Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora Resources > Guides & Solutions (Not For Questions)
FedoraForum Search

Forgot Password? Join Us!
Register All Albums FAQ Today's Posts Search

Guides & Solutions (Not For Questions) Post your guides here (No links to Blogs accepted). You can also append your comments/questions to a guide, but don't start a new thread to ask a question. Use another forum for that.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 18th July 2011, 01:11 PM
David Batson Offline
Registered User
 
Join Date: Jul 2009
Posts: 1,234
linuxopera
Alternative to gpointing-device-settings

gpointing-device-settings is brain dead since it can't remember what you set it at though a logout/login or reboot. Have filed bug reports without any joy.
https://bugzilla.redhat.com/show_bug.cgi?id=528485
https://bugzilla.redhat.com/show_bug.cgi?id=713534
https://bugzilla.gnome.org/show_bug.cgi?id=650559

Here is what I do now for my ThinkPad X220 equiped with the TrackPoint and TouchPad (Synaptics) [aka UltraNav].

All the following was done as root in terminal. After creating the script files below, I made them executable from within nautilus by choosing Properties > Permissions > Allow executing file as program. Of course this can be done from the command line as well.

Note: xorg-x11-apps needs to be installed for xinput. Used gedit as root to create script files below. To launch gedit or nautilus as root, type su - {press ENTER} type root password (will not be displayed). Then start gedit or nautilus by typing gedit or nautilus in terminal.

1) Renamed the file /usr/share/gnome-control-center/ui/gnome-mouse-properties.ui to gnome-mouse-properties.ui.save
2) Created the file /etc/gdm/PostLogin/Default to enable TrackPoint scrolling on login
Code:
#!/bin/sh

xinput list | sed -ne 's/^[^ ][^V].*id=\([0-9]*\).*/\1/p' | while read id
do
        case `xinput list-props $id` in
        *"Middle Button Emulation"*)
                xinput set-int-prop $id "Evdev Wheel Emulation" 8 1
                xinput set-int-prop $id "Evdev Wheel Emulation Button" 8 2
                xinput set-int-prop $id "Evdev Wheel Emulation Timeout" 8 200
                xinput set-int-prop $id "Evdev Wheel Emulation Axes" 8 6 7 4 5
                xinput set-int-prop $id "Evdev Middle Button Emulation" 8 0
                ;;
        esac
done


# disable middle button
xmodmap -e "pointer = 1 9 3 4 5 6 7 8 2"
3) Created the file /etc/acpi/actions/ultranav.sh to toggle the TouchPad on/off
Code:
#!/bin/sh

touchPadId=$(xinput list | grep -i synaptics | cut -d "=" -f 2 | cut -b 1-2)
if [ "$touchPadId" == "" ]; then
	echo "Unable to identify device id..."
else
enabledId=$(xinput list-props $touchPadId | grep -i enabled | cut -d ":" -f 1 | cut -b 18-20)
state=$(xinput list-props 11 | grep -i enabled | cut -d ":" -f 2 | cut -b 2)
	if [ "$state" == "1" ]; then
	xinput set-prop $touchPadId $enabledId 0
	notify-send -t 400 -i /home/david/ultranav.png "Touchpad disabled..."
	else
	xinput set-prop $touchPadId $enabledId 1
	notify-send -t 400 -i /home/david/ultranav.png "Touchpad enabled..."
	fi
fi
4) Open System Settings > Keyboard > Shortcuts > Custom Shortcuts > +. Named shortcut :TouchPad Toggle. Used Command: /etc/acpi/actions/ultranav.sh. Clicked on New Shortcut and pressed Fn + F8. Now when I press Fn + F8, ultranav.sh is run. If the touchpad is off, it is turned on; if the touchpad is on, it is turned off.
5) Save a .png image of the UltraNav icon that I found with Google in /home/~/ - I named the file /ultranav.png

* Note: if you dislike the notification bubbles (they do collect at the bottom of the display), you can omit the notify-send lines in ultranav.sh. If I figure out a way to have the notify-send messages expire, I will add to this thread. Currently they autohide but do not go expire.
__________________
Fedora 19 Gnome on a ThinkPad X220, i5-2540M CPU, Intel HD Graphics 3000, Intel N 6205 wireless, and Sierra Wireless 754S Mobile Hotspot (AT&T)

