mirror of
https://github.com/fairyglade/ly.git
synced 2025-12-21 03:34:54 +00: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:
committed by
GitHub
parent
4882cd4548
commit
33934f3ab2
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);
|
||||
|
||||
Reference in New Issue
Block a user