Reimplementing a GUI Mouse configuration tool in antiX 23

Forum Forums Official Releases antiX-23 “Arditi del Popolo Reimplementing a GUI Mouse configuration tool in antiX 23

  • This topic has 104 replies, 9 voices, and was last updated May 27-4:05 pm by BobC.
Viewing 15 posts - 46 through 60 (of 105 total)
  • Author
    Posts
  • #135828
    Member
    PPC

      @Robin – many thanks for the example! Thanks really how I usually learn anything script related. I have to see something implemented, so I can adapt it to do exactly what I want…

      I had this idea, that I’ll test out, when I can:
      Assuming a future version of this script will replace ds-mouse and be integrated into antiX, the way touch device settings will be stored is that, when the script exits, it ALWAYS saves the settings it manages to a text file, let’s say ~/.mouse_settings.
      When the user clicks the check box to make those settings permanent, all it will do will be making sure that the antiX startup file runs ~/.mouse_settings. So, it’s simpler, we only have to apply the “send to startup file” once, and all settings will be stored.

      By design, the check box that makes the settings permanent will always be unchecked, every time the script starts, you users can test settings. That way, users that just have a mouse connected to a desktop computer and select the option to disable that mouse, then realize they don’t have a pointing device to click in icons and options.

      I’m aware that the check box will have to be changed and state something like “Load mouse/touchpad settings every time the system starts”

      Also, since the script can configure multiple pointing devices, the way the ~/.mouse_settings will work will be like this: when users click the “Apply” button, a sed routine will remove all lines in ~/.mouse_settings related to the settings being managed. This will ensure that, for example, you configure one mouse but don’t touch the stored touchpad settings….

      TO DO:
      – Add a routine to install xinput, if it’s not ready installed… that’s the Achilles heal of ds-mouse, so folks never realized not all of it’s functions were working, since one of it’s dependencies was missing… Worse than having software not working is it failing to work and tell us it’s working… 🙁

      P.

      • This reply was modified 3 months, 2 weeks ago by PPC.
      #135838
      Member
      PPC

        New version:
        -Includes checks for dependencies (yad and xinput) and offers to install xinput if it’s not installed.
        -Creates an executable file that stores the pointing device’s settings.

        To do:
        Adapt the example Robin provided, to the “skeleton code” I already had developed… Maybe on my next coffee break…

        As is, the script is already fully usable to manage pointing device’s settings for the current session in an easy and intuitive way.
        For now, if the user want that configuration to be permanent (i.e., to last after the current session is closed, like when logging on again, after a reboot, etc), then the user has to make sure that the startup includes this line:
        $HOME/.current_pointing_device_config &

        The checkbox will take care of that, I hope, in the next revision of the script…

        I’m aware that the script is not perfect:
        – it should parse better the options that are shown in the initial device selection window, and not display an empty space that is not processed correctly. Also, if only one choice is available, the user should be sent directly to the main window and manage that one device

        P.

        #135840
        Member
        PPC

          OK, folks. I was afraid I would mess it up, but it worked fine on my first try…

          CHANGES:
          – fixed a bug that always turned on reverse scrolling
          – when the checkbox is checked, antiX always reloads the selected settings, every time it starts- many thanks, @Robin!

          To do:
          – jump straight to the configuration window, if only one device is found… etc

          P.

          #135842
          Member
          PPC

            I seem to be on a roll, everything is running well on my first try!
            Now the script only shows the initial selection window if there’s more than one choice.

            To do:
            – when the initial device selection window is shown there’s always an empty choice. I know what’s causing it, but not how to solve it easily…

            P.

            #135844
            Member
            PPC

              I think I should play the lotto today, scripting is really going my way!

              This version of the script is very close to a final one and it’s already (I hope) production ready, but requires a lot of testing…

              What the script currently does:
              -If only one pointing device is detected, user is presented with the main window that allows so set some of it’s configurations.
              -If more than one suspected pointing device is detected, a selection screen with a drop down box allows user to select what device will be configured
              -On the main screen, user can use drop down boxes to make selections or a numeric box to select the acceleration. A check box on the bottom, always checked off by default, allows configurations selected on this script to always be used every time antiX starts.

              That is all the script does. It is simple and I hope, very well commented, so anyone can check it out, help fix it or add new features to it. I think that some settings that ds-mouse allowed to configure are no longer available (mainly, turning off the touchpad when user is typing).
              Fortunately, I was able to remake the most used settings, and add the possibility to configure independently different pointing devices.
              This script was produced on a desktop with a single pointing device, a mouse, so it requires some testing, before I can recommend that this is used to replace ds-mouse, on antiX 23.X.

              EDIT: I’m open to people thinking that, like ds-mouse used to do, the “Make antix load mouse configuration” option should “stick” and always keep the last chosen state (check or unchecked). For now I won’t, can’t implement it. I do think it’s safer for the average user to have this setting unchecked by default. The fact is that most users that require GUIs don’t really know what they are doing, and I don’t want users complaining that Wbecause of antiX, their mouse no longer works”…

              EDIT2: A possible new feature: disable touchpad(s) if a mouse is detected can be “kind of” implemented – as is, it would act just at startup (to always run, we would need to keep running the script on an infinte loop, using system resources on the background, or using a cron job): https://www.antixforum.com/forums/topic/how-to-disable-laptop-trackpad-touchpad/#post-99639

              P.

              • This reply was modified 3 months, 2 weeks ago by PPC.
              • This reply was modified 3 months, 2 weeks ago by PPC.
              • This reply was modified 3 months, 1 week ago by PPC.
              #135863
              Member
              PPC

                I tweaked a bit the script:
                -Added a button that allows to open lxappearance, to select a mouse pointer theme
                -I made all of the text of the GUI translatable. No I did not forget to translate the CLI messages. If folks are running the script from a terminal, they get most of the output in English anyway.
                -Since some users get confused by the “Ok” button, I removed, from the main window, the default buttons and replaced them for just one button, that’s 100% clear: “Apply”.

                Side note: Please, don’t ask to replace (nor translate) the “Apply” button with something like “Click here with the main pointing device button (this means mouse or touchpad)- usually the main button is the left one, for right handed people. But if you selected mouse or touchpad buttons for left handed people, then the main button will be the right one- to apply the above configurations to the device indicated on the top of this window”.
                …That would just be dumb and confusing to users. If you have to explain what “Apply” means, in the context of a selection in a computer program, then no amount of text can help those users, they need to take a computer class before trying to use it…

                P.

                • This reply was modified 3 months, 1 week ago by PPC.
                #135866
                Moderator
                Brian Masinick

                  Good work @PPC: Just tried the latest version; I’m only using a fraction of the capabilities, but it works well for my purposes; thanks!

                  --
                  Brian Masinick

                  #135869
                  Member
                  PPC

                    Many thanks for testing, Mr. Masinick. I’ll wait a few more days and, if no bug is found and everyone is pleased with the script, I’ll try recommending replacing ds-mouse with this tool, in antiX 23+… It was, in fact the reason why I created it…

                    To the user (sorry, mate, I forgot your name, and I can’t find your thread) that complained that the GUI was not working for him: just download the latest version of the script > uncompress it > run the script inside it (you can do that from inside a file manager)> Select what you want and then don’t forget to check the box on the bottom, so that selection is always used every time antiX starts. It was only a matter of time, until someone finds (or creates) and alternative, when an antiX tool is not working as it should… We are not a company, nor a foundation (unfortunately), but we, as a community, get stuff done, without needing the help of big corporations, it took, what? One week, until a solution was presented on the forum? If all goes well, in a week or so, that solution will probably be available, out of the box, as soon as antiX is updated.

                    EDIT:
                    CALL FOR HELP: does anyone know what xinput setting corresponds to “change mouse sensitivity” and how to set it? I found some interesting info over here: https://askubuntu.com/questions/205676/how-to-change-mouse-speed-sensitivity

                    EDIT2: I just tested out- to control the pointer’s speed, the correct setting is: “Coordinate Transformation Matrix” (I would never guess that, from this setting’s name!)
                    Ex: for my mouse id (11)
                    xinput set-prop 11 “Coordinate Transformation Matrix” 0.5 0 0 0 0.5 0 0 0 1

                    A GUI for this requires 2 selections: the first number in bold is horizontal speed, the second one in bold is vertical speed…
                    We will require 2 extra fields and the GUI “Horizontal speed” and “Vertical speed” (just like the one that is already used to set the Acceleration).
                    Note: min: 0.1, max: 1 (if you set either horizontal or vertical speed to 0, the pointer won’t move on that axis)

                    This makes my mouse move at half the speed- so, yes, we’ll probably be able to implement, in the GUI, a simple way to set the pointer’s speed… but I’m a bit busy, right now- maybe someone else, like @Robin or @Dave can “pick up the torch” from here?

                    P.

                    • This reply was modified 3 months, 1 week ago by PPC.
                    • This reply was modified 3 months, 1 week ago by PPC.
                    • This reply was modified 3 months, 1 week ago by PPC.
                    #135880
                    Moderator
                    Brian Masinick

                      xinput –set-prop “SYNA32AC:00 06CB:CD50 Touchpad” “Device Accel Constant Deceleration” 0.3
                      xinput –set-prop “SYNA32AC:00 06CB:CD50 Touchpad” “Device Accel Constant Deceleration” 1.5

                      Two examples: the FIRST one makes for really FAST Touchpad movement; the second one slows it down.
                      For the mouse, these same commands with the mouse device do not work, so I’ll keep looking.

                      These appear to be the properties that can be evaluated and set:

                      libinput Accel Speed (316):	0.000000
                      	libinput Accel Speed Default (317):	0.000000
                      	libinput Accel Profiles Available (318):	1, 1
                      	libinput Accel Profile Enabled (319):	1, 0
                      	libinput Accel Profile Enabled Default (320):	1, 0
                      	

                      --
                      Brian Masinick

                      #135897
                      Member
                      PPC

                        I just added “Speed” to the GUI.
                        Anyone interested, please test…

                        P.

                        #135900
                        Moderator
                        Brian Masinick

                          I just added “Speed” to the GUI.
                          Anyone interested, please test…

                          P.

                          Good stuff @PPC; nice job with all of this.
                          For me, I have xinput and libinput from the xserver-xorg-input-libinput
                          package and a few additional libinput packages I found when I used
                          synaptic to search for similar packages –
                          libinput10
                          libinput-bin
                          are a couple that I have enabled on the system I’m using now;
                          I put even more of them in place on the system I was using this morning.

                          However, it’s the system I’m using now that I’ve used to have YouTube
                          audio and video going all afternoon long, so this is plenty to have
                          everything work well with Pipewire.

                          --
                          Brian Masinick

                          #135912
                          Member
                          dspencerj3

                            PPC, et al, hats off for this tremendous and tenacious problem solving! Thank you!

                            I have learned so much over the last few days trying to stay in the loop on this and learn (to some day be able to contribute) while trying to also solve my own mouse problem. I swear that I have searched and read and watched tutorials etc etc etc, and for the life of me cannot figure out how to implement these bash scripts on my machine. I have learned about shebang and /bin/bash and if fi and case esac, making my computer echo “hello world” til it’s ringing in my ears. But nothing has given me natural scroll besides putting this in a terminal xinput set-prop “Logitech USB Receiver Mouse” “libinput Natural Scrolling Enabled” “1”

                            I have looked for hints in the evolving versions of scripts PPC has posted and am beginning to be more and more familiar with what the different parts mean. But I don’t know *where* to put that file, *what* to rename it (if, in fact, I am supposed to), and “how” I should invoke it to execute at startup (or login). Am I supposed to make an entry in a startup file? I was hoping looking in some of these files would show me via context, but apparently my obtuseness thwarted my perception.

                            Can anyone point me to a “step-by-step for dummies” on how to do this, please?

                            #135914
                            Forum Admin
                            Dave

                              The way the script looks is not important, I’m just trying to get the logic of all functions and implement, from strach, what I can. I don’t even know if Dave is working on the same thing or not…

                              I was not at the time. I only really started studying the xinput command and the differing outputs / values / names / ids on various machines to try and figure a common denominator. For example older versions of antix have different values for xinput list showing synaptics instead of libinput indicating the first column of the property name is also the driver; or the property id number is different depending on the device. (For example, one machine shows natural scrolling as id 315, another as 305, and another as 263 as noticed above) and I have also seen this change depending on enabled/disabled settings on the device. Another item was trying to see how to change the *default properties for persistent settings. This seems to require editing files in /etc/X11/xorg.conf.d/ and/or a library to enable that function. Also studying / researching other apps like xfce4-mouse-settings, lxinput and xinput-gui. Started reworking the gui to work with multiple devices and show different items based on device (example: the touchpad settings are not available when a mouse is selected).

                              – Add a routine to install xinput, if it’s not ready installed… that’s the Achilles heal of ds-mouse, so folks never realized not all of it’s functions were working, since one of it’s dependencies was missing… Worse than having software not working is it failing to work and tell us it’s working… 🙁

                              For the first part, realistically the dependency installation is a function of the package manager (apt/dpkg). Adding code to check though helpful / nice it also duplicates system functions. Though a note in the git of what the dependencies are for packaging would have helped with this I am sure. For the second part, yes this is for sure no good and a bug in ds-mouse (probably others as well) as the backend script should exit with status 1 so the gui knows that the command crashed and burned.

                              A possible new feature: disable touchpad(s) if a mouse is detected can be “kind of” implemented – as is, it would act just at startup (to always run, we would need to keep running the script on an infinte loop, using system resources on the background, or using a cron job): https://www.antixforum.com/forums/topic/how-to-disable-laptop-trackpad-touchpad/#post-99639

                              Better to setup a udev rule to run that option on the mouse program / backend for currently logged in users (w command?). Maybe?

                              CALL FOR HELP: does anyone know what xinput setting corresponds to “change mouse sensitivity” and how to set it? I found some interesting info over here

                              Sensitivity I believe equates to (*Acceleration*)Threshold. If it does not have anything in specifying threshold then it can be changed by modifying the coordinate transformation matrix from my understanding.

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

                              #135920
                              Member
                              PPC

                                @Dave – you are light-years away from me in “programming” skills, so anything you produce will be far better than my current script. Even so, if you take a look at it, you’ll see that settings are managed always using the “device name” and “feature name” (and not their numeric id’s, that can change!)
                                The current version of my script is almost as feature rich as the fully working ds-mouse, except that is does not allow to set size of the pointer (I think that it never really worked for me, because the size of the pointer can change depending on the window it’s on) and the feature to disable the touchpad when typing, that I don’t think can be implemented directly in xinput – because that depends on a deamon running, that checks when the keyboard is being used. You can, of course, write such a deamon and make that feature available again, under xinput…
                                Many thanks for clarifying why you think “acceleration” means, in xinput!
                                EDIT: Special request- if you rework the ds-mouse GUI, please make it more compact. There’s no need to scroll down on a window that has so few options, I’ve always found that a bit confusing…

                                “step-by-step for dummies” on how to do this, please?

                                To use the script just download the zip file, uncompress it and launch the script that’s there. Configure your device(s) and then make sure that the checkbox at the bottom is checked. That will make sure that your startup file always launches a script that my GUI generates, implementing the choices you made.
                                Note: if you launch the GUI and don’t have that checkbox checked (it’s always off by default), when you click “apply” instantly the startup file will be edited and the script that launches your pointing device’s configuration will be commented out…
                                There is no need to add my script to the startup file- unless you really want the GUI to open every time your system starts! If you do want that – there’s a GUI, that I created, that allows to edit the startup file, in antiX 23. Search for “startup” using app-select, in antiX’s menu!

                                P.

                                • This reply was modified 3 months, 1 week ago by PPC.
                                #135924
                                Member
                                PPC

                                  It seems that just 2 users, other than me, tested the script so far… Even so, I have an idea that may be useful to anticapitalista:
                                  – keep both ds-mouse and a new script (mine or any other Dave creates). Since Robin as made the Control Centre so smart, it is probably trivial to change the “Mouse settings” to use the current ds-mouse script if synaptics is detected or the new script that uses xinput, keeping everyone as happy as possible.

                                  Like noted somewhere else in the forum, xinput does not seem to be able to manage as many settings as synaptics, but I think the vast majority of computer users will be happy with the current features my script allows to manage via xinput. I confess that, until I began testing he script, the only thing I ever used was “turn touchpad off” (when I connected a mouse to my netbook) and a setting that decreased mouse sensitivity (I’m not sure what I tried), when I began testing antiX 23 alphas, etc. on my work desktop PC.

                                  P.

                                Viewing 15 posts - 46 through 60 (of 105 total)
                                • You must be logged in to reply to this topic.