Skip to content
Snippets Groups Projects
Unverified Commit ce78d66d authored by Casey's avatar Casey :recycle:
Browse files

main/ttyescape: upgrade to hkdm/buffyboard (MR 2713)

This upgrades ttyescape to use buffyboard, a new fbkeyboard replacement
by @cherrypicker. It adds a lot of missing keys and uses the same layout
as Phosh's Squeekboard, so should feel much more like home for Phosh
users.

This also switches to the new HKDM daemon for hotkey handling, replacing
triggerhappy.
parent c47c62e3
No related branches found
No related tags found
No related merge requests found
# Maintainer: Caleb Connolly <caleb@connolly.tech>
pkgname=ttyescape
pkgver=0.1
pkgver=0.2
pkgrel=0
pkgdesc="Daemon to allow users to escape to a tty"
url="https://postmarketos.org"
arch="all"
arch="noarch"
license="GPL-3.0-or-later"
depends="triggerhappy fbkeyboard terminus-font kbd"
depends="hkdm buffyboard terminus-font kbd"
install="$pkgname.post-install"
subpackages="$pkgname-openrc"
source="
togglevt.sh
ttyescape-triggerhappy.conf
ttyescape-hkdm.toml
etc-conf-d-ttyescape.conf
"
options="!check"
......@@ -19,15 +20,15 @@ package() {
install -Dm755 "$srcdir"/togglevt.sh \
"$pkgdir"/usr/bin/togglevt.sh
install -Dm755 "$srcdir"/ttyescape-triggerhappy.conf \
"$pkgdir"/etc/triggerhappy/triggers.d/ttyescape.conf
install -Dm755 "$srcdir"/ttyescape-hkdm.toml \
"$pkgdir"/etc/hkdm/config.d/ttyescape.toml
install -Dm755 "$srcdir"/etc-conf-d-ttyescape.conf \
"$pkgdir"/etc/conf.d/ttyescape.conf
}
sha512sums="
5a56740678073c72c1952e36742fb0786f932e718835c39502ab51f9731426e2b8479de38d4c44c35bc84a895b74ea0dc7bd39fd9eb89b603973ed6e43abb377 togglevt.sh
f8bf3273cf87392ab2092a005417bc58cb3ae6ad25b9118b76c68481d9d8fc7d964a9d16fc7645f6f9ff0676dccd381be3b846464b2e60a6452b8c883bffb6f1 ttyescape-triggerhappy.conf
5429c7029e6db292cccbd4d5fdb4eb07cbbe050fe886784ebb1f88d790de35c06714c2ad38d366d88ed78a09d4d20e0826541f8f578885384ff6b033ac606af8 etc-conf-d-ttyescape.conf
3b9274093c751a7e6ec1d6578c9bf6d8da4bdb770a1353144b99fddc306edbf182b14d0253a03a40b4418ac0d5ebbaea8ec7a82b9d22a5c0e680897b4fc977d5 togglevt.sh
88034b54b06a962ff353a7a5a272352b56fdb564231a13be85b73d9dfc991d1ec8085014ebfcd5c6eaee67e62341dd2c9c7ace91a2c839702ae3b7f6007433f4 ttyescape-hkdm.toml
ac06c2ae2b3b8404d6ed79a046b175abbeb2360033edcaa22c21e1a61c68913e58013e9200ee5b786eee9020a2c78d1bda09c72d87ea0998bf6eeb71da015a2f etc-conf-d-ttyescape.conf
"
......@@ -6,3 +6,4 @@ FONT="/usr/share/consolefonts/ter-128n.psf.gz"
PRESSCOUNT=3
# tmpfile to use for counting state
TMPFILE="/tmp/ttyescape.tmp"
KEYBOARD="buffyboard"
#!/bin/sh
# Toggle between tty1 and tty2, launching fbkeyboard when on tty2
# Toggle between tty1 and tty2, launching $KEYBOARD when on tty2
# THIS SCRIPT MUST BE RUN AS ROOT
# usage:
# togglevt.sh <state>
......@@ -19,6 +19,7 @@ FONT="${FONT:-/usr/share/consolefonts/ter-128n.psf.gz}"
# amount of times power must be pressed to trigger
PRESSCOUNT="${PRESSCOUNT:-3}"
TMPFILE="${TMPFILE:-/tmp/ttyescape.tmp}"
KEYBOARD="${KEYBOARD:-buffyboard}"
if [ ! -e /dev/uinput ]; then
if ! modprobe -q uinput; then
......@@ -31,12 +32,12 @@ switchtty() {
if [ "$currentvt" = "tty2" ]; then # switch to tty1 with normal UI
chvt 1
killall fbkeyboard
else # Switch to tty2 with fbkeyboard
killall $KEYBOARD
else # Switch to tty2 with $KEYBOARD
setfont "$FONT" -C /dev/tty2
chvt 2
# sometimes fbkeyboard can be running already, we shouldn't start it in that case
[ "$(pgrep fbkeyboard)" ] || nohup fbkeyboard -r "$(cat /sys/class/graphics/fbcon/rotate)" &
# sometimes they keyboard can be running already, we shouldn't start it in that case
[ "$(pgrep $KEYBOARD)" ] || nohup $KEYBOARD -r "$(cat /sys/class/graphics/fbcon/rotate)" &
fi
}
......
[[events]]
name = "increment"
event_type = "EV_KEY"
key_state = "released"
keys = ["KEY_VOLUMEDOWN", "KEY_POWER"]
command = "/usr/bin/togglevt.sh inc"
[[events]]
name = "start"
event_type = "EV_KEY"
key_state = "pressed"
keys = ["KEY_VOLUMEDOWN"]
command = "/usr/bin/togglevt.sh start"
[[events]]
name = "reset"
event_type = "EV_KEY"
key_state = "released"
keys = ["KEY_VOLUMEDOWN"]
command = "/usr/bin/togglevt.sh reset"
\ No newline at end of file
KEY_POWER+KEY_VOLUMEDOWN 0 /usr/bin/togglevt.sh inc
KEY_VOLUMEDOWN 1 /usr/bin/togglevt.sh start
KEY_VOLUMEDOWN 0 /usr/bin/togglevt.sh reset
# noop to prevent garbage being typed in console
KEY_VOLUMEDOWN 2 /bin/true
#!/bin/sh
# Enable triggerhappy
rc-update -q add triggerhappy default
# Enable hkdm
rc-update -q add hkdm default
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment