diff options
Diffstat (limited to 'swaynag/swaynag.c')
-rw-r--r-- | swaynag/swaynag.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/swaynag/swaynag.c b/swaynag/swaynag.c index 74e127b6..a2a0b412 100644 --- a/swaynag/swaynag.c +++ b/swaynag/swaynag.c | |||
@@ -49,14 +49,17 @@ static void swaynag_button_execute(struct swaynag *swaynag, | |||
49 | if (fork() == 0) { | 49 | if (fork() == 0) { |
50 | // Child of the child. Will be reparented to the init process | 50 | // Child of the child. Will be reparented to the init process |
51 | char *terminal = getenv("TERMINAL"); | 51 | char *terminal = getenv("TERMINAL"); |
52 | if (terminal && strlen(terminal)) { | 52 | if (button->terminal && terminal && strlen(terminal)) { |
53 | wlr_log(WLR_DEBUG, "Found $TERMINAL: %s", terminal); | 53 | wlr_log(WLR_DEBUG, "Found $TERMINAL: %s", terminal); |
54 | if (!terminal_execute(terminal, button->action)) { | 54 | if (!terminal_execute(terminal, button->action)) { |
55 | swaynag_destroy(swaynag); | 55 | swaynag_destroy(swaynag); |
56 | exit(EXIT_FAILURE); | 56 | exit(EXIT_FAILURE); |
57 | } | 57 | } |
58 | } else { | 58 | } else { |
59 | wlr_log(WLR_DEBUG, "$TERMINAL not found. Running directly"); | 59 | if (button->terminal) { |
60 | wlr_log(WLR_DEBUG, | ||
61 | "$TERMINAL not found. Running directly"); | ||
62 | } | ||
60 | execl("/bin/sh", "/bin/sh", "-c", button->action, NULL); | 63 | execl("/bin/sh", "/bin/sh", "-c", button->action, NULL); |
61 | } | 64 | } |
62 | } | 65 | } |