July 10, 2009

Add application launcher to GNOME panel script

Google bait since I found myself needing to do this and couldn't find an example anywhere and had to use my brain instead. I hate it when that happens.

#!/bin/bash

# script to add a new application launcher to a GNOME panel

# first define a new object that describes what you want to add
# name of new object.
objectname=object_99
newobjectkey=/apps/panel/objects/${objectname}
# set the type of the object
gconftool-2 --type string --set ${newobjectkey}/object_type "launcher-object"
# set were the .desktop file can be found
gconftool-2 --type string --set ${newobjectkey}/launcher_location "/usr/share/applications/MozillaFirefox.desktop"
# number of pixels from the left side of the screen that you want the launcher
# to appear. if you want to define the position from the right set boolean value
# panel_right_stick to true
gconftool-2 --type int --set ${newobjectkey}/position 500
# which panel the object appears on. look at /apps/panel/toplevels/
# using gconf-editor to get list of valid values for your set up.
gconftool-2 --type string --set ${newobjectkey}/toplevel_id "panel_0"

panelobjectlistkey=/apps/panel/general/object_id_list
# get the list of objects currently on panels
currentlist=$(gconftool-2 --get $panelobjectlistkey)
# add your new object to list.
gconftool-2 --type list --list-type string --set $panelobjectlistkey "${currentlist/\]/,${objectname}]}"



- One comment

  1. Comment awaiting approval

    This comment is awaiting approval by the author of the entry.

    17 Dec 2015, 06:26


Add a comment

Name
Email
Anti-Spam Question
Are you the anonymous annoyance known as Sue, or spammer scum trying to promote some website by leaving a link to it in my comments?
Anti-Spam Answer
Comment


Your IP address will be recorded. -

You can not use HTML, but you can use our special markup -

Search this blog

Tags

Not signed in
Sign in

Powered by BlogBuilder
© MMXIX