aboutsummaryrefslogtreecommitdiff
path: root/sway/commands/exec_always.c
AgeCommit message (Collapse)Author
2024-02-23Define _POSIX_C_SOURCE globallySimon Ser
See discussion in https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4555
2023-02-05launcher: make launcher context seat awareRonan Pigott
2023-01-03Add missing includes & remove duplicatesCarl Smedstad
2022-11-26launcher: export X startup ids and use them for workspace matchingRonan Pigott
2022-11-26launcher: export xdga tokens and use them for workspace matchingRonan Pigott
2022-11-26launcher: fudge the interface a bitRonan Pigott
We want to create a context before knowing the pid it will match with.
2022-11-26launcher: initialize launcher_ctxs once on startupRonan Pigott
2022-11-26launcher: rename pid_workspace to launcher_ctxRonan Pigott
Soon we will match views with more than just a pid.
2022-11-26root: move the workspace matching code to its own fileRonan Pigott
This removes the pid_workspace bits from tree/root before it gets too interesting. No functional change.
2021-10-30Bump RLIMIT_NOFILESimon Ser
Wayland compositors handle many file descriptors: client connections, DMA-BUFs, sync_files, wl_data_device pipes, and so on. Bump the limit to the max. Closes: https://github.com/swaywm/sway/issues/6285
2021-06-05sway: commands: exec: restore SIGPIPE before exec:ingDaniel Eklöf
Sway ignores SIGPIPE (by installing a SIG_IGN handler), in order to “prevent IPC from crashing Sway”. SIG_IGN handlers are the *only* signal handlers inherited in sub-processes. As such, we should be a good citizen and restore the SIGPIPE handler to its default handler. Original bug report: https://www.mail-archive.com/debian-bugs-dist@lists.debian.org/msg1806907.html
2021-05-10commands/exec: stop truncating >4095-byte commandsManuel Stoeckl
2021-04-22commands/exec_always: log error on execlp failureSimon Ser
And exit(1) instead of indicating success.
2021-04-22Use execlp("sh") instead of execl("/bin/sh")Simon Ser
This stops assuming the POSIX shell command is located in /bin.
2020-08-24exec: fix validation during config reloadKonstantin Pospelov
Split cmd_exec_always into separate methods for general validation and process creation. This fixes a potential call of join_args with 0 arguments.
2019-01-21Replace wlr_log with sway_logM Stoeckl
This commit mostly duplicates the wlr_log functions, although with a sway_* prefix. (This is very similar to PR #2009.) However, the logging function no longer needs to be replaceable, so sway_log_init's second argument is used to set the exit callback for sway_abort. wlr_log_init is still invoked in sway/main.c This commit makes it easier to remove the wlroots dependency for the helper programs swaymsg, swaybg, swaybar, and swaynag.
2019-01-14Remove now-unused "input" argument of cmd_results_newM Stoeckl
Patch tested by compiling with `__attribute__ ((format (printf, 2, 3)))` applied to `cmd_results_new`. String usage constants have been converted from pointers to arrays when encountered. General handler format strings were sometimes modified to include the old input string, especially for unknown command errors.
2018-11-25Replace _XOPEN_SOURCE with _POSIX_C_SOURCEemersion
And make sure we don't define both in the same source file.
2018-11-05commands/exec_always: defer command on config validationRouven Czerwinski
The exec_always command was executed twice, since it was not checking for the config->validating variable. Fix this by defering the command if the configuration is validating. Fixes #3072
2018-10-23commands: remove EXPECTED_MORE_THANIan Fan
Its uses have been replaced with EXPECTED_AT_LEAST.
2018-10-23commands: print correct command on error for exec and opacityIan Fan
2018-08-29commands: fix exec quotingIan Fan
2018-08-26Remove layout.cRyan Dwyer
When we have type safety we'll need to have functions for workspace_add_tiling and so on. This means the existing container functions will be just for containers, so they are being moved to container.c. At this point layout.c doesn't contain much else, so I've relocated everything and removed the file. * container_swap and its static functions have been moved to the swap command and made static. * container_recursive_resize has been moved to the resize command and made static. * The following have been moved to container.c: * container_handle_fullscreen_reparent * container_insert_child * container_add_sibling * container_add_child * container_remove_child * container_replace_child * container_split * enum movement_direction and sway_dir_to_wlr have been moved to util.c. Side note: Several commands included layout.h which then included root.h. With layout.h gone, root.h has to be included by those commands.
2018-08-18commands: handle quoted exec commandIan Fan
2018-08-04Move workspace pid code to root.cRyan Dwyer
2018-08-02Reset signal mask after forkMarien Zwart
wlroots uses wl_event_loop_add_signal to handle SIGUSR1 from Xwayland. wl_event_loop_add_signal works by masking the signal and receiving it from a signalfd. The signal mask is preserved across fork and exec, so subprocesses spawned by Sway start with SIGUSR1 masked. Most subprocesses do not expect this and never unmask the signal, resulting in missing functionality or unexpected behavior for processes that use SIGUSR1 (such as i3status). Fix this by unmasking all signals between fork and exec.
2018-07-23Merge branch 'master' into pid-workspacesDrew DeVault
2018-07-09Update for swaywm/wlroots#1126emersion
2018-07-02exec_always: fix leaksDominique Martinet
- child would leak in the workspace_record_pid path - removing malloc lets us get rid of That Comment nobody seems to remember what it was about - we would leak pipe fds on first fork failling - we didn't return an error if second fork failed - the final executed process still had both pipe fds (would show up in /proc/23560/fd in launched programs) - we would write twice to the pipe if execl failed for some reason (e.g. if /bin/sh doesn't exist?!)
2018-07-01Implement pid->workspace trackingDrew DeVault
When you spawn a process with the exec command, sway now notes the workspace you had focused and the pid of the child process, then assigns that workspace to the child when its window appears. Some of this is carried over from sway 0.15, but with some major refactoring and centralization of state.
2018-06-08sway exec command: use waitpid instead of waitDominique Martinet
2018-05-06Revert "exec_always: Search for executables in /usr/lib/sway"Rostislav Pehlivanov
This reverts commit 7709340727fe2834f87b43aeeaef878694d5acd6.
2018-05-06Revert "Make the LIBDIR path configurable"Rostislav Pehlivanov
This reverts commit 1670b46bf6e56d37e69ab0fa32c6799e83397020.
2018-05-06Revert "Meson: Replace option `instlibdir` with `libexecdir`"Rostislav Pehlivanov
This reverts commit 830c4ef74c00dbe448da46cdbc576178abc5728e.
2018-05-06Revert "command/exec_always: Use wlr_log for logging errors in the child ↵Rostislav Pehlivanov
process" This reverts commit 177c67e6b89404d9d477b82c00c1353cd4696096.
2018-05-06Fix PATH setenv() in exec_alwaysRyan Dwyer
2018-05-05command/exec_always: Use wlr_log for logging errors in the child processNicolas Braud-Santoni
2018-05-05Meson: Replace option `instlibdir` with `libexecdir`Nicolas Braud-Santoni
Derive a value from it, called `rundir` rather than writing join_paths(libexecdir, 'sway') all over the place.
2018-05-05Make the LIBDIR path configurableNicolas Braud-Santoni
2018-05-05exec_always: Search for executables in /usr/lib/swayNicolas Braud-Santoni
2018-04-13Fix gcc string truncation warningsDominique Martinet
2018-03-29Revert "Merge pull request #1653 from swaywm/revert-1647-refactor-tree"Tony Crisci
This reverts commit 472e81f35d689d67cda241acafda91c688d61046, reversing changes made to 6b7841b11ff4cd35f54d69dc92029855893e5ce0.
2018-03-29Revert "Refactor tree"Drew DeVault
2018-03-29move tree includes to their own directoryTony Crisci
2018-01-05sway: change all sway_log to wlr_logDominique Martinet
2017-12-05Add minimal config subsystememersion
2017-12-04Add exec and exec_always commandsemersion
2017-11-18Move everything to sway/old/Drew DeVault
2017-03-10UnGNUify the codebaseDrew DeVault
2016-12-15Handle allocation failure in commandsDrew DeVault