Skip to content

Commit

Permalink
Add a systray applet (#149)
Browse files Browse the repository at this point in the history
* - Implement systray icon

* - use user statefile

* - matching state styling

* Add pylint to CI

* - Avoid import errors as there's no use checking them here
- - Doing so successfully would require we use python pip for our packaging, which is a problem for another day
- Some minor alterations for pylint

* - Fixed some pylint warnings

* - switch exception to importerror

* - pylint docstrings

* - ignore pylint module name

* - Remove Gtk3
- Remove exo open
- Remove kioclient
- Remove gettext

* - check for /usr/local prefix

* Add the --tray arg to the main script to launch the Arch-Update systray applet

* Add the systemd service 'arch-update-tray.service' to start the Arch-Update systray applet

* Remove the arch-update-tray.service on make uninstall

* Add systray dependencies to READMEs

* Initialize state file if it doesn't exists
To avoid the systray failing with 'Statefile does not exists' on the first run

* Use the --tray arg of the main script in the systemd service
Calling the python script directly does not make sure that the statefile exists, risking that it fails with 'Statefile does not exists' error

* Add the missing qt6-svg dependency to READMEs

* Update po files

* Restart the tray systemd service on failure

* Add the systray documentation to the man pages

* Simplify the overall README and adapt it to the new systray applet

* Typo in README

* Another typo in README

* Yet another typo in README

* Use long opts in README

* Little fix in README

* Simplify the overall FR README and adapt it to the new systray applet

* Fix the wayland specific dependency in READMEs

* Use regular Arch-Update icon in notifications

* Add new screenshots to the READMEs

* Add logo to the READMEs

* Allow inline html in READMEs

* Remove useless screenshots from READMEs

* Various fixes in FR README

* Style fix in man page

* Improve wording in FR README

* Various improvements in French doc

---------

Co-authored-by: Robin Candau <[email protected]>
  • Loading branch information
trigg and Antiz96 authored May 10, 2024
1 parent 0dd8485 commit fdbe905
Show file tree
Hide file tree
Showing 15 changed files with 425 additions and 344 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,6 @@ jobs:

- name: Run shellcheck
run: find . -name '*.sh' -exec shellcheck --color=always {} +

- name: Run pylint
run: find . -name '*.py' -exec pylint -d E0611,E0401,C0103 --output-format=colorized {} +
3 changes: 3 additions & 0 deletions .github/workflows/mdl_style.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@

# Exclude the rules that refers to the line length
exclude_tag :line_length

# Allow inline HTML
exclude_tag :html
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ all:
install:
# Install the main script
install -Dm 755 "src/script/${pkgname}.sh" "${DESTDIR}${PREFIX}/bin/${pkgname}"
install -Dm 755 "src/script/${pkgname}-tray.py" "${DESTDIR}${PREFIX}/bin/${pkgname}-tray"

# Install icons
install -Dm 664 "src/icons/${pkgname}.svg" "${DESTDIR}${PREFIX}/share/icons/hicolor/scalable/apps/${pkgname}.svg"
Expand All @@ -21,7 +22,8 @@ install:
# Install systemd units
install -Dm 644 "res/systemd/${pkgname}.service" "${DESTDIR}${PREFIX}/lib/systemd/user/${pkgname}.service"
install -Dm 644 "res/systemd/${pkgname}.timer" "${DESTDIR}${PREFIX}/lib/systemd/user/${pkgname}.timer"

install -Dm 644 "res/systemd/${pkgname}-tray.service" "${DESTDIR}${PREFIX}/lib/systemd/user/${pkgname}-tray.service"

# Generate and install .mo files for translations
# .mo files are installed as "Arch-Update.mo" to avoid conflicting with the "arch-update.mo" files shipped by the arch-update Gnome extension (https://extensions.gnome.org/extension/1010/archlinux-updates-indicator/)
msgfmt po/fr.po -o po/fr.mo
Expand Down Expand Up @@ -55,6 +57,7 @@ install:
uninstall:
# Delete the main script
rm -f "${DESTDIR}${PREFIX}/bin/${pkgname}"
rm -f "${DESTDIR}${PREFIX}/bin/${pkgname}-tray"

# Delete icons
rm -rf "${DESTDIR}${PREFIX}/share/icons/hicolor/scalable/apps/${pkgname}.svg"
Expand All @@ -66,6 +69,7 @@ uninstall:
# Delete systemd units
rm -f "${DESTDIR}${PREFIX}/lib/systemd/user/${pkgname}.service"
rm -f "${DESTDIR}${PREFIX}/lib/systemd/user/${pkgname}.timer"
rm -f "${DESTDIR}${PREFIX}/lib/systemd/user/${pkgname}-tray.service"

# Delete .mo files
rm -f "${DESTDIR}${PREFIX}/usr/share/locale/fr/LC_MESSAGES/${_pkgname}.mo"
Expand Down
148 changes: 60 additions & 88 deletions README-fr.md

Large diffs are not rendered by default.

147 changes: 61 additions & 86 deletions README.md

Large diffs are not rendered by default.

28 changes: 17 additions & 11 deletions doc/man/arch-update.1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.TH "ARCH-UPDATE" "1" "March 2024" "Arch-Update 1.15.0" "Arch-Update Manual"
.TH "ARCH-UPDATE" "1" "May 2024" "Arch-Update 1.15.0" "Arch-Update Manual"

.SH NAME
arch-update \- An update notifier/applier for Arch Linux that assists you with important pre/post update tasks.
Expand All @@ -8,7 +8,7 @@ arch-update \- An update notifier/applier for Arch Linux that assists you with i
[\fI\,OPTION\/\fR]

.SH DESCRIPTION
An update notifier/applier for Arch Linux that assists you with important pre/post update tasks and that includes a (.desktop) clickeable icon that can easily be integrated with any DE/WM, dock, status/launch bar or app menu.
An update notifier/applier for Arch Linux that assists you with important pre/post update tasks and that includes a clickeable systray applet for an easy integration with any panel on any DE/WM.
.br
.RB "Optional support for AUR packages update (through " "yay " "or " "paru" "), Flatpak packages update (through " "flatpak" ") and desktop notifications (through " "libnotify" ")."

Expand All @@ -22,19 +22,19 @@ Before performing the update, it offers to display the latest Arch Linux news to
.br
Arch-Update also checks for orphan packages, unused Flatpak packages, old and/or uninstalled cached packages in pacman's cache, pacnew/pacsave files and pending kernel update requiring a reboot to be applied and, if there are, offers to process them.
.br
Those functions are launched when you click on the (.desktop) icon.
Those functions are launched when you click on the systray applet.

.PP

.TP
.B \-c, \-\-check
Check for available updates and change the (.desktop) icon accordingly if there are.
Check for available updates.
.br
.RB "It sends a desktop notification containing the number of available updates if " "libnotify " "is installed."
.br
.RB "It supports AUR packages update (if " "yay " "or " "paru " "is installed) and Flatpak packages update (if " "flatpak " "is installed)."
.br
.RB "The " "\-\-check " "option is automatically launched at boot and then every hour if you enabled the " "systemd.timer " "with the following command:"
.RB "The " "\-\-check " "option is automatically launched at boot and then every hour if you enabled the associated " "systemd.timer " "with the following command:"
.br
.B systemctl \-\-user enable \-\-now arch-update.timer

Expand All @@ -44,7 +44,7 @@ Display the list of pending updates.

.TP
.B \-d, \-\-devel
Include AUR development packages updates
Include AUR development packages updates.

.TP
.B \-n, \-\-news
Expand All @@ -54,12 +54,16 @@ Display latest Arch news.

.TP
.B \-D, \-\-debug
Display debug traces
Display debug traces.

.TP
.B \-\-gen\-config
.RB "Generate a default/example configuration file (see the " "arch-update.conf(5) " "man page for more details)."

.TP
.B \-\-tray
.RB "Launch the Arch-Update systray applet (you can alternatively start/enable the associated systemd service like so: " "systemctl \-\-user enable \-\-now arch-update-tray.service").

