You are not logged in.

#1 2016-11-07 01:46:12

timde9
Member
Registered: 2013-08-05
Posts: 15

any way to run script on Gnome lock screen activation?

I want to run a simple

 sudo -k 

when gnome lock screen is activated.  I usually lock my screen with the default 'Super + L' so my first instinct was to just map this command to that shortcut as well although it seems gnome will not allow two different shortcut actions to the same keys.

I know a while ago before the removal of gnome screensaver there was a way to do this however I am on the latest gnome 3.22 and cannot find anything on this topic.  Appreciate the input!

Offline

#2 2016-11-07 02:16:27

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,456
Website

Re: any way to run script on Gnome lock screen activation?

If you can bind a shell command to the key, just run both commands: don't create two bindings, just one binding for both commands:

sudo -k; screenWhateverCommand

"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#3 2016-11-07 09:02:08

timde9
Member
Registered: 2013-08-05
Posts: 15

Re: any way to run script on Gnome lock screen activation?

this is exactly my problem, after some thorough googling it appears there has not been a clearly documented way to execute the gnome lock screen from the command line since the removal of the gnome-screensaver.  just wondering if anyone has found a workaround to this?

*edit*
never mind it looks like the command was re-added and the information I was finding was outdated. thank you!  However I wish to know if it is possible to do something more complex now.  I have successfully established mounting an encrypted home partition on user login roughly following this wiki entry.

I wonder if I can now achieve the same effect when gnome lock screen is in effect, and I will post my findings.

Last edited by timde9 (2016-11-07 09:18:20)

Offline

Board footer

Powered by FluxBB