*<action name="ToggleAlwaysOnTop">*
Toggle always-on-top of focused window.
+*<action name="GoToDesktop"><to>*
+ Switch to workspace. Supported values are "left", "right" or the full
+ name of a workspace or its index (starting at 1) as configured in rc.xml.
+
+*<action name="SendToDesktop"><to>*
+ Send active window to workspace.
+ Supported values are the same as for GoToDesktop.
+
# SEE ALSO
labwc(1), labwc-config(5), labwc-theme(5)
#include "menu/menu.h"
#include "ssd.h"
#include "action.h"
+#include "workspaces.h"
enum action_type {
ACTION_TYPE_NONE = 0,
ACTION_TYPE_MOVE,
ACTION_TYPE_RAISE,
ACTION_TYPE_RESIZE,
+ ACTION_TYPE_GO_TO_DESKTOP,
+ ACTION_TYPE_SEND_TO_DESKTOP,
};
const char *action_names[] = {
"Move",
"Raise",
"Resize",
+ "GoToDesktop",
+ "SendToDesktop",
NULL
};
resize_edges);
}
break;
+ case ACTION_TYPE_GO_TO_DESKTOP:
+ {
+ struct workspace *target;
+ target = workspaces_find(server->workspace_current, action->arg);
+ if (target) {
+ workspaces_switch_to(target);
+ }
+ }
+ break;
+ case ACTION_TYPE_SEND_TO_DESKTOP:
+ if (view) {
+ struct workspace *target;
+ target = workspaces_find(view->workspace, action->arg);
+ if (target) {
+ workspaces_send_to(view, target);
+ }
+ }
+ break;
case ACTION_TYPE_NONE:
wlr_log(WLR_ERROR,
"Not executing unknown action with arg %s",
wlr_log(WLR_ERROR, "Action argument already set: %s",
current_keybind_action->arg);
} else if (!strcmp(nodename, "command.action")) {
+ /* Execute */
current_keybind_action->arg = strdup(content);
} else if (!strcmp(nodename, "direction.action")) {
+ /* MoveToEdge, SnapToEdge */
current_keybind_action->arg = strdup(content);
} else if (!strcmp(nodename, "menu.action")) {
+ /* ShowMenu */
+ current_keybind_action->arg = strdup(content);
+ } else if (!strcmp(nodename, "to.action")) {
+ /* GoToDesktop, SendToDesktop */
current_keybind_action->arg = strdup(content);
}
}
* compatibility with old openbox-menu generators
*/
current_item_action->arg = strdup(content);
+ } else if (!strcmp(nodename, "to.action")) {
+ current_item_action->arg = strdup(content);
}
}