💾 Archived View for thatit.be › 2023-02-15-18-29-09.gmi captured on 2023-05-24 at 17:51:23. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2023-04-26)

➡️ Next capture (2023-06-14)

-=-=-=-=-=-=-

config snippets: rotate screen for ppkb

I call this script on startup to rotate the display when the keyboard is attached. I’ll probably replace the name with a variable and move it to the settings file, but for now it’s hard coded.

rotate.sh:

#!/bin/bash
. ~/bin/settings.sh

rotate_right() {
    xrandr -o right
    xinput set-prop  "pointer:Goodix Capacitive TouchScreen" --type=float "Coordinate Transformation Matrix"  0 1 0 -1 0 1  0 0 1 
    xinput set-prop "keyboard:Goodix Capacitive TouchScreen" --type=float "Coordinate Transformation Matrix"  0 1 0 -1 0 1  0 0 1 
}

rotate_left() {
    xrandr -o left
    xinput set-prop  "pointer:Goodix Capacitive TouchScreen" --type=float "Coordinate Transformation Matrix"  0 -1 1 1  0 0 0  0 1
    xinput set-prop "keyboard:Goodix Capacitive TouchScreen" --type=float "Coordinate Transformation Matrix"  0 -1 1 1  0 0 0  0 1
}

rotate_normal() {
    xrandr -o normal
    xinput set-prop  "pointer:Goodix Capacitive TouchScreen" --type=float "Coordinate Transformation Matrix" 1 0 0 0 1 0 0 0 1
    xinput set-prop "keyboard:Goodix Capacitive TouchScreen" --type=float "Coordinate Transformation Matrix" 1 0 0 0 1 0 0 0 1
}

if is_kb_present ; then
    rotate_right
fi

settings.sh:

#!/bin/bash
#
# Some common settings about the hafl env on pinephone.
#

##
# 0 exit when more than the internal battery is present
is_kb_present() {
    local BATTERIES=( $(ls -d /sys/class/power_supply/*-battery) )
    test ${#BATTERIES[@]} -gt 1
}

Tags

#pinephone

#pinephonepro

Navigation

index

tags

Backlinks

PinePhone Pro Updates and Configs

updated: 2023-04-20 12:46:05 -0400

generated: 2023-04-23