Created
March 1, 2013 03:21
-
-
Save kaorimatz/5062247 to your computer and use it in GitHub Desktop.
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
#!/bin/sh | |
COMMAND=`cat <<JS | |
const Gio = imports.gi.Gio; | |
let settings = new Gio.Settings({ schema: 'org.gnome.desktop.input-sources' }); | |
let current = settings.get_uint('current'); | |
let sources = settings.get_value('sources').get_child_value(current); | |
let type = sources.get_child_value(0).unpack(); | |
if (type === 'xkb') { | |
let layout = sources.get_child_value(1).unpack(); | |
print('l:' + layout); | |
} else if (type === 'ibus') { | |
let engine = sources.get_child_value(1).unpack(); | |
print('e:' + engine); | |
} | |
JS` | |
gjs -c "$COMMAND" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment