diff options
Diffstat (limited to '.config/i3/music.lua')
| -rw-r--r-- | .config/i3/music.lua | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/.config/i3/music.lua b/.config/i3/music.lua new file mode 100644 index 0000000..1960f9b --- /dev/null +++ b/.config/i3/music.lua @@ -0,0 +1,18 @@ +local shell_utils = require("shellutils") + +local status = shell_utils.get_output("playerctl status") +local song = shell_utils.get_output("playerctl metadata title") +local artist = shell_utils.get_output("playerctl metadata artist") +local album = shell_utils.get_output("playerctl metadata album") + +if #album ~= 0 then + album = ("from %s "):format(album) +end + +if status == "Playing" then + print((" Playing | %s by %s %s"):format(song, artist, album)) +elseif status == "Paused" then + print((" Paused | %s by %s %s"):format(song, artist, album)) +else + print((" Stopped "):format(status)) +end
\ No newline at end of file |
