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, pkgs,
... ...
}: let }: let
# bash script to let dbus know about impotant env variables and themeEnv = ''
# propagate them to relevent services run at the end of sway config export XDG_DATA_DIRS="${pkgs.whitesur-gtk-theme}/share:$XDG_DATA_DIRS"
dbus-sway-environment = pkgs.writeShellScriptBin "dbus-sway-environment" '' export XDG_DATA_DIRS="${pkgs.whitesur-icon-theme}/share:$XDG_DATA_DIRS"
${pkgs.dbus}/bin/dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP=sway export XDG_DATA_DIRS="${pkgs.whitesur-cursors}/share:$XDG_DATA_DIRS"
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'
''; '';
in { in {
environment.extraInit = themeEnv;
programs.regreet = { programs.regreet = {
enable = true; enable = true;
settings = { settings = {
@ -68,16 +38,7 @@ in {
extraGroups = []; extraGroups = [];
}; };
services.greetd = { services.greetd.enable = true;
enable = true;
settings = rec {
# initial_session = {
# command = "${pkgs.sway}/bin/sway --config ${swayConfig}";
# user = "greeter";
# };
# default_session = initial_session;
};
};
environment.etc."greetd/environments".text = '' environment.etc."greetd/environments".text = ''
sway sway