summaryrefslogtreecommitdiffstats
path: root/data/desktop/remmina-file-wrapper.in
blob: 571c3bf7e5ef6a3761dfd826c4c162a7df78d70f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
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