p-e-w / argos

Create GNOME Shell extensions in seconds

Home Page:https://extensions.gnome.org/extension/1176/argos/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Dropbox example

memeplex opened this issue · comments

I would like to contribute this super simple example that I find very useful as a substitute for the (now unsupported) dropbox systray icon:

#!/usr/bin/env bash

case $(dropbox-cli status) in
    "Up to date") echo "| iconName=dropboxstatus-idle" ;;
    "Syncing"*)   echo "| iconName=dropboxstatus-busy"
		  echo "| iconName=dropboxstatus-busy2" ;;
    *)            echo "| iconName=dropboxstatus-x" ;;
esac

Save it as dropbox.6s.sh and voila.

Here's an improved version

#!/usr/bin/env bash

message() {
    echo "| iconName=dropboxstatus-$1"
    echo "---"
    echo "Open folder | href=file:///home/carlos/Dropbox iconName=folder"
    echo "Visit site | href=https://www.dropbox.com iconName=network"
    [[ $1 == "x" ]] && echo "Restart | bash='dropbox-cli start' " \
			    "iconName=player_start terminal=false"
}
case $(dropbox-cli status) in
    "Up to date") message "idle" ;;
    "Syncing"*)   message "busy"; message "busy2" ;;
    *)            message "x" ;;
esac

Cool! Feel free to add this to the Wiki.