Skip to content

Instantly share code, notes, and snippets.

@MindPatch
Created March 21, 2021 18:40
Show Gist options
  • Save MindPatch/f100e7e3867eaa8020593fff7c261a1d to your computer and use it in GitHub Desktop.
Save MindPatch/f100e7e3867eaa8020593fff7c261a1d to your computer and use it in GitHub Desktop.
change layout i3
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