Use py3-cmd to update bar
This commit is contained in:
10
i3/config
10
i3/config
@@ -265,9 +265,13 @@ bindsym $mod+F9 exec --no-startup-id evolution
|
|||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
bindsym XF86Sleep exec --no-startup-id $scriptdir/i3exit suspend
|
bindsym XF86Sleep exec --no-startup-id $scriptdir/i3exit suspend
|
||||||
bindsym XF86AudioMute exec --no-startup-id amixer set Master toggle ; exec --no-startup-id $update-status
|
bindsym XF86AudioMute exec --no-startup-id $scriptdir/pa-volume mute-toggle
|
||||||
bindsym XF86AudioRaiseVolume exec --no-startup-id $scriptdir/pa-volume set-vol +5 ; exec --no-startup-id $scriptdir/update-status
|
bindsym XF86AudioRaiseVolume exec --no-startup-id $scriptdir/pa-volume set-vol +3
|
||||||
bindsym XF86AudioLowerVolume exec --no-startup-id $scriptdir/pa-volume set-vol -5 ; exec --no-startup-id $scriptdir/update-status
|
bindsym XF86AudioLowerVolume exec --no-startup-id $scriptdir/pa-volume set-vol -3
|
||||||
|
|
||||||
|
bindsym XF86AudioPlay exec dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause
|
||||||
|
bindsym XF86AudioNext exec dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Next
|
||||||
|
bindsym XF86AudioPrev exec dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Previous
|
||||||
|
|
||||||
# keys seemingly switched
|
# keys seemingly switched
|
||||||
bindsym XF86MonBrightnessUp exec --no-startup-id xbacklight -dec 5 ; exec --no-startup-id $scriptdir/update-status
|
bindsym XF86MonBrightnessUp exec --no-startup-id xbacklight -dec 5 ; exec --no-startup-id $scriptdir/update-status
|
||||||
|
|||||||
9
i3/scripts/bar-update
Executable file
9
i3/scripts/bar-update
Executable file
@@ -0,0 +1,9 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
if [[ "$1" ]] ; then
|
||||||
|
modules="$1"
|
||||||
|
else
|
||||||
|
modules=all
|
||||||
|
fi
|
||||||
|
|
||||||
|
py3-cmd refresh "$modules"
|
||||||
@@ -75,6 +75,10 @@ usage() {
|
|||||||
echo "$0 set-vol VOL_PERC"
|
echo "$0 set-vol VOL_PERC"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
update_status_bar() {
|
||||||
|
~/.i3/scripts/bar-update volume_status
|
||||||
|
}
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
"get-vol")
|
"get-vol")
|
||||||
echo $(getvol)
|
echo $(getvol)
|
||||||
@@ -85,19 +89,19 @@ case "$1" in
|
|||||||
else
|
else
|
||||||
setvol "$2"
|
setvol "$2"
|
||||||
fi
|
fi
|
||||||
hook="$3"
|
update_status_bar
|
||||||
;;
|
;;
|
||||||
"mute")
|
"mute")
|
||||||
mute
|
mute
|
||||||
hook="$2"
|
update_status_bar
|
||||||
;;
|
;;
|
||||||
"unmute")
|
"unmute")
|
||||||
unmute
|
unmute
|
||||||
hook="$2"
|
update_status_bar
|
||||||
;;
|
;;
|
||||||
"mute-toggle")
|
"mute-toggle")
|
||||||
mute-toggle
|
mute-toggle
|
||||||
hook="$2"
|
update_status_bar
|
||||||
;;
|
;;
|
||||||
"is-muted")
|
"is-muted")
|
||||||
echo $(ismuted)
|
echo $(ismuted)
|
||||||
@@ -109,8 +113,3 @@ case "$1" in
|
|||||||
usage
|
usage
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
if [[ -n "$hook" ]] ; then
|
|
||||||
echo "volume changed, executing hook: $hook"
|
|
||||||
$hook
|
|
||||||
fi
|
|
||||||
|
|||||||
Reference in New Issue
Block a user