Skip to content

pomodoro: store datetime instead of using ticks, add nag config#694

Merged
ammgws merged 1 commit intogreshake:masterfrom
GChicha:master
May 21, 2020
Merged

pomodoro: store datetime instead of using ticks, add nag config#694
ammgws merged 1 commit intogreshake:masterfrom
GChicha:master

Conversation

@GChicha
Copy link
Contributor

@GChicha GChicha commented May 17, 2020

I tried to use the pomodoro block with the hide mode enabled in sway, however I notice that it didn't update while the bar is not visible. I've made some fixes to the block, changed the behavior to not update a counter, now it stores the DateTime when the pomodoro starts.

I still have some problems calling swaynag or i3-nagbar when the bar is not visible.

@ammgws
Copy link
Collaborator

ammgws commented May 19, 2020

@ghedamat Could you please confirm?

@ghedamat
Copy link
Contributor

Yup. I'll review and test soon and report back!

@GChicha
Copy link
Contributor Author

GChicha commented May 19, 2020

I realize now that I forgot to document the new config I added to the block.
As I understand i3status is not running when it's in hide mode. Therefore, it is not possible to call the nagbar in the meantime. Is there any workaround to do this?

@ammgws
Copy link
Collaborator

ammgws commented May 20, 2020

Is there any workaround to do this?

  1. i3status/blocks bar hangs up from time to time i3/i3#3242 (comment)

  2. or perhaps Prevent bar being stopped by using signal other than SIGSTOP #701

  3. and/or send a PR to i3 to allow disabling the whole SIGSTOP/SIGCONT feature (see i3status/blocks bar hangs up from time to time i3/i3#3242)

First see if #701 works

ammgws added a commit to ammgws/i3status-rust that referenced this pull request May 21, 2020
i3 sends SIGSTOP to the bar when it is hidden, which causes the bar to stop
updating. This is done for "power savings" and is not configurable in i3 at
the moment, which inconveniences users of blocks in i3status-rs that are
meant to be running at all times.

Luckily i3 lets us customise the signal it sends, so we can set it to something
other than SIGSTOP to effectively allow non-interrupted of the bar in all
situations.

Fixes greshake#503, greshake#694 and possibly others.
Copy link
Contributor

@ghedamat ghedamat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@GChicha this looks great, tested locally and works well. Just left a comment on an icon that you changed.

when I implemented this I was lazy and eager to get it in, so I didn't feel like doing the time math and went for the tick solution, but this is so much better :)

and was also suggested at the time by @atheriel :)

def 👍 for me!

@ammgws ammgws changed the title Fix pomodoro when sway bar config is set to hide pomodoro: store datetime instead of using ticks, add nag config May 21, 2020
@GChicha
Copy link
Contributor Author

GChicha commented May 21, 2020

I made a small change, instead of using DateTime now it uses Instant. I don't expect any differences.

@ammgws ammgws merged commit 4f15fd1 into greshake:master May 21, 2020
@ammgws
Copy link
Collaborator

ammgws commented May 21, 2020

Thanks!

ammgws added a commit to ammgws/i3 that referenced this pull request May 28, 2020
i3bar has a "power savings" feature that pauses the bar when it is hidden or
obscured by a fullscreen app. However this becomes a problem for some users who
use status line generators such as i3status-rust that have blocks that need
to run at all times. A hacky way to prevent this from happening is to set
stop_signal to a signal that won't cause the status line generator program to stop,
however I do not believe that is a good solution. This PR adds an option on the i3 side
to allow the user to disable this feature in the first place.

This has surprised users a fair amount of time over the past few years, to show a few:
greshake/i3status-rust#503
greshake/i3status-rust#694 (comment)
https://faq.i3wm.org/question/4631/dont-sigstop-when-in-hide-mode.1.html
i3#3242 (comment)
https://www.reddit.com/r/i3wm/comments/gm6yfh/is_there_a_painless_way_to_keep_i3bar_children/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants