mirror of
https://github.com/olexsmir/dotfiles.git
synced 2026-01-15 08:41:34 +02:00
Delete not use, update config
This commit is contained in:
parent
25b4e80c8d
commit
73ebbfbe50
37 changed files with 163 additions and 1634 deletions
|
|
@ -1,23 +1,28 @@
|
|||
"""
|
||||
For working widget install `xkblayout`
|
||||
$ yay -S xkblayout
|
||||
"""
|
||||
from libqtile.widget import base
|
||||
import os
|
||||
|
||||
|
||||
class KBLayout(base.InLoopPollText):
|
||||
"""Widget for displaying the current keyboard layout
|
||||
It requires setxkbmap and xkblayout"""
|
||||
orientations = base.ORIENTATION_HORIZONTAL
|
||||
defaults = [
|
||||
("background", "#000000", "Backbround color"),
|
||||
("foreground", "#ffffff", "Foreground color"),
|
||||
]
|
||||
KBCMD = """
|
||||
case "$(xkblayout)" in
|
||||
"Eng") echo "us" ;;
|
||||
"Rus") echo "ru" ;;
|
||||
"Ukr") echo "ua" ;;
|
||||
esac
|
||||
"""
|
||||
|
||||
|
||||
class KBLayout(base.InLoopPollText):
|
||||
"""Widget for displaying the current keyboard layout"""
|
||||
orientations = base.ORIENTATION_HORIZONTAL
|
||||
def __init__(self, **config):
|
||||
base.InLoopPollText.__init__(self, **config)
|
||||
|
||||
def get_keyboard(self):
|
||||
kb = os.popen("xkblayout").read().rstrip("\n")
|
||||
return kb
|
||||
|
||||
def poll(self):
|
||||
kb = os.popen(".config/qtile/kblay.sh").read().rstrip('\n').encode('utf-8').decode('utf-8')
|
||||
kb = os.popen(KBCMD).read().rstrip('\n')\
|
||||
.encode('utf-8').decode('utf-8')
|
||||
|
||||
return kb
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue