From 0c1cb35a4252ee1c346ef25357ac6832ccc22fa5 Mon Sep 17 00:00:00 2001 From: Puck Meerburg Date: Sun, 7 Aug 2022 10:12:51 +0000 Subject: [PATCH] Allow using security context properties in title_format --- sway/sway.5.scd | 4 ++++ sway/tree/view.c | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/sway/sway.5.scd b/sway/sway.5.scd index eb2c9e1ad..cfc1190dd 100644 --- a/sway/sway.5.scd +++ b/sway/sway.5.scd @@ -362,6 +362,10 @@ set|plus|minus|toggle %instance - The X11 instance (applicable to xwayland windows only) ++ %shell - The protocol the window is using (typically xwayland or xdg_shell) + %sandbox_app_id - The app ID of this window, as passed in by the + sandboxing engine (this may differ from %app_id) + %sandbox_engine - The name of the engine that the client of this + window is sandboxed with This command is typically used with *for_window* criteria. For example: diff --git a/sway/tree/view.c b/sway/tree/view.c index ea81f0c5e..3c44fd30d 100644 --- a/sway/tree/view.c +++ b/sway/tree/view.c @@ -1259,6 +1259,12 @@ static size_t parse_title_format(struct sway_view *view, char *buffer) { } else if (strncmp(next, "%app_id", 7) == 0) { len += append_prop(buffer, view_get_app_id(view)); format += 7; + } else if (strncmp(next, "%sandbox_app_id", 15) == 0) { + len += append_prop(buffer, view_get_sandbox_app_id(view)); + format += 15; + } else if (strncmp(next, "%sandbox_engine", 15) == 0) { + len += append_prop(buffer, view_get_sandbox_engine(view)); + format += 15; } else if (strncmp(next, "%class", 6) == 0) { len += append_prop(buffer, view_get_class(view)); format += 6;