add autostart with permissions

This commit is contained in:
Tobias Bengfort 2025-09-06 12:46:52 +02:00
parent f084a99f29
commit 089a362d73
3 changed files with 14 additions and 0 deletions

View file

@ -187,6 +187,8 @@ struct rcxml {
struct wl_list window_rules; /* struct window_rule.link */
struct wl_list autostart; /* struct action.link */
/* Menu */
unsigned int menu_ignore_button_release_period;
bool menu_show_icons;

View file

@ -1042,6 +1042,8 @@ entry(xmlNode *node, char *nodename, char *content)
/* handle nested nodes */
if (!strcasecmp(nodename, "margin")) {
fill_usable_area_override(node);
} else if (!strcasecmp(nodename, "autostart")) {
append_parsed_actions(node, &rc.autostart);
} else if (!strcasecmp(nodename, "keybind.keyboard")) {
fill_keybind(node);
} else if (!strcasecmp(nodename, "context.mouse")) {
@ -1358,6 +1360,7 @@ rcxml_init(void)
if (!has_run) {
wl_list_init(&rc.usable_area_overrides);
wl_list_init(&rc.autostart);
wl_list_init(&rc.keybinds);
wl_list_init(&rc.mousebinds);
wl_list_init(&rc.libinput_categories);

View file

@ -11,6 +11,7 @@
#include <wlr/backend/drm.h>
#include <wlr/backend/multi.h>
#include <wlr/util/log.h>
#include "action.h"
#include "common/buf.h"
#include "common/dir.h"
#include "common/file-helpers.h"
@ -286,6 +287,13 @@ session_environment_init(void)
paths_destroy(&paths);
}
static void
session_run_rc_autostart(struct server *server)
{
wlr_log(WLR_INFO, "run autostart actions");
actions_run(NULL, server, &rc.autostart, NULL);
}
void
session_run_script(const char *script)
{
@ -318,6 +326,7 @@ session_autostart_init(struct server *server)
{
/* Update dbus and systemd user environment, each may fail gracefully */
update_activation_env(server, /* initialize */ true);
session_run_rc_autostart(server);
session_run_script("autostart");
}