topic title: New Mouse dialog
Posts: 1,062
Dave
Joined: 20 Jan 2010
#1
For the willing and capable, please give this initial make of a new mouse config dialog a try.
It should mirror what the current mouse config dialog does.
Improvements:
- Remembers the set values via read / write to configuration file (mouse.conf)
- Has single command to set mouse configuration, used in startups (Though can be broken into parts, see ds-mouse -h)


========= SCRAPER REMOVED AN EMBEDDED LINK HERE ===========
url was:"https://github.com/antiX-Linux/desktop-session/tree/master/ds-mouse"
linktext was:"https://github.com/antiX-Linux/desktop- ... r/ds-mouse"
====================================

download the 3 files
As root in terminal
cp MY_DOWNLOAD_LOCATION/ds-mouse /usr/local/bin/
cp MY_DOWNLOAD_LOCATION/ds-mouse.py /usr/local/bin/
chmod 755 /usr/local/bin/ds-mouse
chmod 755 /usr/local/bin/ds-mouse.py

cp MY_DOWNLOAD_LOCATION/mouse.conf /etc/desktop-session/mouse.conf

echo"ds-mouse -all" >> /etc/desktop-session/startup (or echo"ds-mouse -all" > ~/.desktop-session/startup for user startup files)

PLEASE try running as user *before* the following. This command is *only* if the program does not make a user based configuration file when the gui (ds-mouse) is run.
As User
cp MY_DOWNLOAD_LOCATION/mouse.conf ~/.desktop-session/

Please let me know if there are any issues. If they are minor points and / or requests to add into the mouse config program please mark as so with ( Request / Minor Issue )
Posts: 1,445
skidoo
Joined: 09 Feb 2012
#2
ds-mouse, when no args are passed on the commandline, fall down go boom
$ ds-mouse
/usr/local/bin/ds-mouse: line 68: ./ds-mouse.py: No such file or directory
and
$ ds-mouse -all
Warning: Only changing the first 5 of 16 buttons.
the gui version
ds-mouse.py
( Request / Minor Issue ) the slider cannot accommodate 0.5 multiplier intervals ?
not really"minor".... when ya want 1.5x, being steered into using 2x is quite a jump in the result produced

( Request / Minor Issue ) Should the"acceleration" slider be scaled to cover a sensible range? A value larger than 16 is probably clipped

Issue? (idk)
adjusting the"Cursor Size" slider seems to have no effect.
I'm guessing: only certain cursorsets provide scalable imagefiles, and none of the currently installed cursorsets meet that requirement
FWIW, I checked after changing desktops to restart session, and again after having fully logged out.
echo"ds-mouse -all" > ~/.desktop-session/startup
wondering whether this written line should contain an ampersand
echo"ds-mouse -all &" > ~/.desktop-session/startup
Posts: 1,062
Dave
Joined: 20 Jan 2010
#3
@ skidoo,
Thanks for the input.
1. calling ds-mouse without parameters should be fixed, (had to link to /usr/local/bin/ds-mouse.py rather than relative path which only worked if you are in /usr/local/bin when you make the call)
2. silenced the xmodmap calls

3. changed for acceleration, does threshold also need to be this way?

4. change to 20 for acceleration as max, again should it be the same for threshold?

5. OK will look into why, does the old app work to change cursor size for you?

6. I think either should work ok. Being in the startup file is just for testing purposes at the moment. Eventually when working (and a keyboard app working) it will be setup as a plugin to desktop-session itself... so if it is installed it will be used, if not then it will not be used.
Posts: 1,445
skidoo
Joined: 09 Feb 2012
#4
Dave, I've revised the scripts to address all but"point #1" (I didn't notice a path refrence issue during testing)

The revised versions
-- eliminate yad dependency
-- eliminate the buttons (which had little merit considering they were labled 'Undo' yet, confusingly, just 'reset to zero')
-- enforce"stay on top" behavior for the modal success dialog window
-- enforce"may only run one instance at a time" for ds-mouse python script
-- provide onscreen advisement"some apps ignore the cursor size setting" (re"point #5")
-- accommodate float value for acceleration (AFAIK, an int must be passed for threshold)
-- allow zero value for acceleration and for threshold (AFAIK, zeroes are valid xset values for these)
Posts: 1,445
skidoo
Joined: 09 Feb 2012
#5
I'm still not convinced that"cursor size" is correctly handled and is being correctly applied.
Seems like the range ought to be subject to sanity checking (min value = 10?)
but setting a silly small value (1 or even zero) results in no ill effect.
Maybe it's checked internally by xmodmap, or just serves as a 'hint' and window manager (theme engine?) applies"nearest available size"?

Aha, testing"sudo ds-mouse" (no args) I'm seeing the path issue now
and finding that the script should bail out if executed by sudo user

python:
os.getenv("SUDO_USER")
or
os.geteuid() == 0
Posts: 1,062
Dave
Joined: 20 Jan 2010
#6
OK updated the app to suggestions and utilized most of your modifications, though not exactly the same... hopefully I understood well enough the modifications.
I have not included a couple mainly:
- root user check
- enforce only one instance of ds-mouse

As with how they are sitting...
- what if someone actually runs the system as root user??? Why should the mouse configuration be disabled???
- only one user can modify the mouse settngs and it is possible to lock yourself out followed by needing to remove the lock file via a file manager or terminal. This will need some looking into. I am wondering though why you are suggesting this limit?