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 #!/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/

View File

@ -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,6 +17,7 @@ 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()
@ -31,5 +28,4 @@ class Xkblayout(IntervalModule):
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]])