Added some vim-go funcs and added a little sound utility script

This commit is contained in:
TuDatTr
2020-01-29 23:12:54 +01:00
parent 737e6e1374
commit 978482a94c
5 changed files with 38 additions and 15 deletions

View File

@@ -133,9 +133,9 @@ bindsym XF86MonBrightnessUp exec "xbacklight -inc 10; a=$(xbacklight | cut -d\.
bindsym XF86MonBrightnessDown exec "xbacklight -dec 10; a=$(xbacklight | cut -d\. -f1)%; dunstify -r 1 'brightness down'\ \($a\)"
# Pulse Audio controls
bindsym XF86AudioLowerVolume exec --no-startup-id "pactl set-sink-volume $(pactl info | grep 'Default Sink' | cut -d' ' -f3) -5%; b=$(amixer sget Master | grep -o \[0-9\]\\+% -m 1); dunstify -r 2 'sound down'\ \($b\)"
bindsym XF86AudioRaiseVolume exec --no-startup-id "pactl set-sink-volume $(pactl info | grep 'Default Sink' | cut -d' ' -f3) +5%; b=$(amixer sget Master | grep -o \[0-9\]\\+% -m 1); dunstify -r 2 'sound up'\ \($b\)"
bindsym XF86AudioMute exec --no-startup-id "pactl set-sink-mute $(pactl info | grep 'Default Sink' | cut -d' ' -f3) toggle; dunstify -r 2 'sound muted'"
bindsym XF86AudioLowerVolume exec --no-startup-id ~/.scripts/sound.sh down
bindsym XF86AudioRaiseVolume exec --no-startup-id ~/.scripts/sound.sh up
bindsym XF86AudioMute exec --no-startup-id ~/.scripts/sound.sh toggle
bindsym XF86AudioPlay exec "playerctl play-pause; cmus-remote -u"
bindsym XF86AudioStop exec "playerctl stop; cmus-remote -s"
bindsym XF86AudioNext exec "playerctl next; cmus-remote -n"

View File

@@ -7,6 +7,6 @@ l:/home/tuan/Local
c:/home/tuan/Documents/CTF/picoCTF
t:/home/tuan/Templates
w:/home/tuan/workspace_l/Projects
k:/home/tuan/Documents/Fachschaft/Berufungskomission
k:/home/tuan/Documents/Protokolle/FSE
q:/home/tuan/.nextcloud/Quick Drop
':/home/tuan
':/home/tuan/.scripts

24
config/.scripts/sound.sh Executable file
View File

@@ -0,0 +1,24 @@
#!/bin/sh
defaultsink=$(pactl info | grep 'Default Sink' | cut -d' ' -f3);
curVolume=$(amixer get Master | grep -o \[0-9\]\\+% -m 1);
case $1 in
"up"*)
pactl set-sink-volume $defaultsink +5%;
dunstify -r 2 'sound up'\ \($curVolume\);
;;
"down"*)
pactl set-sink-volume $defaultsink -5%;
dunstify -r 2 'sound up'\ \($curVolume\);
;;
"toggle"*)
msg='muted';
if amixer get Master | grep -q off; then
msg='unmuted';
fi
pactl set-sink-mute $defaultsink toggle;
dunstify -r 2 'sound'\ $msg;
echo $msg
;;
esac