From 3f138a5d76cf21dc2a34047e74a30094742b34bd Mon Sep 17 00:00:00 2001 From: Alexander Kobjolke Date: Tue, 6 Feb 2024 23:05:18 +0100 Subject: [PATCH 001/194] xmonad: Put module into its own directory --- hosts/dregil/configuration.nix | 2 +- modules/wm/{xmonad.nix => xmonad/default.nix} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename modules/wm/{xmonad.nix => xmonad/default.nix} (100%) diff --git a/hosts/dregil/configuration.nix b/hosts/dregil/configuration.nix index e64c392..d863423 100644 --- a/hosts/dregil/configuration.nix +++ b/hosts/dregil/configuration.nix @@ -17,7 +17,7 @@ in { ./hardware-configuration.nix # ../../modules/wm/x.nix - ../../modules/wm/xmonad.nix + ../../modules/wm/xmonad/default.nix ]; # Use the systemd-boot EFI boot loader. diff --git a/modules/wm/xmonad.nix b/modules/wm/xmonad/default.nix similarity index 100% rename from modules/wm/xmonad.nix rename to modules/wm/xmonad/default.nix From 5e6aaabb6d95ec3316f793e3c7ad689398425893 Mon Sep 17 00:00:00 2001 From: Alexander Kobjolke Date: Sun, 11 Feb 2024 15:32:03 +0100 Subject: [PATCH 002/194] xmonad: Move config from home to system --- home/alex/programs/xmonad/config.hs | 77 --------------------------- modules/wm/xmonad/config.hs | 80 +++++++++++++++++++++++++++++ modules/wm/xmonad/default.nix | 1 + 3 files changed, 81 insertions(+), 77 deletions(-) delete mode 100644 home/alex/programs/xmonad/config.hs create mode 100644 modules/wm/xmonad/config.hs diff --git a/home/alex/programs/xmonad/config.hs b/home/alex/programs/xmonad/config.hs deleted file mode 100644 index 9cc8e3f..0000000 --- a/home/alex/programs/xmonad/config.hs +++ /dev/null @@ -1,77 +0,0 @@ -import XMonad - -import XMonad.Hooks.DynamicLog -import XMonad.Hooks.ManageDocks -import XMonad.Hooks.ManageHelpers -import XMonad.Hooks.StatusBar -import XMonad.Hooks.StatusBar.PP - -import XMonad.Util.EZConfig -import XMonad.Util.Loggers -import XMonad.Util.Ungrab - -import XMonad.Layout.Magnifier -import XMonad.Layout.ThreeColumns - -import XMonad.Hooks.EwmhDesktops - - -main :: IO () -main = xmonad - . ewmhFullscreen - . ewmh - . withEasySB (statusBarProp "xmobar" (pure myXmobarPP)) defToggleStrutsKey - $ myConfig - -myConfig = def - { modMask = mod4Mask -- Rebind Mod to the Super key - , layoutHook = myLayout -- Use custom layouts - , manageHook = myManageHook -- Match on certain windows - } - `additionalKeysP` - [ ("M-S-z", spawn "xscreensaver-command -lock") - , ("M-C-s", unGrab *> spawn "scrot -s" ) - , ("M-f" , spawn "firefox" ) - ] - -myManageHook :: ManageHook -myManageHook = composeAll - [ className =? "Gimp" --> doFloat - , isDialog --> doFloat - ] - -myLayout = tiled ||| Mirror tiled ||| Full ||| threeCol - where - threeCol = magnifiercz' 1.3 $ ThreeColMid nmaster delta ratio - tiled = Tall nmaster delta ratio - nmaster = 1 -- Default number of windows in the master pane - ratio = 1/2 -- Default proportion of screen occupied by master pane - delta = 3/100 -- Percent of screen to increment by when resizing panes - -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" "" diff --git a/modules/wm/xmonad/config.hs b/modules/wm/xmonad/config.hs new file mode 100644 index 0000000..a946326 --- /dev/null +++ b/modules/wm/xmonad/config.hs @@ -0,0 +1,80 @@ +import XMonad +import XMonad.Util.Ungrab (unGrab) +import XMonad.Util.EZConfig (additionalKeys, additionalKeysP) +import Control.Monad (when) +import Text.Printf (printf) +import System.Posix.Process (executeFile) +import System.Info (arch,os) +import System.Environment (getArgs) +import System.FilePath (()) + +compiledConfig = printf "xmonad-%s-%s" arch os + +compileRestart resume = do + dirs <- asks directories + whenX (recompile dirs True) $ do + when resume writeStateToFile + catchIO + ( do + args <- getArgs + executeFile (cacheDir dirs compiledConfig) False args Nothing + ) + +main :: IO () +main = getDirectories >>= launch myConfig + +myConfig = defaultConfig + { modMask = mod4Mask -- Use Super instead of Alt + , terminal = "alacritty" + } + `additionalKeys` + [ ( (mod4Mask,xK_r), compileRestart True) + , ( (mod4Mask,xK_q), restart "xmonad" True ) + ] + `additionalKeysP` + [ ("M-S-z", spawn "xscreensaver-command -lock") + , ("M-C-s", unGrab *> spawn "scrot -s" ) + , ("M-f" , spawn "firefox" ) + ] + + +-- myManageHook :: ManageHook +-- myManageHook = composeAll +-- [ 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" "" diff --git a/modules/wm/xmonad/default.nix b/modules/wm/xmonad/default.nix index dbb4945..9473dae 100644 --- a/modules/wm/xmonad/default.nix +++ b/modules/wm/xmonad/default.nix @@ -8,6 +8,7 @@ windowManager.xmonad = { enable = true; enableContribAndExtras = true; + config = ./config.hs; }; }; }; From 33de3c1f708967ea270aab7e714bc6c567bf0af2 Mon Sep 17 00:00:00 2001 From: Alexander Kobjolke Date: Sun, 11 Feb 2024 15:59:34 +0100 Subject: [PATCH 003/194] home: Enable rofi program launcher --- home/alex/home.nix | 1 + home/alex/programs/rofi/default.nix | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 home/alex/programs/rofi/default.nix diff --git a/home/alex/home.nix b/home/alex/home.nix index 80ccc81..d6211bd 100644 --- a/home/alex/home.nix +++ b/home/alex/home.nix @@ -4,6 +4,7 @@ imports = [ ./cli.nix # ./programs/xmonad/default.nix + ./programs/rofi/default.nix ]; home = { diff --git a/home/alex/programs/rofi/default.nix b/home/alex/programs/rofi/default.nix new file mode 100644 index 0000000..2b7f6c4 --- /dev/null +++ b/home/alex/programs/rofi/default.nix @@ -0,0 +1,16 @@ +{ config, lib, pkgs, ... }: + +{ + programs.rofi = { + enable = true; + plugins = with pkgs; [ rofi-calc rofi-emoji ]; + terminal = "${pkgs.alacritty}/bin/alacritty"; + pass = { + enable = true; + stores = [ config.programs.password-store.settings.PASSWORD_STORE_DIR ]; + }; + }; + + # let rofi insert emojis directly + home.packages = [ pkgs.xdotool ]; +} From d57a732a75a337b7b4adb2e94622ef944103e667 Mon Sep 17 00:00:00 2001 From: Alexander Kobjolke Date: Mon, 12 Feb 2024 21:24:07 +0100 Subject: [PATCH 004/194] home: Enable 'jq' --- home/alex/cli.nix | 1 + home/alex/programs/jq/default.nix | 5 +++++ 2 files changed, 6 insertions(+) create mode 100644 home/alex/programs/jq/default.nix diff --git a/home/alex/cli.nix b/home/alex/cli.nix index 774a738..d0cfd6a 100644 --- a/home/alex/cli.nix +++ b/home/alex/cli.nix @@ -14,6 +14,7 @@ in { ./programs/neovim/default.nix ./programs/emacs/default.nix ./programs/editorconfig + ./programs/jq ]; programs.home-manager.enable = true; diff --git a/home/alex/programs/jq/default.nix b/home/alex/programs/jq/default.nix new file mode 100644 index 0000000..22b3462 --- /dev/null +++ b/home/alex/programs/jq/default.nix @@ -0,0 +1,5 @@ +{ config, lib, pkgs, ... }: + +{ + programs.jq = { enable = true; }; +} From 926706097652cc15994f6365ddb31abc92808df7 Mon Sep 17 00:00:00 2001 From: Alexander Kobjolke Date: Mon, 12 Feb 2024 21:29:13 +0100 Subject: [PATCH 005/194] home: Enable 'fzf' --- home/alex/cli.nix | 2 +- home/alex/programs/fzf/default.nix | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 home/alex/programs/fzf/default.nix diff --git a/home/alex/cli.nix b/home/alex/cli.nix index d0cfd6a..193bbaa 100644 --- a/home/alex/cli.nix +++ b/home/alex/cli.nix @@ -15,6 +15,7 @@ in { ./programs/emacs/default.nix ./programs/editorconfig ./programs/jq + ./programs/fzf ]; programs.home-manager.enable = true; @@ -62,7 +63,6 @@ in { htop-vim # htop with vim bindings erdtree # du+tree had sex dua # ncdu but better - fzf gopass gopass-jsonapi diff --git a/home/alex/programs/fzf/default.nix b/home/alex/programs/fzf/default.nix new file mode 100644 index 0000000..92b7590 --- /dev/null +++ b/home/alex/programs/fzf/default.nix @@ -0,0 +1,5 @@ +{ config, lib, pkgs, ... }: + +{ + programs.fzf = { enable = true; }; +} From 7879575e1b350f234c2f672ca9d0810db44006dc Mon Sep 17 00:00:00 2001 From: Alexander Kobjolke Date: Mon, 12 Feb 2024 22:01:50 +0100 Subject: [PATCH 006/194] feat(home): Enable git-cliff changelog generator --- home/alex/cli.nix | 10 +----- home/alex/programs/git/default.nix | 49 ++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+), 9 deletions(-) create mode 100644 home/alex/programs/git/default.nix diff --git a/home/alex/cli.nix b/home/alex/cli.nix index 193bbaa..2efaddb 100644 --- a/home/alex/cli.nix +++ b/home/alex/cli.nix @@ -16,6 +16,7 @@ in { ./programs/editorconfig ./programs/jq ./programs/fzf + ./programs/git ]; programs.home-manager.enable = true; @@ -149,15 +150,6 @@ in { settings.git_protocol = "ssh"; }; - git = { - enable = true; - ignores = [ "*~" "*.swp" "result" "dist-newstyle" ]; - userEmail = user.mail; - userName = user.fullName; - aliases = { st = "status"; }; - extraConfig = { init.defaultBranch = "main"; }; - }; - gpg = { enable = true; settings = { homedir = "~/.local/share/gnupg"; }; diff --git a/home/alex/programs/git/default.nix b/home/alex/programs/git/default.nix new file mode 100644 index 0000000..21f6fc9 --- /dev/null +++ b/home/alex/programs/git/default.nix @@ -0,0 +1,49 @@ +{ config, lib, pkgs, ... }: + +{ + programs.git = { + enable = true; + lfs.enable = true; + ignores = [ "*~" "*.swp" "result" "dist-newstyle" ]; + signing = { + key = "41A6D13FECA21280"; + signByDefault = false; + }; + delta = { enable = true; }; + # TODO create option for my own account meta data + userEmail = "me@failco.de"; + userName = "Alexander Kobjolke"; + aliases = { + a = "add"; + c = "commit"; + ca = "commit --amend"; + can = "commit --amend --no-edit"; + cl = "clone"; + cm = "commit -m"; + co = "checkout"; + cp = "cherry-pick"; + cpx = "cherry-pick -x"; + d = "diff"; + f = "fetch"; + fo = "fetch origin"; + fu = "fetch upstream"; + lol = "log --graph --decorate --pretty=oneline --abbrev-commit"; + lola = "log --graph --decorate --pretty=oneline --abbrev-commit --all"; + pl = "pull"; + pr = "pull -r"; + ps = "push"; + psf = "push -f"; + rb = "rebase"; + rbi = "rebase -i"; + r = "remote"; + ra = "remote add"; + rr = "remote rm"; + rv = "remote -v"; + rs = "remote show"; + st = "status"; + }; + extraConfig = { init.defaultBranch = "main"; }; + }; + + programs.git-cliff = { enable = true; }; +} From 59e86c9580fbea878dbcec36eee594c03926fc97 Mon Sep 17 00:00:00 2001 From: Alexander Kobjolke Date: Mon, 12 Feb 2024 22:21:31 +0100 Subject: [PATCH 007/194] feat(dregil): Enable AppImage binfmt support --- hosts/dregil/configuration.nix | 1 + modules/appimage.nix | 12 ++++++++++++ 2 files changed, 13 insertions(+) create mode 100644 modules/appimage.nix diff --git a/hosts/dregil/configuration.nix b/hosts/dregil/configuration.nix index d863423..d38e601 100644 --- a/hosts/dregil/configuration.nix +++ b/hosts/dregil/configuration.nix @@ -16,6 +16,7 @@ in { # Include the results of the hardware scan. ./hardware-configuration.nix # + ../../modules/appimage.nix ../../modules/wm/x.nix ../../modules/wm/xmonad/default.nix ]; diff --git a/modules/appimage.nix b/modules/appimage.nix new file mode 100644 index 0000000..782a467 --- /dev/null +++ b/modules/appimage.nix @@ -0,0 +1,12 @@ +{ config, lib, pkgs, ... }: + +{ + boot.binfmt.registrations.appimage = { + wrapInterpreterInShell = false; + interpreter = "${pkgs.appimage-run}/bin/appimage-run"; + recognitionType = "magic"; + offset = 0; + mask = "\\xff\\xff\\xff\\xff\\x00\\x00\\x00\\x00\\xff\\xff\\xff"; + magicOrExtension = "\\x7fELF....AI\\x02"; + }; +} From 649eeae81b22fac044415512f7ed36f1f500a2fc Mon Sep 17 00:00:00 2001 From: Alexander Kobjolke Date: Mon, 12 Feb 2024 22:47:04 +0100 Subject: [PATCH 008/194] feat(home): Move zsh config to shell module --- home/alex/cli.nix | 11 +---------- home/alex/programs/shell/default.nix | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 10 deletions(-) create mode 100644 home/alex/programs/shell/default.nix diff --git a/home/alex/cli.nix b/home/alex/cli.nix index 2efaddb..17fd2d8 100644 --- a/home/alex/cli.nix +++ b/home/alex/cli.nix @@ -17,6 +17,7 @@ in { ./programs/jq ./programs/fzf ./programs/git + ./programs/shell ]; programs.home-manager.enable = true; @@ -119,16 +120,6 @@ in { # htop replacement with a nice UI btop.enable = true; - zsh = { - enable = true; - enableAutosuggestions = true; - oh-my-zsh = { - enable = true; - plugins = [ "git" "fzf" "fd" "z" ]; - theme = "simple"; - }; - }; - # better ls with icons and stuff, maybe also try lsd ${myEza} = { enable = true; diff --git a/home/alex/programs/shell/default.nix b/home/alex/programs/shell/default.nix new file mode 100644 index 0000000..b614b70 --- /dev/null +++ b/home/alex/programs/shell/default.nix @@ -0,0 +1,15 @@ +{ config, lib, pkgs, ... }: + +{ + home.shellAliases = { suspend = "systemctl hibernate"; }; + + programs.zsh = { + enable = true; + enableAutosuggestions = true; + oh-my-zsh = { + enable = true; + plugins = [ "git" "fzf" "fd" "z" ]; + theme = "simple"; + }; + }; +} From 71dbb652b8cbe773dd4a0db556f8903574480ccb Mon Sep 17 00:00:00 2001 From: Alexander Kobjolke Date: Tue, 13 Feb 2024 23:00:04 +0100 Subject: [PATCH 009/194] dregil: Disable touchpad tapping --- modules/wm/x.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/wm/x.nix b/modules/wm/x.nix index 58e31d9..86e2a86 100644 --- a/modules/wm/x.nix +++ b/modules/wm/x.nix @@ -28,6 +28,7 @@ libinput = { enable = true; touchpad.disableWhileTyping = true; + touchpad.tapping = false; mouse.naturalScrolling = config.services.xserver.libinput.touchpad.naturalScrolling; }; From 3a367e9f4fc770a17cd5ee7c57f583768bad7cb9 Mon Sep 17 00:00:00 2001 From: Alexander Kobjolke Date: Thu, 15 Feb 2024 21:58:26 +0100 Subject: [PATCH 010/194] xmonad: Setup a basic xmonad config --- home/alex/programs/xmonad/config.hs | 91 +++++++++++++++++++++++++++ home/alex/programs/xmonad/default.nix | 17 +++-- modules/wm/xmonad/config.hs | 29 ++++++--- modules/wm/xmonad/default.nix | 1 + 4 files changed, 124 insertions(+), 14 deletions(-) create mode 100644 home/alex/programs/xmonad/config.hs diff --git a/home/alex/programs/xmonad/config.hs b/home/alex/programs/xmonad/config.hs new file mode 100644 index 0000000..486ac96 --- /dev/null +++ b/home/alex/programs/xmonad/config.hs @@ -0,0 +1,91 @@ +import XMonad +import XMonad.Util.Ungrab (unGrab) +import XMonad.Layout.ThreeColumns +import XMonad.Layout.Magnifier (magnifiercz') +import XMonad.Hooks.EwmhDesktops +import qualified XMonad.Hooks.ManageDocks as Docks +import qualified XMonad.Util.EZConfig as EZ +import Control.Monad (when) +import Text.Printf (printf) +import System.Posix.Process (executeFile) +import System.Info (arch,os) +import System.Environment (getArgs) +import System.FilePath (()) + +compiledConfig = printf "xmonad-%s-%s" arch os + +compileRestart resume = do + dirs <- asks directories + whenX (recompile dirs True) $ do + when resume writeStateToFile + catchIO + ( do + args <- getArgs + executeFile (cacheDir dirs compiledConfig) False args Nothing + ) + +myLayout = Docks.avoidStruts (tiled ||| Mirror tiled ||| Full ||| columns) + where + tiled = Tall nmaster delta ratio + columns = magnifiercz' 1.3 $ 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 + +main :: IO () +main = getDirectories >>= launch myConfig + +myConfig = ewmhFullscreen $ ewmh $ Docks.docks $ def + { modMask = mod4Mask -- Use Super instead of Alt + , terminal = "alacritty" + , layoutHook = myLayout + } + `EZ.additionalKeysP` + [ ("M-S-z", spawn "xscreensaver-command -lock") + , ("M-S-r", compileRestart True) + , ("M-S-q", restart "xmonad" True) + , ("M-C-s", unGrab *> spawn "scrot -s") + , ("M-b", sendMessage Docks.ToggleStruts) + ] + + +-- myManageHook :: ManageHook +-- myManageHook = composeAll +-- [ 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" "" diff --git a/home/alex/programs/xmonad/default.nix b/home/alex/programs/xmonad/default.nix index 49af6ae..988cd29 100644 --- a/home/alex/programs/xmonad/default.nix +++ b/home/alex/programs/xmonad/default.nix @@ -1,11 +1,18 @@ { config, lib, pkgs, ... }: { - xsession = { - windowManager.command = let - xmonad = pkgs.xmonad-with-packages.override { - packages = self: [ self.xmonad-contrib ]; + config.services = { + upower.enable = true; + + xserver = { + windowManager.xmonad = { + enable = true; + enableContribAndExtras = true; + config = ./config.hs; + extraPackages = hp: [ hp.dbus hp.monad-logger hp.xmonad-contrib ]; }; - in "${xmonad}/bin/xmonad"; + }; }; + + config.systemd.services.upower.enable = true; } diff --git a/modules/wm/xmonad/config.hs b/modules/wm/xmonad/config.hs index a946326..486ac96 100644 --- a/modules/wm/xmonad/config.hs +++ b/modules/wm/xmonad/config.hs @@ -1,6 +1,10 @@ import XMonad import XMonad.Util.Ungrab (unGrab) -import XMonad.Util.EZConfig (additionalKeys, additionalKeysP) +import XMonad.Layout.ThreeColumns +import XMonad.Layout.Magnifier (magnifiercz') +import XMonad.Hooks.EwmhDesktops +import qualified XMonad.Hooks.ManageDocks as Docks +import qualified XMonad.Util.EZConfig as EZ import Control.Monad (when) import Text.Printf (printf) import System.Posix.Process (executeFile) @@ -20,21 +24,28 @@ compileRestart resume = do executeFile (cacheDir dirs compiledConfig) False args Nothing ) +myLayout = Docks.avoidStruts (tiled ||| Mirror tiled ||| Full ||| columns) + where + tiled = Tall nmaster delta ratio + columns = magnifiercz' 1.3 $ 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 + main :: IO () main = getDirectories >>= launch myConfig -myConfig = defaultConfig +myConfig = ewmhFullscreen $ ewmh $ Docks.docks $ def { modMask = mod4Mask -- Use Super instead of Alt , terminal = "alacritty" + , layoutHook = myLayout } - `additionalKeys` - [ ( (mod4Mask,xK_r), compileRestart True) - , ( (mod4Mask,xK_q), restart "xmonad" True ) - ] - `additionalKeysP` + `EZ.additionalKeysP` [ ("M-S-z", spawn "xscreensaver-command -lock") - , ("M-C-s", unGrab *> spawn "scrot -s" ) - , ("M-f" , spawn "firefox" ) + , ("M-S-r", compileRestart True) + , ("M-S-q", restart "xmonad" True) + , ("M-C-s", unGrab *> spawn "scrot -s") + , ("M-b", sendMessage Docks.ToggleStruts) ] diff --git a/modules/wm/xmonad/default.nix b/modules/wm/xmonad/default.nix index 9473dae..c59ec4e 100644 --- a/modules/wm/xmonad/default.nix +++ b/modules/wm/xmonad/default.nix @@ -9,6 +9,7 @@ enable = true; enableContribAndExtras = true; config = ./config.hs; + extraPackages = hp: [ hp.dbus hp.monad-logger hp.xmonad-contrib ]; }; }; }; From 3dec08779dfbfc7c579f071051bab2ac97b65d3a Mon Sep 17 00:00:00 2001 From: Alexander Kobjolke Date: Thu, 15 Feb 2024 22:03:18 +0100 Subject: [PATCH 011/194] polybar: Add basic setup of polybar --- home/alex/services/polybar/config.ini | 179 +++++++++++++++++++++++++ home/alex/services/polybar/default.nix | 19 +++ 2 files changed, 198 insertions(+) create mode 100644 home/alex/services/polybar/config.ini create mode 100644 home/alex/services/polybar/default.nix diff --git a/home/alex/services/polybar/config.ini b/home/alex/services/polybar/config.ini new file mode 100644 index 0000000..2cedc8a --- /dev/null +++ b/home/alex/services/polybar/config.ini @@ -0,0 +1,179 @@ +;========================================================== +; +; +; ██████╗ ██████╗ ██╗ ██╗ ██╗██████╗ █████╗ ██████╗ +; ██╔══██╗██╔═══██╗██║ ╚██╗ ██╔╝██╔══██╗██╔══██╗██╔══██╗ +; ██████╔╝██║ ██║██║ ╚████╔╝ ██████╔╝███████║██████╔╝ +; ██╔═══╝ ██║ ██║██║ ╚██╔╝ ██╔══██╗██╔══██║██╔══██╗ +; ██║ ╚██████╔╝███████╗██║ ██████╔╝██║ ██║██║ ██║ +; ╚═╝ ╚═════╝ ╚══════╝╚═╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝ +; +; +; To learn more about how to configure Polybar +; go to https://github.com/polybar/polybar +; +; The README contains a lot of information +; +;========================================================== + +[colors] +background = #282A2E +background-alt = #373B41 +foreground = #C5C8C6 +primary = #F0C674 +secondary = #8ABEB7 +alert = #A54242 +disabled = #707880 + +[bar/main] +width = 100% +height = 24pt +radius = 6 + +; dpi = 96 + +background = ${colors.background} +foreground = ${colors.foreground} + +line-size = 3pt + +border-size = 4pt +border-color = #00000000 + +padding-left = 0 +padding-right = 1 + +module-margin = 1 + +separator = | +separator-foreground = ${colors.disabled} + +font-0 = monospace;2 + +modules-left = xworkspaces xwindow +modules-center = systray +modules-right = filesystem pulseaudio xkeyboard memory cpu wlan eth date + +cursor-click = pointer +cursor-scroll = ns-resize + +enable-ipc = true + +tray-position = center + +; wm-restack = generic +; wm-restack = bspwm +; wm-restack = i3 + +; override-redirect = true + +[module/systray] +type = internal/tray + +format-margin = 8pt +tray-spacing = 16pt + +[module/xworkspaces] +type = internal/xworkspaces + +label-active = %name% +label-active-background = ${colors.background-alt} +label-active-underline= ${colors.primary} +label-active-padding = 1 + +label-occupied = %name% +label-occupied-padding = 1 + +label-urgent = %name% +label-urgent-background = ${colors.alert} +label-urgent-padding = 1 + +label-empty = %name% +label-empty-foreground = ${colors.disabled} +label-empty-padding = 1 + +[module/xwindow] +type = internal/xwindow +label = %title:0:60:...% + +[module/filesystem] +type = internal/fs +interval = 25 + +mount-0 = / + +label-mounted = %{F#F0C674}%mountpoint%%{F-} %percentage_used%% + +label-unmounted = %mountpoint% not mounted +label-unmounted-foreground = ${colors.disabled} + +[module/pulseaudio] +type = internal/pulseaudio + +format-volume-prefix = "VOL " +format-volume-prefix-foreground = ${colors.primary} +format-volume = + +label-volume = %percentage%% + +label-muted = muted +label-muted-foreground = ${colors.disabled} + +[module/xkeyboard] +type = internal/xkeyboard +blacklist-0 = num lock + +label-layout = %layout% +label-layout-foreground = ${colors.primary} + +label-indicator-padding = 2 +label-indicator-margin = 1 +label-indicator-foreground = ${colors.background} +label-indicator-background = ${colors.secondary} + +[module/memory] +type = internal/memory +interval = 2 +format-prefix = "RAM " +format-prefix-foreground = ${colors.primary} +label = %percentage_used:2%% + +[module/cpu] +type = internal/cpu +interval = 2 +format-prefix = "CPU " +format-prefix-foreground = ${colors.primary} +label = %percentage:2%% + +[network-base] +type = internal/network +interval = 5 +format-connected = +format-disconnected = +label-disconnected = %{F#F0C674}%ifname%%{F#707880} disconnected + +[module/wlan] +inherit = network-base +interface-type = wireless +label-connected = %{F#F0C674}%ifname%%{F-} %essid% %local_ip% + +[module/eth] +inherit = network-base +interface-type = wired +label-connected = %{F#F0C674}%ifname%%{F-} %local_ip% + +[module/date] +type = internal/date +interval = 1 + +date = %H:%M +date-alt = %Y-%m-%d %H:%M:%S + +label = %date% +label-foreground = ${colors.primary} + +[settings] +screenchange-reload = true +pseudo-transparency = true + +; vim:ft=dosini diff --git a/home/alex/services/polybar/default.nix b/home/alex/services/polybar/default.nix new file mode 100644 index 0000000..0289fff --- /dev/null +++ b/home/alex/services/polybar/default.nix @@ -0,0 +1,19 @@ +{ config, lib, pkgs, ... }: +let + mypolybar = pkgs.polybar.override { + alsaSupport = true; + mpdSupport = true; + pulseSupport = true; + }; +in { + home.packages = with pkgs; [ font-awesome material-design-icons ]; + + services.polybar = { + enable = true; + package = mypolybar; + config = ./config.ini; + script = '' + polybar & disown + ''; + }; +} From 7fc99ce334beff8f7c2c598050cf6ae5da2d8924 Mon Sep 17 00:00:00 2001 From: Alexander Kobjolke Date: Thu, 15 Feb 2024 22:21:45 +0100 Subject: [PATCH 012/194] dregil: Import path instead of default.nix --- home/alex/home.nix | 5 +++-- home/alex/programs/rofi/default.nix | 4 ++-- home/alex/services/polybar/default.nix | 4 ++-- modules/wm/xmonad/default.nix | 4 ++-- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/home/alex/home.nix b/home/alex/home.nix index d6211bd..7410d3b 100644 --- a/home/alex/home.nix +++ b/home/alex/home.nix @@ -3,8 +3,9 @@ { imports = [ ./cli.nix - # ./programs/xmonad/default.nix - ./programs/rofi/default.nix + ./programs/xmonad + ./programs/rofi + # ./programs/polybar ]; home = { diff --git a/home/alex/programs/rofi/default.nix b/home/alex/programs/rofi/default.nix index 2b7f6c4..c3f024a 100644 --- a/home/alex/programs/rofi/default.nix +++ b/home/alex/programs/rofi/default.nix @@ -1,7 +1,7 @@ { config, lib, pkgs, ... }: { - programs.rofi = { + config.programs.rofi = { enable = true; plugins = with pkgs; [ rofi-calc rofi-emoji ]; terminal = "${pkgs.alacritty}/bin/alacritty"; @@ -12,5 +12,5 @@ }; # let rofi insert emojis directly - home.packages = [ pkgs.xdotool ]; + config.home.packages = [ pkgs.xdotool ]; } diff --git a/home/alex/services/polybar/default.nix b/home/alex/services/polybar/default.nix index 0289fff..c5f07c7 100644 --- a/home/alex/services/polybar/default.nix +++ b/home/alex/services/polybar/default.nix @@ -6,9 +6,9 @@ let pulseSupport = true; }; in { - home.packages = with pkgs; [ font-awesome material-design-icons ]; + config.home.packages = with pkgs; [ font-awesome material-design-icons ]; - services.polybar = { + config.services.polybar = { enable = true; package = mypolybar; config = ./config.ini; diff --git a/modules/wm/xmonad/default.nix b/modules/wm/xmonad/default.nix index c59ec4e..988cd29 100644 --- a/modules/wm/xmonad/default.nix +++ b/modules/wm/xmonad/default.nix @@ -1,7 +1,7 @@ { config, lib, pkgs, ... }: { - services = { + config.services = { upower.enable = true; xserver = { @@ -14,5 +14,5 @@ }; }; - systemd.services.upower.enable = true; + config.systemd.services.upower.enable = true; } From 30202dd3d0aaecf289fb0756906aa4d83507c9bd Mon Sep 17 00:00:00 2001 From: Alexander Kobjolke Date: Thu, 15 Feb 2024 22:22:12 +0100 Subject: [PATCH 013/194] services: Add configuration for dunst dunst is a notification daemon. --- home/alex/services/dunst/default.nix | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 home/alex/services/dunst/default.nix diff --git a/home/alex/services/dunst/default.nix b/home/alex/services/dunst/default.nix new file mode 100644 index 0000000..4dacb5b --- /dev/null +++ b/home/alex/services/dunst/default.nix @@ -0,0 +1,25 @@ +{ config, lib, pkgs, ... }: + +{ + config.services.dunst = { + enable = true; + iconTheme = { + name = "Adwaita"; + package = pkgs.gnome3.adwaita-icon-theme; + size = "16x16"; + }; + settings = { + global = { + monitor = 0; + geometry = "600x50-50+65"; + shrink = "yes"; + transparency = 10; + padding = 16; + horizontal_padding = 16; + font = "JetBrainsMono Nerd Font 10"; + line_height = 4; + format = "%s\\n%b"; + }; + }; + }; +} From feda238463bcd519b0ce2203f0b0d382fe1363af Mon Sep 17 00:00:00 2001 From: Alexander Kobjolke Date: Thu, 15 Feb 2024 22:30:50 +0100 Subject: [PATCH 014/194] udiskie: Add basic config for automounter --- home/alex/services/udiskie/default.nix | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 home/alex/services/udiskie/default.nix diff --git a/home/alex/services/udiskie/default.nix b/home/alex/services/udiskie/default.nix new file mode 100644 index 0000000..da7a5e2 --- /dev/null +++ b/home/alex/services/udiskie/default.nix @@ -0,0 +1,8 @@ +{ config, lib, pkgs, ... }: + +{ + config.services.udiskie = { + enable = true; + tray = "always"; + }; +} From e52b0e0d8a70a74c8b6c73812d84fa2086abed47 Mon Sep 17 00:00:00 2001 From: Alexander Kobjolke Date: Thu, 15 Feb 2024 22:31:25 +0100 Subject: [PATCH 015/194] alex: Enable polybar dunst and udiskie services --- home/alex/home.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/home/alex/home.nix b/home/alex/home.nix index 7410d3b..757cfda 100644 --- a/home/alex/home.nix +++ b/home/alex/home.nix @@ -5,7 +5,9 @@ ./cli.nix ./programs/xmonad ./programs/rofi - # ./programs/polybar + ./services/polybar + ./services/dunst + ./services/udiskie ]; home = { From 020edd4fc97e3c59e1c6a6c2b2e0a830e6e36f76 Mon Sep 17 00:00:00 2001 From: Alexander Kobjolke Date: Fri, 16 Feb 2024 22:38:37 +0100 Subject: [PATCH 016/194] rofi: Use gruvbox theme --- home/alex/programs/rofi/default.nix | 1 + .../rofi/themes/gruvbox-dark-soft.rasi | 191 ++++++++++++++++++ 2 files changed, 192 insertions(+) create mode 100644 home/alex/programs/rofi/themes/gruvbox-dark-soft.rasi diff --git a/home/alex/programs/rofi/default.nix b/home/alex/programs/rofi/default.nix index c3f024a..20d548a 100644 --- a/home/alex/programs/rofi/default.nix +++ b/home/alex/programs/rofi/default.nix @@ -5,6 +5,7 @@ enable = true; plugins = with pkgs; [ rofi-calc rofi-emoji ]; terminal = "${pkgs.alacritty}/bin/alacritty"; + theme = ./themes/gruvbox-dark-soft.rasi; pass = { enable = true; stores = [ config.programs.password-store.settings.PASSWORD_STORE_DIR ]; diff --git a/home/alex/programs/rofi/themes/gruvbox-dark-soft.rasi b/home/alex/programs/rofi/themes/gruvbox-dark-soft.rasi new file mode 100644 index 0000000..597d883 --- /dev/null +++ b/home/alex/programs/rofi/themes/gruvbox-dark-soft.rasi @@ -0,0 +1,191 @@ +/* ========================================================================== + Rofi color theme + + Based on the Gruvbox color scheme for Vim by morhetz + https://github.com/morhetz/gruvbox + + File: gruvbox-dark-soft.rasi + Desc: Gruvbox dark (soft contrast) color theme for Rofi + Author: bardisty + Source: https://github.com/bardisty/gruvbox-rofi + Modified: Mon Feb 12 2018 06:04:37 PST -0800 + ========================================================================== */ + +* { + /* Theme settings */ + highlight: bold italic; + scrollbar: true; + + /* Gruvbox dark colors */ + gruvbox-dark-bg0-soft: #32302f; + gruvbox-dark-bg1: #3c3836; + gruvbox-dark-bg3: #665c54; + gruvbox-dark-fg0: #fbf1c7; + gruvbox-dark-fg1: #ebdbb2; + gruvbox-dark-red-dark: #cc241d; + gruvbox-dark-red-light: #fb4934; + gruvbox-dark-yellow-dark: #d79921; + gruvbox-dark-yellow-light: #fabd2f; + gruvbox-dark-gray: #a89984; + + /* Theme colors */ + background: @gruvbox-dark-bg0-soft; + background-color: @background; + foreground: @gruvbox-dark-fg1; + border-color: @gruvbox-dark-gray; + separatorcolor: @border-color; + scrollbar-handle: @border-color; + + normal-background: @background; + normal-foreground: @foreground; + alternate-normal-background: @gruvbox-dark-bg1; + alternate-normal-foreground: @foreground; + selected-normal-background: @gruvbox-dark-bg3; + selected-normal-foreground: @gruvbox-dark-fg0; + + active-background: @gruvbox-dark-yellow-dark; + active-foreground: @background; + alternate-active-background: @active-background; + alternate-active-foreground: @active-foreground; + selected-active-background: @gruvbox-dark-yellow-light; + selected-active-foreground: @active-foreground; + + urgent-background: @gruvbox-dark-red-dark; + urgent-foreground: @background; + alternate-urgent-background: @urgent-background; + alternate-urgent-foreground: @urgent-foreground; + selected-urgent-background: @gruvbox-dark-red-light; + selected-urgent-foreground: @urgent-foreground; +} + +/* ========================================================================== + File: gruvbox-common.rasi + Desc: Shared rules between all gruvbox themes + Author: bardisty + Source: https://github.com/bardisty/gruvbox-rofi + Modified: Mon Feb 12 2018 06:06:47 PST -0800 + ========================================================================== */ + +window { + background-color: @background; + border: 2; + padding: 2; +} + +mainbox { + border: 0; + padding: 0; +} + +message { + border: 2px 0 0; + border-color: @separatorcolor; + padding: 1px; +} + +textbox { + highlight: @highlight; + text-color: @foreground; +} + +listview { + border: 2px solid 0 0; + padding: 2px 0 0; + border-color: @separatorcolor; + spacing: 2px; + scrollbar: @scrollbar; +} + +element { + border: 0; + padding: 2px; +} + +element.normal.normal { + background-color: @normal-background; + text-color: @normal-foreground; +} + +element.normal.urgent { + background-color: @urgent-background; + text-color: @urgent-foreground; +} + +element.normal.active { + background-color: @active-background; + text-color: @active-foreground; +} + +element.selected.normal { + background-color: @selected-normal-background; + text-color: @selected-normal-foreground; +} + +element.selected.urgent { + background-color: @selected-urgent-background; + text-color: @selected-urgent-foreground; +} + +element.selected.active { + background-color: @selected-active-background; + text-color: @selected-active-foreground; +} + +element.alternate.normal { + background-color: @alternate-normal-background; + text-color: @alternate-normal-foreground; +} + +element.alternate.urgent { + background-color: @alternate-urgent-background; + text-color: @alternate-urgent-foreground; +} + +element.alternate.active { + background-color: @alternate-active-background; + text-color: @alternate-active-foreground; +} + +scrollbar { + width: 4px; + border: 0; + handle-color: @scrollbar-handle; + handle-width: 8px; + padding: 0; +} + +mode-switcher { + border: 2px 0 0; + border-color: @separatorcolor; +} + +inputbar { + spacing: 0; + text-color: @normal-foreground; + padding: 2px; + children: [ prompt, textbox-prompt-sep, entry, case-indicator ]; +} + +case-indicator, +entry, +prompt, +button { + spacing: 0; + text-color: @normal-foreground; +} + +button.selected { + background-color: @selected-normal-background; + text-color: @selected-normal-foreground; +} + +textbox-prompt-sep { + expand: false; + str: ":"; + text-color: @normal-foreground; + margin: 0 0.3em 0 0; +} +element-text, element-icon { + background-color: inherit; + text-color: inherit; +} From c936e29aebeb3bd6fcc822bb9b1def8e5090abda Mon Sep 17 00:00:00 2001 From: Alexander Kobjolke Date: Fri, 16 Feb 2024 22:40:04 +0100 Subject: [PATCH 017/194] xmonad: Remove configuration from home --- home/alex/home.nix | 1 - home/alex/programs/xmonad/config.hs | 91 --------------------------- home/alex/programs/xmonad/default.nix | 18 ------ 3 files changed, 110 deletions(-) delete mode 100644 home/alex/programs/xmonad/config.hs delete mode 100644 home/alex/programs/xmonad/default.nix diff --git a/home/alex/home.nix b/home/alex/home.nix index 757cfda..48cc283 100644 --- a/home/alex/home.nix +++ b/home/alex/home.nix @@ -3,7 +3,6 @@ { imports = [ ./cli.nix - ./programs/xmonad ./programs/rofi ./services/polybar ./services/dunst diff --git a/home/alex/programs/xmonad/config.hs b/home/alex/programs/xmonad/config.hs deleted file mode 100644 index 486ac96..0000000 --- a/home/alex/programs/xmonad/config.hs +++ /dev/null @@ -1,91 +0,0 @@ -import XMonad -import XMonad.Util.Ungrab (unGrab) -import XMonad.Layout.ThreeColumns -import XMonad.Layout.Magnifier (magnifiercz') -import XMonad.Hooks.EwmhDesktops -import qualified XMonad.Hooks.ManageDocks as Docks -import qualified XMonad.Util.EZConfig as EZ -import Control.Monad (when) -import Text.Printf (printf) -import System.Posix.Process (executeFile) -import System.Info (arch,os) -import System.Environment (getArgs) -import System.FilePath (()) - -compiledConfig = printf "xmonad-%s-%s" arch os - -compileRestart resume = do - dirs <- asks directories - whenX (recompile dirs True) $ do - when resume writeStateToFile - catchIO - ( do - args <- getArgs - executeFile (cacheDir dirs compiledConfig) False args Nothing - ) - -myLayout = Docks.avoidStruts (tiled ||| Mirror tiled ||| Full ||| columns) - where - tiled = Tall nmaster delta ratio - columns = magnifiercz' 1.3 $ 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 - -main :: IO () -main = getDirectories >>= launch myConfig - -myConfig = ewmhFullscreen $ ewmh $ Docks.docks $ def - { modMask = mod4Mask -- Use Super instead of Alt - , terminal = "alacritty" - , layoutHook = myLayout - } - `EZ.additionalKeysP` - [ ("M-S-z", spawn "xscreensaver-command -lock") - , ("M-S-r", compileRestart True) - , ("M-S-q", restart "xmonad" True) - , ("M-C-s", unGrab *> spawn "scrot -s") - , ("M-b", sendMessage Docks.ToggleStruts) - ] - - --- myManageHook :: ManageHook --- myManageHook = composeAll --- [ 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" "" diff --git a/home/alex/programs/xmonad/default.nix b/home/alex/programs/xmonad/default.nix deleted file mode 100644 index 988cd29..0000000 --- a/home/alex/programs/xmonad/default.nix +++ /dev/null @@ -1,18 +0,0 @@ -{ config, lib, pkgs, ... }: - -{ - config.services = { - upower.enable = true; - - xserver = { - windowManager.xmonad = { - enable = true; - enableContribAndExtras = true; - config = ./config.hs; - extraPackages = hp: [ hp.dbus hp.monad-logger hp.xmonad-contrib ]; - }; - }; - }; - - config.systemd.services.upower.enable = true; -} From ba0a4ff3066110843e171937e600e844f88648c3 Mon Sep 17 00:00:00 2001 From: Alexander Kobjolke Date: Fri, 16 Feb 2024 23:09:40 +0100 Subject: [PATCH 018/194] 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 efbdccacbb188a28fd958fd0acd0f4348242c724 Mon Sep 17 00:00:00 2001 From: Alexander Kobjolke Date: Fri, 16 Feb 2024 23:10:32 +0100 Subject: [PATCH 019/194] 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 7da89d2409b9c384ca0423c0a97c27703f1d3845 Mon Sep 17 00:00:00 2001 From: Alexander Kobjolke Date: Fri, 16 Feb 2024 23:10:45 +0100 Subject: [PATCH 020/194] 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 6f0ed7ad886a4335f6f3a70e91f66882dfb331f1 Mon Sep 17 00:00:00 2001 From: Alexander Kobjolke Date: Fri, 16 Feb 2024 23:13:56 +0100 Subject: [PATCH 021/194] 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 b71cdcc218fef868d0fa584f6947ae98bf2c8063 Mon Sep 17 00:00:00 2001 From: Alexander Kobjolke Date: Fri, 16 Feb 2024 23:14:06 +0100 Subject: [PATCH 022/194] 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 617d9c5318bedac87f4a6491a0a886305db0c1c0 Mon Sep 17 00:00:00 2001 From: Alexander Kobjolke Date: Fri, 16 Feb 2024 23:48:20 +0100 Subject: [PATCH 023/194] 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 e7df10f4b0e7637793208eae426bb0e874265cd0 Mon Sep 17 00:00:00 2001 From: Alexander Kobjolke Date: Mon, 19 Feb 2024 23:21:51 +0100 Subject: [PATCH 024/194] 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 5096cf2655aa8b0c303ebe18db34711a037513ab Mon Sep 17 00:00:00 2001 From: Alexander Kobjolke Date: Mon, 19 Feb 2024 23:25:45 +0100 Subject: [PATCH 025/194] 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: +;