summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile2
-rw-r--r--config.h4
-rw-r--r--scripts/powermenu8
3 files changed, 13 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index e361c44..2ada908 100644
--- a/Makefile
+++ b/Makefile
@@ -43,6 +43,8 @@ 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
+ cp -f scripts/* ${DESTDIR}${PREFIX}/bin
+ chmod 755 ${DESTDIR}${PREFIX}/bin/powermenu
uninstall:
rm -f ${DESTDIR}${PREFIX}/bin/dwm\
diff --git a/config.h b/config.h
index 9e3af4d..234d8e2 100644
--- a/config.h
+++ b/config.h
@@ -60,7 +60,8 @@ 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 *dmenunmcmd[] = { "networkmanager_dmenu", NULL };
+static const char *dmenunmcmd[] = { "sudo", "networkmanager_dmenu", NULL };
+static const char *dmenupmcmd[] = { "sudo", "powermenu", NULL };
static const char *termcmd[] = { "st", NULL };
static const char *browsercmd[] = { "firefox", NULL };
static const char *volup[] = { "pactl", "set-sink-volume", "1", "+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/scripts/powermenu b/scripts/powermenu
new file mode 100644
index 0000000..027d513
--- /dev/null
+++ b/scripts/powermenu
@@ -0,0 +1,8 @@
+#!/bin/sh
+case "$(echo "Poweroff \nReboot ﰇ\nSuspend ⏾\nCancel ﰸ" | dmenu)" in
+ "Poweroff ") sudo poweroff ;;
+ "Reboot ﰇ") sudo reboot ;;
+ "Suspend ⏾") sudo ZZZ -z ;;
+ "Cancel ﰸ") exit ;;
+ *) exit ;;
+esac