You are not logged in.
Hallo,
when i use e.g. trizen to compile an aur package or update the system there might be coming several sudo password requests during the process (actually 'sudo pacman'). Sometimes i do not notice them as they were running in the background and thus time out. How can i make these password requests give more feedback like an pcspkr beep for example? Is there something for the 'sudoers' file maybe? I neither want to swap the 'sudo' binary with a script (for security reasons) nor do i want to run trizen as root.
Last edited by Maniaxx (2019-12-26 21:18:31)
sys2064
Offline
sudo has the --beep option but there doesn't seem to be a way to make this always-on in the sudo configuration files
otherwise you could try to set up an askpass helper that beeps (or does anything else really)
you could also make an independent service that polls for waiting sudo processes and beeps ( while sleep 5; pidof sudo && beep; done )
Offline
Alter the promt and have it include '\a' - you can use "man sudoers" or "man sudo" (there's an environment)
You could also alias sudo to sth. like "beep; sudo" or whatever (eg. using notify-send)
Offline
nice, I missed the SUDO_PROMPT. That should be the best option.
$ export SUDO_PROMPT=$'\a'"[sudo] password for %p: "
$ sudo ...that's assuming your terminal actually beeps when it encounters \a
Offline
Thanks, that's working great. There is even something already for the sudoers file in the wiki.
Any ideas for visual feedback? Blinking terminal in taskbar, notification or something (xfce, gnome-terminal)?
Last edited by Maniaxx (2019-12-27 20:35:46)
sys2064
Offline
https://bugzilla.gnome.org/show_bug.cgi?id=557593 and I would be "surprised" if the sudo prompt could execute random commands
:-(
On the upside, maybe you can gain interest in a better TE ![]()
Offline
Then start acting surprised.
$ export SUDO_PROMPT="$(ls /)[sudo] password for %p: "
$ sudo pacman -Syu
boot/
dev/
etc/
home/
lost+found/
mnt/
opt/
proc/
root/
run/
srv/
sys/
tmp/
usr/
var/
bin@
lib@
lib64@
sbin@[sudo] password for jmcclure:"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
I can't reason why, but this feels wrong (or bad)
However you can then oc. use xdotool or wmctrl to activate the window (and have the WM set it urgent if it's not supposed to get the focus right now)
Offline
@Trilby: that executes the command at the time of setting the variable, not at the time of calling sudo ...?
Offline
Hmm, yes, it seems you are right. Sorry ... nevermind my last post.
PS1 is evaluated at each prompt - so one can put such things there, but SUDO_PROMPT doesn't seem to be.
Last edited by Trilby (2019-12-28 00:04:43)
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline