nixos/sway: Improve the wrapper

Port a change by @primeos from sway-beta module to sway module.

https://github.com/NixOS/nixpkgs/pull/51316
This commit is contained in:
gnidorah 2019-01-01 10:45:26 +03:00
parent 1bb4e5c8dc
commit d15425f816

View File

@ -7,11 +7,18 @@ let
swayPackage = pkgs.sway;
swayWrapped = pkgs.writeShellScriptBin "sway" ''
if [[ "$#" -ge 1 ]]; then
set -o errexit
if [ ! "$_SWAY_WRAPPER_ALREADY_EXECUTED" ]; then
export _SWAY_WRAPPER_ALREADY_EXECUTED=1
${cfg.extraSessionCommands}
fi
if [ "$DBUS_SESSION_BUS_ADDRESS" ]; then
export DBUS_SESSION_BUS_ADDRESS
exec sway-setcap "$@"
else
${cfg.extraSessionCommands}
exec ${pkgs.dbus.dbus-launch} --exit-with-session sway-setcap
exec ${pkgs.dbus}/bin/dbus-run-session sway-setcap "$@"
fi
'';
swayJoined = pkgs.symlinkJoin {