use rofi for SUDO_ASKPASS

This commit is contained in:
krolxon 2025-08-04 21:45:34 +05:30
parent 70249a2a89
commit e6a46d699b
3 changed files with 10 additions and 7 deletions

View File

@ -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/"

View File

@ -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

9
.local/bin/rofipass Executable file
View File

@ -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/://)"