xmobar - audio
This commit is contained in:
22
home/programs/xmonad/src/xmobar/scripts/audio.sh
Executable file
22
home/programs/xmonad/src/xmobar/scripts/audio.sh
Executable file
@@ -0,0 +1,22 @@
|
||||
Status=$(pulseaudio-ctl full-status)
|
||||
Volume=$(cut -d ' ' -f 1 <<<$Status)
|
||||
Mute=$(cut -d ' ' -f 2 <<<$Status)
|
||||
Microphone=$(cut -d ' ' -f 3 <<<$Status)
|
||||
|
||||
if [[ $Mute == "yes" ]]; then
|
||||
Symbol="\xe04f"
|
||||
else
|
||||
if [[ $Volume -le 50 ]]; then
|
||||
Symbol="\xe04d"
|
||||
else
|
||||
Symbol="\xe050"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ $Microphone == *"yes"* ]]; then
|
||||
MicOut="\xe02b"
|
||||
else
|
||||
MicOut="\xe029"
|
||||
fi
|
||||
|
||||
echo "<fc=#db4d65><fn=1>$Symbol</fn></fc> $Volume% <fc=#db4d65><fn=1>$MicOut</fn></fc>"
|
||||
@@ -3,7 +3,7 @@ import Xmobar
|
||||
config :: Config
|
||||
config =
|
||||
defaultConfig
|
||||
{ font = "Fira Code"
|
||||
{ font = "Fira Code 9"
|
||||
, position = TopH 30
|
||||
, borderColor = "#402339"
|
||||
, border = FullB
|
||||
@@ -13,6 +13,7 @@ config =
|
||||
, commands =
|
||||
[
|
||||
Run $ Com "./scripts/backlight.sh" [] "backlight" 10
|
||||
Run $ Com "./scripts/audio.sh" [] "audio" 10
|
||||
Run $ Cpu
|
||||
[
|
||||
"--template", "<fc=#a9a1e1><fn=1>\xf085</fn></fc> <total>%"
|
||||
@@ -38,7 +39,7 @@ config =
|
||||
, "--"
|
||||
, "--on", "<fc=#5c0714><fn=1>\xe050</fn>>/fc> <volumestatus>"
|
||||
]
|
||||
, Run $ Date "<fc=#ECBE7B><fn=1>\xf017</fn></fc> %d.%m.%y %H:%M" "date" 300
|
||||
, Run $ Date "<fc=#ECBE7B><fn=1>\xf017</fn></fc> %a %d.%m.%y %H:%M" "date" 300
|
||||
, Run $ DynNetwork
|
||||
[
|
||||
"-t","<fc=#4db5bd><fn=1>\xf063</fn></fc> <rx> <fc=#c678dd><fn=1>\xf062</fn></fc> <tx>"
|
||||
@@ -68,7 +69,7 @@ config =
|
||||
]
|
||||
, sepChar = "%"
|
||||
, alignSep = "}{"
|
||||
, template = "%XMonadLog% }{ %backlight% | %cpu% | %memory% | %battery% | %dynnetwork% | %date% "
|
||||
, template = "%XMonadLog% }{ %audio% | %backlight% | %cpu% | %memory% | %battery% | %dynnetwork% | %date% "
|
||||
}
|
||||
|
||||
main :: IO ()
|
||||
|
||||
Reference in New Issue
Block a user