summaryrefslogtreecommitdiff
blob: d1ee0b84b4bbf0d248f72472d7fb01f3cd9ae5a5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
--- data/config/build_config.sh.orig	2003-10-08 11:30:08.000000000 -0400
+++ data/config/build_config.sh	2003-10-13 23:33:55.864502000 -0400
@@ -1,4 +1,4 @@
-#!/bin/sh -e
+#!/bin/bash
 DB="./entrance_config.db"
 rm -f $DB
 
@@ -14,24 +14,33 @@
 #edb_ed $DB add /entrance/fonts/count int 2
 #edb_ed $DB add /entrance/fonts/0/str str "/usr/share/fonts/truetype/"
 #edb_ed $DB add /entrance/fonts/1/str str "/usr/X11R6/lib/X11/fonts/Truetype/"
-edb_ed $DB add /entrance/session/count int 9
-edb_ed $DB add /entrance/session/0/value str ""
-edb_ed $DB add /entrance/session/0/key str "Default"
-edb_ed $DB add /entrance/session/1/value str "enlightenment"
-edb_ed $DB add /entrance/session/1/key str "Enlightenment"
-edb_ed $DB add /entrance/session/2/value str "kde"
-edb_ed $DB add /entrance/session/2/key str "KDE"
-edb_ed $DB add /entrance/session/3/value str "gnome"
-edb_ed $DB add /entrance/session/3/key str "Gnome"
-edb_ed $DB add /entrance/session/4/value str "gnome"
-edb_ed $DB add /entrance/session/4/key str "Gnome"
-edb_ed $DB add /entrance/session/5/value str "blackbox"
-edb_ed $DB add /entrance/session/5/key str "Blackbox"
-edb_ed $DB add /entrance/session/6/value str "sawfish"
-edb_ed $DB add /entrance/session/6/key str "Sawfish"
-edb_ed $DB add /entrance/session/7/value str "xfce"
-edb_ed $DB add /entrance/session/7/key str "XFce"
-edb_ed $DB add /entrance/session/8/value str "failsafe"
-edb_ed $DB add /entrance/session/8/key str "Failsafe"
+
+pick_icon() {
+	case "`basename $(echo $1 | awk '{print toupper($1)}')`" in
+		KDE*)			echo -n "kde";;
+		GNOME*)			echo -n "gnome";;
+		ENLIGHTENMENT)	echo -n "e16";;
+		E17)			echo -n "enlightenment";;
+		WMAKER)			echo -n "widowmaker";;
+		BLACKBOX)		echo -n "blackbox";;
+		*)				echo -n "default";;
+	esac
+	echo ".png";
+}
+
+count=-1
+for ses in /etc/X11/Sessions/* ; do
+	let "count++"
+	edb_ed $DB add /entrance/session/${count}/name str "`basename ${ses}`"
+	edb_ed $DB add /entrance/session/${count}/path str "${ses}"
+	edb_ed $DB add /entrance/session/${count}/icon str "`pick_icon ${ses}`"
+done
+let "count++"
+edb_ed $DB add /entrance/session/${count}/name str "Failsafe"
+edb_ed $DB add /entrance/session/${count}/path str "/etc/X11/Sessions/Xsession failsafe"
+edb_ed $DB add /entrance/session/${count}/icon str "default.png"
+edb_ed $DB add /entrance/session/count int ${count}
+edb_ed $DB add /entrance/session/default int 0
+
 edb_ed $DB add /entrance/system/reboot int 1
 edb_ed $DB add /entrance/system/halt int 1