xmobar - add quodlibet info/toggle and sound icon
This commit is contained in:
parent
7bf50613a3
commit
ce22e48484
8
local/bin/quodinfo
Executable file
8
local/bin/quodinfo
Executable file
@ -0,0 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
status=$(quodlibet --status | cut -d' ' -f1)
|
||||
case "$status" in
|
||||
"playing") quodlibet --print-playing "<title~album>" ;;
|
||||
*) ;;
|
||||
esac
|
||||
|
17
local/bin/soundinfo
Executable file
17
local/bin/soundinfo
Executable file
@ -0,0 +1,17 @@
|
||||
#!/bin/bash
|
||||
|
||||
if grep -q "\[on\]" <(amixer get Master); then
|
||||
current="$(amixer get Master | sed -n '/%/s/.*\[\(.*\)%\].*/\1/p' | head -1)"
|
||||
if (( current <= 25 )); then
|
||||
echo "none"
|
||||
elif (( current <= 50 )); then
|
||||
echo "low"
|
||||
elif (( current <= 75 )); then
|
||||
echo "medium"
|
||||
else
|
||||
echo "high"
|
||||
fi
|
||||
else
|
||||
echo "mute"
|
||||
fi
|
||||
|
BIN
xmobar/icons/sound.xcf
Normal file
BIN
xmobar/icons/sound.xcf
Normal file
Binary file not shown.
21
xmobar/icons/sound/high.xpm
Normal file
21
xmobar/icons/sound/high.xpm
Normal file
@ -0,0 +1,21 @@
|
||||
/* XPM */
|
||||
static char * high_xpm[] = {
|
||||
"16 16 2 1",
|
||||
" c None",
|
||||
". c #FFFFFF",
|
||||
" ",
|
||||
" ",
|
||||
" ",
|
||||
" . . ",
|
||||
" .. . . ",
|
||||
" ... . . . ",
|
||||
" ..... . . . ",
|
||||
" ..... . . . ",
|
||||
" ..... . . . ",
|
||||
" ..... . . . ",
|
||||
" ... . . . ",
|
||||
" .. . . ",
|
||||
" . . ",
|
||||
" ",
|
||||
" ",
|
||||
" "};
|
21
xmobar/icons/sound/low.xpm
Normal file
21
xmobar/icons/sound/low.xpm
Normal file
@ -0,0 +1,21 @@
|
||||
/* XPM */
|
||||
static char * low_xpm[] = {
|
||||
"16 16 2 1",
|
||||
" c None",
|
||||
". c #FFFFFF",
|
||||
" ",
|
||||
" ",
|
||||
" ",
|
||||
" . ",
|
||||
" .. ",
|
||||
" ... . ",
|
||||
" ..... . ",
|
||||
" ..... . ",
|
||||
" ..... . ",
|
||||
" ..... . ",
|
||||
" ... . ",
|
||||
" .. ",
|
||||
" . ",
|
||||
" ",
|
||||
" ",
|
||||
" "};
|
21
xmobar/icons/sound/medium.xpm
Normal file
21
xmobar/icons/sound/medium.xpm
Normal file
@ -0,0 +1,21 @@
|
||||
/* XPM */
|
||||
static char * medium_xpm[] = {
|
||||
"16 16 2 1",
|
||||
" c None",
|
||||
". c #FFFFFF",
|
||||
" ",
|
||||
" ",
|
||||
" ",
|
||||
" . ",
|
||||
" .. . ",
|
||||
" ... . . ",
|
||||
" ..... . . ",
|
||||
" ..... . . ",
|
||||
" ..... . . ",
|
||||
" ..... . . ",
|
||||
" ... . . ",
|
||||
" .. . ",
|
||||
" . ",
|
||||
" ",
|
||||
" ",
|
||||
" "};
|
21
xmobar/icons/sound/mute.xpm
Normal file
21
xmobar/icons/sound/mute.xpm
Normal file
@ -0,0 +1,21 @@
|
||||
/* XPM */
|
||||
static char * mute_xpm[] = {
|
||||
"16 16 2 1",
|
||||
" c None",
|
||||
". c #FFFFFF",
|
||||
" ",
|
||||
" ",
|
||||
" ",
|
||||
" . ",
|
||||
" .. ",
|
||||
" ... ",
|
||||
" ..... . . ",
|
||||
" ..... .. ",
|
||||
" ..... .. ",
|
||||
" ..... . . ",
|
||||
" ... ",
|
||||
" .. ",
|
||||
" . ",
|
||||
" ",
|
||||
" ",
|
||||
" "};
|
21
xmobar/icons/sound/none.xpm
Normal file
21
xmobar/icons/sound/none.xpm
Normal file
@ -0,0 +1,21 @@
|
||||
/* XPM */
|
||||
static char * none_xpm[] = {
|
||||
"16 16 2 1",
|
||||
" c None",
|
||||
". c #FFFFFF",
|
||||
" ",
|
||||
" ",
|
||||
" ",
|
||||
" . ",
|
||||
" .. ",
|
||||
" ... ",
|
||||
" ..... ",
|
||||
" ..... ",
|
||||
" ..... ",
|
||||
" ..... ",
|
||||
" ... ",
|
||||
" .. ",
|
||||
" . ",
|
||||
" ",
|
||||
" ",
|
||||
" "};
|
5
xmobarrc
5
xmobarrc
@ -2,6 +2,7 @@
|
||||
Config { font = "xft:Source Code Pro:size=9"
|
||||
, iconRoot = ".config/xmobar/icons"
|
||||
, commands = [ Run Date "%B, %a %0d, %l:%M" "date" 10
|
||||
--, Run Mpris2 "org.mpris.quodlibet" [] 100
|
||||
, Run Battery
|
||||
[ "-t", "<leftipat>"
|
||||
, "--"
|
||||
@ -32,7 +33,9 @@ Config { font = "xft:Source Code Pro:size=9"
|
||||
, "--load-icon-patterns", "<icon=cpu/%%.xpm/>"
|
||||
, "--load-icon-patterns", "<icon=cpu4/%%.xpm/>"
|
||||
] 50
|
||||
, Run Com "quodinfo" [] "quodlibet" 10
|
||||
, Run Com "soundinfo" [] "sound" 10
|
||||
, Run StdinReader
|
||||
]
|
||||
, template = " %StdinReader% } %date% { %multicpu% %wlp7s0wi%%enp9s0%%bright%%battery% "
|
||||
, template = " %StdinReader%} %date% {<action=`quodlibet --toggle-window`>%quodlibet%</action> %multicpu% <icon=sound/%sound%.xpm/> %wlp7s0wi% %enp9s0% %bright% %battery% "
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user