Add seatd.

This commit is contained in:
Tom Alexander 2025-01-14 21:10:03 -05:00
parent 5a5839482d
commit 491412c33c
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE
3 changed files with 8 additions and 3 deletions

View File

@ -1,3 +1,4 @@
# TODO: Maybe replace with https://gitlab.com/w0lff/shikane because its written in rust
{
config,
lib,

View File

@ -61,7 +61,7 @@ in
mpv
evince
gimp
imv
imv # TODO: Maybe replace with https://github.com/artemsen/swayimg because imv is looking for a new maintainer
];
})
(lib.mkIf (config.me.graphicsCardType == "amd" || config.me.graphicsCardType == "intel") {

View File

@ -6,6 +6,7 @@
}:
let
# TODO: Maybe replace wofi with tofi (with config to make it start quickly)
sway-config = pkgs.writeTextFile {
name = "config";
text = ''
@ -228,8 +229,8 @@ let
name = "announce_sway_start.conf";
text = ''
# announce a running sway session to systemd
exec systemctl --user import-environment XDG_SESSION_TYPE XDG_CURRENT_DESKTOP
exec dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=sway
exec systemctl --user import-environment WAYLAND_DISPLAY DISPLAY XDG_CURRENT_DESKTOP SWAYSOCK I3SOCK XCURSOR_SIZE XCURSOR_THEME
exec dbus-update-activation-environment WAYLAND_DISPLAY DISPLAY XDG_CURRENT_DESKTOP SWAYSOCK I3SOCK XCURSOR_SIZE XCURSOR_THEME
'';
};
@ -289,6 +290,9 @@ in
announce_sway_start
];
services.seatd.enable = true;
users.users.talexander.extraGroups = [ "seat" ];
# Probably would be cleaner to use environment.sessionVariables but programs.sway.extraSessionCommands is sway-specific.
programs.sway.extraSessionCommands =
if config.me.buildingIso then