sway: Make everything work again

This sadly has to downgrade some programs, if I find more time, I will
look more into this and try to make it work with the latest versions.
This commit is contained in:
Simon Bruder 2022-12-10 16:07:18 +01:00
parent 47c5bd5338
commit ad89732961
Signed by: simon
GPG key ID: 8D3C82F9F309F8EC
4 changed files with 15 additions and 23 deletions

View file

@ -61,6 +61,12 @@ in
overlays overlays
system; system;
}; };
_2205 = import nixpkgs-2205 {
inherit (config.nixpkgs)
config
overlays
system;
};
}) })
]; ];

View file

@ -248,23 +248,7 @@ in
extraConfig = '' extraConfig = ''
# Cursor # Cursor
seat seat0 xcursor_theme Adwaita seat seat0 xcursor_theme Adwaita
'' + ( '' + (lib.optionalString clamshellHack ''
let
environmentVariables = lib.concatStringsSep " " [
"DBUS_SESSION_BUS_ADDRESS"
"DISPLAY"
"SWAYSOCK"
"WAYLAND_DISPLAY"
];
in
''
# From https://github.com/swaywm/sway/wiki#gtk-applications-take-20-seconds-to-start
exec systemctl --user import-environment ${environmentVariables} && \
hash dbus-update-activation-environment 2>/dev/null && \
dbus-update-activation-environment --systemd ${environmentVariables} && \
systemctl --user start sway-session.target
''
) + (lib.optionalString clamshellHack ''
bindswitch --reload --locked lid:on output eDP-1 disable bindswitch --reload --locked lid:on output eDP-1 disable
bindswitch --reload --locked lid:off output eDP-1 enable bindswitch --reload --locked lid:off output eDP-1 enable

View file

@ -8,7 +8,8 @@ in
Install.WantedBy = [ "sway-session.target" ]; Install.WantedBy = [ "sway-session.target" ];
Service = { Service = {
ExecStart = "${pkgs.swaynotificationcenter}/bin/swaync"; # FIXME: use new version (currently system style discovery fails)
ExecStart = "${pkgs._2205.swaynotificationcenter}/bin/swaync";
Restart = "on-failure"; Restart = "on-failure";
}; };
}; };

View file

@ -232,7 +232,7 @@ in
def khal(args): def khal(args):
completed = subprocess.run(["khal"] + args, capture_output=True) completed = subprocess.run(["${pkgs.khal}/bin/khal"] + args, capture_output=True)
assert completed.returncode == 0 assert completed.returncode == 0
return completed.stdout.decode("utf-8") return completed.stdout.decode("utf-8")
@ -285,9 +285,9 @@ in
dnd-none = "${thinsp}"; dnd-none = "${thinsp}";
}; };
return-type = "json"; return-type = "json";
exec = "${pkgs.swaynotificationcenter}/bin/swaync-client -swb"; exec = "${pkgs._2205.swaynotificationcenter}/bin/swaync-client -swb";
on-click = "${pkgs.swaynotificationcenter}/bin/swaync-client -t -sw"; on-click = "${pkgs._2205.swaynotificationcenter}/bin/swaync-client -t -sw";
on-click-right = "${pkgs.swaynotificationcenter}/bin/swaync-client -d -sw"; on-click-right = "${pkgs._2205.swaynotificationcenter}/bin/swaync-client -d -sw";
escape = true; escape = true;
}; };
}; };
@ -307,7 +307,8 @@ in
Service = { Service = {
# ensure sway is already started, otherwise workspaces will not work # ensure sway is already started, otherwise workspaces will not work
ExecStartPre = "${config.wayland.windowManager.sway.package}/bin/swaymsg"; ExecStartPre = "${config.wayland.windowManager.sway.package}/bin/swaymsg";
ExecStart = "${pkgs.waybar}/bin/waybar"; # FIXME: use new version (currently mpd widget does not toggle playback)
ExecStart = "${pkgs._2205.waybar}/bin/waybar";
ExecReload = "${pkgs.utillinux}/bin/kill -SIGUSR2 $MAINPID"; ExecReload = "${pkgs.utillinux}/bin/kill -SIGUSR2 $MAINPID";
Restart = "on-failure"; Restart = "on-failure";
RestartSec = "1s"; RestartSec = "1s";