Merge pull request #53138 from gnidorah/sway

nixos/sway: Improve the wrapper
This commit is contained in:
Michael Weiss 2019-01-04 11:49:07 +01:00 committed by GitHub
commit 65c953976c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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 {