deb postinst file, how do i add gsetting to this file?

Get your foo on.

deb postinst file, how do i add gsetting to this file?

Postby jo-shva » July 31st, 2015, 5:28 pm

I have built a gtk theme deb and I would like to set gsettings to run post install. The theme is for a business and they want it to load the theme as default with the install of Debian. Or at least the instal of the theme .deb.
I have no idea how to correctly add the gsettings lines to the postinst file and make it work.
Code: Select all
gsettings set org.gnome.shell.extensions.user-theme name "Empathy"
   gsettings set org.gnome.desktop.interface gtk-theme "Empathy"

The original postinst file looks like this:
Code: Select all
#!/bin/sh
# postinst script for empathy-theme
#
# see: dh_installdeb(1)

set -e

case "$1" in
    configure)
    ;;

    abort-upgrade|abort-remove|abort-deconfigure)
    ;;

    *)
        echo "postinst called with unknown argument \`$1'" >&2
        exit 1
    ;;
esac

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

#DEBHELPER#

exit 0


I figure this isn't the place for the gsetting string, so I placed it in the makefile, the deb builds with no errors but doesn't commit the gsettings. Where do they need to be placed to be executed with the deb install?

Here's the makefile
Code: Select all
DESTDIR ?= debian/empathy-theme
PREFIX ?= /usr

install:
   mkdir -p "$(DESTDIR)$(PREFIX)"/share/themes/
   cp -R Empathy "$(DESTDIR)$(PREFIX)"/share/themes/
   cp org.gnome.desktop.interface.gschema.xml /usr/share/glib-2.0/schemas/
   cp org.gnome.shell.extensions.user-theme.gschema.xml /usr/share/glib-2.0/schemas/
   DISPLAY=:0 gsettings set org.gnome.desktop.interface gtk-theme "Empathy"
   DISPLAY=:0 gsettings set org.gnome.shell.extensions.user-theme name "Empathy"


Help is greatly appreciated.
jo-shva
 
Posts: 2
Joined: July 31st, 2015, 3:46 pm

Return to Programming

Who is online

Users browsing this forum: No registered users and 2 guests

cron

x