.TP
.B \-v, \-\-version
Display version information.
Expand All @@ -73,10 +77,12 @@ Display the help message.

.SH USAGE
.TP
.B The (.desktop) icon
.RB "The (.desktop) icon is located in " "/usr/share/applications/arch-update.desktop " "(or in " "/etc/local/share/applications/arch-update.desktop " "if you installed arch-update from source)."
.B The systray applet
.RB "To start the systray applet automatically at boot, add the " "arch-update --tray " "command to your auto-start commands/WM config or start/enable the associated systemd service like so: " "systemctl \-\-user enable \-\-now arch-update-tray.service"
.br
The systray icon will automatically change depending on the current state of your system ('up to date' or 'updates available'). It will launch the relevant series of functions to perform a complete and proper update when clicked.
.br
It will automatically change depending on different states (checking for updates, updates available, installing updates, up to date). It will launch the relevant series of functions to perform a complete and proper update when clicked. It is easy to integrate with any DE/WM, docks, launch bars or app menus.
.RB "Alternatively, if you don't have/want systray support, there's a regular .desktop file (under " "/usr/share/applications/arch-update.desktop " "or " "/usr/local/share/applications/arch-update.desktop " "if you installed Arch-Update from source). Note that, unlike the systray applet, the .desktop icon does " "not " "dynamically change depending on the current state of your system ('up to date' or 'updates available')."

