Re: Problems with "launch at startup" script



Hi:

Yes, mine is a Performance MX too, and I also swap to the thumb one... :)

Thanks for your trick, I'll try it now.

On 15/05/14 18:56, Neil Bird wrote:
Around about 15/05/14 16:43, rastersoft scribbled ...
I'm using gnome shell since version 3.2. I also have a logitech mouse
with zillions of buttons, and I have the problem that I hate to have the
third button in the mouse wheel, so I've been using xmodmap in a startup
script to put it in another button. The specific script is:

#!/bin/bash
xmodmap -e "pointer = 1 13 3 4 5 6 7 8 9 10 11 12 2"

I have a Logitech Performance MX on which I like to swap the middle button for the thumb one. I used to use a judiciously placed xmodmap like yours into X11's startup (and also, previously, xorg.conf) but these methods have started failing over time with newer and newer X11/gdm/GNOME setups.

  I currently have (Fedora 20/GNOME 3.10):

</usr/local/bin/swap-mouse-buttons>
#!/bin/bash

xinput list | sed -ne 's/^.*Logitech Unifying Device.*id=\([0-9]*\).*pointer.*/\1/p' | while read id
do
map=$(xinput get-button-map $id | sed -e 's/ 2 / TWO /g' -e 's/ 8 / 2 /g' -e 's/ TWO / 8 /')
    xinput set-button-map $id  $map
done


  And:

<~/.config/autostart/swap-mouse-buttons.desktop>
[Desktop Entry]
Type=Application
Exec=/usr/local/bin/swap-mouse-buttons
Hidden=false
X-GNOME-Autostart-enabled=true
Name=Swap mouse buttons
Comment=Swap middle and thumb mouse buttons



You'll need to ID your mouse device from the “xinput list” output, and adjust the script accordingly (plus change the 8s to 13s for your case).

This will work for a given user (it's not global) and will need to be triggered again (run the swap command from <Alt-F2>¹) if you unplug or otherwise reset USB during a login. I've yet to add anything that catches USB insertions and does it automatically as it's too rare to bother with.


¹ - You could also copy/link the desktop file to ~/.local/share/applications/ so that it shows up in the gnome-shell applications overview instead.


--
Nos leemos
                         RASTER    (Linux user #228804)
raster rastersoft com              http://www.rastersoft.com



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]