diff options
Diffstat (limited to 'webtrayctl')
| -rwxr-xr-x | webtrayctl | 36 |
1 files changed, 28 insertions, 8 deletions
@@ -65,38 +65,54 @@ remove_webapp() { exit } +show() { + host=$(echo "$1" | sed 's/^https\?:\/\/\([^/]*\).*$/\1/') + dbus-send \ + --dest="xyz.nathanreiner.WebTray.$host" \ + --type=method_call \ + --print-reply \ + '/' \ + local.webtray.DBusHandler.show > /dev/null \ + || setsid webtray "$1" --open-at-startup & +} + while true do case "$1" in install) action="install" - shift + shift 2>/dev/null url="$1" name="$2" - shift 2 + shift 2 2>/dev/null ;; uninstall) action="uninstall" - shift + shift 2>/dev/null toRemove="$1" - shift + shift 2>/dev/null ;; "--open-at-startup") open_at_startup="--open-at-startup" - shift + shift 2>/dev/null ;; "--icon") - shift + shift 2>/dev/null icon="$1" [ -z "$1" ] && help - shift + shift 2>/dev/null + ;; + show) + action="show" + shift 2>/dev/null + url="$1" + shift 2>/dev/null ;; *)help;; esac if [ -z "$1" ]; then break fi - #shift 1 || break done case "$action" in @@ -108,5 +124,9 @@ case "$action" in [ -z "$toRemove" ] && help remove_webapp "$toRemove" ;; + show) + [ -z "$url" ] && help + show "$url" + ;; *)help;; esac |