A python3 (not yet daemon) script to enhance user experience on HP Spectre x360 (skylake) under Ubuntu 16.10.
- "stance" detection
- detect if if lid is rotated to tablet mode ("tablet stance")
- detect if an external display is connected ("docked stance")
- otherwise assume "laptop stance"
- react to stance change:
- disable trackpad in tablet mode
- change text scaling and "menu" scaling of Unity
- start/stop onboard (on-screen-keyboard)
- start/stop ScreenToolsSysIndicator
- Python 3
- pydbus (install through pip)
- python-gi (GLib bindings)
- inotifyx (with python 3 compat patches)
The script uses:
- ScreenToolsSysIndicator
- xrandr, xinput
- dconf
- Onboard (the default on-screen-keyboard in Ubuntu Unity)
https://dbus.freedesktop.org/doc/dbus-python/doc/tutorial.html#receiving-signals https://github.com/LEW21/pydbus/blob/master/README.rst
nice summary about understanding dbus-monitor output and DBus messages: http://askubuntu.com/a/38796
- move more stuff to Config (font scaling values, etc...)
- demonize with python-daemon
- do not switch if already in that mode
- install to ~/.confing/autostart/desktop_file.desktop (would be nicer to read XDG CONFIG DIRS)
- sys wide default is /usr/share/gnome/autostart/
- vbtn event file could be read binary, and figure out what data means what (insetad of reading syslog...)