eww icon indicating copy to clipboard operation
eww copied to clipboard

[BUG] Command keeps timing out, while `:timeout` has no effect

Open musjj opened this issue 1 year ago • 6 comments

Checklist before submitting an issue

  • [X] I have searched through the existing closed and open issues for eww and made sure this is not a duplicate
  • [X] I have specifically verified that this bug is not a common user error
  • [X] I am providing as much relevant information as I am able to in this bug report (Minimal config to reproduce the issue for example, if applicable)

Description of the bug

My command inside handlers like :on-hover times out very often, usually after not interacting with the element for a while. Most of my commands are just simple eww update var=value calls, so I'm not sure why it's timing out. I've tried setting the :timeout to a high value like "5s", but it doesn't seem to have any effect. Looking at eww logs, I can see that commands often time out instantly as you click/hover over the element.

Reproducing the issue

Use a widget that has any kind of handlers and add a command to it.

Expected behaviour

:timeout should have some kind of effect

Additional context

I have a slow computer, so that might be one of the factors causing the timeout.

musjj avatar Mar 19 '23 23:03 musjj

:timeout should really work in this context. Could you update to the latest master, and take a look at the logs with --debug enabled? They should mention that a command gets ran, and include the timeout in that log. If the timeout there isn't what you configured, there might be something wrong with the configuration...

elkowar avatar Mar 26 '23 11:03 elkowar

Tested with the latest commit, and I can reproduce the issue there.

Here's a widget to reproduce the issue:

(eventbox                                                             
  :onhover "sleep 3 && notify-send success" 
  :timeout "5s"
  (label :text "hello world"))

And here's the log:

 2023-03-27T23:52:23.126Z DEBUG eww::widgets            > Running command from widget [timeout: 200ms]: sleep 3 && notify-send success
 2023-03-27T23:52:23.326Z ERROR eww::widgets            > WARNING: command sleep 3 && notify-send success timed out

It seems that it's not registering the timeout I gave to it at all.

musjj avatar Mar 27 '23 23:03 musjj

having a similar issue where I wait for confirmation before executing and it timeouts the first try but it works next time after failing once widget:

(defwidget exitmenu []
    (box :orientation "v" :space-evenly "true" 
        (box :orientation "v" :space-evenly "true" :class "container" :spacing "6"
            (eventbox       :class "lock"
                            :tooltip "Lock"
                            :cursor "pointer"
                            :timeout "5s"
                            :onclick "bash ~/.config/eww/scripts/exitmenu/eventLock.sh" "󰌾")
                            
            (eventbox       :class "suspend"
                            :tooltip "Suspend"
                            :cursor "pointer"
                            :timeout "5s"
                            :onclick "bash ~/.config/eww/scripts/exitmenu/eventSuspend.sh" "󰤄")

            (eventbox       :class "logout"
                            :tooltip "Logout"
                            :cursor "pointer"
                            :timeout "5s"
                            :onclick "bash ~/.config/eww/scripts/exitmenu/eventLogout.sh" "󰗽")

            (eventbox       :class "reboot"
                            :tooltip "Reboot"
                            :cursor "pointer"
                            :timeout "5s"
                            :onclick "bash ~/.config/eww/scripts/exitmenu/eventReboot.sh" "󰜉")

            (eventbox       :class "shutdown"
                            :tooltip "Shutdown"
                            :cursor "pointer"
                            :timeout "5s"
                            :onclick "bash ~/.config/eww/scripts/exitmenu/eventShutdown.sh" "󰐥"))

))

log:

 2023-04-08T02:11:00.436Z DEBUG eww::widgets            > Running command from widget [timeout: 200ms]: bash ~/.config/eww/scripts/exitmenu/eventLogout.sh
 2023-04-08T02:11:00.636Z ERROR eww::widgets            > WARNING: command bash ~/.config/eww/scripts/exitmenu/eventLogout.sh timed out

Incognitux avatar Apr 08 '23 02:04 Incognitux

I have a similar issue - I have a button with :onclick "xdg-open https://github.com/notifications", and it instantly logs the timeout error, even though the command will work like 90% of the time.

n3oney avatar Jun 25 '23 18:06 n3oney

Not sure if related, but I have a :onhover event on a child widget, and a :onhoverlost on a parent widget. Sometimes when I mouse over the widgets very quickly, the :onhoverlost event is triggered before the :onhover event.

This causes state issues.

Wallboy avatar Jun 27 '23 07:06 Wallboy

I am also getting this issue with an input with:

(input :timout "1000ms" :onaccapt "eww update ... ; sleep 0.5s ; eww close")

Nickiel12 avatar Nov 02 '23 00:11 Nickiel12