Skip to content

Commit 6356495

Browse files
s-pappousAntiz96
andauthored
feat(icons): Add colorblind-friendly icons variants (#511)
Add the `ColorblindMode` option in the `arch-update.conf` configuration file to change the systray applet icon update variants to a colorblind-friendly yellow. Closes #510 --------- Co-authored-by: Robin Candau <robincandau@protonmail.com>
1 parent 3ebc4ff commit 6356495

11 files changed

+90
-6
lines changed

doc/man/arch-update.conf.5.scd

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@ Options are case sensitive, so capital letters have to be respected.
6161
*TrayIconStyle=[Style / Color]*
6262
Style to be used for the systray applet icon. Valid values are the available style / color variants for the icon set, listed in https://github.com/Antiz96/arch-update/blob/main/res/icons/README.md. Defaults to "blue".
6363

64+
*ColorblindMode*
65+
Change systray applet icon update variants to a colorblind-friendly yellow.
66+
6467
# SEE ALSO
6568

6669
*arch-update*(1)

doc/man/fr/arch-update.conf.5.scd

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@ Les options sont sensibles à la casse, les majuscules doivent donc être respec
6161
*TrayIconStyle=[Style / Couleur]*
6262
Style à utiliser pour l'icône de l'applet systray. Les valeurs valides sont les variantes de style / couleur disponibles pour le set d'icône, listées ici : https://github.com/Antiz96/arch-update/blob/main/res/icons/README.md. La valeur par défaut est "blue".
6363

64+
*ColorblindMode*
65+
Changer la variante de l'icône de l'applet systray pour utiliser une couleur jaune lorsque des mises à jour sont disponibles, afin d'être plus facilement distinguable pour les daltoniens.
66+
6467
# VOIR AUSSI
6568

6669
*arch-update*(1)

res/config/arch-update.conf.example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@
1515
#KeepUninstalledPackages=0
1616
#DiffProg=$DIFFPROG
1717
#TrayIconStyle=blue
18+
#ColorblindMode

res/icons/README.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Icon Style / Color
22

33
Here is the list of available style / color for the systray icon.
4-
You can select which style / color to use with the `TrayIconStyle` option in the `arch-update.conf` configuration file (see the [arch-update.conf(5) man page](https://github.com/Antiz96/arch-update/blob/main/doc/man/arch-update.conf.5.scd) for more details).
4+
You can select which style / color to use with the `TrayIconStyle` option in the `arch-update.conf` configuration file, as well as toggle colorblind mode with the `ColorblindMode` option (see the [arch-update.conf(5) man page](https://github.com/Antiz96/arch-update/blob/main/doc/man/arch-update.conf.5.scd) for more details).
55

66
## blue (default one)
77

@@ -17,6 +17,12 @@ You can select which style / color to use with the `TrayIconStyle` option in the
1717
<img width="200" height="200" src="arch-update_updates-available-blue.svg">
1818
</p>
1919

20+
- Updates available in colorblind mode:
21+
22+
<p align="center">
23+
<img width="200" height="200" src="arch-update_updates-available-blue-cb.svg">
24+
</p>
25+
2026
## light
2127

2228
- Up to date:
@@ -31,6 +37,12 @@ You can select which style / color to use with the `TrayIconStyle` option in the
3137
<img width="200" height="200" src="arch-update_updates-available-light.svg">
3238
</p>
3339

40+
- Updates available in colorblind mode:
41+
42+
<p align="center">
43+
<img width="200" height="200" src="arch-update_updates-available-light-cb.svg">
44+
</p>
45+
3446
## dark
3547

3648
- Up to date:
@@ -44,3 +56,9 @@ You can select which style / color to use with the `TrayIconStyle` option in the
4456
<p align="center">
4557
<img width="200" height="200" src="arch-update_updates-available-dark.svg">
4658
</p>
59+
60+
- Updates available in colorblind mode:
61+
62+
<p align="center">
63+
<img width="200" height="200" src="arch-update_updates-available-dark-cb.svg">
64+
</p>
Lines changed: 18 additions & 0 deletions
Loading
Lines changed: 18 additions & 0 deletions
Loading
Lines changed: 18 additions & 0 deletions
Loading

src/lib/check.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ if [ -n "${update_available}" ]; then
106106
--setenv=_name="${_name}" \
107107
--setenv=name="${name}" \
108108
--setenv=tray_icon_style="${tray_icon_style}" \
109+
--setenv=colorblind_mode="${colorblind_mode}" \
109110
--setenv=tmpdir="${tmpdir}" \
110111
--setenv=desktop_file="${desktop_file}" \
111112
"${libdir}/notification.sh"

src/lib/common.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ icon_up-to-date() {
202202
# Definition of the icon_updates-available function: Change tray icon to "updates available"
203203
icon_updates-available() {
204204
# shellcheck disable=SC2154
205-
echo "${name}_updates-available-${tray_icon_style}" > "${statedir}/tray_icon"
205+
echo "${name}_updates-available-${tray_icon_style}${colorblind_mode}" > "${statedir}/tray_icon"
206206
}
207207

208208
# Definition of commands to always run on exit (e.g. cleanup of files / dirs which have no purpose being kept)

src/lib/config.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@ if [ -f "${config_file}" ]; then
6161
# Check the "TrayIconStyle" option in arch-update.conf
6262
# shellcheck disable=SC2034
6363
tray_icon_style=$(grep -E '^[[:space:]]*TrayIconStyle[[:space:]]*=[[:space:]]*(blue|light|dark)[[:space:]]*$' "${config_file}" 2> /dev/null | awk -F '=' '{print $2}' | tr -d '[:space:]')
64+
65+
# Check the "ColorblindMode" option in arch-update.conf
66+
# shellcheck disable=SC2034
67+
colorblind_mode=$(grep -Eq '^[[:space:]]*ColorblindMode[[:space:]]*$' "${config_file}" 2> /dev/null && echo "-cb")
6468
fi
6569

6670
# Set the default / fallback value for options that require it (if the arch-update.conf configuration file doesn't exists, if the concerned option is commented or if the set value is invalid)

0 commit comments

Comments
 (0)