blob: c6b568193d3378be6d1def79d842e7184025a5ac (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
|
#!/bin/bash
# this is jank and ugly, I know
LAYOUT="$(defaults read ~/Library/Preferences/com.apple.HIToolbox.plist AppleSelectedInputSources | grep "KeyboardLayout Name" | cut -c 33- | rev | cut -c 2- | rev)"
# specify short layouts individually.
case "$LAYOUT" in
"\"Dvorak\"") SHORT_LAYOUT="DV" ;;
"\"U.S.\"") SHORT_LAYOUT="US" ;;
*) SHORT_LAYOUT="한" ;;
esac
sketchybar --set keyboard label="$SHORT_LAYOUT"
|