We should detect the desktop manager. We can do with 'pidof' :
if [ "$(pidof ksmserver)" ]; then
echo "KDE running."
# KDE-specific stuff here
elif [ "$(pidof gnome-session)" ]; then
echo "GNOME running."
# GNOME-specific stuff here
elif [ "$(pidof xfce-mcs-manage)" ]; then
echo "Xfce running."
# Xfce-specific stuff here
fi
We could use a QProcess to execute this command and adapt the behavior to each desktop manager
We should detect the desktop manager. We can do with 'pidof' :
We could use a QProcess to execute this command and adapt the behavior to each desktop manager