summaryrefslogtreecommitdiff
path: root/dwm-6.3
diff options
context:
space:
mode:
Diffstat (limited to 'dwm-6.3')
-rw-r--r--dwm-6.3/cmd.h4
-rw-r--r--dwm-6.3/config.h56
-rw-r--r--dwm-6.3/config.mk2
-rw-r--r--dwm-6.3/dwm.c7
-rw-r--r--dwm-6.3/patches/dwm-activetagindicatorbar-6.2.diff17
-rwxr-xr-xdwm-6.3/scripts/passmenu35
-rwxr-xr-xdwm-6.3/scripts/passmenu260
-rwxr-xr-xdwm-6.3/scripts/power8
-rw-r--r--dwm-6.3/vanitygaps.c106
9 files changed, 99 insertions, 196 deletions
diff --git a/dwm-6.3/cmd.h b/dwm-6.3/cmd.h
new file mode 100644
index 0000000..e734f59
--- /dev/null
+++ b/dwm-6.3/cmd.h
@@ -0,0 +1,4 @@
+/* regular shell command spawner using /bin/sh */
+#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
+/* some things need bash */
+#define BASHCMD(cmd) { .v = (const char*[]){ "/bin/bash", "-c", cmd, NULL } }
diff --git a/dwm-6.3/config.h b/dwm-6.3/config.h
index bfd6e8d..a2cc043 100644
--- a/dwm-6.3/config.h
+++ b/dwm-6.3/config.h
@@ -1,4 +1,5 @@
#include "../colors.h"
+#include "cmd.h"
/* See LICENSE file for copyright and license details. */
/* appearance */
@@ -12,7 +13,7 @@ static const unsigned int gappiv = 10;
static const unsigned int gappoh = 10;
static const unsigned int gappov = 10;
static int smartgaps = 0;
-static const char *fonts[] = { "Source Code Pro:size=9" , "Twitter Color Emoji:size=8"};
+static const char *fonts[] = { "Source Code Pro:size=9" , "NotoColorEmoji:size=8"};
static const char dmenufont[] = "Source Code Pro:size=9";
static const unsigned int baralpha = 0xd0;
static const unsigned int borderalpha = OPAQUE;
@@ -28,9 +29,10 @@ static const unsigned int alphas[][3] = {
};
static const char *const autostart[] = {
- "picom", NULL,
- "fehbg", NULL,
+ "xsetroot", "-name", "Loading dwmblocks", NULL,
"dwmblocks", NULL,
+ "fehbg", NULL,
+ "picom", NULL,
NULL /* terminate */
};
@@ -46,6 +48,7 @@ static const Rule rules[] = {
{ "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 },
+ { "Galculator", NULL, NULL, 0, 1, 0, 0, -1},
{ NULL, NULL, "Event Tester", 0, 0, 0, 1, -1 }, /* xev */
};
@@ -60,7 +63,7 @@ static const int lockfullscreen = 1; /* 1 will force focus on the fullscreen win
static const Layout layouts[] = {
/* symbol arrange function */
- { "[]=", tile }, /* first entry is default */
+ { "[T]", tile }, /* first entry is default */
{ "[M]", monocle },
{ "[@]", spiral },
{ "[\\]", dwindle },
@@ -77,6 +80,12 @@ static const Layout layouts[] = {
{ NULL, NULL },
};
+#define STATUSBAR "dwmblocks"
+
+/* 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 };
/* key definitions */
#define MODKEY Mod1Mask
#define TAGKEYS(KEY,TAG) \
@@ -85,20 +94,10 @@ static const Layout layouts[] = {
{ 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/bash", "-c", cmd, NULL } }
-
-#define STATUSBAR "dwmblocks"
-
-/* 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 Key keys[] = {
/* modifier key function argument */
{ 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_j, focusstack, {.i = +1 } },
{ MODKEY, XK_k, focusstack, {.i = -1 } },
@@ -106,9 +105,9 @@ static Key keys[] = {
{ MODKEY, XK_u, incnmaster, {.i = -1 } },
{ MODKEY, XK_h, setmfact, {.f = -0.05} },
{ MODKEY, XK_l, setmfact, {.f = +0.05} },
- { MODKEY|ShiftMask, XK_Return, zoom, {0} },
+ { MODKEY|ShiftMask, XK_Return, zoom, {0} },
{ MODKEY, XK_Tab, view, {0} },
- { MODKEY, XK_x, killclient, {0} },
+ { MODKEY, XK_x, killclient, {0} },
{ MODKEY, XK_t, setlayout, {.v = &layouts[0]} },
{ MODKEY, XK_f, setlayout, {.v = &layouts[1]} },
{ MODKEY, XK_m, setlayout, {.v = &layouts[2]} },
@@ -123,16 +122,20 @@ static Key keys[] = {
{ MODKEY, XK_r, spawn, SHCMD("mpvopen") },
{ MODKEY, XK_F3, spawn, SHCMD("st ranger") },
{ MODKEY, XK_F5, spawn, SHCMD("st ncmpcpp") },
- { MODKEY|ShiftMask, XK_f, spawn, SHCMD("chromium-ungoogled") },
+ { MODKEY|ShiftMask, XK_f, spawn, SHCMD("firejail --noprofile --hosts-file=~/.config/surf/ads.txt tabbed surf -e") },
{ MODKEY, XK_w, spawn, SHCMD("get_weather") },
- { MODKEY, XK_F11, spawn, SHCMD("dwm-vol_up") },
- { MODKEY, XK_F10, spawn, SHCMD("dwm-vol_down") },
- { MODKEY, XK_F7, spawn, SHCMD("mpc toggle") },
- { MODKEY, XK_F8, spawn, SHCMD("mpc prev") },
- { MODKEY, XK_F6, spawn, SHCMD("mpc next") },
- { MODKEY, XK_F9, spawn, SHCMD("pamixer -t") },
- { MODKEY, XK_p, spawn, SHCMD("sxiv -t ~/Pictures") },
- { MODKEY, XK_a, spawn, SHCMD("passmenu2") },
+ { MODKEY, XK_F11, spawn, SHCMD("pamixer --allow-boost -i 5; kill -44 $(pidof dwmblocks)") },
+ { MODKEY, XK_F10, spawn, SHCMD("pamixer --allow-boost -d 5; kill -44 $(pidof dwmblocks)") },
+ { MODKEY, XK_F7, spawn, BASHCMD("mpc toggle") },
+ { MODKEY, XK_F8, spawn, BASHCMD("mpc prev") },
+ { MODKEY, XK_F6, spawn, BASHCMD("mpc next") },
+ { MODKEY, XK_F9, spawn, BASHCMD("pamixer -t; kill -44 $(pidof dwmblocks)") },
+ { MODKEY, XK_F1, spawn, SHCMD("xbacklight -dec 5; kill -44 $(pidof dwmblocks)") },
+ { MODKEY, XK_F2, spawn, SHCMD("xbacklight -inc 5; kill -44 $(pidof dwmblocks)") },
+ { MODKEY, XK_p, spawn, SHCMD("sxiv -t ~/Pictures") },
+ { MODKEY, XK_a, spawn, BASHCMD("passmenu") },
+ { MODKEY, XK_F12, spawn, SHCMD("power") },
+ { MODKEY, XK_F4, spawn, SHCMD("galculator") },
{ MODKEY, XK_e, spawn, SHCMD("dmenuunicode") },
TAGKEYS( XK_1, 0)
TAGKEYS( XK_2, 1)
@@ -166,4 +169,3 @@ static Button buttons[] = {
{ ClkTagBar, MODKEY, Button1, tag, {0} },
{ ClkTagBar, MODKEY, Button3, toggletag, {0} },
};
-
diff --git a/dwm-6.3/config.mk b/dwm-6.3/config.mk
index 95d92c9..74256ad 100644
--- a/dwm-6.3/config.mk
+++ b/dwm-6.3/config.mk
@@ -28,7 +28,7 @@ LIBS = -L${X11LIB} -lX11 ${XINERAMALIBS} ${FREETYPELIBS} -lX11-xcb -lXrender -lx
# flags
CPPFLAGS = -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_POSIX_C_SOURCE=200809L -DVERSION=\"${VERSION}\" ${XINERAMAFLAGS}
#CFLAGS = -g -std=c99 -pedantic -Wall -O0 ${INCS} ${CPPFLAGS}
-CFLAGS = -std=c99 -pedantic -Wall -Wno-deprecated-declarations -Os ${INCS} ${CPPFLAGS}
+CFLAGS = -std=c99 -pedantic -Wall -Wno-deprecated-declarations -Ofast ${INCS} ${CPPFLAGS}
LDFLAGS = ${LIBS}
# Solaris
diff --git a/dwm-6.3/dwm.c b/dwm-6.3/dwm.c
index 87ef17c..b9d29c3 100644
--- a/dwm-6.3/dwm.c
+++ b/dwm-6.3/dwm.c
@@ -872,9 +872,10 @@ drawbar(Monitor *m)
drw_setscheme(drw, scheme[m->tagset[m->seltags] & 1 << i ? SchemeSel : SchemeNorm]);
drw_text(drw, x, 0, w, bh, lrpad / 2, tags[i], urg & 1 << i);
if (occ & 1 << i)
- drw_rect(drw, x + boxs, boxs, boxw, boxw,
- m == selmon && selmon->sel && selmon->sel->tags & 1 << i,
- urg & 1 << i);
+ drw_rect(drw, x + boxw, 0, w - ( 2 * boxw + 1), boxw,
+ m == selmon && selmon->sel && selmon->sel->tags & 1 << i,
+ urg & 1 << i);
+
x += w;
}
w = blw = TEXTW(m->ltsymbol);
diff --git a/dwm-6.3/patches/dwm-activetagindicatorbar-6.2.diff b/dwm-6.3/patches/dwm-activetagindicatorbar-6.2.diff
new file mode 100644
index 0000000..4450099
--- /dev/null
+++ b/dwm-6.3/patches/dwm-activetagindicatorbar-6.2.diff
@@ -0,0 +1,17 @@
+diff -up dwm-a/dwm.c dwm-b/dwm.c
+--- dwm-a/dwm.c 2019-02-02 06:55:28.000000000 -0600
++++ dwm-b/dwm.c 2019-02-23 21:43:13.359179100 -0600
+@@ -719,9 +719,10 @@ drawbar(Monitor *m)
+ drw_setscheme(drw, scheme[m->tagset[m->seltags] & 1 << i ? SchemeSel : SchemeNorm]);
+ drw_text(drw, x, 0, w, bh, lrpad / 2, tags[i], urg & 1 << i);
+ if (occ & 1 << i)
+- drw_rect(drw, x + boxs, boxs, boxw, boxw,
+- m == selmon && selmon->sel && selmon->sel->tags & 1 << i,
+- urg & 1 << i);
++ drw_rect(drw, x + boxw, 0, w - ( 2 * boxw + 1), boxw,
++ m == selmon && selmon->sel && selmon->sel->tags & 1 << i,
++ urg & 1 << i);
++
+ x += w;
+ }
+ w = blw = TEXTW(m->ltsymbol);
diff --git a/dwm-6.3/scripts/passmenu b/dwm-6.3/scripts/passmenu
new file mode 100755
index 0000000..76d92ab
--- /dev/null
+++ b/dwm-6.3/scripts/passmenu
@@ -0,0 +1,35 @@
+#!/usr/bin/env bash
+
+shopt -s nullglob globstar
+
+typeit=0
+if [[ $1 == "--type" ]]; then
+ typeit=1
+ shift
+fi
+
+if [[ -n $WAYLAND_DISPLAY ]]; then
+ dmenu=dmenu-wl
+ xdotool="ydotool type --file -"
+elif [[ -n $DISPLAY ]]; then
+ dmenu=dmenu
+ xdotool="xdotool type --clearmodifiers --file -"
+else
+ echo "Error: No Wayland or X11 display detected" >&2
+ exit 1
+fi
+
+prefix=${PASSWORD_STORE_DIR-~/.password-store}
+password_files=( "$prefix"/**/*.gpg )
+password_files=( "${password_files[@]#"$prefix"/}" )
+password_files=( "${password_files[@]%.gpg}" )
+
+password=$(printf '%s\n' "${password_files[@]}" | "$dmenu" "$@")
+
+[[ -n $password ]] || exit
+
+if [[ $typeit -eq 0 ]]; then
+ pass show -c "$password" 2>/dev/null
+else
+ pass show "$password" | { IFS= read -r pass; printf %s "$pass"; } | $xdotool
+fi
diff --git a/dwm-6.3/scripts/passmenu2 b/dwm-6.3/scripts/passmenu2
deleted file mode 100755
index 3847219..0000000
--- a/dwm-6.3/scripts/passmenu2
+++ /dev/null
@@ -1,60 +0,0 @@
-#!/usr/bin/env bash
-
-shopt -s nullglob globstar
-
-typeit=0
-if [[ $1 == "--type" ]]; then
- typeit=1
- shift
-fi
-
-
-STARTDIR=${PASSWORD_STORE_DIR-~/.password-store}
-BASEDIR=$STARTDIR
-DONE=0
-LEVEL=0
-PREVSELECTION=""
-SELECTION=""
-
-while [ "$DONE" -eq 0 ] ; do
- password_files=( "$STARTDIR"/* )
- password_files=( "${password_files[@]#"$STARTDIR"/}" )
- password_files=( "${password_files[@]%.gpg}" )
-
- if [ "$LEVEL" -ne 0 ] ; then
- password_files=(".." "${password_files[@]}")
- fi
- entry=$(printf '%s\n' "${password_files[@]}" | dmenu "$@" -l 15)
-
- echo "entry: $entry"
- if [ -z "$entry" ] ; then
- DONE=1
- exit
- fi
-
- if [ "$entry" != ".." ] ; then
- PREVSELECTION=$SELECTION
- SELECTION="$SELECTION/$entry"
-
- # check if another dir
- if [ -d "$STARTDIR/$entry" ] ; then
- STARTDIR="$STARTDIR/$entry"
- LEVEL=$((LEVEL+1))
- else
- # not a directory so it must be a real password entry
-
- if [[ $typeit -eq 0 ]]; then
- pass show -c "$SELECTION" 2>/dev/null
- else
- xdotool - <<<"type --clearmodifiers -- $(pass show "$SELECTION" | head -n 1)"
- fi
- DONE=1
- fi
-
- else
- LEVEL=$((LEVEL-1))
- SELECTION=$PREVSELECTION
- STARTDIR="$BASEDIR/$SELECTION"
- fi
-done
-
diff --git a/dwm-6.3/scripts/power b/dwm-6.3/scripts/power
new file mode 100755
index 0000000..d376fa9
--- /dev/null
+++ b/dwm-6.3/scripts/power
@@ -0,0 +1,8 @@
+#!/bin/sh
+# A dmenu wrapper script for system functions.
+
+case "$(printf "🔃 reboot\n🖥️shutdown\n" | dmenu -i -p 'Power: ')" in
+ '🔃 reboot') sudo reboot ;;
+ '🖥️shutdown') sudo poweroff ;;
+ *) exit 1 ;;
+esac
diff --git a/dwm-6.3/vanitygaps.c b/dwm-6.3/vanitygaps.c
index 3f31593..d81f8c6 100644
--- a/dwm-6.3/vanitygaps.c
+++ b/dwm-6.3/vanitygaps.c
@@ -1,13 +1,3 @@
-/* Key binding functions */
-static void defaultgaps(const Arg *arg);
-static void incrgaps(const Arg *arg);
-static void incrigaps(const Arg *arg);
-static void incrogaps(const Arg *arg);
-static void incrohgaps(const Arg *arg);
-static void incrovgaps(const Arg *arg);
-static void incrihgaps(const Arg *arg);
-static void incrivgaps(const Arg *arg);
-static void togglegaps(const Arg *arg);
/* Layouts (delete the ones you do not need) */
static void bstack(Monitor *m);
static void bstackhoriz(Monitor *m);
@@ -46,100 +36,6 @@ setgaps(int oh, int ov, int ih, int iv)
}
void
-togglegaps(const Arg *arg)
-{
- #if PERTAG_PATCH
- selmon->pertag->enablegaps[selmon->pertag->curtag] = !selmon->pertag->enablegaps[selmon->pertag->curtag];
- #else
- enablegaps = !enablegaps;
- #endif // PERTAG_PATCH
- arrange(NULL);
-}
-
-void
-defaultgaps(const Arg *arg)
-{
- setgaps(gappoh, gappov, gappih, gappiv);
-}
-
-void
-incrgaps(const Arg *arg)
-{
- setgaps(
- selmon->gappoh + arg->i,
- selmon->gappov + arg->i,
- selmon->gappih + arg->i,
- selmon->gappiv + arg->i
- );
-}
-
-void
-incrigaps(const Arg *arg)
-{
- setgaps(
- selmon->gappoh,
- selmon->gappov,
- selmon->gappih + arg->i,
- selmon->gappiv + arg->i
- );
-}
-
-void
-incrogaps(const Arg *arg)
-{
- setgaps(
- selmon->gappoh + arg->i,
- selmon->gappov + arg->i,
- selmon->gappih,
- selmon->gappiv
- );
-}
-
-void
-incrohgaps(const Arg *arg)
-{
- setgaps(
- selmon->gappoh + arg->i,
- selmon->gappov,
- selmon->gappih,
- selmon->gappiv
- );
-}
-
-void
-incrovgaps(const Arg *arg)
-{
- setgaps(
- selmon->gappoh,
- selmon->gappov + arg->i,
- selmon->gappih,
- selmon->gappiv
- );
-}
-
-void
-incrihgaps(const Arg *arg)
-{
- setgaps(
- selmon->gappoh,
- selmon->gappov,
- selmon->gappih + arg->i,
- selmon->gappiv
- );
-}
-
-void
-incrivgaps(const Arg *arg)
-{
- setgaps(
- selmon->gappoh,
- selmon->gappov,
- selmon->gappih,
- selmon->gappiv + arg->i
- );
-}
-
-void
getgaps(Monitor *m, int *oh, int *ov, int *ih, int *iv, unsigned int *nc)
{
unsigned int n, oe, ie;
@@ -806,4 +702,4 @@ tile(Monitor *m)
resize(c, sx, sy, sw - (2*c->bw), (sh / sfacts) + ((i - m->nmaster) < srest ? 1 : 0) - (2*c->bw), 0);
sy += HEIGHT(c) + ih;
}
-} \ No newline at end of file
+}