Created
March 21, 2021 18:40
-
-
Save MindPatch/f100e7e3867eaa8020593fff7c261a1d to your computer and use it in GitHub Desktop.
change layout i3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from os import popen | |
lang = [ | |
'us', | |
'ar' | |
] | |
def check(): | |
v = popen('setxkbmap -query | grep layout').read() | |
return v.split(':')[1].replace(' ','').rstrip() | |
c = check() | |
for i in lang: | |
if i != c: | |
popen(f'setxkbmap {i}') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment