physlock icon indicating copy to clipboard operation
physlock copied to clipboard

Allow running of arbitrary commands before and after authentication

Open dexterlb opened this issue 5 years ago • 6 comments

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 :)

dexterlb avatar Jun 02 '19 15:06 dexterlb

You should add the new flags to print_usage().

googleson78 avatar Jun 03 '19 15:06 googleson78

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?

jluttine avatar Sep 30 '19 07:09 jluttine

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

jluttine avatar Oct 01 '19 09:10 jluttine

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.

travankor avatar Feb 03 '20 10:02 travankor

Hi @DexterLB! I packaged your fork to the AUR. Would you be willing to do a rebase on your fork?

Barbaross93 avatar Feb 09 '21 01:02 Barbaross93

Hi @DexterLB! I packaged your fork to the AUR. Would you be willing to do a rebase on your fork?

It has been done!

dexterlb avatar Feb 09 '21 14:02 dexterlb