hyprland: setup xdg declarative

This commit is contained in:
Christoph Hollizeck 2025-08-18 20:54:14 +02:00
parent fb4b5d0cbe
commit 5dd3c43865
Signed by: Daholli
GPG key ID: 249300664F2AF2C7

View file

@ -118,6 +118,9 @@ in
focus-1password focus-1password
hyprpanel hyprpanel
#####
xdg-dbus-proxy
]; ];
programs = { programs = {
@ -125,21 +128,54 @@ in
enable = true; enable = true;
package = hyprland-package; package = hyprland-package;
portalPackage = inputs.hyprland.packages.${system}.xdg-desktop-portal-hyprland; portalPackage = inputs.hyprland.packages.${system}.xdg-desktop-portal-hyprland;
withUWSM = true;
}; };
}; };
services.greetd = { xdg = {
enable = true; autostart.enable = true;
settings = rec { portal = {
initial_session = { enable = true;
command = "${hyprland-package}/bin/Hyprland"; extraPortals = [
user = "cholli"; pkgs.xdg-desktop-portal
}; pkgs.xdg-desktop-portal-gtk
];
xdgOpenUsePortal = true;
default_session = initial_session; config = {
common = {
default = [ "*" ];
"org.freedesktop.impl.portal.Secret" = [ "gnome-keyring" ];
};
hyprland = {
default = [
"hyprland"
"gtk"
];
"org.freedesktop.impl.portal.FileChooser" = [ "gtk" ];
"org.freedesktop.impl.portal.OpenURI" = [ "gtk" ];
};
};
}; };
}; };
# services.greetd = {
# enable = true;
# settings = rec {
# initial_session = {
# command = "${hyprland-package}/bin/Hyprland";
# user = "cholli";
# };
# default_session = initial_session;
# };
# };
#
services.displayManager.gdm = {
enable = true;
wayland = true;
};
${namespace} = { ${namespace} = {
desktop = { desktop = {
enable = true; enable = true;
@ -164,6 +200,7 @@ in
enable = true; enable = true;
package = hyprland-package; package = hyprland-package;
plugins = [ inputs.hy3.packages.${system}.hy3 ]; plugins = [ inputs.hy3.packages.${system}.hy3 ];
systemd.variables = [ "--all" ];
settings = mkMerge [ settings = mkMerge [
{ {
"$mod" = "SUPER"; "$mod" = "SUPER";
@ -171,7 +208,7 @@ in
exec-once = [ exec-once = [
"systemctl --user start hyprpolkitagent" "systemctl --user start hyprpolkitagent"
"[workspace 2 silent] steam --disable-gpu-compositing" # nvidia pls let me have nice things "[workspace 2 silent] steam"
"[workspace 8 silent] discord" "[workspace 8 silent] discord"
"[workspace 9 silent] ELECTRON_OZONE_PLATFORM_HINT=x11 1password" # fix for promts not showing up anymore "[workspace 9 silent] ELECTRON_OZONE_PLATFORM_HINT=x11 1password" # fix for promts not showing up anymore
"[workspace 1 silent] zen-beta" "[workspace 1 silent] zen-beta"
@ -250,69 +287,68 @@ in
]; ];
}; };
bind = bind = [
[ # compositor commands
# compositor commands "$mod SHIFT, R, exec, hyprctl reload"
"$mod SHIFT, R, exec, hyprctl reload" "$mod SHIFT, Q, killactive,"
"$mod SHIFT, Q, killactive," "$mod SHIFT, E, exec, pkill Hyprland"
"$mod SHIFT, E, exec, pkill Hyprland"
"$mod, F, fullscreen," "$mod, F, fullscreen,"
"$mod, G, togglegroup," "$mod, G, togglegroup,"
"$mod SHIFT, N, changegroupactive, f" "$mod SHIFT, N, changegroupactive, f"
"$mod SHIFT, P, changegroupactive, b" "$mod SHIFT, P, changegroupactive, b"
"$mod, R, togglesplit," "$mod, R, togglesplit,"
"$mod, T, togglefloating," "$mod, T, togglefloating,"
"$mod ALT, ,resizeactive," "$mod ALT, ,resizeactive,"
"$mod CTRL, left, movecurrentworkspacetomonitor, l" "$mod CTRL, left, movecurrentworkspacetomonitor, l"
"$mod CTRL, right, movecurrentworkspacetomonitor, r" "$mod CTRL, right, movecurrentworkspacetomonitor, r"
# move focus # move focus
"$mod, h, hy3:movefocus, l" "$mod, h, hy3:movefocus, l"
"$mod, j, hy3:movefocus, d" "$mod, j, hy3:movefocus, d"
"$mod, k, hy3:movefocus, u" "$mod, k, hy3:movefocus, u"
"$mod, l, hy3:movefocus, r" "$mod, l, hy3:movefocus, r"
"$mod, left, hy3:movefocus, l" "$mod, left, hy3:movefocus, l"
"$mod, down, hy3:movefocus, d" "$mod, down, hy3:movefocus, d"
"$mod, up, hy3:movefocus, u" "$mod, up, hy3:movefocus, u"
"$mod, right, hy3:movefocus, r" "$mod, right, hy3:movefocus, r"
# move focus # move focus
"$mod SHIFT, h, hy3:movewindow, l, once" "$mod SHIFT, h, hy3:movewindow, l, once"
"$mod SHIFT, j, hy3:movewindow, d, once" "$mod SHIFT, j, hy3:movewindow, d, once"
"$mod SHIFT, k, hy3:movewindow, u, once" "$mod SHIFT, k, hy3:movewindow, u, once"
"$mod SHIFT, l, hy3:movewindow, r, once" "$mod SHIFT, l, hy3:movewindow, r, once"
"$mod SHIFT, left, hy3:movewindow, l, once" "$mod SHIFT, left, hy3:movewindow, l, once"
"$mod SHIFT, down, hy3:movewindow, d, once" "$mod SHIFT, down, hy3:movewindow, d, once"
"$mod SHIFT, up, hy3:movewindow, u, once" "$mod SHIFT, up, hy3:movewindow, u, once"
"$mod SHIFT, right, hy3:movewindow, r, once" "$mod SHIFT, right, hy3:movewindow, r, once"
#run important programs #run important programs
"$mod, Return, exec, kitty" "$mod, Return, exec, kitty"
"$mod, D, exec, rofi -show drun" "$mod, D, exec, rofi -show drun"
"$mod, P, exec, focus-or-open-1pass" "$mod, P, exec, focus-or-open-1pass"
# "$mod, D, exec, rofi -show combi" # "$mod, D, exec, rofi -show combi"
#screenshot #screenshot
", Print, exec, grimblast copy area" ", Print, exec, grimblast copy area"
] ]
++ ( ++ (
# workspaces # workspaces
# binds $mod + [shift +] {1..9} to [move to] workspace {1..9} # binds $mod + [shift +] {1..9} to [move to] workspace {1..9}
builtins.concatLists ( builtins.concatLists (
builtins.genList ( builtins.genList (
i: i:
let let
ws = i + 1; ws = i + 1;
in in
[ [
"$mod, code:1${toString i}, workspace, ${toString ws}" "$mod, code:1${toString i}, workspace, ${toString ws}"
"$mod SHIFT, code:1${toString i}, hy3:movetoworkspace, ${toString ws}" "$mod SHIFT, code:1${toString i}, hy3:movetoworkspace, ${toString ws}"
] ]
) 9 ) 9
) )
); );
# mouse movements # mouse movements
bindm = [ bindm = [