Giter Site home page Giter Site logo

spin's Introduction

spin

a small utility to assist in setting usage modes of laptop-tablet devices

features

  • automatic palm rejection when using stylus
  • automatic disable/enable of touchpad and nipple when device toggled between laptop and tablet states
  • manual control of display orientation and input devices

setup

This utility requires X11.

Install PyQt5. On Ubuntu 16.04 LTS, run the following:

sudo apt install python-qt5

On Ubuntu 18.04 LTS, run the following:

sudo apt install pyqt5-dev pyqt5-dev-tools

Now install spin by running the following:

sudo pip install python_spin

To set up globally a Linux desktop launcher with icon, execute the following:

sudo wget --content-disposition -N -P /usr/share/icons/ https://raw.githubusercontent.com/wdbm/spin/master/python_spin/static/spin.svg

sudo wget --content-disposition -N -P /usr/share/applications/ https://raw.githubusercontent.com/wdbm/spin/master/python_spin/static/spin.desktop

quick start

This utility can be run in its default graphical mode or in a non-graphical mode. The graphical mode is engaged by running

spin

while the non-graphical mode is engaged by using the option --no_GUI:

spin --no_GUI

There are other options which are described by spin --help.

By default, this utility disables the touchscreen on detecting the stylus in proximity and it changes between the laptop and tablet modes on detecting toggling between the laptop and tablet usage configurations. These default behaviours are provided by both the graphical and non-graphical modes of this utility. This utility should be initiated in the laptop usage configuration.

compatibility

computer model operating system and setup comment
ThinkPad S1 Yoga Ubuntu 16.04 (X11, Unity) working
ThinkPad S120 Yoga Ubuntu 16.04 (X11, Unity) working
ThinkPad Yoga 14 Ubuntu 16.04 (X11, Unity) possibly working with some reduced functionality
ThinkPad Yoga P40 Ubuntu 16.04 (X11, Unity) possibly working

acceleration control

There is an experimental acceleration control included which is deactivated by default. It can be activated by selecting the appropriate button in the graphical mode.

future

Under consideration is state recording in order to avoid execution of unnecessary commands and better handling of subprocesses.

spin's People

Contributors

ushinawa avatar wdbm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

spin's Issues

Display position not correctly recognized

Hi,

I have a problem with the display mode recognition on my ThinkPad Yoga model. The mode for the different angles is recognized as follows: laptop in (0°, 180°), tablet in [180°, 360°) and finally laptop again at 360°.

I am using Ubuntu 13.10, the Yoga type is 20CD. I should also mention that my stylus pen does not seem to work out of the box.

If you need any more infos or any kind of help please let me know.

ACPI Event Not Working

displayPositionControl() would not work properly when placing the computer in tablet mode.

Error when enabling display position monitoring

Hey there,
Handy tool! However, I get an error when setting display position monitoring to on.
I am on Fedora 20.

INFO:__main__:changing display position control to on
Process Process-7:
Traceback (most recent call last):
  File "/usr/lib64/python2.7/multiprocessing/process.py", line 258, in _bootstrap
    self.run()
  File "/usr/lib64/python2.7/multiprocessing/process.py", line 114, in run
    self._target(*self._args, **self._kwargs)
  File "./spin.py", line 230, in displayPositionControl
    socketACPI.connect("/var/run/acpid.socket")
  File "/usr/lib64/python2.7/socket.py", line 224, in meth
    return getattr(self._sock,name)(*args)
error: [Errno 2] Datei oder Verzeichnis nicht gefunden

The error in the last line in english (sorry, my system is set to german): "File or Directory not found"

Installation instructions are broken.

I have used the installation instructions to try to install this utility but to no avail. Then i tried instead of pip install (since pip by its own defaults to python2) python3 -m pip install and it worked. Please fix the small error in the instructions.

show the commands run

It would be very useful if spin.py would show the actual xinput commands when it is running them. This can even rescue you from a reboot if you switch off your touchpad buttons.

Stylus won't rotate

Thank you for Spin! I really enjoy using it!
I'm using a Thinkpad S1 Yoga, any ideas why stylus won't rotate with the screen? Touch does though.
(Wacom ISDv4 EC Pen stylus)

thank you
Ray

Some issues with the touchscreen/touchpad/trackpoint input on 2nd gen tpyoga

Thanks again for spin, it is really nifty! It also works much better for me after the latest update on the 2nd gen tpyoga (I used to have graphical problems when switching screen orientation, but no more. Maybe it was my switch to 14.10 and installation of intel graphics updater).

Just a few issues:

  • 'Touchpad off' is not working, not when pressing the button or putting it in tablet mode. No error message.
  • The touchpad and trackpoint input are not rotated when put into tablet mode (or other orientations).
  • The touchscreen input is not rotated when put into tablet mode (or other orientations). Getting this error message: 'unable to find device SYNAPTICS Synaptics Touch Digitizer V04'
  • Inverted orientation causes my screen to go black.

All this is on 14.10 with unity.

Cheers

windows x11

hi,
can i use this with widows 11 surface book?
says requires ubuntu?

thankyou

Spin.py: unable to find device 'Watcom ISDv4 EC Pen Stylus'

I love Spin.py-- it is ALMOST what I was looking for. However, when I run it on my Yoga 2 Pro (i7) under Lubuntu 17.10, I get a repeated error message: unable to find device 'Watcom ISDv4 EC Pen Stylus'
The utility seems to work fine on my machine, but that error message is annoying. I tried to run it in silent mode (spin.py -s) but that made no difference.
I also tried to click "stylus proximity monitoring off" and "nipple off" but neither helped.
I gather that my hardware is a little different from the HW used by the developers, but is there anything I can do to tame it?
Thanks--

Finding events on Thinkpad Yoga 14?

Hi,
Don't mean to be a bother, but I have the recently released thinkpad yoga 14, and it's not working properly with the script as is -- which is to be expected, since the hardware is changed and certain events will work differently. I'm trying to see if I can modify it myself to do the listening, so I've been poking around. I ran acpi_listen and moved the hinge through its full range, and no events popped up. I'm wondering if, since you found the original socket, you had any insights for how to locate the socket -- or whatever it is -- that these events are coming through. If it can be found I would be happy to contribute its location to perhaps expand the compatibility scope of the project. For context, I'm running Ubuntu 14.10 and I believe all my drivers and such are fully updated.
An ominous side note -- from some of the research I've done so far it seems possible that these events would only be accessible through the accelerometer, which would be a bit of an issue, as everything I've done to test js0/event7 -- supposedly where the accelerometer is located -- have been met with "operation not permitted" messages and such.
Thanks,
Andrew

Support for disabling touchscreen+touchpad(+nipple) when laptop lid is closed

Hi,

I'm a really happy user of spin.py, it has made using my Thinkpad Yoga 20CD much nicer.

But I have one request: Some Yoga's have a notorious (hardware) bug which causes them to emit spurious touch events (probably from touchscreen) when the laptop lid is closed (i.e., when connected to an external monitor+keyboard+mouse). I'm suffering from these from time to time, and they can be very irritating (especially since they produce a mouse click in addition to moving the mouse cursor).

Would it be possible to add a third mode to spin.py ("lid closed" mode or similar), which could then disable touchscreen and touchpad (and possible nipple, since that cannot be used either)? (Detecting when the lid is closed should be fairly trivial, I suppose.)

Regards,
Matti Rintala

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.