mirror of
https://github.com/LukeSmithxyz/voidrice.git
synced 2026-03-20 01:37:45 +01:00
`kblayoutmanager` switches layouts. Layouts are read from `$KBLAYOUTS`. An extra file, `~/.local/bin/statusbar/lang` is added in the commit, which adds layout indicator to i3blocks. Example binds are `Super+Alt+Space` added to both i3/config and sxhkd/config. Example `KBLAYOUTS` are US Standard Layout and Global UK layout. Special thanks to KEZ-
11 lines
389 B
Bash
Executable File
11 lines
389 B
Bash
Executable File
#!/bin/sh
|
|
# A simple module to print current keyboard layout
|
|
|
|
lang="$(setxkbmap -query | grep -oP 'layout:\s*\K\w+')"
|
|
|
|
# Since shortcuts are unlikely to work with non-latin/US keyboard layouts,
|
|
# the line below makes US layout green to help you recognize anything else easier
|
|
[ "$lang" = "us" ] && color="#00ff00" || color="#ff0000"
|
|
|
|
printf "<span color='%s'>%s</span>\n" "$color" "$lang"
|