#!/bin/bash
#  Copyright 2007, Marek Mahut <mmahut@fedoraproject.org>
#	http://fedorahosted.org/astronomy/
# 
#  This program is free software; you can redistribute it and/or modify
#  it under the terms of the GNU General Public License as published by
#  the Free Software Foundation; version 2 of the License.
#
#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.

touch ~/.redmode.bkp

if [ "`gconftool-2 --get /desktop/gnome/interface/gtk_color_scheme`" != "`cat /etc/redmode.conf`" ]; then
	zenity --title "Enable Red Mode" --question --text "Are you sure you want to activate night red mode?"
	if [ "$?" == "0" ]; then
		gconftool-2 --get /desktop/gnome/interface/gtk_color_scheme > ~/.redmode.bkp
		gconftool-2 --type string --set /desktop/gnome/interface/gtk_color_scheme "`cat /etc/redmode.conf`"
	else
		exit 0
	fi
else
	zenity --title "Disable Red Mode" --question --text "Are you sure you want to quit night red mode and return to the previous mode?"
	if [ "$?" == "0" ]; then
		gconftool-2 --type string --set /desktop/gnome/interface/gtk_color_scheme "`cat ~/.redmode.bkp`"
		rm -f ~/.redmode.bkp
	fi
fi
	
