Compare commits

..

6 Commits

8 changed files with 143 additions and 253 deletions

1
.gitignore vendored
View File

@ -1,6 +1,7 @@
bspwm/.config/bspwm/themes/theme.sh bspwm/.config/bspwm/themes/theme.sh
shell/.config/zsh/plugins/zsh-autosuggestions shell/.config/zsh/plugins/zsh-autosuggestions
shell/.config/zsh/plugins/zsh-syntax-highlighting shell/.config/zsh/plugins/zsh-syntax-highlighting
shell/.config/zsh/plugins/zsh-vi-mode
qtile/.config/qtile/theme.txt qtile/.config/qtile/theme.txt
lupan-clock/lupan-clock lupan-clock/lupan-clock
lupan-wm/target lupan-wm/target

View File

@ -161,7 +161,9 @@ require('lazy').setup({
}, },
}, },
{ 'nvim-orgmode/orgmode' }, 'nvim-orgmode/orgmode',
'norcalli/nvim-colorizer.lua',
-- See: https://github.com/folke/lazy.nvim#-structuring-your-plugins -- See: https://github.com/folke/lazy.nvim#-structuring-your-plugins
-- { import = 'custom.plugins' }, -- { import = 'custom.plugins' },
@ -240,6 +242,10 @@ vim.keymap.set('n', 'k', "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = tr
vim.keymap.set('n', 'j', "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true }) vim.keymap.set('n', 'j', "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true })
vim.keymap.set("n", "<leader>tt", ":NvimTreeToggle<cr>", { desc = "[T]oggle Nvim [T]ree" }) vim.keymap.set("n", "<leader>tt", ":NvimTreeToggle<cr>", { desc = "[T]oggle Nvim [T]ree" })
vim.keymap.set("n", "<A-h>", ":wincmd h<cr>", { desc = "move to left window" })
vim.keymap.set("n", "<A-j>", ":wincmd j<cr>", { desc = "move to below window" })
vim.keymap.set("n", "<A-k>", ":wincmd k<cr>", { desc = "move to above window" })
vim.keymap.set("n", "<A-l>", ":wincmd l<cr>", { desc = "move to right window" })
-- [[ Highlight on yank ]] -- [[ Highlight on yank ]]
-- See `:help vim.highlight.on_yank()` -- See `:help vim.highlight.on_yank()`

122
patches/dwm/config.h Normal file
View File

