aboutsummaryrefslogtreecommitdiffstats
path: root/prefdm
diff options
context:
space:
mode:
Diffstat (limited to 'prefdm')
-rwxr-xr-xprefdm14
1 files changed, 9 insertions, 5 deletions
diff --git a/prefdm b/prefdm
index 57cfafc9..10b679d5 100755
--- a/prefdm
+++ b/prefdm
@@ -35,10 +35,14 @@ shopt -s execfail
[ -n "$preferred" ] && exec $preferred "$@" >/dev/null 2>&1 </dev/null
-# Fallbacks, in order
-exec gdm "$@" >/dev/null 2>&1 </dev/null
-exec kdm "$@" >/dev/null 2>&1 </dev/null
-exec wdm "$@" >/dev/null 2>&1 </dev/null
-exec xdm "$@" >/dev/null 2>&1 </dev/null
+for pkg in $(rpm -q --qf "%{NAME}\n" --whatprovides "service(graphical-login)") ; do
+ dm=$(rpm -q --provides $pkg | awk '/^service\(graphical-login\)/ { print $3 ; exit }')
+ if [ -n "$dm" ]; then
+ exec $dm "$@" >/dev/null 2>&1 </dev/null
+ else
+ exec $pkg "$@" >/dev/null 2>&1 </dev/null
+ fi
+done
+
# catch all exit error
exit 1