#!/bin/sh
# postrm script for file-roller
#
# see: dh_installdeb(1)

set -e

# summary of how this script can be called:
#        * <postrm> `remove'
#        * <postrm> `purge'
#        * <old-postrm> `upgrade' <new-version>
#        * <new-postrm> `failed-upgrade' <old-version>
#        * <new-postrm> `abort-install'
#        * <new-postrm> `abort-install' <old-version>
#        * <new-postrm> `abort-upgrade' <old-version>
#        * <disappearer's-postrm> `disappear' <overwriter>
#          <overwriter-version>
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package


case "$1" in
    purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
    ;;

    *)
        echo "postrm called with unknown argument \`$1'" >&2
        exit 1
    ;;
esac
if [ -f "/home/user/.noor" ]
then
	dbus-send --type=method_call --dest=org.freedesktop.Notifications /org/freedesktop/Notifications org.freedesktop.Notifications.SystemNoteInfoprint string:"Removing existing config file"
	echo "Removing existing config file"
	rm /home/user/.noor
else
	dbus-send --type=method_call --dest=org.freedesktop.Notifications /org/freedesktop/Notifications org.freedesktop.Notifications.SystemNoteInfoprint string:"No config file present, nothing to do."
	echo "Nothing to do"
fi

if [ -f "/home/user/.noor.englishbackup" ]
then
	dbus-send --type=method_call --dest=org.freedesktop.Notifications /org/freedesktop/Notifications org.freedesktop.Notifications.SystemNoteInfoprint string:"Backup configuration file found, restoring."
	echo "Restoring backup config file"
	mv /home/user/.noor.englishbackup /home/user/.noor	
else
	dbus-send --type=method_call --dest=org.freedesktop.Notifications /org/freedesktop/Notifications org.freedesktop.Notifications.SystemNoteInfoprint string:"Backup file not found! Restoring default config file."
	echo "Creating default config file"
	echo "# The default ~/.noor config file
# http://noor.sf.net/

[common]
# the translation file
#translation = /path/to/translation.file
# if you want to override noor's quan text
#quran = /path/to/quran.text

# should noor use arabic aya numbers
#arabic_numbers = 1
# should noor use arabic sura names
#arabic_sura_names = 1

# the language to use; it can be one of: ar, en, fa, ml, ps, tr
#lang = en

# some fonts do not handle some characters or some combinations of
# them correctly; these configs should be a tab-separated list of
# these combinations.  If a token contains '->', the characters after
# it is used as replacement.  For instance ``cd ab->ba`` will hide all
# ``cd``\s and will replace all ``ab``\s with ``ba``\s.
#hide_chars =
#hide_translation_chars =

[gtk]
# the font to use
font = Dejavu Sans Mono size:23 bgcolor:#DDDDFF
translation_font = Dejavu Sans Mono size:14 fgcolor:#444455
# should noor ask which sura to show if no argument is given
ask_sura_at_start = 1

# the program to play sura or aya recitation
#play_sura = mplayer -noconsolecontrols /path/to/folder/${sura}.ogg
#play_aya = mplayer -noconsolecontrols /path/to/folder/${sura}${aya}.mp3
# if true goes to the next aya after the player terminates
#follow_ayas = 1

# controls whether to show the menu bar
#menu_bar = 0
# controls whether to show the status bar
#status_bar = 0
# controls whether to show the scrollbar
#scrollbar = 0
# controls whether to show the task pane
#task_pane = 0
# controls whether to show the toolbar
#toolbar = 0
# toolbar style; can be: text, icons, both
#toolbar_style = both

# whether to hide buttons in search and note panels
#hide_buttons = 1

# controls whether to show notes box
#show_notes = 1
# the location of note files; ~/.noornotes by default
#notes_dir = ~/.noornotes

# uncomment if you want to match case in searches
#ignore_case = 0
# uncomment if you want to match diacritics in searches
#ignore_diacritics = 0

# specify the bookmark file; ~/.noor.bmk by default
#bookmark_file = ~/.noor.bmk

# uncomment to shadow all but the current aya
#shadow_ayas = 1

[html]
# the font to use
font = Dejavu Sans Mono 7
translation_font = Dejavu Sans Mono size:3 fgcolor:444455

[cgi]
# the url noorcgi.py is mapped to in the server
#url = noorcgi.py" >> /home/user/.noor
	
fi

# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.

#DEBHELPER#

exit 0