Last edited by David Batson; 18th July 2011 at 01:46 PM.
Reply With Quote
  #2  
Old 25th July 2011, 04:31 AM
David Batson Offline
Registered User
 
Join Date: Jul 2009
Posts: 1,234
linuxopera
Re: Alternative to gpointing-device-settings

Code:
# disable middle button
xmodmap -e "pointer = 1 9 3 4 5 6 7 8 2"
I found the above (taken from thinkwiki.org) wasn't really working for me in Opera. If I clicked on the middle button before pressing the TrackPoint pointing stick, the next page would load (in a forum for instance). I would sometimes click on the middle button before pressing the TrackPoint pointing stick and would lose the page I was on.

I changed the above to:
Code:
# disable middle button
xmodmap -e "pointer = default"
(probably could have just removed this section all together)

Now an accidental click on the middle button does not load the next page.
__________________
Fedora 19 Gnome on a ThinkPad X220, i5-2540M CPU, Intel HD Graphics 3000, Intel N 6205 wireless, and Sierra Wireless 754S Mobile Hotspot (AT&T)
Reply With Quote
  #3  
Old 10th October 2011, 05:06 AM
David Batson Offline
Registered User
 
Join Date: Jul 2009
Posts: 1,234
linuxopera
Re: Alternative to gpointing-device-settings

Quote:
Originally Posted by David Batson View Post
3) Created the file /etc/acpi/actions/ultranav.sh to toggle the TouchPad on/off
Code:
#!/bin/sh

touchPadId=$(xinput list | grep -i synaptics | cut -d "=" -f 2 | cut -b 1-2)
if [ "$touchPadId" == "" ]; then
	echo "Unable to identify device id..."
else
enabledId=$(xinput list-props $touchPadId | grep -i enabled | cut -d ":" -f 1 | cut -b 18-20)
state=$(xinput list-props 11 | grep -i enabled | cut -d ":" -f 2 | cut -b 2)
	if [ "$state" == "1" ]; then
	xinput set-prop $touchPadId $enabledId 0
	else
	xinput set-prop $touchPadId $enabledId 1
	fi
fi
4) Open System Settings > Keyboard > Shortcuts > Custom Shortcuts > +. Named shortcut :TouchPad Toggle. Used Command: /etc/acpi/actions/ultranav.sh. Clicked on New Shortcut and pressed Fn + F8. Now when I press Fn + F8, ultranav.sh is run. If the touchpad is off, it is turned on; if the touchpad is on, it is turned off.
Something changed along the way, and now I was getting an on screen display from pressing Fn + F8 that changes from Touchpad enabled to Touchpad disabled in addition to the notify-send icon. So I edited the above to remove the notify-send notification icons.

Oddly though, even though the on screen display shows the Touchpad being toggled on and off, the Touchpad is not actually enabled until the command "xinput set-prop..." is run - either from the file above or from the command line thus:
xinput set-prop 11 130 1
{11 being the $touchPadId, 130 being the $enabledId, and 1 being enabled, 0 being disabled}

I also found it is not necessary to disable or rename /usr/share/gnome-control-center/ui/gnome-mouse-properties.ui

I had some difficulty getting the Fn + F8 keyboard shortcut to be accepted in Custom Shortcuts after deleting it, but eventually it stuck.
EDIT: I think the trick to get the Fn + F8 key combo to be accepted is to press both almost simultaneously to get "Touchpad toggle". Otherwise you will just get either Fn (Wake) or F8.
__________________
Fedora 19 Gnome on a ThinkPad X220, i5-2540M CPU, Intel HD Graphics 3000, Intel N 6205 wireless, and Sierra Wireless 754S Mobile Hotspot (AT&T)

Last edited by David Batson; 12th October 2011 at 11:52 PM.
Reply With Quote
  #4  
Old 27th November 2011, 06:12 PM
elesbb Offline
Registered User
 
Join Date: Nov 2011
Posts: 25
linuxfirefox
Re: Alternative to gpointing-device-settings

how can i do this with synaptics touchpad ? i want everything to be remembered upon log out .
Reply With Quote
  #5  
Old 27th November 2011, 11:30 PM
David Batson Offline
Registered User
 
