You are not logged in.

#1 2013-11-06 22:13:17

szebenyib
Member
From: LHBP
Registered: 2011-10-18
Posts: 75

Gnome3 Lock the screen via commandline, cli

Is it possible to lock gnome 3.10 from the cli? I really cannot find anything via google but it would be important for me as I want to lock and suspend gnome by one key combination.
Gnome-screensaver is non-existent. Tried gdm, but it has no man so I have no clue how to solve this.

Offline

#2 2013-11-06 22:52:52

cris9288
Member
Registered: 2013-01-07
Posts: 348

Re: Gnome3 Lock the screen via commandline, cli

When I was using mate, there was a command called mate-session-save something or other, and it served as a logout command. There were some other options, but I can't remember what they were. My point is that there may be a gnome-session-* command. Do you have tab completion? Try and see what comes up when you try and tab-complete gnome-session. If not try and grep the contents of /usr/bin for gnome-session

Offline

#3 2013-11-07 15:29:41

szebenyib
Member
From: LHBP
Registered: 2011-10-18
Posts: 75

Re: Gnome3 Lock the screen via commandline, cli

No luck unfortunately. I have tab completion however gnome-session has only: gnome-session, gnome-session-inhibit, gnome-session-properties, gnome-session-quit. They have man pages, I checked them but none of them offers anything like this.

Offline

#4 2013-11-07 15:44:09

WolleTD
Member
Registered: 2012-11-13
Posts: 70

Re: Gnome3 Lock the screen via commandline, cli

The lockscreen is called by gnome-screensaver

Offline

#5 2013-11-07 17:18:31

szebenyib
Member
From: LHBP
Registered: 2011-10-18
Posts: 75

Re: Gnome3 Lock the screen via commandline, cli

There is no gnome screensaver anymore. As I have read it is provided by gdm somehow. That's why I don't know what to do.

Offline

#6 2013-11-07 17:38:29

KingYes
Member
From: Israel
Registered: 2011-05-08
Posts: 120
Website

Re: Gnome3 Lock the screen via commandline, cli

Do that:

dbus-send --session --dest=org.gnome.ScreenSaver --type=method_call --print-reply --reply-timeout=20000 /org/gnome/ScreenSaver org.gnome.ScreenSaver.SetActive boolean:true                                       
method return sender=:1.1081 -> dest=:1.1192 reply_serial=2

Have fun ;]


Web Developer.

Offline

#7 2013-11-07 18:41:58

szebenyib
Member
From: LHBP
Registered: 2011-10-18
Posts: 75

Re: Gnome3 Lock the screen via commandline, cli

You Sir are a genious! smile
It works, although it does not lock the screen, the screen saver comes in immediately, but locking won't happen (or at least not in a minute) for me. Do you happen to know how to achieve that?

Offline

#8 2013-11-10 12:32:57

orschiro
Member
Registered: 2009-06-04
Posts: 2,136
Website

Re: Gnome3 Lock the screen via commandline, cli

Why not simply using slock, xscreensaver or any other lockscreen app?

Offline

#9 2013-11-10 12:40:09

szebenyib
Member
From: LHBP
Registered: 2011-10-18
Posts: 75

Re: Gnome3 Lock the screen via commandline, cli

Well, I like the look of it. ;-)

Offline

Board footer

Powered by FluxBB