diff --git a/ci-build.sh b/ci-build.sh index fa142a3..2e693e6 100755 --- a/ci-build.sh +++ b/ci-build.sh @@ -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/ diff --git a/i3pystatus/xkblayout.py b/i3pystatus/xkblayout.py index 07254cb..79c7839 100644 --- a/i3pystatus/xkblayout.py +++ b/i3pystatus/xkblayout.py @@ -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]])