summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorozpv <39195175+ozpv@users.noreply.github.com>2022-05-26 18:34:21 -0500
committerGitHub <noreply@github.com>2022-05-26 18:34:21 -0500
commitf350fb79a86cc98ac39dcb9eae408517e8f4c7ad (patch)
tree7d4e96ee7d6f950d40344a82e27740986ceb1cf8
parent844185224e5f39d6ead1e9bdec30d5dda4e91518 (diff)
update
-rw-r--r--Makefile4
-rw-r--r--config.h4
-rw-r--r--config.mk1
-rw-r--r--scripts/powermenu.sh6
4 files changed, 14 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 77bcbc0..9ebcc8c 100644
--- a/Makefile
+++ b/Makefile
@@ -43,9 +43,13 @@ install: all
mkdir -p ${DESTDIR}${MANPREFIX}/man1
sed "s/VERSION/${VERSION}/g" < dwm.1 > ${DESTDIR}${MANPREFIX}/man1/dwm.1
chmod 644 ${DESTDIR}${MANPREFIX}/man1/dwm.1
+ mkdir -p $(DESTDIR)$(USRHOME)/.config/dwm/
+ cp -r scripts/* $(DESTDIR)$(USRHOME)/.config/dwm/
+ chmod 0755 $(DESTDIR)$(USRHOME)/.config/dwm/powermenu.sh
uninstall:
rm -f ${DESTDIR}${PREFIX}/bin/dwm\
${DESTDIR}${MANPREFIX}/man1/dwm.1
+ rm -rf $(DESTDIR)$(USRHOME)/.config/dwm
.PHONY: all options clean dist install uninstall
diff --git a/config.h b/config.h
index 4e77fbb..9a16f25 100644
--- a/config.h
+++ b/config.h
@@ -60,8 +60,9 @@ static const Layout layouts[] = {
/* 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 *dmenupmcmd[] = { "sh", "/home/ozpv/.config/dwm/powermenu.sh", NULL };
static const char *dmenunmcmd[] = { "networkmanager_dmenu", NULL };
+static const char *termcmd[] = { "st", NULL };
static const char *browsercmd[] = { "firefox", NULL };
static const char *volup[] = { "pactl", "set-sink-volume", "0", "+10%", NULL };
static const char *voldown[] = { "pactl", "set-sink-volume", "0", "-10%", NULL };
@@ -103,6 +104,7 @@ static Key keys[] = {
TAGKEYS( XK_8, 7)
TAGKEYS( XK_9, 8)
+ { MODKEY, XK_q, spawn, {.v = dmenupmcmd } },
{ MODKEY|ShiftMask, XK_q, quit, {0} },
};
diff --git a/config.mk b/config.mk
index 81c493e..79a8edd 100644
--- a/config.mk
+++ b/config.mk
@@ -4,6 +4,7 @@ VERSION = 6.3
# Customize below to fit your system
# paths
+USRHOME ?= /home/ozpv
PREFIX = /usr/local
MANPREFIX = ${PREFIX}/share/man
diff --git a/scripts/powermenu.sh b/scripts/powermenu.sh
new file mode 100644
index 0000000..5b561a6
--- /dev/null
+++ b/scripts/powermenu.sh
@@ -0,0 +1,6 @@
+case "$(echo -e "Poweroff \nReboot ﰇ\nSuspend ⏾\nCancel ﰸ" | dmenu)" in
+ "Poweroff ") loginctl poweroff ;;
+ "Reboot ﰇ") loginctl reboot ;;
+ "Suspend ⏾") loginctl suspend ;;
+ "Cancel ﰸ") exit ;;
+esac