From 1a047c4a8eb6e6a1903dfe8453d8df585e22ac9a Mon Sep 17 00:00:00 2001 From: Michael Weiss Date: Tue, 31 Dec 2019 16:28:52 +0100 Subject: [PATCH] sway: Make it possible to use exec in extraSessionCommands This is useful for use-cases like this (logging to journald): ``` programs.sway.extraSessionCommands = '' if [ -z "$_SWAY_DID_SYSTEMD_CAT" ]; then export _SWAY_DID_SYSTEMD_CAT=1 exec ${config.systemd.package}/bin/systemd-cat -t sway "$0" "$@" fi # ... (potentially also another exec) ''; ``` Without this change the rest of the extraSessionCommands won't be executed after the exec since the whole extraSessionCommands block would be skipped during the re-execution (_SWAY_WRAPPER_ALREADY_EXECUTED is already set). --- pkgs/applications/window-managers/sway/wrapper.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/applications/window-managers/sway/wrapper.nix b/pkgs/applications/window-managers/sway/wrapper.nix index 7c59b8b7cde4..3e12e3fcc55f 100644 --- a/pkgs/applications/window-managers/sway/wrapper.nix +++ b/pkgs/applications/window-managers/sway/wrapper.nix @@ -14,8 +14,8 @@ let baseWrapper = writeShellScriptBin "sway" '' set -o errexit if [ ! "$_SWAY_WRAPPER_ALREADY_EXECUTED" ]; then - export _SWAY_WRAPPER_ALREADY_EXECUTED=1 ${extraSessionCommands} + export _SWAY_WRAPPER_ALREADY_EXECUTED=1 fi if [ "$DBUS_SESSION_BUS_ADDRESS" ]; then export DBUS_SESSION_BUS_ADDRESS