How can I detect if the user "prefers" Qt or GTK?

It sounds impossible, but I want to try.
I'm thinking that a start might be reading the root window atoms in addition to the process list, but I'm not too sure what else.
This goes beyond "the user's running {KDE,GNOME}"; I don't really want to figure out the windowmanager, I want to use deduction so as to figure out what toolkit the user would prefer something to use. The idea is then to compile both Qt and GTK toolkit calls into whatever given program along with a simple abstraction layer and the detection stuff, so I can from there figure out which toolkit to use at startup.
I don't expect perfect detection, but it'd be fun to figure out.
Ideas, anyone?
My first stab at detecting a "GTK preference" is checking if the user is running gnome-session-manager. I'm not too sure what processes set "KDE session" apart from "a Qt-based program is running" because Qt has this tendancy to load 3874692725 things when anything starts and leave them preloaded for the next app. Nice idea, but not for low-RAM machines like mine. Only reason I haven't ravaged bits of KDE and stuffed them into my openbox desktop configuration
-dav7
Last edited by dav7 (2008-10-29 17:46:03)

How about a environmental variable?
You could have something like this is your .bashrc
export MYTOOLKIT=qt
or
export MYTOOLKIT=gtk
Then in your c-program you do something like this:
char *toolkit;
if ((toolkit = getenv("MYTOOLKIT")) == NULL) {
  fprintf(stderr, "-- 'MYTOOLKIT' not defined - required for this application (argv[0])\n");
  exit(1);
if (!strcasecmp(toolkit, "qt")) {
; // qt-part
} else if (!strcasecmp(toolkit, "gtk")) {
; // gtk-part
edit: forgot a curly brace - duh!
Last edited by perbh (2009-01-05 05:24:47)

Similar Messages

  • How Can I Detect Whether the User's Firefox Supports MHTML?

    Is there a browser capability property that I could look at to detect whether the user's version of Firefox (including, for instance, an "unMHT" add-on) supports MHTML? Currently we provide reports to our users in this format and want to provide a link to add-on's in case the user cannot actually view the format; but show the report if the add-on or capability is present.

    Sorry, you can't detect if a user has unMHT installed.
    Have you tested your MHTML files with Firefox and unMHT? <br />
    MHTML was never adopted as an official standard by W3C - http://en.wikipedia.org/wiki/MHTML - and from my limited usage of unMHT, it isn't exactly the same as what MS uses with IE. I have had problems displaying a file saved in one browser in another brand browser, and don't remember the specifics beyond IE8 won't correctly display unMHT files even when the file extension is changed from MHT to MHTML. Plus there's a 2nd add-on / extension - Mozilla Archive Format - that some users may have installed for MHTML files.

  • How can i get all the users from weblogic server?

    how can i get all the users from weblogic server?
    i have configurated a LDAP server using iPlanet and
    in weblogic server console i see those users from LDAP
    server. but how can i get all the users in my program
    from weblogic server instead of LDAP server?
    BTW,how to configure a RDBMSAuthenticator and what should i do
    in Oracle? which tables should i create? and how are their architectures?
    Thanks
    Daniel

    BTW, i use weblogic platform 8.1
    "Daniel" <[email protected]> дÈëÓʼþ
    news:[email protected]..
    how can i get all the users from weblogic server?
    i have configurated a LDAP server using iPlanet and
    in weblogic server console i see those users from LDAP
    server. but how can i get all the users in my program
    from weblogic server instead of LDAP server?
    BTW,how to configure a RDBMSAuthenticator and what should i do
    in Oracle? which tables should i create? and how are their architectures?
    Thanks
    Daniel

  • How can give permissions to the users in wiki?

    Hi, in wiki how can give permissions to the users, i need to give one of the users full control for wiki only ( not the server ), so how can make this user wiki admin?.

    No answer!!??
    I Need to put one of staff as Wiki Admin then he can manage it ( Delete, Edit ...etc ), Wiki Creators users can't full admin the Wiki.
    Please help.

  • How can I detect if the  IMAP service is down ?

    I'm trying to figure out how to monitor when IMAP service down ?
    $ORACLE_HOME/bin/oesctl show status ${host_name}:um_system:imap
    However, this always shows that everythings fine.
    Is there a way of telling if it is not fine ?

    You can actually telnet to the IMAP server and issue some basic commands to see if it is responding. Try the following on the command line:
    telnet <your server> 143
    1 login <some user> <password>
    1 quitWhat you want to do is come up with something (like a script) that is scheduled to run and detects whether a valid response is returned every time.
    Edit: apologies, the "quit" should be "logout" as indicated below
    Message was edited by:
    david.chandler

  • How can my program keep the user from using Alt+Tab?

    Hi everyone,
    How can i make my program so that when the user tries to use Alt+Tab to open any other windows, it won�t allow it. Thanks in advance.

    You can't.
    Java runs in a virtual machine, and relies on the OS to forward events to the virtual machine for dispatch to the appropriate swing components.
    This means that the OS will get the alt-tab, before java, and it will consume it.
    You can however detect when a window is no longer receiving focus, by adding a WindowListener
    Window.addWindowListener(WindowListener l)And you can bring your window to the front (in theory) using
    Window.toFront()However, I have found this to be not always successful (since the jre dispatches the request to the OS, it is the OS that must do it, and depending on the context may not).
    I suggest you try another language, such as C.

  • How can i detect if the picture or swf file is produced from legal flash?

    I have recently bought images and swf files from a student for my website.
    I've just realized that the images and swf might be from pirated flash product because i found out that
    the original flash is really and i mean really pricey! I don't believe he bought an original product.
    How do i detect if it is from a legal product? I'm worried as i'm going to put it in my website.
    I can't get the guy who did this for me as he is in another country already.
    If it is possible to detect this and it is indeed from pirated product, how can i make it legal again?
    Please help.

    Hey Rob,
    Its the same question, just that i want to know if it is possible to trace the source if the file is an image.
    If it is not possible to trace the source be it a swf or an image file, then i will just upload it to my website.
    I wouldn't bother to check if it came from a pirated flash product.
    The image is created from flash 8 just for me. It is not downloaded from another source.
    Thanks.

  • How can i detected that the channel is closed with nio async?

    using nio, I can wait accept, read data, write data asynchronously.
    now i make a server program, and want to dected if a socket is closed by client, how can i do this?
    thanks.

    TO: ejp
    In TCP the only way you can detect a dead connection is to attempt to write to it.
    Eventually this will fail probably with a SocketException 'connection reset'.When should this happen? I don't seem to get any expection. The socket is registered for read only but it never gets read for reading again. The appropriate selection key indicates it is writable, but I don't have it registered for write operation.
    Isn't there any other way to get around those dead sockets without trying to write at them? This would be quite an overhead, since server has to send some check_alive message periodically...

  • How can I get ALL the user info from WWW_FLOW_FND_USER -table?

    Hi.
    I use HTML DB authentication and therefore all my user information is stored in HTML DB tables. I can use :APP_USER to get USER_NAME, but in my application I need to have also USER_ID, FIRST_NAME, LAST_NAME and EMAIL_ADDRESS fields from database. I don't want to change any database/schema security level so I cannot read directly from WWW_FLOW_FND_USER -table when I am inside in SCOTT -schema/sec.level.
    How to read all the information?

    Thank you for your help, but I cannot find any information about backage wwv_flow_user_api on OTN or in HTML DB documentation.
    Where to start?

  • How to detect if the user is using SSL

    I use weblogic 5.1 sp6and NES 4.1. Netscape plug-in connects them together.
    I also install the verisign certificate on the NES 4.1.
    I want my JSP code to detect if the user is using http or https to visit my
    site. However, isSecure() will return false and getSchema will return https
    and getServerPort will return 80, even when the user is using https:// . I
    guess the reason is when the NES forwards the request to the weblogic, it is
    not using https.
    Then how can I detect the protocol the user is using? I use getHeaderNames()
    method to print out all the infomration in the HEADER. However, I find that
    it only includes client header information. Is it true that NES plug-in only
    fowards part of the HEADER information to the weblogic server?
    Thanks

    Comments inline....
    "Lan Jiang" <[email protected]> wrote in message
    news:3a74d511$[email protected]..
    I use weblogic 5.1 sp6and NES 4.1. Netscape plug-in connects themtogether.
    I also install the verisign certificate on the NES 4.1.
    I want my JSP code to detect if the user is using http or https to visitmy
    site. However, isSecure() will return false and getSchema will returnhttps
    and getServerPort will return 80, even when the user is using https:// . I
    guess the reason is when the NES forwards the request to the weblogic, itis
    not using https.getServerPort should return 443. It's a bug. Fixed already in the later
    service packs.
    Workaround: run the server in a port other than 443.
    >
    Then how can I detect the protocol the user is using? I usegetHeaderNames()
    method to print out all the infomration in the HEADER. However, I findthat
    it only includes client header information. Is it true that NES plug-inonly
    fowards part of the HEADER information to the weblogic server?No, it forwards all except the Connection header because it doesn't support
    http 1.1
    Vinod.

  • How can I delete all the email from a user's account?

    I have a user account with a huge amount of mail (around 50K messages) that Apple Mail can't deal with... it constantly hangs and/or crashes whether I use POP or IMAP to try and delete all the mail from the client.
    How can I delete all the mail from the mailbox on the server? I don't want to delete the account entirely, I just want to empty everything out of it.
    Thanks!

    sudo -u _cyrus /usr/bin/cyrus/bin/ipurge -d 0 -f user/mailboxname
    HTH,
    Alex

  • How can I find out the screen size of the users moniter using the Acrobat SDK?

    How can I find out the screen size of the users moniter using the Acrobat SDK? I need to know how much sreen real estate that is available on the users moniter. Is there some call that I can make from the SDK to discover the maximun X and Y coordinates?
    Thanks,
    Gregory

    Currently, I am testing on multiple moniters and it is defaulting to the moniter designated as the #1 moniter. For our purposes, this is acceptable. Once the two documents have loaded, the user can move and re-size at will.
    Gregory

  • How can I find out the list of users who has the access to IT 0008

    All,
    How can I find out the list of users who has the W R permission for IT 008
    for others?
    SUIM doe not look like giving me the correct results.
    Please advise.
    Thanks,
    From
    PT.

    combine tables AGR_1251 and table AGR_Users on keyfield AGR_USERS
    in tabel AGR_1251 select on Field LOW values IT0008.OR W OR R,
    noiw you get also other values
    So better solution run the query twice over AGR1251 first on IT0008 and secondly on values W OR R and then the result over table AGR_USERS
    Youu also might put an additional selection on object P* (only selecting HR objects)
    output wll be UID in table AGR_USERS

  • How can i do a variable User exit that present the values before execute

    Hi Gurus,
    How can i do a variable User exit that present the values before execute, i need this:
    a variable that calculate SYS-DATUM until 30 days before (I got the code) but this  variable run automatic because is user exit, i want this variable but first present the values, not execute automatic, this is because the users want the report that automatic present the values , help

    Hi,
    Refer the below links,
    http://documentation.softwareag.com/natural/nat424mf/pdf/ops_mf/conf_usrex.pdf
    http://www.erpgenie.com/component/content/article/1097
    http://www.apentia-online.at/UP/Apentia/files/Article/SAP_BW_User_Exits_and_BAdIs.pdf
    Hope it helps you,
    Regards,
    Ravindra.

  • How can we find all the available  user-exits in sap without using SMOD?.

    How can we find all the available  user-exits in sap without using SMOD?.

    Hi,
    Please check this links for user exits list.
    http://www.planetsap.com/Userexit_List.htm
    http://www.easymarketplace.de/userexit.php
    http://www.sap-img.com/ab038.htm
    Regards,
    Ferry Lianto

Maybe you are looking for

  • PPC IMac G5 w/ OSX 10.4.11

    I'm actually going to be selling my iMac having upgraded recently, so I've reformatted/clean installed it and loaded on some apps, but my Classic (which was working) is now gone. As I recall I think all I had to do was drag copy an old System 9 folde

  • HT2731 can i download itunes on my nokia lumia 520?

    hi. So I'm trying to figure out if I can download the iTunes app for my Nokia Lumia 520? Could u tell me if that's possible.

  • BUG in AdvancedDataGrid?

    Editable does not work as advertised in the documentation. (FB3 w SDK 3.5) From the docs for the "editable" property at http://livedocs.adobe.com/flex/3/langref/mx/controls/AdvancedDataGridBaseEx.html#editable: If "item", the item renderers in the co

  • Is there a way to set/change default event start/end time?

    Is there a way to set or change the default start and end time for events? 

  • Block a specific address via WiFi (and allow via Ethernet)?

    Does anyone know of a way to block incoming connections from a specific IP address ONLY when using WiFi, but allow incoming connections from the same IP address when using ethernet? Basically, like a micro-firewall. I've found myself in a situation d