11

How can I trigger the screen saver manually from the command line? I'm using GNOME 3.8.4 on Fedora 19, but the solution should not necessarily be specific to this distro.

  • dbus-send cammand use to send the meassage and imgsrc for picture – umer Aug 27 '18 at 10:15
13

The details on how to do this were found here in this blog post titled: Locking the screen from the command line in Gnome 3.8.

Manually triggering

The dbus-send command can be used to send this message, in this case we're sending the "Lock" message to the screensaver.

$ dbus-send --type=method_call --dest=org.gnome.ScreenSaver \
    /org/gnome/ScreenSaver org.gnome.ScreenSaver.Lock

Timeout

Typically this same message will be sent when you've configured for this particular timeout to occur through the desktop settings.

You can check the amount of idle time required before the locking will automatically get triggered, from the GNOME Control Center, Settings -> Power -> Blank Screen.

You can check the value of this delay from the command line like so:

$ gsettings get org.gnome.desktop.session idle-delay
uint32 600

Also you can change it via the command line, or through the GNOME Control Center.

$ gsettings set org.gnome.desktop.session idle-delay 300

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.