mirror of
https://gitlab.archlinux.org/tpowa/archboot.git
synced 2024-09-19 19:40:37 +02:00
replace sed with correct srftime dialog
This commit is contained in:
parent
4819849658
commit
d5b0c738b5
2 changed files with 3 additions and 4 deletions
|
@ -49,13 +49,12 @@ _timeset() {
|
||||||
if [[ -z "${_SET_TIME}" ]]; then
|
if [[ -z "${_SET_TIME}" ]]; then
|
||||||
timedatectl set-ntp 0
|
timedatectl set-ntp 0
|
||||||
# display and ask to set date/time
|
# display and ask to set date/time
|
||||||
_dialog --title " Date " --no-cancel --calendar "Use <TAB> to navigate and arrow keys to change values." 0 0 0 0 0 2>"${_ANSWER}"
|
_dialog --title " Date " --no-cancel --calendar --date-format='%F' "Use <TAB> to navigate and arrow keys to change values." 0 0 0 0 0 2>"${_ANSWER}"
|
||||||
_DATE="$(cat "${_ANSWER}")"
|
_DATE="$(cat "${_ANSWER}")"
|
||||||
_dialog --title " Time " --no-cancel --timebox "Use <TAB> to navigate and up/down to change values." 0 0 2>"${_ANSWER}"
|
_dialog --title " Time " --no-cancel --timebox "Use <TAB> to navigate and up/down to change values." 0 0 2>"${_ANSWER}"
|
||||||
_TIME="$(cat "${_ANSWER}")"
|
_TIME="$(cat "${_ANSWER}")"
|
||||||
# save the time
|
# save the time
|
||||||
# DD/MM/YYYY hh:mm:ss -> YYYY-MM-DD hh:mm:ss
|
_DATETIME=""${_DATE}" "${_TIME}""
|
||||||
_DATETIME="$(echo "${_DATE}" "${_TIME}" | sed 's#\(..\)/\(..\)/\(....\) \(..\):\(..\):\(..\)#\3-\2-\1 \4:\5:\6#g')"
|
|
||||||
timedatectl set-time "${_DATETIME}"
|
timedatectl set-time "${_DATETIME}"
|
||||||
_SET_TIME="1"
|
_SET_TIME="1"
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
# wait for modules to initialize cmompletely
|
# wait for modules to initialize cmompletely
|
||||||
udevadm wait --settle /dev/fb0
|
udevadm wait --settle /dev/fb0
|
||||||
# get screen setting mode from /sys
|
# get screen setting mode from /sys
|
||||||
_FB_SIZE="$(sed -e 's#.*:##g' -e 's#x.*##g' /sys/class/graphics/fb0/modes 2>/dev/null)"
|
_FB_SIZE="$(rg -o ':(.*)x' -r '$1' /sys/class/graphics/fb0/modes 2>/dev/null)"
|
||||||
if [[ "${_FB_SIZE}" -gt '1900' ]]; then
|
if [[ "${_FB_SIZE}" -gt '1900' ]]; then
|
||||||
_SIZE="32"
|
_SIZE="32"
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue