From c8ea6ee9f88e6383318ea3d77950929f068389e9 Mon Sep 17 00:00:00 2001 From: Storm Dragon Date: Wed, 17 Apr 2024 16:12:03 -0400 Subject: [PATCH] Fixed long standing bug of remind having more than one instance start if I3 was restarted. --- i38.sh | 4 ++-- scripts/launch_remind.sh | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) create mode 100755 scripts/launch_remind.sh diff --git a/i38.sh b/i38.sh index 2b45090..52a1300 100755 --- a/i38.sh +++ b/i38.sh @@ -598,7 +598,7 @@ bindsym Shift+o exec $(command -v orca) --replace, mode "default" # reload the configuration file bindsym Control+semicolon exec bash -c '$i3msg -t run_command reload && spd-say -P important -Cw "I38 Configuration reloaded."', mode "default" # restart i3 inplace (preserves your layout/session, can be used to upgrade i3) -bindsym Control+Shift+semicolon exec bash -c 'killall remind || true && $i3msg -t run_command restart && spd-say -P important -Cw "I3 restarted."', mode "default" +bindsym Control+Shift+semicolon exec $i3msg -t run_command restart && spd-say -P important -Cw "I3 restarted.", mode "default" # Run dialog with exclamation bindsym Shift+exclam exec ${i3Path}/scripts/run_dialog.sh, mode "default" # exit i3 (logs you out of your X session) @@ -635,7 +635,7 @@ if [[ -x "/usr/libexec/notification-daemon" ]]; then echo 'exec_always --no-startup-id /usr/libexec/notification-daemon -r' fi if command -v remind &> /dev/null && command -v notify-send &> /dev/null ; then - echo "exec_always --no-startup-id $(command -v remind) -z '-k:${HOME}/.config/i3/scripts/reminder.sh %s &' ${HOME}/.reminders < /dev/null > /dev/null 2>&1" + echo "exec_always --no-startup-id ${i3Path}/scripts/launch_remind.sh" touch ~/.reminders fi if [[ $batteryAlert -eq 0 ]]; then diff --git a/scripts/launch_remind.sh b/scripts/launch_remind.sh new file mode 100755 index 0000000..4737039 --- /dev/null +++ b/scripts/launch_remind.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +pgrep remind > /dev/null 2>&1 && exit 0 +command remind -z '-k:${HOME}/.config/i3/scripts/reminder.sh %s &' ${HOME}/.reminders < /dev/null > /dev/null 2>&1 &