相关疑难解决方法(0)

Qt - 如何检测应用程序是否在GNOME或KDE上运行?

我想知道如何使用Qt 做这样的事情(来源).我查看了文档,但找不到任何方法来检查外部进程是否正在运行.

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
Run Code Online (Sandbox Code Playgroud)

linux desktop qt kde gnome

5
推荐指数
2
解决办法
2325
查看次数

标签 统计

desktop ×1

gnome ×1

kde ×1

linux ×1

qt ×1