4 个版本
0.3.2 | 2022 年 8 月 25 日 |
---|---|
0.3.1 | 2022 年 7 月 6 日 |
0.2.1 | 2022 年 4 月 7 日 |
0.2.0 | 2022 年 3 月 4 日 |
#16 in #notifier
34KB
463 行
Blink
Blink 是一个非常小的单二进制程序,可以帮助你在使用计算机时记住休息(并眨眼)。
功能
- 创建具有不同间隔、权重、超时和衰减提示的多个休息类型。
- 具有可自定义描述的通知。
- 在休息时间到来时播放声音。
- 跟踪计算机是否被使用:超时后,计时器将暂停或重置。
安装
您可以从 GitHub 发布 下载最新的可执行文件。
用法
在后台启动可执行文件。您可能希望将其在系统启动时运行,但您也可以从终端尝试。
配置
如果尚未存在,将在您的系统配置目录(Linux上的 ~/.config
)中生成默认的 blink.toml
配置文件。您可以使用 blink -c [path]
指定不同的配置文件。
以下示例仅供参考,并用于配置程序以符合您的需求。持续时间类型指定为字符串形式的秒数。
# The delay between each update.
update_delay = "1"
# How long it takes for the timer to pause after receiving no input.
input_timeout = "30"
# How long it takes for the timer to reset after receiving no input.
input_reset = "300"
# The delay between updates at which the timer resets. This is caused by your computer sleeping.
timeout_reset = "200"
# How long the notifications are displayed.
notification_timeout = "10"
# Resets the timer when the notification is pressed (only supported on Linux)
notification_press_reset = true
# Templates for the time description in the notification.
time_descriptions = ["Using the computer for {} minutes.", "Staring at the screen for {} minutes."]
# The path of the directory the sounds are loaded from. You can specify a different sound for earch break type.
sounds_dir = "/path/to/my/sounds"
# You can specify multiple break types / timers.
[[break]]
# Required: title of the break, will be shown on notifications.
title = "Micro break"
# Required: the interval between each break.
interval = "1200"
# A list of random descriptions. A random one will be shown in notifications
descriptions = ["Don't forget to blink your eyes.", "Look away from the screen for a moment.", "Make sure you have a good posture."]
[[break]]
title = "Computer break"
interval = "1800"
# How long it takes for the break to become 'active'.
timeout = "2000"
# Breaks with a higher weight will be chosen before others.
weight = 2
# The decay of the break interval after each prompt. A decay of 1.0 will multiply the interval with 0.5 after each prompt.
decay = 0.5
descriptions = ["Get away from behind your screen!", "Time to relax for a moment!"]
# The sound to play on each prompt. Refering to a file in the sounds_dir.
# Note that only the .ogg (vorbis) codec is supported!
# You can use ffmpeg to convert audio files: ffmpeg -i mysound.mp3 mysound.ogg
sound_file = "time-for-a-break.ogg"
# How long the sound should be played.
sound_duration = "10"
# A command that gets run on the break
command = 'mpv "https://www.youtube.com/watch?v=dQw4w9WgXcQ"'
依赖项
~7–38MB
~595K SLoC