summaryrefslogtreecommitdiff
path: root/common/modules/window_managers/dwm
diff options
context:
space:
mode:
authorbeeb5k (Vivek Tiwari) <beebeeb5k@gmail.com>2026-06-04 23:45:29 +0530
committerbeeb5k (Vivek Tiwari) <beebeeb5k@gmail.com>2026-06-04 23:45:29 +0530
commit2c2669697fdeaf7316feed3449d2082d255de5af (patch)
tree4d8ed566c2be1ec01c54a3eb6106c40fa79ddb8a /common/modules/window_managers/dwm
parentb6e25e72d30d9810abc0eb48058334e2495350f8 (diff)
Debloat
Diffstat (limited to 'common/modules/window_managers/dwm')
-rw-r--r--common/modules/window_managers/dwm/default.nix176
-rw-r--r--common/modules/window_managers/dwm/picom.nix63
-rw-r--r--common/modules/window_managers/dwm/scripts.nix113
3 files changed, 0 insertions, 352 deletions
diff --git a/common/modules/window_managers/dwm/default.nix b/common/modules/window_managers/dwm/default.nix
deleted file mode 100644
index 49537a2..0000000
--- a/common/modules/window_managers/dwm/default.nix
+++ /dev/null
@@ -1,176 +0,0 @@
-{
- homeManager,
- inputs,
- moduleNameSpace,
- ...
-}:
-{
- config,
- lib,
- pkgs,
- ...
-}:
-let
- cfg = config.${moduleNameSpace}.windowManagers;
- st-patched =
- (pkgs.st.override {
- extraLibs = [ pkgs.libXcursor ];
- }).overrideAttrs
- (oldAttrs: rec {
- patches = map pkgs.fetchpatch [
- {
- url = "https://st.suckless.org/patches/xresources/st-xresources-20230320-45a15676.diff";
- sha256 = "sha256-WcL9IeyanXFiOFDGGRU0QNT8DU7wSo2o+3n+TaqASUY=";
- }
- {
- url = "https://st.suckless.org/patches/vertcenter/st-vertcenter-20231003-eb3b894.diff";
- sha256 = "sha256-RbFNdGNi5HLAp1s8QOX3qsfxpkLcp1p/vksyZORN/uc=";
- }
- {
- url = "https://st.suckless.org/patches/anysize/st-anysize-20220718-baa9357.diff";
- hash = "sha256-yx9VSwmPACx3EN3CAdQkxeoJKJxQ6ziC9tpBcoWuWHc=";
- }
- {
- url = "https://st.suckless.org/patches/csi_22_23/st-csi_22_23-0.8.5.diff";
- hash = "sha256-+izEkGVkLCbhZNBD2WN4uX5j+YMmou7JaMVmPG0mrYk=";
- }
- {
- url = "https://st.suckless.org/patches/sync/st-appsync-20200618-b27a383.diff";
- sha256 = "sha256-lys7/nup7a+GcmW+CutX0kjmbbOis2stkuhw02beuPs=";
- }
- {
- url = "https://st.suckless.org/patches/fix_keyboard_input/st-fix-keyboard-input-20180605-dc3b5ba.diff";
- sha256 = "sha256-h5ZrCj4IrkMQanLSMmgXaRd7qZYqvbzqUnuFt/axsMI=";
- }
- {
- url = "https://st.suckless.org/patches/boxdraw/st-boxdraw_v2-0.8.5.diff";
- sha256 = "sha256-WN/R6dPuw1eviHOvVVBw2VBSMDtfi1LCkXyX36EJKi4=";
- }
- {
- url = "https://st.suckless.org/patches/bold-is-not-bright/st-bold-is-not-bright-20190127-3be4cf1.diff";
- sha256 = "sha256-IhrTgZ8K3tcf5HqSlHm3GTacVJLOhO7QPho6SCGXTHw=";
- }
- ];
-
- postPatch = oldAttrs.postPatch or "" + ''
- sed -i 's/const int boxdraw = 0;/const int boxdraw = 1;/g' config.def.h
- sed -i 's/const int boxdraw_bold = 0;/const int boxdraw_bold = 1;/g' config.def.h
-
- grep -q Xcursor x.c || sed -i '/#include <X11\/XKBlib.h>/a #include <X11/Xcursor/Xcursor.h>' x.c
-
- sed -i 's/XCreateFontCursor/XcursorLibraryLoadCursor/g' x.c
-
- sed -i 's/static unsigned int mouseshape/static char *mouseshape/' config.def.h
- sed -i 's/XC_xterm/"ibeam"/' config.def.h
-
- sed -i 's/-lXft/-lXft -lXcursor/g' config.mk
- '';
- });
-in
-{
- imports = [
- # (import ./picom.nix homeManager)
- (import ./scripts.nix homeManager)
- ];
-
- config = lib.mkIf cfg.dwm.enable (
- if !homeManager then
- {
- services.xserver = {
- enable = true;
- windowManager.dwm = {
- enable = true;
- package = inputs.mydwm.packages.${pkgs.stdenv.hostPlatform.system}.default;
- };
- autoRepeatDelay = 300;
- autoRepeatInterval = 20;
- excludePackages = with pkgs; [ xterm ];
- displayManager.sessionCommands = ''
- ${pkgs.systemd}/bin/systemctl --user import-environment DISPLAY XAUTHORITY XDG_SESSION_TYPE
- ${pkgs.dbus}/bin/dbus-update-activation-environment --systemd DISPLAY XAUTHORITY XDG_SESSION_TYPE
- '';
- };
-
- programs.ssh.askPassword = "";
- }
- else
- {
- xdg.dataFile."dwm/autostart.sh" = {
- executable = true;
- text = ''
- #!${pkgs.bash}/bin/bash
-
- gnome-keyring-daemon --start --components=secrets,ssh,pkcs11 &
- ${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1 &
-
- [ -f ~/.Xresources ] && xrdb -merge ~/.Xresources
- xrandr --output eDP --set TearFree on
-
- sync_dms
- systemctl --user restart xidlehook.service xautolock-session.service xss-lock.service clipcat.service
- '';
- };
-
- home.packages = with pkgs; [
- st-patched
- xdotool
- xclip
- (pkgs.dmenu.overrideAttrs (oldAttrs: {
- patches = (oldAttrs.patches or [ ]) ++ [
- (pkgs.fetchpatch {
- url = "https://tools.suckless.org/dmenu/patches/xresources/dmenu-xresources-4.9.diff";
- sha256 = "sha256-Np9I8hhnwmGA3W5v4tSrBN9Or8Q2Ag9x8H3yf8L9jDI=";
- })
- ];
- }))
- ];
-
- services.clipcat = {
- enable = false;
- daemonSettings = {
- daemonize = false;
- max_history = 50;
- desktop_notification = {
- enable = false;
- };
- };
- menuSettings = {
- server_endpoint = "/run/user/1000/clipcat/grpc.sock";
- finder = "rofi";
-
- rofi = {
- menu_length = 10;
- line_length = 100;
- menu_prompt = "Clipboard";
- extra_arguments = [ ];
- };
- };
- };
-
- systemd.user.services.clipcat = {
- Unit = {
- ConditionEnvironment = [ "XDG_SESSION_TYPE=x11" ];
- };
- };
-
- xresources.extraConfig = lib.mkIf config.beeMods.matugen.enable ''
- #include "${config.xdg.configHome}/x11/matugen.Xresources"
- '';
-
- xresources.properties = {
- "Xft.dpi" = 96;
- "Xft.autohint" = 0;
- "Xft.antialias" = true;
- "Xft.hinting" = true;
- "Xft.lcdfilter" = "lcddefault";
- "Xft.hintstyle" = "hintfull";
- "Xft.rgba" = "rgb";
- "st.font" =
- "JetBrainsMono Nerd Font:size=${toString config.beeMods.terminal.font.size}:antialias=true:autohint=true";
- "dmenu.font" =
- "${config.beeMods.terminal.font.family}:size=${toString config.beeMods.terminal.font.size}";
- # "st.borderpx" = 2;
- };
- }
- );
-}
diff --git a/common/modules/window_managers/dwm/picom.nix b/common/modules/window_managers/dwm/picom.nix
deleted file mode 100644
index f0b8d17..0000000
--- a/common/modules/window_managers/dwm/picom.nix
+++ /dev/null
@@ -1,63 +0,0 @@
-homeManager:
-{ config, lib, ... }:
-let
- cfg = config.beeMods.windowManagers;
-in
-{
- config = lib.mkIf cfg.enable (
- lib.optionalAttrs homeManager {
- services.picom = {
- enable = true;
- backend = "glx";
- vSync = true;
-
- activeOpacity = if cfg.window.blur.enable then 0.82 else cfg.window.opacity.active;
- inactiveOpacity = if cfg.window.blur.enable then 0.82 else cfg.window.opacity.inactive;
-
- opacityRules = [
- "100:fullscreen"
- "100:_NET_WM_STATE@:32a *= '_NET_WM_STATE_FULLSCREEN'"
- ];
- settings = {
- blur = {
- method = "dual_kawase";
- strength = cfg.window.blur.strength;
- size = cfg.window.blur.size;
- };
- blur-background = cfg.window.blur.enable;
- blur-background-exclude = [
- "window_type = 'dock'"
- "window_type = 'desktop'"
- "class_g = 'slop'"
- "class_g = 'dwm'"
- "_GTK_FRAME_EXTENTS@"
- "fullscreen"
- "_NET_WM_STATE@:32a *= '_NET_WM_STATE_FULLSCREEN'"
- ];
-
- # xrender-sync-fence = true;
- use-damage = true;
-
- unredir-if-possible = true;
-
- detect-transient = true;
- detect-client-opacity = true;
- mark-wmwin-focused = true;
- mark-ovredir-focused = true;
- detect-rounded-corners = true;
-
- shadow = cfg.shadow;
- fading = false;
- animations = cfg.animations;
- };
- };
-
- # systemd.user.services.picom.Install.wantedBy = lib.mkForce [ ];
- systemd.user.services.picom = {
- Unit = {
- ConditionEnvironment = "XDG_SESSION_TYPE=x11";
- };
- };
- }
- );
-}
diff --git a/common/modules/window_managers/dwm/scripts.nix b/common/modules/window_managers/dwm/scripts.nix
deleted file mode 100644
index 25ecc19..0000000
--- a/common/modules/window_managers/dwm/scripts.nix
+++ /dev/null
@@ -1,113 +0,0 @@
-homeManager:
-{ pkgs, lib, ... }:
-let
- sync_dms = pkgs.writeShellScriptBin "sync_dms" ''
- jq=${pkgs.jq}/bin/jq
- SETTINGS_FILE="$HOME/.config/noctalia/settings.json"
- WALLPAPER_FILE="$HOME/.cache/noctalia/wallpapers.json"
-
- # --- Helpers ---
-
- get_setting() {
- $jq -r "$1" "$SETTINGS_FILE"
- }
-
- toggle_nightlight_state() {
- local tmp=$(mktemp)
- # Flips the boolean cleanly without changing it to a string
- $jq '.nightLight.enabled = (.nightLight.enabled | not)' "$SETTINGS_FILE" > "$tmp" && mv "$tmp" "$SETTINGS_FILE"
- }
-
- # --- Modules ---
-
- apply_wallpaper() {
- # Read dark mode and monitor preferences from settings.json
- local is_dark=$(get_setting '.colorSchemes.darkMode')
- local monitor=$(get_setting '.colorSchemes.monitorForColors')
-
- # Default to eDP-1 if monitor setting is missing
- if [[ "$monitor" == "null" || -z "$monitor" ]]; then
- monitor="eDP-1"
- fi
-
- local mode="light"
- if [[ "$is_dark" == "true" ]]; then
- mode="dark"
- fi
-
- # Use jq variables to safely parse the nested monitor and mode keys
- local wall=$($jq -r --arg mon "$monitor" --arg mode "$mode" '.wallpapers[$mon][$mode]' "$WALLPAPER_FILE")
-
- if [[ "$wall" != "null" && -n "$wall" ]]; then
- ${pkgs.xwallpaper}/bin/xwallpaper --zoom "$wall"
- fi
- }
-
- apply_nightlight() {
- local is_night_mode=$(get_setting '.nightLight.enabled')
- local night_temp=$(get_setting '.nightLight.nightTemp')
-
- if [[ "$is_night_mode" == "true" ]]; then
- echo "bitch $is_night_mode"
- # -P resets prior adjustments, -O applies one-shot manual temperature
- ${pkgs.redshift}/bin/redshift -P -O "$night_temp"
- else
- # -x clears all redshift adjustments
- ${pkgs.redshift}/bin/redshift -x
- fi
- }
-
- sync_all() {
- apply_wallpaper
- apply_nightlight
- }
-
- dmenu_settings() {
- local is_night_mode=$(get_setting '.nightLight.enabled')
- local options="Toggle NightMode (Currently $is_night_mode)\nSync Now"
-
- local choice=$(echo -e "$options" | dmenu -p "Settings:")
-
- case "$choice" in
- *"NightMode"*)
- toggle_nightlight_state
- # Immediately apply the new state after toggling
- apply_nightlight
- ;;
- "Sync Now")
- sync_all
- ;;
- esac
- }
-
- # --- Main ---
-
- case "$1" in
- settings) dmenu_settings ;;
- *) sync_all ;;
- esac
- '';
- logout_dmenu = pkgs.writeShellScriptBin "logout_dmenu" ''
- options="Lock\nLogout\nReboot\nShutdown"
-
- choice=$(echo -e "$options" | dmenu -p "System:")
-
- case "$choice" in
- Lock) slock ;;
- Logout) pkill dwm ;;
- Reboot) reboot ;;
- Shutdown) poweroff ;;
- *) exit 1 ;;
- esac
- '';
-in
-{
- config = lib.mkIf homeManager (
- lib.optionalAttrs homeManager {
- home.packages = with pkgs; [
- sync_dms
- logout_dmenu
- ];
- }
- );
-}