Page 1 of 1

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

PostPosted: July 31st, 2015, 5:28 pm
by jo-shva
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 name "Empathy"
   gsettings set org.gnome.desktop.interface gtk-theme "Empathy"

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

set -e

case "$1" in


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

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


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

   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 /usr/share/glib-2.0/schemas/
   DISPLAY=:0 gsettings set org.gnome.desktop.interface gtk-theme "Empathy"
   DISPLAY=:0 gsettings set name "Empathy"

Help is greatly appreciated.