diff options
| author | Naz <ndpm13@ch-naseem.com> | 2025-10-15 16:38:07 +0100 |
|---|---|---|
| committer | Naz <ndpm13@ch-naseem.com> | 2025-10-15 16:44:00 +0100 |
| commit | df2e7925832b4ef1e853994b0ea952f54a3806b3 (patch) | |
| tree | 33c0624156060bd3fb6f433cc94d17751a24b90f | |
| parent | 9af4c2957939aa4b7864a04115c10262f9762a7d (diff) | |
✨feat: add my own customizations6.6-custom.1
| -rw-r--r-- | .gitignore | 3 | ||||
| -rw-r--r-- | README | 48 | ||||
| -rw-r--r-- | README.md | 5 | ||||
| -rw-r--r-- | config.def.h | 158 | ||||
| -rw-r--r-- | dwm.c | 2 |
5 files changed, 80 insertions, 136 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..dcba295 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +*.o +config.h +dwm @@ -1,48 +0,0 @@ -dwm - dynamic window manager -============================ -dwm is an extremely fast, small, and dynamic window manager for X. - - -Requirements ------------- -In order to build dwm you need the Xlib header files. - - -Installation ------------- -Edit config.mk to match your local setup (dwm is installed into -the /usr/local namespace by default). - -Afterwards enter the following command to build and install dwm (if -necessary as root): - - make clean install - - -Running dwm ------------ -Add the following line to your .xinitrc to start dwm using startx: - - exec dwm - -In order to connect dwm to a specific display, make sure that -the DISPLAY environment variable is set correctly, e.g.: - - DISPLAY=foo.bar:1 exec dwm - -(This will start dwm on display :1 of the host foo.bar.) - -In order to display status info in the bar, you can do something -like this in your .xinitrc: - - while xsetroot -name "`date` `uptime | sed 's/.*,//'`" - do - sleep 1 - done & - exec dwm - - -Configuration -------------- -The configuration of dwm is done by creating a custom config.h -and (re)compiling the source code. diff --git a/README.md b/README.md new file mode 100644 index 0000000..dfd9243 --- /dev/null +++ b/README.md @@ -0,0 +1,5 @@ +My build of [dwm](https://dwm.suckless.org/). Still working on the bar tho. + +## License + +This project is licensed under the same terms as Suckless's dwm. diff --git a/config.def.h b/config.def.h index 27d966c..9c5771c 100644 --- a/config.def.h +++ b/config.def.h @@ -1,79 +1,90 @@ /* See LICENSE file for copyright and license details. */ /* appearance */ -static const unsigned int borderpx = 1; /* border pixel of windows */ +static const unsigned int borderpx = 2; /* border pixel of windows */ static const unsigned int snap = 32; /* snap pixel */ -static const unsigned int gappih = 10; /* horiz inner gap between windows */ -static const unsigned int gappiv = 10; /* vert inner gap between windows */ +static const unsigned int gappih = 5; /* horiz inner gap between windows */ +static const unsigned int gappiv = 5; /* vert inner gap between windows */ static const unsigned int gappoh = 10; /* horiz outer gap between windows and screen edge */ static const unsigned int gappov = 10; /* vert outer gap between windows and screen edge */ static const int smartgaps = 0; /* 1 means no outer gap when there is only one window */ -static const int swallowfloating = 0; /* 1 means swallow floating windows by default */ +static const int swallowfloating = 1; /* 1 means swallow floating windows by default */ static const int showbar = 1; /* 0 means no bar */ static const int topbar = 1; /* 0 means bottom bar */ static const int splitstatus = 1; /* 1 for split status items */ -static const char *splitdelim = ";"; /* Character used for separating status */ -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_gray3[] = "#bbbbbb"; -static const char col_gray4[] = "#eeeeee"; -static const char col_cyan[] = "#005577"; +static const char *splitdelim = ";"; /* Character used for separating status */ +static const char *fonts[] = { "CaskaydiaCoveNerdFont:size=10:Bold" }; +static const char col_light[] = "#ebdbb2"; +static const char col_dark[] = "#282828"; +static const char col_accent[] = "#a89984"; static const char *colors[][3] = { - /* fg bg border */ - [SchemeNorm] = { col_gray3, col_gray1, col_gray2 }, - [SchemeSel] = { col_gray4, col_cyan, col_cyan }, + /* fg bg border */ + [SchemeNorm] = { col_light, col_dark, col_dark }, + [SchemeSel] = { col_dark, col_accent, col_accent }, }; typedef struct { const char *name; const void *cmd; } Sp; -const char *spcmd1[] = {"st", "-n", "spterm", "-g", "120x34", NULL }; -const char *spcmd2[] = {"st", "-n", "spfm", "-g", "144x41", "-e", "ranger", NULL }; -const char *spcmd3[] = {"keepassxc", NULL }; +const char *spcmd1[] = {"bash", "-c", "$HOME/.local/share/dwm/scratchpads/sp-ncmpcpp.sh", NULL }; +const char *spcmd2[] = {"bash", "-c", "$HOME/.local/share/dwm/scratchpads/sp-pulsemixer.sh", NULL }; +const char *spcmd3[] = {"bash", "-c", "$HOME/.local/share/dwm/scratchpads/sp-term.sh", NULL }; +const char *spcmd4[] = {"bash", "-c", "$HOME/.local/share/dwm/scratchpads/sp-lf.sh", NULL }; static Sp scratchpads[] = { - /* name cmd */ - {"spterm", spcmd1}, - {"spranger", spcmd2}, - {"keepassxc", spcmd3}, + /* name cmd */ + {"sp-ncmpcpp", spcmd1}, + {"sp-pulsemixer", spcmd2}, + {"sp-term", spcmd3}, + {"sp-lf", spcmd4}, }; /* tagging */ -static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" }; +static const char *tags[] = { "一", "二", "三", "四", "五", "六", "七", "八"}; static const Rule rules[] = { /* xprop(1): * WM_CLASS(STRING) = instance, class * WM_NAME(STRING) = title */ - /* class instance title tags mask isfloating isterminal noswallow monitor */ - { "Gimp", NULL, NULL, 0, 1, 0, 0, -1 }, - { "Firefox", NULL, NULL, 1 << 8, 0, 0, -1, -1 }, - { "St", NULL, NULL, 0, 0, 1, 0, -1 }, - { NULL, NULL, "Event Tester", 0, 0, 0, 1, -1 }, /* xev */ - { NULL, "spterm", NULL, SPTAG(0), 1, 0, 0, -1 }, - { NULL, "spfm", NULL, SPTAG(1), 1, 0, 0, -1 }, - { NULL, "keepassxc", NULL, SPTAG(2), 0, 0, 0, -1 }, + /* class instance title tags mask isfloating isterminal noswallow monitor */ + { "Brave-browser", NULL, NULL, 1 << 0, 0, 0, 0, -1 }, + { "Emacs", NULL, NULL, 1 << 1, 0, 0, 0, -1 }, + { "KeePassXC", NULL, NULL, 1 << 4, 0, 0, 0, -1 }, + { "tutanota-desktop", NULL, NULL, 1 << 4, 0, 0, 0, -1 }, + { "Ferdium", NULL, NULL, 1 << 5, 0, 0, 0, -1 }, + { "Thunar", NULL, NULL, 1 << 6, 0, 0, 0, -1 }, + { "Spotify", NULL, NULL, 1 << 7, 0, 0, 0, -1 }, + { "Virt-manager", NULL, NULL, 1 << 7, 0, 0, 0, -1 }, + { "mpv", NULL, NULL, 0, 1, 0, 0, -1 }, + { "Nsxiv", NULL, NULL, 0, 1, 0, 0, -1 }, + { "Nitrogen", NULL, NULL, 0, 1, 0, 0, -1 }, + { "Lxappearance", NULL, NULL, 0, 1, 0, 0, -1 }, + { "Arandr", NULL, NULL, 0, 1, 0, 0, -1 }, + { "Alacritty", NULL, NULL, 0, 0, 1, 0, -1 }, + { NULL, NULL, "Event Tester", 0, 0, 0, 1, -1 }, /* xev */ + { NULL, "sp-ncmpcpp", NULL, SPTAG(0), 1, 0, 0, -1 }, + { NULL, "sp-pulsemixer", NULL, SPTAG(1), 1, 0, 0, -1 }, + { NULL, "sp-term", NULL, SPTAG(2), 1, 1, 0, -1 }, + { NULL, "sp-lf", NULL, SPTAG(3), 1, 1, 0, -1 }, }; /* layout(s) */ -static const float mfact = 0.55; /* factor of master area size [0.05..0.95] */ -static const int nmaster = 1; /* number of clients in master area */ -static const int resizehints = 1; /* 1 means respect size hints in tiled resizals */ +static const float mfact = 0.55; /* factor of master area size [0.05..0.95] */ +static const int nmaster = 1; /* number of clients in master area */ +static const int resizehints = 0; /* 1 means respect size hints in tiled resizals */ static const int lockfullscreen = 1; /* 1 will force focus on the fullscreen window */ -static const int refreshrate = 120; /* refresh rate (per second) for client move/resize */ +static const int refreshrate = 120; /* refresh rate (per second) for client move/resize */ static const Layout layouts[] = { /* symbol arrange function */ { "[]=", tile }, /* first entry is default */ - { "><>", NULL }, /* no layout function means floating behavior */ { "[M]", monocle }, + { "><>", NULL }, /* no layout function means floating behavior */ }; /* key definitions */ -#define MODKEY Mod1Mask +#define MODKEY Mod4Mask #define TAGKEYS(KEY,TAG) \ { MODKEY, KEY, view, {.ui = 1 << TAG} }, \ { MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \ @@ -83,15 +94,8 @@ static const Layout layouts[] = { /* helper for spawning shell commands in the pre dwm-5.0 fashion */ #define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } } -/* 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 *termcmd[] = { "st", NULL }; - static const Key keys[] = { /* modifier key function argument */ - { MODKEY, XK_p, spawn, {.v = dmenucmd } }, - { MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } }, { MODKEY, XK_b, togglebar, {0} }, { MODKEY, XK_j, focusstack, {.i = +1 } }, { MODKEY, XK_k, focusstack, {.i = -1 } }, @@ -99,66 +103,48 @@ static const Key keys[] = { { MODKEY, XK_d, incnmaster, {.i = -1 } }, { MODKEY, XK_h, setmfact, {.f = -0.05} }, { MODKEY, XK_l, setmfact, {.f = +0.05} }, - { MODKEY|Mod4Mask, XK_h, incrgaps, {.i = +1 } }, - { MODKEY|Mod4Mask, XK_l, incrgaps, {.i = -1 } }, - { MODKEY|Mod4Mask|ShiftMask, XK_h, incrogaps, {.i = +1 } }, - { MODKEY|Mod4Mask|ShiftMask, XK_l, incrogaps, {.i = -1 } }, - { MODKEY|Mod4Mask|ControlMask, XK_h, incrigaps, {.i = +1 } }, - { MODKEY|Mod4Mask|ControlMask, XK_l, incrigaps, {.i = -1 } }, - { MODKEY|Mod4Mask, XK_0, togglegaps, {0} }, - { MODKEY|Mod4Mask|ShiftMask, XK_0, defaultgaps, {0} }, - { MODKEY, XK_y, incrihgaps, {.i = +1 } }, - { MODKEY, XK_o, incrihgaps, {.i = -1 } }, - { MODKEY|ControlMask, XK_y, incrivgaps, {.i = +1 } }, - { MODKEY|ControlMask, XK_o, incrivgaps, {.i = -1 } }, - { MODKEY|Mod4Mask, XK_y, incrohgaps, {.i = +1 } }, - { MODKEY|Mod4Mask, XK_o, incrohgaps, {.i = -1 } }, - { MODKEY|ShiftMask, XK_y, incrovgaps, {.i = +1 } }, - { MODKEY|ShiftMask, XK_o, incrovgaps, {.i = -1 } }, - { MODKEY, XK_Return, zoom, {0} }, + { MODKEY|ShiftMask, XK_j, pushdown, {0} }, + { MODKEY|ShiftMask, XK_k, pushup, {0} }, + { MODKEY|ShiftMask, XK_Return, zoom, {0} }, + { MODKEY|ShiftMask, XK_i, incrogaps, {.i = +1 } }, + { MODKEY|ShiftMask, XK_d, incrogaps, {.i = -1 } }, + { MODKEY|Mod4Mask, XK_g, togglegaps, {0} }, + { MODKEY|Mod4Mask|ShiftMask, XK_g, defaultgaps, {0} }, { MODKEY, XK_Tab, view, {0} }, - { MODKEY|ShiftMask, XK_c, killclient, {0} }, - { MODKEY, XK_t, setlayout, {.v = &layouts[0]} }, - { MODKEY, XK_f, setlayout, {.v = &layouts[1]} }, - { MODKEY, XK_m, setlayout, {.v = &layouts[2]} }, + { MODKEY, XK_q, killclient, {0} }, { MODKEY, XK_space, setlayout, {0} }, { MODKEY|ShiftMask, XK_space, togglefloating, {0} }, - { MODKEY|ShiftMask, XK_f, togglefullscr, {0} }, - { MODKEY, XK_0, view, {.ui = ~0 } }, - { MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } }, + { MODKEY, XK_f, togglefullscr, {0} }, { MODKEY, XK_comma, focusmon, {.i = -1 } }, { MODKEY, XK_period, focusmon, {.i = +1 } }, { MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } }, { MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } }, { MODKEY, XK_y, togglescratch, {.ui = 0 } }, { MODKEY, XK_u, togglescratch, {.ui = 1 } }, - { MODKEY, XK_x, togglescratch, {.ui = 2 } }, + { MODKEY, XK_t, togglescratch, {.ui = 2 } }, + { MODKEY, XK_r, togglescratch, {.ui = 3 } }, TAGKEYS( XK_1, 0) TAGKEYS( XK_2, 1) TAGKEYS( XK_3, 2) TAGKEYS( XK_4, 3) - TAGKEYS( XK_5, 4) - TAGKEYS( XK_6, 5) - TAGKEYS( XK_7, 6) - TAGKEYS( XK_8, 7) - TAGKEYS( XK_9, 8) - { MODKEY|ShiftMask, XK_q, quit, {0} }, + TAGKEYS( XK_7, 4) + TAGKEYS( XK_8, 5) + TAGKEYS( XK_9, 6) + TAGKEYS( XK_0, 7) }; /* button definitions */ /* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */ static const Button buttons[] = { /* click event mask button function argument */ - { ClkLtSymbol, 0, Button1, setlayout, {0} }, - { ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} }, - { ClkWinTitle, 0, Button2, zoom, {0} }, - { ClkStatusText, 0, Button2, spawn, {.v = termcmd } }, - { ClkClientWin, MODKEY, Button1, movemouse, {0} }, - { ClkClientWin, MODKEY, Button2, togglefloating, {0} }, - { ClkClientWin, MODKEY, Button1, resizemouse, {0} }, - { ClkTagBar, 0, Button1, view, {0} }, - { ClkTagBar, 0, Button3, toggleview, {0} }, - { ClkTagBar, MODKEY, Button1, tag, {0} }, - { ClkTagBar, MODKEY, Button3, toggletag, {0} }, + { ClkLtSymbol, 0, Button1, setlayout, {0} }, + { ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} }, + { ClkWinTitle, 0, Button2, zoom, {0} }, + { ClkClientWin, MODKEY, Button1, movemouse, {0} }, + { ClkClientWin, MODKEY, Button3, resizemouse, {0} }, + { ClkTagBar, 0, Button1, view, {0} }, + { ClkTagBar, 0, Button3, toggleview, {0} }, + { ClkTagBar, MODKEY, Button1, tag, {0} }, + { ClkTagBar, MODKEY, Button3, toggletag, {0} }, }; @@ -2023,8 +2023,6 @@ spawn(const Arg *arg) { struct sigaction sa; - if (arg->v == dmenucmd) - dmenumon[0] = '0' + selmon->num; if (fork() == 0) { if (dpy) close(ConnectionNumber(dpy)); |
