xmobar - restructure and clean sound/music
This commit is contained in:
parent
c0c460f006
commit
286d5cb0ec
Before Width: | Height: | Size: 403 B After Width: | Height: | Size: 403 B |
BIN
config/xmobar/icons/music.xcf
Normal file
BIN
config/xmobar/icons/music.xcf
Normal file
Binary file not shown.
21
config/xmobar/icons/music/pause.xpm
Normal file
21
config/xmobar/icons/music/pause.xpm
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
/* XPM */
|
||||||
|
static char * pause_xpm[] = {
|
||||||
|
"16 16 2 1",
|
||||||
|
" c None",
|
||||||
|
". c #FFFFFF",
|
||||||
|
" ",
|
||||||
|
" ... ",
|
||||||
|
" . . ",
|
||||||
|
" ... ",
|
||||||
|
" . ",
|
||||||
|
" . ",
|
||||||
|
" . . ",
|
||||||
|
" .. .. . . ",
|
||||||
|
" .. .. . . ",
|
||||||
|
" .. .. . . ",
|
||||||
|
" .. .. . .. ",
|
||||||
|
" .. .. ... ",
|
||||||
|
" .. .. .. ",
|
||||||
|
" . ",
|
||||||
|
" . ",
|
||||||
|
" "};
|
21
config/xmobar/icons/music/play.xpm
Normal file
21
config/xmobar/icons/music/play.xpm
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
/* XPM */
|
||||||
|
static char * play_xpm[] = {
|
||||||
|
"16 16 2 1",
|
||||||
|
" c None",
|
||||||
|
". c #FFFFFF",
|
||||||
|
" ",
|
||||||
|
" ... ",
|
||||||
|
" . . ",
|
||||||
|
" ... ",
|
||||||
|
" . ",
|
||||||
|
" . ",
|
||||||
|
" . . . ",
|
||||||
|
" .. . . ",
|
||||||
|
" ... . . ",
|
||||||
|
" .... . . ",
|
||||||
|
" ... . .. ",
|
||||||
|
" .. ... ",
|
||||||
|
" . .. ",
|
||||||
|
" . ",
|
||||||
|
" . ",
|
||||||
|
" "};
|
11
config/xmobar/scripts/quodlibet
Executable file
11
config/xmobar/scripts/quodlibet
Executable file
@ -0,0 +1,11 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
status=$(quodlibet --status | cut -d' ' -f1)
|
||||||
|
case "$status" in
|
||||||
|
"playing") icon="<icon=music/play.xpm/>" ;;
|
||||||
|
"paused") icon="<icon=music/pause.xpm/>" ;;
|
||||||
|
*) ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
echo '<action=`quodlibet --toggle-window`>'"$icon"'</action>'
|
||||||
|
|
@ -1,17 +1,19 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
sound="mute"
|
||||||
|
|
||||||
if grep -q "\[on\]" <(amixer get Master); then
|
if grep -q "\[on\]" <(amixer get Master); then
|
||||||
current="$(amixer get Master | sed -n '/%/s/.*\[\(.*\)%\].*/\1/p' | head -1)"
|
current="$(amixer get Master | sed -n '/%/s/.*\[\(.*\)%\].*/\1/p' | head -1)"
|
||||||
if (( current <= 25 )); then
|
if (( current <= 25 )); then
|
||||||
echo "none"
|
sound="none"
|
||||||
elif (( current <= 50 )); then
|
elif (( current <= 50 )); then
|
||||||
echo "low"
|
sound="low"
|
||||||
elif (( current <= 75 )); then
|
elif (( current <= 75 )); then
|
||||||
echo "medium"
|
sound="medium"
|
||||||
else
|
else
|
||||||
echo "high"
|
sound="high"
|
||||||
fi
|
fi
|
||||||
else
|
|
||||||
echo "mute"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
echo "<icon=sound/$sound.xpm/>"
|
||||||
|
|
@ -1,8 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
status=$(quodlibet --status | cut -d' ' -f1)
|
|
||||||
case "$status" in
|
|
||||||
"playing") quodlibet --print-playing "<title~album>" ;;
|
|
||||||
*) ;;
|
|
||||||
esac
|
|
||||||
|
|
6
xmobarrc
6
xmobarrc
@ -50,9 +50,9 @@ Config { font = "xft:Source Code Pro:size=9"
|
|||||||
, "--load-icon-patterns", "<icon=cpu/%%.xpm/>"
|
, "--load-icon-patterns", "<icon=cpu/%%.xpm/>"
|
||||||
, "--load-icon-patterns", "<icon=cpu4/%%.xpm/>"
|
, "--load-icon-patterns", "<icon=cpu4/%%.xpm/>"
|
||||||
] 50
|
] 50
|
||||||
, Run Com "quodinfo" [] "quodlibet" 10
|
, Run Com ".config/xmobar/scripts/quodlibet" [] "quodlibet" 10
|
||||||
, Run Com "soundinfo" [] "sound" 10
|
, Run Com ".config/xmobar/scripts/sound" [] "sound" 10
|
||||||
, Run StdinReader
|
, Run StdinReader
|
||||||
]
|
]
|
||||||
, template = " %StdinReader%} %date% {<action=`quodlibet --toggle-window`>%quodlibet%</action> %multicpu%<icon=sound/%sound%.xpm/>%wlp7s0wi%%enp9s0%%bright%%battery% "
|
, template = " %StdinReader%} %date% {%multicpu%%quodlibet%%sound%%wlp7s0wi%%enp9s0%%bright%%battery% "
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user