diff options
author | gnidorah <gnidorah@users.noreply.github.com> | 2019-01-01 10:45:26 +0300 |
---|---|---|
committer | gnidorah <gnidorah@users.noreply.github.com> | 2019-01-01 11:21:15 +0300 |
commit | d15425f81653e13cae44c259932c10bf34b6708e (patch) | |
tree | 817fbef67c5347a45ba8f3bb47d0379b36d300ea /nixos/modules/programs/sway.nix | |
parent | 1bb4e5c8dc25c13a6c4b980a439c053810262007 (diff) |
nixos/sway: Improve the wrapper
Port a change by @primeos from sway-beta module to sway module.
https://github.com/NixOS/nixpkgs/pull/51316
Diffstat (limited to 'nixos/modules/programs/sway.nix')
-rw-r--r-- | nixos/modules/programs/sway.nix | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/nixos/modules/programs/sway.nix b/nixos/modules/programs/sway.nix index 0eaaf6b85b99..b3847db8cd9c 100644 --- a/nixos/modules/programs/sway.nix +++ b/nixos/modules/programs/sway.nix @@ -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 { |