xmobar & xmonad optimierung

This commit is contained in:
2024-03-07 18:48:50 +01:00
parent ccf04eae11
commit c90ff7fa3e
7 changed files with 164 additions and 88 deletions

View File

@@ -65,7 +65,7 @@
isNormalUser = true; isNormalUser = true;
home = "/home/elias"; home = "/home/elias";
shell = pkgs.zsh; shell = pkgs.zsh;
extraGroups = [ "wheel" "networkmanager" ]; extraGroups = [ "wheel" "networkmanager" "audio" "video" ];
hashedPassword = hashedPassword =
"$6$pdAJt1f0v7Zb13Ri$1WpKrErAp5JCb7eXs7EeeWYRMBLu5/WKDdMyGzJyYQDijG2NiywUXpAkl/8p1noxOOqYbb.MTw7JmTzhWGsT21"; "$6$pdAJt1f0v7Zb13Ri$1WpKrErAp5JCb7eXs7EeeWYRMBLu5/WKDdMyGzJyYQDijG2NiywUXpAkl/8p1noxOOqYbb.MTw7JmTzhWGsT21";
}; };
@@ -82,6 +82,8 @@
dmenu dmenu
acpilight # For setting Backlight. acpilight # For setting Backlight.
pulseaudio
pulseaudio-ctl
gnome.nautilus gnome.nautilus
lxqt.lxqt-policykit # provides a default authentication client for policykit lxqt.lxqt-policykit # provides a default authentication client for policykit
@@ -106,15 +108,10 @@
programs.zsh.enable = true; programs.zsh.enable = true;
# Audio # Audio
# rtkit is optional but recommended sound.enable = true;
security.rtkit.enable = true; hardware.pulseaudio.enable = true;
services.pipewire = { hardware.pulseaudio.support32Bit =
enable = true; true; # # If compatibility with 32-bit applications is desired.
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
jack.enable = true;
};
# Set stateVersion. Leave it as set. # Set stateVersion. Leave it as set.
system.stateVersion = "23.11"; system.stateVersion = "23.11";

View File

@@ -16,12 +16,7 @@
## Audio ## Audio
- ??? - alsa
## Planify
- Installieren
- Sync
## Lockscreen ## Lockscreen
@@ -40,11 +35,6 @@
- Installieren - Installieren
- Spiele - Spiele
## Element
- Installieren
- Matrix connecten
## Spotify ## Spotify
- Installieren? - Installieren?
@@ -121,6 +111,7 @@
- Hotkeys einrichten - Hotkeys einrichten
- i3 - i3
- mit alsa
- Workspaces - Workspaces
## git ## git
@@ -148,6 +139,7 @@
- Akku - Akku
- Netzwerk - Netzwerk
- i3? - i3?
- Audio
## Dateien ## Dateien

16
home/extras/images.nix Normal file
View File

@@ -0,0 +1,16 @@
{ ... }:
{
login = builtins.fetchurl {
url =
"https://github.com/zhichaoh/catppuccin-wallpapers/blob/main/minimalistic/unicat.png?raw=true";
sha256 = "1pa0mlnzna96d0gkrc9yphg11vmjdxvk5vyj8h5jq4ngsm20p6cy";
};
lock = builtins.fetchurl {
url =
"https://github.com/zhichaoh/catppuccin-wallpapers/blob/main/landscapes/yosemite.png?raw=true";
sha256 = "0zyphcvh6dxbq997h716lcr2kpilp4jid9hp2sdjphpxpf824nck";
};
}

View File

@@ -0,0 +1,2 @@
Out=$(xbacklight -get)
echo "<fc=#dbb302><fn=1>\xe3aa</fn></fc> $Out%"

View File

