diff options
| author | Mouad Alami <mouad@alami.xyz> | 2024-01-15 10:15:54 +0100 |
|---|---|---|
| committer | Mouad Alami <mouad@alami.xyz> | 2024-01-15 10:15:54 +0100 |
| commit | 78c3053eac670e2f2ede050ce501547804372893 (patch) | |
| tree | 775bda60429b72360fb2c079aa55dd3fc77f1af4 | |
| parent | 757acbdc5249772b9a5e9d9c44b2692c153e0ccc (diff) | |
Reverted alternativetags patch and added mod+n for clipmenu
| -rw-r--r-- | config.h | 5 | ||||
| -rw-r--r-- | dwm.c | 35 |
2 files changed, 3 insertions, 37 deletions
@@ -37,8 +37,6 @@ static const char *dec_bright[] = { "/home/mouad/.local/bin/brightness/dec_brigh /* tagging */ static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" }; -static const char *tagsalt[] = { "", "", "", "", "", "", "", "", "" }; -static const int momentaryalttags = 1; /* 1 means alttags will show only when key is held down*/ static const Rule rules[] = { /* xprop(1): @@ -110,7 +108,6 @@ static const Key keys[] = { { MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } }, { MODKEY, XK_comma, focusmon, {.i = -1 } }, { MODKEY, XK_period, focusmon, {.i = +1 } }, - { MODKEY, XK_n, togglealttag, {0} }, { MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } }, { MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } }, {MODKEY, XK_s, togglesticky, {0}}, @@ -160,8 +157,8 @@ static const Key keys[] = { {0, XF86XK_AudioPlay, spawn, SHCMD("playerctl play-pause")}, {MODKEY, XK_e, spawn, SHCMD("xdotool type $(grep -Ev '^($|#)' ~/.config/bookmarks | dmenu -i -l 50 | cut -d' ' -f1)")}, + {MODKEY, XK_n, spawn, SHCMD("clipmenu")}, - /* screenshot */ {MODKEY, XK_F12, spawn, SHCMD("scrot -e 'mv $f /home/mouad/Pictures/Screenshots/' && notify-send '📸 Screenshot taken'")}, }; @@ -134,7 +134,6 @@ struct Monitor { Window barwin; const Layout *lt[2]; Pertag *pertag; - unsigned int alttag; }; typedef struct { @@ -185,7 +184,6 @@ static void grabbuttons(Client *c, int focused); static void grabkeys(void); static void incnmaster(const Arg *arg); static void keypress(XEvent *e); -static void keyrelease(XEvent *e); static void killclient(const Arg *arg); static void manage(Window w, XWindowAttributes *wa); static void mappingnotify(XEvent *e); @@ -220,7 +218,6 @@ static void spawn(const Arg *arg); static void tag(const Arg *arg); static void tagmon(const Arg *arg); static void tile(Monitor *m); -static void togglealttag(const Arg *arg); static void togglebar(const Arg *arg); static void togglefakefullscreen(const Arg *arg); static void togglefloating(const Arg *arg); @@ -274,7 +271,6 @@ static void (*handler[LASTEvent]) (XEvent *) = { [Expose] = expose, [FocusIn] = focusin, [KeyPress] = keypress, - [KeyRelease] = keyrelease, [MappingNotify] = mappingnotify, [MapRequest] = maprequest, [MotionNotify] = motionnotify, @@ -786,7 +782,7 @@ dirtomon(int dir) void drawbar(Monitor *m) { - int x, w, wdelta, tw = 0; + int x, w, tw = 0; int boxs = drw->fonts->h / 9; int boxw = drw->fonts->h / 6 + 2; unsigned int i, occ = 0, urg = 0; @@ -828,9 +824,8 @@ drawbar(Monitor *m) if(!(occ & 1 << i || m->tagset[m->seltags] & 1 << i)) continue; w = TEXTW(tags[i]); - wdelta = selmon->alttag ? abs(TEXTW(tags[i]) - TEXTW(tagsalt[i])) / 2 : 0; drw_setscheme(drw, scheme[m->tagset[m->seltags] & 1 << i ? SchemeSel : SchemeNorm]); - drw_text(drw, x, 0, w, bh, wdelta + lrpad / 2, (selmon->alttag ? tagsalt[i] : tags[i]), urg & 1 << i); + drw_text(drw, x, 0, w, bh, lrpad / 2, tags[i], urg & 1 << i); x += w; } w = TEXTW(m->ltsymbol); @@ -1155,25 +1150,6 @@ keypress(XEvent *e) } void -keyrelease(XEvent *e) -{ - unsigned int i; - KeySym keysym; - XKeyEvent *ev; - - ev = &e->xkey; - keysym = XKeycodeToKeysym(dpy, (KeyCode)ev->keycode, 0); - - for (i = 0; i < LENGTH(keys); i++) - if (momentaryalttags - && keys[i].func && keys[i].func == togglealttag - && selmon->alttag - && (keysym == keys[i].keysym - || CLEANMASK(keys[i].mod) == CLEANMASK(ev->state))) - keys[i].func(&(keys[i].arg)); -} - -void killclient(const Arg *arg) { if (!selmon->sel) @@ -1938,13 +1914,6 @@ tile(Monitor *m) } void -togglealttag(const Arg *arg) -{ - selmon->alttag = !selmon->alttag; - drawbar(selmon); -} - -void togglebar(const Arg *arg) { selmon->showbar = selmon->pertag->showbars[selmon->pertag->curtag] = !selmon->showbar; |
