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_feature)
@$(call add,CONTROL,xdg-user-dirs:enabled)
@$(call add,THE_PACKAGES,xdg-user-dirs) @$(call add,THE_PACKAGES,xdg-user-dirs)
@$(call xport,XDG_USER_DIRS) @$(call xport,XDG_USER_DIRS)
......
#!/bin/sh #!/bin/sh
# turn on xdg-user-dirs.and tweak its defaults if told so # tweak xdg-user-dirs defaults if told so
# (using tuples like "PHOTOS:Documents/Pictures") # using tuples like "PHOTOS:Documents/Pictures"
. shell-config . shell-config
CONFIG="/etc/xdg/user-dirs.defaults" CONFIG="/etc/xdg/user-dirs.defaults"
if control xdg-user-dirs enabled; then [ -z "$GLOBAL_XDG_USER_DIRS" ] ||
if [ -n "$GLOBAL_XDG_USER_DIRS" ]; then echo "$GLOBAL_XDG_USER_DIRS" \
echo "$GLOBAL_XDG_USER_DIRS" \ | tr ' ' '\n' \
| tr ' ' '\n' \
| while IFS=':' read k v; do | while IFS=':' read k v; do
[ -n "$k" -a -n "$v" ] || continue [ -n "$k" -a -n "$v" ] || continue
shell_config_set "$CONFIG" "$k" "$v" shell_config_set "$CONFIG" "$k" "$v"
done 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