#!/bin/sh

export TEXTDOMAIN=conky_launcher
export OUTPUT_CHARSET=UTF-8

Xdialog --title "$(gettext "Conky Launcher")" \
		--ok-label "$(gettext "(Re)Start")" \
		--cancel-label "$(gettext "Stop")" \
		--yesno "$(gettext "Note:\n \
				'(Re)Start' adds autostart to \$HOME/Startup/\n \
				'Stop' removes it")" 0 0

case $? in
  0)	killall conky
		rm -f $HOME/Startup/conky
		echo -e '#!/bin/sh\nexec conky' > "${HOME}/Startup/conky"
		chmod +x "${HOME}/Startup/conky"
		exec conky
		;;
  1)	killall conky
		rm -f $HOME/Startup/conky
		;;
  *)	exit
		;;
esac
