aboutsummaryrefslogtreecommitdiff
path: root/.local/bin
diff options
context:
space:
mode:
authoriamcheeseman <[email protected]>2026-03-04 10:18:06 -0500
committeriamcheeseman <[email protected]>2026-03-04 10:18:06 -0500
commitc7167e481507435dc2354f2155720573053cfc79 (patch)
treeb9823064cbb6b914a241fb87f2bc155194755095 /.local/bin
parentdea74983f6d1581c782b0caa21009fd8474295ec (diff)
add media notifications
Diffstat (limited to '.local/bin')
-rwxr-xr-x.local/bin/media_notif.sh8
-rwxr-xr-x.local/bin/tsarbar_status.sh7
2 files changed, 14 insertions, 1 deletions
diff --git a/.local/bin/media_notif.sh b/.local/bin/media_notif.sh
new file mode 100755
index 0000000..8bc3764
--- /dev/null
+++ b/.local/bin/media_notif.sh
@@ -0,0 +1,8 @@
+playerctl -F metadata -f "{{lc(title)}} - {{lc(artist)}}" \
+| while read -r line; do
+ sleep 1
+ md=`playerctl metadata | grep "mpris:artUrl"`
+ arturl=`echo $md | awk -v FS="file://" '{print $2}'`
+ echo $arturl
+ notify-send -u low -a "media" -i "$arturl" "$line"
+done
diff --git a/.local/bin/tsarbar_status.sh b/.local/bin/tsarbar_status.sh
index ec18150..1fdda43 100755
--- a/.local/bin/tsarbar_status.sh
+++ b/.local/bin/tsarbar_status.sh
@@ -25,6 +25,11 @@ tsarc layout \
-center window \
-right ram ~ vol ~ clock
+trim() {
+ read -r text
+ echo "$text" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//'
+}
+
workspace() {
focused_ws=`bspc query -D --names -d focused`
ws=`bspc query -D --names | tr '\n' ' '`
@@ -75,7 +80,7 @@ playerctl -F metadata -f "{{lc(status)}} {{lc(title)}} - {{lc(artist)}}" \
esac
case "$status" in "playing")
tsarc set player -text \
- "`echo $line | awk 'match($0, $1) {print substr($0, RSTART+RLENGTH)}' | xargs`"
+ "`echo $line | awk 'match($0, $1) {print substr($0, RSTART+RLENGTH)}' | trim`"
esac
done &