fixed fonts, added newsboat
This commit is contained in:
parent
8c4521015f
commit
11ab11d59e
23 changed files with 2892 additions and 37 deletions
|
@ -1,4 +1,4 @@
|
|||
{ config, inputs, pkgs, ... }:
|
||||
{ config, inputs, pkgs, lib, ... }:
|
||||
{
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
# Time Zone
|
||||
|
@ -23,7 +23,6 @@
|
|||
security.sudo.package = pkgs.sudo.override { withInsults = true; };
|
||||
security.polkit.enable = true;
|
||||
programs.kdeconnect.enable = true;
|
||||
services.picom.enable = true;
|
||||
services.mpd = {
|
||||
enable = true;
|
||||
musicDirectory = "/home/vali/Nextcloud/Media/Music/";
|
||||
|
@ -35,6 +34,12 @@
|
|||
}
|
||||
'';
|
||||
};
|
||||
/* options.ui.darkTheme = {
|
||||
type = lib.types.bool;
|
||||
default = true;
|
||||
example = false;
|
||||
description = "If ui programs should use a dark or light theme";
|
||||
};*/
|
||||
modules = {
|
||||
other = {
|
||||
system = {
|
||||
|
@ -49,10 +54,10 @@
|
|||
};
|
||||
programs = {
|
||||
vesktop.enable = true;
|
||||
ncmpcpp.enable = true;
|
||||
ssh.enable = true;
|
||||
btop.enable = true;
|
||||
mpv.enable = true;
|
||||
kitty.enable = true;
|
||||
dwm.enable = true;
|
||||
schizofox.enable = true;
|
||||
#git = {
|
||||
|
@ -66,13 +71,6 @@
|
|||
enable = true;
|
||||
profiling = false;
|
||||
};
|
||||
alacritty = {
|
||||
enable = true;
|
||||
catppuccin = true;
|
||||
opacity = 0.8;
|
||||
blur = true;
|
||||
# Grüsse
|
||||
};
|
||||
};
|
||||
services = {
|
||||
pipewire.enable = true;
|
||||
|
@ -106,3 +104,4 @@
|
|||
};
|
||||
system.stateVersion = "23.11";
|
||||
}
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
static int topbar = 1; /* -b option; if 0, dmenu appears at bottom */
|
||||
/* -fn option overrides fonts[0]; default X11 font or font set */
|
||||
static const char *fonts[] = {
|
||||
"monospace:size=18"
|
||||
"monospace:size=10"
|
||||
};
|
||||
static const char *prompt = NULL; /* -p option; prompt to the left of input field */
|
||||
static const char *colors[SchemeLast][2] = {
|
||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -95,6 +95,13 @@ static const Key keys[] = {
|
|||
TAGKEYS( XK_8, 7)
|
||||
TAGKEYS( XK_9, 8)
|
||||
{ MODKEY|ShiftMask, XK_q, quit, {0} },
|
||||
{ MODKEY, XK_s, scratchpad_show, {.i = 1} },
|
||||
{ MODKEY, XK_y, scratchpad_show, {.i = 2} },
|
||||
{ MODKEY, XK_u, scratchpad_show, {.i = 3} },
|
||||
{ MODKEY|ShiftMask, XK_s, scratchpad_hide, {.i = 1} },
|
||||
{ MODKEY|ShiftMask, XK_y, scratchpad_hide, {.i = 2} },
|
||||
{ MODKEY|ShiftMask, XK_u, scratchpad_hide, {.i = 3} },
|
||||
{ MODKEY|ShiftMask, XK_r, scratchpad_remove, {0} },
|
||||
};
|
||||
|
||||
/* button definitions */
|
||||
|
|
|
@ -1,21 +1,22 @@
|
|||
/* See LICENSE file for copyright and license details. */
|
||||
|
||||
|
||||
/* appearance */
|
||||
static const unsigned int borderpx = 1; /* border pixel of windows */
|
||||
static const unsigned int borderpx = 4; /* border pixel of windows */
|
||||
static const unsigned int snap = 32; /* snap pixel */
|
||||
static const int showbar = 1; /* 0 means no bar */
|
||||
static const int showbar = 0; /* 0 means no bar */
|
||||
static const int topbar = 1; /* 0 means bottom bar */
|
||||
static const char *fonts[] = { "monospace:size=10" };
|
||||
static const char dmenufont[] = "monospace:size=10";
|
||||
static const char col_gray1[] = "#222222";
|
||||
static const char col_gray2[] = "#444444";
|
||||
static const char col_gray1[] = "#282828";
|
||||
static const char col_gray2[] = "#98971a";
|
||||
static const char col_gray3[] = "#bbbbbb";
|
||||
static const char col_gray4[] = "#eeeeee";
|
||||
static const char col_cyan[] = "#005577";
|
||||
static const char col_gray4[] = "#928374";
|
||||
static const char col_cyan[] = "#BD93BD";
|
||||
static const char col_sel[] = "#d79921";
|
||||
static const char *colors[][3] = {
|
||||
/* fg bg border */
|
||||
[SchemeNorm] = { col_gray3, col_gray1, col_gray2 },
|
||||
[SchemeSel] = { col_gray4, col_cyan, col_cyan },
|
||||
[SchemeNorm] = { col_gray2, col_gray1, col_gray4 },
|
||||
[SchemeSel] = { col_gray2, col_gray1, col_sel },
|
||||
};
|
||||
|
||||
/* tagging */
|
||||
|
@ -57,14 +58,18 @@ static const Layout layouts[] = {
|
|||
|
||||
/* commands */
|
||||
static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
|
||||
static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4, NULL };
|
||||
static const char *dmenucmd[] = { "rofi", "-show", "drun", NULL };
|
||||
static const char *termcmd[] = { "kitty", NULL };
|
||||
static const char *browsercmd[] = { "tor-browser", NULL };
|
||||
static const char *filebrowsercmd[] = { "pcmanfm", NULL };
|
||||
static const char *spkeepassxc[] = { "keepassxc", NULL };
|
||||
|
||||
static const Key keys[] = {
|
||||
/* modifier key function argument */
|
||||
/* modifier key function argument */
|
||||
{ MODKEY, XK_d, spawn, {.v = dmenucmd } },
|
||||
{ MODKEY, XK_Return, spawn, {.v = termcmd } },
|
||||
{ MODKEY, XK_b, togglebar, {0} },
|
||||
{ MODKEY, XK_b, spawn, {.v = browsercmd } },
|
||||
{ MODKEY, XK_e, spawn, {.v = filebrowsercmd } },
|
||||
{ MODKEY, XK_j, focusstack, {.i = +1 } },
|
||||
{ MODKEY, XK_k, focusstack, {.i = -1 } },
|
||||
{ MODKEY, XK_i, incnmaster, {.i = +1 } },
|
||||
|
@ -85,6 +90,13 @@ static const Key keys[] = {
|
|||
{ MODKEY, XK_space, togglefullscr, {0} },
|
||||
{ MODKEY, XK_0, view, {.ui = ~0 } },
|
||||
{ MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } },
|
||||
{ MODKEY, XK_s, scratchpad_show, {.i = 1} },
|
||||
{ MODKEY, XK_y, scratchpad_show, {.i = 2} },
|
||||
{ MODKEY, XK_p, scratchpad_show, {.i = 3} },
|
||||
{ MODKEY|ShiftMask, XK_s, scratchpad_hide, {.i = 1} },
|
||||
{ MODKEY|ShiftMask, XK_y, scratchpad_hide, {.i = 2} },
|
||||
{ MODKEY|ShiftMask, XK_p, scratchpad_hide, {.i = 3} },
|
||||
{ MODKEY|ShiftMask, XK_r, scratchpad_remove, {0} },
|
||||
TAGKEYS( XK_1, 0)
|
||||
TAGKEYS( XK_2, 1)
|
||||
TAGKEYS( XK_3, 2)
|
||||
|
|
Binary file not shown.
|
@ -0,0 +1,207 @@
|
|||
diff --git a/config.def.h b/config.def.h
|
||||
index a2ac963..1c82453 100644
|
||||
--- a/config.def.h
|
||||
+++ b/config.def.h
|
||||
@@ -95,6 +95,13 @@ static Key keys[] = {
|
||||
TAGKEYS( XK_8, 7)
|
||||
TAGKEYS( XK_9, 8)
|
||||
{ MODKEY|ShiftMask, XK_q, quit, {0} },
|
||||
+ { MODKEY, XK_s, scratchpad_show, {.i = 1} },
|
||||
+ { MODKEY, XK_y, scratchpad_show, {.i = 2} },
|
||||
+ { MODKEY, XK_u, scratchpad_show, {.i = 3} },
|
||||
+ { MODKEY|ShiftMask, XK_s, scratchpad_hide, {.i = 1} },
|
||||
+ { MODKEY|ShiftMask, XK_y, scratchpad_hide, {.i = 2} },
|
||||
+ { MODKEY|ShiftMask, XK_u, scratchpad_hide, {.i = 3} },
|
||||
+ { MODKEY|ShiftMask, XK_r, scratchpad_remove, {0} },
|
||||
};
|
||||
|
||||
/* button definitions */
|
||||
diff --git a/dwm.c b/dwm.c
|
||||
index 5f16260..202038f 100644
|
||||
--- a/dwm.c
|
||||
+++ b/dwm.c
|
||||
@@ -195,6 +195,11 @@ static void resizemouse(const Arg *arg);
|
||||
static void restack(Monitor *m);
|
||||
static void run(void);
|
||||
static void scan(void);
|
||||
+static void scratchpad_hide();
|
||||
+static void scratchpad_remove();
|
||||
+static void scratchpad_show();
|
||||
+static void scratchpad_show_client(Client *c);
|
||||
+static void scratchpad_show_first(int scratchNum);
|
||||
static int sendevent(Client *c, Atom proto);
|
||||
static void sendmon(Client *c, Monitor *m);
|
||||
static void setclientstate(Client *c, long state);
|
||||
@@ -269,11 +274,19 @@ static Drw *drw;
|
||||
static Monitor *mons, *selmon;
|
||||
static Window root, wmcheckwin;
|
||||
|
||||
+/* scratchpad */
|
||||
+#define SCRATCHPAD_MASK_1 (1u << sizeof tags / sizeof * tags)
|
||||
+#define SCRATCHPAD_MASK_2 (1u << (sizeof tags / sizeof * tags + 1))
|
||||
+#define SCRATCHPAD_MASK_3 (1u << (sizeof tags / sizeof * tags + 2))
|
||||
+static int scratchpad_hide_flag = 0;
|
||||
+static Client *scratchpad_last_showed_1 = NULL;
|
||||
+static Client *scratchpad_last_showed_2 = NULL;
|
||||
+static Client *scratchpad_last_showed_3 = NULL;
|
||||
/* configuration, allows nested code to access above variables */
|
||||
#include "config.h"
|
||||
|
||||
/* compile-time check if all tags fit into an unsigned int bit array. */
|
||||
-struct NumTags { char limitexceeded[LENGTH(tags) > 31 ? -1 : 1]; };
|
||||
+struct NumTags { char limitexceeded[LENGTH(tags) > 28 ? -1 : 1]; };
|
||||
|
||||
/* function implementations */
|
||||
void
|
||||
@@ -309,7 +322,9 @@ applyrules(Client *c)
|
||||
XFree(ch.res_class);
|
||||
if (ch.res_name)
|
||||
XFree(ch.res_name);
|
||||
+ if(c->tags != SCRATCHPAD_MASK_1 && c->tags != SCRATCHPAD_MASK_2 && c->tags != SCRATCHPAD_MASK_3) {
|
||||
c->tags = c->tags & TAGMASK ? c->tags & TAGMASK : c->mon->tagset[c->mon->seltags];
|
||||
+ }
|
||||
}
|
||||
|
||||
int
|
||||
@@ -1412,6 +1427,124 @@ scan(void)
|
||||
}
|
||||
}
|
||||
|
||||
+static void scratchpad_hide(const Arg *arg) {
|
||||
+ if(scratchpad_hide_flag < 4) {
|
||||
+ if(arg->i == 1) {
|
||||
+ if(selmon->sel) {
|
||||
+ selmon->sel->tags = SCRATCHPAD_MASK_1;
|
||||
+ selmon->sel->isfloating = 1;
|
||||
+ focus(NULL);
|
||||
+ arrange(selmon);
|
||||
+ scratchpad_hide_flag++;
|
||||
+ }
|
||||
+ }
|
||||
+ else if(arg->i == 2) {
|
||||
+ if(selmon->sel) {
|
||||
+ selmon->sel->tags = SCRATCHPAD_MASK_2;
|
||||
+ selmon->sel->isfloating = 1;
|
||||
+ focus(NULL);
|
||||
+ arrange(selmon);
|
||||
+ scratchpad_hide_flag++;
|
||||
+ }
|
||||
+ }
|
||||
+ else if(arg->i == 3) {
|
||||
+ if(selmon->sel) {
|
||||
+ selmon->sel->tags = SCRATCHPAD_MASK_3;
|
||||
+ selmon->sel->isfloating = 1;
|
||||
+ focus(NULL);
|
||||
+ arrange(selmon);
|
||||
+ scratchpad_hide_flag++;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+static void scratchpad_remove() {
|
||||
+ if(selmon->sel && (scratchpad_last_showed_1 != NULL || scratchpad_last_showed_2 != NULL ||scratchpad_last_showed_3 != NULL) && (selmon->sel == scratchpad_last_showed_1 || selmon->sel == scratchpad_last_showed_2 || selmon->sel == scratchpad_last_showed_3)) {
|
||||
+ if(scratchpad_last_showed_1 == selmon->sel) {
|
||||
+ scratchpad_last_showed_1 = NULL;
|
||||
+ scratchpad_hide_flag--;
|
||||
+ }
|
||||
+ else if(scratchpad_last_showed_2 == selmon->sel) {
|
||||
+ scratchpad_last_showed_2 = NULL;
|
||||
+ scratchpad_hide_flag--;
|
||||
+ }
|
||||
+ else if(scratchpad_last_showed_3 == selmon->sel) {
|
||||
+ scratchpad_last_showed_3 = NULL;
|
||||
+ scratchpad_hide_flag--;
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+static void scratchpad_show(const Arg *arg) {
|
||||
+ if(arg->i == 1) {
|
||||
+ if(scratchpad_last_showed_1 == NULL) {
|
||||
+ scratchpad_show_first(arg->i);
|
||||
+ }
|
||||
+ else {
|
||||
+ if(scratchpad_last_showed_1->tags != SCRATCHPAD_MASK_1) {
|
||||
+ scratchpad_last_showed_1->tags = SCRATCHPAD_MASK_1;
|
||||
+ focus(NULL);
|
||||
+ arrange(selmon);
|
||||
+ }
|
||||
+ else {
|
||||
+ scratchpad_show_first(arg->i);
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ else if(arg->i == 2) {
|
||||
+ if(scratchpad_last_showed_2 == NULL) {
|
||||
+ scratchpad_show_first(arg->i);
|
||||
+ }
|
||||
+ else {
|
||||
+ if(scratchpad_last_showed_2->tags != SCRATCHPAD_MASK_2) {
|
||||
+ scratchpad_last_showed_2->tags = SCRATCHPAD_MASK_2;
|
||||
+ focus(NULL);
|
||||
+ arrange(selmon);
|
||||
+ }
|
||||
+ else {
|
||||
+ scratchpad_show_first(arg->i);
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ else if(arg->i == 3) {
|
||||
+ if(scratchpad_last_showed_3 == NULL) {
|
||||
+ scratchpad_show_first(arg->i);
|
||||
+ }
|
||||
+ else {
|
||||
+ if(scratchpad_last_showed_3->tags != SCRATCHPAD_MASK_3) {
|
||||
+ scratchpad_last_showed_3->tags = SCRATCHPAD_MASK_3;
|
||||
+ focus(NULL);
|
||||
+ arrange(selmon);
|
||||
+ }
|
||||
+ else {
|
||||
+ scratchpad_show_first(arg->i);
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+static void scratchpad_show_client(Client *c) {
|
||||
+ c->tags = selmon->tagset[selmon->seltags];
|
||||
+ focus(c);
|
||||
+ arrange(selmon);
|
||||
+}
|
||||
+
|
||||
+static void scratchpad_show_first(int scratchNum) {
|
||||
+ for(Client *c = selmon->clients; c !=NULL; c = c->next) {
|
||||
+ if(c->tags == SCRATCHPAD_MASK_1 && scratchNum == 1) {
|
||||
+ scratchpad_last_showed_1 = c;
|
||||
+ scratchpad_show_client(c);
|
||||
+ } else if(c->tags == SCRATCHPAD_MASK_2 && scratchNum == 2) {
|
||||
+ scratchpad_last_showed_2 = c;
|
||||
+ scratchpad_show_client(c);
|
||||
+ } else if(c->tags == SCRATCHPAD_MASK_3 && scratchNum == 3) {
|
||||
+ scratchpad_last_showed_3 = c;
|
||||
+ scratchpad_show_client(c);
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
void
|
||||
sendmon(Client *c, Monitor *m)
|
||||
{
|
||||
@@ -1785,6 +1918,16 @@ unmanage(Client *c, int destroyed)
|
||||
XSetErrorHandler(xerror);
|
||||
XUngrabServer(dpy);
|
||||
}
|
||||
+ if(scratchpad_last_showed_1 == c) {
|
||||
+ scratchpad_last_showed_1 = NULL;
|
||||
+ }
|
||||
+ if(scratchpad_last_showed_2 == c) {
|
||||
+ scratchpad_last_showed_2 = NULL;
|
||||
+ }
|
||||
+ if(scratchpad_last_showed_3 == c) {
|
||||
+ scratchpad_last_showed_3 = NULL;
|
||||
+ }
|
||||
+
|
||||
free(c);
|
||||
focus(NULL);
|
||||
updateclientlist();
|
105
hosts/vali/mars/dwm/dwm-6.5/dwm-scratchpad-20240321-061e9fe.diff
Normal file
105
hosts/vali/mars/dwm/dwm-6.5/dwm-scratchpad-20240321-061e9fe.diff
Normal file
|
@ -0,0 +1,105 @@
|
|||
From b9f3c11c3150f0b5d5b297a4eeeb2012764c98f5 Mon Sep 17 00:00:00 2001
|
||||
From: visil <workregor@mail.ru>
|
||||
Date: Thu, 21 Mar 2024 15:16:39 +0300
|
||||
Subject: [PATCH] Patch updated to 6.5
|
||||
|
||||
---
|
||||
config.def.h | 3 +++
|
||||
dwm.c | 34 ++++++++++++++++++++++++++++++++++
|
||||
2 files changed, 37 insertions(+)
|
||||
|
||||
diff --git a/config.def.h b/config.def.h
|
||||
index 9efa774..0b8b310 100644
|
||||
--- a/config.def.h
|
||||
+++ b/config.def.h
|
||||
@@ -59,11 +59,14 @@ static const Layout layouts[] = {
|
||||
static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
|
||||
static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4, NULL };
|
||||
static const char *termcmd[] = { "st", NULL };
|
||||
+static const char scratchpadname[] = "scratchpad";
|
||||
+static const char *scratchpadcmd[] = { "st", "-t", scratchpadname, "-g", "120x34", NULL };
|
||||
|
||||
static const Key keys[] = {
|
||||
/* modifier key function argument */
|
||||
{ MODKEY, XK_p, spawn, {.v = dmenucmd } },
|
||||
{ MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } },
|
||||
+ { MODKEY, XK_grave, togglescratch, {.v = scratchpadcmd } },
|
||||
{ MODKEY, XK_b, togglebar, {0} },
|
||||
{ MODKEY, XK_j, focusstack, {.i = +1 } },
|
||||
{ MODKEY, XK_k, focusstack, {.i = -1 } },
|
||||
diff --git a/dwm.c b/dwm.c
|
||||
index f1d86b2..a8db21a 100644
|
||||
--- a/dwm.c
|
||||
+++ b/dwm.c
|
||||
@@ -211,6 +211,7 @@ static void tagmon(const Arg *arg);
|
||||
static void tile(Monitor *m);
|
||||
static void togglebar(const Arg *arg);
|
||||
static void togglefloating(const Arg *arg);
|
||||
+static void togglescratch(const Arg *arg);
|
||||
static void toggletag(const Arg *arg);
|
||||
static void toggleview(const Arg *arg);
|
||||
static void unfocus(Client *c, int setfocus);
|
||||
@@ -271,6 +272,8 @@ static Window root, wmcheckwin;
|
||||
/* configuration, allows nested code to access above variables */
|
||||
#include "config.h"
|
||||
|
||||
+static unsigned int scratchtag = 1 << LENGTH(tags);
|
||||
+
|
||||
/* compile-time check if all tags fit into an unsigned int bit array. */
|
||||
struct NumTags { char limitexceeded[LENGTH(tags) > 31 ? -1 : 1]; };
|
||||
|
||||
@@ -1061,6 +1064,14 @@ manage(Window w, XWindowAttributes *wa)
|
||||
c->y = MAX(c->y, c->mon->wy);
|
||||
c->bw = borderpx;
|
||||
|
||||
+ selmon->tagset[selmon->seltags] &= ~scratchtag;
|
||||
+ if (!strcmp(c->name, scratchpadname)) {
|
||||
+ c->mon->tagset[c->mon->seltags] |= c->tags = scratchtag;
|
||||
+ c->isfloating = True;
|
||||
+ c->x = c->mon->wx + (c->mon->ww / 2 - WIDTH(c) / 2);
|
||||
+ c->y = c->mon->wy + (c->mon->wh / 2 - HEIGHT(c) / 2);
|
||||
+ }
|
||||
+
|
||||
wc.border_width = c->bw;
|
||||
XConfigureWindow(dpy, w, CWBorderWidth, &wc);
|
||||
XSetWindowBorder(dpy, w, scheme[SchemeNorm][ColBorder].pixel);
|
||||
@@ -1651,6 +1662,7 @@ spawn(const Arg *arg)
|
||||
|
||||
if (arg->v == dmenucmd)
|
||||
dmenumon[0] = '0' + selmon->num;
|
||||
+ selmon->tagset[selmon->seltags] &= ~scratchtag;
|
||||
if (fork() == 0) {
|
||||
if (dpy)
|
||||
close(ConnectionNumber(dpy));
|
||||
@@ -1735,6 +1747,28 @@ togglefloating(const Arg *arg)
|
||||
arrange(selmon);
|
||||
}
|
||||
|
||||
+void
|
||||
+togglescratch(const Arg *arg)
|
||||
+{
|
||||
+ Client *c;
|
||||
+ unsigned int found = 0;
|
||||
+
|
||||
+ for (c = selmon->clients; c && !(found = c->tags & scratchtag); c = c->next);
|
||||
+ if (found) {
|
||||
+ unsigned int newtagset = selmon->tagset[selmon->seltags] ^ scratchtag;
|
||||
+ if (newtagset) {
|
||||
+ selmon->tagset[selmon->seltags] = newtagset;
|
||||
+ focus(NULL);
|
||||
+ arrange(selmon);
|
||||
+ }
|
||||
+ if (ISVISIBLE(c)) {
|
||||
+ focus(c);
|
||||
+ restack(selmon);
|
||||
+ }
|
||||
+ } else
|
||||
+ spawn(arg);
|
||||
+}
|
||||
+
|
||||
void
|
||||
toggletag(const Arg *arg)
|
||||
{
|
||||
--
|
||||
2.44.0
|
||||
|
|
@ -195,6 +195,11 @@ static void resizemouse(const Arg *arg);
|
|||
static void restack(Monitor *m);
|
||||
static void run(void);
|
||||
static void scan(void);
|
||||
static void scratchpad_hide();
|
||||
static void scratchpad_remove();
|
||||
static void scratchpad_show();
|
||||
static void scratchpad_show_client(Client *c);
|
||||
static void scratchpad_show_first(int scratchNum);
|
||||
static int sendevent(Client *c, Atom proto);
|
||||
static void sendmon(Client *c, Monitor *m);
|
||||
static void setclientstate(Client *c, long state);
|
||||
|
@ -269,11 +274,20 @@ static Drw *drw;
|
|||
static Monitor *mons, *selmon;
|
||||
static Window root, wmcheckwin;
|
||||
|
||||
/* scratchpad */
|
||||
#define SCRATCHPAD_MASK_1 (1u << sizeof tags / sizeof * tags)
|
||||
#define SCRATCHPAD_MASK_2 (1u << (sizeof tags / sizeof * tags + 1))
|
||||
#define SCRATCHPAD_MASK_3 (1u << (sizeof tags / sizeof * tags + 2))
|
||||
static int scratchpad_hide_flag = 0;
|
||||
static Client *scratchpad_last_showed_1 = NULL;
|
||||
static Client *scratchpad_last_showed_2 = NULL;
|
||||
static Client *scratchpad_last_showed_3 = NULL;
|
||||
|
||||
/* configuration, allows nested code to access above variables */
|
||||
#include "config.h"
|
||||
|
||||
/* compile-time check if all tags fit into an unsigned int bit array. */
|
||||
struct NumTags { char limitexceeded[LENGTH(tags) > 31 ? -1 : 1]; };
|
||||
struct NumTags { char limitexceeded[LENGTH(tags) > 28 ? -1 : 1]; };
|
||||
|
||||
/* function implementations */
|
||||
void
|
||||
|
@ -309,7 +323,9 @@ applyrules(Client *c)
|
|||
XFree(ch.res_class);
|
||||
if (ch.res_name)
|
||||
XFree(ch.res_name);
|
||||
if(c->tags != SCRATCHPAD_MASK_1 && c->tags != SCRATCHPAD_MASK_2 && c->tags != SCRATCHPAD_MASK_3) {
|
||||
c->tags = c->tags & TAGMASK ? c->tags & TAGMASK : c->mon->tagset[c->mon->seltags];
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
|
@ -1062,13 +1078,15 @@ manage(Window w, XWindowAttributes *wa)
|
|||
c->y = MAX(c->y, c->mon->wy);
|
||||
c->bw = borderpx;
|
||||
|
||||
wc.border_width = c->bw;
|
||||
wc.border_width = c->bw;
|
||||
XConfigureWindow(dpy, w, CWBorderWidth, &wc);
|
||||
XSetWindowBorder(dpy, w, scheme[SchemeNorm][ColBorder].pixel);
|
||||
configure(c); /* propagates border_width, if size doesn't change */
|
||||
updatewindowtype(c);
|
||||
updatesizehints(c);
|
||||
updatewmhints(c);
|
||||
c->x = c->mon->mx + (c->mon->mw - WIDTH(c)) / 2;
|
||||
c->y = c->mon->my + (c->mon->mh - HEIGHT(c)) / 2;
|
||||
XSelectInput(dpy, w, EnterWindowMask|FocusChangeMask|PropertyChangeMask|StructureNotifyMask);
|
||||
grabbuttons(c, 0);
|
||||
if (!c->isfloating)
|
||||
|
@ -1418,6 +1436,124 @@ scan(void)
|
|||
}
|
||||
}
|
||||
|
||||
static void scratchpad_hide(const Arg *arg) {
|
||||
if(scratchpad_hide_flag < 4) {
|
||||
if(arg->i == 1) {
|
||||
if(selmon->sel) {
|
||||
selmon->sel->tags = SCRATCHPAD_MASK_1;
|
||||
selmon->sel->isfloating = 1;
|
||||
focus(NULL);
|
||||
arrange(selmon);
|
||||
scratchpad_hide_flag++;
|
||||
}
|
||||
}
|
||||
else if(arg->i == 2) {
|
||||
if(selmon->sel) {
|
||||
selmon->sel->tags = SCRATCHPAD_MASK_2;
|
||||
selmon->sel->isfloating = 1;
|
||||
focus(NULL);
|
||||
arrange(selmon);
|
||||
scratchpad_hide_flag++;
|
||||
}
|
||||
}
|
||||
else if(arg->i == 3) {
|
||||
if(selmon->sel) {
|
||||
selmon->sel->tags = SCRATCHPAD_MASK_3;
|
||||
selmon->sel->isfloating = 1;
|
||||
focus(NULL);
|
||||
arrange(selmon);
|
||||
scratchpad_hide_flag++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void scratchpad_remove() {
|
||||
if(selmon->sel && (scratchpad_last_showed_1 != NULL || scratchpad_last_showed_2 != NULL ||scratchpad_last_showed_3 != NULL) && (selmon->sel == scratchpad_last_showed_1 || selmon->sel == scratchpad_last_showed_2 || selmon->sel == scratchpad_last_showed_3)) {
|
||||
if(scratchpad_last_showed_1 == selmon->sel) {
|
||||
scratchpad_last_showed_1 = NULL;
|
||||
scratchpad_hide_flag--;
|
||||
}
|
||||
else if(scratchpad_last_showed_2 == selmon->sel) {
|
||||
scratchpad_last_showed_2 = NULL;
|
||||
scratchpad_hide_flag--;
|
||||
}
|
||||
else if(scratchpad_last_showed_3 == selmon->sel) {
|
||||
scratchpad_last_showed_3 = NULL;
|
||||
scratchpad_hide_flag--;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void scratchpad_show(const Arg *arg) {
|
||||
if(arg->i == 1) {
|
||||
if(scratchpad_last_showed_1 == NULL) {
|
||||
scratchpad_show_first(arg->i);
|
||||
}
|
||||
else {
|
||||
if(scratchpad_last_showed_1->tags != SCRATCHPAD_MASK_1) {
|
||||
scratchpad_last_showed_1->tags = SCRATCHPAD_MASK_1;
|
||||
focus(NULL);
|
||||
arrange(selmon);
|
||||
}
|
||||
else {
|
||||
scratchpad_show_first(arg->i);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(arg->i == 2) {
|
||||
if(scratchpad_last_showed_2 == NULL) {
|
||||
scratchpad_show_first(arg->i);
|
||||
}
|
||||
else {
|
||||
if(scratchpad_last_showed_2->tags != SCRATCHPAD_MASK_2) {
|
||||
scratchpad_last_showed_2->tags = SCRATCHPAD_MASK_2;
|
||||
focus(NULL);
|
||||
arrange(selmon);
|
||||
}
|
||||
else {
|
||||
scratchpad_show_first(arg->i);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(arg->i == 3) {
|
||||
if(scratchpad_last_showed_3 == NULL) {
|
||||
scratchpad_show_first(arg->i);
|
||||
}
|
||||
else {
|
||||
if(scratchpad_last_showed_3->tags != SCRATCHPAD_MASK_3) {
|
||||
scratchpad_last_showed_3->tags = SCRATCHPAD_MASK_3;
|
||||
focus(NULL);
|
||||
arrange(selmon);
|
||||
}
|
||||
else {
|
||||
scratchpad_show_first(arg->i);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void scratchpad_show_client(Client *c) {
|
||||
c->tags = selmon->tagset[selmon->seltags];
|
||||
focus(c);
|
||||
arrange(selmon);
|
||||
}
|
||||
|
||||
static void scratchpad_show_first(int scratchNum) {
|
||||
for(Client *c = selmon->clients; c !=NULL; c = c->next) {
|
||||
if(c->tags == SCRATCHPAD_MASK_1 && scratchNum == 1) {
|
||||
scratchpad_last_showed_1 = c;
|
||||
scratchpad_show_client(c);
|
||||
} else if(c->tags == SCRATCHPAD_MASK_2 && scratchNum == 2) {
|
||||
scratchpad_last_showed_2 = c;
|
||||
scratchpad_show_client(c);
|
||||
} else if(c->tags == SCRATCHPAD_MASK_3 && scratchNum == 3) {
|
||||
scratchpad_last_showed_3 = c;
|
||||
scratchpad_show_client(c);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
sendmon(Client *c, Monitor *m)
|
||||
{
|
||||
|
@ -1803,6 +1939,16 @@ unmanage(Client *c, int destroyed)
|
|||
XSetErrorHandler(xerror);
|
||||
XUngrabServer(dpy);
|
||||
}
|
||||
if(scratchpad_last_showed_1 == c) {
|
||||
scratchpad_last_showed_1 = NULL;
|
||||
}
|
||||
if(scratchpad_last_showed_2 == c) {
|
||||
scratchpad_last_showed_2 = NULL;
|
||||
}
|
||||
if(scratchpad_last_showed_3 == c) {
|
||||
scratchpad_last_showed_3 = NULL;
|
||||
}
|
||||
|
||||
free(c);
|
||||
focus(NULL);
|
||||
updateclientlist();
|
||||
|
|
2207
hosts/vali/mars/dwm/dwm-6.5/dwm.c.orig
Normal file
2207
hosts/vali/mars/dwm/dwm-6.5/dwm.c.orig
Normal file
File diff suppressed because it is too large
Load diff
23
hosts/vali/mars/dwm/dwm-6.5/dwm.c.rej
Normal file
23
hosts/vali/mars/dwm/dwm-6.5/dwm.c.rej
Normal file
|
@ -0,0 +1,23 @@
|
|||
--- dwm.c
|
||||
+++ dwm.c
|
||||
@@ -274,11 +279,19 @@ static Drw *drw;
|
||||
static Monitor *mons, *selmon;
|
||||
static Window root, wmcheckwin;
|
||||
|
||||
+/* scratchpad */
|
||||
+#define SCRATCHPAD_MASK_1 (1u << sizeof tags / sizeof * tags)
|
||||
+#define SCRATCHPAD_MASK_2 (1u << (sizeof tags / sizeof * tags + 1))
|
||||
+#define SCRATCHPAD_MASK_3 (1u << (sizeof tags / sizeof * tags + 2))
|
||||
+static int scratchpad_hide_flag = 0;
|
||||
+static Client *scratchpad_last_showed_1 = NULL;
|
||||
+static Client *scratchpad_last_showed_2 = NULL;
|
||||
+static Client *scratchpad_last_showed_3 = NULL;
|
||||
/* configuration, allows nested code to access above variables */
|
||||
#include "config.h"
|
||||
|
||||
/* compile-time check if all tags fit into an unsigned int bit array. */
|
||||
-struct NumTags { char limitexceeded[LENGTH(tags) > 31 ? -1 : 1]; };
|
||||
+struct NumTags { char limitexceeded[LENGTH(tags) > 28 ? -1 : 1]; };
|
||||
|
||||
/* function implementations */
|
||||
void
|
Binary file not shown.
|
@ -6,9 +6,11 @@ in {
|
|||
options.modules.programs.dwm.enable = mkEnableOption "dwm";
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
services.xserver = {
|
||||
services.xserver = {
|
||||
enable = true;
|
||||
xkb.layout = "de";
|
||||
layout = "de, de";
|
||||
xkbVariant = ",neo ";
|
||||
xkbOptions = "grp:alt_space_toggle";
|
||||
windowManager.dwm = {
|
||||
enable = true;
|
||||
};
|
||||
|
@ -24,12 +26,7 @@ in {
|
|||
})
|
||||
];
|
||||
environment.systemPackages = with pkgs; [
|
||||
(st.overrideAttrs (oldAttrs: rec { src = ./st-0.9.2; }))
|
||||
(dmenu.overrideAttrs (oldAttrs: rec { src = ./dmenu-5.3; }))
|
||||
# (dmenu.overrideAttrs (oldAttrs: rec { src = ./dmenu-5.3; }))
|
||||
];
|
||||
home-manager.users.${username} = {
|
||||
programs.eww.enable = true;
|
||||
programs.eww.configDir=./eww;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -36,7 +36,6 @@ in {
|
|||
httpie
|
||||
imagemagick
|
||||
keepassxc
|
||||
kitty
|
||||
krita
|
||||
lazygit
|
||||
libreoffice-fresh
|
||||
|
@ -48,6 +47,7 @@ in {
|
|||
neovim
|
||||
networkmanagerapplet
|
||||
nextcloud-client
|
||||
nheko
|
||||
pamixer
|
||||
pavucontrol
|
||||
pcmanfm
|
||||
|
@ -65,7 +65,6 @@ in {
|
|||
signal-desktop-beta
|
||||
smartmontools
|
||||
spotube
|
||||
st
|
||||
steam
|
||||
strawberry
|
||||
telegram-desktop
|
||||
|
@ -78,6 +77,7 @@ in {
|
|||
ventoy-full
|
||||
vesktop
|
||||
vlc
|
||||
weechat
|
||||
wget
|
||||
xclip
|
||||
xfce.thunar
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue