diff options
-rw-r--r-- | meson.build | 9 | ||||
-rw-r--r-- | security.d/00-defaults.in | 6 | ||||
-rw-r--r-- | sway/commands/exec_always.c | 38 | ||||
-rw-r--r-- | swaybar/meson.build | 3 | ||||
-rw-r--r-- | swaybg/meson.build | 3 |
5 files changed, 5 insertions, 54 deletions
diff --git a/meson.build b/meson.build index e40dc33c..bf266e5f 100644 --- a/meson.build +++ b/meson.build @@ -19,14 +19,6 @@ is_freebsd = host_machine.system().startswith('freebsd') datadir = get_option('datadir') sysconfdir = get_option('sysconfdir') prefix = get_option('prefix') -libexecdir = get_option('libexecdir') - -if libexecdir == '' - libexecdir = 'lib' -endif -sway_libexecdir = join_paths(prefix, libexecdir, 'sway') -add_project_arguments('-DSWAY_LIBEXECDIR="/@0@"'.format(sway_libexecdir), language : 'c') - jsonc = dependency('json-c', version: '>=0.13') pcre = dependency('libpcre') @@ -121,7 +113,6 @@ config = configuration_data() config.set('sysconfdir', join_paths(prefix, sysconfdir)) config.set('datadir', join_paths(prefix, datadir)) config.set('prefix', prefix) -config.set('sway_libexecdir', sway_libexecdir) configure_file( configuration: config, diff --git a/security.d/00-defaults.in b/security.d/00-defaults.in index b5ae1149..e4626477 100644 --- a/security.d/00-defaults.in +++ b/security.d/00-defaults.in @@ -11,9 +11,9 @@ # Configures enabled compositor features for specific programs permit * fullscreen keyboard mouse permit @prefix@/bin/swaylock lock +permit @prefix@/bin/swaybg background permit @prefix@/bin/swaygrab screenshot -permit @sway_libexecdir@/swaybg background -permit @sway_libexecdir@/swaybar panel +permit @prefix@/bin/swaybar panel # Configures enabled IPC features for specific programs ipc @prefix@/bin/swaymsg { @@ -24,7 +24,7 @@ ipc @prefix@/bin/swaymsg { } } -ipc @sway_libexecdir@/swaybar { +ipc @prefix@/bin/swaybar { bar-config enabled outputs enabled workspaces enabled diff --git a/sway/commands/exec_always.c b/sway/commands/exec_always.c index f631d7d8..af4e4965 100644 --- a/sway/commands/exec_always.c +++ b/sway/commands/exec_always.c @@ -11,7 +11,6 @@ #include "log.h" #include "stringop.h" - struct cmd_results *cmd_exec_always(int argc, char **argv) { struct cmd_results *error = NULL; if (!config->active) return cmd_results_new(CMD_DEFER, NULL, NULL); @@ -52,44 +51,7 @@ struct cmd_results *cmd_exec_always(int argc, char **argv) { if ((pid = fork()) == 0) { // Fork child process again setsid(); - if ((*child = fork()) == 0) { - // Acquire the current PATH - char *path = getenv("PATH"); - const char *extra_path = ":" SWAY_LIBEXECDIR; - const size_t extra_size = sizeof(SWAY_LIBEXECDIR) + 1; - - if (!path) { - size_t n = confstr(_CS_PATH, NULL, 0); - path = malloc(n + extra_size); - if (!path) { - wlr_log(L_ERROR, "exec_always: Unable to allocate PATH"); - exit(EXIT_FAILURE); - } - confstr(_CS_PATH, path, n); - - } else { - size_t n = strlen(path) + 1; - char *tmp = malloc(n + extra_size); - if (!tmp) { - wlr_log(L_ERROR, "exec_always: Unable to allocate PATH"); - exit(EXIT_FAILURE); - } - - strncpy(tmp, path, n); - path = tmp; - } - - // Append /usr/lib/sway to PATH - strcat(path, extra_path); - if (setenv("PATH", path, 1) == -1) { - free(path); - wlr_log(L_ERROR, "exec_always: Unable to set PATH"); - exit(EXIT_FAILURE); - } - free(path); - - // Execute the command execl("/bin/sh", "/bin/sh", "-c", cmd, (void *)NULL); // Not reached } diff --git a/swaybar/meson.build b/swaybar/meson.build index 41c81a88..d65edb11 100644 --- a/swaybar/meson.build +++ b/swaybar/meson.build @@ -24,6 +24,5 @@ executable( wlroots, ], link_with: [lib_sway_common, lib_sway_client], - install: true, - install_dir: sway_libexecdir + install: true ) diff --git a/swaybg/meson.build b/swaybg/meson.build index 716178d2..8704de6d 100644 --- a/swaybg/meson.build +++ b/swaybg/meson.build @@ -14,6 +14,5 @@ executable( wlroots, ], link_with: [lib_sway_common, lib_sway_client], - install: true, - install_dir: sway_libexecdir + install: true ) |