lupan-set-theme: fix light and dark; add key in dwm

This commit is contained in:
Łukasz Pankowski 2023-08-17 20:20:59 +02:00
parent f320686648
commit 4b45ae4d75
2 changed files with 8 additions and 4 deletions

View File

@ -62,6 +62,7 @@ static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont,
static const char *termcmd[] = { "st", NULL };
static const char *lockcmd[] = { "slock", NULL };
static const char *suspendcmd[] = { "systemctl", "suspend", NULL };
static const char *toggletheme[] = { "lupan-set-theme", "toggle", NULL };
static const Key keys[] = {
/* modifier key function argument */
@ -69,6 +70,7 @@ static const Key keys[] = {
{ MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } },
{ MODKEY|ControlMask|ShiftMask, XK_l, spawn, {.v = lockcmd } },
{ MODKEY|ControlMask|ShiftMask, XK_s, spawn, {.v = suspendcmd } },
{ MODKEY|ShiftMask, XK_F6, spawn, {.v = toggletheme } },
{ MODKEY|ControlMask, XK_b, togglebar, {0} },
{ MODKEY|ControlMask, XK_j, focusstack, {.i = +1 } },
{ MODKEY|ControlMask, XK_k, focusstack, {.i = -1 } },

View File

@ -2,11 +2,13 @@
THEME="$1"
if [ "$THEME" = "toggle" ] && grep Materia-dark ~/.config/xsettingsd/xsettingsd.conf > /dev/null; then
if [ "$THEME" = "toggle" ]; then
if grep Materia-dark ~/.config/xsettingsd/xsettingsd.conf > /dev/null; then
THEME=light
else
THEME=dark
fi
fi
if [ "$THEME" = dark ]; then
BGCOLOR=#4a4a4a