the stuff

heads-tz 865B

12345678910111213141516171819202122232425262728293031323334353637
  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 timezone
  7. cd /usr/share/zoneinfo
  8. zones="$(find * -type f -name '[A-Z]*' | grep -Ev '^right|^posix')"
  9. chosen="$(printf "%s\n" "$zones" | yad \
  10. --title="heads' timezone" \
  11. --text="<b>Select the system timezone</b>
  12. Select below your prefered timezone.
  13. (Start typing to search)" \
  14. --image="/usr/share/icons/Adwaita/64x64/apps/preferences-system-time-symbolic.symbolic.png" \
  15. --image-on-top \
  16. --no-escape \
  17. --listen \
  18. --borders=40 \
  19. --width=360 \
  20. --height=360 \
  21. --fixed \
  22. --center \
  23. --list \
  24. --button="<b>Accept</b>":0 \
  25. --separator="\n" \
  26. --column="Timezone" \
  27. --search-column=1 \
  28. --print-column=1 | sed '/^$/d')"
  29. [ -n "$chosen" ] || exit 0
  30. ln -snf /usr/share/zoneinfo/$chosen /etc/localtime
  31. echo "$chosen" > /etc/timezone