切换 client 所在 tag
This commit is contained in:
@@ -29,6 +29,10 @@ void select_tag_of_current_monitor(const user_action_arg_t *arg) {
|
|||||||
monitor_select_tag(wm.current_monitor, arg->ui);
|
monitor_select_tag(wm.current_monitor, arg->ui);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void send_client_to_tag(const user_action_arg_t *arg) {
|
||||||
|
if (wm.client_focused) client_send_to_tag(wm.client_focused, arg->ui);
|
||||||
|
}
|
||||||
|
|
||||||
void spawn(const user_action_arg_t *arg) {
|
void spawn(const user_action_arg_t *arg) {
|
||||||
const char *cmd = (const char *)arg->ptr;
|
const char *cmd = (const char *)arg->ptr;
|
||||||
if (cmd == nullptr || strlen(cmd) == 0) return;
|
if (cmd == nullptr || strlen(cmd) == 0) return;
|
||||||
|
|||||||
@@ -50,5 +50,6 @@ typedef struct keyboard_t {
|
|||||||
|
|
||||||
void focus_client_in_same_tag(const user_action_arg_t *arg);
|
void focus_client_in_same_tag(const user_action_arg_t *arg);
|
||||||
void select_tag_of_current_monitor(const user_action_arg_t *arg);
|
void select_tag_of_current_monitor(const user_action_arg_t *arg);
|
||||||
|
void send_client_to_tag(const user_action_arg_t *arg);
|
||||||
void spawn(const user_action_arg_t *arg);
|
void spawn(const user_action_arg_t *arg);
|
||||||
void quit(const user_action_arg_t *arg);
|
void quit(const user_action_arg_t *arg);
|
||||||
|
|||||||
@@ -232,6 +232,12 @@ bool client_need_layout(client_t *client) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void client_send_to_tag(client_t *client, uint32_t tag_mask) {
|
||||||
|
client->tags = tag_mask;
|
||||||
|
client_tags_apply(client);
|
||||||
|
monitor_select_tag(client->monitor, tag_mask);
|
||||||
|
}
|
||||||
|
|
||||||
void client_move_to(client_t *client, int16_t x, int16_t y) {
|
void client_move_to(client_t *client, int16_t x, int16_t y) {
|
||||||
client->geometry.x = x;
|
client->geometry.x = x;
|
||||||
client->geometry.y = y;
|
client->geometry.y = y;
|
||||||
|
|||||||
@@ -30,6 +30,11 @@ static const button_t button_list[] = {
|
|||||||
{click_tag, modifier_none, button_left, select_tag_of_current_monitor, {0}},
|
{click_tag, modifier_none, button_left, select_tag_of_current_monitor, {0}},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#define TAGKEYS(KEY, TAG) \
|
||||||
|
{modifier_alt, KEY, select_tag_of_current_monitor, {.ui = TAG}}, { \
|
||||||
|
modifier_alt | modifier_shift, KEY, send_client_to_tag, {.ui = TAG}, \
|
||||||
|
}
|
||||||
|
|
||||||
static const char launcher[] =
|
static const char launcher[] =
|
||||||
"rofi -show combi -modes combi -combi-modes window,drun,run,ssh,windowcd";
|
"rofi -show combi -modes combi -combi-modes window,drun,run,ssh,windowcd";
|
||||||
static const keyboard_t key_list[] = {
|
static const keyboard_t key_list[] = {
|
||||||
@@ -38,6 +43,16 @@ static const keyboard_t key_list[] = {
|
|||||||
{modifier_alt, XK_r, quit, {.b = true}},
|
{modifier_alt, XK_r, quit, {.b = true}},
|
||||||
{modifier_alt | modifier_shift, XK_j, focus_client_in_same_tag, {.b = true}},
|
{modifier_alt | modifier_shift, XK_j, focus_client_in_same_tag, {.b = true}},
|
||||||
{modifier_alt | modifier_shift, XK_k, focus_client_in_same_tag, {.b = false}},
|
{modifier_alt | modifier_shift, XK_k, focus_client_in_same_tag, {.b = false}},
|
||||||
|
|
||||||
|
TAGKEYS(XK_1, 1 << 0),
|
||||||
|
TAGKEYS(XK_2, 1 << 1),
|
||||||
|
TAGKEYS(XK_3, 1 << 2),
|
||||||
|
TAGKEYS(XK_4, 1 << 3),
|
||||||
|
TAGKEYS(XK_5, 1 << 4),
|
||||||
|
TAGKEYS(XK_6, 1 << 5),
|
||||||
|
TAGKEYS(XK_7, 1 << 6),
|
||||||
|
TAGKEYS(XK_8, 1 << 7),
|
||||||
|
TAGKEYS(XK_9, 1 << 8),
|
||||||
};
|
};
|
||||||
|
|
||||||
static const layout_t layout_list[] = {
|
static const layout_t layout_list[] = {
|
||||||
|
|||||||
Reference in New Issue
Block a user