aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesús <heckyel@hyperbola.info>2019-04-21 16:02:48 -0500
committerJesús <heckyel@hyperbola.info>2019-04-21 16:02:48 -0500
commitf56d9d68470b7c358ca992d7f4119930415a8067 (patch)
tree35cf88d7f5193faf54d8ffb0170384e872443b77
parenta8c60290bde30c163bb51a9ef6c25eb418f6d7f9 (diff)
downloadi3-config-f56d9d68470b7c358ca992d7f4119930415a8067.tar.lz
i3-config-f56d9d68470b7c358ca992d7f4119930415a8067.tar.xz
i3-config-f56d9d68470b7c358ca992d7f4119930415a8067.zip
fix null null in mediaplayer
-rw-r--r--config2
-rw-r--r--i3blocks.conf1
-rw-r--r--scripts/mprish.sh21
3 files changed, 22 insertions, 2 deletions
diff --git a/config b/config
index 01a6585..cf172c9 100644
--- a/config
+++ b/config
@@ -275,8 +275,6 @@ mode "$mode_system" {
}
bindsym $mod+Pause mode "$mode_system"
-#open audio player
-exec --no-startup-id audacious
#players global horkeys
bindsym XF86AudioPrev exec playerctl previous
bindsym XF86AudioNext exec playerctl next
diff --git a/i3blocks.conf b/i3blocks.conf
index 322767e..fcfcb1a 100644
--- a/i3blocks.conf
+++ b/i3blocks.conf
@@ -40,6 +40,7 @@ markup=none
[mediaplayer]
label=
+command=sh /home/$USER/.config/i3/scripts/mprish.sh
instance=audacious
interval=5
signal=10
diff --git a/scripts/mprish.sh b/scripts/mprish.sh
new file mode 100644
index 0000000..54b78ca
--- /dev/null
+++ b/scripts/mprish.sh
@@ -0,0 +1,21 @@
+#!/bin/bash
+
+# Specifying the icon(s) in the script
+# This allows us to change its appearance conditionally
+
+player_status=$(playerctl status 2> /dev/null)
+if [[ $player_status == "Playing" || $player_status == "Paused" ]]; then
+ metadata="$(playerctl metadata artist) - $(playerctl metadata title)"
+fi
+
+# Foreground color formatting tags are optional
+if [[ $player_status == "Playing" ]]; then
+ # Orange when playing
+ echo "$metadata"
+elif [[ $player_status == "Paused" ]]; then
+ # Greyed out info when paused
+ echo "$metadata"
+else
+ # Greyed out icon when stopped
+ echo ""
+fi