From cd7be59d5fea887b41abb6a0edcedcc233795c36 Mon Sep 17 00:00:00 2001 From: massi Date: Tue, 12 May 2026 17:06:18 -0700 Subject: [PATCH] window-title: rewording, renaming, lint fixes --- docs/labwc.1.scd | 14 +++++++------- include/labwc.h | 2 +- src/main.c | 32 ++++++++++++++++---------------- src/output.c | 4 ++-- 4 files changed, 26 insertions(+), 26 deletions(-) diff --git a/docs/labwc.1.scd b/docs/labwc.1.scd index 30abf3f6..3be47743 100644 --- a/docs/labwc.1.scd +++ b/docs/labwc.1.scd @@ -70,13 +70,13 @@ the `--exit` and `--reconfigure` options use. session clients support both X11 and Wayland, this command line option avoids re-writes and fragmentation. -*-t, --window-title* - Set the window title for labwc to use when nested in a compositor. - is a format string to be used as the window title, replacing - `%o` with the name of the output region. This is useful when simulating - multiple screens, such as with running labwc with the enviornment - variable `WLR_WL_OUTPUTS=2`. In this case, `%o` will be unique per - simulated screen. +*-t, --title* + Set the window title for labwc to use when it is running in a window + (i.e. nested in a compositor). is a format string to be used as + the window title, replacing `%o` with the name of the output + region. This is useful when simulating multiple screens, such as with + running labwc with the enviornment variable `WLR_WL_OUTPUTS=2`. In this + case, `%o` will be unique per simulated screen. *-v, --version* Show the version number and quit diff --git a/include/labwc.h b/include/labwc.h index bbee63cf..a6d69317 100644 --- a/include/labwc.h +++ b/include/labwc.h @@ -316,7 +316,7 @@ struct server { pid_t primary_client_pid; - char *window_title_fmt; + char *title_fmt; }; /* defined in main.c */ diff --git a/src/main.c b/src/main.c index 98c1f1bf..081bd62a 100644 --- a/src/main.c +++ b/src/main.c @@ -38,7 +38,7 @@ static const struct option long_options[] = { {"reconfigure", no_argument, NULL, 'r'}, {"startup", required_argument, NULL, 's'}, {"session", required_argument, NULL, 'S'}, - {"window-title", required_argument, NULL, 't'}, + {"title", required_argument, NULL, 't'}, {"version", no_argument, NULL, 'v'}, {"verbose", no_argument, NULL, 'V'}, {0, 0, 0, 0} @@ -46,18 +46,18 @@ static const struct option long_options[] = { static const char labwc_usage[] = "Usage: labwc [options...]\n" -" -c, --config Specify config file (with path)\n" -" -C, --config-dir Specify config directory\n" -" -d, --debug Enable full logging, including debug information\n" -" -e, --exit Exit the compositor\n" -" -h, --help Show help message and quit\n" -" -m, --merge-config Merge user config files/theme in all XDG Base Dirs\n" -" -r, --reconfigure Reload the compositor configuration\n" -" -s, --startup Run command on startup\n" -" -S, --session Run command on startup and terminate on exit\n" -" -t, --window-title Specify title to use when the compositor is nested\n" -" -v, --version Show version number and quit\n" -" -V, --verbose Enable more verbose logging\n"; +" -c, --config Specify config file (with path)\n" +" -C, --config-dir Specify config directory\n" +" -d, --debug Enable full logging, including debug information\n" +" -e, --exit Exit the compositor\n" +" -h, --help Show help message and quit\n" +" -m, --merge-config Merge user config files/theme in all XDG Base Dirs\n" +" -r, --reconfigure Reload the compositor configuration\n" +" -s, --startup Run command on startup\n" +" -S, --session Run command on startup and terminate on exit\n" +" -t, --title Specify title to use when running in a window\n" +" -v, --version Show version number and quit\n" +" -V, --verbose Enable more verbose logging\n"; static void usage(void) @@ -211,7 +211,7 @@ main(int argc, char *argv[]) primary_client = optarg; break; case 't': - server.window_title_fmt = optarg; + server.title_fmt = optarg; break; case 'v': print_version(); @@ -271,8 +271,8 @@ main(int argc, char *argv[]) increase_nofile_limit(); - if (string_null_or_empty(server.window_title_fmt)) { - server.window_title_fmt = "labwc - %o"; + if (string_null_or_empty(server.title_fmt)) { + server.title_fmt = "labwc - %o"; } server_init(); diff --git a/src/output.c b/src/output.c index 33154e58..6811b783 100644 --- a/src/output.c +++ b/src/output.c @@ -607,8 +607,8 @@ handle_new_output(struct wl_listener *listener, void *data) } if (wlr_output_is_wl(wlr_output)) { - gchar** parts = g_strsplit(server.window_title_fmt, "%o", -1); - gchar* formatted_title = g_strjoinv(wlr_output->name, parts); + gchar **parts = g_strsplit(server.title_fmt, "%o", -1); + gchar *formatted_title = g_strjoinv(wlr_output->name, parts); g_strfreev(parts); wlr_wl_output_set_title(wlr_output, formatted_title); g_free(formatted_title);