fix dbus env

This commit is contained in:
LordGrimmauld 2024-04-28 10:50:53 +02:00
parent 070df903b5
commit 3171f92588

View file

@ -50,6 +50,12 @@ in
}
'';
dbus-sway-environment = pkgs.writeShellScriptBin "dbus-sway-environment" ''
dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=sway
systemctl --user stop xdg-desktop-portal xdg-desktop-portal-wlr
systemctl --user start xdg-desktop-portal xdg-desktop-portal-wlr
'';
build_conf = with lib; sway_conf:
let
build_definition_lines = mapAttrsToList (name: value: "set \$${name} ${value}");
@ -79,14 +85,15 @@ in
);
conf_path = "sway.conf";
# sway_conf = pkgs.writeText "sway.conf" text;
in
with cfg; lib.mkIf (enable && sway.enable) {
environment.etc."${conf_path}".text = sway_conf;
grimmShared.sway.config.autolaunch = lib.singleton dbus-sway-environment;
environment.systemPackages = [
waybar_full
dbus-sway-environment
] ++ (with pkgs; [
procps
slurp
@ -130,16 +137,18 @@ in
wl-clipboard
wf-recorder
dmenu
# wlroots_0_16
wmenu
waybar-mpris
];
extraOptions = [
"--unsupported-gpu"
"--config"
"/etc/${conf_path}"
];
extraSessionCommands = ''
# source /etc/profile
# test -f $HOME/.profile && source $HOME/.profile
systemctl --user import-environment
export XDG_CURRENT_DESKTOP=sway
export SDL_VIDEODRIVER=wayland
export QT_QPA_PLATFORM=wayland