Recently Written · git

dmenu-scripts

Ask for things

git clone https://github.com/equwal/dmenu-scripts

Log | Files | Refs


commit 0b2fbaa0f9c6a1d3e42e2bb147ec160700136278
Spenser Truex <truex@equwal.com>
2025-09-01 19:36:52 -0400

dmenupass: ask for the sudo password as SUDO_ASKPASS

 README.md | 1 +
 dmenupass | 6 ++++++
 2 files changed, 7 insertions(+)
diff --git a/README.md b/README.md
index 2eb0d57..fd2337d 100644
--- a/README.md
+++ b/README.md
@@ -9,6 +9,7 @@ with that.
 - `dcpupower`: select CPU throttling settings
 - `ddmenu`: use dmenu to select a dmenu script -- dception
 - `dmenu_run/dsudo`: run programs, maybe from a keybind set with xbindkeys or a wm
+- `dmenupass`: ask for the sudo password as SUDO_ASKPASS
 - `dshow`:  run a command and show output without having to open a terminal
 - `dsysact`: reboot/shutdown/etc.
 - `passmenu`: unix [`pass`](https://www.passwordstore.org/) interface
diff --git a/dmenupass b/dmenupass
new file mode 100755
index 0000000..fa58159
--- /dev/null
+++ b/dmenupass
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+# This script is the SUDO_ASKPASS variable, meaning that it will be used as a
+# password prompt if needed.
+
+dmenu -p "$1" <&- && echo