3

I want to use two finger scrolling on my touchpad. I'm using Ubuntu 13.04, and the Mouse and Touchpad GUI configuration doesn't let me enable it (the checkbox is greyed out). As a workaround, I created a script that is run on startup per the advice. The script is:

xinput set-int-prop "SynPS/2 Synaptics TouchPad" "Two-Finger Scrolling" 8 1         
xinput set-int-prop "SynPS/2 Synaptics TouchPad" "Synaptics Two-Finger Scrolling" 8 1 1
xinput set-int-prop "SynPS/2 Synaptics TouchPad" "Synaptics Two-Finger Pressure" 32 0

This works fine after I log in. However, when I sleep and resume, the setting seems to disappear -- two finger scrolling is no longer enabled.

Some solutions (e.g.) suggest using synclient and xorg.conf, but those don't seem to work. Other solutions (e.g.) add scripts that are run upon resuming from sleep. This seems like the wrong way to go about it -- there should be a way to make permanent changes without having to re-tweak them on every resume.

Does anyone have a permanent way to enable two finger scrolling?

Sam King
  • 719

4 Answers4

1

You can add the script to /etc/X11/Xsession.d/ to make the change persist across all sessions. Just make sure you read up on how to customize Xsession's startup procedure (particularly the naming convention): http://manpages.ubuntu.com/manpages/raring/man5/Xsession.5.html

cesar
  • 111
1

Even if you did the run on resume thing it wouldn't have worked(at least for me it didn't), in fact it inhibited my system from suspending (got the lock screen only).

So here's my, ugly but working solution.

Create a script /desired/path/my-synaptic.sh (call it X) with the following content(set the mode to 777 just in case, chmod 777 X):

#! /bin/sh

while true
do
 # all your commands here
 sleep 5 # increase the time if you want to be less aggressive about it
done

Then go to Startup Applications from the dashboard and add a startup program with the following command:

nohup X

and you're good to go until this issue is properly addressed.

Idea of the script was taken from here.

And yeah not even cron was of any help in this situation.


set-int-prop is deprecated. Source 1 and 2.

  • 1
    Hmm... That would work, but it feels like a bit too much of a hack to just keep running a command every few seconds in the background. – Sam King Sep 25 '13 at 05:20
  • @SamKing a system already does run plenty of commands in the background. Plus it'ss not cpu/memory intensive. And like I said until the issues gets resolved/properly addressed, this is the easiest working hack. – Bleeding Fingers Sep 25 '13 at 05:30
  • Generally, a system runs commands in the backround when there is a meaningful reason for them to do so (eg, monitoring IO or waiting on system calls to return). I'm aware that it wouldn't be memory intensive and that the sleep means it isn't busy waiting. Nonetheless, I'm looking for a more elegant solution. Also, it does have other negative effects, such as preventing me from easily tweaking those settings if I want to (without rebooting or manually killing the script's process) and forcing a processor context switch every 5 seconds, which could reduce cache utilization. – Sam King Sep 25 '13 at 15:51
  • @SamKing like I said it is not even close to elegant but at least I am willing to pay this negligible price. Pointer setting's are not something that one changes every other day, I never touched my settings in 11.04 for over a year(even forget it existed) and it wasn't this ugly. – Bleeding Fingers Sep 25 '13 at 16:26
0

I did this to make my xinput settings persist after reboot (Ubuntu 13.04 Unity), but it may not help for resuming from hibernate:

sudo vi /usr/local/bin/xinput.sh

Add your xinput line(s) and save.

sudo chmod 755 /usr/local/bin/xinput.sh

Press the Super key do go to Dash, search for Startup Applications and click on it to open. Click Add:

Name: xinput
Command: /usr/local/bin/xinput.sh
Comment: xinput settings

Save and reboot

pulsar039
  • 34
  • 3
  • 1
    That's what I do now. Unfortunately, the setting appears to be cleared after resuming from standby. – Sam King Jul 13 '13 at 18:11
  • You can run a script that runs when returning from hibernation. Take a look here: http://askubuntu.com/a/308076/174852 – pulsar039 Nov 02 '14 at 10:56
0

I've had to put it in /etc/X11/xorg.conf.d/50-mouse-map.conf (and reboot) to be permanent not only over reboots but also over suspend/resume.

#instead of: xinput set-button-map "2.4G Wireless Optical Mouse" 1 2 3 4 5 6 7 0 
Section "InputClass"
    Identifier  "2.4G Wireless Optical Mouse"
    Option  "ButtonMapping" "1 2 3 4 5 6 7 0 0 10 11 12 13 14 15 16"
EndSection
Matija Nalis
  • 1,444