aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xcmusShow.sh28
1 files changed, 24 insertions, 4 deletions
diff --git a/cmusShow.sh b/cmusShow.sh
index 8a5c576..8e36b3b 100755
--- a/cmusShow.sh
+++ b/cmusShow.sh
@@ -7,6 +7,7 @@ scriptName="${0##*/}"
notificationFreq=0.1
steps=20
+bluetoothInfo=''
getCmusInfo() {
cmus-remote -Q | grep "^${1} " | cut -d' ' -f "${2}-"
@@ -19,14 +20,33 @@ sToTime() {
echo "${min}:${s}"
}
+if bluetoothctl info; then
+ device="πŸ“» $(bluetoothctl info |
+ grep 'Name: ' |
+ cut -d' ' -f '2-')"
+ battery="$(bluetoothctl info |
+ grep 'Battery Percentage:' |
+ grep -o '(.*)' |
+ grep -o '[0-9]*')% πŸ”‹"
+ bluetoothInfo="\n${device} - ${battery}"
+fi
+
+
i=0
while [ "$i" -lt "$steps" ]; do
- artist="$(getCmusInfo 'tag artist' '3')"
- album="$(getCmusInfo 'tag album' '3')"
- title="$(getCmusInfo 'tag title' '3')"
+
+ playingIcon=''
+ [ "$(getCmusInfo 'status' 2)" = 'playing' ] && playingIcon='▢️'
+ [ "$(getCmusInfo 'status' 2)" = 'paused' ] && playingIcon='⏸️'
+
+ title="🎢 $(getCmusInfo 'tag title' '3') 🎢"
+ artist="πŸ§‘β€πŸŽ€ $(getCmusInfo 'tag artist' '3')"
+ album="$(getCmusInfo 'tag album' '3') πŸ’½"
position="$(getCmusInfo 'position' '2')"
duration="$(getCmusInfo 'duration' '2')"
- dunstify -r "$(dunstifyIDs.sh cmusShow)" -t 250 "${title}" "${artist} - ${album}\n$(sToTime "${position}") - $(sToTime "${duration}")"
+
+ dunstify -r "$(dunstifyIDs.sh cmusShow)" -t 250 "${title}" "${artist} - ${album}\n${playingIcon} $(sToTime "${position}") - $(sToTime "${duration}")${bluetoothInfo}"
+
sleep "$notificationFreq"
i=$((i+1))
done