#!/usr/bin/env bash

set -e

source $HOME/Scripts/gpre

setxkbmap -layout us -variant altgr-intl

xmodmap .Xmodmap
#xcape -e "Control_R=Escape"

dunst &

# Set dbus display variable
dbus-update-activation-environment --systemd DISPLAY

args="$LOPTS"
for arg in $args
do
    echo $arg
    case $arg in
        panel)
            echo starting panel
            xfce4-panel &
            ;;
        composer)
            echo starting comp
            xcompmgr &
            ;;
        gnome-keyring)
            dbus-update-activation-environment --systemd DISPLAY &
            eval $(/usr/bin/gnome-keyring-daemon --start --components=pkcs11,secrets) &
            ;;
        screensaver)
            xss-lock -- $HOME/Scripts/lock.sh &
            ;;
        autorandr)
            autorandr -c
            ;;
        autorun)
            ~/.xautorun
            ;;
    esac
done


# Please do not block