我想知道如何使用Qt來做這樣的事情(source)。我查看了文檔,但找不到任何方法來檢查外部進程是否正在運行。Qt - 如何檢測應用程序是否在GNOME或KDE上運行?
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
正是我需要的,謝謝。 – 2010-08-13 00:40:10