Alternative to gpointing-device-settings
FedoraForum.org - Fedora Support Forums and Community
Results 1 to 9 of 9
  1. #1
    Join Date
    Jul 2009
    Posts
    1,234
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    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.
    Last edited by David Batson; 18th July 2011 at 01:46 PM.
    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)

  2. #2
    Join Date
    Jul 2009
    Posts
    1,234
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    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)

  3. #3
    Join Date
    Jul 2009
    Posts
    1,234
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Alternative to gpointing-device-settings

    Quote Originally Posted by David Batson
    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.
    Last edited by David Batson; 12th October 2011 at 11:52 PM.
    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)

  4. #4
    Join Date
    Nov 2011
    Posts
    25
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Alternative to gpointing-device-settings

    how can i do this with synaptics touchpad ? i want everything to be remembered upon log out .

  5. #5
    Join Date
    Jul 2009
    Posts
    1,234
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    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)

  6. #6
    Join Date
    Jul 2006
    Location
    Out West
    Posts
    30
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    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

  7. #7
    Join Date
    Jul 2009
    Posts
    1,234
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    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.
    Last edited by David Batson; 2nd January 2012 at 04:19 PM.
    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)

  8. #8
    Join Date
    Jul 2006
    Location
    Out West
    Posts
    30
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Alternative to gpointing-device-settings

    Wow, that's Cool! Fn+F8 gets the job done very nicely. Thanks, David and Happy New Year!!

  9. #9
    Join Date
    Feb 2008
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    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

Similar Threads

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

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •