Skip to content

Instantly share code, notes, and snippets.

@1stvamp
Created March 12, 2010 13:39
Show Gist options
  • Save 1stvamp/330295 to your computer and use it in GitHub Desktop.
Save 1stvamp/330295 to your computer and use it in GitHub Desktop.
Lock both the current host and a remote (or multiple) host at the same time, useful for working with multiple machines using synergy
#!/bin/bash
# Replace <local_user> with your local username, <remote_user> with your username on <remote_host> etc.
# You'll need an SSH, <private_key>, setup with the remote host to not prompt for a password
# (either passphraseless or with ssh-agent running)
ssh -i /home/<local_user>/.ssh/<private_key> <remote_user>@<remote_host> "export DISPLAY=:0 && gnome-screensaver-command --lock"
gnome-screensaver-command --lock
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment