Skip to content

Instantly share code, notes, and snippets.

@dln
Created March 12, 2024 16:43
Show Gist options
  • Save dln/9ec1f4e6a0e842359fcb2a9cf4ddf29c to your computer and use it in GitHub Desktop.
Save dln/9ec1f4e6a0e842359fcb2a9cf4ddf29c to your computer and use it in GitHub Desktop.
_config_systemd_user_opener@.service
Host dln-dev
RemoteForward ${XDG_RUNTIME_DIR}/opener.sock ${XDG_RUNTIME_DIR}/opener.dln-dev.sock
[Unit]
Description=Open URL in your local web browser from the SSH-connected remote environment.
[Service]
Restart=always
Environment=OPENER_CONF=%t/opener.%i.conf
ExecStart=/bin/sh -c 'echo "address: %t/opener.%i.sock" > $OPENER_CONF && exec %h/bin/opener --config $OPENER_CONF'
[Install]
WantedBy=graphical-session.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment