Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add dark and blue variants to the systray icon set and add the "TrayIconStyle" option in arch-update.conf #242

Merged
merged 5 commits into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README-fr.md
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ Les options prises en charge sont :
- PrivilegeElevationCommand=[Cmd] # Commande à utiliser pour l'élévation de privilège. Les options valides sont `sudo`, `doas` ou `run0`. Si cette option n'est pas spécifiée, Arch-Update utilisera la première commande disponible dans l'odre suivant : `sudo`, `doas` puis `run0`.
- DiffProg=[Editeur] # Editeur à utiliser pour visualiser/editer les différences durant le traitement des fichiers pacnew. La valeur par défaut est la valeur de la variable d'environnement `$DIFFPROG` (ou `vimdiff` si `$DIFFPROG` n'est pas paramétrée). Notez qu'en raison de l'absence d'option pour préserver les variables d'environnement dans `doas`, cette option sera ignorée lors de l'utilisation de `doas` comme méthode d'élévation de privilèges.
- AURHelper=[AUR Helper] # AUR helper à utiliser pour la prise en charge des paquets AUR. Les options valides sont `paru` ou `yay`. Si cette option n'est pas spécifiée, Arch-Update utilisera le premier AUR helper disponible dans l'ordre suivant : `paru` puis `yay` (si aucun des deux n'est installé, Arch-Update ne prendra pas en compte les paquets AUR).
- TrayIconStyle=[Style/Color] # Style à utiliser pour l'icône de l'applet systray. Les options valides sont les variantes de style/couleur disponibles pour le set d'icône, listées ici : https://github.com/Antiz96/arch-update/tree/main/src/icons. La valeur par défaut est "light".

Les options sont sensibles à la casse, les majuscules doivent donc être respectées.
```
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ The supported options are:
- PrivilegeElevationCommand=[Cmd] # Command to be used for privilege elevation. Valid options are `sudo`, `doas` or `run0`. If this option is not set, Arch-Update will use the first available command in the following order: `sudo`, `doas` then `run0`.
- DiffProg=[Editor] # Editor to use to visualize/edit differences during the pacnew files processing. Defaults to the `$DIFFPROG` environment variable's value (or `vimdiff` if `$DIFFPROG` isn't set). Note that, due to the lack of option to preserve environment variable in `doas`, this option will be ignored when using `doas` as the privilege elevation method.
- AURHelper=[AUR Helper] # AUR helper to be used for AUR packages support. Valid options are `paru` or `yay`. If this option is not set, Arch-Update will use the first available AUR helper in the following order: `paru` then `yay` (in case none of them is installed, Arch-Update will not take AUR packages into account).
- TrayIconStyle=[Style/Color] # Style to be used for the systray applet icon. Valid options are the available style/color variants for the icon set, listed in https://github.com/Antiz96/arch-update/tree/main/src/icons. Defaults to "light".

Options are case sensitive, so capital letters have to be respected.
```
Expand Down
4 changes: 4 additions & 0 deletions doc/man/arch-update.conf.5
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ Command to be used for privilege elevation. Valid options are sudo, doas or run0
.B AURHelper=[AUR Helper]
AUR helper to be used for AUR packages support. Valid options are paru or yay. If this option is not set, Arch-Update will use the first installed AUR helper in the following order: paru then yay (in case none of them is installed, Arch-Update will not take AUR packages into account).

.TP
.B TrayIconStyle=[Style/Color]
Style to be used for the systray applet icon. Valid options are the available style/color variants for the icon set, listed in https://github.com/Antiz96/arch-update/tree/main/src/icons. Defaults to "light".

.SH SEE ALSO
.BR arch-update (1)

Expand Down
4 changes: 4 additions & 0 deletions doc/man/fr/arch-update.conf.5
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ Commande à utiliser pour l'élévation de privilège. Les options valides sont
.B AURHelper=[AUR Helper]
AUR helper à utiliser pour la prise en charge des paquets AUR. Les options valides sont paru ou yay. Si cette option n'est pas spécifiée, Arch-Update utilisera le premier AUR helper disponible dans l'ordre suivant : paru puis yay (si aucun des deux n'est installé, Arch-Update ne prendra pas en compte les paquets AUR).

.TP
.B TrayIconStyle=[Style/Color]
Style à utiliser pour l'icône de l'applet systray. Les options valides sont les variantes de style/couleur disponibles pour le set d'icône, listées ici : https://github.com/Antiz96/arch-update/tree/main/src/icons. La valeur par défaut est "light".

.SH VOIR AUSSI
.BR arch-update (1)

Expand Down
1 change: 1 addition & 0 deletions res/config/arch-update.conf.example
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@
#PrivilegeElevationCommand=sudo
#DiffProg=$DIFFPROG
#AURHelper=paru
#TrayIconStyle=light
21 changes: 21 additions & 0 deletions src/icons/arch-update-blue.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions src/icons/arch-update-dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
25 changes: 25 additions & 0 deletions src/icons/arch-update_updates-available-blue.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 25 additions & 0 deletions src/icons/arch-update_updates-available-dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 7 additions & 2 deletions src/lib/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -123,14 +123,19 @@ if [ -n "${diff_prog}" ]; then
fi
fi

# Definition of the tray icon style to use (default to "light" if it isn't set in the arch-update.conf configuration file)
if [ -z "${tray_icon_style}" ]; then
tray_icon_style="light"
fi

# Definition of the icon_up-to-date function: Change icon to "up to date"
icon_up-to-date() {
# shellcheck disable=SC2154
echo "${name}" > "${statedir}/tray_icon"
echo "${name}-${tray_icon_style}" > "${statedir}/tray_icon"
}

# Definition of the icon_updates-available function: Change tray icon to "updates available"
icon_updates-available() {
# shellcheck disable=SC2154
echo "${name}_updates-available" > "${statedir}/tray_icon"
echo "${name}_updates-available-${tray_icon_style}" > "${statedir}/tray_icon"
}
5 changes: 5 additions & 0 deletions src/lib/config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -96,3 +96,8 @@ if grep -Eq '^[[:space:]]*AURHelper[[:space:]]*=[[:space:]]*(paru|yay)[[:space:]
# shellcheck disable=SC2034
aur_helper=$(grep -E '^[[:space:]]*AURHelper[[:space:]]*=[[:space:]]*(paru|yay)[[:space:]]*$' "${config_file}" 2> /dev/null | awk -F '=' '{print $2}' | tr -d '[:space:]')
fi

if grep -Eq '^[[:space:]]*TrayIconStyle[[:space:]]*=[[:space:]]*(light|dark|blue)[[:space:]]*$' "${config_file}" 2> /dev/null; then
# shellcheck disable=SC2034
tray_icon_style=$(grep -E '^[[:space:]]*TrayIconStyle[[:space:]]*=[[:space:]]*(light|dark|blue)[[:space:]]*$' "${config_file}" 2> /dev/null | awk -F '=' '{print $2}' | tr -d '[:space:]')
fi