mirror of
https://github.com/eRgo35/dwm.git
synced 2025-12-16 13:46:11 +01:00
initial commit
This commit is contained in:
69
patch/focusadjacenttag.c
Normal file
69
patch/focusadjacenttag.c
Normal file
@@ -0,0 +1,69 @@
|
||||
void
|
||||
tagtoleft(const Arg *arg)
|
||||
{
|
||||
unsigned int MASK = (1 << NUMTAGS) - 1;
|
||||
if (selmon->sel != NULL
|
||||
&& __builtin_popcount(selmon->tagset[selmon->seltags] & MASK) == 1
|
||||
&& selmon->tagset[selmon->seltags] > 1) {
|
||||
selmon->sel->tags >>= 1;
|
||||
arrange(selmon);
|
||||
focus(NULL);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
tagtoright(const Arg *arg)
|
||||
{
|
||||
unsigned int MASK = (1 << NUMTAGS) - 1;
|
||||
if (selmon->sel != NULL
|
||||
&& __builtin_popcount(selmon->tagset[selmon->seltags] & MASK) == 1
|
||||
&& selmon->tagset[selmon->seltags] & (MASK >> 1)) {
|
||||
selmon->sel->tags <<= 1;
|
||||
arrange(selmon);
|
||||
focus(NULL);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
viewtoleft(const Arg *arg)
|
||||
{
|
||||
unsigned int MASK = (1 << NUMTAGS) - 1;
|
||||
if (__builtin_popcount(selmon->tagset[selmon->seltags] & MASK) == 1
|
||||
&& selmon->tagset[selmon->seltags] > 1) {
|
||||
view(&((Arg) { .ui = selmon->tagset[selmon->seltags] >> 1 }));
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
viewtoright(const Arg *arg)
|
||||
{
|
||||
unsigned int MASK = (1 << NUMTAGS) - 1;
|
||||
if (__builtin_popcount(selmon->tagset[selmon->seltags] & MASK) == 1
|
||||
&& selmon->tagset[selmon->seltags] & (MASK >> 1)) {
|
||||
view(&((Arg) { .ui = selmon->tagset[selmon->seltags] << 1 }));
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
tagandviewtoleft(const Arg *arg)
|
||||
{
|
||||
unsigned int MASK = (1 << NUMTAGS) - 1;
|
||||
if (selmon->sel != NULL
|
||||
&& __builtin_popcount(selmon->tagset[selmon->seltags] & MASK) == 1
|
||||
&& selmon->tagset[selmon->seltags] > 1) {
|
||||
selmon->sel->tags >>= 1;
|
||||
view(&((Arg) { .ui = selmon->tagset[selmon->seltags] >> 1 }));
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
tagandviewtoright(const Arg *arg)
|
||||
{
|
||||
unsigned int MASK = (1 << NUMTAGS) - 1;
|
||||
if (selmon->sel != NULL
|
||||
&& __builtin_popcount(selmon->tagset[selmon->seltags] & MASK) == 1
|
||||
&& selmon->tagset[selmon->seltags] & (MASK >> 1)) {
|
||||
selmon->sel->tags <<= 1;
|
||||
view(&((Arg) { .ui = selmon->tagset[selmon->seltags] << 1 }));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user