Skip to content

Sound, emojis, notifications#2

Open
r14n wants to merge 1 commit intoamireldor:masterfrom
r14n:master
Open

Sound, emojis, notifications#2
r14n wants to merge 1 commit intoamireldor:masterfrom
r14n:master

Conversation

@r14n
Copy link
Copy Markdown

@r14n r14n commented Mar 24, 2026

Enhanced the timer a little bit. It will play a recurring bell sound, notify via system notify-send, and flash a bell icon when the timer is up

Enhanced the timer a little bit.  It will play a recurring bell sound, notify via system notify-send, and flash a bell icon when the timer is up
@amireldor
Copy link
Copy Markdown
Owner

Hi @r14n, thanks for the PR, sorry for the late response. I must've missed some notification.

Copy link
Copy Markdown
Owner

@amireldor amireldor left a comment

Choose a reason for hiding this comment

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

Hi @r14n and thanks again for the PR.

The guide for my comments was directed by the idea of "let's keep the same previous behavior" so it doesn't break expected behavior for any users who might be using this for some reason. Thanks for the enhancements!

Comment thread i3blockstimerthing.py
inner_text = f"{icon}<span font_family='monospace'>{to_display}</span>"
display_text = f'<span color="green">{inner_text}</span>'

subprocess.Popen(["paplay", "/usr/share/sounds/freedesktop/stereo/complete.oga"],
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Please make this filepath customizable via getenv("SOME_NAMING_YOU_CAN_CHOOSE", "1") as in the other options above.

Comment thread i3blockstimerthing.py
Comment on lines +94 to +95
if seconds_count % 2 == 0:
icon = "🔔 "
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

I think this should be customizable too (with flashing on/off).
Maybe you can "expand" pomodoro_warning values:
"0" or empty - no pomodoro_warning
"1" - existing behavior
"flashing" - your new logic

Comment thread i3blockstimerthing.py
def format_time(seconds_count):
if seconds_count < 3600:
minutes = str(int(seconds_count / 60))
minutes = str(int(seconds_count / 60)).zfill(2)
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Sorry to nitpick, I think this should be also customizable via an env var as "zfill on/off" or similar.

Comment thread i3blockstimerthing.py
from typing import Tuple

filename = getenv("I3BLOCKSTIMERTHING_FILE", "/tmp/i3blockstimerthing.txt")
notified_file = filename + ".notified"
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Is a new file really necessary? Why not use write_stuff_to_file with a new boolean, and write to it when you need to change the notified value?

I prefer to not "pollute" the filesystem with an additional file.

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.

2 participants