mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-01 07:01:54 +00:00
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:
parent
1bb4e5c8dc
commit
d15425f816
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user