#!/bin/sh

# pkgbuild() installs/overwrites the .dist.new file
# system
CONFIG="etc/compizconfig"
if ! [ -d "$CONFIG" ]; then
	mkdir -p "$CONFIG"
fi
if ! [ -e "$CONFIG/default.ini" ]; then
	cp "$CONFIG/default.ini.dist.new" \
	   "$CONFIG/default.ini"
fi

# user
home="$(awk -F: '$3==U {print $(NF-1); exit}' U=$(id -u) /etc/passwd)"
CONFIG="${home#/}/.config/compiz/compizconfig"
if ! [ -d "$CONFIG" ]; then
	mkdir -p "$CONFIG"
fi
if ! [ -f "$CONFIG/default.ini" ]; then
	cp etc/compizconfig/default.ini "$CONFIG/default.ini"
fi

# compiz-session will again copy /etc/.../default.ini to
# ~/.config/compizconfig/default.ini in case a user skips
# wmswitch and goes straight to compiz. or fusion-icon.

