summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkrolxon <krolyxon@tutanota.com>2025-08-04 21:45:34 +0530
committerkrolxon <krolyxon@tutanota.com>2025-08-04 21:45:34 +0530
commite6a46d699b5dafa35ffb38ccdf5153d67f7348e4 (patch)
tree9a102d6ca8f129cf80181cb5120c5816e7c01d31
parent70249a2a89349d99b27d9b4f5c7ca84a463f9a3a (diff)
use rofi for SUDO_ASKPASS
-rw-r--r--.config/shell/profile2
-rwxr-xr-x.local/bin/dmenupass6
-rwxr-xr-x.local/bin/rofipass9
3 files changed, 10 insertions, 7 deletions
diff --git a/.config/shell/profile b/.config/shell/profile
index c290ffa..3a5955b 100644
--- a/.config/shell/profile
+++ b/.config/shell/profile
@@ -32,7 +32,7 @@ export MYSQL_HISTFILE="$XDG_CACHE_HOME/.mariadb_history"
export CUDA_CACHE_PATH="$XDG_CACHE_HOME/nv"
# Other program settings
-export SUDO_ASKPASS="$HOME/.local/bin/dmenupass"
+export SUDO_ASKPASS="$HOME/.local/bin/rofipass"
export FZF_DEFAULT_OPTS="--layout=reverse --height 40%"
export ANDROID_SDK_HOME="${XDG_CONFIG_HOME:-$HOME/.config}/android"
export ANDROID_HOME="$HOME/Android/Sdk/"
diff --git a/.local/bin/dmenupass b/.local/bin/dmenupass
deleted file mode 100755
index b8e2f1b..0000000
--- a/.local/bin/dmenupass
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/sh
-
-# This script is the SUDO_ASKPASS variable, meaning that it will be used as a
-# password prompt if needed.
-
-dmenu -P -p "$1" <&- && echo
diff --git a/.local/bin/rofipass b/.local/bin/rofipass
new file mode 100755
index 0000000..b1bf6a3
--- /dev/null
+++ b/.local/bin/rofipass
@@ -0,0 +1,9 @@
+#!/bin/sh
+#
+# Take password prompt from STDIN, print password to STDOUT
+# the sed piece just removes the colon from the provided
+# prompt: rofi -p already gives us a colon
+rofi -dmenu \
+ -password \
+ -no-fixed-num-lines \
+ -p "$(printf "$1" | sed s/://)"