diff --git a/config/xmobar/scripts/volume.sh b/config/xmobar/scripts/volume.sh new file mode 100644 index 00000000..4342a564 --- /dev/null +++ b/config/xmobar/scripts/volume.sh @@ -0,0 +1,8 @@ +#!/bin/sh +# Get the maximum volume of any pulseaudio sink channel +# amixer get Master | egrep -o "[0-9]+%" +vol=$(amixer get Master | awk -F'[]%[]' '/%/ {if ($7 == "off") { print "MM" } else { print $2 }}' | head -n 1) + +echo Vol: $vol% + +exit 0 diff --git a/config/xmobar/xmobarrc b/config/xmobar/xmobarrc index 975fe125..a21f5bef 100644 --- a/config/xmobar/xmobarrc +++ b/config/xmobar/xmobarrc @@ -12,7 +12,7 @@ Config { -- layout , sepChar = "%" -- delineator between plugin names and straight text , alignSep = "}{" -- separator between left-right alignment - , template = "%StdinReader% | %battery% | %multicpu% | %memory% }{ %date% | %kbd% %_XMONAD_TRAYPAD%" + , template = "%StdinReader% | %battery% | %multicpu% | %memory% }{ %vol% | %date% | %kbd% %_XMONAD_TRAYPAD%" -- general behavior , lowerOnStart = True -- send to bottom of window stack on start @@ -62,6 +62,8 @@ Config { , "--high" , "darkred" ] 10 + , Run Com "/home/sako/.config/xmobar/scripts/get-volume.sh" [] "vol", + -- cpu core temperature monitor , Run CoreTemp [ "--template" , "Temp: °C|°C" , "--Low" , "70" -- units: °C