This commit is contained in:
Ismael Puerto 2015-08-12 16:15:06 +02:00
parent 097c42b5a8
commit 793b1be032
2 changed files with 6 additions and 10 deletions

View File

@ -1,7 +1,7 @@
#!/bin/bash -xe
python3 --version
py.test --version
py.test-3.4 --version
python3 -mpep8 --version
# 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-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)
sphinx-build -b html -W docs ${BUILD}/docs/
sphinx-build-3.4 -b html -W docs ${BUILD}/docs/

View File

@ -1,10 +1,6 @@
from i3pystatus import IntervalModule
import subprocess
#Example
# status.register("xkblayout",
# layouts=["es", "us"])
class Xkblayout(IntervalModule):
interval = 1
@ -21,15 +17,15 @@ class Xkblayout(IntervalModule):
"full_text": self.format.format(name=kblayout).upper(),
"color": "#ffffff"
}
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()
if kblayout in layouts:
position = layouts.index(kblayout)
try:
subprocess.check_call(["setxkbmap", layouts[position+1]])
subprocess.check_call(["setxkbmap", layouts[position + 1]])
except IndexError:
subprocess.check_call(["setxkbmap", layouts[0]])
else:
# Go to first position
subprocess.check_call(["setxkbmap", layouts[0]])