1
Fork 0
This repository has been archived on 2023-03-26. You can view files and clone it, but cannot push or open issues or pull requests.
theorangeone.net-legacy/content/projects/yoga-pal.md

33 lines
1.9 KiB
Markdown
Raw Permalink Normal View History

2016-10-14 17:58:10 +01:00
---
2016-05-27 23:17:11 +01:00
title: Yoga Pal
template: projects
slug: yoga-pal
repo: https://github.com/RealOrangeOne/yoga-pal
2016-07-16 19:44:18 +01:00
summary: Control screen rotation, touch screen, and trackpad using the terminal
2016-10-14 17:58:10 +01:00
---
2016-05-27 23:17:11 +01:00
2017-02-04 21:42:45 +00:00
Once I started work, I bought myself a _Lenovo Yoga 3 14"_ laptop, because I needed a thin and light laptop for trains and the office. This came with windows, which within 10 minutes was running Ubuntu Gnome! Ubuntu greatly increased the performance, but I had to sacrifice all the screen, touchpad and keyboard customisation when changing 'modes'.
2016-05-27 23:17:11 +01:00
2017-02-04 21:42:45 +00:00
I found [this thread](https://askubuntu.com/questions/450066/rotate-touchscreen-and-disable-the-touchpad-on-yoga-2-pro-in-rotated-mode) with someone else trying to find a solution to this, to find a nice way of rotating the screen when in tablet mode. On the thread was a really nice simple [script](https://askubuntu.com/a/485685/432138) that rotated the screen perfectly, and did the touchscreen too.
2016-05-27 23:17:11 +01:00
2017-02-04 21:42:45 +00:00
This script worked great, doing exactly what it said it did, nicely and quickly, however it wasn't a great solution for me. Yes it worked, but it didn't allow me to change anything else, like the touchpad.
So I wrote my own CLI, based off the above script, that would allow me to tweak everything, so the laptop can be used as it was intended. With a simple command, I could swap the _mode_ of the laptop to match how I was using it.
2017-02-04 21:50:02 +00:00
eg:
2017-02-04 21:42:45 +00:00
```bash
$ yoga mode tablet # Set to tablet mode
$ yoga mode laptop # Reset to laptop mode
```
After writing this, It ended up finding an accidental usage. The touchscreen started glitching out, causing ghost presses on the screen, making the mouse move all over the screen and switch focus all over the place. Fortunately, I'd already written a command to disable the touch screen and prevent this:
```bash
$ yoga disable touch
```
Problem solved!
Whilst I've only tested this on my laptop, there's no reason it shouldn't work on others too! If it doesn't, submit an [issue]({{ article.repo }}/issues/)!