fix commit e85425c
This commit is contained in:
parent
097c42b5a8
commit
793b1be032
@ -1,7 +1,7 @@
|
|||||||
#!/bin/bash -xe
|
#!/bin/bash -xe
|
||||||
|
|
||||||
python3 --version
|
python3 --version
|
||||||
py.test --version
|
py.test-3.4 --version
|
||||||
python3 -mpep8 --version
|
python3 -mpep8 --version
|
||||||
|
|
||||||
# Target directory for all build files
|
# Target directory for all build files
|
||||||
@ -19,7 +19,7 @@ PYTHONPATH=${BUILD}/test-install python3 setup.py --quiet install --install-lib
|
|||||||
test -f ${BUILD}/test-install-bin/i3pystatus
|
test -f ${BUILD}/test-install-bin/i3pystatus
|
||||||
test -f ${BUILD}/test-install-bin/i3pystatus-setting-util
|
test -f ${BUILD}/test-install-bin/i3pystatus-setting-util
|
||||||
|
|
||||||
PYTHONPATH=${BUILD}/test-install py.test --junitxml ${BUILD}/testlog.xml tests
|
PYTHONPATH=${BUILD}/test-install py.test-3.4 --junitxml ${BUILD}/testlog.xml tests
|
||||||
|
|
||||||
# Check that the docs build w/o warnings (-W flag)
|
# Check that the docs build w/o warnings (-W flag)
|
||||||
sphinx-build -b html -W docs ${BUILD}/docs/
|
sphinx-build-3.4 -b html -W docs ${BUILD}/docs/
|
||||||
|
@ -1,10 +1,6 @@
|
|||||||
from i3pystatus import IntervalModule
|
from i3pystatus import IntervalModule
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
#Example
|
|
||||||
# status.register("xkblayout",
|
|
||||||
# layouts=["es", "us"])
|
|
||||||
|
|
||||||
|
|
||||||
class Xkblayout(IntervalModule):
|
class Xkblayout(IntervalModule):
|
||||||
interval = 1
|
interval = 1
|
||||||
@ -21,15 +17,15 @@ class Xkblayout(IntervalModule):
|
|||||||
"full_text": self.format.format(name=kblayout).upper(),
|
"full_text": self.format.format(name=kblayout).upper(),
|
||||||
"color": "#ffffff"
|
"color": "#ffffff"
|
||||||
}
|
}
|
||||||
|
|
||||||
def change_layout(self):
|
def change_layout(self):
|
||||||
layouts=self.layouts
|
layouts = self.layouts
|
||||||
kblayout = subprocess.check_output("setxkbmap -query | awk '/layout/{print $2}'", shell=True).decode('utf-8').strip()
|
kblayout = subprocess.check_output("setxkbmap -query | awk '/layout/{print $2}'", shell=True).decode('utf-8').strip()
|
||||||
if kblayout in layouts:
|
if kblayout in layouts:
|
||||||
position = layouts.index(kblayout)
|
position = layouts.index(kblayout)
|
||||||
try:
|
try:
|
||||||
subprocess.check_call(["setxkbmap", layouts[position+1]])
|
subprocess.check_call(["setxkbmap", layouts[position + 1]])
|
||||||
except IndexError:
|
except IndexError:
|
||||||
subprocess.check_call(["setxkbmap", layouts[0]])
|
subprocess.check_call(["setxkbmap", layouts[0]])
|
||||||
else:
|
else:
|
||||||
# Go to first position
|
|
||||||
subprocess.check_call(["setxkbmap", layouts[0]])
|
subprocess.check_call(["setxkbmap", layouts[0]])
|
||||||
|
Loading…
Reference in New Issue
Block a user