From fdbe905ad308b94f1eb251430c408012164608ba Mon Sep 17 00:00:00 2001 From: trigg Date: Fri, 10 May 2024 20:44:00 +0100 Subject: [PATCH] Add a systray applet (#149) * - 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 --- .github/workflows/CI.yml | 3 + .github/workflows/mdl_style.rb | 3 + Makefile | 6 +- README-fr.md | 148 +++++++++++--------------- README.md | 147 +++++++++++--------------- doc/man/arch-update.1 | 28 +++-- doc/man/fr/arch-update.1 | 28 +++-- po/arch-update.pot | 147 +++++++++++++------------- po/fr.po | 149 ++++++++++++++------------- res/completions/arch-update.bash | 1 + res/completions/arch-update.fish | 1 + res/completions/arch-update.zsh | 1 + res/systemd/arch-update-tray.service | 10 ++ src/script/arch-update-tray.py | 81 +++++++++++++++ src/script/arch-update.sh | 16 ++- 15 files changed, 425 insertions(+), 344 deletions(-) create mode 100644 res/systemd/arch-update-tray.service create mode 100755 src/script/arch-update-tray.py diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index b18f8d8..5fd6dc2 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -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 {} + diff --git a/.github/workflows/mdl_style.rb b/.github/workflows/mdl_style.rb index 87f29fd..33ceabd 100644 --- a/.github/workflows/mdl_style.rb +++ b/.github/workflows/mdl_style.rb @@ -3,3 +3,6 @@ # Exclude the rules that refers to the line length exclude_tag :line_length + +# Allow inline HTML +exclude_tag :html diff --git a/Makefile b/Makefile index a7a1cc3..b712d3e 100644 --- a/Makefile +++ b/Makefile @@ -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" @@ -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 @@ -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" @@ -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" diff --git a/README-fr.md b/README-fr.md index f4481bd..4571e88 100644 --- a/README-fr.md +++ b/README-fr.md @@ -1,5 +1,9 @@ # Arch-Update +

+ +

+ [![lang-en](https://img.shields.io/badge/lang-en-blue.svg)](https://github.com/Antiz96/arch-update/blob/main/README.md) ## Table des matières @@ -13,38 +17,48 @@ ## 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. Prise en charge optionnelle des mises à jour des paquets AUR/Flatpak et des notifications de bureau. Fonctionnalités : -- Inclut une icône cliquable (.desktop) qui change automatiquement pour agir comme un notificateur/applicateur de mise à jour. Facile à intégrer avec n'importe quel DE/WM, dock, barre d'état/lancement, menu d'application, etc... -- Vérification et listing automatiques de tous les paquets disponibles pour la mise à jour (via [checkupdates](https://archlinux.org/packages/extra/x86_64/pacman-contrib/ "pacman-contrib package")). -- Propose d'afficher les news récentes d'Arch Linux avant d'appliquer les mises à jour (via [curl](https://archlinux.org/packages/core/x86_64/curl/ "curl package") et [htmlq](https://archlinux.org/packages/extra/x86_64/htmlq/ "package htmlq")). +- Inclut une applet systray cliquable qui change dynamiquemnt pour agir comme un notificateur/applicateur de mise à jour. Facile à intégrer avec n'importe quel panneau sur n'importe quel DE/WM. +- Vérification et listing automatiques de tous les paquets disponibles pour la mise à jour. +- Propose d'afficher les news récentes d'Arch Linux avant d'appliquer les mises à jour. - Vérification et listing automatiques des paquets orphelins et propose de les supprimer. -- Vérification automatique de la présence d'anciens paquets et/ou paquets désinstallés dans le cache de `pacman` et propose de les supprimer (via [paccache](https://archlinux.org/packages/extra/x86_64/pacman-contrib/ "package pacman-contrib")). -- Vous aide à traiter les fichiers pacnew/pacsave (via [pacdiff](https://archlinux.org/packages/extra/x86_64/pacman-contrib/ "pacman-contrib package"), nécessite optionnellement [vim](https://archlinux.org/packages/extra/x86_64/vim/ "vim package") comme [programme de fusion par défaut](https://wiki.archlinux.org/title/Pacman/Pacnew_and_Pacsave#pacdiff "programme de fusion pacdiff")). +- Vérification automatique de la présence d'anciens paquets et/ou paquets désinstallés dans le cache et propose de les supprimer. +- Listing et aide au traitement des fichiers pacnew/pacsave. - Vérification automatique des mises à jour du noyau en attente nécessitant un redémarrage et propose de redémarrer s'il y en a une. -- Fonctionne avec [sudo](https://archlinux.org/packages/core/x86_64/sudo/ "sudo package") et [doas](https://archlinux.org/packages/extra/x86_64/opendoas/ "opendoas package"). -- Prise en charge optionnelle de la mise à jour des paquets AUR (via [yay](https://aur.archlinux.org/packages/yay "yay AUR package") ou [paru](https://aur.archlinux.org/packages/paru "paru AUR package")). -- Prise en charge optionnelle de la mise à jour des paquets Flatpak (via [flatpak](https://archlinux.org/packages/extra/x86_64/flatpak "Flatpak Package")). -- Prise en charge optionnelle des notifications de bureau (via [libnotify](https://archlinux.org/packages/extra/x86_64/libnotify "libnotify package"), voir ). +- Support de `sudo` et `doas`. +- Prise en charge optionnelle des paquets AUR (via `yay` ou `paru`). +- Prise en charge optionnelle des paquets Flatpak. +- Prise en charge optionnelle des notifications de bureau lors de nouvelles mises à jour disponibles. ## Installation ### AUR -Installez le paquet AUR [arch-update](https://aur.archlinux.org/packages/arch-update "arch-update AUR package"). +Installez le paquet AUR [arch-update](https://aur.archlinux.org/packages/arch-update "arch-update AUR package"). +Consultez également [la liste des dépendances optionnelles](https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=arch-update#n11) dont vous pourriez avoir besoin. ### Depuis la source -Installer les dépendances : +Installez les dépendancese requises : ```bash -sudo pacman -S --needed pacman-contrib curl htmlq diffutils hicolor-icon-theme +sudo pacman -S --needed pacman-contrib curl htmlq diffutils hicolor-icon-theme python python-pyqt6 qt6-svg glib2 ``` -Téléchargez l'archive de la [dernière version stable](https://github.com/Antiz96/arch-update/releases/latest) et extrayez-la *(vous pouvez également cloner ce référentiel via `git`)*. +Dépendances optionnelles supplémentaires dont vous pourriez avoir besoin ou que vous pourriez souhaiter : + +- [yay](https://aur.archlinux.org/packages/yay): Support des paquets AUR +- [paru](https://aur.archlinux.org/packages/paru): Support des paquets AUR +- [flatpak](https://archlinux.org/packages/extra/x86_64/flatpak/): Support des paquets Flatpak +- [libnotify](https://archlinux.org/packages/extra/x86_64/libnotify/): Support des notifications de bureau lors de nouvelles mises à jour disponibles (voir ) +- [vim](https://archlinux.org/packages/extra/x86_64/vim/): Programme de fusion par défaut pour pacdiff +- [qt6-wayland](https://archlinux.org/packages/extra/x86_64/qt6-wayland/): Support de l'applet systray sur Wayland + +Téléchargez l'archive de la [dernière version stable](https://github.com/Antiz96/arch-update/releases/latest) et extrayez-la *(vous pouvez également cloner ce référentiel via `git clone`)*. Pour installer `arch-update`, allez dans le répertoire extrait/cloné et exécutez la commande suivante : @@ -60,23 +74,23 @@ sudo make uninstall ## Utilisation -L'utilisation consiste à intégrer [le fichier .desktop](#le-fichier-desktop) quelque part (cela peut être votre bureau, votre dock, votre barre d'état/de lancement ou votre menu d'application) et à activer le [timer systemd](#le-timer-systemd). +L'utilisation consiste à démarrer [l'applet systray](#lapplet-systray) et à activer [le timer systemd](#le-timer-systemd). -Voici une petite présentation/revue YouTube de `arch-update` que [Cardiac](https://github.com/Cardiacman13) et moi-même avons réalisée sur [sa chaîne YouTube](https://www.youtube.com/@Cardiacman) : +### L'applet systray -*Attention : les fonctionnalités et le comportement par défaut d'Arch-Update peuvent avoir changé/évolué depuis !* +Pour démarrer l'applet systray automatiquement au démarrage du système, ajoutez la command `arch-update --tray` a vos commandes 'auto-start'/configuration de votre WM ou démarrez/activez le service systemd associé comme ceci : -[![youtube_presentation](https://github.com/Antiz96/arch-update/assets/53110319/23af5180-1881-486d-bd5a-3edd48ed1a08)](https://www.youtube.com/watch?v=QkOkX70SEmo) +```bash +systemctl --user enable --now arch-update-tray.service +``` -### Le fichier .desktop +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 nécessaires pour effectuer une mise à jour complète et appropriée lorsque vous cliquez dessus. -Le fichier .desktop se trouve dans `/usr/share/applications/arch-update.desktop` (ou `/usr/local/share/applications/arch-update.desktop` si vous avez installé `arch-update` [depuis la source](#depuis-la-source)). -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 (voir le chapitre [Documentation](#documentation)). Il est facile à intégrer à n’importe quel DE/WM, dock, barre d’état/lancement ou menu d’application. +Alternativement, si vous n'avez pas (ou 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](#depuis-la-source)). Notez que, à l'inverse de l'applet systray, l'îcone du fichier `.desktop` ne changera **pas** dynamiquement en fonction de l'état actuel de votre système ('à jour' ou 'mises à jour disponibles'). ### Le timer systemd -Il existe un service systemd dans `/usr/lib/systemd/user/arch-update.service` (ou dans `/usr/local/lib/systemd/user/arch-update.service` si vous avez installé `arch-update` [depuis la source](#depuis-la-source)) qui exécute la fonction `check` quand il est démarré (voir le chapitre [Documentation](#documentation)). +Il existe un service systemd (sous `/usr/lib/systemd/user/arch-update.service` ou `/usr/local/lib/systemd/user/arch-update.service` si vous avez installé `Arch-Update` [depuis la source](#depuis-la-source)) qui exécute la fonction `check` quand il est démarré (voir le chapitre [Documentation](#documentation)). Pour le démarrer automatiquement **au démarrage du système puis une fois toutes les heures**, activez le timer systemd associé (vous pouvez modifier le cycle de vérification automatique à votre guise, voir les [Trucs et astuces - Modifier le cycle de vérification automatique](#modifier-le-cycle-de-vérification-automatique)) : ```bash @@ -85,75 +99,32 @@ systemctl --user enable --now arch-update.timer ### Captures d'écran -*Les captures d'écran montrent le retour du script en anglais, mais `Arch-Update` possède désormais une **traduction française** !* - -Personnellement, j'ai intégré l'icône .desktop dans ma barre supérieure. -C'est la première icône en partant de la gauche. - -![icon](https://github.com/Antiz96/arch-update/assets/53110319/25f3d2ca-b9d3-4a32-ace3-b0fa785662c2) - -Lorsque `arch-update` vérifie les mises à jour, l'icône change en conséquence (la fonction `check` est automatiquement déclenchée au démarrage du système puis une fois toutes les heures si vous avez activé le [timer systemd](#le-timer-systemd) et peut être déclenchée manuellement en exécutant la commande `arch-update -c`) : - -![icon-checking](https://github.com/Antiz96/arch-update/assets/53110319/f4c09898-7b21-430f-84be-431a31e25c3f) - -Si de nouvelles mises à jour sont disponibles, l'icône affichera une cloche et une notification de bureau indiquant le nombre de mises à jour disponibles sera envoyée (nécessite [libnotify/notify-send](https://archlinux.org/packages/extra/x86_64/libnotify/ "paquet libnotify")) : - -![icon-update-available](https://github.com/Antiz96/arch-update/assets/53110319/c1526ce7-5f94-41b8-a8fa-3587b9d00a9d) -![notification](https://github.com/Antiz96/arch-update/assets/53110319/631b8e67-487a-441a-84b4-6cce95223729) - -Lorsque l'on clique sur l'icône, cela lance la série de fonctions adéquates pour effectuer une mise à jour complète et correcte, en commençant par actualiser la liste des paquets disponibles pour la mise à jour, en l'affichant dans un terminal et en demandant la confirmation de l'utilisateur pour procéder à l'installation (elle peut également être lancée en exécutant la commande `arch-update`, nécessite [yay](https://aur.archlinux.org/packages/yay "yay") ou [paru](https://aur.archlinux.org/packages/paru "paru") pour la prise en charge de la mise à jour des paquets AUR et [flatpak](https://archlinux.org/packages/extra/x86_64/flatpak/) pour la prise en charge de la mise à jour des paquets Flatpak) : - -*La sortie colorée peut être désactivée avec l'option `NoColor` dans le fichier de configuration `arch-update.conf`.* -*La liste des mises à jour en attente peut être affichées à tout moment en exécutant `arch-update -l` ou `arch-update --list`.* -*Vous pouvez inclure les mises à jour des paquets de développements AUR en exécutant `arch-update -d` ou `arch-update --devel`.* -*Les changements de versions dans la listing des paquets peuvent être masqués avec l'option `NoVersion` dans le fichier de configuration `arch-update.conf`.* -*Voir le [chapitre de documentation arch-update.conf](#Fichier-de-configuration-arch-update) pour plus de détails.* - -![listing-packages](https://github.com/Antiz96/arch-update/assets/53110319/43a990c8-ed93-420f-8c46-d50d60bff03f) - -Une fois que vous avez donné la confirmation pour procéder, `arch-update` propose d'afficher les dernières Arch news. -Par défaut, les Arch news sont seulement affichées si au moins une nouvelle news a été publiée depuis la dernière exécution. Les Arch news publiées depuis la dernière exécution ou à la même date sont étiquetées comme `[NOUVEAU]`. -Sélectionnez la news à lire en tapant le numéro associé. -Après avoir lu une news, `arch-update` vous proposera à nouveau d'afficher les dernières Arch news, afin que vous puissiez lire plusieurs news à la fois. -Appuyez simplement sur « Entrée » sans saisir de chiffre pour procéder à la mise à jour : - -*Les Arch news peuvent être affichées à tout moment en exécutant la commande `arch-update --news`.* -*Le nombre par défaut de Arch news à afficher avant la mise à jour et avec l'option `-n/--news` est de 5 mais il peut être modifié avec l'option `NewsNum=[Num]` dans le fichier de configuration `arch-update.conf`.* -*Les Arch news peuvent être systématiquement affichées avant la mise à jour, peu importe s'il y en a une nouvelle depuis la dernière exécution ou non, en paramétrant l'option `AlwaysShowNews` dans le fichier de configuration `arch-update.conf`* -*Notez que l'utilisation de cette option générera un message d'avertissement pour rappeler que les utilisateurs sont censés consulter régulièrement les Arch news.* -*Voir le [chapitre de documentation](#Documentation) pour plus de détails.* - -![list-news](https://github.com/Antiz96/arch-update/assets/53110319/b6883ec4-8c44-4b97-86d9-4d0a304b748b) - -Pendant que `arch-update` effectue des mises à jour, l'icône change en conséquence : - -![icon-installing](https://github.com/Antiz96/arch-update/assets/53110319/7c74ce84-7de4-4e09-aa2a-66afad9e61d7) - -Une fois la mise à jour terminée, l'icône change en conséquence : +Une fois démarrée, l'applet systray apparait dans la zone systray de votre panneau. +C'est l'icône à droite de celle du wifi dans la capture d'écran ci-dessous: -![icon-up-to-date](https://github.com/Antiz96/arch-update/assets/53110319/03f224a5-5fcf-450d-9aa5-bae90e7d2e8a) +![systray-icon](https://github.com/Antiz96/arch-update/assets/53110319/fe032e68-3582-470a-9e6d-b51a9ea8c1ba) -`arch-update` recherchera ensuite les paquets orphelins/paquets Flatpak inutilisés et proposera de les supprimer (s'il y en a) : +Avec [le systemd timer](#le-timer-systemd) activé, `Arch-Update` vérifie automatiquement les mises à jour au démarrage du système puis une fois chaque heure. La vérification peut être manuellement déclenchée en exécutant la commande `arch-update --check`. -![paquets-orphelins](https://github.com/Antiz96/arch-update/assets/53110319/76b795e5-076e-4070-9fe2-73165503011b) +Si de nouvelles mises à jour sont disponibles, l'icône systray affichera un cercle rouge et une notification de bureau indiquant le nombre de mises à jour disponibles sera envoyée (nécessite [libnotify/notify-send](https://archlinux.org/packages/extra/x86_64/libnotify/ "paquet libnotify") et un serveur de notification en cours d'exécution) : -![flatpak-unused-packages](https://github.com/Antiz96/arch-update/assets/53110319/cd4053bb-623e-44c2-8c74-9f87710f4074) +![notification-FR](https://github.com/Antiz96/arch-update/assets/53110319/28f0b95a-5b8a-43a5-bc3c-df42cd40d87b) -`arch-update` recherchera également les anciens paquets et/ou paquets désinstallés mis en cache et proposera de les supprimer (s'il y en a) : +Quand l'applet systray est cliquée, elle affiche la liste des paquets disponibles pour la mise à jour dans une fenêtre de terminal et demande la confirmation de l'utilisateur pour procéder à l'installation (peut aussi être lancé en exécutant la commande `arch-update`, requiert [yay](https://aur.archlinux.org/packages/yay "yay") ou [paru](https://aur.archlinux.org/packages/paru "paru") pour le support des paquets AUR et [flatpak](https://archlinux.org/packages/extra/x86_64/flatpak/) pour le support des paquets Flatpak). -*Le comportement par défaut consiste à conserver les 3 dernières versions en cache des paquets installés et à supprimer toutes les versions en cache des paquets désinstallés.* -*Vous pouvez modifier le nombre d'anciennes versions de paquets et de versions de paquets désinstallés à conserver respectivement dans le cache de pacman avec les options `KeepOldPackages=[Num]` et `KeepUninstalledPackages=[Num]` dans le fichier de configuration `arch-update.conf`.* -*Voir le [chapitre de documentation arch-update.conf](#Fichier-de-configuration-arch-update) pour plus de détails.* +![listing_packages-FR](https://github.com/Antiz96/arch-update/assets/53110319/60547cde-f327-46f8-907c-61bf9bbee6c5) -![cached-packages](https://github.com/Antiz96/arch-update/assets/53110319/7199bbf1-acd8-49a1-80eb-e9874b94fba6) +Par défaut, si au moins une news Arch Linux a été publiée depuis la dernière exécution, `Arch-Update` vous proposera de lire les dernières news Arch Linux directement depuis votre fenêtre de terminal. +Les news publiées depuis la dernière exécution sont tagguées comme `[NOUVEAU]` : -De plus, `arch-update` recherchera les fichiers pacnew/pacsave et proposera de les traiter via `pacdiff` (s'il y en a) : +![listing_news-FR](https://github.com/Antiz96/arch-update/assets/53110319/72819197-d4f7-4c50-af21-0aac1c60ba41) -![pacnew-files](https://github.com/Antiz96/arch-update/assets/53110319/5ee627ee-f7b7-4528-bf41-435d3c5892ac) +Quand la liste des news récentes est affichée, vous pouvez soit taper le nombre associé à une news pour la lire (vous serez invité à nouveau à lire d'autres news par la suite, ce qui vous permettra de lire plusieurs news en une seule exécution), ou simplement appuyez sur "entrée" pour procéder à la mise à jour. +Si aucune news n'a été publiée depuis la dernière exécution, `Arch-Update` procédera directement à la mise à jour après que vous ayez donné votre confirmation. -Enfin, `arch-update` vérifiera s'il y a une mise à jour du noyau en attente nécessitant un redémarrage et vous proposera de le faire (s'il y en a une) : +Dans les deux cas, à partir de là, vous avez simplement à laisser `Arch-Update` vous guider à travers les différentes étapes requises pour une mise à jour complète et appropriée de votre système ! :smile: -![kernel-pending-update](https://github.com/Antiz96/arch-update/assets/53110319/14aef5b2-db32-4296-8a60-bc840c09d457) +Certaines options peuvent être activées/désactivées ou modifiées via le fichier de configuration `arch-update.conf`. Voir le [chapitre de documentation arch-update.conf](#fichier-de-configuration-arch-update) pour plus de détails. ## Documentation @@ -177,6 +148,7 @@ Options : -n, --news [Num] Afficher les dernieres Arch News, vous pouvez optionellement spécifier le nombre de Arch news à afficher avec `--news [Num]` (e.g. `--news 10`) -D, --debug Afficher les traces de débogage --gen-config 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) +--tray Lancer l'applet systray d'Arch-Update -h, --help Afficher ce message d'aide et quitter -V, --version Afficher les informations de version et quitter @@ -184,7 +156,7 @@ Codes de sortie : 0 OK 1 Option invalide 2 Aucune méthode d'élévation de privilège (sudo ou doas) n'est installée -3 Erreur lors du changement d'icône +3 Erreur lors du lancement de l'applet systray d'Arch-Update 4 L'utilisateur n'a pas donné la confirmation de procéder 5 Erreur lors de la mise à jour des paquets 6 Erreur lors de l'appel de la commande reboot pour appliquer une mise à jour du noyau en attente @@ -221,20 +193,20 @@ Pour plus d'informations, consultez la page de manuel arch-update.conf(5). ## Trucs et astuces -### Prise en charge du AUR +### Support du AUR -Arch-Update prend en charge la mise à jour des paquets AUR lors de la vérification et de l'installation des mises à jour si **yay** ou **paru** est installé : +Arch-Update prend en charge les paquets AUR si **yay** ou **paru** est installé : Voir et Voir et -### Prise en charge de Flatpak +### Support de Flatpak -Arch-Update prend en charge la mise à jour des paquets Flatpak lors de la vérification et de l'installation des mises à jour (ainsi que de la suppression des packages Flatpak inutilisés) si **flatpak** est installé : +Arch-Update prend en charge les paquets Flatpak si **flatpak** est installé : Voir et -### Notifications de bureau +### Support des notifications de bureau -Arch-Update prend en charge les notifications de bureau lors de l'exécution de la fonction `--check` si **libnotify (notify-send)** est installé : +Arch-Update prend en charge les notifications de bureau lors de l'exécution de la fonction `--check` si **libnotify** est installé (et qu'un serveur de notification est en cours d'exécution) : Voir ### Modifier le cycle de vérification automatique diff --git a/README.md b/README.md index 454078e..a851507 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,9 @@ # Arch-Update +

+ +

+ [![lang-fr](https://img.shields.io/badge/lang-fr-blue.svg)](https://github.com/Antiz96/arch-update/blob/main/README-fr.md) ## Table of contents @@ -13,38 +17,48 @@ ## 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. Optional support for AUR/Flatpak packages updates and desktop notifications. Features: -- Includes a (.desktop) clickeable icon that automatically changes to act as an update notifier/applier. Easy to integrate with any DE/WM, dock, status/launch bar, app menu, etc... -- Automatic check and listing of every packages available for update (through [checkupdates](https://archlinux.org/packages/extra/x86_64/pacman-contrib/ "pacman-contrib package")). -- Offers to display the latest Arch Linux news before applying updates (through [curl](https://archlinux.org/packages/core/x86_64/curl/ "curl package") and [htmlq](https://archlinux.org/packages/extra/x86_64/htmlq/ "htmlq package")). -- Automatic check and listing of orphan packages and offering you to remove them. -- Automatic check for old and/or uninstalled cached packages in `pacman`'s cache and offering you to remove them (through [paccache](https://archlinux.org/packages/extra/x86_64/pacman-contrib/ "pacman-contrib package")). -- Helps you processing pacnew/pacsave files (through [pacdiff](https://archlinux.org/packages/extra/x86_64/pacman-contrib/ "pacman-contrib package"), optionally requires [vim](https://archlinux.org/packages/extra/x86_64/vim/ "vim package") as the default [merge program](https://wiki.archlinux.org/title/Pacman/Pacnew_and_Pacsave#pacdiff "pacdiff merge program")). +- Includes a clickeable systray applet that dynamically changes to act as an update notifier/applier. Easy to integrate with any panel on any DE/WM. +- Automatic check and listing of every packages available for update. +- Offers to display the latest Arch Linux news before applying updates. +- Automatic check and listing of orphan packages and offers to remove them. +- Automatic check for old and/or uninstalled cached packages and offers to remove them. +- Lists and helps you processing pacnew/pacsave files. - Automatic check for pending kernel updates requiring a reboot to be applied and offers to do so if there's one. -- Support for both [sudo](https://archlinux.org/packages/core/x86_64/sudo/ "sudo package") and [doas](https://archlinux.org/packages/extra/x86_64/opendoas/ "opendoas package"). -- Optional support for AUR packages update (through [yay](https://aur.archlinux.org/packages/yay "yay AUR package") or [paru](https://aur.archlinux.org/packages/paru "paru AUR package")). -- Optional support for Flatpak packages update (through [flatpak](https://archlinux.org/packages/extra/x86_64/flatpak "Flatpak package")). -- Optional support for desktop notifications (through [libnotify](https://archlinux.org/packages/extra/x86_64/libnotify "libnotify package"), see ). +- Support for both `sudo` and `doas`. +- Optional support for AUR packages (through `yay` or `paru`). +- Optional support for Flatpak packages. +- Optional support for desktop notifications on new available updates. ## Installation ### AUR -Install the [arch-update](https://aur.archlinux.org/packages/arch-update "arch-update AUR package") AUR package. +Install the [arch-update](https://aur.archlinux.org/packages/arch-update "arch-update AUR package") AUR package. +Also check [the list of optional dependencies](https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=arch-update#n11) you might need or want. ### From Source -Install dependencies: +Install required dependencies: ```bash -sudo pacman -S --needed pacman-contrib curl htmlq diffutils hicolor-icon-theme +sudo pacman -S --needed pacman-contrib curl htmlq diffutils hicolor-icon-theme python python-pyqt6 qt6-svg glib2 ``` -Download the archive of the [latest stable release](https://github.com/Antiz96/arch-update/releases/latest) and extract it *(alternatively, you can clone this repository via `git`)*. +Additional optional dependencies you might need or want: + +- [yay](https://aur.archlinux.org/packages/yay): AUR Packages support +- [paru](https://aur.archlinux.org/packages/paru): AUR Packages support +- [flatpak](https://archlinux.org/packages/extra/x86_64/flatpak/): Flatpak Packages support +- [libnotify](https://archlinux.org/packages/extra/x86_64/libnotify/): Desktop notifications support on new available updates (see ) +- [vim](https://archlinux.org/packages/extra/x86_64/vim/): Default merge program for pacdiff +- [qt6-wayland](https://archlinux.org/packages/extra/x86_64/qt6-wayland/): Systray applet support on Wayland + +Download the archive of the [latest stable release](https://github.com/Antiz96/arch-update/releases/latest) and extract it *(alternatively, you can clone this repository via `git clone`)*. To install `arch-update`, go into the extracted/cloned directory and run the following command: @@ -60,23 +74,23 @@ sudo make uninstall ## Usage -The usage consist of integrating [the .desktop file](#the-desktop-file) somewhere (could be your desktop, your dock, your status/launch bar and/or your app menu) and enabling the [systemd timer](#the-systemd-timer). +The usage consist of starting [the systray applet](#the-systray-applet) and enabling [the systemd timer](#the-systemd-timer). -Here is a little YouTube presentation/review of `arch-update` that [Cardiac](https://github.com/Cardiacman13) and I made on [his YouTube channel](https://www.youtube.com/@Cardiacman) (**videos there, including this one, are in french**): +### The systray applet -*Warning: Arch-Update's features and default behavior may have changed/evolved since then!* +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: -[![youtube_presentation](https://github.com/Antiz96/arch-update/assets/53110319/23af5180-1881-486d-bd5a-3edd48ed1a08)](https://www.youtube.com/watch?v=QkOkX70SEmo) +```bash +systemctl --user enable --now arch-update-tray.service +``` -### The .desktop file +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. -The .desktop file is located in `/usr/share/applications/arch-update.desktop` (or `/usr/local/share/applications/arch-update.desktop` if you installed `arch-update` [from source](#from-source)). -Its icon will automatically change depending on the 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 (see the [Documentation](#documentation) chapter). It is easy to integrate with any DE/WM, dock, status/launch bar or app menu. +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](#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'). ### The systemd timer -There is a systemd service in `/usr/lib/systemd/user/arch-update.service` (or in `/usr/local/lib/systemd/user/arch-update.service` if you installed `arch-update` [from source](#from-source)) that executes the `check` function when started (see the [Documentation](#documentation) chapter). +There is a systemd service (in `/usr/lib/systemd/user/arch-update.service` or in `/usr/local/lib/systemd/user/arch-update.service` if you installed `Arch-Update` [from source](#from-source)) that executes the `check` function when started (see the [Documentation](#documentation) chapter). To start it automatically **at boot and then once every hour**, enable the associated systemd timer (you can modify the auto-check cycle to your liking, see the [Tips and tricks - Modify the auto-check cycle](#modify-the-auto-check-cycle) chapter): ```bash @@ -85,72 +99,32 @@ systemctl --user enable --now arch-update.timer ### Screenshots -Personally, I integrated the .desktop icon in my top bar. -It is the first icon from the left. - -![icon](https://github.com/Antiz96/arch-update/assets/53110319/25f3d2ca-b9d3-4a32-ace3-b0fa785662c2) - -When `arch-update` is checking for updates, the icon changes accordingly (the `check` function is automatically triggered at boot and then once every hour if you enabled the [systemd timer](#the-systemd-timer) and can be manually triggered by running the `arch-update -c` command): - -![icon-checking](https://github.com/Antiz96/arch-update/assets/53110319/f4c09898-7b21-430f-84be-431a31e25c3f) - -If there are new available updates, the icon will show a bell sign and a desktop notification indicating the number of available updates will be sent (requires [libnotify/notify-send](https://archlinux.org/packages/extra/x86_64/libnotify/ "libnotify package")): - -![icon-update-available](https://github.com/Antiz96/arch-update/assets/53110319/c1526ce7-5f94-41b8-a8fa-3587b9d00a9d) -![notification](https://github.com/Antiz96/arch-update/assets/53110319/631b8e67-487a-441a-84b4-6cce95223729) - -When the icon is clicked, it launches the relevant series of functions to perform a complete and proper update starting by refreshing the list of packages available for updates, display it inside a terminal window and asks for the user's confirmation to proceed with the installation (it can also be launched by running the `arch-update` command, requires [yay](https://aur.archlinux.org/packages/yay "yay") or [paru](https://aur.archlinux.org/packages/paru "paru") for AUR packages update support and [flatpak](https://archlinux.org/packages/extra/x86_64/flatpak/) for Flatpak packages update support): - -*The colored output can be disabled with the `NoColor` option in the `arch-update.conf` configuration file.* -*The list of pending updates can be displayed at anytime by running `arch-update -l` or `arch-update --list`.* -*You can include AUR development packages updates by running `arch-update -d` or `arch-update --devel`.* -*The versions changes in the packages listing can be hidden with the `NoVersion` option in the `arch-update.conf` configuration file.* -*See the [arch-update.conf documentation chapter](#arch-update-configuration-file) for more details.* - -![listing-packages](https://github.com/Antiz96/arch-update/assets/53110319/43a990c8-ed93-420f-8c46-d50d60bff03f) - -Once you gave the confirmation to proceed, `arch-update` offers to display latest Arch Linux news. -By default, Arch news are only displayed if at least a new one has been published since the last run. Arch news published since the last run or at the same date are tagged as `[NEW]`. -Select which news to read by typing its associated number. -After your read a news, `arch-update` will once again offers to display latest Arch Linux news, so you can read multiple news at once. -Simply press "enter" without typing any number to proceed with update: - -*Arch news can be displayed at any time by running the `arch-update --news` command.* -*The number of Arch news to display before updating and with the `-n/--news` option defaults to 5 but can be customised with the `NewsNum=[Num]` option in the `arch-update.conf` configuration file.* -*Arch news can be displayed every time before updating, regardless of whether there's a new one since the last run or not, by setting the `AlwaysShowNews` option in the `arch-update.conf` configuration file.* -*See the [documentation chapter](#Documentation) for more details.* - -![list-news](https://github.com/Antiz96/arch-update/assets/53110319/b6883ec4-8c44-4b97-86d9-4d0a304b748b) - -While `arch-update` is performing updates, the icon changes accordingly: - -![icon-installing](https://github.com/Antiz96/arch-update/assets/53110319/7c74ce84-7de4-4e09-aa2a-66afad9e61d7) - -When the update is over, the icon changes accordingly: +Once started, the systray applet appears in the systray area of your panel. +It is the icon at the right of the 'wifi' one in the screenshot below: -![icon-up-to-date](https://github.com/Antiz96/arch-update/assets/53110319/03f224a5-5fcf-450d-9aa5-bae90e7d2e8a) +![systray-icon](https://github.com/Antiz96/arch-update/assets/53110319/fe032e68-3582-470a-9e6d-b51a9ea8c1ba) -`arch-update` will then search for orphan packages/unused Flatpak packages and offers to remove them (if there are): +With [the system timer](#the-systemd-timer) enabled, `Arch-Update` automatically checks for updates at boot and then once every hour. The check can be manually triggered by running the `arch-update --check` command. -![orphan-packages](https://github.com/Antiz96/arch-update/assets/53110319/76b795e5-076e-4070-9fe2-73165503011b) +If there are new available updates, the systray icon will show a red circle and a desktop notification indicating the number of available updates will be sent (requires [libnotify](https://archlinux.org/packages/extra/x86_64/libnotify/ "libnotify package") and a running notification server): -![flatpak-unused-packages](https://github.com/Antiz96/arch-update/assets/53110319/cd4053bb-623e-44c2-8c74-9f87710f4074) +![notification](https://github.com/Antiz96/arch-update/assets/53110319/db94c308-526a-4b8f-8f2a-0624d0a83553) -`arch-update` will also search for old and/or uninstalled cached packages and offers to remove them (if there are): +When the systray applet is clicked, it prints the list of packages available for updates inside a terminal window and asks for the user's confirmation to proceed with the installation (it can also be launched by running the `arch-update` command, requires [yay](https://aur.archlinux.org/packages/yay "yay") or [paru](https://aur.archlinux.org/packages/paru "paru") for AUR packages support and [flatpak](https://archlinux.org/packages/extra/x86_64/flatpak/) for Flatpak packages support). -*The default behavior is to keep the last 3 cached versions of installed packages and remove every cached versions of uninstalled packages.* -*You can modify the number of old packages' versions and uninstalled packages' versions to keep in pacman's cache respectively with the `KeepOldPackages=[Num]` and `KeepUninstalledPackages=[Num]` options in the `arch-update.conf` configuration file.* -*See the [arch-update.conf documentation chapter](#arch-update-configuration-file) for more details.* +![listing_packages](https://github.com/Antiz96/arch-update/assets/53110319/ed552414-0dff-4cff-84d2-6ff13340259d) -![cached-packages](https://github.com/Antiz96/arch-update/assets/53110319/7199bbf1-acd8-49a1-80eb-e9874b94fba6) +By default, if at least one Arch Linux news has been published since the last run, `Arch-Update` will offer you to read the latest Arch Linux news directly from your terminal window. +The news published since the last run are as `[NEW]`: -Additionally `arch-update` will search for pacnew/pacsave files and offers to process them via `pacdiff` (if there are): +![listing_news](https://github.com/Antiz96/arch-update/assets/53110319/4f6f1c84-e5d6-4072-aa57-0c3e80783c01) -![pacnew-files](https://github.com/Antiz96/arch-update/assets/53110319/5ee627ee-f7b7-4528-bf41-435d3c5892ac) +When recent news gets listed, either type the number associated to a news to read it (you'll be re-prompted to read other news afterwards so you can read multiple news in one run), or simply press "enter" to proceed with the update. +If no news has been published since the last run, `Arch-Update` will directly proceed to the update after you gave your confirmation. -Finally, `arch-update` will check if there's a pending kernel update requiring a reboot to be applied and offers you to do so (if there is): +In both cases, from there, you just have to let `Arch-Update` guide you to the various steps required for a complete and proper update of your system! :smile: -![kernel-pending-update](https://github.com/Antiz96/arch-update/assets/53110319/14aef5b2-db32-4296-8a60-bc840c09d457) +Certain options can be enabled/disabled or modified via the `arch-update.conf` configuration file. See the [arch-update.conf documentation chapter](#arch-update-configuration-file) for more details. ## Documentation @@ -174,6 +148,7 @@ Options: -n, --news [Num] Display latest Arch News, you can optionally specify the number of Arch news to display with `--news [Num]` (e.g. `--news 10`) -D, --debug Display debug traces --gen-config Generate a default/example configuration file (see the arch-update.conf(5) man page for more details) +--tray Launch the Arch-Update systray applet -h, --help Display this help message and exit -V, --version Display version information and exit @@ -181,7 +156,7 @@ Exit Codes: 0 OK 1 Invalid option 2 No privilege elevation method (sudo or doas) is installed -3 Error when changing icon +3 Error when launching the Arch-Update systray applet 4 User didn't gave the confirmation to proceed 5 Error when updating the packages 6 Error when calling the reboot command to apply a pending kernel update @@ -218,20 +193,20 @@ For more information, see the arch-update.conf(5) man page. ## Tips and tricks -### AUR Support +### AUR support -Arch-Update supports AUR packages update when checking and installing updates if **yay** or **paru** is installed: +Arch-Update supports AUR packages if **yay** or **paru** is installed: See and See and -### Flatpak Support +### Flatpak support -Arch-Update supports Flatpak packages update when checking and installing updates (as well as removing unused Flatpak packages) if **flatpak** is installed: +Arch-Update supports Flatpak packages if **flatpak** is installed: See and -### Desktop notifications Support +### Desktop notifications support -Arch-Update supports desktop notifications when performing the `--check` function if **libnotify (notify-send)** is installed: +Arch-Update supports desktop notifications when performing the `--check` function if **libnotify** is installed (and a notification server is running): See ### Modify the auto-check cycle diff --git a/doc/man/arch-update.1 b/doc/man/arch-update.1 index 553a578..d0ff05d 100644 --- a/doc/man/arch-update.1 +++ b/doc/man/arch-update.1 @@ -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. @@ -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" ")." @@ -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 @@ -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 @@ -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. @@ -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 @@ -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 diff --git a/doc/man/fr/arch-update.1 b/doc/man/fr/arch-update.1 index c09add9..f773037 100644 --- a/doc/man/fr/arch-update.1 +++ b/doc/man/fr/arch-update.1 @@ -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. @@ -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" ")." @@ -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 @@ -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 @@ -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. @@ -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 @@ -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 diff --git a/po/arch-update.pot b/po/arch-update.pot index 4882b5c..8894857 100644 --- a/po/arch-update.pot +++ b/po/arch-update.pot @@ -106,349 +106,354 @@ msgstr "" #: src/script/arch-update.sh:173 #, sh-format -msgid " -h, --help Display this help message and exit" +msgid " --tray Launch the Arch-Update systray applet" msgstr "" #: src/script/arch-update.sh:174 #, sh-format +msgid " -h, --help Display this help message and exit" +msgstr "" + +#: src/script/arch-update.sh:175 +#, sh-format msgid " -V, --version Display version information and exit" msgstr "" -#: src/script/arch-update.sh:176 +#: src/script/arch-update.sh:177 #, sh-format msgid "For more information, see the ${name}(1) man page." msgstr "" -#: src/script/arch-update.sh:177 +#: src/script/arch-update.sh:178 #, sh-format msgid "" "Certain options can be enabled/disabled or modified via the ${name}.conf " "configuration file, see the ${name}.conf(5) man page." msgstr "" -#: src/script/arch-update.sh:188 +#: src/script/arch-update.sh:189 #, sh-format msgid "" "${name}: invalid option -- '${option}'\\nTry '${name} --help' for more " "information." msgstr "" -#: src/script/arch-update.sh:244 src/script/arch-update.sh:246 +#: src/script/arch-update.sh:229 src/script/arch-update.sh:231 #, sh-format msgid "${update_number} update available" msgstr "" -#: src/script/arch-update.sh:251 src/script/arch-update.sh:253 +#: src/script/arch-update.sh:236 src/script/arch-update.sh:238 #, sh-format msgid "${update_number} updates available" msgstr "" -#: src/script/arch-update.sh:270 +#: src/script/arch-update.sh:254 #, sh-format msgid "Looking for updates...\\n" msgstr "" -#: src/script/arch-update.sh:291 +#: src/script/arch-update.sh:275 #, sh-format msgid "Packages:" msgstr "" -#: src/script/arch-update.sh:296 +#: src/script/arch-update.sh:280 #, sh-format msgid "AUR Packages:" msgstr "" -#: src/script/arch-update.sh:301 +#: src/script/arch-update.sh:285 #, sh-format msgid "Flatpak Packages:" msgstr "" -#: src/script/arch-update.sh:308 +#: src/script/arch-update.sh:292 #, sh-format msgid "No update available\\n" msgstr "" -#: src/script/arch-update.sh:315 +#: src/script/arch-update.sh:299 #, sh-format msgid "Proceed with update? [Y/n]" msgstr "" -#: src/script/arch-update.sh:318 src/script/arch-update.sh:457 -#: src/script/arch-update.sh:490 src/script/arch-update.sh:532 -#: src/script/arch-update.sh:599 src/script/arch-update.sh:625 +#: src/script/arch-update.sh:302 src/script/arch-update.sh:439 +#: src/script/arch-update.sh:472 src/script/arch-update.sh:514 +#: src/script/arch-update.sh:581 src/script/arch-update.sh:607 #, sh-format msgid "Y" msgstr "" -#: src/script/arch-update.sh:318 src/script/arch-update.sh:457 -#: src/script/arch-update.sh:490 src/script/arch-update.sh:532 -#: src/script/arch-update.sh:599 src/script/arch-update.sh:625 +#: src/script/arch-update.sh:302 src/script/arch-update.sh:439 +#: src/script/arch-update.sh:472 src/script/arch-update.sh:514 +#: src/script/arch-update.sh:581 src/script/arch-update.sh:607 #, sh-format msgid "y" msgstr "" -#: src/script/arch-update.sh:322 +#: src/script/arch-update.sh:306 #, sh-format msgid "The update has been aborted\\n" msgstr "" -#: src/script/arch-update.sh:353 +#: src/script/arch-update.sh:337 #, sh-format msgid "Arch News:" msgstr "" -#: src/script/arch-update.sh:358 +#: src/script/arch-update.sh:342 #, sh-format msgid "[NEW]" msgstr "" -#: src/script/arch-update.sh:369 +#: src/script/arch-update.sh:353 #, sh-format msgid "Select the news to read (or just press \"enter\" to quit):" msgstr "" -#: src/script/arch-update.sh:371 +#: src/script/arch-update.sh:355 #, sh-format msgid "" "Select the news to read (or just press \"enter\" to proceed with update):" msgstr "" -#: src/script/arch-update.sh:382 +#: src/script/arch-update.sh:366 #, sh-format msgid "Title:" msgstr "" -#: src/script/arch-update.sh:383 +#: src/script/arch-update.sh:367 #, sh-format msgid "Author:" msgstr "" -#: src/script/arch-update.sh:384 +#: src/script/arch-update.sh:368 #, sh-format msgid "Publication date:" msgstr "" -#: src/script/arch-update.sh:385 +#: src/script/arch-update.sh:369 #, sh-format msgid "URL:" msgstr "" -#: src/script/arch-update.sh:400 +#: src/script/arch-update.sh:382 #, sh-format msgid "Updating Packages...\\n" msgstr "" -#: src/script/arch-update.sh:405 src/script/arch-update.sh:417 -#: src/script/arch-update.sh:428 +#: src/script/arch-update.sh:387 src/script/arch-update.sh:399 +#: src/script/arch-update.sh:410 #, sh-format msgid "" "An error has occurred during the update process\\nThe update has been " "aborted\\n" msgstr "" -#: src/script/arch-update.sh:412 +#: src/script/arch-update.sh:394 #, sh-format msgid "Updating AUR Packages...\\n" msgstr "" -#: src/script/arch-update.sh:424 +#: src/script/arch-update.sh:406 #, sh-format msgid "Updating Flatpak Packages...\\n" msgstr "" -#: src/script/arch-update.sh:435 +#: src/script/arch-update.sh:417 #, sh-format msgid "The update has been applied\\n" msgstr "" -#: src/script/arch-update.sh:447 +#: src/script/arch-update.sh:429 #, sh-format msgid "Orphan Packages:" msgstr "" -#: src/script/arch-update.sh:451 +#: src/script/arch-update.sh:433 #, sh-format msgid "" "Would you like to remove this orphan package (and its potential " "dependencies) now? [y/N]" msgstr "" -#: src/script/arch-update.sh:453 +#: src/script/arch-update.sh:435 #, sh-format msgid "" "Would you like to remove these orphan packages (and their potential " "dependencies) now? [y/N]" msgstr "" -#: src/script/arch-update.sh:459 +#: src/script/arch-update.sh:441 #, sh-format msgid "Removing Orphan Packages...\\n" msgstr "" -#: src/script/arch-update.sh:463 src/script/arch-update.sh:496 -#: src/script/arch-update.sh:539 src/script/arch-update.sh:549 -#: src/script/arch-update.sh:559 src/script/arch-update.sh:568 +#: src/script/arch-update.sh:445 src/script/arch-update.sh:478 +#: src/script/arch-update.sh:521 src/script/arch-update.sh:531 +#: src/script/arch-update.sh:541 src/script/arch-update.sh:550 #, sh-format msgid "" "An error has occurred during the removal process\\nThe removal has been " "aborted\\n" msgstr "" -#: src/script/arch-update.sh:466 src/script/arch-update.sh:499 +#: src/script/arch-update.sh:448 src/script/arch-update.sh:481 #, sh-format msgid "The removal has been applied\\n" msgstr "" -#: src/script/arch-update.sh:471 src/script/arch-update.sh:503 -#: src/script/arch-update.sh:576 +#: src/script/arch-update.sh:453 src/script/arch-update.sh:485 +#: src/script/arch-update.sh:558 #, sh-format msgid "The removal hasn't been applied\\n" msgstr "" -#: src/script/arch-update.sh:475 +#: src/script/arch-update.sh:457 #, sh-format msgid "No orphan package found\\n" msgstr "" -#: src/script/arch-update.sh:480 +#: src/script/arch-update.sh:462 #, sh-format msgid "Flatpak Unused Packages:" msgstr "" -#: src/script/arch-update.sh:484 +#: src/script/arch-update.sh:466 #, sh-format msgid "Would you like to remove this Flatpak unused package now? [y/N]" msgstr "" -#: src/script/arch-update.sh:486 +#: src/script/arch-update.sh:468 #, sh-format msgid "Would you like to remove these Flatpak unused packages now? [y/N]" msgstr "" -#: src/script/arch-update.sh:492 +#: src/script/arch-update.sh:474 #, sh-format msgid "Removing Flatpak Unused Packages..." msgstr "" -#: src/script/arch-update.sh:507 +#: src/script/arch-update.sh:489 #, sh-format msgid "No Flatpak unused package found\\n" msgstr "" -#: src/script/arch-update.sh:524 +#: src/script/arch-update.sh:506 #, sh-format msgid "Cached Packages:\\nThere's an old or uninstalled cached package\\n" msgstr "" -#: src/script/arch-update.sh:525 +#: src/script/arch-update.sh:507 #, sh-format msgid "Would you like to remove it from the cache now? [Y/n]" msgstr "" -#: src/script/arch-update.sh:527 +#: src/script/arch-update.sh:509 #, sh-format msgid "Cached Packages:\\nThere are old and/or uninstalled cached packages\\n" msgstr "" -#: src/script/arch-update.sh:528 +#: src/script/arch-update.sh:510 #, sh-format msgid "Would you like to remove them from the cache now? [Y/n]" msgstr "" -#: src/script/arch-update.sh:535 src/script/arch-update.sh:555 +#: src/script/arch-update.sh:517 src/script/arch-update.sh:537 #, sh-format msgid "Removing old cached packages..." msgstr "" -#: src/script/arch-update.sh:545 src/script/arch-update.sh:564 +#: src/script/arch-update.sh:527 src/script/arch-update.sh:546 #, sh-format msgid "Removing uninstalled cached packages..." msgstr "" -#: src/script/arch-update.sh:580 +#: src/script/arch-update.sh:562 #, sh-format msgid "No old or uninstalled cached package found\\n" msgstr "" -#: src/script/arch-update.sh:589 +#: src/script/arch-update.sh:571 #, sh-format msgid "Pacnew Files:" msgstr "" -#: src/script/arch-update.sh:593 +#: src/script/arch-update.sh:575 #, sh-format msgid "Would you like to process this file now? [Y/n]" msgstr "" -#: src/script/arch-update.sh:595 +#: src/script/arch-update.sh:577 #, sh-format msgid "Would you like to process these files now? [Y/n]" msgstr "" -#: src/script/arch-update.sh:601 +#: src/script/arch-update.sh:583 #, sh-format msgid "Processing Pacnew Files...\\n" msgstr "" -#: src/script/arch-update.sh:605 +#: src/script/arch-update.sh:587 #, sh-format msgid "The pacnew file(s) processing has been applied\\n" msgstr "" -#: src/script/arch-update.sh:608 +#: src/script/arch-update.sh:590 #, sh-format msgid "The pacnew file(s) processing hasn't been applied\\n" msgstr "" -#: src/script/arch-update.sh:612 +#: src/script/arch-update.sh:594 #, sh-format msgid "No pacnew file found\\n" msgstr "" -#: src/script/arch-update.sh:621 +#: src/script/arch-update.sh:603 #, sh-format msgid "" "Reboot required:\\nThere's a pending kernel update on your system requiring " "a reboot to be applied\\n" msgstr "" -#: src/script/arch-update.sh:622 +#: src/script/arch-update.sh:604 #, sh-format msgid "Would you like to reboot now? [y/N]" msgstr "" -#: src/script/arch-update.sh:627 +#: src/script/arch-update.sh:609 #, sh-format msgid "Rebooting in 5 seconds...\\nPress ctrl+c to abort" msgstr "" -#: src/script/arch-update.sh:631 +#: src/script/arch-update.sh:613 #, sh-format msgid "" "An error has occurred during the reboot process\\nThe reboot has been " "aborted\\n" msgstr "" -#: src/script/arch-update.sh:639 +#: src/script/arch-update.sh:621 #, sh-format msgid "" "The reboot hasn't been performed\\nPlease, consider rebooting to finalize " "the pending kernel update\\n" msgstr "" -#: src/script/arch-update.sh:643 +#: src/script/arch-update.sh:625 #, sh-format msgid "No pending kernel update found\\n" msgstr "" -#: src/script/arch-update.sh:691 +#: src/script/arch-update.sh:673 #, sh-format msgid "" "The '${config_file}' configuration file already exists\\nPlease, remove it " "before generating a new one" msgstr "" -#: src/script/arch-update.sh:696 +#: src/script/arch-update.sh:678 #, sh-format msgid "The '${config_file}' configuration file has been generated" msgstr "" diff --git a/po/fr.po b/po/fr.po index 2507db6..c935dab 100644 --- a/po/fr.po +++ b/po/fr.po @@ -9,7 +9,7 @@ msgstr "" "Project-Id-Version: Arch-Update 1.15.0\n" "Report-Msgid-Bugs-To: https://github.com/Antiz96/arch-update/issues\n" "POT-Creation-Date: 2024-03-17 16:22+0100\n" -"PO-Revision-Date: 2024-03-17 17:00+0100\n" +"PO-Revision-Date: 2024-05-09 09:30+0100\n" "Last-Translator: Robin Candau \n" "Language: fr\n" "MIME-Version: 1.0\n" @@ -119,20 +119,25 @@ msgstr " --gen-config Générer un fichier de configuration par défaut/ex #: src/script/arch-update.sh:173 #, sh-format +msgid " --tray Launch the Arch-Update systray applet" +msgstr " --tray Lancer l'applet systray d'Arch-Update" + +#: src/script/arch-update.sh:174 +#, sh-format msgid " -h, --help Display this help message and exit" msgstr " -h, --help Afficher ce message d'aide et quitter" -#: src/script/arch-update.sh:174 +#: src/script/arch-update.sh:175 #, sh-format msgid " -V, --version Display version information and exit" msgstr " -V, --version Afficher les informations de version et quitter" -#: src/script/arch-update.sh:176 +#: src/script/arch-update.sh:177 #, sh-format msgid "For more information, see the ${name}(1) man page." msgstr "Pour plus d'informations, consultez la page de manuel ${name}(1)." -#: src/script/arch-update.sh:177 +#: src/script/arch-update.sh:178 #, sh-format msgid "" "Certain options can be enabled/disabled or modified via the ${name}.conf " @@ -141,7 +146,7 @@ msgstr "" "Certaines options peuvent être activées/désactivées ou modifiées via le fichier de configuration ${name}.conf, " "voir la page de manuel ${name}.conf(5)." -#: src/script/arch-update.sh:188 +#: src/script/arch-update.sh:189 #, sh-format msgid "" "${name}: invalid option -- '${option}'\\nTry '${name} --help' for more " @@ -150,114 +155,114 @@ msgstr "" "${name}: option invalide -- '${option}'\\nEssayez '${name} --help' pour plus " "d'informations." -#: src/script/arch-update.sh:244 src/script/arch-update.sh:246 +#: src/script/arch-update.sh:229 src/script/arch-update.sh:231 #, sh-format msgid "${update_number} update available" msgstr "${update_number} mise à jour disponible" -#: src/script/arch-update.sh:251 src/script/arch-update.sh:253 +#: src/script/arch-update.sh:236 src/script/arch-update.sh:238 #, sh-format msgid "${update_number} updates available" msgstr "${update_number} mises à jour disponibles" -#: src/script/arch-update.sh:270 +#: src/script/arch-update.sh:254 #, sh-format msgid "Looking for updates...\\n" msgstr "Recherche de mises à jour...\\n" -#: src/script/arch-update.sh:291 +#: src/script/arch-update.sh:275 #, sh-format msgid "Packages:" msgstr "Paquets :" -#: src/script/arch-update.sh:296 +#: src/script/arch-update.sh:280 #, sh-format msgid "AUR Packages:" msgstr "Paquets AUR :" -#: src/script/arch-update.sh:301 +#: src/script/arch-update.sh:285 #, sh-format msgid "Flatpak Packages:" msgstr "Paquets Flatpak :" -#: src/script/arch-update.sh:308 +#: src/script/arch-update.sh:292 #, sh-format msgid "No update available\\n" msgstr "Aucune mise à jour disponible\\n" -#: src/script/arch-update.sh:315 +#: src/script/arch-update.sh:299 #, sh-format msgid "Proceed with update? [Y/n]" msgstr "Procéder à la mise à jour ? [O/n]" -#: src/script/arch-update.sh:318 src/script/arch-update.sh:457 -#: src/script/arch-update.sh:490 src/script/arch-update.sh:532 -#: src/script/arch-update.sh:599 src/script/arch-update.sh:625 +#: src/script/arch-update.sh:302 src/script/arch-update.sh:439 +#: src/script/arch-update.sh:472 src/script/arch-update.sh:514 +#: src/script/arch-update.sh:581 src/script/arch-update.sh:607 #, sh-format msgid "Y" msgstr "O" -#: src/script/arch-update.sh:318 src/script/arch-update.sh:457 -#: src/script/arch-update.sh:490 src/script/arch-update.sh:532 -#: src/script/arch-update.sh:599 src/script/arch-update.sh:625 +#: src/script/arch-update.sh:302 src/script/arch-update.sh:439 +#: src/script/arch-update.sh:472 src/script/arch-update.sh:514 +#: src/script/arch-update.sh:581 src/script/arch-update.sh:607 #, sh-format msgid "y" msgstr "o" -#: src/script/arch-update.sh:322 +#: src/script/arch-update.sh:306 #, sh-format msgid "The update has been aborted\\n" msgstr "La mise à jour a été abandonnée\\n" -#: src/script/arch-update.sh:353 +#: src/script/arch-update.sh:337 #, sh-format msgid "Arch News:" msgstr "Arch News :" -#: src/script/arch-update.sh:358 +#: src/script/arch-update.sh:342 #, sh-format msgid "[NEW]" msgstr "[NOUVEAU]" -#: src/script/arch-update.sh:369 +#: src/script/arch-update.sh:353 #, sh-format msgid "Select the news to read (or just press \"enter\" to quit):" msgstr "Sélectionnez la news à lire (ou appuyez simplement sur \"entrée\" pour quitter) :" -#: src/script/arch-update.sh:371 +#: src/script/arch-update.sh:355 #, sh-format msgid "" "Select the news to read (or just press \"enter\" to proceed with update):" msgstr "" "Sélectionnez la news à lire (ou appuyez simplement sur \"entrée\" pour procéder à la mise à jour) :" -#: src/script/arch-update.sh:382 +#: src/script/arch-update.sh:366 #, sh-format msgid "Title:" msgstr "Titre :" -#: src/script/arch-update.sh:383 +#: src/script/arch-update.sh:367 #, sh-format msgid "Author:" msgstr "Auteur :" -#: src/script/arch-update.sh:384 +#: src/script/arch-update.sh:368 #, sh-format msgid "Publication date:" msgstr "Date de publication :" -#: src/script/arch-update.sh:385 +#: src/script/arch-update.sh:369 #, sh-format msgid "URL:" msgstr "URL :" -#: src/script/arch-update.sh:400 +#: src/script/arch-update.sh:382 #, sh-format msgid "Updating Packages...\\n" msgstr "Mise à jour des paquets...\\n" -#: src/script/arch-update.sh:405 src/script/arch-update.sh:417 -#: src/script/arch-update.sh:428 +#: src/script/arch-update.sh:387 src/script/arch-update.sh:399 +#: src/script/arch-update.sh:410 #, sh-format msgid "" "An error has occurred during the update process\\nThe update has been " @@ -266,27 +271,27 @@ msgstr "" "Une erreur est survenue pendant le processus de mise à jour\\nLa mise à jour a été " "abandonnée\\n" -#: src/script/arch-update.sh:412 +#: src/script/arch-update.sh:394 #, sh-format msgid "Updating AUR Packages...\\n" msgstr "Mise à jour des paquets AUR...\\n" -#: src/script/arch-update.sh:424 +#: src/script/arch-update.sh:406 #, sh-format msgid "Updating Flatpak Packages...\\n" msgstr "Mise à jour des paquets Flatpak...\\n" -#: src/script/arch-update.sh:435 +#: src/script/arch-update.sh:417 #, sh-format msgid "The update has been applied\\n" msgstr "La mise à jour a été appliquée\\n" -#: src/script/arch-update.sh:447 +#: src/script/arch-update.sh:429 #, sh-format msgid "Orphan Packages:" msgstr "Paquets orphelins :" -#: src/script/arch-update.sh:451 +#: src/script/arch-update.sh:433 #, sh-format msgid "" "Would you like to remove this orphan package (and its potential " @@ -295,7 +300,7 @@ msgstr "" "Voulez-vous supprimer ce paquet orphelin (et ses potentielles " "dépendances) maintenant ? [o/N]" -#: src/script/arch-update.sh:453 +#: src/script/arch-update.sh:435 #, sh-format msgid "" "Would you like to remove these orphan packages (and their potential " @@ -304,14 +309,14 @@ msgstr "" "Voulez-vous supprimer ces paquets orphelins (et leurs potentielles " "dépendances) maintenant ? [o/N]" -#: src/script/arch-update.sh:459 +#: src/script/arch-update.sh:441 #, sh-format msgid "Removing Orphan Packages...\\n" msgstr "Suppression des paquets orphelins...\\n" -#: src/script/arch-update.sh:463 src/script/arch-update.sh:496 -#: src/script/arch-update.sh:539 src/script/arch-update.sh:549 -#: src/script/arch-update.sh:559 src/script/arch-update.sh:568 +#: src/script/arch-update.sh:445 src/script/arch-update.sh:478 +#: src/script/arch-update.sh:521 src/script/arch-update.sh:531 +#: src/script/arch-update.sh:541 src/script/arch-update.sh:550 #, sh-format msgid "" "An error has occurred during the removal process\\nThe removal has been " @@ -320,118 +325,118 @@ msgstr "" "Une erreur est survenue pendant le processus de suppression\\nLa suppression a été " "abandonnée\\n" -#: src/script/arch-update.sh:466 src/script/arch-update.sh:499 +#: src/script/arch-update.sh:448 src/script/arch-update.sh:481 #, sh-format msgid "The removal has been applied\\n" msgstr "La suppression a été appliquée\\n" -#: src/script/arch-update.sh:471 src/script/arch-update.sh:503 -#: src/script/arch-update.sh:576 +#: src/script/arch-update.sh:453 src/script/arch-update.sh:485 +#: src/script/arch-update.sh:558 #, sh-format msgid "The removal hasn't been applied\\n" msgstr "La suppression n'a pas été appliquée\\n" -#: src/script/arch-update.sh:475 +#: src/script/arch-update.sh:457 #, sh-format msgid "No orphan package found\\n" msgstr "Aucun paquet orphelin n'a été trouvé\\n" -#: src/script/arch-update.sh:480 +#: src/script/arch-update.sh:462 #, sh-format msgid "Flatpak Unused Packages:" msgstr "Paquets Flatpak inutilisés :" -#: src/script/arch-update.sh:484 +#: src/script/arch-update.sh:466 #, sh-format msgid "Would you like to remove this Flatpak unused package now? [y/N]" msgstr "Voulez-vous supprimer ce paquet Flatpak inutilisé maintenant ? [o/N]" -#: src/script/arch-update.sh:486 +#: src/script/arch-update.sh:468 #, sh-format msgid "Would you like to remove these Flatpak unused packages now? [y/N]" msgstr "Voulez-vous supprimer ces paquets Flatpak inutilisés maintenant ? [o/N]" -#: src/script/arch-update.sh:492 +#: src/script/arch-update.sh:474 #, sh-format msgid "Removing Flatpak Unused Packages..." msgstr "Suppression des paquets Flatpak inutilisés..." -#: src/script/arch-update.sh:507 +#: src/script/arch-update.sh:489 #, sh-format msgid "No Flatpak unused package found\\n" msgstr "Aucun paquet Flatpak inutilisé n'a été trouvé\\n" -#: src/script/arch-update.sh:524 +#: src/script/arch-update.sh:506 #, sh-format msgid "Cached Packages:\\nThere's an old or uninstalled cached package\\n" msgstr "Paquets mis en cache :\\nIl y a un paquet ancien ou désinstallé mis en cache\\n" -#: src/script/arch-update.sh:525 +#: src/script/arch-update.sh:507 #, sh-format msgid "Would you like to remove it from the cache now? [Y/n]" msgstr "Voulez-vous le supprimer du cache maintenant ? [O/n]" -#: src/script/arch-update.sh:527 +#: src/script/arch-update.sh:509 #, sh-format msgid "Cached Packages:\\nThere are old and/or uninstalled cached packages\\n" msgstr "Paquets mis en cache :\\nIl y a plusieurs paquets anciens ou désinstallés mis en cache\\n" -#: src/script/arch-update.sh:528 +#: src/script/arch-update.sh:510 #, sh-format msgid "Would you like to remove them from the cache now? [Y/n]" msgstr "Voulez-vous les supprimer du cache maintenant ? [O/n]" -#: src/script/arch-update.sh:535 src/script/arch-update.sh:555 +#: src/script/arch-update.sh:517 src/script/arch-update.sh:537 #, sh-format msgid "Removing old cached packages..." msgstr "Suppression des anciens paquets mis en cache..." -#: src/script/arch-update.sh:545 src/script/arch-update.sh:564 +#: src/script/arch-update.sh:527 src/script/arch-update.sh:546 #, sh-format msgid "Removing uninstalled cached packages..." msgstr "Suppression des paquets désinstallés mis en cache..." -#: src/script/arch-update.sh:580 +#: src/script/arch-update.sh:562 #, sh-format msgid "No old or uninstalled cached package found\\n" msgstr "Aucun paquet ancien ou désinstallé mis en cache n'a été trouvé\\n" -#: src/script/arch-update.sh:589 +#: src/script/arch-update.sh:571 #, sh-format msgid "Pacnew Files:" msgstr "Fichiers Pacnew :" -#: src/script/arch-update.sh:593 +#: src/script/arch-update.sh:575 #, sh-format msgid "Would you like to process this file now? [Y/n]" msgstr "Voulez-vous traiter ce fichier maintenant ? [O/n]" -#: src/script/arch-update.sh:595 +#: src/script/arch-update.sh:577 #, sh-format msgid "Would you like to process these files now? [Y/n]" msgstr "Voulez-vous traiter ces fichiers maintenant ? [O/n]" -#: src/script/arch-update.sh:601 +#: src/script/arch-update.sh:583 #, sh-format msgid "Processing Pacnew Files...\\n" msgstr "Traitement des fichiers pacnew...\\n" -#: src/script/arch-update.sh:605 +#: src/script/arch-update.sh:587 #, sh-format msgid "The pacnew file(s) processing has been applied\\n" msgstr "Le traitement des fichiers pacnew a été appliqué\\n" -#: src/script/arch-update.sh:608 +#: src/script/arch-update.sh:590 #, sh-format msgid "The pacnew file(s) processing hasn't been applied\\n" msgstr "Le traitement des fichiers pacnew n'a pas été appliqué\\n" -#: src/script/arch-update.sh:612 +#: src/script/arch-update.sh:594 #, sh-format msgid "No pacnew file found\\n" msgstr "Aucun fichier pacnew n'a été trouvé\\n" -#: src/script/arch-update.sh:621 +#: src/script/arch-update.sh:603 #, sh-format msgid "" "Reboot required:\\nThere's a pending kernel update on your system requiring " @@ -440,17 +445,17 @@ msgstr "" "Redémarrage nécessaire :\\nIl y a une mise à jour du noyau en attente sur votre système qui nécessite " "un redémarrage pour être appliquée\\n" -#: src/script/arch-update.sh:622 +#: src/script/arch-update.sh:604 #, sh-format msgid "Would you like to reboot now? [y/N]" msgstr "Voulez-vous redémarrer votre système maintenant ? [o/N]" -#: src/script/arch-update.sh:627 +#: src/script/arch-update.sh:609 #, sh-format msgid "Rebooting in 5 seconds...\\nPress ctrl+c to abort" msgstr "Redémarrage dans 5 secondes...\\nAppuyez sur ctrl+c pour annuler" -#: src/script/arch-update.sh:631 +#: src/script/arch-update.sh:613 #, sh-format msgid "" "An error has occurred during the reboot process\\nThe reboot has been " @@ -459,7 +464,7 @@ msgstr "" "Une erreur est survenue pendant le processus de redémarrage\\nLe redémarrage a été " "abandonné\\n" -#: src/script/arch-update.sh:639 +#: src/script/arch-update.sh:621 #, sh-format msgid "" "The reboot hasn't been performed\\nPlease, consider rebooting to finalize " @@ -468,12 +473,12 @@ msgstr "" "Le redémarrage n'a pas été effectué\\nVeuillez considérer redémarrer votre système pour finaliser " "la mise à jour du noyau en attente\\n" -#: src/script/arch-update.sh:643 +#: src/script/arch-update.sh:625 #, sh-format msgid "No pending kernel update found\\n" msgstr "Aucune mise à jour du noyau en attente n'a été trouvée\\n" -#: src/script/arch-update.sh:691 +#: src/script/arch-update.sh:673 #, sh-format msgid "" "The '${config_file}' configuration file already exists\\nPlease, remove it " @@ -482,7 +487,7 @@ msgstr "" "Le fichier de configuration '${config_file}' existe déjà.\\nVeuillez le supprimer " "avant d'en générer un nouveau" -#: src/script/arch-update.sh:696 +#: src/script/arch-update.sh:678 #, sh-format msgid "The '${config_file}' configuration file has been generated" msgstr "Le fichier de configuration '${config_file}' a été généré" diff --git a/res/completions/arch-update.bash b/res/completions/arch-update.bash index 5c01f3b..ed89a03 100644 --- a/res/completions/arch-update.bash +++ b/res/completions/arch-update.bash @@ -7,6 +7,7 @@ _arch-update() { -n --news -D --debug --gen-config + --tray -h --help -V --version') diff --git a/res/completions/arch-update.fish b/res/completions/arch-update.fish index 48b7b74..736739c 100644 --- a/res/completions/arch-update.fish +++ b/res/completions/arch-update.fish @@ -6,5 +6,6 @@ complete -c arch-update -s d -l devel -d 'Include AUR development packages updat complete -c arch-update -s n -l news -d 'Display latest Arch news' complete -c arch-update -s D -l debug -d 'Display debug traces' complete -c arch-update -l gen-config -d 'Generate a default/example configuration file' +complete -c arch-update -l tray -d 'Launch the Arch-Update systray applet' complete -c arch-update -s h -l help -d 'Display the help message' complete -c arch-update -s V -l version -d 'Display version information' diff --git a/res/completions/arch-update.zsh b/res/completions/arch-update.zsh index ed75690..fbff1a2 100644 --- a/res/completions/arch-update.zsh +++ b/res/completions/arch-update.zsh @@ -8,6 +8,7 @@ opts=( {-n,--news}'[Display latest Arch news]' {-D,--debug}'[Display debug traces]' {--gen-config}'[Generate a default/example configuration file]' + {--tray}'[Launch the Arch-Update systray applet]' {-h,--help}'[Display the help message]' {-V,--version}'[Display version information]' ) diff --git a/res/systemd/arch-update-tray.service b/res/systemd/arch-update-tray.service new file mode 100644 index 0000000..a4ffa56 --- /dev/null +++ b/res/systemd/arch-update-tray.service @@ -0,0 +1,10 @@ +[Unit] +Description=Launch the Arch-Update systray applet +After=graphical-session.target + +[Service] +ExecStart=arch-update --tray +Restart=on-failure + +[Install] +WantedBy=graphical-session.target diff --git a/src/script/arch-update-tray.py b/src/script/arch-update-tray.py new file mode 100755 index 0000000..ec698cc --- /dev/null +++ b/src/script/arch-update-tray.py @@ -0,0 +1,81 @@ +#!/usr/bin/env python3 +"""Arch-Update System Tray.""" +import logging +import os +import sys +import subprocess +from PyQt6.QtGui import QIcon +from PyQt6.QtWidgets import QApplication, QSystemTrayIcon +from PyQt6.QtCore import QFileSystemWatcher + +# Create logger +log = logging.getLogger(__name__) + +# Find Statefile +if 'XDG_STATE_HOME' in os.environ: + STATE_FILE = os.path.join( + os.environ['XDG_STATE_HOME'], 'arch-update', 'current_state') +elif 'HOME' in os.environ: + STATE_FILE = os.path.join( + os.environ['HOME'], '.local', 'state', 'arch-update', 'current_state') +if not os.path.isfile(STATE_FILE): + log.error("Statefile does not exist: %s", STATE_FILE) + sys.exit(1) + + +def arch_update(): + """ Launch with terminal """ + update = "/usr/share/applications/arch-update.desktop" + if not os.path.isfile(update): + update = "/usr/local/share/applications/arch-update.desktop" + subprocess.run(["gio", "launch", update], check=False) + + +class ArchUpdateQt6: + """ System Tray using QT6 library """ + + def file_changed(self): + """ Called when statefile contents change """ + + contents = "" + if self.watcher and not self.statefile in self.watcher.files(): + self.watcher.addPath(self.statefile) + try: + with open(self.statefile, encoding="utf-8") as f: + contents = f.readline().strip() + except FileNotFoundError: + log.error("Statefile Missing") + sys.exit(1) + if contents.startswith("arch-update"): + icon = QIcon.fromTheme(contents) + self.tray.setIcon(icon) + + def update(self): + """ Start arch-update """ + arch_update() + + def __init__(self, statefile): + """ Start Qt6 System Tray """ + + self.statefile = statefile + self.watcher = None + + # Application + app = QApplication([]) + app.setQuitOnLastWindowClosed(False) + + # Icon + self.tray = QSystemTrayIcon() + self.file_changed() + self.tray.setVisible(True) + self.tray.activated.connect(self.update) + + # File Watcher + self.watcher = QFileSystemWatcher([self.statefile]) + self.watcher.fileChanged.connect(self.file_changed) + + app.exec() + + +if __name__ == "__main__": + ArchUpdateQt6(STATE_FILE) diff --git a/src/script/arch-update.sh b/src/script/arch-update.sh index dacd597..167b677 100755 --- a/src/script/arch-update.sh +++ b/src/script/arch-update.sh @@ -170,6 +170,7 @@ $(eval_gettext " -d, --devel Include AUR development packages updates") $(eval_gettext " -n, --news [Num] Display latest Arch news, you can optionally specify the number of Arch news to display with '--news [Num]' (e.g. '--news 10')") $(eval_gettext " -D, --debug Display debug traces") $(eval_gettext " --gen-config Generate a default/example configuration file") +$(eval_gettext " --tray Launch the Arch-Update systray applet") $(eval_gettext " -h, --help Display this help message and exit") $(eval_gettext " -V, --version Display version information and exit") @@ -225,16 +226,16 @@ check() { last_notif_id=$(cat "${tmpdir}/last_notif_id" 2> /dev/null) if [ "${update_number}" -eq 1 ]; then if [ -z "${last_notif_id}" ]; then - notify-send -p -i "${name}_updates-available" "${_name}" "$(eval_gettext "\${update_number} update available")" > "${tmpdir}/last_notif_id" + notify-send -p -i "${name}" "${_name}" "$(eval_gettext "\${update_number} update available")" > "${tmpdir}/last_notif_id" else - notify-send -p -r "${last_notif_id}" -i "${name}_updates-available" "${_name}" "$(eval_gettext "\${update_number} update available")" > "${tmpdir}/last_notif_id" + notify-send -p -r "${last_notif_id}" -i "${name}" "${_name}" "$(eval_gettext "\${update_number} update available")" > "${tmpdir}/last_notif_id" fi else if [ -z "${last_notif_id}" ]; then - notify-send -p -i "${name}_updates-available" "${_name}" "$(eval_gettext "\${update_number} updates available")" > "${tmpdir}/last_notif_id" + notify-send -p -i "${name}" "${_name}" "$(eval_gettext "\${update_number} updates available")" > "${tmpdir}/last_notif_id" else - notify-send -p -r "${last_notif_id}" -i "${name}_updates-available" "${_name}" "$(eval_gettext "\${update_number} updates available")" > "${tmpdir}/last_notif_id" + notify-send -p -r "${last_notif_id}" -i "${name}" "${_name}" "$(eval_gettext "\${update_number} updates available")" > "${tmpdir}/last_notif_id" fi fi fi @@ -677,6 +678,13 @@ case "${option}" in info_msg "$(eval_gettext "The '\${config_file}' configuration file has been generated")" fi ;; + --tray) + if [ ! -f "${statedir}/current_state" ]; then + echo "${name}" > "${statedir}/current_state" + fi + + arch-update-tray || exit 3 + ;; -h|--help) help ;;