Media Playing Module with Buttons
- Replace clicks and scroll actions with dedicated buttons for media playing module - Add media-playing-change module to display current media source and left-click to change - Add media-playing-prev/next to play previous or next track - Add media-playing-play-pause to display pause button when media is playing and play button when media is paused - Update media-playing to use Zscroll to scroll through artist and title text when over limit - Add some extra helper scripts
This commit is contained in:
19
polybar/scripts/get-media-info.sh
Executable file
19
polybar/scripts/get-media-info.sh
Executable file
@@ -0,0 +1,19 @@
|
||||
#!/bin/bash
|
||||
mediaStatus=$(playerctl --player=playerctld metadata 2>&1)
|
||||
|
||||
if [[ "$mediaStatus" == "No player could handle this command" ]]; then
|
||||
echo " N/A"
|
||||
else
|
||||
artist=$(playerctl --player=playerctld metadata --format '{{ artist }}')
|
||||
title=$(playerctl --player=playerctld metadata --format '{{ title }}')
|
||||
|
||||
if [[ $artist == "" ]]; then
|
||||
artist="N/A"
|
||||
fi
|
||||
|
||||
if [[ $title == "" ]]; then
|
||||
title="N/A"
|
||||
fi
|
||||
|
||||
echo "$title - $artist"
|
||||
fi
|
Reference in New Issue
Block a user