fixed fonts, added newsboat

This commit is contained in:
Charlie Root 2024-04-23 10:59:57 +02:00
commit 11ab11d59e
23 changed files with 2892 additions and 37 deletions

View file

@ -1,4 +1,4 @@
{ config, inputs, pkgs, ... }: { config, inputs, pkgs, lib, ... }:
{ {
nixpkgs.config.allowUnfree = true; nixpkgs.config.allowUnfree = true;
# Time Zone # Time Zone
@ -23,7 +23,6 @@
security.sudo.package = pkgs.sudo.override { withInsults = true; }; security.sudo.package = pkgs.sudo.override { withInsults = true; };
security.polkit.enable = true; security.polkit.enable = true;
programs.kdeconnect.enable = true; programs.kdeconnect.enable = true;
services.picom.enable = true;
services.mpd = { services.mpd = {
enable = true; enable = true;
musicDirectory = "/home/vali/Nextcloud/Media/Music/"; 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 = { modules = {
other = { other = {
system = { system = {
@ -49,10 +54,10 @@
}; };
programs = { programs = {
vesktop.enable = true; vesktop.enable = true;
ncmpcpp.enable = true;
ssh.enable = true; ssh.enable = true;
btop.enable = true; btop.enable = true;
mpv.enable = true; mpv.enable = true;
kitty.enable = true;
dwm.enable = true; dwm.enable = true;
schizofox.enable = true; schizofox.enable = true;
#git = { #git = {
@ -66,13 +71,6 @@
enable = true; enable = true;
profiling = false; profiling = false;
}; };
alacritty = {
enable = true;
catppuccin = true;
opacity = 0.8;
blur = true;
# Grüsse
};
}; };
services = { services = {
pipewire.enable = true; pipewire.enable = true;
@ -106,3 +104,4 @@
}; };
system.stateVersion = "23.11"; system.stateVersion = "23.11";
} }

View file

@ -4,7 +4,7 @@
static int topbar = 1; /* -b option; if 0, dmenu appears at bottom */ static int topbar = 1; /* -b option; if 0, dmenu appears at bottom */
/* -fn option overrides fonts[0]; default X11 font or font set */ /* -fn option overrides fonts[0]; default X11 font or font set */
static const char *fonts[] = { 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 *prompt = NULL; /* -p option; prompt to the left of input field */
static const char *colors[SchemeLast][2] = { static const char *colors[SchemeLast][2] = {

Binary file not shown.

View file

@ -95,6 +95,13 @@ static const Key keys[] = {
TAGKEYS( XK_8, 7) TAGKEYS( XK_8, 7)
TAGKEYS( XK_9, 8) TAGKEYS( XK_9, 8)
{ MODKEY|ShiftMask, XK_q, quit, {0} }, { 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 */ /* button definitions */

View file

@ -1,21 +1,22 @@
/* See LICENSE file for copyright and license details. */
/* appearance */ /* 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 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 int topbar = 1; /* 0 means bottom bar */
static const char *fonts[] = { "monospace:size=10" }; static const char *fonts[] = { "monospace:size=10" };
static const char dmenufont[] = "monospace:size=10"; static const char dmenufont[] = "monospace:size=10";
static const char col_gray1[] = "#222222"; static const char col_gray1[] = "#282828";
static const char col_gray2[] = "#444444"; static const char col_gray2[] = "#98971a";
static const char col_gray3[] = "#bbbbbb"; static const char col_gray3[] = "#bbbbbb";
static const char col_gray4[] = "#eeeeee"; static const char col_gray4[] = "#928374";
static const char col_cyan[] = "#005577"; static const char col_cyan[] = "#BD93BD";
static const char col_sel[] = "#d79921";
static const char *colors[][3] = { static const char *colors[][3] = {
/* fg bg border */ /* fg bg border */
[SchemeNorm] = { col_gray3, col_gray1, col_gray2 }, [SchemeNorm] = { col_gray2, col_gray1, col_gray4 },
[SchemeSel] = { col_gray4, col_cyan, col_cyan }, [SchemeSel] = { col_gray2, col_gray1, col_sel },
}; };
/* tagging */ /* tagging */
@ -57,14 +58,18 @@ static const Layout layouts[] = {
/* commands */ /* commands */
static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */ 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 *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[] = { static const Key keys[] = {
/* modifier key function argument */ /* modifier key function argument */
{ MODKEY, XK_d, spawn, {.v = dmenucmd } }, { MODKEY, XK_d, spawn, {.v = dmenucmd } },
{ MODKEY, XK_Return, spawn, {.v = termcmd } }, { 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_j, focusstack, {.i = +1 } },
{ MODKEY, XK_k, focusstack, {.i = -1 } }, { MODKEY, XK_k, focusstack, {.i = -1 } },
{ MODKEY, XK_i, incnmaster, {.i = +1 } }, { MODKEY, XK_i, incnmaster, {.i = +1 } },
@ -85,6 +90,13 @@ static const Key keys[] = {
{ MODKEY, XK_space, togglefullscr, {0} }, { MODKEY, XK_space, togglefullscr, {0} },
{ MODKEY, XK_0, view, {.ui = ~0 } }, { MODKEY, XK_0, view, {.ui = ~0 } },
{ MODKEY|ShiftMask, XK_0, tag, {.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_1, 0)
TAGKEYS( XK_2, 1) TAGKEYS( XK_2, 1)
TAGKEYS( XK_3, 2) TAGKEYS( XK_3, 2)

Binary file not shown.

View file

@ -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();

View 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

View file

@ -195,6 +195,11 @@ static void resizemouse(const Arg *arg);
static void restack(Monitor *m); static void restack(Monitor *m);
static void run(void); static void run(void);
static void scan(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 int sendevent(Client *c, Atom proto);
static void sendmon(Client *c, Monitor *m); static void sendmon(Client *c, Monitor *m);
static void setclientstate(Client *c, long state); static void setclientstate(Client *c, long state);
@ -269,11 +274,20 @@ static Drw *drw;
static Monitor *mons, *selmon; static Monitor *mons, *selmon;
static Window root, wmcheckwin; 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 */ /* configuration, allows nested code to access above variables */
#include "config.h" #include "config.h"
/* compile-time check if all tags fit into an unsigned int bit array. */ /* 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 */ /* function implementations */
void void
@ -309,7 +323,9 @@ applyrules(Client *c)
XFree(ch.res_class); XFree(ch.res_class);
if (ch.res_name) if (ch.res_name)
XFree(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]; c->tags = c->tags & TAGMASK ? c->tags & TAGMASK : c->mon->tagset[c->mon->seltags];
}
} }
int int
@ -1069,6 +1085,8 @@ manage(Window w, XWindowAttributes *wa)
updatewindowtype(c); updatewindowtype(c);
updatesizehints(c); updatesizehints(c);
updatewmhints(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); XSelectInput(dpy, w, EnterWindowMask|FocusChangeMask|PropertyChangeMask|StructureNotifyMask);
grabbuttons(c, 0); grabbuttons(c, 0);
if (!c->isfloating) 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 void
sendmon(Client *c, Monitor *m) sendmon(Client *c, Monitor *m)
{ {
@ -1803,6 +1939,16 @@ unmanage(Client *c, int destroyed)
XSetErrorHandler(xerror); XSetErrorHandler(xerror);
XUngrabServer(dpy); 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); free(c);
focus(NULL); focus(NULL);
updateclientlist(); updateclientlist();

File diff suppressed because it is too large Load diff

View 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.

View file

@ -8,7 +8,9 @@ in {
config = mkIf cfg.enable { config = mkIf cfg.enable {
services.xserver = { services.xserver = {
enable = true; enable = true;
xkb.layout = "de"; layout = "de, de";
xkbVariant = ",neo ";
xkbOptions = "grp:alt_space_toggle";
windowManager.dwm = { windowManager.dwm = {
enable = true; enable = true;
}; };
@ -24,12 +26,7 @@ in {
}) })
]; ];
environment.systemPackages = with pkgs; [ 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;
};
}; };
} }

View file

@ -36,7 +36,6 @@ in {
httpie httpie
imagemagick imagemagick
keepassxc keepassxc
kitty
krita krita
lazygit lazygit
libreoffice-fresh libreoffice-fresh
@ -48,6 +47,7 @@ in {
neovim neovim
networkmanagerapplet networkmanagerapplet
nextcloud-client nextcloud-client
nheko
pamixer pamixer
pavucontrol pavucontrol
pcmanfm pcmanfm
@ -65,7 +65,6 @@ in {
signal-desktop-beta signal-desktop-beta
smartmontools smartmontools
spotube spotube
st
steam steam
strawberry strawberry
telegram-desktop telegram-desktop
@ -78,6 +77,7 @@ in {
ventoy-full ventoy-full
vesktop vesktop
vlc vlc
weechat
wget wget
xclip xclip
xfce.thunar xfce.thunar

View file

@ -11,6 +11,7 @@ _: {
./foot.nix ./foot.nix
./rofi.nix ./rofi.nix
./WM ./WM
./kitty.nix
./vivado.nix ./vivado.nix
./alacritty.nix ./alacritty.nix
./firefox.nix ./firefox.nix

78
modules/gui/kitty.nix Normal file
View file

@ -0,0 +1,78 @@
{ config, lib, pkgs, ... }:
with lib; let
cfg = config.modules.programs.kitty;
username = config.modules.other.system.username;
in {
options.modules.programs.kitty.enable = mkEnableOption "kitty";
config = mkIf cfg.enable {
home-manager.users.${username} = {
programs.kitty = {
enable = true;
settings = {
font_size = "13.0";
mouse_hide_wait = -1;
url_style = "curly";
open_url_with = "default";
background_opacity = "0.9";
confirm_os_window_close = "0";
font_family = "JetBrainsMono Nerd Font";
cursor_text_color = "background";
url_color = "#83a598";
visual_bell_color = "#8ec07c";
bell_border_color = "#8ec07c";
active_border_color = "#d3869b";
inactive_border_color = "#665c54";
foreground = "#ebdbb2";
background = "#282828";
selection_foreground = "#928374";
selection_background = "#ebdbb2";
active_tab_foreground = "#fbf1c7";
active_tab_background = "#665c54";
inactive_tab_foreground = "#a89984";
inactive_tab_background = "#3c3836";
# black (bg3/bg4)
color0 = "#665c54";
color8 = "#7c6f64";
# red
color1 = "#cc241d";
color9 = "#fb4934";
#: green
color2 = "#98971a";
color10 = "#b8bb26";
# yellow
color3 = "#d79921";
color11 = "#fabd2f";
# blue
color4 = "#458588";
color12 = "#83a598";
# purple
color5 = "#b16286";
color13 = "#d3869b";
# aqua
color6 = "#689d6a";
color14 = "#8ec07c";
# white (fg4/fg3)
color7 = "#a89984";
color15 = "#bdae93";
};
};
};
};
}

View file

@ -3,7 +3,7 @@ _: {
./btop.nix ./btop.nix
# ./helix.nix # ./helix.nix
./neovim.nix ./neovim.nix
# ./newsboat.nix ./newsboat.nix
./ncmpcpp.nix ./ncmpcpp.nix
./yazi.nix ./yazi.nix
]; ];

73
modules/tui/newsboat.nix Normal file
View file

@ -0,0 +1,73 @@
{
config,
lib,
...
}: with lib; let
cfg = config.modules.programs.newsboat;
username = config.modules.other.system.username;
in {
options.modules.programs.newsboat.enable = mkEnableOption "newsboat";
config = mkIf cfg.enable {
home-manager.users.${username} = {
programs.newsboat = {
enable = true;
autoReload = true;
extraConfig = ''
download-full-page yes
download-retries 3
error-log /dev/null
cookie-cache ~/.cache/newsboat/cookies.txt
bind-key j down
bind-key k up
bind-key G end
bind-key g home
bind-key d pagedown
bind-key u pageup
bind-key a toggle-article-read
color listnormal color15 default
color listnormal_unread color2 default
color listfocus_unread color2 color0
color listfocus default color0
color background default default
color article default default
color end-of-text-marker color8 default
color info color4 color8
color hint-separator default color8
color hint-description default color8
color title color14 color8
highlight article "^(Feed|Title|Author|Link|Date): .+" color4 default bold
highlight article "^(Feed|Title|Author|Link|Date):" color14 default bold
highlight article "\\((link|image|video)\\)" color8 default
highlight article "https?://[^ ]+" color4 default
highlight article "\[[0-9]+\]" color6 default bold
user-agent "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36"
'';
urls = [
{
title = "NixOS Weekly";
url = "https://weekly.nixos.org/feeds/all.rss.xml";
}
{
title = "Hacker News";
url = "https://hnrss.org/newest";
}
{
title = "Phoronix";
url = "https://www.phoronix.com/rss.php";
}
{
title = "LWN";
url = "https://lwn.net/headlines/rss";
}
{
title = "Hyprland Commit Feed";
url = "https://github.com/hyprwm/Hyprland/commits/main.atom";
}
];
};
};
};
}

View file

@ -3,7 +3,7 @@
fonts.packages = with pkgs; [ fonts.packages = with pkgs; [
material-design-icons material-design-icons
(nerdfonts.override { (nerdfonts.override {
fonts = [ "JetBrainsMono"]; # fonts = [ "JetBrains Mono"];
}) })
noto-fonts noto-fonts
noto-fonts-cjk-sans noto-fonts-cjk-sans