xmobar - audio

This commit is contained in:
2024-03-07 20:45:47 +01:00
parent c90ff7fa3e
commit e890e496bd
5 changed files with 37 additions and 21 deletions

View File

@@ -114,10 +114,6 @@
- mit alsa - mit alsa
- Workspaces - Workspaces
## git
- Packete signieren für github
## Nautilus ## Nautilus
- Thumbnailer - Thumbnailer
@@ -132,15 +128,6 @@
- Sperrbild? - Sperrbild?
- Wann sperren -> XMonad - Wann sperren -> XMonad
## XMoBar
- Zur Leiste hinzufügen
- Uhrzeit
- Akku
- Netzwerk
- i3?
- Audio
## Dateien ## Dateien
- Sortieren - Sortieren

View File

@@ -12,5 +12,5 @@
}; };
}; };
home.packages = [ pkgs.xmobar ]; home.packages = with pkgs; [ xmobar maim ];
} }

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

View File

@@ -3,7 +3,7 @@ import Xmobar
config :: Config config :: Config
config = config =
defaultConfig defaultConfig
{ font = "Fira Code" { font = "Fira Code 9"
, position = TopH 30 , position = TopH 30
, borderColor = "#402339" , borderColor = "#402339"
, border = FullB , border = FullB
@@ -13,6 +13,7 @@ config =
, commands = , commands =
[ [
Run $ Com "./scripts/backlight.sh" [] "backlight" 10 Run $ Com "./scripts/backlight.sh" [] "backlight" 10
Run $ Com "./scripts/audio.sh" [] "audio" 10
Run $ Cpu Run $ Cpu
[ [
"--template", "<fc=#a9a1e1><fn=1>\xf085</fn></fc> <total>%" "--template", "<fc=#a9a1e1><fn=1>\xf085</fn></fc> <total>%"
@@ -38,7 +39,7 @@ config =
, "--" , "--"
, "--on", "<fc=#5c0714><fn=1>\xe050</fn>>/fc> <volumestatus>" , "--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 , Run $ DynNetwork
[ [
"-t","<fc=#4db5bd><fn=1>\xf063</fn></fc> <rx> <fc=#c678dd><fn=1>\xf062</fn></fc> <tx>" "-t","<fc=#4db5bd><fn=1>\xf063</fn></fc> <rx> <fc=#c678dd><fn=1>\xf062</fn></fc> <tx>"
@@ -68,7 +69,7 @@ config =
] ]
, sepChar = "%" , sepChar = "%"
, alignSep = "}{" , alignSep = "}{"
, template = "%XMonadLog% }{ %backlight% | %cpu% | %memory% | %battery% | %dynnetwork% | %date% " , template = "%XMonadLog% }{ %audio% | %backlight% | %cpu% | %memory% | %battery% | %dynnetwork% | %date% "
} }
main :: IO () main :: IO ()

View File

@@ -11,6 +11,7 @@ import XMonad.Util.ClickableWorkspaces
import XMonad.Util.Loggers import XMonad.Util.Loggers
import Data.ByteString (maximum) import Data.ByteString (maximum)
import Text.XHtml (gray) import Text.XHtml (gray)
import Distribution.Compat.Prelude (print)
main = xmonad . ewmhFullscreen . ewmh . withEasySB (statusBarProp "xmobar" (pure myXmobarPP)) defToggleStrutsKey $ myconfig main = xmonad . ewmhFullscreen . ewmh . withEasySB (statusBarProp "xmobar" (pure myXmobarPP)) defToggleStrutsKey $ myconfig
@@ -24,14 +25,19 @@ myconfig = def
} }
`additionalKeysP` `additionalKeysP`
[ [
-- System
("M-p", spawn "rofi -show \"drun\"") ("M-p", spawn "rofi -show \"drun\"")
, ("<print>", spawn "maim --format=png \"/home/elias/Pictures/screenshot-$(date -u +'%Y-%m-%d-%H:%M:%S.png')\"")
--Program
, ("M-c", spawn "firefox") , ("M-c", spawn "firefox")
-- Brightness
, ("<XF86MonBrightnessUp>", spawn "xbacklight -inc 10") , ("<XF86MonBrightnessUp>", spawn "xbacklight -inc 10")
, ("<XF86MonBrightnessDown>", spawn "xbacklight -dec 10") , ("<XF86MonBrightnessDown>", spawn "xbacklight -dec 10")
--, ("<XF86AudioMute>", spawn "wpctl set-mute 58 toggle") -- Audio
--, ("<XF86AudioRaiseVolume>", spawn "wpctl set-volume 58 0.05+") , ("<XF86AudioMute>", spawn "pulseaudio-ctl mute")
--, ("<XF86AudioLowerVolume>", spawn "wpctl set-volume 58 0.05-") , ("<XF86AudioRaiseVolume>", spawn "pulseaudio-ctl up 5")
--, ("<XF86AudioMicMute>", spawn "wpctl set-mute 52 toggle") , ("<XF86AudioLowerVolume>", spawn "pulseaudio-ctl down 5")
, ("<XF86AudioMicMute>", spawn "pulseaudio-ctl mute-input")
] ]
`removeKeysP` [] `removeKeysP` []