diff --git a/modules/nixos/greetd.nix b/modules/nixos/greetd.nix index bf304ad..5e75d06 100644 --- a/modules/nixos/greetd.nix +++ b/modules/nixos/greetd.nix @@ -4,6 +4,21 @@ pkgs, ... }: let + # bash script to let dbus know about impotant env variables and + # propagate them to relevent services run at the end of sway config + dbus-sway-environment = pkgs.writeShellScriptBin "dubs-sway-environment" '' + dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=sway + systemctl --user stop pipewire pipewire-media-session xdg-desktop-portal xdg-desktop-portal-wlr + systemctl --user start pipewire pipewire-media-session xdg-desktop-portal xdg-desktop-portal-wlr + ''; + + # currently, there is some friction between sway and gtk: + # https://github.com/swaywm/sway/wiki/GTK-3-settings-on-Wayland + configure-gtk = pkgs.writeShellScriptBin "configure-gtk" '' + gnome_schema=org.gnome.desktop.interface + gsettings set $gnome_schema gtk-theme 'Dracula' + ''; + swayConfig = pkgs.writeText "greetd-sway-config" '' input * { xkb_layout "de" @@ -15,8 +30,8 @@ natural_scroll "enable" } - exec dbus-sway-environment - exec configure-gtk + exec ${dbus-sway-environment}/bin/dbus-sway-environment + exec ${configure-gtk}/bin/configure-gtk # `-l` activates layer-shell mode. Notice that `swaymsg exit` will run after gtkgreet. exec "${pkgs.greetd.regreet}/bin/regreet; swaymsg exit" bindsym Mod4+shift+e exec swaynag \