Skip to content

Commit

Permalink
fix(systray): Prevent multiple instances of the systray applet to be …
Browse files Browse the repository at this point in the history
…able to run at the same time

Add a test to check if there's already a running instance of the systray applet before starting it to avoid the possibility to have multiple instances running at the same time.

Fixes #196
  • Loading branch information
Antiz96 committed Jul 4, 2024
1 parent 2b3857f commit 62f2492
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
5 changes: 5 additions & 0 deletions po/arch-update.pot
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,11 @@ msgid ""
"from your app menu"
msgstr ""

#: src/script/arch-update.sh:763
#, sh-format
msgid "There's already a running instance of the Arch-Update systray applet"
msgstr ""

#: src/script/arch-update-tray.py:118
msgid "Run Arch-Update"
msgstr ""
Expand Down
5 changes: 5 additions & 0 deletions po/fr.po
Original file line number Diff line number Diff line change
Expand Up @@ -548,6 +548,11 @@ msgstr ""
"immédiatement, vous pouvez lancer l'application \"Arch-Update Systray Applet\" "
"depuis votre menu d'application"

#: src/script/arch-update.sh:763
#, sh-format
msgid "There's already a running instance of the Arch-Update systray applet"
msgstr "Il y a déjà une instance de l'applet systray d'Arch-Update en cours d'exécution"

#: src/script/arch-update-tray.py:118
msgid "Run Arch-Update"
msgstr "Lancer Arch-Update"
Expand Down
5 changes: 5 additions & 0 deletions src/script/arch-update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -759,6 +759,11 @@ case "${option}" in
state_up_to_date
fi

if ps -ef | grep "[a]rch-update-tray"; then
error_msg "$(eval_gettext "There's already a running instance of the Arch-Update systray applet")"
exit 3
fi

arch-update-tray || exit 3
fi
;;
Expand Down

0 comments on commit 62f2492

Please sign in to comment.