physlock
physlock copied to clipboard
Allow running of arbitrary commands before and after authentication
Let the user execute any command just before and after authenticating. This allows for things like printing a different prompt each time, showing something just after unlocking, etc - within physlock's VT.
As a bonus, add an option to not do any authentication at all - just execute the commands while having locked the screen. My personal favourite is running sl with no way whatsoever to interrupt it :)
You should add the new flags to print_usage()
.
Are the commands run as the user whose password is asked or as the user who launched physlock (typically root, I suppose)? In my opinion, it would be nice if those were run as the user whose password is asked. What do you think?
@DexterLB Thanks a lot for the changes, they are very helpful to me! Now, running the following command works and the before/after commands are executed as the normal user:
PATH="" /path/to/bin/sudo /path/to/bin/physlock -b '/path/to/bin/echo "Hello, `/path/to/bin/whoami`"' -a '/path/to/bin/echo "Bye, `/path/to/bin/whoami`!" && /path/to/bin/sleep 2'
It would be nice to have an option to execute a command after inactivity timeout. For example, go to sleep if physlock is called but no activity happens after a certain amount of time.
Hi @DexterLB! I packaged your fork to the AUR. Would you be willing to do a rebase on your fork?
Hi @DexterLB! I packaged your fork to the AUR. Would you be willing to do a rebase on your fork?
It has been done!