Commit d79061fb authored by Michael Shigorin's avatar Michael Shigorin

xdg-user-dirs: employ control feature

Maybe the conditionals shouldn't be too terse, by the way...
parent f123fea6
use/xdg-user-dirs:
use/xdg-user-dirs: use/control
@$(call add_feature)
@$(call add,CONTROL,xdg-user-dirs:enabled)
@$(call add,THE_PACKAGES,xdg-user-dirs)
@$(call xport,XDG_USER_DIRS)
......
#!/bin/sh
# turn on xdg-user-dirs.and tweak its defaults if told so
# (using tuples like "PHOTOS:Documents/Pictures")
# tweak xdg-user-dirs defaults if told so
# using tuples like "PHOTOS:Documents/Pictures"
. shell-config
CONFIG="/etc/xdg/user-dirs.defaults"
if control xdg-user-dirs enabled; then
if [ -n "$GLOBAL_XDG_USER_DIRS" ]; then
echo "$GLOBAL_XDG_USER_DIRS" \
| tr ' ' '\n' \
[ -z "$GLOBAL_XDG_USER_DIRS" ] ||
echo "$GLOBAL_XDG_USER_DIRS" \
| tr ' ' '\n' \
| while IFS=':' read k v; do
[ -n "$k" -a -n "$v" ] || continue
shell_config_set "$CONFIG" "$k" "$v"
done
fi
fi
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment