summaryrefslogtreecommitdiffstats
path: root/modules/current-keyboard-layout.py
diff options
context:
space:
mode:
authorUltrabug <ultrabug@gentoo.org>2014-05-26 19:12:26 +0200
committerUltrabug <ultrabug@gentoo.org>2014-05-26 19:12:26 +0200
commitf4a2a2cb22770f298c13904f05049f0c17c8c3c0 (patch)
tree42cc4aeaf9f10ee882b045b2f72dfe13ccd10557 /modules/current-keyboard-layout.py
parentb4eb295800916915b6188114b4df8fadd0165676 (diff)
rename current-keyboard-layout to keyboard-layout, PEP8 cleanup, implement check using setxkbmap for maximal compatibility, add french coloring
Diffstat (limited to 'modules/current-keyboard-layout.py')
-rw-r--r--modules/current-keyboard-layout.py33
1 files changed, 0 insertions, 33 deletions
diff --git a/modules/current-keyboard-layout.py b/modules/current-keyboard-layout.py
deleted file mode 100644
index 046a2aa..0000000
--- a/modules/current-keyboard-layout.py
+++ /dev/null
@@ -1,33 +0,0 @@
-import subprocess
-import time
-
-"""
-Module for showing current keyboard layout.
-DEPENDS ON xkblayout-state!
-
-@author shadowprince
-@version 1.0
-@license Eclipse Public License
-"""
-
-CACHE_TIME = 0.2 # maximum time to update indicator
-
-# colors of layouts
-# key must be compatible with xkblayout-state print %s!
-LANG_COLORS = {
- "ru": "#F75252",
- "us": "#729FCF",
- "ua": "#FCE94F",
- }
-
-class Py3status:
- def currentLayout(self, i3status_output_json, i3status_config):
- response = {'full_text': '', 'name': 'current-layout', 'cached_until': time.time()+CACHE_TIME}
- lang = subprocess.check_output(["xkblayout-state", "print", "%s"]).decode('utf-8')
-
- return (0, {
- "full_text": lang,
- "name": "current-layout",
- "cached_until": time.time() + CACHE_TIME,
- "color": LANG_COLORS.get(lang, "#ffffff"),
- })