diff --git a/modules/hypr/hyprland/autostart.nix b/modules/hypr/hyprland/autostart.nix index bf79914..76ab82c 100644 --- a/modules/hypr/hyprland/autostart.nix +++ b/modules/hypr/hyprland/autostart.nix @@ -4,7 +4,7 @@ ... }: let - uwsm_run = "${pkgs.uwsm}/bin/uwsm"; + uwsm_run = "${pkgs.uwsm}/bin/uwsm app"; in { wayland.windowManager.hyprland.settings = { diff --git a/modules/hypr/hyprland/env.nix b/modules/hypr/hyprland/env.nix index 9c8c6b6..a540e55 100644 --- a/modules/hypr/hyprland/env.nix +++ b/modules/hypr/hyprland/env.nix @@ -4,14 +4,7 @@ ... }: let - uwsm_run = "${pkgs.uwsm}/bin/uwsm"; - exe = pkg: bin: if userConfig.isNixOS then "${pkg}/bin/${bin}" else "/usr/bin/${bin}"; - jq = exe pkgs.jq "jq"; - grim = exe pkgs.grim "grim"; - satty = exe pkgs.satty "satty"; - wl_copy = exe pkgs.wl-clipboard "wl-copy"; - notify_send = exe pkgs.libnotify "notify-send"; - playerctl = exe pkgs.playerctl "playerctl"; + uwsm_run = "${pkgs.uwsm}/bin/uwsm app"; in { wayland.windowManager.hyprland = { diff --git a/modules/hypr/hyprland/general.nix b/modules/hypr/hyprland/general.nix index 10bfdb1..6bf37b2 100644 --- a/modules/hypr/hyprland/general.nix +++ b/modules/hypr/hyprland/general.nix @@ -11,6 +11,11 @@ let wl_copy = exe pkgs.wl-clipboard "wl-copy"; notify_send = exe pkgs.libnotify "notify-send"; playerctl = exe pkgs.playerctl "playerctl"; + xdg-desktop-portal-hyprland = + if userConfig.isNixOS then + "${pkgs.xdg-desktop-portal-hyprland}/libexec/xdg-desktop-portal-hyprland" + else + "/usr/lib/xdg-desktop-portal-hyprland"; in { wayland.windowManager.hyprland = { @@ -25,28 +30,16 @@ in #portalPackage = lib.mkIf (userConfig.isNixOS #) inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system}.xdg-desktop-portal-hyprland; + xwayland.enable = true; settings = { - - xwayland.enable = true; - general = { - gaps_in = 4; - gaps_out = 6; - border_size = 4; - "col.active_border" = "$blue $sky"; - "col.inactive_border" = "$overlay1"; - resize_on_border = false; - allow_tearing = false; - layout = "scrolling"; - }; - ecosystem = { enforce_permissions = true; }; permission = [ - "^${pkgs.grim}$, screencopy, allow" - "^${pkgs.hyprlock}$, screencopy, allow" - "^${pkgs.xdg-desktop-portal-hyprland}$, screencopy, allow" + "^${pkgs.grim}/bin/grim$, screencopy, allow" + "^${pkgs.hyprlock}/bin/hyprlock$, screencopy, allow" + "^${xdg-desktop-portal-hyprland}$, screencopy, allow" ]; misc = { @@ -71,6 +64,16 @@ in "rounding 0, match:float 0, match:workspace f[1]" ]; + bind = [ + "$mainMod, V, exec, cliphist list | hyprlauncher -m | cliphist decode | wl-copy" + "$mainMod ALT_L, V, exec, cliphist wipe && notify-send \"Clipboard\" \"Clipboard cleared!\"" + "$mainMod L_SHIFT ctrl, l, exec, hyprlock" + "$mainMod L_SHIFT ctrl, r, exec, openrgb -c black && systemctl reboot" + "$mainMod L_SHIFT ctrl, p, exec, openrgb -c black && systemctl poweroff" + "$mainMod L_SHIFT ctrl, s, exec, openrgb -c black && pidof hyprlock || sleep 1 && systemctl sleep" + "$mainMod L_SHIFT ctrl, m, exec, uwsm stop" + ]; + bindt = [ ", PRINT, exec, ${pkgs.writeShellScript "screenshot-region" '' MONITOR=$(hyprctl monitors -j | ${jq} -r '.[] | select(.focused == true) | .name') diff --git a/modules/hypr/hyprland/layouts.nix b/modules/hypr/hyprland/layouts.nix index 85bd7dc..b636bca 100644 --- a/modules/hypr/hyprland/layouts.nix +++ b/modules/hypr/hyprland/layouts.nix @@ -57,6 +57,7 @@ binde = [ "$mainMod alt, equal, exec, hyprctl -q keyword cursor:zoom_factor $(hyprctl getoption cursor:zoom_factor | awk '/^float.*/ {print $2 * 1.1}')" "$mainMod alt, minus, exec, hyprctl -q keyword cursor:zoom_factor $(hyprctl getoption cursor:zoom_factor | awk '/^float.*/ {print $2 * 0.9}')" + "$mainMod alt, 0, exec, hyprctl -q keyword cursor:zoom_factor 1" "$mainMod L_SHIFT, l, resizeactive, 10 0" "$mainMod L_SHIFT, h, resizeactive, -10 0" "$mainMod L_SHIFT, k, resizeactive, 0 -10"