Skip to content

Instantly share code, notes, and snippets.

@annalinneajohansson
Last active February 8, 2020 02:36
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save annalinneajohansson/cf887aa1373505905e0b to your computer and use it in GitHub Desktop.
Save annalinneajohansson/cf887aa1373505905e0b to your computer and use it in GitHub Desktop.
Generate a xfce4 panel shortcut (.desktop file). Change "launcher-10" to whatever launcher is used.
#!/bin/bash
echo "Enter host (defined in ~/.ssh/config):"
read host
if [ -z "${host}" ]; then
echo "No host given. Exiting."
else
echo "Enter comment: "
read comment
cd ~/.config/xfce4/panel/launcher-10/
echo "[Desktop Entry]
Version=1.0
Type=Application
Name=ssh $host
Comment=$comment
Exec=x-terminal-emulator -e 'ssh $host'
Icon=utilities-terminal
Path=
Terminal=false
StartupNotify=true" > $host.desktop
echo "SSH shortcut ($host) created"
fi
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment