#!/bin/bash

#launcher script to process possible command line arguement stored in .conf file
#not actually needed by xfce-superkey

configfile="$HOME/.config/xfce-superkey/xfce-superkey.conf"
configfolder="$HOME/.config/xfce-superkey/"

arguement=""
#check for existence of conf file
if [ -e "$configfile" ]; then
	arguement="$(grep -m1 -v -e '^#' -e '^$' $configfile)"
	echo "arguement is: " "$arguement"
else
	mkdir -p "$configfolder"
	cp /usr/share/xfce-superkey/xfce-superkey.conf "$configfile"
fi

#launch xfce-superkey	
if [ -n "$arguement" ]; then
	xfce-superkey -e "$arguement" &
else
	xfce-superkey &
fi

	
