A display synchronization tool that keeps your remote display's screen lock state in sync with your local machine. When your local screen locks or unlocks, the remote display follows suit.
- Automatic Sync: Monitors local screen lock/unlock events and syncs them to a remote machine
- Manual Control: Toggle remote display state with a single command or dock button
- SSH-based: Uses SSH for secure remote control
- Systemd Integration: Runs as a systemd service for automatic startup
- Cluster Deskflow Restart: One-click restart of the Deskflow Flatpak on all configured hosts
scripts/sync-lock.sh- Main monitoring script that watches for screen lock/unlock eventsscripts/display-on.sh- Turns on the remote display(s)scripts/display-off.sh- Turns off the remote display(s)scripts/display-toggle.sh- Manually toggles the remote display statescripts/spotify-shortcut.sh- Sends keyboard shortcut to remote machine(s) (Ctrl+Shift+Space)scripts/deskflow-restart.sh- Restarts the Deskflow Flatpak on all configured hosts in their active graphical sessionscripts/ssh-config-parser.sh- Parses SSH config file to extract host information
- The
sync-lock.shscript monitors D-Bus events for screen lock/unlock changes - When a lock/unlock event is detected, it SSH's to all configured remote machines
- The
ssh-config-parser.shscript reads your SSH config to get connection details (hostname, user, identity file, port, etc.) - On each remote machine, it uses
gnome-screensaver-commandto control the display state - The systemd service keeps the sync script running continuously
- All configured hosts are synchronized simultaneously
-
Copy the example configuration:
cp config.example config
-
Edit
configand set your remote hosts:REMOTE_HOSTS="jellyfin server2"Make sure these host aliases exist in your
~/.ssh/configfile. -
Run the install script:
sudo ./install.sh
-
Enable and start the service:
sudo systemctl enable system-cluster-sync-lock.service sudo systemctl start system-cluster-sync-lock.service
./scripts/display-toggle.sh./scripts/display-on.sh./scripts/display-off.shThe install.sh script automatically installs .desktop launchers for:
- Toggle cluster displays →
scripts/display-toggle.sh - Restart cluster Deskflow →
scripts/deskflow-restart.sh
These launchers are written to:
~/.local/share/applications/system-cluster-sync-lock-toggle.desktop
~/.local/share/applications/system-cluster-deskflow-restart.desktopOn GNOME, the installer also makes a best-effort attempt to pin both launchers to the dash by adding them to org.gnome.shell favorite-apps. If that does not take effect (e.g. non-GNOME desktop or no running session), you can still search for them in your app grid and add them to favorites manually.
- Local Machine: Linux with D-Bus and
gdbuscommand - Remote Machine(s): Linux with GNOME screensaver (
gnome-screensaver-command) installed and available inPATH - SSH: Key-based SSH authentication configured to remote machine
- Systemd: For running as a service (optional, can run manually)
- Deskflow (optional): Flatpak
org.deskflow.deskflowinstalled on each host where you want to usedeskflow-restart.sh
Edit the config file to customize the remote hosts and connection settings.
The tool supports multiple remote hosts using SSH config file entries:
# Remote hosts: Space or comma-separated list of SSH config host aliases
REMOTE_HOSTS="jellyfin server2 server3"
# Optional: Path to SSH config file (defaults to ~/.ssh/config)
# SSH_CONFIG="$HOME/.ssh/config"Your ~/.ssh/config should contain entries like:
Host jellyfin
HostName 192.168.1.60
User jellyfin
IdentityFile ~/.ssh/jellyfin
Port 22
Host server2
HostName 192.168.1.61
User admin
IdentityFile ~/.ssh/server2_keyThe tool will automatically extract:
HostName- The actual hostname/IPUser- SSH usernameIdentityFile- SSH private key pathPort- SSH port (if specified)ProxyJump- Proxy jump configuration (if specified)
sudo systemctl status system-cluster-sync-lock.servicesudo journalctl -u system-cluster-sync-lock.service -fThis error means the remote machine does not have GNOME Screensaver (and its CLI gnome-screensaver-command) installed or available in PATH.
-
On Arch/Manjaro:
sudo pacman -S gnome-screensaver
-
On Debian/Ubuntu:
sudo apt install gnome-screensaver
Make sure this is installed on every host listed in REMOTE_HOSTS (e.g. tower, jellyfin, etc.), and that the GNOME session/screensaver is running on those machines.
Test SSH connection using the host alias from your SSH config:
ssh jellyfin 'gnome-screensaver-command -q'# Test if a host is found in SSH config
cd ~/repos/system-cluster-sync-lock
source scripts/ssh-config-parser.sh
parse_ssh_config jellyfinMIT