diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 8d27841..f39bcb9 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -24,7 +24,7 @@ jobs: run: find . -name '*.sh' -exec shellcheck --color=always {} + - name: Run pylint - run: find . -name '*.py' -exec pylint -d E0611,E0401,C0103 --output-format=colorized {} + + run: find . -name '*.py' -exec pylint -d E0611,E0401,C0103,C0301 --output-format=colorized {} + - name: Run make test run: make test diff --git a/CHANGELOG.md b/CHANGELOG.md index 7d4ea8e..202dd45 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,17 @@ All notable changes to this project will be documented in this file. +## [v3.3.0](https://github.com/Antiz96/arch-update/releases/tag/v3.3.0) - 2024-10-06 + +### Features + +- Add a dynamic dropdown menu entry to the systray applet menu containing the list of available updates ([#272](https://github.com/Antiz96/arch-update/pull/272)) - ([af51378](https://github.com/Antiz96/arch-update/commit/af51378cf4e0e7c67722ca9d90be44c26f6f27cc)) by @Antiz96 + +### Documentation + +- Update screenshots in the READMEs with the new systray's dropdown menu ([#273](https://github.com/Antiz96/arch-update/pull/273)) - ([d79ed9b](https://github.com/Antiz96/arch-update/commit/d79ed9b93324add9e926b059be98d38345bbc8ef)) by @Antiz96 +- Document the workaround for the race condition potentially happening when starting the systray applet at boot ([#271](https://github.com/Antiz96/arch-update/pull/271)) - ([64378f1](https://github.com/Antiz96/arch-update/commit/64378f1de372d7768cb53cbb76887babe50170f1)) by @Antiz96 + ## [v3.2.3](https://github.com/Antiz96/arch-update/releases/tag/v3.2.3) - 2024-10-05 ### Fixes diff --git a/README-fr.md b/README-fr.md index a045b3a..945d1bb 100644 --- a/README-fr.md +++ b/README-fr.md @@ -104,7 +104,9 @@ arch-update --tray --enable systemctl --user enable --now arch-update-tray.service ``` -Si vous utilisez un gestionnaire de fenêtre ou un compositeur Wayland, vous pouvez plutôt ajouter la commande `arch-update --tray` à vôtre fichier de configuration. +Si vous utilisez un gestionnaire de fenêtre ou un compositeur Wayland, vous pouvez plutôt ajouter la commande `arch-update --tray` à vos applications "auto-start" dans votre fichier de configuration. + +**Si l'applet systray ne démarre pas au démarrage du système malgré tout**, veuillez lire [ce chapitre](#lapplet-systray-ne-démarre-pas-au-démarrage-du-système). L'icône du systray changera automatiquement en fonction de l'état actuel de votre système ('à jour' ou 'mises à jour disponibles'). Lorsque vous cliquez dessus, elle lance `arch-update` via le fichier [arch-update.desktop](https://github.com/Antiz96/arch-update/blob/main/res/desktop/arch-update.desktop). @@ -137,19 +139,23 @@ C'est l'icône à droite de celle du wifi dans la capture d'écran ci-dessous: ![systray-icon](https://github.com/Antiz96/arch-update/assets/53110319/fe032e68-3582-470a-9e6d-b51a9ea8c1ba) -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` ou en faisant un clic droit sur l'applet systray puis en cliquant sur l'entrée `Vérifier les mises à jour` depuis le menu : +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` ou en faisant un clic droit sur l'icône du systray puis en cliquant sur l'entrée `Vérifier les mises à jour` depuis le menu : + +![check_menu_fr](https://github.com/user-attachments/assets/b0b7730b-0196-4973-ac90-bceb8a74845e) -![check_menu_fr](https://github.com/user-attachments/assets/e16a3fc1-bce6-4509-8aeb-a85784354783) +Si de nouvelles mises à jour sont disponibles, l'icône du systray affichera un cercle rouge et une notification de bureau indiquant le nombre de mises à jour disponibles sera envoyée (nécessite [libnotify](https://archlinux.org/packages/extra/x86_64/libnotify/ "paquet libnotify") et un serveur de notification en cours d'exécution) : -Si de nouvelles mises à jour sont disponibles, l'icône systray affichera un cercle rouge. Vous pouvez alors voir la liste des mises à jour disponibles en passant votre souris sur l'icône de l'applet systray : +![notif_fr](https://github.com/user-attachments/assets/56d72147-bde4-492b-8ad1-20caed9f22a9) -![tooltip_fr](https://github.com/user-attachments/assets/ccad758a-bf3a-4e1d-aa9c-17470488f761) +Vous pouvez alors voir la liste des mises à jour disponibles dans l'infobulle de l'icône du systray en passant votre souris dessus : -De plus, une notification de bureau indiquant le nombre de mises à jour disponibles sera envoyée s'il y a de nouvelles mises à jour depuis le dernier check (nécessite [libnotify](https://archlinux.org/packages/extra/x86_64/libnotify/ "paquet libnotify") et un serveur de notification en cours d'exécution) : +![tooltip_fr](https://github.com/user-attachments/assets/8bc3d339-f7ab-4c8b-aa3f-2b88ea68af42) -![notif_fr](https://github.com/user-attachments/assets/16090810-157d-466b-86d4-70b5ed8091b5) +Alternativement, vous pouvez voir la liste des mises à jour disponible dans le menu déroulant en faisant un clic droit sur l'icône du systray : -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). +![dropdown_menu_fr](https://github.com/user-attachments/assets/60c3c0d8-8091-4047-b8da-ce8f8bc72476) + +Quand l'icône du 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). ![listing_packages-FR](https://github.com/Antiz96/arch-update/assets/53110319/60547cde-f327-46f8-907c-61bf9bbee6c5) @@ -182,7 +188,7 @@ de fichiers pacnew & pacsave, de mise à jour du noyau en attente ainsi que des et, s'il y en a, propose de les traiter. Options : --c, --check Vérifier les mises à jour disponibles, changer l'icône systray et envoyer une notification de bureau contenant le nombre de mises à jour disponibles (s'il y a des nouvelles mises à jour disponibles depuis le dernier check) +-c, --check Vérifier les mises à jour disponibles, changer l'icône du systray et envoyer une notification de bureau contenant le nombre de mises à jour disponibles (s'il y a des nouvelles mises à jour disponibles depuis le dernier check) -l, --list Afficher la liste des mises à jour en attente -d, --devel Inclure les mises à jour des paquets de développement AUR -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`) @@ -262,6 +268,27 @@ Voir et +### L'applet systray ne démarre pas au démarrage du système + +Assurez vous d'avoir suivi les instructions de [ce chapitre](#lapplet-systray). + +Si l'applet systray ne démarre pas malgré tout, cela peut être le résultat d'une [situation de compétition](https://fr.wikipedia.org/wiki/Situation_de_comp%C3%A9tition). +Dans ce cas, il peut être utile de légèrement retarder le démarrage de l'applet systray en utilisant une déclaration `sleep` au préalable : + +- Si vous avez utilisé `arch-update --tray --enable`, modifiez la ligne `Exec=` dans le fichier `arch-update-tray.desktop` (qui se trouve sous `~/.config/autostart/` par défaut), comme ceci : + +> Exec=sh -c "sleep 3 && arch-update --tray" + +- Si vous avez utilisé le service systemd `arch-update-tray.service`, exécutez `systemctl --user edit --full arch-update-tray.service` et modifiez la ligne `ExecStart=`, comme ceci : + +> ExecStart=sh -c "sleep 3 && arch-update --tray" + +- Si vous utilisez un gestionnaire de fenêtres ou un compositeur Wayland, ajoutez une déclaration `sleep` avant la commande `arch-update --tray` dans vos applications "auto-start" dans votre fichier de configuration, comme ceci : + +> `sleep 3 && arch-update --tray` + +Si l'applet systray ne démarre toujours au démarrage du système, essayez de graduellement augmenter la valeur du `sleep`. + ### Modifier le cycle de vérification automatique Si vous avez activé le [timer systemd](#le-timer-systemd), l'option `--check` est automatiquement lancée au démarrage du système puis une fois par heure. diff --git a/README.md b/README.md index cb6ed5e..d7e18da 100644 --- a/README.md +++ b/README.md @@ -104,7 +104,9 @@ arch-update --tray --enable systemctl --user enable --now arch-update-tray.service ``` -If you use a Window Manager or a Wayland Compositor, you can add the `arch-update --tray` command to your configuration file instead. +If you use a Window Manager or a Wayland Compositor, you can add the `arch-update --tray` command to your "auto-start" apps in your configuration file instead. + +**If the systray applet doesn't start at boot regardless**, please read [this chapter](#the-systray-applet-does-not-start-at-boot). The systray icon will automatically change depending on the current state of your system ('up to date' or 'updates available'). When clicked, it launches `arch-update` via the [arch-update.desktop](https://github.com/Antiz96/arch-update/blob/main/res/desktop/arch-update.desktop) file. @@ -137,19 +139,23 @@ It is the icon at the right of the 'wifi' one in the screenshot below: ![systray-icon](https://github.com/Antiz96/arch-update/assets/53110319/fe032e68-3582-470a-9e6d-b51a9ea8c1ba) -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 or by right clicking the systray applet and then clicking on the `Check for updates` menu entry: +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 or by right-clicking the systray icon and then clicking on the `Check for updates` menu entry: + +![check_for_updates](https://github.com/user-attachments/assets/86c3107d-d7aa-4ced-b9aa-69668c2e3c2a) -![check_for_updates](https://github.com/user-attachments/assets/fc1e1dc4-9b42-4560-beeb-7cb44186364d) +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): -If there are new available updates, the systray icon will show a red circle. You can then see the list of available updates by hovering your mouse over the icon: +![notif](https://github.com/user-attachments/assets/55301470-fab6-463f-af2e-ebe4e3d65af7) -![tooltip](https://github.com/user-attachments/assets/59237e42-b989-4222-9be7-1d6a88eef790) +You can then see the list of available updates in the systray icon's tooltip by hovering your mouse over it: -Additionally, a desktop notification indicating the number of available updates will be sent if there are new available updates compared to the last check (requires [libnotify](https://archlinux.org/packages/extra/x86_64/libnotify/ "libnotify package") and a running notification server): +![tooltip](https://github.com/user-attachments/assets/52ee0608-a8a2-4be9-ba9b-badeb8720ba1) -![notif](https://github.com/user-attachments/assets/16518dc4-d883-420f-b8a3-097f85177bb1) +Alternatively, you can see the list of available updates in the dropdown menu entry by right-clicking the systray icon: -When the systray applet is left 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). +![dropdown_menu](https://github.com/user-attachments/assets/4621d7d2-a9e4-40c3-851f-ee1687e6cf1e) + +When the systray icon is left-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). ![listing_packages](https://github.com/Antiz96/arch-update/assets/53110319/ed552414-0dff-4cff-84d2-6ff13340259d) @@ -262,6 +268,27 @@ See and +### The systray applet does not start at boot + +Make sure you followed instructions of [this chapter](#the-systray-applet). + +If the systray applet doesn't start regardless, this could be the result of a [race condition](https://en.wikipedia.org/wiki/Race_condition#In_software). +In such case, it might be useful to slightly delay the startup of the systray applet by using a `sleep` statement beforehand: + +- If you used `arch-update --tray --enable`, modify the `Exec=` line in the `arch-update-tray.desktop` file (which is under `~/.config/autostart/` by default), like so: + +> Exec=sh -c "sleep 3 && arch-update --tray" + +- If you used the `arch-update-tray.service` systemd service, run `systemctl --user edit --full arch-update-tray.service` and modify the `ExecStart=` line, like so: + +> ExecStart=sh -c "sleep 3 && arch-update --tray" + +- If you're using a standalone Window Manager or a Wayland Compositor, add a `sleep` statement before the `arch-update --tray` command in your "auto-start" apps in your configuration file, like so: + +> `sleep 3 && arch-update --tray` + +If the systray applet still does not start at boot, try to gradually increase the value of the `sleep`. + ### Modify the auto-check cycle If you enabled the [systemd.timer](#the-systemd-timer), the `--check` option is automatically launched at boot and then once per hour. diff --git a/doc/man/arch-update.1 b/doc/man/arch-update.1 index 802ec4e..87fc32b 100644 --- a/doc/man/arch-update.1 +++ b/doc/man/arch-update.1 @@ -1,4 +1,4 @@ -.TH "ARCH-UPDATE" "1" "September 2024" "Arch-Update 3.2.3" "Arch-Update Manual" +.TH "ARCH-UPDATE" "1" "October 2024" "Arch-Update 3.3.0" "Arch-Update Manual" .SH NAME arch-update \- An update notifier & applier for Arch Linux that assists you with important pre / post update tasks. @@ -78,7 +78,7 @@ Start the Arch-Update systray applet. .br .RB "To start it automatically at boot, you can either run the " "arch-update --tray --enable " "command (preferred method for most Desktop Environments, uses XDG Autostart) or enable the associated systemd service (in case your Desktop Environment doesn't support XDG Autostart) by running " "systemctl \-\-user enable \-\-now arch-update-tray.service". .br -.RB "If you use a window manager or a Wayland compositor, you can add the " "arch-update --tray " "command to your configuration file instead." +.RB "If you use a window manager or a Wayland compositor, you can add the " "arch-update --tray " "command to your auto-start apps in your configuration file instead." .TP .B \-v, \-\-version @@ -102,7 +102,9 @@ To start it automatically at boot, you can either: .br .RB "- Enable the associated systemd service (in case your Desktop Environment doesn't support XDG Autostart): " "systemctl \-\-user enable \-\-now arch-update-tray.service" -.RB "If you use a Window Manager or a Wayland Compositor, you can add the " "arch-update \-\-tray " "command to your configuration file instead." +.RB "If you use a Window Manager or a Wayland Compositor, you can add the " "arch-update \-\-tray " "command to your auto-start apps in your configuration file instead." + +.BR "If the systray applet doesn't start at boot regardless" ", please read the " "'The systray applet does not start at boot' " "chapter in the " "Tips and Tricks " "section below." .RB "The systray icon will automatically change depending on the current state of your system ('up to date' or 'updates available'). When clicked, it launches " "arch-update " "via the " "arch-update.desktop " file. @@ -152,6 +154,27 @@ See https://www.flatpak.org/ and https://archlinux.org/packages/extra/x86_64/fla .br See https://wiki.archlinux.org/title/Desktop_notifications +.TP +.B The systray applet does not start at boot +.RB "Make sure you followed instructions of the " "'The systray applet' " "chapter in the " "Usage " "section above." + +.RB "If the systray applet doesn't start regardless, this could be the result of a " "race condition". +.RB "In such case, it might be useful to slightly delay the startup of the systray applet by using a " "sleep " "statement beforehand:" + +.RB "\- If you used " "arch-update --tray --enable" ", modify the " "Exec= " "line in the " "arch-update-tray.desktop " "file (which is under " "~/.config/autostart/ " "by default), like so:" +.br +Exec=sh -c "sleep 3 && arch-update --tray" + +.RB "\- If you used the " "arch-update-tray.service " "systemd service, run " "systemctl --user edit --full arch-update-tray.service " "and modify the " "ExecStart= " "line, like so:" +.br +ExecStart=sh -c "sleep 3 && arch-update --tray" + +.RB "\- If you're using a standalone Window Manager or a Wayland Compositor, add a " "sleep " "statement before the " "arch-update --tray " "command in your auto-start apps in your configuration file, like so:" +.br +sleep 3 && arch-update --tray + +.RB "If the systray applet still does not start at boot, try to gradually increase the value of the " "sleep". + .TP .B Modify the auto-check cycle .RB "If you enabled the " "systemd.timer" ", the " "--check " "option is automatically launched at boot and then once per hour." diff --git a/doc/man/arch-update.conf.5 b/doc/man/arch-update.conf.5 index 8a2fa5c..949bb07 100644 --- a/doc/man/arch-update.conf.5 +++ b/doc/man/arch-update.conf.5 @@ -1,4 +1,4 @@ -.TH "ARCH-UPDATE.CONF" "5" "July 2024" "Arch-Update 3.2.3" "Arch-Update Manual" +.TH "ARCH-UPDATE.CONF" "5" "October 2024" "Arch-Update 3.3.0" "Arch-Update Manual" .SH NAME arch-update.conf \- arch-update configuration file. diff --git a/doc/man/fr/arch-update.1 b/doc/man/fr/arch-update.1 index d30e8e7..feae180 100644 --- a/doc/man/fr/arch-update.1 +++ b/doc/man/fr/arch-update.1 @@ -1,4 +1,4 @@ -.TH "ARCH-UPDATE" "1" "Septembre 2024" "Arch-Update 3.2.3" "Manuel de Arch-Update" +.TH "ARCH-UPDATE" "1" "Octobre 2024" "Arch-Update 3.3.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. @@ -32,7 +32,7 @@ Ces fonctions sont lancées quand vous cliquez sur l'applet systray. .B \-c, \-\-check Vérifier les mises à jour disponibles. .br -Change l'icône systray et envoie une notification de bureau contenant le nombre de mises à jour disponibles (s'il y a des nouvelles mises à jour disponibles depuis le dernier check). +Change l'icône du systray et envoie une notification de bureau contenant le nombre de mises à jour disponibles (s'il y a des nouvelles mises à jour disponibles depuis le dernier check). .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 @@ -78,7 +78,7 @@ Démarrer l'applet systray d'Arch-Update. .br .RB "Pour la démarrer automatiquement au démarrage du système, vous pouvez soit exécuter la commande " "arch-update --tray --enable " "(méthode recommandée pour la plupart des environnements de bureau, utilise XDG Autostart) ou vous pouvez activer le service systemd associé (dans le cas où vôtre environnement de bureau ne supporte pas XDG Autostart) en exécutant " "systemctl \-\-user enable \-\-now arch-update-tray.service". .br -.RB "Si vous utilisez un gestionnaire de fenêtres ou un compositeur Wayland, vous pouvez plutôt ajouter la commande " "arch-update --tray " "à votre fichier de configuration." +.RB "Si vous utilisez un gestionnaire de fenêtres ou un compositeur Wayland, vous pouvez plutôt ajouter la commande " "arch-update --tray " "à vos applications auto-start dans votre fichier de configuration." .TP .B \-v, \-\-version @@ -102,7 +102,9 @@ Pour la démarrer automatiquement au démarrage du système, utilisez l'une des .br .RB "- Activer le service systemd associé (dans le cas où votre environnement de bureau ne supporte pas XDG Autostart) : " "systemctl \-\-user enable \-\-now arch-update-tray.service" -.RB "Si vous utilisez un gestionnaire de fenêtre ou un compositeur Wayland, vous pouvez plutôt ajouter la commande " "arch-update \-\-tray " "à vôtre fichier de configuration." +.RB "Si vous utilisez un gestionnaire de fenêtre ou un compositeur Wayland, vous pouvez plutôt ajouter la commande " "arch-update \-\-tray " "à vos applications auto-start dans votre fichier de configuration." + +.BR "Si l'applet systray ne démarre pas au démarrage du système malgré tout" ", veuillez lire le chapitre " "'l'applet systray ne démarre pas au démarrage du système' " "dans la section " "Trucs et Astuces " "ci-dessous." .RB "L'icône du systray changera automatiquement en fonction de l'état actuel de votre système ('à jour' ou 'mises à jour disponibles'). Lorsque vous cliquez dessus, elle lance " "arch-update " "via le fichier " "arch-update.desktop". @@ -152,6 +154,28 @@ Voir https://www.flatpak.org/ et https://archlinux.org/packages/extra/x86_64/fla .br Voir https://wiki.archlinux.org/title/Desktop_notifications +.TP +.B L'applet systray ne démarre pas au démarrage du système + +.RB "Assurez vous d'avoir suivi les instructions du chapitre " "l'applet systray " "dans la section " "Utilisation " "ci-dessus." + +.RB "Si l'applet systray ne démarre pas malgré tout, cela peut être le résultat d'une " "situation de compétition". +.RB "Dans ce cas, il peut être utile de légèrement retarder le démarrage de l'applet systray en utilisant une déclaration " "sleep " "au préalable :" + +.RB "\- Si vous avez utilisé " "arch-update --tray --enable" ", modifiez la ligne " "Exec= " "dans le fichier " "arch-update-tray.desktop " "(qui se trouve sous " "~/.config/autostart/ " "par défaut), comme ceci :" +.br +Exec=sh -c "sleep 3 && arch-update --tray" + +.RB "\- Si vous avez utilisé le service systemd " "arch-update-tray.service" ", exécutez " "systemctl --user edit --full arch-update-tray.service " "et modifiez la ligne " "ExecStart=" ", comme ceci :" +.br +ExecStart=sh -c "sleep 3 && arch-update --tray" + +.RB "\- Si vous utilisez un gestionnaire de fenêtres ou un compositeur Wayland, ajoutez une déclaration " "sleep " "avant la commande " "arch-update --tray " "à vos applications auto-start dans votre fichier de configuration, comme ceci :" +.br +"sleep 3 && arch-update --tray" + +.RB "Si l'applet systray ne démarre toujours au démarrage du système, essayez de graduellement augmenter la valeur du " "sleep". + .TP .B Modifier le cycle de vérification automatique .RB "Si vous avez activé le " "systemd.timer" ", l'option " "--check " "est automatiquement lancée au démarrage du système puis une fois par heure." diff --git a/doc/man/fr/arch-update.conf.5 b/doc/man/fr/arch-update.conf.5 index 0958478..878d673 100644 --- a/doc/man/fr/arch-update.conf.5 +++ b/doc/man/fr/arch-update.conf.5 @@ -1,4 +1,4 @@ -.TH "ARCH-UPDATE.CONF" "5" "Juillet 2024" "Arch-Update 3.2.3" "Manuel de Arch-Update" +.TH "ARCH-UPDATE.CONF" "5" "Octobre 2024" "Arch-Update 3.3.0" "Manuel de Arch-Update" .SH NAME arch-update.conf \- fichier de configuration pour arch-update. diff --git a/po/arch-update.pot b/po/arch-update.pot index cf8ffd9..164e898 100644 --- a/po/arch-update.pot +++ b/po/arch-update.pot @@ -6,7 +6,7 @@ # AUTHOR , YEAR msgid "" msgstr "" -"Project-Id-Version: Arch-Update 3.2.3\n" +"Project-Id-Version: Arch-Update 3.3.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: YEAR-MO-DA HO:MI+ZONE\n" @@ -588,42 +588,55 @@ msgstr "" msgid "No service requiring a post upgrade restart found\\n" msgstr "" -#: src/lib/tray.py:123 -msgid "Arch-Update: 'updates' state file isn't found" +#: src/lib/tray.py:123 src/lib/tray.py:125 +msgid "'updates' state file isn't found" msgstr "" -#: src/lib/tray.py:137 -msgid "Arch-Update: System is up to date" +#: src/lib/tray.py:135 src/lib/tray.py:136 +msgid "System is up to date" msgstr "" #: src/lib/tray.py:140 #, python-brace-format msgid "" -"Arch-Update: 1 update available\n" +"1 update available\n" "\n" "{update_list}" msgstr "" +#: src/lib/tray.py:141 +msgid "1 update available" +msgstr "" + #: src/lib/tray.py:145 #, python-brace-format msgid "" -"Arch-Update: {updates} updates available\n" +"{updates} updates available\n" "\n" "{update_list}" msgstr "" -#: src/lib/tray.py:182 +#: src/lib/tray.py:146 +#, python-brace-format +msgid "{updates} updates available" +msgstr "" + +#: src/lib/tray.py:186 msgid "Run Arch-Update" msgstr "" -#: src/lib/tray.py:183 +#: src/lib/tray.py:187 msgid "Check for updates" msgstr "" -#: src/lib/tray.py:184 +#: src/lib/tray.py:188 msgid "Exit" msgstr "" +#: src/lib/tray.py:191 +msgid "Checking for updates..." +msgstr "" + #: src/lib/tray.sh:20 #, sh-format msgid "Arch-Update tray desktop file not found" diff --git a/po/fr.po b/po/fr.po index 0f20537..8f8d8b7 100644 --- a/po/fr.po +++ b/po/fr.po @@ -6,7 +6,7 @@ # Robin Candau , 2024 msgid "" msgstr "" -"Project-Id-Version: Arch-Update 3.2.3\n" +"Project-Id-Version: Arch-Update 3.3.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-05-09 09:30+0100\n" @@ -170,7 +170,7 @@ msgid "" "send a desktop notification containing the number of available updates (if " "there are new available updates compared to the last check)" msgstr "" -" -c, --check Vérifier les mises à jour disponibles, change l'icône systray et " +" -c, --check Vérifier les mises à jour disponibles, change l'icône du systray et " "envoie une notification de bureau contenant le nombre de mises à jour disponibles (s'" "il y a des nouvelles mises à jour depuis le dernier check)" @@ -658,48 +658,61 @@ msgstr "" msgid "No service requiring a post upgrade restart found\\n" msgstr "Aucun service nécessitant un redémarrage suite à la mise à jour n'a été trouvé\\n" -#: src/lib/tray.py:123 -msgid "Arch-Update: 'updates' state file isn't found" -msgstr "Arch-Update : fichier d'état 'updates' non trouvé" +#: src/lib/tray.py:123 src/lib/tray.py:125 +msgid "'updates' state file isn't found" +msgstr "fichier d'état 'updates' non trouvé" -#: src/lib/tray.py:137 -msgid "Arch-Update: System is up to date" -msgstr "Arch-Update : Le système est à jour" +#: src/lib/tray.py:135 src/lib/tray.py:136 +msgid "System is up to date" +msgstr "Le système est à jour" #: src/lib/tray.py:140 #, python-brace-format msgid "" -"Arch-Update: 1 update available\n" +"1 update available\n" "\n" "{update_list}" msgstr "" -"Arch-Update : 1 mise à jour disponible\n" +"1 mise à jour disponible\n" "\n" "{update_list}" +#: src/lib/tray.py:141 +msgid "1 update available" +msgstr "1 mise à jour disponible" + #: src/lib/tray.py:145 #, python-brace-format msgid "" -"Arch-Update: {updates} updates available\n" +"{updates} updates available\n" "\n" "{update_list}" msgstr "" -"Arch-Update : {updates} mises à jour disponibles\n" +"{updates} mises à jour disponibles\n" "\n" "{update_list}" -#: src/lib/tray.py:182 +#: src/lib/tray.py:146 +#, python-brace-format +msgid "{updates} updates available" +msgstr "{updates} mises à jour disponibles" + +#: src/lib/tray.py:186 msgid "Run Arch-Update" msgstr "Lancer Arch-Update" -#: src/lib/tray.py:183 +#: src/lib/tray.py:187 msgid "Check for updates" msgstr "Vérifier les mises à jour" -#: src/lib/tray.py:184 +#: src/lib/tray.py:188 msgid "Exit" msgstr "Quitter" +#: src/lib/tray.py:191 +msgid "Checking for updates..." +msgstr "Vérification des mises à jour..." + #: src/lib/tray.sh:20 #, sh-format msgid "Arch-Update tray desktop file not found" diff --git a/src/arch-update.sh b/src/arch-update.sh index 0b8aa20..bdb9bb3 100755 --- a/src/arch-update.sh +++ b/src/arch-update.sh @@ -7,7 +7,7 @@ # General variables name="arch-update" _name="Arch-Update" -version="3.2.3" +version="3.3.0" option="${1}" # Define the directory containing libraries diff --git a/src/lib/tray.py b/src/lib/tray.py index 215187a..7f41d59 100755 --- a/src/lib/tray.py +++ b/src/lib/tray.py @@ -90,9 +90,9 @@ class ArchUpdateQt6: """ System Tray using QT6 library """ def file_changed(self): - """ Update icon and tooltip on state file content changes """ + """ Update icon, tooltip and dropdown menu on state file content changes """ self.update_icon() - self.update_tooltip() + self.update_tooltip_and_dropdown_menu() def update_icon(self): """ Update the tray icon based on the icon state file content """ @@ -110,7 +110,7 @@ def update_icon(self): icon = QIcon.fromTheme(contents) self.tray.setIcon(icon) - def update_tooltip(self): + def update_tooltip_and_dropdown_menu(self): """ Update the tooltip with the number / list of pending updates """ if self.watcher and not self.updatesfile in self.watcher.files(): self.watcher.addPath(self.updatesfile) @@ -120,33 +120,38 @@ def update_tooltip(self): updates_list = f.readlines() except FileNotFoundError: log.error("State updates file missing") - tooltip = _("Arch-Update: 'updates' state file isn't found") + tooltip = _("'updates' state file isn't found") self.tray.setToolTip(tooltip) + self.dropdown_menu.setTitle(_("'updates' state file isn't found")) + self.dropdown_menu.setEnabled(False) return # Remove empty lines - updates_list = [ - update.strip() - for update in updates_list - if update.strip() - ] + updates_list = [update.strip() for update in updates_list if update.strip()] updates_count = len(updates_list) if updates_count == 0: - tooltip = _("Arch-Update: System is up to date") + tooltip = _("System is up to date") + self.dropdown_menu.setTitle(_("System is up to date")) + self.dropdown_menu.setEnabled(False) elif updates_count == 1: update_list = "".join(updates_list) - tooltip = _("Arch-Update: 1 update available\n\n{update_list}").format( - update_list=update_list - ) + tooltip = _("1 update available\n\n{update_list}").format(update_list=update_list) + self.dropdown_menu.setTitle(_("1 update available")) + self.dropdown_menu.setEnabled(True) else: update_list = "\n".join(updates_list) - tooltip = _("Arch-Update: {updates} updates available\n\n{update_list}").format( - updates=updates_count, update_list=update_list - ) + tooltip = _("{updates} updates available\n\n{update_list}").format(updates=updates_count, update_list=update_list) + self.dropdown_menu.setTitle(_("{updates} updates available").format(updates=updates_count)) + self.dropdown_menu.setEnabled(True) + # Update tooltip and dropdown menu accordingly self.tray.setToolTip(tooltip) + self.dropdown_menu.clear() + if updates_list: + for update in updates_list: + self.dropdown_menu.addAction(update) def run(self): """ Start arch-update """ @@ -173,7 +178,6 @@ def __init__(self, iconfile): # Icon self.tray = QSystemTrayIcon() - self.file_changed() self.tray.setVisible(True) self.tray.activated.connect(self.run) @@ -182,6 +186,13 @@ def __init__(self, iconfile): menu_launch = QAction(_("Run Arch-Update")) menu_check = QAction(_("Check for updates")) menu_exit = QAction(_("Exit")) + + # Dynamic dropdown menu to show the update list + self.dropdown_menu = QMenu(_("Checking for updates...")) + + # Add actions to the menu + menu.addMenu(self.dropdown_menu) + menu.addSeparator() menu.addAction(menu_launch) menu.addAction(menu_check) menu.addAction(menu_exit) @@ -196,8 +207,10 @@ def __init__(self, iconfile): self.watcher = QFileSystemWatcher([self.iconfile, self.updatesfile]) self.watcher.fileChanged.connect(self.file_changed) - app.exec() + # Initial file check to set the right icon, tooltip and dropdown menu text + self.file_changed() + app.exec() if __name__ == "__main__": ArchUpdateQt6(ICON_FILE)