mirror of
https://github.com/Fluffy-Bean/dots.git
synced 2025-05-22 03:14:54 +00:00
Updated polybar with my own music script
This commit is contained in:
parent
ea4e3a6be9
commit
d8be95b8d2
8 changed files with 31 additions and 32 deletions
20
polybar/scripts/music.sh
Executable file
20
polybar/scripts/music.sh
Executable file
|
@ -0,0 +1,20 @@
|
|||
#!/bin/sh
|
||||
|
||||
player=$(playerctl -p %any,firefox status)
|
||||
title=$(playerctl -p %any,firefox metadata --format '{{ title }}')
|
||||
artist=$(playerctl -p %any,firefox metadata --format '{{ artist }}')
|
||||
|
||||
if [ $player = "Playing" ]
|
||||
then
|
||||
if [ "$title" == "" ]
|
||||
then
|
||||
$title="Unknow title"
|
||||
fi
|
||||
if [ "$artist" == "" ]
|
||||
then
|
||||
$artist = "Unknow artist"
|
||||
fi
|
||||
echo "%{F#151515}%{T2}%{T- F-}%{B#151515}"$title", "$artist"%{B-}%{F#151515}%{T2}%{T- F-}"
|
||||
#else
|
||||
# echo ""
|
||||
fi
|
Loading…
Add table
Add a link
Reference in a new issue