Skip to content

Avoid duplicating directories in the tail of $XDG_* envs

Example input: XDG_CONFIG_DIRS="/etc/xdg/rosa-xfce-config:/etc/xdg"

Output before this patch: XDG_CONFIG_DIRS="/etc/xdg/rosa-xfce-config:/etc/xdg:/etc/xdg"

But there is no need to duplicate /etc/xdg in the tail.

Output after this patch: XDG_CONFIG_DIRS="/etc/xdg/rosa-xfce-config:/etc/xdg"

The scripts that sets XDG_CONFIG_DIRS: https://abf.io/soft/rosa-xfce-config/blob/04b69c389d/profile.d/10-rosa-xfce-config-xdg.sh

Tests for that script: https://abf.io/soft/rosa-xfce-config/blob/04b69c389d/profile.d/test_10-rosa-xfce-config-xdg.sh

I do not see why that my script must not append "/etc/xdg", so fixing startxfce4.

This case-esac code is compatible with POSIX shell (https://stackoverflow.com/a/2830416), but tested it only with bash.

Replaces #111 (closed)

Merge request reports

Loading