the stuff

heads-locale 937B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #!/bin/sh
  2. #
  3. # Copyright (c) 2018 Ivan J. <parazyd@dyne.org>
  4. # See LICENSE file for copyright and license details.
  5. #
  6. # Select locales to generate.
  7. locs="$(grep ' UTF-8$' /etc/locale.gen | tr -d '#' | awk '{print $1}')"
  8. chosen="$(printf "%s\n" "$locs" | yad \
  9. --title="heads' locale" \
  10. --text="<b>Select the system locale</b>
  11. Choose below your prefered locale.
  12. (Select multiple by holding down Ctrl)
  13. (Start typing to search)" \
  14. --no-escape \
  15. --borders=40 \
  16. --image="/usr/share/icons/Adwaita/64x64/apps/preferences-desktop-locale-symbolic.symbolic.png" \
  17. --image-on-top \
  18. --listen \
  19. --width=360 \
  20. --height=360 \
  21. --fixed \
  22. --center \
  23. --list \
  24. --multiple \
  25. --button="<b>Accept</b>":0 \
  26. --separator="\n" \
  27. --column="Locale Name" \
  28. --search-column=1 \
  29. --print-column=1 | sed '/^$/d')"
  30. for i in $chosen; do
  31. echo "$i UTF-8" >> /etc/locale.gen
  32. done
  33. locale-gen
  34. # TODO: Ask for a prefered locale and set it in /etc/profile.d