今回は20-20-20ルールのリマインダーを改良します。
リマインダーの多重起動を防止します。設定済みならリマインダーを設定しません。

【目の健康を守るルール】. 「30 分に 1 回は、20 秒以上、遠くを見て目を休める。」
環境
・Omarchy v3.0.1
start_eye_reminder.shから以前に作成したスクリプトを呼ぶようにします。
~/.local/bin/start_desktop_reminder.sh
#!/bin/bash
desktop_reminder_active() { pgrep -f .local/bin/desktop_reminder.sh >/dev/null; }
if desktop_reminder_active; then
notify-send "リマインダーは設定済みです。"
exit 0
fi
~/.local/bin/desktop_reminder.sh 1200 "6m先を20秒間見ましょう。" "20分経過" "critical" && notify-send 20分後に通知します。
.local/share/applications/eye.desktop
[Desktop Entry]
Name=eye
Comment=20-20-20ルールのリマインダー
Exec=~/.local/bin/start_eye_reminder.sh
Terminal=false
Type=Application
Icon=utilities-terminal
Categories=Utility
~/.bashrc
alias eye='start_eye_reminder.sh'
以上です。
▼この記事がいいね!と思ったらブックマークお願いします
