#!/bin/bash

case $1 in

	--set-sawfish )

		echo "( bind-keys global-keymap \"A-F2\" '(system gnome-run-dialog)')" >> $HOME/.sawfishrc
	
	;;

	--unset-sawfish )
	
		sed -e '/system gnome-run-dialog/d' -i $HOME/.sawfishrc

	;;

	--set-metacity )
	
		gconftool-2 --set --type string \
			/apps/metacity/global_keybindings/panel_run_dialog \
				"<Ctrl><Alt>F2"
		
		gconftool-2 --set --type string \
			/apps/metacity/global_keybindings/run_command_12 \
				"<Alt>F2"
		
		gconftool-2 --set --type string \
			/apps/metacity/keybinding_commands/command_12 \
				"gnome-run-dialog"
	
	;;
	
	--unset-metacity )
	
		gconftool-2 --set --type string \
			/apps/metacity/global_keybindings/panel_run_dialog \
				"<Alt>F2"
		
		gconftool-2 --set --type string \
			/apps/metacity/global_keybindings/run_command_12 \
				""
		
		gconftool-2 --set --type string \
			/apps/metacity/keybinding_commands/command_12 \
				""
	
	;;

	--version )
	
		echo -e "\nThis is GNOME-Run-Dialog 1.7.0 \`Reflect Yourself'\n"

	;;


	--prefix )
	
		echo -e "\nPrefix: /usr\n"

	;;

	--help )
	
		echo -e "\nUsage:\n"
		echo -e "gnome-run-dialog | --version [Display Version]\
		\ngnome-run-dialog | --prefix [Display Prefix]\n"

	;;

	*)
	
		cd /usr/share/gnome-run-dialog/
		python ./gnome-run-dialog

	;;

esac
