You are not logged in.

#1 2015-08-04 11:10:58

jo-shva
Member
From: Sherman, TX USA
Registered: 2010-10-18
Posts: 133

creating a deb package and trying to run gsettings without luck

I know that a deb file probably doesn't belong in the forums, but you guys are the best, and in the know.(plus I've had it posted on Debian forums for a week without a response).

I'm making a deb package and trying to get it to run gsettings command after install to make the package default.  I have had no luck so far(3 days trying and googling).
This is the make file:

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/
	./gsettings.sh

Then I have the gsettings bit in its own bash file:

#!/bin/sh
	DISPLAY=:0 gsettings set org.gnome.desktop.interface gtk-theme "Empathy" &
	DISPLAY=:0 gsettings set org.gnome.shell.extensions.user-theme name "Empathy"

I can't figure out what I'm doing wrong, the package builds without errors It just wont run gsettings.
I am not a programmer, I do css and html and design themes for linux.  This has me stumped!

Please, help is greatly appreciated.

Last edited by jo-shva (2015-08-04 11:16:34)


"Democracy is being allowed to vote for the candidate you dislike least." -- Robert Byrne
http://killhellokitty.deviantart.com/

Offline

#2 2015-08-04 11:31:23

jsoy9pQbYVNu5nfU
Member
Registered: 2013-04-19
Posts: 108

Re: creating a deb package and trying to run gsettings without luck

Use a postinst script for the gsettings invocation, and a simple install file to install the files. See dh_install(1) for more information.

Not knowing GNOME stuff at all, I am however not sure if invoking gsettings as root during installation has the desired effect, i.e. setting your user's themes. I do not think so but I guess you know what you are doing.

Offline

#3 2015-08-04 11:54:35

jo-shva
Member
From: Sherman, TX USA
Registered: 2010-10-18
Posts: 133

Re: creating a deb package and trying to run gsettings without luck

The Debian postinst file looks like this:

#!/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 have know idea as to where I would add the gsettings part.
And I dont really know what I am doing, I am just taking pieces from everywhere I could find them and putting them together as best as I can.
Dh_install is interesting, but I''m not sure if it exists for packages built for Debian.  I will check on it.

Last edited by jo-shva (2015-08-04 12:02:19)


"Democracy is being allowed to vote for the candidate you dislike least." -- Robert Byrne
http://killhellokitty.deviantart.com/

Offline

#4 2015-08-04 12:06:26

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,525
Website

Re: creating a deb package and trying to run gsettings without luck

jo-shva wrote:

I know that a deb file probably doesn't belong in the forums.

If you know it's wrong, why would you do it?

Closed.  Binned.

EDIT: based on an appeal by the OP I've reopened this.  The purpose seems to be to build deb packages in archlinux, and that certainly can be supported here [1].  That - however - wasn't clear in the initial post.  Jo-shva, the quoted statement implies you didn't even think it belongs here.  But if this is building within arch, then it certainly can fit here. (I don't recall the initial subforum it was in, but to move it out of the bin programming/scripting seems reasonable.)

[1] If nothing else, my own previous thread can be a precident

Last edited by Trilby (2015-08-04 13:49:24)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#5 2015-08-04 16:42:00

jsoy9pQbYVNu5nfU
Member
Registered: 2013-04-19
Posts: 108

Re: creating a deb package and trying to run gsettings without luck

jo-shva wrote:

The Debian postinst file looks like this:

#!/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 have know idea as to where I would add the gsettings part.
And I dont really know what I am doing, I am just taking pieces from everywhere I could find them and putting them together as best as I can.
Dh_install is interesting, but I''m not sure if it exists for packages built for Debian.  I will check on it.

dh_* tools are part of the debhelper package. They are standard tools. I maintain a number of Debian packages and would advise against wanting to build them under an Arch Linux system due to the complexity of the build system and the possibility of a script failing due to Debian<>Arch differences. Just set up a Debian chroot using debootstrap  and and proceed using it with systemd-nspawn. Works wonderfully. Examples are in the systemd-nspawn manual.

The postinst script is called by dpkg with an argument $1 depending on which you do different things. In your case a script such as this should suffice:

#!/bin/bash
set -e
case "$1" in
  configure) # INSERT_YOUR_GSETTINGS_COMMANDS_HERE ;;
  *) true ;; # in all other cases, do nothing
esac
#DEBHELPER#
exit 0

Offline

#6 2015-08-04 16:55:36

jo-shva
Member
From: Sherman, TX USA
Registered: 2010-10-18
Posts: 133

Re: creating a deb package and trying to run gsettings without luck

Thank you for getting back to me.  I had no idea how to deal with the postinst file. I will also check out your other suggestions for building the package in a chroot with systemd-nspawn.
I hope this accomplishes my goal.  Thank You again!

Last edited by jo-shva (2015-08-04 16:56:15)


"Democracy is being allowed to vote for the candidate you dislike least." -- Robert Byrne
http://killhellokitty.deviantart.com/

Offline

#7 2015-08-04 20:41:42

jo-shva
Member
From: Sherman, TX USA
Registered: 2010-10-18
Posts: 133

Re: creating a deb package and trying to run gsettings without luck

adding it to the postinst doesn't work it still doesn't load the gsettings when the package is installed.  Its possible I have made an error, but I'm not sure.  Making debs is very difficult.
Do you have any other ideas?


"Democracy is being allowed to vote for the candidate you dislike least." -- Robert Byrne
http://killhellokitty.deviantart.com/

Offline

Board footer

Powered by FluxBB