diff options
| author | ozpv <39195175+ozpv@users.noreply.github.com> | 2022-06-05 14:32:13 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-06-05 14:32:13 -0500 |
| commit | e68ba677432cf0ac70e91347f3dfa20f700c8fd7 (patch) | |
| tree | 4c1fb81cef4d1c2f8b74910a6f90ea87b24c386d | |
| parent | ab8c4738fe4bc6c2eb2f60e5df07ffcbeeb14e62 (diff) | |
add powermenu back
| -rw-r--r-- | Makefile | 2 | ||||
| -rw-r--r-- | config.h | 4 | ||||
| -rw-r--r-- | scripts/powermenu | 8 |
3 files changed, 13 insertions, 1 deletions
@@ -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\ @@ -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 |