@ -0,0 +1,122 @@
/* See LICENSE file for copyright and license details. */
/* appearance */
static const unsigned int borderpx = 2; /* 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[] = { "Iosevka NFM Light:size=11" };
static const char dmenufont[] = "Iosevka NFM Light:size=11";
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[] = "#1a5a72"; // "#6c7aaa"; // "#007762"; // "#195971";
static const char col_orange[] = "#a0522d";
static const char *colors[][3] = {
/* fg bg border */
[SchemeNorm] = { col_gray3, col_gray1, col_gray2 },
[SchemeSel] = { col_gray4, col_cyan, col_orange },
};
/* tagging */
static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
static const Rule rules[] = {
/* xprop(1):
* WM_CLASS(STRING) = instance, class
* WM_NAME(STRING) = title
*/
/* class instance title tags mask isfloating monitor */
{ "Gimp", NULL, NULL, 0, 1, -1 },
{ "Firefox", NULL, NULL, 1 << 8, 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 int lockfullscreen = 1; /* 1 will force focus on the fullscreen window */
static const Layout layouts[] = {
/* symbol arrange function */
{ "[]=", tile }, /* first entry is default */
{ "><>", NULL }, /* no layout function means floating behavior */
{ "[M]", monocle },
};
/* key definitions */
#define MODKEY Mod4Mask
#define TAGKEYS(KEY,TAG) \
{ MODKEY, KEY, view, {.ui = 1 << TAG} }, \
{ MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \
{ MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \
{ MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} },
/* 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 char *lockcmd[] = { "slock", NULL };
static const char *suspendcmd[] = { "systemctl", "suspend", NULL };
static const Key keys[] = {
/* modifier key function argument */
{ MODKEY, XK_p, spawn, {.v = dmenucmd } },
{ MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } },
{ MODKEY|ControlMask, XK_l, spawn, {.v = lockcmd } },
{ MODKEY|ControlMask, XK_s, spawn, {.v = suspendcmd } },
{ MODKEY, XK_b, togglebar, {0} },
{ MODKEY, XK_j, focusstack, {.i = +1 } },
{ MODKEY, XK_k, focusstack, {.i = -1 } },
{ MODKEY, XK_i, incnmaster, {.i = +1 } },
{ MODKEY, XK_d, incnmaster, {.i = -1 } },
{ MODKEY, XK_h, setmfact, {.f = -0.05} },
{ MODKEY, XK_l, setmfact, {.f = +0.05} },
{ MODKEY, XK_Return, zoom, {0} },
{ MODKEY, XK_Tab, view, {0} },
{ MODKEY, XK_a, 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_space, setlayout, {0} },
{ MODKEY|ShiftMask, XK_space, togglefloating, {0} },
{ MODKEY, XK_0, view, {.ui = ~0 } },
{ MODKEY|ShiftMask, XK_0, tag, {.ui = ~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 } },
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} },
};
/* 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, Button3, resizemouse, {0} },
{ ClkTagBar, 0, Button1, view, {0} },
{ ClkTagBar, 0, Button3, toggleview, {0} },
{ ClkTagBar, MODKEY, Button1, tag, {0} },
{ ClkTagBar, MODKEY, Button3, toggletag, {0} },
};

View File

@ -1,231 +0,0 @@
diff --git a/config.def.h b/config.def.h
index 91ab8ca..5bbc088 100644
--- a/config.def.h
+++ b/config.def.h
@@ -5,7 +5,7 @@
*
* font: see http://freedesktop.org/software/fontconfig/fontconfig-user.html
*/
-static char *font = "Liberation Mono:pixelsize=12:antialias=true:autohint=true";
+static char *font = "Iosevka Slab Light:size=12:antialias=true:autohint=true";
static int borderpx = 2;
/*
@@ -95,35 +95,61 @@ unsigned int tabspaces = 8;
/* Terminal colors (16 first used in escape sequence) */
static const char *colorname[] = {
- /* 8 normal colors */
- "black",
- "red3",
- "green3",
- "yellow3",
- "blue2",
- "magenta3",
- "cyan3",
- "gray90",
-
- /* 8 bright colors */
- "gray50",
- "red",
- "green",
- "yellow",
- "#5c5cff",
- "magenta",
- "cyan",
- "white",
+ /* windi dark */
+ "#1f1f1f", /* 0: black */
+ "#ef4444", /* 1: red */
+ "#22c55e", /* 2: green */
+ "#eab308", /* 3: yellow */
+ "#3b82f6", /* 4: blue */
+ "#d946ef", /* 5: magenta */
+ "#06b6d4", /* 6: cyan */
+ "#f2f2f2", /* 7: white */
+ "#737373", /* 8: brblack */
+ "#fecaca", /* 9: brred */
+ "#bbf7d0", /* 10: brgreen */
+ "#fef08a", /* 11: bryellow */
+ "#bfdbfe", /* 12: brblue */
+ "#f5d0fe", /* 13: brmagenta*/
+ "#a5f3fc", /* 14: brcyan */
+ "#fafafa", /* 15: brwhite */
[255] = 0,
/* more colors can be added after 255 to use with DefaultXX */
- "#cccccc",
- "#555555",
- "gray90", /* default foreground colour */
- "black", /* default background colour */
+ "white",
+ "black",
+ "#E7E7E7", /* default foreground colour */
+ "#2C444D",
};
+/* Terminal colors for alternate (light) palette */
+static const char *altcolorname[] = {
+ /* windi light */
+ "#1b1b1b", /* 0: black */
+ "#b91c1c", /* 1: red */
+ "#15803d", /* 2: green */
+ "#a16207", /* 3: yellow */
+ "#1d4ed8", /* 4: blue */
+ "#a21caf", /* 5: magenta*/
+ "#0e7490", /* 6: cyan */
+ "#e9ecef", /* 7: white */
+ "#404040", /* 8: brblack */
+ "#ef4444", /* 9: brred */
+ "#22c55e", /* 10: brgreen */
+ "#eab308", /* 11: bryellow */
+ "#3b82f6", /* 12: brblue */
+ "#d946ef", /* 13: brmagenta */
+ "#06b6d4", /* 14: brcyan */
+ "#f2f2f2", /* 15: brwhite */
+
+ [255] = 0,
+
+ /* more colors can be added after 255 to use with DefaultXX */
+ "#00638a",
+ "#f2f2f2",
+ "#454545", /* default foreground colour */
+ "#f2f2f2",
+};
/*
* Default colors (colorname index)
@@ -201,6 +227,7 @@ static Shortcut shortcuts[] = {
{ TERMMOD, XK_Y, selpaste, {.i = 0} },
{ ShiftMask, XK_Insert, selpaste, {.i = 0} },
{ TERMMOD, XK_Num_Lock, numlock, {.i = 0} },
+ { XK_ANY_MOD, XK_F6, swapcolors, {.i = 0} },
};
/*
diff --git a/st.h b/st.h
index 519b9bd..c25b693 100644
--- a/st.h
+++ b/st.h
@@ -122,6 +122,7 @@ extern wchar_t *worddelimiters;
extern int allowaltscreen;
extern int allowwindowops;
extern char *termname;
+extern int usealtcolors;
extern unsigned int tabspaces;
extern unsigned int defaultfg;
extern unsigned int defaultbg;
diff --git a/x.c b/x.c
index 8a16faa..4b569df 100644
--- a/x.c
+++ b/x.c
@@ -55,6 +55,7 @@ static void clipcopy(const Arg *);
static void clippaste(const Arg *);
static void numlock(const Arg *);
static void selpaste(const Arg *);
+static void swapcolors(const Arg *);
static void zoom(const Arg *);
static void zoomabs(const Arg *);
static void zoomreset(const Arg *);
@@ -254,6 +255,8 @@ static char *opt_title = NULL;
static int oldbutton = 3; /* button event on startup: 3 = release */
+int usealtcolors = 0; /* 1 to use alternate palette */
+
void
clipcopy(const Arg *dummy)
{
@@ -292,6 +295,18 @@ numlock(const Arg *dummy)
win.mode ^= MODE_NUMLOCK;
}
+void
+swapcolors(const Arg *arg)
+{
+ int next = (arg->i == 'D') ? 0 : (arg->i == 'L') ? 1 : !usealtcolors;
+
+ if (next != usealtcolors) {
+ usealtcolors = next;
+ xloadcols();
+ redraw();
+ }
+}
+
void
zoom(const Arg *arg)
{
@@ -750,6 +765,11 @@ sixd_to_16bit(int x)
return x == 0 ? 0 : 0x3737 + 0x2828 * x;
}
+const char* getcolorname(int i)
+{
+ return (usealtcolors) ? altcolorname[i] : colorname[i];
+}
+
int
xloadcolor(int i, const char *name, Color *ncolor)
{
@@ -768,7 +788,7 @@ xloadcolor(int i, const char *name, Color *ncolor)
return XftColorAllocValue(xw.dpy, xw.vis,
xw.cmap, &color, ncolor);
} else
- name = colorname[i];
+ name = getcolorname(i);
}
return XftColorAllocName(xw.dpy, xw.vis, xw.cmap, name, ncolor);
@@ -791,8 +811,8 @@ xloadcols(void)
for (i = 0; i < dc.collen; i++)
if (!xloadcolor(i, NULL, &dc.col[i])) {
- if (colorname[i])
- die("could not allocate color '%s'\n", colorname[i]);
+ if (getcolorname(i))
+ die("could not allocate color '%s'\n", getcolorname(i));
else
die("could not allocate color %d\n", i);
}
@@ -1184,13 +1204,13 @@ xinit(int cols, int rows)
cursor = XCreateFontCursor(xw.dpy, mouseshape);
XDefineCursor(xw.dpy, xw.win, cursor);
- if (XParseColor(xw.dpy, xw.cmap, colorname[mousefg], &xmousefg) == 0) {
+ if (XParseColor(xw.dpy, xw.cmap, getcolorname(mousefg), &xmousefg) == 0) {
xmousefg.red = 0xffff;
xmousefg.green = 0xffff;
xmousefg.blue = 0xffff;
}
- if (XParseColor(xw.dpy, xw.cmap, colorname[mousebg], &xmousebg) == 0) {
+ if (XParseColor(xw.dpy, xw.cmap, getcolorname(mousebg), &xmousebg) == 0) {
xmousebg.red = 0x0000;
xmousebg.green = 0x0000;
xmousebg.blue = 0x0000;
@@ -2008,6 +2028,15 @@ usage(void)
" [stty_args ...]\n", argv0, argv0);
}
+void
+sig_usr_handler(int num)
+{
+ Arg a = { .i = (num == 10) ? 'D' : 'L' };
+ signal(num, sig_usr_handler);
+ swapcolors(&a);
+}
+
+
int
main(int argc, char *argv[])
{
@@ -2066,6 +2095,8 @@ run:
if (!opt_title)
opt_title = (opt_line || !opt_cmd) ? "st" : opt_cmd[0];
+ signal(SIGUSR1, sig_usr_handler);
+ signal(SIGUSR2, sig_usr_handler);
setlocale(LC_CTYPE, "");
XSetLocaleModifiers("");
cols = MAX(cols, 1);

View File

@ -2,5 +2,6 @@ Directory for plugins. Checkout here
1. zsh-autosuggestions (https://github.com/zsh-users/zsh-autosuggestions) 1. zsh-autosuggestions (https://github.com/zsh-users/zsh-autosuggestions)
2. zsh-syntax-highlighting (https://github.com/zsh-users/zsh-syntax-highlighting) 2. zsh-syntax-highlighting (https://github.com/zsh-users/zsh-syntax-highlighting)
3. https://github.com/jeffreytse/zsh-vi-mode
or install then with package manager in /usr/share/zsh/plugins/ and symlink. or install then with package manager in /usr/share/zsh/plugins/ and symlink.

View File

@ -29,7 +29,7 @@ ifDark dark light = if isDark then dark else light
myConfig = myConfig =
def def
{ modMask = mod4Mask, { modMask = mod4Mask,
terminal = "xterm", terminal = "st",
borderWidth = 3, borderWidth = 3,
focusedBorderColor = ifDark "#a0522d" "#ff7f50", focusedBorderColor = ifDark "#a0522d" "#ff7f50",
normalBorderColor = ifDark "#708090" "#bebebe", normalBorderColor = ifDark "#708090" "#bebebe",
@ -59,9 +59,9 @@ myConfig =
] ]
scratchpads = scratchpads =
[ NS "terminal" "xterm -T terminal" (title =? "terminal") floating, [ NS "terminal" "st -T terminal" (title =? "terminal") floating,
NS "thunar" "thunar" (className =? "Thunar") floating, NS "thunar" "thunar" (className =? "Thunar") floating,
NS "top" "xterm -T top -e top" (title =? "top") floating NS "top" "st -T top -e top" (title =? "top") floating
] ]
where where
floating = customFloating $ RationalRect (1 / 6) (1 / 6) (2 / 3) (2 / 3) floating = customFloating $ RationalRect (1 / 6) (1 / 6) (2 / 3) (2 / 3)

View File

@ -8,7 +8,7 @@ xset b off
xrandr --auto xrandr --auto
xrandr --output HDMI1 --right-of DP1 xrandr --output HDMI1 --right-of DP1
xrdb -merge ~/.Xresources xrdb -merge ~/.Xresources
setxkbmap pl -option ctrl:nocaps setxkbmap pl -option caps:escape
xmodmap ~/.xmodmaprc xmodmap ~/.xmodmaprc
if [ -x ~/.fehbg ]; then if [ -x ~/.fehbg ]; then
@ -24,24 +24,26 @@ else
( echo "Missing command(s):"; which xss-lock slock 2>&1 ) | xmessage -file - ( echo "Missing command(s):"; which xss-lock slock 2>&1 ) | xmessage -file -
fi fi
# run emacs daemon if not running
emacsclient --eval nil -a '' &
xsettingsd & xsettingsd &
xsetroot -cursor_name left_ptr xsetroot -cursor_name left_ptr
picom -b -I 1 -O 1 -i 1 -e 1 --no-fading-openclose || compton -b --no-fading-openclose picom -b -I 1 -O 1 -i 1 -e 1 --no-fading-openclose || compton -b --no-fading-openclose
if which xmonad > /dev/null && test -f ~/.stumpwm.d/init.lisp; then if which dwm > /dev/null; then
export SBCL_HOME="$(dirname $(dirname $(readlink -f $(which sbcl))))/lib/sbcl/" lupan-clock &
exec stumpwm exec dwm
fi fi
if which xmonad > /dev/null && test -f ~/.config/xmonad/xmonad.hs; then if which xmonad > /dev/null && test -f ~/.config/xmonad/xmonad.hs; then
exec xmonad exec xmonad
fi fi
if which stumpwm > /dev/null && test -f ~/.stumpwm.d/init.lisp; then
export SBCL_HOME="$(dirname $(dirname $(readlink -f $(which sbcl))))/lib/sbcl/"
exec stumpwm
fi
if which qtile > /dev/null && test -f ~/.config/qtile/config.py; then if which qtile > /dev/null && test -f ~/.config/qtile/config.py; then
exec qtile start exec qtile start
fi fi
@ -65,9 +67,4 @@ if which i3 > /dev/null; then
exec i3 exec i3
fi fi
if which dwm > /dev/null; then
lupan-clock &
exec dwm
fi
exec xterm exec xterm

View File

@ -3,15 +3,12 @@
THEME="$1" THEME="$1"
if [ "$THEME" = dark ]; then if [ "$THEME" = dark ]; then
SIGNAL=USR1
BGCOLOR=#4a4a4a BGCOLOR=#4a4a4a
GTK_THEME=Materia-dark GTK_THEME=Materia-dark
elif [ "$THEME" = light ]; then elif [ "$THEME" = light ]; then
SIGNAL=USR2
BGCOLOR=#dde1e3 BGCOLOR=#dde1e3
GTK_THEME=Materia-light GTK_THEME=Materia-light
elif [ "$THEME" = faff ]; then elif [ "$THEME" = faff ]; then
SIGNAL=USR2
BGCOLOR=#4a4a4a BGCOLOR=#4a4a4a
GTK_THEME=Materia-light GTK_THEME=Materia-light
else else
@ -29,9 +26,6 @@ if [ -f ~/.config/alacritty/alacritty.yml ]; then
sed -i "s/^colors: [*].*/colors: *$THEME/" ~/.config/alacritty/alacritty.yml sed -i "s/^colors: [*].*/colors: *$THEME/" ~/.config/alacritty/alacritty.yml
fi fi
# ST (patched)
pkill -$SIGNAL -x st
# GTK # GTK
if [ -f ~/.config/xsettingsd/xsettingsd.conf ]; then if [ -f ~/.config/xsettingsd/xsettingsd.conf ]; then
sed -i -E "s#(Net/ThemeName) .*#\\1 \"${GTK_THEME}\"#" ~/.config/xsettingsd/xsettingsd.conf sed -i -E "s#(Net/ThemeName) .*#\\1 \"${GTK_THEME}\"#" ~/.config/xsettingsd/xsettingsd.conf