.TP
.B The systemd timer
Expand Down Expand Up @@ -138,7 +144,7 @@ No privilege elevation method (sudo or doas) is installed

.TP
.B 3
Error when changing icon
Error when launching the Arch-Update systray applet

.TP
.B 4
Expand Down
28 changes: 17 additions & 11 deletions doc/man/fr/arch-update.1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.TH "ARCH-UPDATE" "1" "Mars 2024" "Arch-Update 1.15.0" "Manuel de Arch-Update"
.TH "ARCH-UPDATE" "1" "Mai 2024" "Arch-Update 1.15.0" "Manuel de Arch-Update"

.SH NAME
arch-update \- Un notificateur/applicateur de mises à jour pour Arch Linux qui vous assiste dans les tâches importantes d'avant/après mise à jour.
Expand All @@ -8,7 +8,7 @@ arch-update \- Un notificateur/applicateur de mises à jour pour Arch Linux qui
[\fI\,OPTION\/\fR]

.SH DESCRIPTION
Un notificateur/applicateur de mises à jour pour Arch Linux qui vous assiste dans les tâches importantes d'avant/après mise à jour et qui inclut une icône cliquable (.desktop) qui peut facilement être intégrée à n'importe quel environnement de bureau/gestionnaire de fenêtres, dock, barre d'état, barre de lancement ou menu d'application.
Un notificateur/applicateur de mises à jour pour Arch Linux qui vous assiste dans les tâches importantes d'avant/après mise à jour et qui inclut une applet systray cliquable pour une intégration facile avec n'importe quel panneau sur n'importe quel DE/WM.
.br
.RB "Prise en charge optionnelle des mises à jour des paquets AUR (via " "yay " "or " "paru" "), des mises à jour des paquets Flatpak (via " "flatpak" ") et des notifications de bureau (via " "libnotify" ")."

Expand All @@ -22,19 +22,19 @@ Avant d'effectuer la mise à jour, propose d'afficher les dernières Arch news
.br
Arch-Update vérifie aussi la présence de paquets orphelins/inutilisés, d'anciens paquets mis en cache, de fichiers pacnew/pacsave et de mise à jour du noyau en attente et, s'il y en a, propose de les traiter.
.br
Ces fonctions sont lancées quand vous cliquez sur l'icône (.desktop).
Ces fonctions sont lancées quand vous cliquez sur l'applet systray.

.PP

