blob: 014bf10839a0fb235bdf6d3f34f76e01da574837 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
|
from subprocess import run as _run
def run(command):
return _run(command.split(), capture_output=True).stdout.decode().strip()
def callback():
try:
name = run('xkblayout-state print "%s"').strip('"')
return f"LNG: {name.upper()}"
except FileNotFoundError:
return f"LNG: xkblayout-state not installed"
|