1
0
mirror of https://github.com/ellmau/nixos.git synced 2025-12-19 09:29:36 +01:00

Add some window shifting to XMonad and first setup of polybar

This commit is contained in:
Stefan Ellmauthaler 2023-05-11 16:59:12 +02:00
parent b99443dfaf
commit 805d8f7ac2
Failed to extract signature
2 changed files with 67 additions and 6 deletions

View File

@ -123,6 +123,7 @@ layoutMap k l = ("M-y M-" ++ k, sendMessage $ JumpToLayout (l :: String))
myHookManager = composeAll [ manageDocks myHookManager = composeAll [ manageDocks
, className =? "Element" --> doShift "comm" , className =? "Element" --> doShift "comm"
, className =? "firefox" --> doShift "web" , className =? "firefox" --> doShift "web"
, className =? "thunderbird" --> doShift "comm"
, isFullscreen --> doFullFloat , isFullscreen --> doFullFloat
, placeHook $ withGaps (32, 32, 32, 32) $ smart (0.5, 0.5) , placeHook $ withGaps (32, 32, 32, 32) $ smart (0.5, 0.5)
, manageHook def , manageHook def
@ -154,6 +155,7 @@ fadeHook act inact = fadeOutLogHook $ fadeAllBut exceptions act inact
<||> className =? "firefox" <||> className =? "firefox"
<||> className =? "Chromium-browser" <||> className =? "Chromium-browser"
<||> className =? "Emacs" <||> className =? "Emacs"
<||> className =? "thunderbird"
fadeAllBut :: Query Bool -> Rational -> Rational -> Query Rational fadeAllBut :: Query Bool -> Rational -> Rational -> Query Rational
fadeAllBut qry amt inact = do isInactive <- isUnfocused fadeAllBut qry amt inact = do isInactive <- isUnfocused

View File

@ -22,15 +22,17 @@ with lib; {
left = "xmonad"; left = "xmonad";
center = ""; center = "";
# right = "xbacklight xkeyboard eth wlan battery date powermenu dunst volume "; # right = "xbacklight xkeyboard eth wlan battery date powermenu dunst volume ";
right = ""; right = "xkeyboard dunst battery date volume";
}; };
tray = { tray = {
position = "right"; position = "right";
padding = 2; padding = 3;
}; };
background = "FFFFFF"; # background = "FFFFFF";
foreground = "000000"; # foreground = "000000";
module-margin = 2;
monitor = '' monitor = ''
''${env:MONITOR:} ''${env:MONITOR:}
@ -42,8 +44,7 @@ with lib; {
modules = { modules = {
left = "xmonad"; left = "xmonad";
center = ""; center = "";
right = right = "";
" xbacklight xkeyboard eth wlan battery date powermenu volume ";
}; };
monitor = '' monitor = ''
''${env:MONITOR:} ''${env:MONITOR:}
@ -55,6 +56,64 @@ with lib; {
exec = "${pkgs.xmonad-log}/bin/xmonad-log"; exec = "${pkgs.xmonad-log}/bin/xmonad-log";
tail = true; tail = true;
}; };
"module/dunst" = {
type = "custom/script";
exec =
"PATH=${pkgs.dbus}/bin/:$PATH ${pkgs.dunst}/bin/dunstctl is-paused | ${pkgs.gnugrep}/bin/grep -q true && echo || echo ";
interval = 10;
click-left =
"PATH=${pkgs.dbus}/bin/:$PATH ${pkgs.dunst}/bin/dunstctl set-paused toggle";
};
"module/volume" = {
type = "internal/pulseaudio";
format.volume = "<ramp-volume> <label-volume>";
label.muted.text = "🔇";
label.muted.foreground = "#666";
ramp.volume = [ "🔈" "🔉" "🔊" ];
click.right = "${pkgs.pavucontrol}/bin/pavucontrol &";
# format-volume-underline = Base2;
# format-muted-underline = Base2;
};
"module/xkeyboard" = {
type = "internal/xkeyboard";
blacklist-0 = "num lock";
interval = "5";
format-prefix = ''""'';
label-layout = "%layout%";
label-indicator-padding = "2";
label-indicator-margin = "1";
};
"module/battery" = {
type = "internal/battery";
battery = "BAT0";
adapter = "ADP1";
full-at = "98";
format-charging-prefix = ''" "'';
format-charging = "<label-charging>";
format-discharging-prefix = ''" "'';
format-discharging = "<label-discharging>";
format-full-prefix = ''" "'';
format-full-padding = "1";
format-charging-padding = "1";
format-discharging-padding = "1";
};
"module/date" = {
type = "internal/date";
interval = "5";
date = ''" %Y-%m-%d"'';
date-alt = ''" %Y-%m-%d"'';
time = "%H:%M";
time-alt = "%H:%M:%S";
label = "%{A} %date% %time%";
};
}; };
script = '' script = ''
for m in $(polybar --list-monitors | ${pkgs.gnugrep}/bin/grep '(primary)' | ${pkgs.coreutils}/bin/cut -d":" -f1); do for m in $(polybar --list-monitors | ${pkgs.gnugrep}/bin/grep '(primary)' | ${pkgs.coreutils}/bin/cut -d":" -f1); do