It is currently Fri Jun 23, 2017 5:34 pm



Welcome
Welcome to antiX-forum.

You are currently viewing our boards as a guest, which gives you limited access to view most discussions and access our other features. By joining our free community, you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content, and access many other special features. Registration is fast, simple, and absolutely free, so please, join our community today!


Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: New Mouse dialog
PostPosted: Tue Jul 21, 2015 1:54 am 
Offline

Joined: Thu Jan 21, 2010 12:36 am
Posts: 1040
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)

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 )

_________________
Computers are like air conditioners. They work fine until you start opening Windows. ~Author Unknown


Top
 Profile  
 
 Post subject: Re: New Mouse dialog
PostPosted: Tue Jul 21, 2015 5:51 am 
Offline

Joined: Thu Feb 09, 2012 7:29 am
Posts: 1177
ds-mouse, when no args are passed on the commandline, fall down go boom
Quote:
$ ds-mouse
/usr/local/bin/ds-mouse: line 68: ./ds-mouse.py: No such file or directory
and
Quote:
$ 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.

Quote:
echo "ds-mouse -all" > ~/.desktop-session/startup
wondering whether this written line should contain an ampersand
echo "ds-mouse -all &" > ~/.desktop-session/startup


Top
 Profile  
 
 Post subject: Re: New Mouse dialog
PostPosted: Tue Jul 21, 2015 11:36 pm 
Offline

Joined: Thu Jan 21, 2010 12:36 am
Posts: 1040
@ 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.

_________________
Computers are like air conditioners. They work fine until you start opening Windows. ~Author Unknown


Top
 Profile  
 
 Post subject: Re: New Mouse dialog
PostPosted: Wed Jul 22, 2015 12:59 am 
Offline

Joined: Thu Feb 09, 2012 7:29 am
Posts: 1177
Dave, I've revised the scripts to address all but "point #1" (I didn't notice a path refrence issue during testing)
http://pastebin.com/jDZJnnmQ

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)


Top
 Profile  
 
 Post subject: Re: New Mouse dialog
PostPosted: Wed Jul 22, 2015 1:28 am 
Offline

Joined: Thu Feb 09, 2012 7:29 am
Posts: 1177
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


Top
 Profile  
 
 Post subject: Re: New Mouse dialog
PostPosted: Mon Aug 03, 2015 4:16 am 
Offline

Joined: Thu Jan 21, 2010 12:36 am
Posts: 1040
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?

_________________
Computers are like air conditioners. They work fine until you start opening Windows. ~Author Unknown


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
suspicion-preferred