xmobar - restructure and clean sound/music

This commit is contained in:
Felix Van der Jeugt 2015-03-23 23:15:26 +01:00
parent c0c460f006
commit 286d5cb0ec
91 changed files with 64 additions and 17 deletions

View File

Before

Width:  |  Height:  |  Size: 403 B

After

Width:  |  Height:  |  Size: 403 B

Binary file not shown.

View File

@ -0,0 +1,21 @@
/* XPM */
static char * pause_xpm[] = {
"16 16 2 1",
" c None",
". c #FFFFFF",
" ",
" ... ",
" . . ",
" ... ",
" . ",
" . ",
" . . ",
" .. .. . . ",
" .. .. . . ",
" .. .. . . ",
" .. .. . .. ",
" .. .. ... ",
" .. .. .. ",
" . ",
" . ",
" "};

View 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
View 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>'

View File

@ -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/>"

View File

@ -1,8 +0,0 @@
#!/bin/bash
status=$(quodlibet --status | cut -d' ' -f1)
case "$status" in
"playing") quodlibet --print-playing "<title~album>" ;;
*) ;;
esac

View File

@ -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% "
} }