From 738f8c5b6275c2fa78a999c7a3faa73b959c8c4c Mon Sep 17 00:00:00 2001 From: Alexander Kobjolke Date: Fri, 16 Feb 2024 23:09:40 +0100 Subject: [PATCH 01/12] xmonad: Disable magnification of selected window --- modules/wm/xmonad/config.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/wm/xmonad/config.hs b/modules/wm/xmonad/config.hs index 486ac96..42fd91d 100644 --- a/modules/wm/xmonad/config.hs +++ b/modules/wm/xmonad/config.hs @@ -27,7 +27,7 @@ compileRestart resume = do myLayout = Docks.avoidStruts (tiled ||| Mirror tiled ||| Full ||| columns) where tiled = Tall nmaster delta ratio - columns = magnifiercz' 1.3 $ ThreeColMid nmaster delta ratio + columns = ThreeColMid nmaster delta ratio nmaster = 1 -- default number of windows in the master pane ratio = 1/2 -- default proportion occupied by master pane delta = 3/100 -- percent of screen to increment when resizing From 931b572b9aa9293f644a308bbcb13a836dfe1e13 Mon Sep 17 00:00:00 2001 From: Alexander Kobjolke Date: Fri, 16 Feb 2024 23:10:32 +0100 Subject: [PATCH 02/12] services: Add compositor picom --- home/alex/services/picom/default.nix | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 home/alex/services/picom/default.nix diff --git a/home/alex/services/picom/default.nix b/home/alex/services/picom/default.nix new file mode 100644 index 0000000..047a0af --- /dev/null +++ b/home/alex/services/picom/default.nix @@ -0,0 +1,15 @@ +{ config, lib, pkgs, ... }: + +{ + config.services.picom = { + enable = true; + activeOpacity = 1.0; + inactiveOpacity = 0.8; + backend = "glx"; + fade = true; + fadeDelta = 5; + opacityRules = [ "100:name *= 'i3lock'" ]; + shadow = true; + shadowOpacity = 0.75; + }; +} From 18b00d2991a940bd5cabb15dac58a5e8570ca758 Mon Sep 17 00:00:00 2001 From: Alexander Kobjolke Date: Fri, 16 Feb 2024 23:10:45 +0100 Subject: [PATCH 03/12] alex: Enable picom as a compositor --- home/alex/home.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/home/alex/home.nix b/home/alex/home.nix index 48cc283..a5a313c 100644 --- a/home/alex/home.nix +++ b/home/alex/home.nix @@ -7,6 +7,7 @@ ./services/polybar ./services/dunst ./services/udiskie + ./services/picom ]; home = { From 88e5c2db8f700d2e56bb66c28882ceee6bb66fe4 Mon Sep 17 00:00:00 2001 From: Alexander Kobjolke Date: Fri, 16 Feb 2024 23:13:56 +0100 Subject: [PATCH 04/12] xmonad: Remove commented code --- modules/wm/xmonad/config.hs | 35 ----------------------------------- 1 file changed, 35 deletions(-) diff --git a/modules/wm/xmonad/config.hs b/modules/wm/xmonad/config.hs index 42fd91d..9f77278 100644 --- a/modules/wm/xmonad/config.hs +++ b/modules/wm/xmonad/config.hs @@ -54,38 +54,3 @@ myConfig = ewmhFullscreen $ ewmh $ Docks.docks $ def -- [ className =? "Gimp" --> doFloat -- , isDialog --> doFloat -- ] - --- main = xmonad --- . ewmhFullscreen --- . ewmh --- . withEasySB (statusBarProp "xmobar" (pure myXmobarPP)) defToggleStrutsKey --- $ myConfig - - --- myXmobarPP :: PP --- myXmobarPP = def --- { ppSep = magenta " • " --- , ppTitleSanitize = xmobarStrip --- , ppCurrent = wrap " " "" . xmobarBorder "Top" "#8be9fd" 2 --- , ppHidden = white . wrap " " "" --- , ppHiddenNoWindows = lowWhite . wrap " " "" --- , ppUrgent = red . wrap (yellow "!") (yellow "!") --- , ppOrder = \[ws, l, _, wins] -> [ws, l, wins] --- , ppExtras = [logTitles formatFocused formatUnfocused] --- } --- where --- formatFocused = wrap (white "[") (white "]") . magenta . ppWindow --- formatUnfocused = wrap (lowWhite "[") (lowWhite "]") . blue . ppWindow - --- -- | Windows should have *some* title, which should not not exceed a --- -- sane length. --- ppWindow :: String -> String --- ppWindow = xmobarRaw . (\w -> if null w then "untitled" else w) . shorten 30 - --- blue, lowWhite, magenta, red, white, yellow :: String -> String --- magenta = xmobarColor "#ff79c6" "" --- blue = xmobarColor "#bd93f9" "" --- white = xmobarColor "#f8f8f2" "" --- yellow = xmobarColor "#f1fa8c" "" --- red = xmobarColor "#ff5555" "" --- lowWhite = xmobarColor "#bbbbbb" "" From f6c5cc58345dcbcc167e102aaa3e2082f0ba1fc8 Mon Sep 17 00:00:00 2001 From: Alexander Kobjolke Date: Fri, 16 Feb 2024 23:14:06 +0100 Subject: [PATCH 05/12] xmonad: Run rofi as an appLauncher --- modules/wm/xmonad/config.hs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/wm/xmonad/config.hs b/modules/wm/xmonad/config.hs index 9f77278..815f302 100644 --- a/modules/wm/xmonad/config.hs +++ b/modules/wm/xmonad/config.hs @@ -46,7 +46,10 @@ myConfig = ewmhFullscreen $ ewmh $ Docks.docks $ def , ("M-S-q", restart "xmonad" True) , ("M-C-s", unGrab *> spawn "scrot -s") , ("M-b", sendMessage Docks.ToggleStruts) + , ("M-p", spawn appLauncher) ] + where + appLauncher = "rofi -show combi -modes combi -combi-modes window,drun,run,ssh" -- myManageHook :: ManageHook From 519ef6a5d343903a7aa2246aedc2f8452143ff85 Mon Sep 17 00:00:00 2001 From: Alexander Kobjolke Date: Fri, 16 Feb 2024 23:48:20 +0100 Subject: [PATCH 06/12] xmonad: Run rofi-pass to fill in passwords --- modules/wm/xmonad/config.hs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/wm/xmonad/config.hs b/modules/wm/xmonad/config.hs index 815f302..cbc358d 100644 --- a/modules/wm/xmonad/config.hs +++ b/modules/wm/xmonad/config.hs @@ -47,9 +47,11 @@ myConfig = ewmhFullscreen $ ewmh $ Docks.docks $ def , ("M-C-s", unGrab *> spawn "scrot -s") , ("M-b", sendMessage Docks.ToggleStruts) , ("M-p", spawn appLauncher) + , ("M-i", spawn passLauncher) ] where appLauncher = "rofi -show combi -modes combi -combi-modes window,drun,run,ssh" + passLauncher = "rofi-pass" -- myManageHook :: ManageHook From e3bc43c827fc5df8876a9595ce779ca65d86937b Mon Sep 17 00:00:00 2001 From: Alexander Kobjolke Date: Mon, 19 Feb 2024 23:21:51 +0100 Subject: [PATCH 07/12] wm: Add module to set backlight It's currently not used since it did not work as expected. --- modules/wm/light.nix | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 modules/wm/light.nix diff --git a/modules/wm/light.nix b/modules/wm/light.nix new file mode 100644 index 0000000..bdf351d --- /dev/null +++ b/modules/wm/light.nix @@ -0,0 +1,22 @@ +{ config, lib, pkgs, ... }: + +{ + config.programs.light = { enable = true; }; + config.services.actkbd = let light = "${pkgs.light}/bin/light"; + in { + enable = true; + bindings = [ + { + keys = [ 232 ]; + events = [ "key" ]; + command = "${light} -U 10"; + } + + { + keys = [ 233 ]; + events = [ "key" ]; + command = "${light} -A 10"; + } + ]; + }; +} From b26f6112dc109067e40bdfac3b6884fb7615665b Mon Sep 17 00:00:00 2001 From: Alexander Kobjolke Date: Mon, 19 Feb 2024 23:25:45 +0100 Subject: [PATCH 08/12] polybar: Add backlight and battery modules --- home/alex/services/polybar/config.ini | 58 ++++++++++++++++++++++++++- 1 file changed, 57 insertions(+), 1 deletion(-) diff --git a/home/alex/services/polybar/config.ini b/home/alex/services/polybar/config.ini index 2cedc8a..112a45f 100644 --- a/home/alex/services/polybar/config.ini +++ b/home/alex/services/polybar/config.ini @@ -52,7 +52,7 @@ font-0 = monospace;2 modules-left = xworkspaces xwindow modules-center = systray -modules-right = filesystem pulseaudio xkeyboard memory cpu wlan eth date +modules-right = filesystem pulseaudio xkeyboard memory cpu battery wlan eth backlight date cursor-click = pointer cursor-scroll = ns-resize @@ -73,6 +73,62 @@ type = internal/tray format-margin = 8pt tray-spacing = 16pt +[module/battery] +type = internal/battery + +; This is useful in case the battery never reports 100% charge +; Default: 100 +full-at = 99 + +; format-low once this charge percentage is reached +; Default: 10 +; New in version 3.6.0 +low-at = 10 + +; Use the following command to list batteries and adapters: +; $ ls -1 /sys/class/power_supply/ +battery = BAT0 +adapter = ADP0 + +; If an inotify event haven't been reported in this many +; seconds, manually poll for new values. +; +; Needed as a fallback for systems that don't report events +; on sysfs/procfs. +; +; Disable polling by setting the interval to 0. +; +; Default: 5 +poll-interval = 5 + +[module/backlight] +type = internal/xbacklight + +; XRandR output to get get values from +; Default: the monitor defined for the running bar +;output = DP-4 + +; Create scroll handlers used to set the backlight value +; Default: true +enable-scroll = true + +; Available tags: +;