Skip to content

Commit

Permalink
feat: Add a right click menu entry to trigger a check for updates in …
Browse files Browse the repository at this point in the history
…the systray applet (#258)

Add a right click menu entry to check for updates in the systray applet (runs `arch-update --check`), allowing to easily trigger a check for new pending updates without having to actually run `arch-update` by cliking systray or waiting for the systemd timer to pass (or without having to run `arch-update --check` manually via the terminal)
  • Loading branch information
Antiz96 authored Oct 1, 2024
1 parent 33f8bf1 commit 0f89ad2
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
8 changes: 6 additions & 2 deletions po/arch-update.pot
Original file line number Diff line number Diff line change
Expand Up @@ -588,11 +588,15 @@ msgstr ""
msgid "No service requiring a post upgrade restart found\\n"
msgstr ""

#: src/lib/tray.py:123
#: src/lib/tray.py:127
msgid "Run Arch-Update"
msgstr ""

#: src/lib/tray.py:124
#: src/lib/tray.py:128
msgid "Check for updates"
msgstr ""

#: src/lib/tray.py:129
msgid "Exit"
msgstr ""

Expand Down
8 changes: 6 additions & 2 deletions po/fr.po
Original file line number Diff line number Diff line change
Expand Up @@ -658,11 +658,15 @@ msgstr ""
msgid "No service requiring a post upgrade restart found\\n"
msgstr "Aucun service nécessitant un redémarrage suite à la mise à jour n'a été trouvé\\n"

#: src/lib/tray.py:123
#: src/lib/tray.py:127
msgid "Run Arch-Update"
msgstr "Lancer Arch-Update"

#: src/lib/tray.py:124
#: src/lib/tray.py:128
msgid "Check for updates"
msgstr "Vérifier les mises à jour"

#: src/lib/tray.py:129
msgid "Exit"
msgstr "Quitter"

Expand Down
7 changes: 7 additions & 0 deletions src/lib/tray.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@ def run(self):
""" Start arch-update """
arch_update()

def check(self):
""" Check for updates """
subprocess.run(["arch-update", "--check"], check=False)

def exit(self):
""" Close systray process """
sys.exit(0)
Expand All @@ -121,11 +125,14 @@ def __init__(self, iconfile):
# Menu
menu = QMenu()
menu_launch = QAction(_("Run Arch-Update"))
menu_check = QAction(_("Check for updates"))
menu_exit = QAction(_("Exit"))
menu.addAction(menu_launch)
menu.addAction(menu_check)
menu.addAction(menu_exit)

menu_launch.triggered.connect(self.run)
menu_check.triggered.connect(self.check)
menu_exit.triggered.connect(self.exit)

self.tray.setContextMenu(menu)
Expand Down

0 comments on commit 0f89ad2

Please sign in to comment.