2 # Debian lightdm package configuration script
4 # Copyright 2000-2001 Branden Robinson.
5 # Licensed under the GNU General Public License, version 2. See the file
6 # /usr/share/common-licenses/GPL or <http://www.gnu.org/copyleft/gpl.txt>.
10 # source debconf library
11 . /usr/share/debconf/confmodule
13 # set default display manager
14 DEFAULT_DISPLAY_MANAGER_FILE=/etc/X11/default-display-manager
17 if db_metaget shared/default-x-display-manager owners; then
22 if db_metaget shared/default-x-display-manager choices; then
26 if [ "$OWNERS" != "$CHOICES" ]; then
27 db_subst shared/default-x-display-manager choices "$OWNERS" || :
28 db_fset shared/default-x-display-manager seen false || :
31 # debconf is not a registry; use the current contents of the default display
32 # manager file to pre-answer the question if possible
33 if [ -e "$DEFAULT_DISPLAY_MANAGER_FILE" ]; then
34 CURRENT_DEFAULT=$(basename "$(grep -v '^[[:space:]]*#' \
35 "$DEFAULT_DISPLAY_MANAGER_FILE" |
37 if [ -n "$CURRENT_DEFAULT" ]; then
38 db_set shared/default-x-display-manager "$CURRENT_DEFAULT"
42 if db_get shared/default-x-display-manager; then
43 CURRENT_DEFAULT="$RET"
47 db_input high shared/default-x-display-manager || :
50 # using this display manager?
52 if db_get shared/default-x-display-manager; then
56 # move the default display manager file if we are going to change it
57 if [ -n "$NEW_DEFAULT" ]; then
58 if [ "$NEW_DEFAULT" != "$CURRENT_DEFAULT" ]; then
59 if [ -e "$DEFAULT_DISPLAY_MANAGER_FILE" ]; then
60 mv "$DEFAULT_DISPLAY_MANAGER_FILE" \
61 "${DEFAULT_DISPLAY_MANAGER_FILE}.dpkg-tmp"