Toggle Mon

This commit is contained in:
2026-04-12 21:13:36 +02:00
parent 7d1a34e011
commit c39dab7cb2
2 changed files with 13 additions and 0 deletions
+2
View File
@@ -150,6 +150,8 @@ static const Key keys[] = {
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_Down, movestack, {.i = +1} }, { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_Down, movestack, {.i = +1} },
{ MODKEY, XKB_KEY_comma, focusmon, {.i = WLR_DIRECTION_LEFT} }, { MODKEY, XKB_KEY_comma, focusmon, {.i = WLR_DIRECTION_LEFT} },
{ MODKEY, XKB_KEY_period, focusmon, {.i = WLR_DIRECTION_RIGHT} }, { MODKEY, XKB_KEY_period, focusmon, {.i = WLR_DIRECTION_RIGHT} },
{ MODKEY, XKB_KEY_o, focusmon, {.i = WLR_DIRECTION_RIGHT} },
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_O, tagcyclemon, {.i = WLR_DIRECTION_RIGHT} },
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_Q, quit, {0} }, { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_Q, quit, {0} },
/* Ctrl-Alt-Backspace and Ctrl-Alt-Fx used to be handled by X server */ /* Ctrl-Alt-Backspace and Ctrl-Alt-Fx used to be handled by X server */
+11
View File
@@ -335,6 +335,7 @@ static void shiftview(const Arg *arg);
static void spawn(const Arg *arg); static void spawn(const Arg *arg);
static void startdrag(struct wl_listener *listener, void *data); static void startdrag(struct wl_listener *listener, void *data);
static void tag(const Arg *arg); static void tag(const Arg *arg);
static void tagcyclemon(const Arg *arg);
static void tagmon(const Arg *arg); static void tagmon(const Arg *arg);
static void tile(Monitor *m); static void tile(Monitor *m);
static void togglefloating(const Arg *arg); static void togglefloating(const Arg *arg);
@@ -2712,6 +2713,16 @@ tag(const Arg *arg)
printstatus(); printstatus();
} }
void
tagcyclemon(const Arg *arg)
{
Client *sel = focustop(selmon);
if (!sel)
return;
setmon(sel, dirtomon(arg->i), 0);
focusmon(arg);
}
void void
tagmon(const Arg *arg) tagmon(const Arg *arg)
{ {