Join Date: Jul 2009
Posts: 1,234
linuxopera
Re: Alternative to gpointing-device-settings

Run xinput list (xorg-X11-apps must be installed for xinput).

Code:
# xinput list
⎡ Virtual core pointer                    	id=2	[master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer              	id=4	[slave  pointer  (2)]
⎜   ↳ TPPS/2 IBM TrackPoint                   	id=12	[slave  pointer  (2)]
⎜   ↳ SynPS/2 Synaptics TouchPad              	id=11	[slave  pointer  (2)]
⎣ Virtual core keyboard                   	id=3	[master keyboard (2)]
    ↳ Virtual core XTEST keyboard             	id=5	[slave  keyboard (3)]
    ↳ Power Button                            	id=6	[slave  keyboard (3)]
    ↳ Video Bus                               	id=7	[slave  keyboard (3)]
    ↳ Sleep Button                            	id=8	[slave  keyboard (3)]
    ↳ Integrated Camera                       	id=9	[slave  keyboard (3)]
    ↳ AT Translated Set 2 keyboard            	id=10	[slave  keyboard (3)]
    ↳ ThinkPad Extra Buttons                  	id=13	[slave  keyboard (3)]
Notice that the Synaptics Touchpad is id=11. May be different on your machine. Run xinput list-props <your device number> to find out properties that can be changed.
Code:
# xinput list-props 11
Device 'SynPS/2 Synaptics TouchPad':
	Device Enabled (132):	0
	Coordinate Transformation Matrix (134):	1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
	Device Accel Profile (255):	0
	Device Accel Constant Deceleration (256):	1.000000
	Device Accel Adaptive Deceleration (257):	1.000000
	Device Accel Velocity Scaling (258):	10.000000
	Evdev Axis Inversion (259):	0, 0
	Evdev Axis Calibration (260):	<no items>
	Evdev Axes Swap (261):	0
	Axis Labels (262):	"Abs X" (251), "Abs Y" (252), "Abs Pressure" (253), "Abs Tool Width" (254)
	Button Labels (263):	"Button Left" (135), "Button Unknown" (250), "Button Unknown" (250), "Button Wheel Up" (138), "Button Wheel Down" (139)
	Evdev Middle Button Emulation (264):	0
	Evdev Middle Button Timeout (265):	50
	Evdev Wheel Emulation (266):	1
	Evdev Wheel Emulation Axes (267):	6, 7, 4, 5
	Evdev Wheel Emulation Inertia (268):	10
	Evdev Wheel Emulation Timeout (269):	200
	Evdev Wheel Emulation Button (270):	2
	Evdev Drag Lock Buttons (271):	0
To set a property of your touchpad (say disable it) put the xinput command in a executable file (you can make the file executable using the permissions tab of your file manager when run as root by right-clicking on the file, or you can do this from terminal with the chmod command). The file should start with the shebang at the top: #!/bin/sh
Example to disable the touchpad:
Code:
#!/bin/sh
xinput set-prop 11 132 0
OR
Code:
#!/bin/sh
xinput set-prop "SynPS/2 Synaptics TouchPad" "Device Enabled" 0
In addition to post #3 above, you can put content in /etc/gdm/PostLogin/Default so that the file runs on login.
__________________
Fedora 19 Gnome on a ThinkPad X220, i5-2540M CPU, Intel HD Graphics 3000, Intel N 6205 wireless, and Sierra Wireless 754S Mobile Hotspot (AT&T)
Reply With Quote
  #6  
Old 1st January 2012, 09:38 PM
sloosley Offline
Registered User
 
Join Date: Jul 2006
Location: Out West
Posts: 30
linuxchrome
Re: Alternative to gpointing-device-settings

David, thank you for your post on how you enabled scrolling in F15 (or F16) on a X220. I've read it carefully several times, along with the wiki, referenced elsewhere.

I am trying to write a script that runs on login to
(1) disable the Trackpad; and
(2) enable the middle-button scroll.

I saved the script as /etc/gdm/PostLogin/Default. My script (see below) only enables the middle scroll button. It does not disable the Trackpad.

By chance do you (or anyone else) have any suggestions to modify the scrip to make it accomplish both of my objectives -- kill the Trackpad and enable the middle button scroll. I'm a noobie, so be patient

Thanks!!
-steve.


Code:
#!/bin/sh

# enable the middle button to scroll

xinput list | sed -ne 's/^[^ ][^V].*id=\([0-9]*\).*/\1/p' | while read id
do
        case `xinput list-props $id` in
        *"Middle Button Emulation"*)
                xinput set-int-prop $id "Evdev Wheel Emulation" 8 1
                xinput set-int-prop $id "Evdev Wheel Emulation Button" 8 2
                ;;
        esac
