Skip to content

Instantly share code, notes, and snippets.

@Victor-Arruda
Last active July 8, 2024 10:02
Show Gist options
  • Save Victor-Arruda/474ccde8c64ffc0e776b2b59261c8ad5 to your computer and use it in GitHub Desktop.
Save Victor-Arruda/474ccde8c64ffc0e776b2b59261c8ad5 to your computer and use it in GitHub Desktop.
Polybar music player
// modules.conf
[module/sn]
type = custom/text
content = "  "
tail = true
format = <label>
content-background = ${colors.background}
click-left = playerctl next
[module/sp]
type = custom/text
content = "  "
content-background = ${colors.background}
click-left = playerctl previous
[module/spp]
type = custom/script
interval = 0
exec = $HOME/.config/polybar/mc //script below
format = <label>
format-background = ${colors.background}
click-left = playerctl play-pause
[module/sps]
type = custom/text
content = "  "
format = <label>
content-background = ${colors.background}
// script for spp (use chmod +x on the file)
#!/bin/bash
if [[ $(playerctl status) == 'Playing' ]];
then
echo '  '
else
echo '  '
fi
then just call the modules names where you want
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment