From 786a8cb186e603d1256f46c450368f0e4f231c48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kha=C3=AFs=20COLIN?= Date: Sun, 9 Feb 2025 13:19:01 +0100 Subject: [PATCH] feat(wm): install xmonad --- common.nix | 3 +++ home.nix | 9 +++++++++ xmonad.hs | 24 ++++++++++++++++++++++++ 3 files changed, 36 insertions(+) create mode 100644 xmonad.hs diff --git a/common.nix b/common.nix index a12136a..f92a081 100644 --- a/common.nix +++ b/common.nix @@ -43,6 +43,9 @@ # You can disable this if you're only using the Wayland session. services.xserver.enable = true; + # emable xmonad + services.xserver.windowManager.xmonad.enable = true; + # Enable the KDE Plasma Desktop Environment. services.displayManager.sddm.enable = true; services.desktopManager.plasma6.enable = true; diff --git a/home.nix b/home.nix index d540149..ae192aa 100644 --- a/home.nix +++ b/home.nix @@ -85,6 +85,8 @@ in { # xmonad # apparently this is needed for the haskell lsp ghc + i3lock + xmobar ]; file = { @@ -247,4 +249,11 @@ in { programs.yazi = { enable = true; }; + + xsession.windowManager.xmonad = { + enable = true; + config = ./xmonad.hs; + enableContribAndExtras = true; + }; + programs.rofi.enable = true; } diff --git a/xmonad.hs b/xmonad.hs new file mode 100644 index 0000000..4849a01 --- /dev/null +++ b/xmonad.hs @@ -0,0 +1,24 @@ +import XMonad +import XMonad.Util.EZConfig +import System.Exit + +main :: IO () +main = xmonad $ myConfig +myConfig = def + `additionalKeysP` + [ + -- Screen lock & suspend + ("C-M-l" , spawn "swaylock" ) + , ("C-M-L" , spawn "swaylock" *> spawn "systemctl suspend") + -- Terminal + , ("S-", spawn "kitty" ) + -- Frequent programs + , ("S-q", spawn "firefox" ) + , ("S-a", spawn "emacs" ) + , ("S-d", spawn "discord" ) + , ("S-g", spawn "dolphin" ) + -- Program launcher + , ("S-r", spawn "rofi -show drun -theme Paper" ) + -- Exit + , ("S-M-C-q", io (exitWith ExitSuccess) ) + ]