From bb3d875d77d0149f1c4c5326f89b5e22990dbf8c Mon Sep 17 00:00:00 2001 From: Nathan Date: Sat, 30 Aug 2025 13:22:25 -0500 Subject: [PATCH] hyprland config --- home-manager/programs/hyprland/default.nix | 22 ++++++++++--- .../users/nathan/dotfiles/hypr/main.conf | 32 +++++++++---------- .../users/nathan/dotfiles/hypr/otf.conf | 1 - .../users/nathan/dotfiles/hypr/pyprland.toml | 13 ++++++-- .../users/nathan/packages/scripts/default.nix | 1 - 5 files changed, 43 insertions(+), 26 deletions(-) delete mode 100644 home-manager/users/nathan/dotfiles/hypr/otf.conf diff --git a/home-manager/programs/hyprland/default.nix b/home-manager/programs/hyprland/default.nix index 749c42c..e4c0ad3 100644 --- a/home-manager/programs/hyprland/default.nix +++ b/home-manager/programs/hyprland/default.nix @@ -15,6 +15,13 @@ pyprland ]; + home.activation.extraHyprFile = lib.hm.dag.entryAfter ["writeBoundary"] '' + if [[ ! -f ${config.home.homeDirectory}/.config/hypr/otf.conf ] && [ -z ''$DRY_RUN ]]; then + touch ${config.home.homeDirectory}/.config/hypr/otf.conf + fi + ''; + + wayland.windowManager.hyprland = { enable = true; @@ -24,9 +31,9 @@ variables = [ "--all" ]; }; - extraConfig = let - monitor = if config.homeconfig.host == "laptop" then '' + extraConfig = (if config.homeconfig.host == "laptop" then '' monitor=eDP-1,1920x1080@300,0x0,1 + bind = CTRL SHIFT, XF86Launch2, exec, if [[ $(hyprctl monitors | grep 0x0 | sed -n -e "s/\t*1920x1080@//" -e "s/.[1234567890]* at 0x0//p") == 300 ]]; then hyprctl keyword monitor eDP-1,1920x1080@60,0x0,1; else hyprctl keyword monitor eDP-1,1920x1080@300,0x0,1; fi '' else if config.homeconfig.host == "homebox" then '' monitor=HDMI-A-2,1920x1080@60,0x0,1 monitor=HEADLESS-2,1920x1080@60,0x0,1 @@ -37,9 +44,14 @@ monitor=HEADLESS-2,1920x1080@60,0x0,1 exec-once=hyprctl output create headless HEADLESS-2 exec-once=${pkgs.wayvnc}/bin/wayvnc 0.0.0.0 -o HEADLESS-2 - '' else ''''; - in monitor + '' - source = /home/nathan/.config/hypr/main.conf + '' else '' + monitor= , prefered, auto, 1 + '') + (if config.homeconfig.hyprpanel.enable then '' + bind = , Print, exec, bash -c ${pkgs.hyprpanel}/share/scripts/screenshot.sh" + '' else '' + bind = , Print, exec, grim -g "$(slurp)" + '') + '' + source = ${config.home.homeDirectory}/.config/hypr/main.conf ''; }; diff --git a/home-manager/users/nathan/dotfiles/hypr/main.conf b/home-manager/users/nathan/dotfiles/hypr/main.conf index 3ba590b..87044f9 100644 --- a/home-manager/users/nathan/dotfiles/hypr/main.conf +++ b/home-manager/users/nathan/dotfiles/hypr/main.conf @@ -15,7 +15,7 @@ exec-once=onSystemStart # Some default env vars. env = XCURSOR_SIZE,16 -source = ~/Projects/Olympus/home-manager/users/nathan/dotfiles/hypr/otf.conf +source = ~/.config/hypr/otf.conf source = ~/.cache/wal/colors-hypr.conf # For all categories, see https://wiki.hyprland.org/Configuring/Variables/ @@ -119,24 +119,20 @@ bind = $mainMod, R, exec, colorPrefix kitty -e _systemRebuild bind = $mainMod SHIFT, R, exec, colorPrefix kitty -e _homeRebuild -bind = $mainMod, C, exec, colorPrefix kitty -e bash -c "cd ~/Projects/Olympus; nvim ~/Projects/Olympus/" - bind = $mainMod, F, exec, thunar bind = $mainMod SHIFT, F, fullscreen bind = $mainMod, semicolon, exec, colorPrefix kitty -e nvim ~ -bind = $mainMod, Insert, exec, libreoffice & - -bind = $mainMod, H, exec, bluetoothctl connect 88:D0:39:F9:83:CE +bind = $mainMod, Insert, exec, libreoffice bind = $mainMod, V, togglefloating, -bind = $mainMod SHIFT, V, exec, vlc & +bind = $mainMod SHIFT, V, exec, vlc bind = , Menu, exec, rofi -show drun -bind = $mainMod, Menu, exec, killall .ags-wrapped; ags & +bind = $mainMod, Menu, exec, hyprpanel -q; hyprpanel bind = $mainMod, P, pseudo, # dwindle @@ -158,17 +154,14 @@ bind = , XF86AudioNext, exec, playerctl next bind = , XF86AudioPrev, exec, playerctl previous -bind = , XF86Launch2, exec, steam & +bind = , XF86Launch2, exec, steam bind = $mainMod, XF86Launch2, exec, prismlauncher -bind = CTRL SHIFT, XF86Launch2, exec, if [[ $(hyprctl monitors | grep 0x0 | sed -n -e "s/\t*1920x1080@//" -e "s/.[1234567890]* at 0x0//p") == 300 ]]; then hyprctl keyword monitor eDP-1,1920x1080@60,0x0,1; else hyprctl keyword monitor eDP-1,1920x1080@300,0x0,1; fi - bind = , XF86Calculator, exec, geogebra bind = $mainMod SHIFT, Print, exec, firefox localhost:631 -bind = , Print, exec, grim -g "$(slurp)" -bind = $mainMod, Return, exec, discord --enable-features=UseOzonePlatform --ozone-platform=wayland & +bind = $mainMod, Return, exec, discord --enable-features=UseOzonePlatform --ozone-platform=wayland bind = $mainMod CTRL, Return, exec, firefox https://discord.com/app @@ -242,25 +235,30 @@ bindm = $mainMod, mouse:272, movewindow bindm = $mainMod SHIFT, mouse:272, resizewindow $scratchpadsize = size 60% 80% -$scratchpad = class:^(scratchpad)$ +$scratchpad = class:^(scratchpad)$ windowrulev2 = float, $scratchpad windowrulev2 = $scratchpadsize, $scratchpad windowrulev2 = workspace special silent, $scratchpad $kitty = class:^(scratchpad-kitty)$ - windowrulev2 = float, $kitty windowrulev2 = $scratchpadsize, $kitty windowrulev2 = workspace special silent, $kitty -$nvim = class:^(scratchpad-nvim)$ +$nvim = class:^(scratchpad-nvim)$ windowrulev2 = float, $nvim windowrulev2 = $scratchpadsize, $nvim windowrulev2 = workspace special silent, $nvim +$cal = class:^(scratchpad-calendar)$ +windowrulev2 = float, $cal +windowrulev2 = $scratchpadsize, $cal +windowrulev2 = workspace special silent, $cal + bind = $mainMod, N, exec, colorPrefix pypr toggle nvim -bind = $mainMod, E, exec, colorPrefix pypr toggle free +bind = $mainMod, E, exec, colorPrefix pypr toggle kitty +bind = $mainMod, C, exec, colorPrefix pypr toggle calendar bind = CTRL SHIFT, Home, exec, ssh nathan@blunkall.us -fL 5900:localhost:5900 sleep 10; vncviewer localhost:5900 -fullscreen diff --git a/home-manager/users/nathan/dotfiles/hypr/otf.conf b/home-manager/users/nathan/dotfiles/hypr/otf.conf deleted file mode 100644 index 8b13789..0000000 --- a/home-manager/users/nathan/dotfiles/hypr/otf.conf +++ /dev/null @@ -1 +0,0 @@ - diff --git a/home-manager/users/nathan/dotfiles/hypr/pyprland.toml b/home-manager/users/nathan/dotfiles/hypr/pyprland.toml index 14eee5a..43adbb5 100644 --- a/home-manager/users/nathan/dotfiles/hypr/pyprland.toml +++ b/home-manager/users/nathan/dotfiles/hypr/pyprland.toml @@ -7,12 +7,12 @@ animation = "fromTop" command = "kitty --class scratchpad-nvim -e nvim ~/Projects" lazy = false - class = "scratchpad-nvim" + class = "scratchpad" margin = 100 multi = true excludes = "*" - [scratchpads.free] + [scratchpads.kitty] animation = "fromBottom" command = "kitty --class scratchpad -e tmux" class = "scratchpad" @@ -20,3 +20,12 @@ margin = 100 multi = true excludes = "*" + + [scratchpads.calendar] + animation = "fromTop" + command = "kitty --class scratchpad -e calcurse" + class = "scratchpad" + lazy = false + margin = 100 + multi = true + excludes = "*" diff --git a/home-manager/users/nathan/packages/scripts/default.nix b/home-manager/users/nathan/packages/scripts/default.nix index 36006a6..ea39e1a 100644 --- a/home-manager/users/nathan/packages/scripts/default.nix +++ b/home-manager/users/nathan/packages/scripts/default.nix @@ -65,7 +65,6 @@ (pkgs.writeShellScriptBin "onSystemStart" '' - hyprctl dispatch exec ${pkgs.hyprpanel}/bin/hyprpanel if [[ ! -f ${config.home.homeDirectory}/.config/background ]]; then hyprctl dispatch exec "randWallpaper && chmod 600 ${config.home.homeDirectory}/.config/background" fi