small tweak added, if by some weird chance there's more than one dm, shows all of them, in comma separated list.

This might help debug certain odd issues where a user might not know this is the case, or forgot, or something else weird.
This commit is contained in:
inxi-svn 2012-06-24 07:45:22 +00:00
parent 3821e2a16e
commit ce04297c0f

6
inxi
View file

@ -3395,13 +3395,15 @@ get_display_manager()
{ {
eval $LOGFE eval $LOGFE
local dm_id_list='entrance/entranced.pid gdm.pid gdm3.pid kdm.pid lightdm.pid lxdm.pid mdm.pid nodm.pid slim.lock wdm.pid xdm.pid' local dm_id_list='entrance/entranced.pid gdm.pid gdm3.pid kdm.pid lightdm.pid lxdm.pid mdm.pid nodm.pid slim.lock wdm.pid xdm.pid'
local dm_id='' dm='' local dm_id='' dm='' separator=''
local x_is_running=$( ps aux | grep '/usr.*/X' | grep -Eivc '(grep|/Xprt)' ) local x_is_running=$( ps aux | grep '/usr.*/X' | grep -Eivc '(grep|/Xprt)' )
for dm_id in $dm_id_list for dm_id in $dm_id_list
do do
if [[ -e /var/run/$dm_id || -e /run/$dm_id ]];then if [[ -e /var/run/$dm_id || -e /run/$dm_id ]];then
dm=$( basename $dm_id | cut -d '.' -f 1 ) # just on the off chance that two dms are running, good info to have in that case, if possible
dm=$dm$separator$( basename $dm_id | cut -d '.' -f 1 )
separator=','
fi fi
done done
# might add this in, but the rate of new dm's makes it more likely it's an unknown dm, so # might add this in, but the rate of new dm's makes it more likely it's an unknown dm, so