diff --git a/home/features/desktop/default.nix b/home/features/desktop/default.nix index 1f35703..562205e 100644 --- a/home/features/desktop/default.nix +++ b/home/features/desktop/default.nix @@ -2,6 +2,7 @@ # Common GUI apps imports = [ ./firefox.nix + ./gtk.nix ./vscode.nix ]; diff --git a/home/features/desktop/gtk.nix b/home/features/desktop/gtk.nix new file mode 100644 index 0000000..7f24657 --- /dev/null +++ b/home/features/desktop/gtk.nix @@ -0,0 +1,9 @@ +{ config, pkgs, inputs, ... }: { + gtk = { + enable = true; + }; + + services.xsettingsd = { + enable = true; + }; +} diff --git a/home/features/desktop/hyprland/binds.nix b/home/features/desktop/hyprland/binds.nix index eea3046..68c4775 100644 --- a/home/features/desktop/hyprland/binds.nix +++ b/home/features/desktop/hyprland/binds.nix @@ -3,6 +3,10 @@ # See https://wiki.hyprland.org/Configuring/Keywords/ for more $mainMod = SUPER + # Alt-Tab action + bind = ALT, Tab, cyclenext, + bind = ALT, Tab, bringactivetotop, + # Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more bind = $mainMod, Q, exec, kitty bind = $mainMod, C, killactive, diff --git a/home/features/desktop/hyprland/default.nix b/home/features/desktop/hyprland/default.nix index 7e0e256..c4a51de 100644 --- a/home/features/desktop/hyprland/default.nix +++ b/home/features/desktop/hyprland/default.nix @@ -2,14 +2,16 @@ imports = [ ./binds.nix + # ./systemd-fixes.nix + ./tty-init.nix ../wayland-wm ]; wayland.windowManager.hyprland = { enable = true; systemdIntegration = true; - xwayland.enable = true; - recommendedEnvironment = true; +# xwayland.enable = true; +# recommendedEnvironment = true; extraConfig = '' # This is an example Hyprland config file. # diff --git a/home/features/desktop/hyprland/systemd-fixes.nix b/home/features/desktop/hyprland/systemd-fixes.nix new file mode 100644 index 0000000..3d31e09 --- /dev/null +++ b/home/features/desktop/hyprland/systemd-fixes.nix @@ -0,0 +1,30 @@ +{ lib, config, ... }: +let + cfg = config.wayland.windowManager.hyprland; +in +{ + config = lib.mkIf (cfg.enable && cfg.systemdIntegration) { + # stolen from https://github.com/alebastr/sway-systemd/commit/0fdb2c4b10beb6079acd6073c5b3014bd58d3b74 + systemd.user.targets.hyprland-session-shutdown = { + Unit = { + Description = "Shutdown running Hyprland session"; + DefaultDependencies = "no"; + StopWhenUnneeded = "true"; + + Conflicts = [ + "graphical-session.target" + "graphical-session-pre.target" + "hyprland-session.target" + ]; + After = [ + "graphical-session.target" + "graphical-session-pre.target" + "hyprland-session.target" + ]; + }; + }; + wayland.windowManager.hyprland.settings.bind = lib.mkAfter [ + "SUPERSHIFT,e,exec,systemctl --user start hyprland-session-shutdown.target; hyprctl dispatch exit" + ]; + }; +} diff --git a/home/features/desktop/hyprland/tty-init.nix b/home/features/desktop/hyprland/tty-init.nix new file mode 100644 index 0000000..9ca836c --- /dev/null +++ b/home/features/desktop/hyprland/tty-init.nix @@ -0,0 +1,9 @@ +{ + programs = { + fish.loginShellInit = '' + if test (tty) = "/dev/tty1" + exec Hyprland &> /dev/null + end + ''; + }; +} diff --git a/hosts/pixnix/default.nix b/hosts/pixnix/default.nix index 6c8638b..f069087 100644 --- a/hosts/pixnix/default.nix +++ b/hosts/pixnix/default.nix @@ -22,6 +22,11 @@ networkmanager.enable = true; }; + xdg.portal = { + enable = true; + wlr.enable = true; + }; + system.stateVersion = "23.05"; }