diff options
| author | Tjaart van der Walt <github@tjaart.co.za> | 2015-05-23 19:31:02 -0500 |
|---|---|---|
| committer | Tjaart van der Walt <github@tjaart.co.za> | 2015-05-23 19:31:02 -0500 |
| commit | 5816fa6d6cef6998302ec1f01b3d16ca2b7d44b4 (patch) | |
| tree | 1003640ee654ac04954cd6c421930eb280c02a7f /py3status/modules/dropbox.py | |
| parent | 295d070044d8fecf579156d7e4f28eee72423532 (diff) | |
changed filename
Diffstat (limited to 'py3status/modules/dropbox.py')
| -rw-r--r-- | py3status/modules/dropbox.py | 47 |
1 files changed, 0 insertions, 47 deletions
diff --git a/py3status/modules/dropbox.py b/py3status/modules/dropbox.py deleted file mode 100644 index 1cd1532..0000000 --- a/py3status/modules/dropbox.py +++ /dev/null @@ -1,47 +0,0 @@ -# -*- coding: utf-8 -*- -""" -Display your dropbox status. - -Configuration parameters: - - format : Prefix text for the dropbox status - -Requires: - - the 'dropbox-cli' command - -@author Tjaart van der Walt (github:tjaartvdwalt) -@license GNU GPL http://www.gnu.org/licenses/gpl.html -""" -import subprocess - - -class Py3status: - format = "Dropbox: {}" - - def dropbox(self, i3status_output_json, i3status_config): - response = {} - - lines = subprocess.check_output(["dropbox-cli", "status"]).decode( - "utf-8").split("\n") - status = lines[0] - full_text = self.format.format(str(status)) - response['full_text'] = full_text - - if (status == "Dropbox isn't running!"): - response.update({'color': i3status_config['color_bad']}) - elif (status == "Up to date"): - response.update({'color': i3status_config['color_good']}) - else: - response.update({'color': i3status_config['color_degraded']}) - return response - -if __name__ == "__main__": - from time import sleep - x = Py3status() - config = { - 'color_bad': '#FF0000', - 'color_degraded': '#FFFF00', - 'color_good': '#00FF00' - } - while True: - print(x.dropbox([], config)) - sleep(1) |