@@ -5,56 +5,70 @@ config =
defaultConfig defaultConfig
{ font = "Fira Code" { font = "Fira Code"
, position = TopH 30 , position = TopH 30
, borderColor = "#1e2030" , borderColor = "#402339"
, border = FullB , border = FullB
, borderWidth = 3 , borderWidth = 2
, bgColor = "#24273a" , bgColor = "#381f32"
, fgColor = "#cad3f5" , fgColor = "#a8dfe3"
, commands = [ Run $ Cpu [ "--template", "<fc=#a9a1e1><fn=1>\xf085</fn></fc> <total>%" , commands =
, "--Low","3" [
, "--High","50" Run $ Com "./scripts/backlight.sh" [] "backlight" 10
, "--low","#bbc2cf" Run $ Cpu
, "--normal","#bbc2cf" [
, "--high","#fb4934"] 50 "--template", "<fc=#a9a1e1><fn=1>\xf085</fn></fc> <total>%"
, Run $ Memory ["-t","<fc=#51afef><fn=1>\xF2DB</fn></fc> <usedratio>%" , "--Low","3"
,"-H","80" , "--High","50"
,"-L","10" , "--low","#bbc2cf"
,"-l","#bbc2cf" , "--normal","#bbc2cf"
,"-n","#bbc2cf" , "--high","#fb4934"
,"-h","#fb4934"] 50 ] 50
, Run $ Date "<fc=#ECBE7B><fn=1>\xf017</fn></fc> %a %b %_d %H:%M" "date" 300 , Run $ Memory
, Run $ DynNetwork ["-t","<fc=#4db5bd><fn=1>\xf063</fn></fc> <rx> <fc=#c678dd><fn=1>\xf062</fn></fc> <tx>" [
,"-H","200" "-t","<fc=#51afef><fn=1>\xF2DB</fn></fc> <usedratio>%"
,"-L","10" ,"-H","80"
,"-h","#bbc2cf" ,"-L","10"
,"-l","#bbc2cf" ,"-l","#bbc2cf"
,"-n","#bbc2cf"] 50 ,"-n","#bbc2cf"
, Run $ CoreTemp ["-t", "<fc=#CDB464><fn=1>\xf2c7</fn></fc> <core0>°" ,"-h","#fb4934"
, "-L", "30" ] 50
, "-H", "75" , Run $ Alsa "default" "Master"
, "-l", "lightblue" [
, "-n", "#bbc2cf" "--template", "<fc=#5c0714><fn=1>\xe050</fn>>/fc> <volumestatus>"
, "-h", "#aa4450"] 50 , "--suffix" , "True"
, Run $ BatteryP [ "BAT1" ] , "--"
[ "--template" , "<fc=#B1DE76><fn=1>\xf240</fn></fc> <acstatus>" , "--on", "<fc=#5c0714><fn=1>\xe050</fn>>/fc> <volumestatus>"
, "--Low" , "10" -- units: % ]
, "--High" , "80" -- units: % , Run $ Date "<fc=#ECBE7B><fn=1>\xf017</fn></fc> %d.%m.%y %H:%M" "date" 300
, "--low" , "#fb4934" , Run $ DynNetwork
, "--normal" , "#bbc2cf" [
, "--high" , "#98be65" "-t","<fc=#4db5bd><fn=1>\xf063</fn></fc> <rx> <fc=#c678dd><fn=1>\xf062</fn></fc> <tx>"
, "--" -- battery specific options ,"-H","200"
-- discharging status ,"-L","10"
, "-o" , "<left>% (<timeleft>)" ,"-h","#bbc2cf"
-- AC "on" status ,"-l","#bbc2cf"
, "-O" , "<left>% (<fc=#98be65>Charging</fc>)" ,"-n","#bbc2cf"
-- charged status ] 50
, "-i" , "<fc=#98be65>Charged</fc>" , Run $ BatteryP [ "BAT0" ]
] 50 [
, Run XMonadLog "--template" , "<fc=#B1DE76><fn=1>\xf240</fn></fc> <acstatus>"
] , "--Low" , "10" -- units: %
, "--High" , "80" -- units: %
, "--low" , "#fb4934"
, "--normal" , "#bbc2cf"
, "--high" , "#98be65"
, "--" -- battery specific options
-- discharging status
, "-o" , "<left>% (<timeleft>)"
-- AC "on" status
, "-O" , "<left>% (<fc=#98be65>Charging</fc>)"
-- charged status
, "-i" , "<fc=#98be65>Charged</fc>"
] 50
, Run XMonadLog
]
, sepChar = "%" , sepChar = "%"
, alignSep = "}{" , alignSep = "}{"
, template = "%XMonadLog% }{ %cpu% | %coretemp% | %memory% | %battery% | %dynnetwork% | %date% |" , template = "%XMonadLog% }{ %backlight% | %cpu% | %memory% | %battery% | %dynnetwork% | %date% "
} }
main :: IO () main :: IO ()

View File

