Replacing deprecated IPC hooks with IPC actions
This commit is contained in:
parent
083d014bd3
commit
e8a3eb74d4
@ -9,12 +9,9 @@ killall -q polybar
|
||||
while pgrep -u $UID -x polybar >/dev/null; do sleep 1; done
|
||||
|
||||
for m in $(polybar --list-monitors | cut -d":" -f1); do
|
||||
MONITOR=$m polybar top -c ~/.config/polybar/config-top.ini > top.log &
|
||||
MONITOR=$m polybar bottom -c ~/.config/polybar/config-bottom.ini > bottom.log &
|
||||
MONITOR=$m polybar top -c ~/.config/polybar/config-top.ini > ~/.config/polybar/top.log &
|
||||
MONITOR=$m polybar bottom -c ~/.config/polybar/config-bottom.ini > ~/config/polybar/bottom.log &
|
||||
done
|
||||
|
||||
exit 0
|
||||
|
||||
# Launch bar1 and bar2
|
||||
#polybar top -c ~/.config/polybar/config-top.ini &
|
||||
#polybar bottom -c ~/.config/polybar/config-bottom.ini &
|
||||
|
||||
0
polybar/scripts/mopidy.sh
Normal file → Executable file
0
polybar/scripts/mopidy.sh
Normal file → Executable file
@ -58,18 +58,21 @@ def event_handler(*args, **kwargs):
|
||||
"""arg[1] contains metadata"""
|
||||
"""arg[1][1] contains PlaybackStatus"""
|
||||
data = unwrap(args)
|
||||
if 'spotify' in data[1]['Metadata']['mpris:trackid']:
|
||||
#if 'spotify' in data[1]['Metadata']['mpris:trackid']:
|
||||
if 'PlaybackStatus' in data[1]:
|
||||
if data[1]['PlaybackStatus'] == "Playing":
|
||||
print("Music is playing")
|
||||
system("polybar-msg hook playpause 2")
|
||||
""" Send IPC hook 2 to all bars for module playpause """
|
||||
#system("polybar-msg hook playpause 2")
|
||||
system("polybar-msg action '#playpause.hook.1'")
|
||||
if data[1]['PlaybackStatus'] == "Paused":
|
||||
print("Music is paused.")
|
||||
""" Send IPC hook 3 to all bars module playpause """
|
||||
system("polybar-msg hook playpause 3")
|
||||
#system("polybar-msg hook playpause 3")
|
||||
system("polybar-msg action '#playpause.hook.2'")
|
||||
""" Send IPC hook 2 to all bars for module spotify """
|
||||
system("polybar-msg hook spotify 2")
|
||||
#system("polybar-msg action spotify 2")
|
||||
#system("polybar-msg hook spotify 2")
|
||||
system("polybar-msg action '#spotify.hook.1'")
|
||||
|
||||
def unwrap(val):
|
||||
if isinstance(val, dbus.ByteArray):
|
||||
|
||||
BIN
polybar/wallpapers/bg-default.png
Normal file
BIN
polybar/wallpapers/bg-default.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 57 KiB |
BIN
polybar/wallpapers/bg-secondary.jpg
Normal file
BIN
polybar/wallpapers/bg-secondary.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 164 KiB |
Loading…
x
Reference in New Issue
Block a user