dotfiles

Dotfiles for my OpenBSD environment.
git clone https://git.mtkn.jp/dotfiles
Log | Files | Refs

commit 95fb926a4fbe88002a4e9a1856d505fb461e1090
parent d0958b15be7e94ddffca98414492b96a8ee61e06
Author: Matsuda Kenji <info@mtkn.jp>
Date:   Sat, 27 Jul 2024 09:00:48 +0900

delete unused items

Diffstat:
Dsuckless/dmenu/config.diff | 11-----------
Dsuckless/dmenu/dmenu-password-4.7.diff | 66------------------------------------------------------------------
Dsuckless/dwm/config.diff | 79-------------------------------------------------------------------------------
Dsuckless/st/config.diff | 17-----------------
Dsuckless/st/st-font2-20190416-ba72400.diff | 167-------------------------------------------------------------------------------
Dsuckless/st/st-w3m-0.8.3.diff | 42------------------------------------------
Dsuckless/surf/config.diff | 61-------------------------------------------------------------
Dsuckless/surf/surf-playexternal-20190724-b814567.diff | 54------------------------------------------------------
8 files changed, 0 insertions(+), 497 deletions(-)

diff --git a/suckless/dmenu/config.diff b/suckless/dmenu/config.diff @@ -1,11 +0,0 @@ ---- config.def.h Thu Nov 18 09:10:09 2021 -+++ config.h Thu Jun 16 10:57:09 2022 -@@ -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=10" -+ "monospace:size=7", - }; - static const char *prompt = NULL; /* -p option; prompt to the left of input field */ - static const char *colors[SchemeLast][2] = { diff --git a/suckless/dmenu/dmenu-password-4.7.diff b/suckless/dmenu/dmenu-password-4.7.diff @@ -1,66 +0,0 @@ -diff -wup a/dmenu.c b/dmenu.c ---- a/dmenu.c 2017-06-12 00:35:39.814716857 +0200 -+++ b/dmenu.c 2017-06-11 23:59:18.794768196 +0200 -@@ -36,7 +36,7 @@ struct item { - static char text[BUFSIZ] = ""; - static char *embed; - static int bh, mw, mh; --static int inputw = 0, promptw; -+static int inputw = 0, promptw, passwd = 0; - static int lrpad; /* sum of left and right padding */ - static size_t cursor; - static struct item *items = NULL; -@@ -131,6 +131,7 @@ drawmenu(void) - unsigned int curpos; - struct item *item; - int x = 0, y = 0, w; -+ char *censort; - - drw_setscheme(drw, scheme[SchemeNorm]); - drw_rect(drw, 0, 0, mw, mh, 1, 1); -@@ -142,7 +143,12 @@ drawmenu(void) - /* draw input field */ - w = (lines > 0 || !matches) ? mw - x : inputw; - drw_setscheme(drw, scheme[SchemeNorm]); -- drw_text(drw, x, 0, w, bh, lrpad / 2, text, 0); -+ if (passwd) { -+ censort = ecalloc(1, sizeof(text)); -+ memset(censort, '.', strlen(text)); -+ drw_text(drw, x, 0, w, bh, lrpad / 2, censort, 0); -+ free(censort); -+ } else drw_text(drw, x, 0, w, bh, lrpad / 2, text, 0); - - drw_font_getexts(drw->fonts, text, cursor, &curpos, NULL); - if ((curpos += lrpad / 2 - 1) < w) { -@@ -481,6 +487,11 @@ readstdin(void) - size_t i, imax = 0, size = 0; - unsigned int tmpmax = 0; - -+ if (passwd) { -+ inputw = lines = 0; -+ return; -+ } -+ - /* read each line from stdin and add it to the item list */ - for (i = 0; fgets(buf, sizeof buf, stdin); i++) { - if (i + 1 >= size / sizeof *items) -@@ -636,7 +647,7 @@ setup(void) - static void - usage(void) - { -- fputs("usage: dmenu [-bfiv] [-l lines] [-p prompt] [-fn font] [-m monitor]\n" -+ fputs("usage: dmenu [-bfiPv] [-l lines] [-p prompt] [-fn font] [-m monitor]\n" - " [-nb color] [-nf color] [-sb color] [-sf color] [-w windowid]\n", stderr); - exit(1); - } -@@ -659,7 +670,9 @@ main(int argc, char *argv[]) - else if (!strcmp(argv[i], "-i")) { /* case-insensitive item matching */ - fstrncmp = strncasecmp; - fstrstr = cistrstr; -- } else if (i + 1 == argc) -+ } else if (!strcmp(argv[i], "-P")) /* is the input a password */ -+ passwd = 1; -+ else if (i + 1 == argc) - usage(); - /* these options take one argument */ - else if (!strcmp(argv[i], "-l")) /* number of lines in vertical list */ diff --git a/suckless/dwm/config.diff b/suckless/dwm/config.diff @@ -1,79 +0,0 @@ ---- config.def.h Thu Nov 18 08:37:04 2021 -+++ config.h Tue Jun 14 08:36:53 2022 -@@ -1,25 +1,25 @@ - /* See LICENSE file for copyright and license details. */ - - /* appearance */ --static const unsigned int borderpx = 1; /* border pixel of windows */ -+static const unsigned int borderpx = 0; /* border pixel of windows */ - static const unsigned int snap = 32; /* snap pixel */ - static const int showbar = 1; /* 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 *fonts[] = { "DejaVu Sans Mono:size=7", "Noto Serif CJK JP:size=7", "Font Awesome 5 Free:size=7", "Noto Color Emoji:size=7"}; -+static const char dmenufont[] = "monospace:size=8"; - 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 col_highlight[] = "#324d45"; - static const char *colors[][3] = { - /* fg bg border */ - [SchemeNorm] = { col_gray3, col_gray1, col_gray2 }, -- [SchemeSel] = { col_gray4, col_cyan, col_cyan }, -+ [SchemeSel] = { col_gray4, col_highlight, col_highlight }, - }; - - /* tagging */ --static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" }; -+static const char *tags[] = { "1", "2", "3"}; - - static const Rule rules[] = { - /* xprop(1): -@@ -45,7 +45,7 @@ - }; - - /* 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} }, \ -@@ -57,13 +57,21 @@ - - /* 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 char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_highlight, "-sf", col_gray4, NULL };*/ -+static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_highlight, "-sf", col_gray4, NULL }; -+static const char *termcmd[] = { "$TERMINAL", NULL }; - -+#include <X11/XF86keysym.h> -+ - static Key keys[] = { - /* modifier key function argument */ -+ { MODKEY|ShiftMask, XK_b, spawn, SHCMD("$BROWSER") }, -+ { MODKEY|ShiftMask, XK_s, spawn, SHCMD("$SURF") }, -+ { MODKEY, XK_n, spawn, SHCMD("jinput") }, - { MODKEY, XK_p, spawn, {.v = dmenucmd } }, -- { MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } }, -+ { MODKEY|ShiftMask, XK_p, spawn, SHCMD("pass dmenu") }, -+ /*{ MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } },*/ -+ { MODKEY|ShiftMask, XK_Return, spawn, SHCMD("$TERMINAL") }, - { MODKEY, XK_b, togglebar, {0} }, - { MODKEY, XK_j, focusstack, {.i = +1 } }, - { MODKEY, XK_k, focusstack, {.i = -1 } }, -@@ -95,6 +103,10 @@ - TAGKEYS( XK_8, 7) - TAGKEYS( XK_9, 8) - { MODKEY|ShiftMask, XK_q, quit, {0} }, -+ -+ -+ { 0, XF86XK_AudioRaiseVolume, spawn, SHCMD("mixer vol +3 >/dev/null; kill -75 $(pidof dwmblocks)") }, -+ { 0, XF86XK_AudioLowerVolume, spawn, SHCMD("mixer vol -3 >/dev/null; kill -75 $(pidof dwmblocks)") }, - }; - - /* button definitions */ diff --git a/suckless/st/config.diff b/suckless/st/config.diff @@ -1,17 +0,0 @@ ---- config.def.h Mon May 2 15:31:46 2022 -+++ config.h Tue Jun 14 07:22:25 2022 -@@ -5,11 +5,11 @@ - * - * font: see http://freedesktop.org/software/fontconfig/fontconfig-user.html - */ --static char *font = "Liberation Mono:pixelsize=12:antialias=true:autohint=true"; -+static char *font = "DejaVu Sans Mono:pixelsize=12:antialias=true:autohint=true"; - /* Spare fonts */ - static char *font2[] = { --/* "Inconsolata for Powerline:pixelsize=12:antialias=true:autohint=true", */ --/* "Hack Nerd Font Mono:pixelsize=11:antialias=true:autohint=true", */ -+ "Noto Color Emoji:pixelsize=12:antialias=true:autohint=true", -+ "Noto Serif CJK JP:pixelsize=12:antialias=true:autohint=true", - }; - - static int borderpx = 2; diff --git a/suckless/st/st-font2-20190416-ba72400.diff b/suckless/st/st-font2-20190416-ba72400.diff @@ -1,167 +0,0 @@ -From ba724004c6a368e452114f7dc147a9978fe0f3b4 Mon Sep 17 00:00:00 2001 -From: Kirill Bugaev <kirill.bugaev87@gmail.com> -Date: Tue, 16 Apr 2019 04:31:30 +0800 -Subject: [PATCH] This patch allows to add spare font besides default. Some - glyphs can be not present in default font. For this glyphs st uses - font-config and try to find them in font cache first. This patch append fonts - defined in font2 variable to the beginning of font cache. So they will be - used first for glyphs that absent in default font. - ---- - config.def.h | 6 +++ - x.c | 101 +++++++++++++++++++++++++++++++++++++++++++++++++++ - 2 files changed, 107 insertions(+) - -diff --git a/config.def.h b/config.def.h -index 482901e..676719e 100644 ---- a/config.def.h -+++ b/config.def.h -@@ -6,6 +6,12 @@ - * font: see http://freedesktop.org/software/fontconfig/fontconfig-user.html - */ - static char *font = "Liberation Mono:pixelsize=12:antialias=true:autohint=true"; -+/* Spare fonts */ -+static char *font2[] = { -+/* "Inconsolata for Powerline:pixelsize=12:antialias=true:autohint=true", */ -+/* "Hack Nerd Font Mono:pixelsize=11:antialias=true:autohint=true", */ -+}; -+ - static int borderpx = 2; - - /* -diff --git a/x.c b/x.c -index 5828a3b..d37e59d 100644 ---- a/x.c -+++ b/x.c -@@ -149,6 +149,8 @@ static void xhints(void); - static int xloadcolor(int, const char *, Color *); - static int xloadfont(Font *, FcPattern *); - static void xloadfonts(char *, double); -+static int xloadsparefont(FcPattern *, int); -+static void xloadsparefonts(void); - static void xunloadfont(Font *); - static void xunloadfonts(void); - static void xsetenv(void); -@@ -296,6 +298,7 @@ zoomabs(const Arg *arg) - { - xunloadfonts(); - xloadfonts(usedfont, arg->f); -+ xloadsparefonts(); - cresize(0, 0); - redraw(); - xhints(); -@@ -977,6 +980,101 @@ xloadfonts(char *fontstr, double fontsize) - FcPatternDestroy(pattern); - } - -+int -+xloadsparefont(FcPattern *pattern, int flags) -+{ -+ FcPattern *match; -+ FcResult result; -+ -+ match = FcFontMatch(NULL, pattern, &result); -+ if (!match) { -+ return 1; -+ } -+ -+ if (!(frc[frclen].font = XftFontOpenPattern(xw.dpy, match))) { -+ FcPatternDestroy(match); -+ return 1; -+ } -+ -+ frc[frclen].flags = flags; -+ /* Believe U+0000 glyph will present in each default font */ -+ frc[frclen].unicodep = 0; -+ frclen++; -+ -+ return 0; -+} -+ -+void -+xloadsparefonts(void) -+{ -+ FcPattern *pattern; -+ double sizeshift, fontval; -+ int fc; -+ char **fp; -+ -+ if (frclen != 0) -+ die("can't embed spare fonts. cache isn't empty"); -+ -+ /* Calculate count of spare fonts */ -+ fc = sizeof(font2) / sizeof(*font2); -+ if (fc == 0) -+ return; -+ -+ /* Allocate memory for cache entries. */ -+ if (frccap < 4 * fc) { -+ frccap += 4 * fc - frccap; -+ frc = xrealloc(frc, frccap * sizeof(Fontcache)); -+ } -+ -+ for (fp = font2; fp - font2 < fc; ++fp) { -+ -+ if (**fp == '-') -+ pattern = XftXlfdParse(*fp, False, False); -+ else -+ pattern = FcNameParse((FcChar8 *)*fp); -+ -+ if (!pattern) -+ die("can't open spare font %s\n", *fp); -+ -+ if (defaultfontsize > 0) { -+ sizeshift = usedfontsize - defaultfontsize; -+ if (sizeshift != 0 && -+ FcPatternGetDouble(pattern, FC_PIXEL_SIZE, 0, &fontval) == -+ FcResultMatch) { -+ fontval += sizeshift; -+ FcPatternDel(pattern, FC_PIXEL_SIZE); -+ FcPatternDel(pattern, FC_SIZE); -+ FcPatternAddDouble(pattern, FC_PIXEL_SIZE, fontval); -+ } -+ } -+ -+ FcPatternAddBool(pattern, FC_SCALABLE, 1); -+ -+ FcConfigSubstitute(NULL, pattern, FcMatchPattern); -+ XftDefaultSubstitute(xw.dpy, xw.scr, pattern); -+ -+ if (xloadsparefont(pattern, FRC_NORMAL)) -+ die("can't open spare font %s\n", *fp); -+ -+ FcPatternDel(pattern, FC_SLANT); -+ FcPatternAddInteger(pattern, FC_SLANT, FC_SLANT_ITALIC); -+ if (xloadsparefont(pattern, FRC_ITALIC)) -+ die("can't open spare font %s\n", *fp); -+ -+ FcPatternDel(pattern, FC_WEIGHT); -+ FcPatternAddInteger(pattern, FC_WEIGHT, FC_WEIGHT_BOLD); -+ if (xloadsparefont(pattern, FRC_ITALICBOLD)) -+ die("can't open spare font %s\n", *fp); -+ -+ FcPatternDel(pattern, FC_SLANT); -+ FcPatternAddInteger(pattern, FC_SLANT, FC_SLANT_ROMAN); -+ if (xloadsparefont(pattern, FRC_BOLD)) -+ die("can't open spare font %s\n", *fp); -+ -+ FcPatternDestroy(pattern); -+ } -+} -+ - void - xunloadfont(Font *f) - { -@@ -1057,6 +1155,9 @@ xinit(int cols, int rows) - usedfont = (opt_font == NULL)? font : opt_font; - xloadfonts(usedfont, 0); - -+ /* spare fonts */ -+ xloadsparefonts(); -+ - /* colors */ - xw.cmap = XDefaultColormap(xw.dpy, xw.scr); - xloadcols(); --- -2.21.0 - diff --git a/suckless/st/st-w3m-0.8.3.diff b/suckless/st/st-w3m-0.8.3.diff @@ -1,42 +0,0 @@ -From 69cffc587b54b0a9cd81adb87abad8e526d5b25b Mon Sep 17 00:00:00 2001 -From: "Avi Halachmi (:avih)" <avihpit@yahoo.com> -Date: Thu, 4 Jun 2020 17:35:08 +0300 -Subject: [PATCH] support w3m images - -w3m images are a hack which renders on top of the terminal's drawable, -which didn't work in st because when using double buffering, the front -buffer (on which w3m draws its images) is ignored, and st draws only -on the back buffer, which is then copied to the front buffer. - -There's a patch to make it work at the FAQ already, but that patch -canceles double-buffering, which can have negative side effects on -some cases such as flickering. - -This patch achieves the same goal but instead of canceling the double -buffer it first copies the front buffer to the back buffer. - -This has the same issues as the FAQ patch in that the cursor line is -deleted at the image (because st renders always full lines), but -otherwise it's simpler and does keeps double buffering. ---- - x.c | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/x.c b/x.c -index e5f1737..b6ae162 100644 ---- a/x.c -+++ b/x.c -@@ -1594,6 +1594,8 @@ xsettitle(char *p) - int - xstartdraw(void) - { -+ if (IS_SET(MODE_VISIBLE)) -+ XCopyArea(xw.dpy, xw.win, xw.buf, dc.gc, 0, 0, win.w, win.h, 0, 0); - return IS_SET(MODE_VISIBLE); - } - - -base-commit: 43a395ae91f7d67ce694e65edeaa7bbc720dd027 --- -2.17.1 - diff --git a/suckless/surf/config.diff b/suckless/surf/config.diff @@ -1,61 +0,0 @@ ---- config.def.h 2021-08-12 09:55:15.980353000 +0900 -+++ config.h 2021-08-10 11:04:40.573740000 +0900 -@@ -119,7 +119,8 @@ - { "://suckless\\.org/", "suckless.org.crt" }, - }; - --#define MODKEY GDK_CONTROL_MASK -+/*#define MODKEY GDK_CONTROL_MASK*/ -+#define MODKEY GDK_MOD1_MASK - - /* hotkeys */ - /* -@@ -129,25 +130,27 @@ - static Key keys[] = { - /* modifier keyval function arg */ - { MODKEY, GDK_KEY_g, spawn, SETPROP("_SURF_URI", "_SURF_GO", PROMPT_GO) }, -- { MODKEY, GDK_KEY_f, spawn, SETPROP("_SURF_FIND", "_SURF_FIND", PROMPT_FIND) }, - { MODKEY, GDK_KEY_slash, spawn, SETPROP("_SURF_FIND", "_SURF_FIND", PROMPT_FIND) }, - -+ { MODKEY, GDK_KEY_w, playexternal, { 0 } }, -+ - { 0, GDK_KEY_Escape, stop, { 0 } }, -- { MODKEY, GDK_KEY_c, stop, { 0 } }, - - { MODKEY|GDK_SHIFT_MASK, GDK_KEY_r, reload, { .i = 1 } }, - { MODKEY, GDK_KEY_r, reload, { .i = 0 } }, - -- { MODKEY, GDK_KEY_l, navigate, { .i = +1 } }, -- { MODKEY, GDK_KEY_h, navigate, { .i = -1 } }, -+ { GDK_SHIFT_MASK, GDK_KEY_l, navigate, { .i = +1 } }, -+ { GDK_SHIFT_MASK, GDK_KEY_h, navigate, { .i = -1 } }, - - /* vertical and horizontal scrolling, in viewport percentage */ -- { MODKEY, GDK_KEY_j, scrollv, { .i = +10 } }, -- { MODKEY, GDK_KEY_k, scrollv, { .i = -10 } }, -- { MODKEY, GDK_KEY_space, scrollv, { .i = +50 } }, -- { MODKEY, GDK_KEY_b, scrollv, { .i = -50 } }, -- { MODKEY, GDK_KEY_i, scrollh, { .i = +10 } }, -- { MODKEY, GDK_KEY_u, scrollh, { .i = -10 } }, -+ { MODKEY, GDK_KEY_j, scrollv, { .i = +5 } }, -+ { MODKEY, GDK_KEY_e, scrollv, { .i = +5 } }, -+ { MODKEY, GDK_KEY_k, scrollv, { .i = -5 } }, -+ { MODKEY, GDK_KEY_y, scrollv, { .i = -5 } }, -+ { MODKEY, GDK_KEY_d, scrollv, { .i = +50 } }, -+ { MODKEY, GDK_KEY_u, scrollv, { .i = -50 } }, -+ { MODKEY, GDK_KEY_l, scrollh, { .i = +5 } }, -+ { MODKEY, GDK_KEY_h, scrollh, { .i = -5 } }, - - - { MODKEY|GDK_SHIFT_MASK, GDK_KEY_j, zoom, { .i = -1 } }, -@@ -156,8 +159,8 @@ - { MODKEY, GDK_KEY_minus, zoom, { .i = -1 } }, - { MODKEY, GDK_KEY_plus, zoom, { .i = +1 } }, - -- { MODKEY, GDK_KEY_p, clipboard, { .i = 1 } }, -- { MODKEY, GDK_KEY_y, clipboard, { .i = 0 } }, -+ { MODKEY|GDK_SHIFT_MASK, GDK_KEY_p, clipboard, { .i = 1 } }, -+ { MODKEY|GDK_SHIFT_MASK, GDK_KEY_y, clipboard, { .i = 0 } }, - - { MODKEY, GDK_KEY_n, find, { .i = +1 } }, - { MODKEY|GDK_SHIFT_MASK, GDK_KEY_n, find, { .i = -1 } }, diff --git a/suckless/surf/surf-playexternal-20190724-b814567.diff b/suckless/surf/surf-playexternal-20190724-b814567.diff @@ -1,54 +0,0 @@ -From 95e17b5bd428173c83e60cec9cd5666cfe9066fa Mon Sep 17 00:00:00 2001 -From: DanMan <dnahimov@gmail.com> -Date: Wed, 24 Jul 2019 18:47:46 -0400 -Subject: [PATCH] added playexternal hotkey function - ---- - config.def.h | 2 ++ - surf.c | 10 ++++++++++ - 2 files changed, 12 insertions(+) - -diff --git a/config.def.h b/config.def.h -index 6d3135e..5fa0d9d 100644 ---- a/config.def.h -+++ b/config.def.h -@@ -105,6 +105,8 @@ static Key keys[] = { - { MODKEY, GDK_KEY_f, spawn, SETPROP("_SURF_FIND", "_SURF_FIND") }, - { MODKEY, GDK_KEY_slash, spawn, SETPROP("_SURF_FIND", "_SURF_FIND") }, - -+ { MODKEY, GDK_KEY_w, playexternal, { 0 } }, -+ - { 0, GDK_KEY_Escape, stop, { 0 } }, - { MODKEY, GDK_KEY_c, stop, { 0 } }, - -diff --git a/surf.c b/surf.c -index 93a1629..e74e9df 100644 ---- a/surf.c -+++ b/surf.c -@@ -217,6 +217,7 @@ static void togglefullscreen(Client *c, const Arg *a); - static void togglecookiepolicy(Client *c, const Arg *a); - static void toggleinspector(Client *c, const Arg *a); - static void find(Client *c, const Arg *a); -+static void playexternal(Client *c, const Arg *a); - - /* Buttons */ - static void clicknavigate(Client *c, const Arg *a, WebKitHitTestResult *h); -@@ -1648,6 +1649,15 @@ clickexternplayer(Client *c, const Arg *a, WebKitHitTestResult *h) - spawn(c, &arg); - } - -+void -+playexternal(Client *c, const Arg *a) -+{ -+ Arg arg; -+ -+ arg = (Arg)VIDEOPLAY(geturi(c)); -+ spawn(c, &arg); -+} -+ - int - main(int argc, char *argv[]) - { --- -2.22.0 -