@@ -5,29 +5,65 @@ import XMonad.Util.EZConfig
import XMonad.Hooks.DynamicLog import XMonad.Hooks.DynamicLog
import XMonad.Hooks.StatusBar import XMonad.Hooks.StatusBar
import XMonad.Hooks.StatusBar.PP import XMonad.Hooks.StatusBar.PP
import XMonad.Layout.ThreeColumns
import XMonad.Layout.Magnifier
import XMonad.Util.ClickableWorkspaces
import XMonad.Util.Loggers
import Data.ByteString (maximum)
import Text.XHtml (gray)
main = xmonad . ewmhFullscreen . ewmh . xmobarProp $ def main = xmonad . ewmhFullscreen . ewmh . withEasySB (statusBarProp "xmobar" (pure myXmobarPP)) defToggleStrutsKey $ myconfig
{ terminal = "alacritty"
, normalBorderColor = "#050508" myconfig = def
, focusedBorderColor = "#89b4fa" {
} layoutHook = myLayout
`additionalKeysP` , terminal = "alacritty"
[ ("M-p", spawn "rofi -show \"drun\"") , normalBorderColor = "#050508"
, ("M-c", spawn "firefox") , focusedBorderColor = "#89b4fa"
--, ("<XF86MonBrightnessUp>", spawn "xbacklight -inc 10") }
--, ("<XF86MonBrightnessDown>", spawn "xbacklight -dec 10") `additionalKeysP`
--, ("<XF86AudioMute>", spawn "wpctl set-mute 58 toggle") [
--, ("<XF86AudioRaiseVolume>", spawn "wpctl set-volume 58 0.05+") ("M-p", spawn "rofi -show \"drun\"")
--, ("<XF86AudioLowerVolume>", spawn "wpctl set-volume 58 0.05-") , ("M-c", spawn "firefox")
--, ("<XF86AudioMicMute>", spawn "wpctl set-mute 52 toggle") , ("<XF86MonBrightnessUp>", spawn "xbacklight -inc 10")
] , ("<XF86MonBrightnessDown>", spawn "xbacklight -dec 10")
`removeKeysP` --, ("<XF86AudioMute>", spawn "wpctl set-mute 58 toggle")
[ "M-q" --, ("<XF86AudioRaiseVolume>", spawn "wpctl set-volume 58 0.05+")
] --, ("<XF86AudioLowerVolume>", spawn "wpctl set-volume 58 0.05-")
--, ("<XF86AudioMicMute>", spawn "wpctl set-mute 52 toggle")
]
`removeKeysP` []
myXmobarPP :: PP
myXmobarPP = def
{
ppSep = magenta ""
, ppWsSep = ""
, ppCurrent = wrap " " "" . xmobarBorder "Top" "#a8dfe3" 2
, ppHidden = wrap " " ""
, ppHiddenNoWindows = gray . wrap " " ""
, ppUrgent = red . wrap (yellow "!") (yellow "!")
, ppTitleSanitize = xmobarStrip
, ppOrder = \[ws, l, _, wins] -> [ws, l, wins]
, ppExtras = [logTitles formatFocused formatUnfocused]
}
where
formatFocused = wrap "[" "]" . magenta . ppWindow
formatUnfocused = wrap "[" "]" . gray . ppWindow
ppWindow :: String -> String
ppWindow = xmobarRaw . (\w -> if null w then "???" else w) . shorten 15 -- set maximum length of windowtitle to 15
magenta, gray, red, yellow :: String -> String
magenta = xmobarColor "#ff79c6" ""
gray = xmobarColor "#5c5e5e" ""
red = xmobarColor "#ff5555" ""
yellow = xmobarColor "#f1fa8c" ""
myLayout = Tall 1 (3/100) (1/2) ||| Mirror (Tall 1 (3/100) (1/2)) ||| Full ||| ThreeColMid 1 (3/100) (1/2) -- wenn wieder zoom von fokusierten Seitenfenstern gewünscht, dann Fireox fixn und: magnifiercz' 1.3 (ThreeColMid 1 (3/100) (1/2))
myStartupHook :: X () myStartupHook :: X ()
myStartupHook = do myStartupHook = do
mapM_ spawnOnce ["xmobar -x " ++ show sid | sid <- [0..9]] mapM_ spawnOnce ["xmobar -x " ++ show sid | sid <- [0..9]]

View File

@@ -0,0 +1,19 @@
{ pkgs, ... }:
let images = pkgs.callPackage ../extras/images.nix { };
in {
home.packages = with pkgs; [ xsecurelock ];
home.sessionVariables = rec {
XSECURELOCK_COMPOSITE_OBSCURER = 0;
XSECURELOCK_PASSWORD_PROMPT = "asterisks";
};
services.screen-locker = {
enable = true;
inactiveInterval = 1;
lockCmd = "${pkgs.xsecurelock}/bin/xsecurelock";
xautolock.extraOptions = [ "Xautolock.killer: systemctl suspend" ];
};
}