i3blocks-contrib icon indicating copy to clipboard operation
i3blocks-contrib copied to clipboard

timer_and_stopwatch: add UNIX_TIME parameter to fix fullscreen use

Open stephengmatthews opened this issue 3 years ago • 10 comments

When LibreOffice Impress runs in presentation mode (press F5), the timer/stopwatch is not updated. The timer/stopwatch is updated when using full screen mode in i3, such as Firefox and terminal.

This PR relates to #255 in i3blocks (not i3blocks-contrib). I tried to find the cause of the issue but I admit I didn't know where to look (i3blocks? LibreOffice?). For this reason, I've added this as a config parameter to allow enabling/disabling rather than pushing for a bug fix.

This PR adds a UNIX_TIME parameter to the config. When enabled, unix time is used to calculate the time difference for incrementing the timer/stopwatch. The idea is that if the timer_and_stopwatch script is not run every second, say for 10 seconds because LibreOffice Impress is in presentation mode, then the next time the script runs the difference in unix time is 10 seconds, which is used for incrementing the timer/stopwatch. I've tested it and it works for me.

UNIX_TIME defaults to false, but can be enabled with UNIX_TIME=true in the config.

What are your thoughts?

stephengmatthews avatar Nov 23 '20 17:11 stephengmatthews

Wow! I can't believe someone is really using my blocklet. I'll give a look at this pr myself later, even if I don't have any permission to accept/deny/whatever.

Aster89 avatar Nov 23 '20 17:11 Aster89

Wow! I can't believe someone is really using my blocklet. I'll give a look at this pr myself later, even if I don't have any permission to accept/deny/whatever.

:) It's a useful blocklet -- thank you! I use it to track my time when working.

stephengmatthews avatar Nov 23 '20 18:11 stephengmatthews

Feeback on the reason for this change. Without it, I can start the timer, go full screen in Impress with F5, wait a few 10-20 seconds, exit full screen, and see that the time has elapsed.

Probably the behavior you observe depends on something other than i3/i3blocks, because I use them both.

Aster89 avatar Nov 23 '20 20:11 Aster89

Running i3blocks with -vv, I see sigwaitinfo(): Interrupted system call on standard error at some point between when Impress' full screen starts and stops. I don't know how to investigate further. Would the i3blocks repo be the correct place to raise this?

stephengmatthews avatar Nov 24 '20 18:11 stephengmatthews

Why not? Worst case scenario: someone will tell you what is he correct place ;)

Aster89 avatar Nov 24 '20 21:11 Aster89

I queried this behaviour on the i3blocks repo and they responded here. It seems that the timer/stopwatch not updating is expected.

@Aster89, you tried it for "a few second", would you mind trying for 5-10 seconds, which is how long I waited? I started using 1/2/3 seconds but sometimes found it difficult to spot non-updates after a few seconds. Also, I noticed the non-updates occur only when all i3bars are obscured when multiple monitors are used.

stephengmatthews avatar Nov 28 '20 14:11 stephengmatthews

@stephengmatthews, I've rectified my comment, as I did wait enough. Furthermore I've just tried now also on my laptop (same configuration: archlinux, i3, i3blocks, ...), and the timer seems to go just fine: I counted 20 seconds right after pressing F5, then pressed Escape, and the timer correctly showed 20-ish seconds less (I guess my counting is ish, not the timer).

Unfortunately I cannot try a multi-monitor configuration. I guess you can try with a single monitor instead, right?

As regards the presentation, I just used the empty one you get when opening LibreOffice Impress.

Aster89 avatar Nov 29 '20 06:11 Aster89

Thanks for trying again @Aster89.

I've tried on my laptop without external monitor, and I see the timer/stopwatch not updating -- so, same as before for me.

I used the same empty presentation as yourself.

To test and poke around a bit more, I set the display mode to hide, restarted i3, and verified that: 1) the timer/stopwatch did not update when i3bar was hidden, and 2) the timer/stopwatch did update whilst holding the mod key. Could you test this setting, please? I'm hoping this could reveal something to point us in the right direction!

stephengmatthews avatar Nov 30 '20 18:11 stephengmatthews

Forgot to mention: I'm using Ubuntu 18.04.

stephengmatthews avatar Nov 30 '20 18:11 stephengmatthews

With the bar mode set to hide, I observe the same behavior you describe, but this has nothing to do with LibreOffice Impress. Maybe you can try address this, and you'll find the issue with impress solved automatically, I don't know.

In comparison, the following blocklet for time and date works just fine

[time]
command=date '+ %H:%M:%S'
interval=1
separator=false

Aster89 avatar Dec 01 '20 13:12 Aster89