summaryrefslogtreecommitdiff
path: root/common/modules/dwm
diff options
context:
space:
mode:
Diffstat (limited to 'common/modules/dwm')
-rw-r--r--common/modules/dwm/default.nix202
-rw-r--r--common/modules/dwm/picom.nix60
2 files changed, 0 insertions, 262 deletions
diff --git a/common/modules/dwm/default.nix b/common/modules/dwm/default.nix
deleted file mode 100644
index 8141dbf..0000000
--- a/common/modules/dwm/default.nix
+++ /dev/null
@@ -1,202 +0,0 @@
-{
- homeManager,
- inputs,
- moduleNameSpace,
- ...
-}:
-{
- config,
- lib,
- pkgs,
- ...
-}:
-let
- cfg = config.${moduleNameSpace}.dwm;
-in
-{
- imports = lib.optionals homeManager [ ./picom.nix ];
-
- options.${moduleNameSpace}.dwm = {
- enable = lib.mkEnableOption "dwm setup";
- picom = {
- enable = lib.mkEnableOption "enable picom compositor";
- animations = lib.mkEnableOption "enable animations";
- shadow = lib.mkEnableOption "enable shadows";
- window = {
- opacity = {
- active = lib.mkOption {
- type = lib.types.float;
- default = 1.0;
- };
- inactive = lib.mkOption {
- type = lib.types.float;
- default = 1.0;
- };
- };
- blur = {
- enable = lib.mkEnableOption "Enable window blur";
- strength = lib.mkOption {
- type = lib.types.int;
- default = 1;
- };
- size = lib.mkOption {
- type = lib.types.int;
- default = 10;
- };
- };
- };
- };
- };
-
- config = lib.mkIf cfg.enable (
- if !homeManager then
- {
- services.xserver = {
- enable = true;
- 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
- '';
- windowManager.dwm = {
- enable = true;
- package = inputs.mydwm.packages.${pkgs.stdenv.hostPlatform.system}.default;
- };
- };
-
- programs.ssh.askPassword = "";
-
- security.pam.services.betterlockscreen = { };
- security.pam.services.i3lock = { };
-
- programs.i3lock = {
- enable = true;
- package = pkgs.i3lock-color;
- };
- }
- 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 &
-
- feh --no-fehbg --bg-fill "$(rg wallpaper ~/.config/beeSettings | cut -d"=" -f2)"
- [ -f ~/.Xresources ] && xrdb -merge ~/.Xresources
-
- dunst &
- clipcatd &
- slstatus &
- ${lib.optionalString (!cfg.picom.enable) ''
- xrandr --output eDP --set TearFree on
- ''}
- ${lib.optionalString (cfg.picom.enable) ''
- systemctl --user restart picom.service
- ''}
-
- systemctl --user restart xidlehook.service xautolock-session.service xss-lock.service clipcat.service
- ${lib.optionalString (config.beeMods.mango.waybar) ''
- systemctl --user stop waybar.service
- ''}
- ${lib.optionalString (config.beeMods.mango.enable) ''
- systemctl --user stop swayidle.service
- ''}
- '';
- };
-
- services.clipcat = {
- enable = true;
- 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 = [ ];
- };
- };
- };
-
- services.screen-locker = {
- enable = true;
- inactiveInterval = 5;
- lockCmd = "${pkgs.betterlockscreen}/bin/betterlockscreen -l";
-
- xss-lock.extraOptions = [
- "-n"
- "--transfer-sleep-lock"
- ];
- };
-
- services.xidlehook = {
- enable = true;
- timers = [
- {
- delay = 270;
- command = "${pkgs.brightnessctl}/bin/brightnessctl g > /tmp/brightness_prev && ${pkgs.brightnessctl}/bin/brightnessctl set 10%";
- canceller = "${pkgs.brightnessctl}/bin/brightnessctl set $(${pkgs.coreutils}/bin/cat /tmp/brightness_prev 2>/dev/null || echo 100%)";
- }
- {
- delay = 900;
- command = "systemctl suspend";
- canceller = "";
- }
- ];
- };
-
- systemd.user.services.clipcat = {
- Unit = {
- ConditionEnvironment = [ "XDG_SESSION_TYPE=x11" ];
- };
-
- };
- systemd.user.services.xidlehook = {
- Unit = {
- ConditionEnvironment = [ "XDG_SESSION_TYPE=x11" ];
- };
- };
-
- systemd.user.services.xautolock-session = {
- Unit = {
- ConditionEnvironment = [ "XDG_SESSION_TYPE=x11" ];
- };
- };
-
- systemd.user.services.xss-lock = {
- 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" =
- "${config.beeMods.terminal.font.family}:size=${toString config.beeMods.terminal.font.size}:antialias=true:autohint=true";
- "st.borderpx" = 5;
- };
- }
- );
-}
diff --git a/common/modules/dwm/picom.nix b/common/modules/dwm/picom.nix
deleted file mode 100644
index b338df8..0000000
--- a/common/modules/dwm/picom.nix
+++ /dev/null
@@ -1,60 +0,0 @@
-{ config, lib, ... }:
-let
- cfg = config.beeMods.dwm.picom;
-in
-{
- config = lib.mkIf cfg.enable {
- 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";
- };
- };
- };
-}