diff options
Diffstat (limited to 'data/desktop/remmina-file-wrapper.in')
-rwxr-xr-x | data/desktop/remmina-file-wrapper.in | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/data/desktop/remmina-file-wrapper.in b/data/desktop/remmina-file-wrapper.in new file mode 100755 index 0000000..571c3bf --- /dev/null +++ b/data/desktop/remmina-file-wrapper.in @@ -0,0 +1,56 @@ +#!/usr/bin/env bash +#=============================================================================== +# +# FILE: remmina-file-wrapper +# +# USAGE: ./remmina-file-wrapper +# +# DESCRIPTION: Wrapper used by xdg to connect or edit a remmina file clicking +# on it, or clicking to an URL like remmina:///profile.remmina +# +# OPTIONS: File path or URL +# REQUIREMENTS: --- +# BUGS: --- +# NOTES: --- +# AUTHOR: Antenore Gatta (tmow), antenore@simbiosi.org +# ORGANIZATION: Remmina +# CREATED: 15. 06. 19 00:32:11 +# REVISION: --- +# LICENSE: GPLv2 +#=============================================================================== + +set -o nounset # Treat unset variables as an error + +USRBIN="$(dirname "$(readlink -f "${0}")")" +REMMINA="@REMMINA_BINARY_PATH@" + +if [[ ! -f "$REMMINA" ]]; then + REMMINA="${USRBIN}/remmina" +fi + +if [[ ! -f "$REMMINA" ]]; then + REMMINA="remmina" +fi + +export GLADE_HOME="$USRBIN/../share/remmina/ui/" + +case "$@" in + *rdp:*) + "$REMMINA" "${@}" + ;; + *spice:*) + "$REMMINA" "${@}" + ;; + *vnc:*) + "$REMMINA" "${@}" + ;; + *ssh:*) + "$REMMINA" "${@}" + ;; + *remmina:*) + "$REMMINA" "${@#remmina:\/\/}" + ;; + *) + "$REMMINA" "${@}" + ;; +esac |