#!/bin/sh

set -e

#DEBHELPER#

## the following is the exact code in moblin-ux-settings.spec
## but it would be nice to use dh_gconf in future as it would handle prerm.

# Theme
gconftool-2 --config-source=xml::/etc/gconf/gconf.xml.defaults \
            --direct --type string -s \
            /apps/metacity/general/theme "Moblin-Netbook"

gconftool-2 --config-source=xml::/etc/gconf/gconf.xml.defaults \
            --direct --type string -s \
            /apps/metacity/general/button_layout ":close"

gconftool-2 --config-source=xml::/etc/gconf/gconf.xml.defaults \
            --direct --type string -s \
            /desktop/gnome/interface/gtk_theme "Moblin-Netbook"

gconftool-2 --config-source=xml::/etc/gconf/gconf.xml.defaults \
            --direct --type string -s \
            /desktop/gnome/interface/icon_theme "moblin"

gconftool-2 --config-source=xml::/etc/gconf/gconf.xml.defaults \
            --direct --type string -s \
            /desktop/gnome/peripherals/mouse/cursor_theme "moblin"

gconftool-2 --config-source=xml::/etc/gconf/gconf.xml.defaults \
            --direct --type string -s \
            /desktop/gnome/interface/toolbar_style "icons"

gconftool-2 --config-source=xml::/etc/gconf/gconf.xml.defaults \
            --direct --type bool -s \
            /desktop/gnome/interface/menus_have_icons false

gconftool-2 --config-source=xml::/etc/gconf/gconf.xml.defaults \
            --direct --type bool -s \
            /desktop/gnome/interface/buttons_have_icons false

gconftool-2 --config-source=xml::/etc/gconf/gconf.xml.defaults \
            --direct --type string -s \
            /desktop/gnome/sound/theme_name moblin

# Screen shot
gconftool-2 --config-source=xml::/etc/gconf/gconf.xml.defaults \
            --direct --type string -s \
            /apps/metacity/global_keybindings/run_command_screenshot \
            "Print"
gconftool-2 --config-source=xml::/etc/gconf/gconf.xml.defaults \
            --direct --type string -s \
            /apps/metacity/keybinding_commands/command_screenshot \
            "gnome-screenshot"

gconftool-2 --config-source=xml::/etc/gconf/gconf.xml.defaults \
            --direct --type string -s \
            /apps/metacity/global_keybindings/run_command_window_screenshot \
            "<Alt>Print"
gconftool-2 --config-source=xml::/etc/gconf/gconf.xml.defaults \
            --direct --type string -s \
            /apps/metacity/keybinding_commands/command_window_screenshot \
            "gnome-screenshot --window"

# Window Actions
gconftool-2 --config-source=xml::/etc/gconf/gconf.xml.defaults \
            --direct --type string -s \
            /apps/metacity/general/action_double_click_titlebar "none"
gconftool-2 --config-source=xml::/etc/gconf/gconf.xml.defaults \
            --direct --type string -s \
            /apps/metacity/general/action_middle_click_titlebar "none"
gconftool-2 --config-source=xml::/etc/gconf/gconf.xml.defaults \
            --direct --type string -s \
            /apps/metacity/general/action_right_click_titlebar "none"


# UX Shell
gconftool-2 --config-source=xml::/etc/gconf/gconf.xml.defaults \
            --direct --type bool -s \
            /apps/mutter/general/clutter_disabled false

gconftool-2 --config-source=xml::/etc/gconf/gconf.xml.defaults \
            --direct --type list --list-type string -s \
            /apps/mutter/general/clutter_plugins '[moblin-netbook]'

gconftool-2 --config-source=xml::/etc/gconf/gconf.xml.defaults \
            --direct --type string -s \
            /desktop/gnome/url-handlers/http/command 'moblin-web-browser %s'

gconftool-2 --config-source=xml::/etc/gconf/gconf.xml.defaults \
            --direct --type string -s \
            /desktop/gnome/url-handlers/https/command 'moblin-web-browser %s'

gconftool-2 --config-source=xml::/etc/gconf/gconf.xml.defaults \
            --direct --type string -s \
            /desktop/gnome/background/picture_filename \
            '/usr/share/backgrounds/StarryLight.png'

# Fonts
gconftool-2 --config-source=xml::/etc/gconf/gconf.xml.defaults \
            --direct --type string -s \
            /desktop/gnome/interface/document_font_name \
            'Liberation Sans 10'

gconftool-2 --config-source=xml::/etc/gconf/gconf.xml.defaults \
            --direct --type string -s \
            /desktop/gnome/interface/font_name \
            'Liberation Sans 10'

gconftool-2 --config-source=xml::/etc/gconf/gconf.xml.defaults \
            --direct --type string -s \
            /desktop/gnome/interface/monospace_font_name \
            'Liberation Mono 10'

# Nautilus
gconftool-2 --config-source=xml::/etc/gconf/gconf.xml.defaults \
            --direct --type bool -s \
            /apps/nautilus/preferences/always_use_browser true

gconftool-2 --config-source=xml::/etc/gconf/gconf.xml.defaults \
            --direct --type bool -s \
            /apps/nautilus/preferences/exit_with_last_window false

# Do not automount, this is done by g-s-d plugin
gconftool-2 --config-source=xml::/etc/gconf/gconf.xml.defaults \
            --direct --type bool -s \
            /apps/nautilus/preferences/media_automount false

# And should not open new window whenever media mounted
gconftool-2 --config-source=xml::/etc/gconf/gconf.xml.defaults \
            --direct --type bool -s \
            /apps/nautilus/preferences/media_automount_open false


gconftool-2 --config-source=xml::/etc/gconf/gconf.xml.defaults \
            --direct --type bool -s \
            /apps/nautilus/icon_view/labels_beside_icons false

gconftool-2 --config-source=xml::/etc/gconf/gconf.xml.defaults \
            --direct --type string -s \
            /apps/nautilus/icon_view/default_zoom_level standard

gconftool-2 --config-source=xml::/etc/gconf/gconf.xml.defaults \
            --direct --type string -s \
            /apps/gnome_settings_daemon/keybindings/power ""

# General
gconftool-2 --config-source=xml::/etc/gconf/gconf.xml.defaults \
            --direct --type float -s \
            /desktop/gnome/peripherals/mouse/mouse_acceleration 0.8

gconftool-2 --config-source=xml::/etc/gconf/gconf.xml.defaults \
            --direct --type int -s \
            /desktop/gnome/peripherals/mouse/mouse_threshold 2
