#!/bin/bash

SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P )"

#boot compton if it exists
if [ -x "$(command -v compton)" ]; then
  compton &> /dev/null & 
fi

echo "LoadTheme $SCRIPTPATH/theme.toml" > $XDG_RUNTIME_DIR/leftwm/commands.pipe

#set background
if [ -x "$(command -v feh)" ]; then
  feh --bg-scale $SCRIPTPATH/background.jpg
fi

#boot lemonbar and pipe the status of left into it
if [ -x "$(command -v lemonbar)" ]; then
  pkill xmobar
  ruby $SCRIPTPATH/parse.rb | xmobar $SCRIPTPATH/left &
fi

