jersou / mouse-actions

mouse-actions execute some command from mouse events such as clicks/wheel on the side/corners of the screen, or drawing shapes. It's a mix between Easystroke and Compiz edge commands.
MIT License
173 stars 7 forks source link

Output spam when stopping mouse-actions[-gui] #9

Open pallaswept opened 1 year ago

pallaswept commented 1 year ago

When stopping the app, as it exits, it seems to spam a lot of Ctrl+C messages. This occurs slightly differently in the CLI and GUI version.

[2023-06-28T07:44:40Z DEBUG mouse_actions::process_event] Process event duration : 10.885132ms
^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C

Note the multiple ^C - I did not type those, I pressed Ctrl+C one time. When using the GUI version it does this too. As an example:

pallaswept@Pallas:~> mouse-actions-gui -n -l trace stop
Args {
    no_listen: true,
    config_path: None,
    command: Some(
        Stop,
    ),
    version: false,
    log_level: Some(
        "trace",
    ),
}
[2023-06-28T08:01:17Z DEBUG mouse_actions::process_args] log_level=trace
[2023-06-28T08:01:17Z TRACE mouse_actions::process_args] version : 0.4.2-VERGEN_IDEMPOTENT_OUTPUT (2023-06-28)
[2023-06-28T08:01:17Z TRACE mouse_actions::process_args] args = Args {
        no_listen: true,
        config_path: None,
        command: Some(
            Stop,
        ),
        version: false,
        log_level: Some(
            "trace",
        ),
    }!
[2023-06-28T08:01:17Z TRACE users::base] Running getuid
[2023-06-28T08:01:17Z TRACE users::base] Running getpwuid_r for user #1000
[2023-06-28T08:01:17Z TRACE users::base] Loading user with uid 1000
[2023-06-28T08:01:17Z INFO  mouse_actions::single_instance] killing the old instance with pid 17825
[2023-06-28T08:01:17Z TRACE users::base] Running getuid
[2023-06-28T08:01:17Z TRACE users::base] Running getpwuid_r for user #1000
[2023-06-28T08:01:17Z TRACE users::base] Loading user with uid 1000
[2023-06-28T08:01:17Z INFO  mouse_actions::process_args] mouse_actions successfully stopped
pallaswept@Pallas:~> 
pallaswept@Pallas:~> 
pallaswept@Pallas:~> 
pallaswept@Pallas:~> 
pallaswept@Pallas:~> 
pallaswept@Pallas:~> 
pallaswept@Pallas:~> 
pallaswept@Pallas:~> 
pallaswept@Pallas:~> 
pallaswept@Pallas:~> 
pallaswept@Pallas:~> 
pallaswept@Pallas:~> 
pallaswept@Pallas:~> 
pallaswept@Pallas:~> 
pallaswept@Pallas:~> 
pallaswept@Pallas:~> 
pallaswept@Pallas:~> 
pallaswept@Pallas:~> 
pallaswept@Pallas:~> 
pallaswept@Pallas:~> 
pallaswept@Pallas:~> 
pallaswept@Pallas:~> 
pallaswept@Pallas:~> 
pallaswept@Pallas:~> 
pallaswept@Pallas:~> 
pallaswept@Pallas:~> 
pallaswept@Pallas:~> 
pallaswept@Pallas:~> 
pallaswept@Pallas:~> 
pallaswept@Pallas:~> 
pallaswept@Pallas:~> 
pallaswept@Pallas:~> 
pallaswept@Pallas:~> 
pallaswept@Pallas:~> 
pallaswept@Pallas:~> 
pallaswept@Pallas:~> 
pallaswept@Pallas:~> 
pallaswept@Pallas:~> 
pallaswept@Pallas:~> 
pallaswept@Pallas:~> 
pallaswept@Pallas:~> 
pallaswept@Pallas:~> 
pallaswept@Pallas:~> 
pallaswept@Pallas:~> 
pallaswept@Pallas:~> 
pallaswept@Pallas:~> 
pallaswept@Pallas:~> 
pallaswept@Pallas:~> 
pallaswept@Pallas:~> 
pallaswept@Pallas:~> 
pallaswept@Pallas:~> 
pallaswept@Pallas:~> 
pallaswept@Pallas:~> 
pallaswept@Pallas:~> 
pallaswept@Pallas:~> 
pallaswept@Pallas:~> 
pallaswept@Pallas:~> 
pallaswept@Pallas:~> 
pallaswept@Pallas:~> 
pallaswept@Pallas:~> 
pallaswept@Pallas:~> 
pallaswept@Pallas:~> 
pallaswept@Pallas:~> 
pallaswept@Pallas:~> 

In the case of the GUI app, this sometimes causes the (assumedly ctrl+c but it could be enter or something else?) to be passed into the next GUI app, for example I once did this and the next active window was my browser, which blinked a few times before crashing.

Slightly offtopic but some good news is that I have managed to develop a working fedora/opensuse compliant build script. This was no mean feat, as RPMs are built in a virtualised environment with no network access (to ensure the source really can be built from source without further sources), so naturally neither npm or cargo could function. The solution in brief is to parse the source code from the development workstation, to generate local copies of all of the online dependencies, which are then archived and those archives included as part of the package source (along with the git sources), extracted, and the npm and cargo invocations are altered to use the local sources for the build.

I also had to overcome a number of bugs with the private instance of opensuse's appliance for this, so it's taken several weeks to overcome the npm and cargo challenges without a working build environment. But as of today, I have the solution at hand, which means I will now be able to focus on developing the app itself. My next steps are to author a systemd service file for the CLI version, and a .desktop file for the GUI, which will also need modifications to the start/stop functions, to make it compatible with the CLI acting as the daemon (but of course retain their current function if the daemon is not enabled), and then I will focus on allowing mouse buttons as modifiers as this is the greatest issue I'm facing personally. If there's anything in particular you would prefer me to work on first, please do let me know, as my real first priority with this project is to support you.