From d9747b64e1e62abee12ef0bafd365cf380ff7fe9 Mon Sep 17 00:00:00 2001 From: Ultrabug Date: Sun, 23 Nov 2014 20:55:53 +0100 Subject: move modules folder so we can install it as a module of py3status --- modules/whoami.py | 26 -------------------------- 1 file changed, 26 deletions(-) delete mode 100644 modules/whoami.py (limited to 'modules/whoami.py') diff --git a/modules/whoami.py b/modules/whoami.py deleted file mode 100644 index f930991..0000000 --- a/modules/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) -- cgit v1.3