#!/bin/sh

#export XKB_DEFAULT_RULES=evdev

# Turn bell off
xset b off

# If ogain is present, make sure its turned up
MIXOUT="`mixer -s`"
echo $MIXOUT | grep "ogain " >/dev/null 2>/dev/null
if [ "$?" == "0" ]
then
    mixer ogain 100:100
fi

PATH=$PATH:$HOME/bin:/usr/local/lib/libexec/kf5:/usr/local/share/ulbsd/scripts

USER="`id -u`"
AKONADI_MYSQL='/root/.local/share/akonadi/mysql.conf'
if [ "${USER}" == "0" ] && [ -f ${AKONADI_MYSQL} ]
then
    LINE="`grep --line-number --max-count=1 --only-matching 'user=root' ${AKONADI_MYSQL} | sed -e s/\:.*//`"
    if [ "${LINE}" == "" ]
    then
        sed -i '' '/\[mysqld\]/ a \
user=root
' ${AKONADI_MYSQL}
    fi
fi
