diff options
| author | Ultrabug <ultrabug@gentoo.org> | 2014-05-03 19:36:39 +0200 |
|---|---|---|
| committer | Ultrabug <ultrabug@gentoo.org> | 2014-05-03 19:36:39 +0200 |
| commit | d9f15faaf6a61380a51c99349932718a181513f4 (patch) | |
| tree | dd19e9acbef005b1d920f9f4b2c45caae14b2dd3 /examples/whoami.py | |
| parent | 280a383cc84b048a686d4ac573e001a9b7891c46 (diff) | |
rename examples folder to the modules and prepare for installation
Diffstat (limited to 'examples/whoami.py')
| -rw-r--r-- | examples/whoami.py | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/examples/whoami.py b/examples/whoami.py deleted file mode 100644 index f930991..0000000 --- a/examples/whoami.py +++ /dev/null @@ -1,26 +0,0 @@ -from getpass import getuser -from time import time - - -class Py3status: - """ - Simply output the currently logged in user in i3bar. - - Inspired by i3 FAQ: - https://faq.i3wm.org/question/1618/add-user-name-to-status-bar/ - """ - def whoami(self, i3status_output_json, i3status_config): - """ - We use the getpass module to get the current user. - """ - # the current user doesnt change so much, cache it good - CACHE_TIMEOUT = 600 - - # here you can change the format of the output - # default is just to show the username - username = '{}'.format(getuser()) - - # set, cache and return the output - response = {'full_text': username, 'name': 'whoami'} - response['cached_until'] = time() + CACHE_TIMEOUT - return (0, response) |
