From 6e4c4c83bc14b3bfd203118a20b312e947bf6cbd Mon Sep 17 00:00:00 2001 From: David Crompton Date: Tue, 11 Mar 2025 12:39:05 -0400 Subject: [PATCH] universedesktop: back to dwm & st --- machines/universedesktop/desktop/default.nix | 3 ++- machines/universedesktop/desktop/dwm.nix | 13 +++++++++---- machines/universedesktop/desktop/dwm/config.h | 7 +++++-- .../universedesktop/desktop/dwm/st-config.def.h | 12 ++++++------ 4 files changed, 22 insertions(+), 13 deletions(-) diff --git a/machines/universedesktop/desktop/default.nix b/machines/universedesktop/desktop/default.nix index 405c534..c351bf9 100644 --- a/machines/universedesktop/desktop/default.nix +++ b/machines/universedesktop/desktop/default.nix @@ -2,6 +2,7 @@ imports = [ ./audio.nix ./graphics.nix - ./dwm.nix # Sadly, nVidia seems to be too broken too often + # ./dwl.nix # Sadly, nVidia seems to be too broken too often on wayland + ./dwm.nix ]; } diff --git a/machines/universedesktop/desktop/dwm.nix b/machines/universedesktop/desktop/dwm.nix index 10d6d0e..54395be 100644 --- a/machines/universedesktop/desktop/dwm.nix +++ b/machines/universedesktop/desktop/dwm.nix @@ -2,11 +2,11 @@ nixpkgs.overlays = [ (final: prev: { st = prev.st.override { - conf = pkgs.substituteAll { - src = ./dwm/; + conf = builtins.readFile (pkgs.substituteAll { + src = ./dwm/st-config.def.h; env = { }; - }; + }); }; }) ]; @@ -30,7 +30,7 @@ ''; scrncmd=pkgs.writeScript "screenshot-region" '' #!${pkgs.bash}/bin/bash - ${pkgs.slurp}/bin/slurp | ${pkgs.grim}/bin/grim -g - - | ${pkgs.wl-clipboard}/bin/wl-copy + ${pkgs.maim}/bin/maim -o -s | ${pkgs.xclip}/bin/xclip -sel clip -t image/png ''; }; }; @@ -40,8 +40,13 @@ }; }; services.xserver.enable = true; + # services.xserver.xrandrHeads should work, but alas + services.xserver.displayManager.setupCommands = '' + ${pkgs.xorg.xrandr}/bin/xrandr --output DP-4 --auto --output DP-2 --auto --right-of DP-4 --primary --output HDMI-0 --auto --right-of DP-2; + ''; services.xserver.displayManager.lightdm = { enable = true; + background = "#000000"; }; environment.sessionVariables = { GTK_THEME="Adwaita-dark"; diff --git a/machines/universedesktop/desktop/dwm/config.h b/machines/universedesktop/desktop/dwm/config.h index 73c4380..bd33934 100644 --- a/machines/universedesktop/desktop/dwm/config.h +++ b/machines/universedesktop/desktop/dwm/config.h @@ -1,3 +1,4 @@ +#include /* See LICENSE file for copyright and license details. */ /* appearance */ @@ -34,7 +35,7 @@ static const Rule rules[] = { /* layout(s) */ static const float mfact = 0.5; /* factor of master area size [0.05..0.95] */ static const int nmaster = 1; /* number of clients in master area */ -static const int resizehints = 1; /* 1 means respect size hints in tiled resizals */ +static const int resizehints = 0; /* 1 means respect size hints in tiled resizals */ static const int lockfullscreen = 1; /* 1 will force focus on the fullscreen window */ static const Layout layouts[] = { @@ -75,7 +76,7 @@ static const Key keys[] = { { MODKEY, XK_d, incnmaster, {.i = -1 } }, { MODKEY, XK_h, setmfact, {.f = -0.05} }, { MODKEY, XK_l, setmfact, {.f = +0.05} }, - { MODKEY, XK_Return, zoom, {0} }, + { MODKEY, XK_z, zoom, {0} }, { MODKEY, XK_Tab, view, {0} }, { MODKEY|ShiftMask, XK_c, killclient, {0} }, { MODKEY, XK_t, setlayout, {.v = &layouts[0]} }, @@ -90,6 +91,8 @@ static const Key keys[] = { { MODKEY, XK_period, focusmon, {.i = +1 } }, { MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } }, { MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } }, + { MODKEY|ShiftMask, XK_Print, spawn, {.v = scrncmd } }, + { 0, XF86XK_AudioPlay, spawn, {.v = playcmd } }, TAGKEYS( XK_1, 0) TAGKEYS( XK_2, 1) TAGKEYS( XK_3, 2) diff --git a/machines/universedesktop/desktop/dwm/st-config.def.h b/machines/universedesktop/desktop/dwm/st-config.def.h index 2200e3c..ed296a3 100644 --- a/machines/universedesktop/desktop/dwm/st-config.def.h +++ b/machines/universedesktop/desktop/dwm/st-config.def.h @@ -193,12 +193,12 @@ static Shortcut shortcuts[] = { { ControlMask, XK_Print, toggleprinter, {.i = 0} }, { ShiftMask, XK_Print, printscreen, {.i = 0} }, { XK_ANY_MOD, XK_Print, printsel, {.i = 0} }, - { TERMMOD|ShiftMask, XK_KP_Subtract, zoom, {.f = -1} }, - { TERMMOD|ShiftMask, XK_KP_Equal, zoom, {.f = +1} }, - { TERMMOD, XK_Home, zoomreset, {.f = 0} }, - { TERMMOD, XK_C, clipcopy, {.i = 0} }, - { TERMMOD, XK_V, clippaste, {.i = 0} }, - { TERMMOD, XK_Y, selpaste, {.i = 0} }, + { ControlMask|ShiftMask, XK_KP_Subtract, zoom, {.f = -1} }, + { ControlMask|ShiftMask, XK_KP_Equal, zoom, {.f = +1} }, + { ControlMask, XK_Home, zoomreset, {.f = 0} }, + { ControlMask|ShiftMask, XK_C, clipcopy, {.i = 0} }, + { ControlMask|ShiftMask, XK_V, clippaste, {.i = 0} }, + { ControlMask, XK_Y, selpaste, {.i = 0} }, { ShiftMask, XK_Insert, selpaste, {.i = 0} }, { TERMMOD, XK_Num_Lock, numlock, {.i = 0} }, };