Compare commits
2 Commits
083d014bd3
...
934775ea9d
| Author | SHA1 | Date | |
|---|---|---|---|
| 934775ea9d | |||
| 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):
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user