diff options
| author | Tom Harley | 2020-12-30 10:52:09 +0000 |
|---|---|---|
| committer | Tom Harley | 2020-12-30 10:52:41 +0000 |
| commit | 68cf8766e2636a50b0a660368b18426e2c12d487 (patch) | |
| tree | f7f73e3a93e36ca544b14e6fdb3bd31073262424 /xmonad.nix | |
| download | home-manager-68cf8766e2636a50b0a660368b18426e2c12d487.tar.gz home-manager-68cf8766e2636a50b0a660368b18426e2c12d487.zip | |
Initial commit
Diffstat (limited to 'xmonad.nix')
| -rw-r--r-- | xmonad.nix | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/xmonad.nix b/xmonad.nix new file mode 100644 index 0000000..7647094 --- /dev/null +++ b/xmonad.nix @@ -0,0 +1,69 @@ +{ config, lib, pkgs, ... }: + +{ + xsession.windowManager.xmonad = { + enable = true; + enableContribAndExtras = true; + + # would be nice to have this as an actual haskell file, so I + # could get syntax highlighting, but I also need to make sure + # external programs are included as runtime dependencies + config = pkgs.writeText "xmonad.hs" '' + import XMonad + import XMonad.Actions.Volume + import XMonad.Actions.PhysicalScreens + import XMonad.Util.Dzen + import XMonad.Hooks.EwmhDesktops + import XMonad.Util.EZConfig + + import Data.Default + + mymod = mod4Mask + myKeys = + [ ((mymod, xK_p), spawn "${pkgs.rofi}/bin/rofi -show run") + , ((mymod, xK_i), lowerVolume 5 >>= alert) + , ((mymod, xK_o), raiseVolume 5 >>= alert) + ] + ++ + [((mymod .|. mask, key), f sc) + | (key, sc) <- zip [xK_w, xK_e, xK_r] [0..] + , (f, mask) <- [(viewScreen def, 0), (sendToScreen def, shiftMask)]] + + alert = dzenConfig (timeout 3 >=> onCurr xScreen) . show . round + + main = xmonad $ ewmh $ def + { terminal = "${pkgs.rxvt-unicode}/bin/urxvt" + , modMask = mymod + , borderWidth = 0 + , focusFollowsMouse = False + } `additionalKeys` myKeys + ''; + }; + + xsession.enable = true; + xsession.initExtra = '' + # source .Xmodmap to get key rebindings + ${pkgs.xorg.xmodmap}/bin/xmodmap .Xmodmap + + # disable mouse acceleration + ${pkgs.xorg.xinput}/bin/xinput --set-prop \ + 'Logitech G500s Laser Gaming Mouse' \ + 'libinput Accel Profile Enabled' 0, 1 + + # make displayport input the primary monitor + ${pkgs.xorg.xrandr}/bin/xrandr --output DP-0 --primary + ''; + + xsession.pointerCursor = { + defaultCursor = "left_ptr"; + package = pkgs.vanilla-dmz; + name = "Vanilla-DMZ-AA"; + size = 16; + }; + + # adding dzen to path because I cannot for the life of me figure + # out how to add it to xmonad's path + home.packages = with pkgs; [ + dzen2 + ]; +} |