.TP
.B \-c, \-\-check
Vérifier les mises à jour disponibles and changer l'icône (.desktop) en conséquence s'il y en a.
Vérifier les mises à jour disponibles.
.br
.RB "Cela envoie une notification de bureau contenant le nombre de mise à jour disponibles si " "libnotify " "est installé."
.br
.RB "Supporte les mises à jour des paquets AUR (si " "yay " "ou " "paru " "est installé) et les mises à jour des paquets Flatpak (si " "flatpak " "est installé)."
.br
.RB "L'option " "\-\-check " "est automatiquement lancée au démarrage du système puis une fois chaque heure si vous avez activé le " "systemd.timer " "avec la commande suivante :"
.RB "L'option " "\-\-check " "est automatiquement lancée au démarrage du système puis une fois chaque heure si vous avez activé le " "systemd.timer " "associé avec la commande suivante :"
.br
.B systemctl \-\-user enable \-\-now arch-update.timer

Expand All @@ -44,7 +44,7 @@ Afficher la liste des mises à jour en attente.

.TP
.B \-d, \-\-devel
Inclure les mises à jour des paquets de développement AUR
Inclure les mises à jour des paquets de développement AUR.

.TP
.B \-n, \-\-news
Expand All @@ -54,12 +54,16 @@ Afficher les dernières Arch news.

.TP
.B \-D, \-\-debug
Afficher les traces de débogage
Afficher les traces de débogage.

.TP
.B \-\-gen\-config
.RB "Générer un fichier de configuration par défaut/exemple (voir la page de manuel " "arch-update.conf(5) " "pour plus de détails)."

.TP
.B \-\-tray
.RB "Lancer l'applet systray d'Arch-Update (alternativement, vous pouvez démarrer/activer le service systemd associé comme ceci : " "systemctl \-\-user enable \-\-now arch-update-tray.service").

.TP
.B \-v, \-\-version
Afficher les informations de version.
Expand All @@ -73,10 +77,12 @@ Afficher le message d'aide.

.SH UTILISATION
.TP
.B L'icône (.desktop)
.RB "Le fichier .desktop se trouve dans " "/usr/share/applications/arch-update.desktop " "(ou dans " "/etc/local/share/applications/arch-update.desktop " "si vous avez installé arch-update depuis la source)."
.B L'applet systray
.RB "Pour démarrer l'applet systray automatiquement au démarrage du système, ajouter la commande " "arch-update --tray " "à vos commandes 'auto-start'/configuration de votre WM ou démarrez/activez le service systemd associé comme ceci : " "systemctl \-\-user enable \-\-now arch-update-tray.service"
.br
L'îcone du systray changera automatiquement en fonction de l'état actuel de votre système ('à jour' ou 'mises à jour disponibles'). Il lancera la série de fonctions adéquates pour effectuer une mise à jour complète et appropriée lorsque vous cliquez dessus.
.br
Son icône changera automatiquement en fonction des différents états (vérification des mises à jour, mises à jour disponibles, installation des mises à jour, à jour). Il lancera la série de fonctions adéquates pour effectuer une mise à jour complète et correcte lorsque vous cliquez dessus. Il est facile à intégrer à n’importe quel DE/WM, dock, barre d’état/lancement ou menu d’application.
.RB "Alternativement, si vous n'avez/ne voulez pas le support du systray, il y a un fichier .desktop classique (sous " "/usr/share/applications/arch-update.desktop " "ou " "/usr/local/share/applications/arch-update.desktop " "si vous avez installé Arch-Update depuis la source). Notez que, à l'inverse de l'applet systray, l'îcone du fichier .desktop ne change " "pas " "dynamiquement en fonction de l'état actuel de votre système ('à jour' ou 'mises à jour disponibles')."

.TP
.B Le timer systemd
Expand Down Expand Up @@ -138,7 +144,7 @@ Aucune méthode d'élévation de privilège (sudo ou doas) n'est installée

.TP
.B 3
Erreur lors du changement d'icône
Erreur lors du lancement de l'applet systray d'Arch-update

.TP
.B 4
Expand Down
Loading

0 comments on commit fdbe905

Please sign in to comment.