-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcmus-shortcut
executable file
·26 lines (25 loc) · 1.19 KB
/
cmus-shortcut
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/bash
##Simple script to change cmus music over command, for its use as hotkeys
ICO=/home/dmolinao/scripts/parametros/enjuto.jpeg
CMUS_COMMAND="cmus-remote --server /run/user/1000/cmus-socket"
case $1 in
next )
$CMUS_COMMAND -n
#notify-send -t 3 "$(cmus-remote -Q | grep tag | head -n 3 | sort -r | cut -d ' ' -f 3- | head -n 1)" "$(cmus-remote -Q | grep tag | head -n 3 | sort -r | cut -d ' ' -f 3- | tail -n 2)"
#notify-send -i $ICO -t 3 "$(cmus-remote -Q | grep "tag title" | sed 's/tag title //' | awk -F " - " '{print $1}' | sed 's/ (.*)//g' | sed 's/ \[.*\]//g' )" "$(cmus-remote -Q | grep "tag artist" | sed 's/tag artist //')"
;;
back )
$CMUS_COMMAND -r
#notify-send -t 3 "$(cmus-remote -Q | grep tag | head -n 3 | sort -r | cut -d ' ' -f 3- | head -n 1)" "$(cmus-remote -Q | grep tag | head -n 3 | sort -r | cut -d ' ' -f 3- | tail -n 2)"
#notify-send -i $ICO -t 3 "$(cmus-remote -Q | grep "tag title" | sed 's/tag title //' | awk -F " - " '{print $1}' | sed 's/ (.*)//g' | sed 's/ \[.*\]//g' )" "$(cmus-remote -Q | grep "tag artist" | sed 's/tag artist //')"
;;
play )
$CMUS_COMMAND -u
;;
forward)
$CMUS_COMMAND -k +5
;;
backwards)
$CMUS_COMMAND -k -5
;;
esac