Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Fri Jun 05, 2020 10:32 pm
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 11 posts ] 
Author Message
 Post subject: Which window manager
PostPosted: Tue Oct 04, 2005 2:46 pm 
Offline
User avatar

Joined: Fri Sep 30, 2005 3:53 pm
Posts: 3261
Location: England
Does anyone know how I can tell at run time whether my app is running in kde or gnome ?

If it's complicated, I'd appreciate an explanation in words of one syllable.

_________________
Steve Garman
Using REALbasic 2008r2 Professional on Windows Vista Ultimate
and REALbasic 2009r5.1 Professional on Linux Ubuntu 9.04 Desktop
and REAL Studio 2010r1 Personal on Linux Ubuntu 9.10 Desktop
Occasional blog


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Oct 04, 2005 3:28 pm 
Offline
User avatar

Joined: Wed Sep 28, 2005 8:39 am
Posts: 9341
Location: St Augusta, MN
I've looked into this before, and I've never actually found a reliable way to tell which window manager is currently running. It's possible that I've overlooked something though...

I'd guess that you might be able to hackishly get the window manager by checking the scripts which tells X which manager to start up, but it seems kinda skeezy to me.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Oct 04, 2005 9:12 pm 
Offline

Joined: Fri Sep 30, 2005 9:30 pm
Posts: 1712
Location: U.S.A.
Please excuse my ignorance, but wouldn't the window manager be the same as the desktop? My desktop always tells me which is running by way of the distinct icons. Unless you have installed a theme that changes the icons it seems to me this would be accurate.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Oct 04, 2005 9:14 pm 
Offline
User avatar

Joined: Wed Sep 28, 2005 8:39 am
Posts: 9341
Location: St Augusta, MN
I think what Steve is after is a way to programmatically know what the window manager is. This can be important for things like following the proper UI guidelines. For example, Gnome documents that OK/Cancel is supposed to be like the Mac. KDE documents that it should be like Windows. So if you generically want to follow the proper UI guidelines, you need to know which window manager is running so you can swap buttons as appropriate.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Oct 04, 2005 9:45 pm 
Offline
User avatar

Joined: Mon Oct 03, 2005 5:33 pm
Posts: 464
<rant>

I think the Linux community are going about things all wrong. They have dozens of distributions which all use the same kernel (Linux) and one of two (or both) windowing systems: GNOME or KDE. It would make a heck of a lot more sense to me for them to have exactly two distributions, one for GNOME and one for KDE, and then refer to them not as "Linux" but as "GNOME Linux" or "KDE Linux." GNOME and KDE are a lot more different than, say, Debian (running KDE) and Knoppix (running KDE). Yet Debian and Knoppix are considered different products, and GNOME and KDE are not.

</rant>

I was thinking, at first, that you might be able to tell what libraries are installed and use that, but the problem is that a lot of Linux systems have both the GNOME and KDE libraries loaded at the same time... so that's out. Parsing the startup script might be it.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Oct 05, 2005 12:01 am 
Offline
User avatar

Joined: Fri Sep 30, 2005 3:53 pm
Posts: 3261
Location: England
Aaron Ballman wrote:
I think what Steve is after is a way to programmatically know what the window manager is. This can be important for things like following the proper UI guidelines.

Aaron's exactly right about what I was looking for and why.

I vaguely hoped that someone would have an answer like "gnome always sets an environment variable gnomehome"

I've tried parsing startup scripts before (awk, not RB) and my simplistic attempts have often ended up tripping over something I hadn't thought about.

Since there doesn't seem to be a straightforward answer, I think I'll ignore the problem and treat linux as a single target platform.

_________________
Steve Garman
Using REALbasic 2008r2 Professional on Windows Vista Ultimate
and REALbasic 2009r5.1 Professional on Linux Ubuntu 9.04 Desktop
and REAL Studio 2010r1 Personal on Linux Ubuntu 9.10 Desktop
Occasional blog


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Oct 05, 2005 3:15 pm 
Offline
User avatar

Joined: Wed Sep 28, 2005 8:39 am
Posts: 9341
Location: St Augusta, MN
Yeah, I was hoping it'd be that simple as well. But it's not something that's standardized, unfortunately. It'd sure be nice if it was though!


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Oct 05, 2005 7:58 pm 
Offline

Joined: Fri Sep 30, 2005 9:30 pm
Posts: 1712
Location: U.S.A.
I tried looking around in Gnome's documentation and came up with nothing. You may be able to check the existance of certain libraries, but like someone already mentioned, I have Gnome and KDE installed, but use the KDE desktop, so that probably wouldn't work.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Oct 05, 2005 9:43 pm 
Offline

Joined: Sat Oct 01, 2005 12:18 pm
Posts: 1358
blakeyrat wrote:
<rant>

I think the Linux community are going about things all wrong. They have dozens of distributions which all use the same kernel (Linux) and one of two (or both) windowing systems: GNOME or KDE. It would make a heck of a lot more sense to me for them to have exactly two distributions, one for GNOME and one for KDE, and then refer to them not as "Linux" but as "GNOME Linux" or "KDE Linux." GNOME and KDE are a lot more different than, say, Debian (running KDE) and Knoppix (running KDE). Yet Debian and Knoppix are considered different products, and GNOME and KDE are not.

</rant>


<off topic, kinda>
There a many windows managers available for different versions of Linux. I know someone with about 7 different windows managers. While he regularly uses KDE, he switches between them. The windows managers make things feel different, but represent the same stuff. The different versions of linux (Debian, Knoppix, Mandrake, RedHat...) do process things differently. I have been told that Mandrake is the easiest for beginners and the most user friendly, while there are much harder ones, like Debian and ArcLinux, that are harder to use. KDE and GNOME, while they look very different, are very similer, compared to the different distros. Some have graphical installers, like what Windows and Mac have, while others require you to recompile your kernal and create config files in the command line and change things manually to install. Big difference, but not always noticable to the casual user. </off topic>

I'll ask my friend who uses Linux all the time.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sat Nov 26, 2005 4:42 pm 
Offline

Joined: Sat Nov 26, 2005 4:30 pm
Posts: 1
Steve Garman wrote:
Does anyone know how I can tell at run time whether my app is running in kde or gnome ?

If it's complicated, I'd appreciate an explanation in words of one syllable.


Maybe this?

Check the $DESKTOP_SESSION environment variable.

(That's assuming RB can query this)

To see what I mean, at a bash prompt type:

echo $DESKTOP_SESSION


With KDE, it returns "kde". With FluxBox, it returns "fluxbox" so I think this should work....

HTH.

AIR

_________________
"Programming is like Poetry. Sometimes the words just escape you..."
-me, to my manager.

http://www.airsys.org - Freeware programs coded in Hotbasic, Delphi, and Purebasic


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sat Nov 26, 2005 5:05 pm 
Offline

Joined: Sun Nov 13, 2005 5:48 pm
Posts: 1073
Location: Gone man...gone.
Airr wrote:
Check the $DESKTOP_SESSION environment variable.

(That's assuming RB can query this)

To see what I mean, at a bash prompt type:

echo $DESKTOP_SESSION


With KDE, it returns "kde". With FluxBox, it returns "fluxbox" so I think this should work....

Airr,

That's a great solution. Here it is applied in RB:

Dim DesktopType as String = System.EnvironmentVariable("DESKTOP_SESSION")
MsgBox DesktopType

_________________
God bless and thanks to my friends and fellow RB'ers for the good times!


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group