2023-11-18 17:20:34 +01:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
2023-11-19 18:27:13 +01:00
|
|
|
# archboot-detect-vconsole.sh:
|
2023-11-18 21:25:48 +01:00
|
|
|
# sets bigger font on bigger display resolutions
|
|
|
|
# by Tobias Powalowski <tpowa@archlinux.org>
|
2023-11-18 17:20:34 +01:00
|
|
|
#
|
2023-11-18 21:48:54 +01:00
|
|
|
# wait for modules to initialize cmompletely
|
2023-11-20 21:27:23 +01:00
|
|
|
udevadm wait --settle /dev/fb0
|
2023-11-18 21:48:54 +01:00
|
|
|
# get screen setting mode from /sys
|
2024-06-26 22:47:46 +02:00
|
|
|
_FB_SIZE="$(rg -o ':(.*)x' -r '$1' /sys/class/graphics/fb0/modes 2>/dev/null)"
|
2023-11-20 13:52:19 +01:00
|
|
|
if [[ "${_FB_SIZE}" -gt '1900' ]]; then
|
|
|
|
_SIZE="32"
|
2023-11-18 17:20:34 +01:00
|
|
|
else
|
2023-11-20 13:52:19 +01:00
|
|
|
_SIZE="16"
|
2023-11-18 17:20:34 +01:00
|
|
|
fi
|
2023-11-18 21:48:54 +01:00
|
|
|
# update vconsole.conf accordingly
|
2023-11-18 17:20:34 +01:00
|
|
|
echo KEYMAP=us >/etc/vconsole.conf
|
2023-11-20 13:52:19 +01:00
|
|
|
echo FONT=ter-v${_SIZE}n >>/etc/vconsole.conf
|
2023-11-19 09:39:38 +01:00
|
|
|
/lib/systemd/systemd-vconsole-setup
|