]>
git.mar77i.info Git - laptop-config/blob - setup_screens.sh
4 pacman
-Qi linux
| sed -rn 's/^Version\s*:\s*(.*)$/\1/p'
8 uname
-r | sed -r 's/-/./'
11 try_finding_stylus
() {
13 if [[ "$(kernel_pkg_ver)" != "$(kernel_running_ver)" ]]; then
14 echo "Warning: Kernel was updated: You need a reboot!" >&2
16 echo "Tip with the stylus on monitor ${1}"
17 for (( i
= 0; i
< 16; i
++ )); do
19 if grep -Fq "${2}" < <(xinput list
--name-only); then
25 echo "Error: Stylus was not found: ${2}" >&2
33 [eDP
-1]="ELAN9008:00 04F3:425B Stylus Pen (0)"
34 [eDP
-2]="ELAN9009:00 04F3:425A Stylus Pen (0)"
37 for mon
in "${!styluses[@]}"; do
38 stylus
="${styluses[${mon}]}"
39 xinput disable
"${stylus}"
40 if grep -q "${mon}" < <(xrandr
--listactivemonitors); then
41 if ! grep -Fq "${stylus}" < <(xinput list
--name-only); then
42 try_finding_stylus
"${mon}" "${stylus}" || return 1
44 xinput
enable "${stylus}"
45 xinput
--map-to-output "${stylus}" "${mon}"
46 echo "$(date) mapped stylus pen ${stylus%% *} to ${mon}" >&2
48 echo "$(date) disabled stylus pen ${stylus%% *}" >&2
55 "ELAN9008:00 04F3:425B"
56 "ELAN9008:00 04F3:425B Touchpad"
57 "ELAN9009:00 04F3:425A"
58 "ELAN9009:00 04F3:425A Touchpad"
61 for touchpad
in "${touchpads[@]}"; do
62 xinput disable
"${touchpad}"
68 for config
in "${configs[@]}"; do
69 if [[ "${1}" == "${config}" ]]; then
78 if (( wait_for_keypress
)); then
82 echo exit "${1:-${ret}}"
86 echo "TODO: help text"
94 if ! output
="$(lxqt-config-monitor --list-saved 2>/dev/null)"; then
95 lxqt
-config-monitor --list-saved
97 elif [[ "${output}" ]]; then
98 mapfile
-d $
'\n' -t configs
< <(printf '%s\n' "${output}")
101 list_saved_failed
="${?}"
115 echo "Error: unknown argument: ${1}" >&2
122 if [[ "${load_saved}" ]]; then
123 (( list_saved_failed
)) && exit "${list_saved_failed}"
124 if check_config
"${load_saved}"; then
125 lxqt
-config-monitor --load-saved "${load_saved}" || exit 1
128 echo "Error: no such saved config: ${load_saved}" >&2