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
170 stars 6 forks source link

xdotool leaves lots of defunct/zombie processes #56

Open niawag opened 2 weeks ago

niawag commented 2 weeks ago

Hi and thanks for this great tool, I'm using it with xdotool to perform operation but I just noticed that each time I use an action the xdotool process stays running as a defunct process (that can't be killed). If I run the same command inside a terminal there is no defunct process left. Am I the only one affected by this ? Do you know if there is a way to prevent that ?

Here is my config:

{
  "shape_button": "Right",
  "bindings": [
    {
      "comment": "refresh",
      "event": {
        "button": "Right",
        "event_type": "Shape",
        "shapes_xy": [
          [
            0,
            0,
            16,
            48,
            32,
            111,
            32,
            206,
            63,
            286,
            63,
            381,
            63,
            476,
            63,
            556,
            63,
            651,
            63,
            746,
            63,
            825,
            63,
            873,
            63,
            905,
            63,
            937,
            48,
            968,
            48,
            984,
            48,
            1000
          ]
        ]
      },
      "cmd_str": "xdotool key ctrl+r"
    },
    {
      "comment": "back",
      "event": {
        "button": "Right",
        "event_type": "Shape",
        "shapes_xy": [
          [
            1000,
            39,
            971,
            39,
            928,
            33,
            876,
            33,
            824,
            29,
            761,
            29,
            690,
            23,
            627,
            16,
            562,
            16,
            490,
            10,
            435,
            10,
            389,
            3,
            346,
            3,
            304,
            3,
            265,
            3,
            232,
            3,
            212,
            0,
            183,
            0,
            154,
            0,
            127,
            0,
            108,
            0,
            85,
            0,
            65,
            0,
            49,
            0,
            36,
            0,
            20,
            0,
            13,
            0,
            7,
            0,
            3,
            0,
            0,
            0,
            0,
            0
          ]
        ]
      },
      "cmd_str": "xdotool key alt+Left"
    },
    {
      "comment": "forward",
      "event": {
        "button": "Right",
        "event_type": "Shape",
        "shapes_xy": [
          [
            0,
            12,
            37,
            0,
            98,
            0,
            207,
            0,
            366,
            0,
            549,
            0,
            720,
            0,
            829,
            0,
            927,
            0,
            988,
            0,
            1000,
            0
          ]
        ]
      },
      "cmd_str": "xdotool key Alt+Right"
    },
    {
      "comment": "toggle volume",
      "event": {
        "button": "Middle",
        "modifiers": [
          "ShiftLeft"
        ],
        "event_type": "Click"
      },
      "cmd_str": "xdotool key --clearmodifiers XF86AudioMute"
    },
    {
      "comment": "volume up",
      "event": {
        "button": "WheelUp",
        "modifiers": [
          "ShiftLeft"
        ],
        "event_type": "Release"
      },
      "cmd_str": "xdotool key --clearmodifiers XF86AudioRaiseVolume"
    },
    {
      "comment": "volume down",
      "event": {
        "button": "WheelDown",
        "modifiers": [
          "ShiftLeft"
        ],
        "event_type": "Release"
      },
      "cmd_str": "xdotool key --clearmodifiers XF86AudioLowerVolume"
    }
  ]
}

I'm using it on Linux Mint 22 x64 with latest mouse-actions binary (0.4.5) with a systemd user service (that might be part of the problem):

[Unit]
Description=mouse-actions

[Service]
ExecStart=/pathto/mouse-actions start
ExecStop=/pathto/mouse-actions stop
ExecReload=/pathto/mouse-actions stop && /pathto/mouse-actions start

[Install]
WantedBy=graphical-session.target
niawag commented 2 weeks ago

I tried to run mouse-actions directly from terminal and I'm having the same problem of zombie processes

jersou commented 1 week ago

I confirm, I have the same bug, I'll try to figure out why