226 current 1970-01-01 01:00:00 24.05.20240312.0ad13a6 6.6.21 *

This commit is contained in:
Max Känner 2024-03-14 09:53:30 +01:00
parent 9e4597fdd3
commit 111d3d9777

View File

@ -4,43 +4,13 @@
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 "dbus-sway-environment" ''
${pkgs.dbus}/bin/dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK 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
${pkgs.glib}/bin/gsettings set $gnome_schema gtk-theme 'WhiteSur-Dark'
'';
swayConfig = pkgs.writeText "greetd-sway-config" ''
input * {
xkb_layout "de"
xkb_options "caps:ctrl_modifier"
xkb_numlock "enable"
}
input "type:touchpad" {
tap "enable"
natural_scroll "enable"
}
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 > /var/log/regreet/log; swaymsg exit"
bindsym Mod4+shift+e exec ${pkgs.sway}/bin/swaynag \
-t warning \
-m 'What do you want to do?' \
-b 'Poweroff' 'systemctl poweroff' \
-b 'Reboot' 'systemctl reboot'
themeEnv = ''
export XDG_DATA_DIRS="${pkgs.whitesur-gtk-theme}/share:$XDG_DATA_DIRS"
export XDG_DATA_DIRS="${pkgs.whitesur-icon-theme}/share:$XDG_DATA_DIRS"
export XDG_DATA_DIRS="${pkgs.whitesur-cursors}/share:$XDG_DATA_DIRS"
'';
in {
environment.extraInit = themeEnv;
programs.regreet = {
enable = true;
settings = {
@ -68,16 +38,7 @@ in {
extraGroups = [];
};
services.greetd = {
enable = true;
settings = rec {
# initial_session = {
# command = "${pkgs.sway}/bin/sway --config ${swayConfig}";
# user = "greeter";
# };
# default_session = initial_session;
};
};
services.greetd.enable = true;
environment.etc."greetd/environments".text = ''
sway