From 03a6ab8fcd6e55435528df88f4917c31f70cabff Mon Sep 17 00:00:00 2001 From: Alex van de Sandt Date: Thu, 25 Jun 2026 18:54:10 +0000 Subject: [PATCH] Reorganize desktop folder --- modules/fonts.nix | 16 ---------------- modules/kitty.nix | 44 -------------------------------------------- modules/sddm.nix | 10 ---------- modules/zen.nix | 25 ------------------------- modules/desktop/_hyprland-settings.nix | 277 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ modules/desktop/fonts.nix | 16 ++++++++++++++++ modules/desktop/hyprland.nix | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ modules/desktop/hyprpaper.nix | 19 +++++++++++++++++++ modules/desktop/kitty.nix | 44 ++++++++++++++++++++++++++++++++++++++++++++ modules/desktop/sddm.nix | 10 ++++++++++ modules/desktop/zen.nix | 25 +++++++++++++++++++++++++ modules/hyprland/_settings.nix | 277 ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- modules/hyprland/hyprland.nix | 60 ------------------------------------------------------------ modules/hyprland/hyprpaper.nix | 19 ------------------- modules/desktop/waybar/power_menu.xml | 18 ++++++++++++++++++ modules/desktop/waybar/style.css | 41 +++++++++++++++++++++++++++++++++++++++++ modules/desktop/waybar/waybar.nix | 134 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ modules/hyprland/waybar/power_menu.xml | 18 ------------------ modules/hyprland/waybar/style.css | 41 ----------------------------------------- modules/hyprland/waybar/waybar.nix | 134 -------------------------------------------------------------------------------------------------------------------------------------- 20 file(s) changed, 644 insertion(s)(+), 644 deletion(s)(-) diff --git a/modules/fonts.nix b/modules/fonts.nix deleted file mode 100644 --- a/modules/fonts.nix +++ /dev/null @@ -1,16 +0,0 @@ -{ - den.aspects.fonts = { - nixos = { pkgs, ... }: { - fonts.packages = with pkgs; [ - iosevka - nerd-fonts.iosevka - ]; - fonts.fontconfig.defaultFonts = { - monospace = [ - # "Berkeley Mono" - "iosevka" - ]; - }; - }; - }; -} diff --git a/modules/kitty.nix b/modules/kitty.nix deleted file mode 100644 --- a/modules/kitty.nix +++ /dev/null @@ -1,44 +0,0 @@ -{ - den.aspects.kitty = { - homeManager = { - programs.kitty = { - enable = true; - enableGitIntegration = true; - - themeFile = "Catppuccin-Frappe"; - settings = { - # font_family = "family='Berkeley Mono' postscript_name=BerkeleyMono-Regular"; - cursor_trail = 1; - - scrollbar = "hovered"; - scrollbar_width = 1.5; - scrollbar_hover_width = 1.5; - scrollbar_radius = 0.5; - - mouse_hide_wait = "1.0 0 0 no"; - - strip_trailing_spaces = "smart"; - - active_border_color = "blue"; - inactive_border_color = "white"; - bell_border_color = "red"; - - inactive_text_alpha = 0.6; - - tab_bar_style = "slant"; - - background_opacity = 0.9; - transparent_background_colors = "#3b3f53@0.9"; - }; - keybindings = { - "ctrl+up" = "neighboring_window up"; - "ctrl+right" = "neighboring_window right"; - "ctrl+down" = "neighboring_window down"; - "ctrl+left" = "neighboring_window left"; - "ctrl+shfit+p" = "nth_window -1"; - "ctrl+alt+t" = "detach_window new-tab"; - }; - }; - }; - }; -} diff --git a/modules/sddm.nix b/modules/sddm.nix deleted file mode 100644 --- a/modules/sddm.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ - den.aspects.sddm = { - nixos = { - services.displayManager.sddm = { - enable = true; - wayland.enable = true; - }; - }; - }; -} diff --git a/modules/zen.nix b/modules/zen.nix deleted file mode 100644 --- a/modules/zen.nix +++ /dev/null @@ -1,25 +0,0 @@ -{ inputs, ... }: { - flake-file.inputs.zen-browser = { - url = "github:youwen5/zen-browser-flake"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - - den.aspects.zen = { host, ... }: { - homeManager = { - home.packages = [ - inputs.zen-browser.packages.${host.system}.default - ]; - - xdg.mimeApps = { - enable = true; - defaultApplications = { - "text/html" = "zen.desktop"; - "x-scheme-handler/http" = "zen.desktop"; - "x-scheme-handler/https" = "zen.desktop"; - "x-scheme-handler/about" = "zen.desktop"; - "x-scheme-handler/unknown" = "zen.desktop"; - }; - }; - }; - }; -} diff --git a/modules/desktop/_hyprland-settings.nix b/modules/desktop/_hyprland-settings.nix new file mode 100644 --- /dev/null +++ b/modules/desktop/_hyprland-settings.nix @@ -0,0 +1,277 @@ +{ + wayland.windowManager.hyprland = { + settings = { + # monitor settings https://wiki.hypr.land/0.54.0/Configuring/Monitors/ + monitor = [ + "HDMI-A-2, 2560x1440@144.00Hz, auto, auto, cm, auto" + "eDP-1, preferred, auto, auto, cm, auto" + ]; + + # keywords https://wiki.hypr.land/0.54.0/Configuring/Keywords/ + "$terminal" = "kitty"; + "$browser " = "zen"; + "$menu " = "hyprlauncher"; + "$mainMod" = "SUPER"; + + # TODO: use an autostart quirk + exec-once = [ + "1password --silent &" + # "hyprpaper &" + ]; + + # environment variables https://wiki.hypr.land/0.54.0/Configuring/Environment-variables/ + env = [ + "XCURSOR_SIZE,24" + "HYPRCURSOR_SIZE,24" + "HYPRCURSOR_THEME,phinger-cursors-dark" + ]; + + # look and feel, https://wiki.hypr.land/0.54.0/Configuring/Variables/#general + general = { + gaps_in = 3; + gaps_out = 3; + border_size = 3; + + "col.active_border " = "rgba(800080aa)"; + "col.inactive_border " = "rgba(a3a3a3ee)"; + }; + + resize_on_border = false; + + allow_tearing = false; + + # https://wiki.hypr.land/0.54.0/Configuring/Variables/#decoration + decoration = { + rounding = 10; + rounding_power = 10; + + active_opacity = 1.0; + inactive_opacity = 1.0; + + # https://wiki.hypr.land/0.54.0/Configuring/Variables/#blur + shadow = { + enabled = true; + range = 4; + render_power = 3; + color = "rgba(1a1a1aee)"; + }; + + # https://wiki.hypr.land/0.54.0/Configuring/Variables/#blur + blur = { + enabled = true; + size = 3; + passes = 1; + + vibrancy = 0.1696; + }; + }; + + # https://wiki.hypr.land/0.54.0/Configuring/Variables/#animations + animations = { + enabled = true; + + bezier = [ + #NAME, X0, Y0, X1, Y1 + "easeOutQuint, 0.23, 1, 0.32, 1" + "easeInOutCubic, 0.65, 0.05, 0.36, 1" + "linear, 0, 0, 1, 1" + "almostLinear, 0.5, 0.5, 0.75, 1" + "quick, 0.15, 0, 0.1, 1" + ]; + + # defaults, https://wiki.hypr.land/0.54.0/Configuring/Animations/ + animation = [ + #NAME, ONOFF, SPEED, CURVE, [STYLE] + "global, 1, 10, default" + "border, 1, 5.39, easeOutQuint" + "windows, 1, 4.79, easeOutQuint" + "windowsIn, 1, 4.1, easeOutQuint, popin 87%" + "windowsOut, 1, 1.49, linear, popin 87%" + "fadeIn, 1, 1.73, almostLinear" + "fadeOut, 1, 1.46, almostLinear" + "fade, 1, 3.03, quick" + "layers, 1, 3.81, easeOutQuint" + "layersIn, 1, 4, easeOutQuint, fade" + "layersOut, 1, 1.5, linear, fade" + "fadeLayersIn, 1, 1.79, almostLinear" + "fadeLayersOut, 1, 1.39, almostLinear" + "workspaces, 1, 1.94, almostLinear, fade" + "workspacesIn, 1, 1.21, almostLinear, fade" + "workspacesOut, 1, 1.94, almostLinear, fade" + "zoomFactor, 1, 7, quick" + ]; + }; + + # https://wiki.hypr.land/0.54.0/Configuring/Dwindle-Layout/ + dwindle = { + preserve_split = true; + }; + + # https://wiki.hypr.land/0.54.0/Configuring/Master-Layout/ + master = { + new_status = "master"; + }; + + # https://wiki.hypr.land/0.54.0/Configuring/Variables/#misc + # https://wiki.hypr.land/0.54.0/Configuring/Variables/#misc + misc = { + # disable default wallpaper + force_default_wallpaper = 0; + # disable logo rendering + disable_hyprland_logo = true; + # disable annoying random background text + disable_splash_rendering = true; + }; + + # https://wiki.hypr.land/0.54.0/Configuring/Variables/#misc + input = { + kb_layout = "us"; + follow_mouse = 0; + }; + + # Don't scale xwayland apps, fix for discord & steam + xwayland.force_zero_scaling = true; + + # keybindings, https://wiki.hypr.land/0.54.0/Configuring/Binds/ + bindu = [ + "$mainMod, return, exec, $terminal" + ]; + bind = [ + "$mainMod SHIFT, Q, killactive," + "$mainMod, M, exit," + "$mainMod, V, togglefloating," + "$mainMod, SPACE, exec, $menu" + "$mainMod, F, exec, $browser" + "$mainMod, TAB, focuscurrentorlast" + + # Move focus with mainMod + arrow keys + "$mainMod, H, movefocus, l" + "$mainMod, L, movefocus, r" + "$mainMod, K, movefocus, u" + "$mainMod, J, movefocus, d" + + # Move windows + "$mainMod SHIFT, H, movewindow, l" + "$mainMod SHIFT, L, movewindow, r" + "$mainMod SHIFT, K, movewindow, u" + "$mainMod SHIFT, J, movewindow, d" + + # Switch workspaces with mainMod + [0-9] + "$mainMod, 1, workspace, 1" + "$mainMod, 2, workspace, 2" + "$mainMod, 3, workspace, 3" + "$mainMod, 4, workspace, 4" + "$mainMod, 5, workspace, 5" + "$mainMod, 6, workspace, 6" + "$mainMod, 7, workspace, 7" + "$mainMod, 8, workspace, 8" + "$mainMod, 9, workspace, 9" + "$mainMod, 0, workspace, 10" + + # Move active window to a workspace with mainMod + SHIFT + [0-9] + "$mainMod SHIFT, 1, movetoworkspace, 1" + "$mainMod SHIFT, 2, movetoworkspace, 2" + "$mainMod SHIFT, 3, movetoworkspace, 3" + "$mainMod SHIFT, 4, movetoworkspace, 4" + "$mainMod SHIFT, 5, movetoworkspace, 5" + "$mainMod SHIFT, 6, movetoworkspace, 6" + "$mainMod SHIFT, 7, movetoworkspace, 7" + "$mainMod SHIFT, 8, movetoworkspace, 8" + "$mainMod SHIFT, 9, movetoworkspace, 9" + "$mainMod SHIFT, 0, movetoworkspace, 10" + + # Switch to app-specific workspaces + "$mainMod , D, workspace, discord" + "$mainMod SHIFT, D, movetoworkspace, discord" + "$mainMod , S, workspace, steam" + "$mainMod SHIFT, S, movetoworkspace, steam" + "$mainMod , P, workspace, spotify" + "$mainMod SHIFT, P, movetoworkspace, spotify" + + # Scroll through existing workspaces with mainMod + scroll + "$mainMod, mouse_up, workspace, e+1" + "$mainMod, mouse_down, workspace, e-1" + + # Enter resize mode + "$mainMod SHIFT, R, submap, resize" + ]; + + bindm = [ + # Move/resize windows with mainMod + LMB/RMB and dragging + "$mainMod, mouse:272, movewindow" + "$mainMod, mouse:273, resizewindow" + ]; + + bindel = [ + # Volume control + ",XF86AudioRaiseVolume, exec, wpctl set-volume -l 1 @DEFAULT_AUDIO_SINK@ 5%+" + ",XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-" + ",XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle" + + # Backlight brightness + ",XF86MonBrightnessUp, exec, brightnessctl set 10%+" + ",XF86MonBrightnessDown, exec, brightnessctl set 10%-" + + # Requires playerctl + # ", XF86AudioNext, exec, playerctl next" + # ", XF86AudioPause, exec, playerctl play-pause" + # ", XF86AudioPlay, exec, playerctl play-pause" + # ", XF86AudioPrev, exec, playerctl previous" + ]; + + windowrule = [ + { + # Ignore maximize requests from all apps. You'll probably like this. + name = "suppress-maximize-events"; + "match:class" = ".*"; + suppress_event = "maximize"; + } + { + # Fix some dragging issues with XWayland + name = "fix-xwayland-drags"; + "match:class" = "^$"; + "match:title" = "^$"; + "match:xwayland" = true; + "match:float" = true; + "match:fullscreen" = false; + "match:pin" = false; + no_focus = true; + } + { + name = "discord"; + "match:class" = "discord"; + workspace = "name:discord"; + } + { + name = "steam"; + "match:class" = "steam"; + workspace = "name:steam"; + } + { + name = "spotify"; + "match:class" = "Spotify"; + workspace = "name:spotify"; + } + ]; + }; + + # submaps + submaps = { + resize = { + settings = { + binde = [ + # hold vim keys to expand or shrink window + ", h, resizeactive, -10 0" + ", l, resizeactive, 10 0" + ", k, resizeactive, 0 -10" + ", j, resizeactive, 0 10" + + # reset with any key + ", catchall, submap, reset" + ", escape, submap, reset" + ]; + }; + }; + }; + }; +} diff --git a/modules/desktop/fonts.nix b/modules/desktop/fonts.nix new file mode 100644 --- /dev/null +++ b/modules/desktop/fonts.nix @@ -0,0 +1,16 @@ +{ + den.aspects.fonts = { + nixos = { pkgs, ... }: { + fonts.packages = with pkgs; [ + iosevka + nerd-fonts.iosevka + ]; + fonts.fontconfig.defaultFonts = { + monospace = [ + # "Berkeley Mono" + "iosevka" + ]; + }; + }; + }; +} diff --git a/modules/desktop/hyprland.nix b/modules/desktop/hyprland.nix new file mode 100644 --- /dev/null +++ b/modules/desktop/hyprland.nix @@ -0,0 +1,60 @@ +{ den, inputs, ... }: +{ + flake-file.inputs = { + hyprland.url = "github:hyprwm/Hyprland"; + }; + + den.aspects.hyprland = { + includes = with den.aspects; [ + hyprland.hyprpaper + hyprland.waybar + ]; + + nixos = { pkgs, ... }: { + programs.hyprland = + let + hyprland = inputs.hyprland; + in + { + enable = true; + package = hyprland.packages.${pkgs.stdenv.hostPlatform.system}.hyprland; + portalPackage = hyprland.packages.${pkgs.stdenv.hostPlatform.system}.xdg-desktop-portal-hyprland; + xwayland.enable = true; + withUWSM = true; + }; + + # Use cachix + nix.settings = { + substituters = [ "https://hyprland.cachix.org" ]; + trusted-substituters = [ "https://hyprland.cachix.org" ]; + trusted-public-keys = [ "hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc=" ]; + }; + + services.xserver.xkb = { + layout = "us"; + variant = ""; + }; + }; + + homeManager = { + imports = [ ./_hyprland-settings.nix ]; + + xdg.portal.config.common.default = "*"; + + wayland.windowManager.hyprland = { + enable = true; + package = null; + systemd.enable = true; + configType = "hyprlang"; + }; + + services.hyprlauncher = { + enable = true; + settings = { + finders.desktop_icons = true; + general.grab_focus = true; + }; + }; + }; + }; +} diff --git a/modules/desktop/hyprpaper.nix b/modules/desktop/hyprpaper.nix new file mode 100644 --- /dev/null +++ b/modules/desktop/hyprpaper.nix @@ -0,0 +1,19 @@ +{ + den.aspects.hyprland.hyprpaper = { + homeManager = { + services.hyprpaper = { + enable = true; + settings = { + preload = [ "~/Pictures/nomo2.jpg" ]; + wallpaper = [ + { + monitor = "HDMI-A-2"; + path = "~/Pictures/nomo2.jpg"; + } + ]; + splash = false; + }; + }; + }; + }; +} diff --git a/modules/desktop/kitty.nix b/modules/desktop/kitty.nix new file mode 100644 --- /dev/null +++ b/modules/desktop/kitty.nix @@ -0,0 +1,44 @@ +{ + den.aspects.kitty = { + homeManager = { + programs.kitty = { + enable = true; + enableGitIntegration = true; + + themeFile = "Catppuccin-Frappe"; + settings = { + # font_family = "family='Berkeley Mono' postscript_name=BerkeleyMono-Regular"; + cursor_trail = 1; + + scrollbar = "hovered"; + scrollbar_width = 1.5; + scrollbar_hover_width = 1.5; + scrollbar_radius = 0.5; + + mouse_hide_wait = "1.0 0 0 no"; + + strip_trailing_spaces = "smart"; + + active_border_color = "blue"; + inactive_border_color = "white"; + bell_border_color = "red"; + + inactive_text_alpha = 0.6; + + tab_bar_style = "slant"; + + background_opacity = 0.9; + transparent_background_colors = "#3b3f53@0.9"; + }; + keybindings = { + "ctrl+up" = "neighboring_window up"; + "ctrl+right" = "neighboring_window right"; + "ctrl+down" = "neighboring_window down"; + "ctrl+left" = "neighboring_window left"; + "ctrl+shfit+p" = "nth_window -1"; + "ctrl+alt+t" = "detach_window new-tab"; + }; + }; + }; + }; +} diff --git a/modules/desktop/sddm.nix b/modules/desktop/sddm.nix new file mode 100644 --- /dev/null +++ b/modules/desktop/sddm.nix @@ -0,0 +1,10 @@ +{ + den.aspects.sddm = { + nixos = { + services.displayManager.sddm = { + enable = true; + wayland.enable = true; + }; + }; + }; +} diff --git a/modules/desktop/zen.nix b/modules/desktop/zen.nix new file mode 100644 --- /dev/null +++ b/modules/desktop/zen.nix @@ -0,0 +1,25 @@ +{ inputs, ... }: { + flake-file.inputs.zen-browser = { + url = "github:youwen5/zen-browser-flake"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + + den.aspects.zen = { host, ... }: { + homeManager = { + home.packages = [ + inputs.zen-browser.packages.${host.system}.default + ]; + + xdg.mimeApps = { + enable = true; + defaultApplications = { + "text/html" = "zen.desktop"; + "x-scheme-handler/http" = "zen.desktop"; + "x-scheme-handler/https" = "zen.desktop"; + "x-scheme-handler/about" = "zen.desktop"; + "x-scheme-handler/unknown" = "zen.desktop"; + }; + }; + }; + }; +} diff --git a/modules/hyprland/_settings.nix b/modules/hyprland/_settings.nix deleted file mode 100644 --- a/modules/hyprland/_settings.nix +++ /dev/null @@ -1,277 +0,0 @@ -{ - wayland.windowManager.hyprland = { - settings = { - # monitor settings https://wiki.hypr.land/0.54.0/Configuring/Monitors/ - monitor = [ - "HDMI-A-2, 2560x1440@144.00Hz, auto, auto, cm, auto" - "eDP-1, preferred, auto, auto, cm, auto" - ]; - - # keywords https://wiki.hypr.land/0.54.0/Configuring/Keywords/ - "$terminal" = "kitty"; - "$browser " = "zen"; - "$menu " = "hyprlauncher"; - "$mainMod" = "SUPER"; - - # TODO: use an autostart quirk - exec-once = [ - "1password --silent &" - # "hyprpaper &" - ]; - - # environment variables https://wiki.hypr.land/0.54.0/Configuring/Environment-variables/ - env = [ - "XCURSOR_SIZE,24" - "HYPRCURSOR_SIZE,24" - "HYPRCURSOR_THEME,phinger-cursors-dark" - ]; - - # look and feel, https://wiki.hypr.land/0.54.0/Configuring/Variables/#general - general = { - gaps_in = 3; - gaps_out = 3; - border_size = 3; - - "col.active_border " = "rgba(800080aa)"; - "col.inactive_border " = "rgba(a3a3a3ee)"; - }; - - resize_on_border = false; - - allow_tearing = false; - - # https://wiki.hypr.land/0.54.0/Configuring/Variables/#decoration - decoration = { - rounding = 10; - rounding_power = 10; - - active_opacity = 1.0; - inactive_opacity = 1.0; - - # https://wiki.hypr.land/0.54.0/Configuring/Variables/#blur - shadow = { - enabled = true; - range = 4; - render_power = 3; - color = "rgba(1a1a1aee)"; - }; - - # https://wiki.hypr.land/0.54.0/Configuring/Variables/#blur - blur = { - enabled = true; - size = 3; - passes = 1; - - vibrancy = 0.1696; - }; - }; - - # https://wiki.hypr.land/0.54.0/Configuring/Variables/#animations - animations = { - enabled = true; - - bezier = [ - #NAME, X0, Y0, X1, Y1 - "easeOutQuint, 0.23, 1, 0.32, 1" - "easeInOutCubic, 0.65, 0.05, 0.36, 1" - "linear, 0, 0, 1, 1" - "almostLinear, 0.5, 0.5, 0.75, 1" - "quick, 0.15, 0, 0.1, 1" - ]; - - # defaults, https://wiki.hypr.land/0.54.0/Configuring/Animations/ - animation = [ - #NAME, ONOFF, SPEED, CURVE, [STYLE] - "global, 1, 10, default" - "border, 1, 5.39, easeOutQuint" - "windows, 1, 4.79, easeOutQuint" - "windowsIn, 1, 4.1, easeOutQuint, popin 87%" - "windowsOut, 1, 1.49, linear, popin 87%" - "fadeIn, 1, 1.73, almostLinear" - "fadeOut, 1, 1.46, almostLinear" - "fade, 1, 3.03, quick" - "layers, 1, 3.81, easeOutQuint" - "layersIn, 1, 4, easeOutQuint, fade" - "layersOut, 1, 1.5, linear, fade" - "fadeLayersIn, 1, 1.79, almostLinear" - "fadeLayersOut, 1, 1.39, almostLinear" - "workspaces, 1, 1.94, almostLinear, fade" - "workspacesIn, 1, 1.21, almostLinear, fade" - "workspacesOut, 1, 1.94, almostLinear, fade" - "zoomFactor, 1, 7, quick" - ]; - }; - - # https://wiki.hypr.land/0.54.0/Configuring/Dwindle-Layout/ - dwindle = { - preserve_split = true; - }; - - # https://wiki.hypr.land/0.54.0/Configuring/Master-Layout/ - master = { - new_status = "master"; - }; - - # https://wiki.hypr.land/0.54.0/Configuring/Variables/#misc - # https://wiki.hypr.land/0.54.0/Configuring/Variables/#misc - misc = { - # disable default wallpaper - force_default_wallpaper = 0; - # disable logo rendering - disable_hyprland_logo = true; - # disable annoying random background text - disable_splash_rendering = true; - }; - - # https://wiki.hypr.land/0.54.0/Configuring/Variables/#misc - input = { - kb_layout = "us"; - follow_mouse = 0; - }; - - # Don't scale xwayland apps, fix for discord & steam - xwayland.force_zero_scaling = true; - - # keybindings, https://wiki.hypr.land/0.54.0/Configuring/Binds/ - bindu = [ - "$mainMod, return, exec, $terminal" - ]; - bind = [ - "$mainMod SHIFT, Q, killactive," - "$mainMod, M, exit," - "$mainMod, V, togglefloating," - "$mainMod, SPACE, exec, $menu" - "$mainMod, F, exec, $browser" - "$mainMod, TAB, focuscurrentorlast" - - # Move focus with mainMod + arrow keys - "$mainMod, H, movefocus, l" - "$mainMod, L, movefocus, r" - "$mainMod, K, movefocus, u" - "$mainMod, J, movefocus, d" - - # Move windows - "$mainMod SHIFT, H, movewindow, l" - "$mainMod SHIFT, L, movewindow, r" - "$mainMod SHIFT, K, movewindow, u" - "$mainMod SHIFT, J, movewindow, d" - - # Switch workspaces with mainMod + [0-9] - "$mainMod, 1, workspace, 1" - "$mainMod, 2, workspace, 2" - "$mainMod, 3, workspace, 3" - "$mainMod, 4, workspace, 4" - "$mainMod, 5, workspace, 5" - "$mainMod, 6, workspace, 6" - "$mainMod, 7, workspace, 7" - "$mainMod, 8, workspace, 8" - "$mainMod, 9, workspace, 9" - "$mainMod, 0, workspace, 10" - - # Move active window to a workspace with mainMod + SHIFT + [0-9] - "$mainMod SHIFT, 1, movetoworkspace, 1" - "$mainMod SHIFT, 2, movetoworkspace, 2" - "$mainMod SHIFT, 3, movetoworkspace, 3" - "$mainMod SHIFT, 4, movetoworkspace, 4" - "$mainMod SHIFT, 5, movetoworkspace, 5" - "$mainMod SHIFT, 6, movetoworkspace, 6" - "$mainMod SHIFT, 7, movetoworkspace, 7" - "$mainMod SHIFT, 8, movetoworkspace, 8" - "$mainMod SHIFT, 9, movetoworkspace, 9" - "$mainMod SHIFT, 0, movetoworkspace, 10" - - # Switch to app-specific workspaces - "$mainMod , D, workspace, discord" - "$mainMod SHIFT, D, movetoworkspace, discord" - "$mainMod , S, workspace, steam" - "$mainMod SHIFT, S, movetoworkspace, steam" - "$mainMod , P, workspace, spotify" - "$mainMod SHIFT, P, movetoworkspace, spotify" - - # Scroll through existing workspaces with mainMod + scroll - "$mainMod, mouse_up, workspace, e+1" - "$mainMod, mouse_down, workspace, e-1" - - # Enter resize mode - "$mainMod SHIFT, R, submap, resize" - ]; - - bindm = [ - # Move/resize windows with mainMod + LMB/RMB and dragging - "$mainMod, mouse:272, movewindow" - "$mainMod, mouse:273, resizewindow" - ]; - - bindel = [ - # Volume control - ",XF86AudioRaiseVolume, exec, wpctl set-volume -l 1 @DEFAULT_AUDIO_SINK@ 5%+" - ",XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-" - ",XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle" - - # Backlight brightness - ",XF86MonBrightnessUp, exec, brightnessctl set 10%+" - ",XF86MonBrightnessDown, exec, brightnessctl set 10%-" - - # Requires playerctl - # ", XF86AudioNext, exec, playerctl next" - # ", XF86AudioPause, exec, playerctl play-pause" - # ", XF86AudioPlay, exec, playerctl play-pause" - # ", XF86AudioPrev, exec, playerctl previous" - ]; - - windowrule = [ - { - # Ignore maximize requests from all apps. You'll probably like this. - name = "suppress-maximize-events"; - "match:class" = ".*"; - suppress_event = "maximize"; - } - { - # Fix some dragging issues with XWayland - name = "fix-xwayland-drags"; - "match:class" = "^$"; - "match:title" = "^$"; - "match:xwayland" = true; - "match:float" = true; - "match:fullscreen" = false; - "match:pin" = false; - no_focus = true; - } - { - name = "discord"; - "match:class" = "discord"; - workspace = "name:discord"; - } - { - name = "steam"; - "match:class" = "steam"; - workspace = "name:steam"; - } - { - name = "spotify"; - "match:class" = "Spotify"; - workspace = "name:spotify"; - } - ]; - }; - - # submaps - submaps = { - resize = { - settings = { - binde = [ - # hold vim keys to expand or shrink window - ", h, resizeactive, -10 0" - ", l, resizeactive, 10 0" - ", k, resizeactive, 0 -10" - ", j, resizeactive, 0 10" - - # reset with any key - ", catchall, submap, reset" - ", escape, submap, reset" - ]; - }; - }; - }; - }; -} diff --git a/modules/hyprland/hyprland.nix b/modules/hyprland/hyprland.nix deleted file mode 100644 --- a/modules/hyprland/hyprland.nix +++ /dev/null @@ -1,60 +0,0 @@ -{ den, inputs, ... }: -{ - flake-file.inputs = { - hyprland.url = "github:hyprwm/Hyprland"; - }; - - den.aspects.hyprland = { - includes = with den.aspects; [ - hyprland.hyprpaper - hyprland.waybar - ]; - - nixos = { pkgs, ... }: { - programs.hyprland = - let - hyprland = inputs.hyprland; - in - { - enable = true; - package = hyprland.packages.${pkgs.stdenv.hostPlatform.system}.hyprland; - portalPackage = hyprland.packages.${pkgs.stdenv.hostPlatform.system}.xdg-desktop-portal-hyprland; - xwayland.enable = true; - withUWSM = true; - }; - - # Use cachix - nix.settings = { - substituters = [ "https://hyprland.cachix.org" ]; - trusted-substituters = [ "https://hyprland.cachix.org" ]; - trusted-public-keys = [ "hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc=" ]; - }; - - services.xserver.xkb = { - layout = "us"; - variant = ""; - }; - }; - - homeManager = { - imports = [ ./_settings.nix ]; - - xdg.portal.config.common.default = "*"; - - wayland.windowManager.hyprland = { - enable = true; - package = null; - systemd.enable = true; - configType = "hyprlang"; - }; - - services.hyprlauncher = { - enable = true; - settings = { - finders.desktop_icons = true; - general.grab_focus = true; - }; - }; - }; - }; -} diff --git a/modules/hyprland/hyprpaper.nix b/modules/hyprland/hyprpaper.nix deleted file mode 100644 --- a/modules/hyprland/hyprpaper.nix +++ /dev/null @@ -1,19 +0,0 @@ -{ - den.aspects.hyprland.hyprpaper = { - homeManager = { - services.hyprpaper = { - enable = true; - settings = { - preload = [ "~/Pictures/nomo2.jpg" ]; - wallpaper = [ - { - monitor = "HDMI-A-2"; - path = "~/Pictures/nomo2.jpg"; - } - ]; - splash = false; - }; - }; - }; - }; -} diff --git a/modules/desktop/waybar/power_menu.xml b/modules/desktop/waybar/power_menu.xml new file mode 100644 --- /dev/null +++ b/modules/desktop/waybar/power_menu.xml @@ -0,0 +1,18 @@ + + + + + + Shutdown + + + + + + + + Reboot + + + + diff --git a/modules/desktop/waybar/style.css b/modules/desktop/waybar/style.css new file mode 100644 --- /dev/null +++ b/modules/desktop/waybar/style.css @@ -0,0 +1,41 @@ +* { + border: none; + border-radius: 0; + font-family: 'Berkeley Mono', 'Iosevka Nerd Font'; + font-size: 13px; + min-height: 0; +} + +window#waybar { + background: rgba(43, 48, 59, 0.5); + border-bottom: 3px solid rgba(100, 114, 125, 0.5); + color: white; +} + +tooltip { + background: rgba(43, 48, 59, 0.75); + border: 1px solid rgba(100, 114, 125, 0.5); +} + +tooltip label { + color: white; +} + +#workspaces button { + padding: 0 5px; + background: transparent; + color: white; + border-bottom: 3px solid transparent; +} + +/* highlight active workspace */ +#workspaces button.active { + border-top: 3px solid #a3a3a3; + border-bottom: 3px solid #a3a3a3; + +} + +#clock { + background-color: #64727D; +} + diff --git a/modules/desktop/waybar/waybar.nix b/modules/desktop/waybar/waybar.nix new file mode 100644 --- /dev/null +++ b/modules/desktop/waybar/waybar.nix @@ -0,0 +1,134 @@ +{ + den.aspects.hyprland.waybar = { + homeManager = { + programs.waybar = { + enable = true; + systemd.enable = true; + + settings.main = { + height = 34; + spacing = 10; + + modules-left = [ + "hyprland/workspaces" + "hyprland/submap" + "hyprland/window" + ]; + modules-right = [ + "keyboard-state" + "pulseaudio" + "network" + "cpu" + "memory" + "temperature" + "battery" + "clock" + "tray" + "custom/power" + ]; + + "hyprland/window" = { + rewrite = { + "(.*) — (Zen Browser|Mozilla Firefox)" = "🌎 $1"; + "(.*) - Discord" = "💬 $1"; + }; + separate-outputs = true; + }; + + keyboard-state = { + numlock = true; + capslock = true; + format = { + capslock = "C {icon}"; + numlock = "{icon} N"; + }; + format-icons = { + locked = " "; + unlocked = " "; + }; + }; + + pulseaudio = { + format = "{volume}% {icon} {format_source}"; + format-bluetooth = "{volume}% {icon} {format_source}"; + format-bluetooth-muted = " {icon} {format_source}"; + format-muted = " {format_source}"; + format-source = "{volume}% "; + format-source-muted = " "; + format-icons = { + headphone = ""; + default = [ + " " + " " + " " + ]; + }; + on-click = "pavucontrol"; + }; + + network = { + format-wifi = "{essid} ({signalStrength}%)  "; + format-ethernet = "{ipaddr}/{cidr} 🔌"; + tooltip-format = "{ifname} via {gwaddr} "; + format-linked = "{ifname} (No IP) "; + format-disconnected = "Disconnected ⚠"; + format-alt = "{ifname}: {ipaddr}/{cidr}"; + }; + + cpu = { + format = "{usage}%  "; + tooltip = true; + }; + + memory = { + format = "{used}/{total} GiB ({percentage}%)  "; + tooltip = false; + }; + + temperature = { + critical-threshold = 80; + format = "{temperatureC}°C {icon}"; + format-icons = [ + "" + "" + "" + ]; + }; + + battery = { + format = "{capacity}% {icon}"; + }; + + clock = { + tooltip-format = "{calendar}"; + format = "{0:%H:%M} {0:%Y-%m-%d}"; + }; + + tray = { + spacing = 20; + }; + + "custom/power" = { + format = "⏻ "; + tooltip = false; + menu = "on-click"; + menu-file = "$HOME/.config/waybar/power_menu.xml"; + menu-actions = { + shutdown = "hyprshutdown --post-cmd 'shutdown -P 0'"; + reboot = "hyprshutdown --post-cmd 'reboot'"; + }; + }; + }; + + style = ./style.css; + }; + + home.file = { + waybar-custom-power = { + target = ".config/waybar/power_menu.xml"; + source = ./power_menu.xml; + }; + }; + }; + }; +} diff --git a/modules/hyprland/waybar/power_menu.xml b/modules/hyprland/waybar/power_menu.xml deleted file mode 100644 --- a/modules/hyprland/waybar/power_menu.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - Shutdown - - - - - - - - Reboot - - - - diff --git a/modules/hyprland/waybar/style.css b/modules/hyprland/waybar/style.css deleted file mode 100644 --- a/modules/hyprland/waybar/style.css +++ /dev/null @@ -1,41 +0,0 @@ -* { - border: none; - border-radius: 0; - font-family: 'Berkeley Mono', 'Iosevka Nerd Font'; - font-size: 13px; - min-height: 0; -} - -window#waybar { - background: rgba(43, 48, 59, 0.5); - border-bottom: 3px solid rgba(100, 114, 125, 0.5); - color: white; -} - -tooltip { - background: rgba(43, 48, 59, 0.75); - border: 1px solid rgba(100, 114, 125, 0.5); -} - -tooltip label { - color: white; -} - -#workspaces button { - padding: 0 5px; - background: transparent; - color: white; - border-bottom: 3px solid transparent; -} - -/* highlight active workspace */ -#workspaces button.active { - border-top: 3px solid #a3a3a3; - border-bottom: 3px solid #a3a3a3; - -} - -#clock { - background-color: #64727D; -} - diff --git a/modules/hyprland/waybar/waybar.nix b/modules/hyprland/waybar/waybar.nix deleted file mode 100644 --- a/modules/hyprland/waybar/waybar.nix +++ /dev/null @@ -1,134 +0,0 @@ -{ - den.aspects.hyprland.waybar = { - homeManager = { - programs.waybar = { - enable = true; - systemd.enable = true; - - settings.main = { - height = 34; - spacing = 10; - - modules-left = [ - "hyprland/workspaces" - "hyprland/submap" - "hyprland/window" - ]; - modules-right = [ - "keyboard-state" - "pulseaudio" - "network" - "cpu" - "memory" - "temperature" - "battery" - "clock" - "tray" - "custom/power" - ]; - - "hyprland/window" = { - rewrite = { - "(.*) — (Zen Browser|Mozilla Firefox)" = "🌎 $1"; - "(.*) - Discord" = "💬 $1"; - }; - separate-outputs = true; - }; - - keyboard-state = { - numlock = true; - capslock = true; - format = { - capslock = "C {icon}"; - numlock = "{icon} N"; - }; - format-icons = { - locked = " "; - unlocked = " "; - }; - }; - - pulseaudio = { - format = "{volume}% {icon} {format_source}"; - format-bluetooth = "{volume}% {icon} {format_source}"; - format-bluetooth-muted = " {icon} {format_source}"; - format-muted = " {format_source}"; - format-source = "{volume}% "; - format-source-muted = " "; - format-icons = { - headphone = ""; - default = [ - " " - " " - " " - ]; - }; - on-click = "pavucontrol"; - }; - - network = { - format-wifi = "{essid} ({signalStrength}%)  "; - format-ethernet = "{ipaddr}/{cidr} 🔌"; - tooltip-format = "{ifname} via {gwaddr} "; - format-linked = "{ifname} (No IP) "; - format-disconnected = "Disconnected ⚠"; - format-alt = "{ifname}: {ipaddr}/{cidr}"; - }; - - cpu = { - format = "{usage}%  "; - tooltip = true; - }; - - memory = { - format = "{used}/{total} GiB ({percentage}%)  "; - tooltip = false; - }; - - temperature = { - critical-threshold = 80; - format = "{temperatureC}°C {icon}"; - format-icons = [ - "" - "" - "" - ]; - }; - - battery = { - format = "{capacity}% {icon}"; - }; - - clock = { - tooltip-format = "{calendar}"; - format = "{0:%H:%M} {0:%Y-%m-%d}"; - }; - - tray = { - spacing = 20; - }; - - "custom/power" = { - format = "⏻ "; - tooltip = false; - menu = "on-click"; - menu-file = "$HOME/.config/waybar/power_menu.xml"; - menu-actions = { - shutdown = "hyprshutdown --post-cmd 'shutdown -P 0'"; - reboot = "hyprshutdown --post-cmd 'reboot'"; - }; - }; - }; - - style = ./style.css; - }; - - home.file = { - waybar-custom-power = { - target = ".config/waybar/power_menu.xml"; - source = ./power_menu.xml; - }; - }; - }; - }; -} -- tangled.sh