I don't know how much help this will be to you, but I always perform the following commands from a terminal.
Qt Code:
ps -ef | grep startkde or ps -ef | grep gnome-sessionTo copy to clipboard, switch view to plain text mode
startkde (to run kde)
gnome-session (to run Gnome)
This will tell you whether kde or gnome is running. You could write code to perform this system call and then parse the return to determine the environment.
Not pretty, but it just might work.![]()
Bookmarks