Pine64-Arch icon indicating copy to clipboard operation
Pine64-Arch copied to clipboard

Add ttyescape

Open adamthiede opened this issue 3 years ago • 17 comments

I'd like to help add TTYescape to Arch. TTYescape is available in PostmarketOS and enables switching to a TTY on the pinephone with hotkeys. The TTY has a touchscreen keyboard. It's pretty useful. https://wiki.postmarketos.org/index.php?title=TTYescape https://gitlab.com/postmarketOS/pmaports/-/merge_requests/2309/diffs

I'm not great at PKGBUILDs so these are not working yet. I could use some help. It's based on modified APKBUILDs from Alpine/pmos.

https://pkgs.alpinelinux.org/package/edge/testing/aarch64/hkdm https://pkgs.alpinelinux.org/package/edge/testing/aarch64/buffyboard https://pkgs.postmarketos.org/package/master/postmarketos/aarch64/triggerhappy https://pkgs.postmarketos.org/package/master/postmarketos/aarch64/ttyescape and the following AUR PKGBUILD: https://aur.archlinux.org/packages/triggerhappy/

adamthiede avatar Jan 06 '22 14:01 adamthiede

Right now, buffyboard, triggerhappy, and hkdm are working. Still working on ttyescape.

adamthiede avatar Jan 07 '22 14:01 adamthiede

ttyescape seems to be working if I remove hkdm as a dependency. hkdm is the one that's giving me problems. hkdm: /usr/sbin exists in filesystem (owned by filesystem) Not sure what I'm doing wrong. (figured it out - sbin was a symlink on arch)

adamthiede avatar Jan 08 '22 01:01 adamthiede

I've built the packages and they're here: https://server.elagost.com/arch/

Steps to test this out:

  • Download or build the packages yourself
  • Install the packages - pacman -U <packages> (for ttyescape, triggerhappy, and buffyboard; hkdm doesn't need to be here)
  • enable triggerhappy.socket and triggerhappy.service
  • ensure hkdm.service is disabled
  • reboot
  • hold Volume Down key and tap Power key 3 times, let go of Volume Down key
  • you should see tty2 with a large font and a keyboard (if the font isn't large, repeat the previous step, twice)

A few issues so far:

  • how to make this work with the bootsplash - I attempted to add [email protected] to triggerhappy.service but that did not work. I ended up regenerating my initramfs after removing danctnix-bootsplash from the hooks and running mkinitcpio -p linux-megi and rebooting.
  • this might need the uinput module loaded? echo uinput | sudo tee /etc/modules.load.d/uinput.conf will enable it but I think the togglevt.sh script does it automatically if needed.

Other than that, it's working great!

adamthiede avatar Jan 08 '22 21:01 adamthiede

Marked ready for review since I've been running packages built off these PKGBUILDs for a few days with no cost to stability. They seem to work well, with the one caveat being I've disabled the bootsplash.

adamthiede avatar Jan 12 '22 01:01 adamthiede

just another "+1" comment, works great for me and doesn't conflict with sxmo's unusual power-key bindings. i already had the bootsplash disabled

hamblingreen1 avatar Feb 18 '22 16:02 hamblingreen1

Hey! it's cool to see an interest in my software being used elsewhere :D

right now the togglevt script is the only part of TTYEscape, and i somewhat lazily included it directly in pmaports, this has the limitation that you basically need to kang the whole script.

this is bad because it means any upstream fixes require manual intervention (more than simply bumping the pkgver), I'll try and get TTYEscape moved to it's own repo soon so we dont potentially have to deal with breaking changes in the future.

calebccff avatar Mar 14 '22 13:03 calebccff

@ArenM Thank you so much for the extensive review. It might be a bit before I can get to it - my family is in the middle of moving right now. But I will get it cleaned up.

adamthiede avatar Mar 28 '22 19:03 adamthiede

I've moved TTYEscape to it's own repo so it can be packaged without having to vendor any scripts: https://gitlab.com/postmarketOS/ttyescape, you can upgrade you package to use this as the source (See https://gitlab.com/postmarketOS/pmaports/-/commit/be91c62136804b84b0dd2062ac9f29d3548f2a8d)

calebccff avatar Mar 29 '22 00:03 calebccff

@calebccff my sincere thanks for making TTYEscape in the first place. It's a lifesaver! @ArenM I've fixed a few things; had some spare time.

adamthiede avatar Mar 29 '22 01:03 adamthiede

Ok. Still needs the bootsplash removed (sudo sed -e 's/bootsplash-danctnix//g' -i /etc/mkinitpcio.conf && sudo mkinitcpio -p linux-megi), but where it's at now should be better.

adamthiede avatar Mar 29 '22 02:03 adamthiede

diff.txt I needed these changes to make it work on my pinephone.

  • the PKGBUILD depends on files not existing in this repository (I have copied the one from postmarketos and fixed the path to the font for archlinux)
  • since it is depending on hkdm, there is no need to configure triggerhappy
  • on my system, and I do not remember modifying it so must be the default terminal 1 is the gui not 7, so removed that Otherwise it seems to work perfectly. Tested on sxmo/swmo.

manner82 avatar Apr 21 '22 14:04 manner82

Hey there @elagost , just wondering if you were planning on implementing the changes in @manner82 's comment above. they make sense to me and i'd love to see ttyescape merged into the repos. thanks!

hamblingreen1 avatar Jun 21 '22 03:06 hamblingreen1

@hamblingreen1 thanks for reminding me. I've not really used Arch on my pinephone for a while; mainly been running pmOS which is why this has sat untouched. Addressing the changes from @manner82 :

  • I will remove the triggerhappy config
  • It's possible that sxmo/swmo run on different ttys than phosh. I only tested on phosh. I can test out both (hopefully sometime soon) and update the PR.

adamthiede avatar Jun 21 '22 10:06 adamthiede

Ok, ttyescape now has customizable VTs, and those can be set in the config file, without editing the togglevt.sh script. I've not yet had time to build or test these packages yet but it should be a little more flexible now.

adamthiede avatar Jun 22 '22 11:06 adamthiede

I've put the current exact pkgbuilds on the AUR if anyone wants to use them from there while waiting on this. hkdm is rust so it is more complicated to build.

adamthiede avatar Jun 29 '22 21:06 adamthiede

the pkgbuild from the aur works well, uninstalled my old version of ttyescape and it's dependencies and after reinstalling using the newest version it works great out of the box.

hamblingreen1 avatar Jun 30 '22 05:06 hamblingreen1

Updated and improved PKGBUILDs now added to the Manjaro ARM repos (unstable for now). I've tested on my PinePhone running Manjaro Phosh.

yochananmarqos avatar Dec 12 '23 02:12 yochananmarqos