Dash:
[t2-trunk.git] / misc / tail / install_desktop.in
blobfa38f80ebe7d72625fc320ff84dce9e9349deb6e
1 #!/bin/sh
2 # --- T2-COPYRIGHT-NOTE-BEGIN ---
3 # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
4 #
5 # T2 SDE: misc/tail/install_desktop.in
6 # Copyright (C) 2004 - 2005 The T2 SDE Project
7 #
8 # More information can be found in the files COPYING and README.
9 #
10 # This program is free software; you can redistribute it and/or modify
11 # it under the terms of the GNU General Public License as published by
12 # the Free Software Foundation; version 2 of the License. A copy of the
13 # GNU General Public License can be found in the file COPYING.
14 # --- T2-COPYRIGHT-NOTE-END ---
16 # Register a window-manager
18 register_wm() {
19 local regdir=usr/share/rock-registry
20 [ -e $root/$regdir/wm ] || mkdir -p $root/$regdir/wm
22 cat <<-EOT > "$root/$regdir/wm/$1"
23 name="$2"
24 exec="$3"
25 EOT
28 # Register an application
30 register_application() {
31 local regdir=usr/share/rock-registry
32 [ -e $root/$regdir/app ] || mkdir -p $root/$regdir/app
34 cat <<-EOT > "$root/$regdir/app/$1"
35 name="$2"
36 exec="$3"
37 EOT
40 # Register a xdm - display manager
42 register_xdm() {
43 local regdir=usr/share/rock-registry
44 [ -e $root/$regdir/xdm ] || mkdir -p $root/$regdir/xdm
46 cat <<-EOT > "$root/$regdir/xdm/$1"
47 name="$2"
48 exec="$3"
49 EOT
52 install_desktop() {
53 local file="$1" regdir=usr/share/rock-registry
54 [ -e $root/$regdir/app ] || mkdir -p $root/$regdir/app
56 echo "Installing ${file##*/} ..."
57 sde_substitute $file > $root/$regdir/${file##*/}
60 for y in $( ls -1 $confdir/*.desktop 2> /dev/null ); do
61 hook_add postinstall 6 "install_desktop '$y'"
62 done