summaryrefslogtreecommitdiff
path: root/mac/.config/sketchybar.mon/plugins/keyboard.sh
diff options
context:
space:
mode:
authorTheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com>2025-08-23 12:42:37 +0900
committerTheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com>2025-08-23 12:42:37 +0900
commit07d294425a98ee5d1e22d03e2b24ae2c76e487c0 (patch)
treea6818f0d64438c5fdb88b00a35d944f80c056213 /mac/.config/sketchybar.mon/plugins/keyboard.sh
parent6fc28cdb3529ca8ee864cb5c41674cb0a4af72a1 (diff)
updates
Diffstat (limited to 'mac/.config/sketchybar.mon/plugins/keyboard.sh')
-rwxr-xr-xmac/.config/sketchybar.mon/plugins/keyboard.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/mac/.config/sketchybar.mon/plugins/keyboard.sh b/mac/.config/sketchybar.mon/plugins/keyboard.sh
new file mode 100755
index 0000000..c6b5681
--- /dev/null
+++ b/mac/.config/sketchybar.mon/plugins/keyboard.sh
@@ -0,0 +1,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"