Skip to content

Instantly share code, notes, and snippets.

@davidphilipbarr
Created December 3, 2024 18:23
Show Gist options
  • Select an option

  • Save davidphilipbarr/e0226fdd84fb58b5d55213baf11963b7 to your computer and use it in GitHub Desktop.

Select an option

Save davidphilipbarr/e0226fdd84fb58b5d55213baf11963b7 to your computer and use it in GitHub Desktop.
more client menu
wl_list_for_each(view, &server->views, link) {
if (view->workspace == workspace) {
const char *title = view_get_string_prop(view, "title");
const char *appid = view_get_string_prop(view, "app_id");
if (!view->foreign_toplevel || string_null_or_empty(title)) {
continue;
}
if (view == server->active_view) {
buf_add_fmt(&buffer, "* %s - %s", title, appid);
}
else if (view->maximized) {
buf_add_fmt(&buffer, "[[%s - %s]]", title, appid);
}
else if (view->fullscreen) {
buf_add_fmt(&buffer, "[%s - %s]", title, appid);
}
else if (view->minimized) {
buf_add_fmt(&buffer, "(%s - %s)", title, appid);
}
else {
buf_add_fmt(&buffer, "%s - %s", title, appid);
}
current_item = item_create(menu, buffer.data, /*show arrow*/ false);
current_item->id = xstrdup(menu->id);
current_item->client_list_view = view;
fill_item("name.action", "Focus");
fill_item("name.action", "Raise");
buf_clear(&buffer);
}
}
if (workspace != server->workspaces.current) {
current_item = item_create(menu, _("Go there..."), /*show arrow*/ false);
current_item->id = xstrdup(menu->id);
fill_item("name.action", "GoToDesktop");
fill_item("to.action", workspace->name);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment