the stuff

heads-keymap 595B

123456789101112131415161718192021222324252627282930313233
  1. #!/bin/sh
  2. #
  3. # Copyright (c) 2016-2018 Ivan J. <parazyd@dyne.org>
  4. # See LICENSE file for copyright and license details.
  5. #
  6. # Select a keyboard layout.
  7. kmps="/usr/share/X11/xkb/symbols"
  8. cd "$kmps"
  9. klist="$(find *)"
  10. cd - >/dev/null
  11. sel_layout() {
  12. yad \
  13. --text="Please select your prefered keyboard layout." \
  14. --no-escape \
  15. --listen \
  16. --center \
  17. --list \
  18. --title="heads keyboard layout" \
  19. --separator="\n" \
  20. --column="Layout Name" \
  21. --search-column=1 \
  22. --print-column=1
  23. }
  24. sel=""
  25. while [ -z "$sel" ]; do
  26. sel="$(printf "%s\n" "$klist" | sel_layout)"
  27. done
  28. printf "%s\n" "$sel"