mirror of
https://codeberg.org/fairyglade/ly.git
synced 2026-08-26 15:34:20 +02:00
add wayland specifier to session names (#162)
Create a config option to force ly to add " (Wayland)" to session names, as long as those names don't already contain the string.
This commit is contained in:
parent
a36f70ecb2
commit
b2c1ef5c50
4 changed files with 19 additions and 0 deletions
13
src/utils.c
13
src/utils.c
|
|
@ -95,6 +95,19 @@ void desktop_crawl(
|
|||
strncat(path, dir_info->d_name, (sizeof (path)) - 1);
|
||||
configator(&desktop_config, path);
|
||||
|
||||
// if these are wayland sessions, add " (Wayland)" to their names,
|
||||
// as long as their names don't already contain that string
|
||||
if (server == DS_WAYLAND && config.wayland_specifier)
|
||||
{
|
||||
const char wayland_specifier[] = " (Wayland)";
|
||||
if (strstr(name, wayland_specifier) == NULL)
|
||||
{
|
||||
name = realloc(name, (strlen(name) + sizeof(wayland_specifier) + 1));
|
||||
// using strcat is safe because the string is constant
|
||||
strcat(name, wayland_specifier);
|
||||
}
|
||||
}
|
||||
|
||||
if ((name != NULL) && (exec != NULL))
|
||||
{
|
||||
input_desktop_add(target, name, exec, server);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue