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 Not publicly viewable

  1. Comment awaiting approval

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

    17 Dec 2015, 06:26


Add a comment

You are not allowed to comment on this entry as it has restricted commenting permissions.

Search this blog

Tags

Not signed in
Sign in

Powered by BlogBuilder
© MMXXIV