summaryrefslogtreecommitdiff
path: root/dwm-6.3
diff options
context:
space:
mode:
authorstkhan <personal@slickd.xyz>2022-04-08 09:06:03 -0800
committerstkhan <personal@slickd.xyz>2022-04-08 09:06:03 -0800
commitdf966cab682c913e8b62b460c9ef900e1046863f (patch)
tree99c5f7363f91fdfcd7cd37ebcd6e51d185073759 /dwm-6.3
parent356b726ec5ac1d6796cfb5ca6171d20b4d0783a1 (diff)
Added dwmblocks scripts, sxiv, and modified dwm bindings
Diffstat (limited to 'dwm-6.3')
-rw-r--r--dwm-6.3/config.h31
-rwxr-xr-xdwm-6.3/scripts/dmenuunicode18
-rwxr-xr-xdwm-6.3/scripts/passmenu260
3 files changed, 90 insertions, 19 deletions
diff --git a/dwm-6.3/config.h b/dwm-6.3/config.h
index ec0ebed..bfd6e8d 100644
--- a/dwm-6.3/config.h
+++ b/dwm-6.3/config.h
@@ -45,7 +45,7 @@ static const Rule rules[] = {
/* 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 },
+ { "st", NULL, NULL, 0, 0, 1, 0, -1 },
{ NULL, NULL, "Event Tester", 0, 0, 0, 1, -1 }, /* xev */
};
@@ -86,7 +86,7 @@ static const Layout layouts[] = {
{ 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 } }
+#define SHCMD(cmd) { .v = (const char*[]){ "/bin/bash", "-c", cmd, NULL } }
#define STATUSBAR "dwmblocks"
@@ -107,22 +107,6 @@ static Key keys[] = {
{ MODKEY, XK_h, setmfact, {.f = -0.05} },
{ MODKEY, XK_l, setmfact, {.f = +0.05} },
{ MODKEY|ShiftMask, XK_Return, zoom, {0} },
- { MODKEY|Mod4Mask, XK_u, incrgaps, {.i = +1 } },
- { MODKEY|Mod4Mask|ShiftMask, XK_u, incrgaps, {.i = -1 } },
- { MODKEY|Mod4Mask, XK_i, incrigaps, {.i = +1 } },
- { MODKEY|Mod4Mask|ShiftMask, XK_i, incrigaps, {.i = -1 } },
- { MODKEY|Mod4Mask, XK_o, incrogaps, {.i = +1 } },
- { MODKEY|Mod4Mask|ShiftMask, XK_o, incrogaps, {.i = -1 } },
- { MODKEY|Mod4Mask, XK_6, incrihgaps, {.i = +1 } },
- { MODKEY|Mod4Mask|ShiftMask, XK_6, incrihgaps, {.i = -1 } },
- { MODKEY|Mod4Mask, XK_7, incrivgaps, {.i = +1 } },
- { MODKEY|Mod4Mask|ShiftMask, XK_7, incrivgaps, {.i = -1 } },
- { MODKEY|Mod4Mask, XK_8, incrohgaps, {.i = +1 } },
- { MODKEY|Mod4Mask|ShiftMask, XK_8, incrohgaps, {.i = -1 } },
- { MODKEY|Mod4Mask, XK_9, incrovgaps, {.i = +1 } },
- { MODKEY|Mod4Mask|ShiftMask, XK_9, incrovgaps, {.i = -1 } },
- { MODKEY|Mod4Mask, XK_0, togglegaps, {0} },
- { MODKEY|Mod4Mask|ShiftMask, XK_0, defaultgaps, {0} },
{ MODKEY, XK_Tab, view, {0} },
{ MODKEY, XK_x, killclient, {0} },
{ MODKEY, XK_t, setlayout, {.v = &layouts[0]} },
@@ -136,11 +120,20 @@ static Key keys[] = {
{ MODKEY, XK_period, focusmon, {.i = +1 } },
{ MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } },
{ MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } },
+ { 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, XK_r, spawn, SHCMD("get_weather") },
+ { 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_e, spawn, SHCMD("dmenuunicode") },
TAGKEYS( XK_1, 0)
TAGKEYS( XK_2, 1)
TAGKEYS( XK_3, 2)
diff --git a/dwm-6.3/scripts/dmenuunicode b/dwm-6.3/scripts/dmenuunicode
new file mode 100755
index 0000000..7d9a4ea
--- /dev/null
+++ b/dwm-6.3/scripts/dmenuunicode
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+# The famous "get a menu of emojis to copy" script.
+
+# Get user selection via dmenu from emoji file.
+chosen=$(cut -d ';' -f1 ~/.local/share/larbs/emoji | dmenu -i -l 30 | sed "s/ .*//")
+
+# Exit if none chosen.
+[ -z "$chosen" ] && exit
+
+# If you run this command with an argument, it will automatically insert the
+# character. Otherwise, show a message that the emoji has been copied.
+if [ -n "$1" ]; then
+ xdotool type "$chosen"
+else
+ printf "$chosen" | xclip -selection clipboard
+ notify-send "'$chosen' copied to clipboard." &
+fi
diff --git a/dwm-6.3/scripts/passmenu2 b/dwm-6.3/scripts/passmenu2
new file mode 100755
index 0000000..3847219
--- /dev/null
+++ b/dwm-6.3/scripts/passmenu2
@@ -0,0 +1,60 @@
+#!/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
+