done

# disable the trackpad

touchPadId=$(xinput list | grep -i synaptics | cut -d "=" -f 2 | cut -b 1-2)
enabledId=$(xinput list-props $touchPadId | grep -i enabled | cut -d ":" -f 1 | cut -b 18-20)
xinput set-prop $touchPadId $enabledId 0
Reply With Quote
  #7  
Old 1st January 2012, 11:23 PM
David Batson Offline
Registered User
 
Join Date: Jul 2009
Posts: 1,234
linuxopera
Re: Alternative to gpointing-device-settings

It appears things changed a little bit again with F16. Now the /etc/acpi/ultranav.sh script and keyboard shortcut is unneeded to disable the touchpad. Simply press Fn+F8 and the touchpad is toggled on and off. Actually the ultranav.sh file interferes with the Fn+F8 shortcut.

FTR, this is on a Lenovo X220 ThinkPad.

I believe the touchpad will not disable on boot-up because gnome shell is re-enabling it after /etc/gdm/Default is run.
__________________
Fedora 19 Gnome on a ThinkPad X220, i5-2540M CPU, Intel HD Graphics 3000, Intel N 6205 wireless, and Sierra Wireless 754S Mobile Hotspot (AT&T)

Last edited by David Batson; 2nd January 2012 at 03:19 PM.
Reply With Quote
  #8  
Old 1st January 2012, 11:25 PM
sloosley Offline
Registered User
 
Join Date: Jul 2006
Location: Out West
Posts: 30
linuxchrome
Re: Alternative to gpointing-device-settings

Wow, that's Cool! Fn+F8 gets the job done very nicely. Thanks, David and Happy New Year!!
Reply With Quote
  #9  
Old 29th April 2015, 09:57 AM
cosine Offline
Registered User
 
Join Date: Feb 2008
Posts: 6
linuxfedorafirefox
Re: Alternative to gpointing-device-settings

In FC22 you need to add 'head' here and there to correct the parsing.

#!/bin/sh
# see http://fedoraforum.org/forum/showthread.php?p=1543202
# in FC 22 added head -1 to stop multiple matches.
touchPadId=$(xinput list | grep -i synaptics | cut -d "=" -f 2 | cut -b 1-2)
#echo $touchPadId
if [ "$touchPadId" == "" ]; then
echo "Unable to identify device id..."
else
#enabledId=$(xinput list-props $touchPadId | grep -i enabled | cut -d ":" -f 1 | cut -b 18-20)
enabledId=$(xinput list-props $touchPadId | grep -i enabled | head -1 | cut -d ":" -f 1 | cut -b 18-20)
echo $enabledId
state=$(xinput list-props $touchPadId | grep -i enabled | head -1 |cut -d ":" -f 2 | cut -b 2)
echo "state =" $state
if [ "$state" == "1" ]; then
xinput set-prop $touchPadId $enabledId 0
notify-send "Touchpad disabled..."
else
xinput set-prop $touchPadId $enabledId 1
notify-send "Touchpad enabled..."
fi
fi
Reply With Quote
Reply

Tags
alternative, gpointingdevicesettings


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
F15: gpointing-device-settings problem JayJayKing Using Fedora 4 7th June 2011 09:24 AM
gpointing device settings config lost calanor F16 Development 0 20th February 2011 10:20 PM
[SOLVED] Does the new gpointing-device-settings work? dd_wizard Fedora 13 Development Branch 1 17th April 2010 06:55 PM
Where is gpointing-device-settings? Palooka Fedora 12 Alpha, Beta & Release Candidates 2 4th November 2009 08:52 PM
kde blocks access to cd device despite settings iidbis Using Fedora 4 19th February 2008 05:59 PM


Current GMT-time: 17:50 (Monday, 26-06-2017)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat