diff options
| author | Xander Swan <email> | 2025-12-03 10:00:41 -0500 |
|---|---|---|
| committer | Xander Swan <email> | 2025-12-03 10:00:41 -0500 |
| commit | 9c504cd8639c82d476c2af41796743185ffd706a (patch) | |
| tree | dca0f9f7c5347b7f0798b13d99b1b0df4d9a4ef0 /.config/i3/music.lua | |
| parent | ceb1360704f390862eecbd405d3837f9c42f1baa (diff) | |
Add i3
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 |
