Moved misc/tail to lib/init
[opensde-nopast.git] / lib / init / install_desktop.in
blob5dd071edb5d62bb342873728b82b6fb998cdb4c9
1 #!/bin/sh
2 # --- SDE-COPYRIGHT-NOTE-BEGIN ---
3 # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
4 #
5 # Filename: lib/init/install_desktop.in
6 # Copyright (C) 2008 The OpenSDE Project
7 # Copyright (C) 2004 - 2006 The T2 SDE Project
8 #
9 # More information can be found in the files COPYING and README.
11 # This program is free software; you can redistribute it and/or modify
12 # it under the terms of the GNU General Public License as published by
13 # the Free Software Foundation; version 2 of the License. A copy of the
14 # GNU General Public License can be found in the file COPYING.
15 # --- SDE-COPYRIGHT-NOTE-END ---
17 # Register a window-manager
19 register_wm() {
20 local regdir=usr/share/rock-registry
21 [ -e $root/$regdir/wm ] || mkdir -p $root/$regdir/wm
23 cat <<-EOT > "$root/$regdir/wm/$1"
24 name="$2"
25 exec="$3"
26 EOT
29 # Register an application
31 register_application() {
32 local regdir=usr/share/rock-registry
33 [ -e $root/$regdir/app ] || mkdir -p $root/$regdir/app
35 cat <<-EOT > "$root/$regdir/app/$1"
36 name="$2"
37 exec="$3"
38 EOT
41 # Register a xdm - display manager
43 register_xdm() {
44 local regdir=usr/share/rock-registry
45 [ -e $root/$regdir/xdm ] || mkdir -p $root/$regdir/xdm
47 cat <<-EOT > "$root/$regdir/xdm/$1"
48 name="$2"
49 exec="$3"
50 EOT
53 install_desktop() {
54 local file="$1" regdir=usr/share/rock-registry
55 [ -e $root/$regdir/app ] || mkdir -p $root/$regdir/app
57 echo "Installing ${file##*/} ..."
58 rock_substitute $file > $root/$regdir/${file##*/}
61 for y in $( ls -1 $confdir/*.desktop 2> /dev/null ); do
62 hook_add postinstall 6 "install_desktop '$y'"
63 done