473,402 Members | 2,053 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,402 software developers and data experts.

Invoking GUI for app running in background with a keypress

I am creating a small app called PyQe
(http://klibb.com/cgi-bin/wiki.pl/PyQe) to launch commands and
programs quickly. I works more or less as I want it now and I have
managed to make my window manager (Metacity) under Mandrake GNU/Linux
start my program so that it can be started easily with just a
keypress.

Now, the only annoyance I have is that when I have not started the
program for a while, the OS seems to not have Python or the program in
"the cache" (or whatever, what I mean is that if I have started the
program "recently" it starts fast the next time) anymore, which means
that the program, even though quite small, takes about a second to
start. This is too slow to feel good given the nature of the program
(a quick launcher).

I have tried making it start faster by calling python with the -S
switch and by compiling my program to a .pyc file. It has not helped
much.

So, I was wondering if I could have my program running in the
background and instead capture a certain keystroke (the same one I
have my window manager to capture now) to make the GUI appear.

How does one go about doing this? I found a small program written in C
(xbindkeys) that can do this and understand that it probably involves
a lot of "low-level" stuff in X which feels a bit "scary" :). Any
clues of doing this "easily" in Python + some module?

/Mathias

Aug 15 '05 #1
1 1553
Mathias Dahl <br********@gmail.com> writes:
How does one go about doing this? I found a small program written in C
(xbindkeys) that can do this and understand that it probably involves
a lot of "low-level" stuff in X which feels a bit "scary" :). Any
clues of doing this "easily" in Python + some module?


Check out the python xlib implementation <URL:
http://sourceforge.net/projects/python-xlib >. It's a python library
that speaks native X - no C required. That lets you do those low-level
things in Python in a straightforward manner. It's not getting a lot
of work lately - because it's largely a finished product. I use it
heavily on a daily basis.

<mike
--
Mike Meyer <mw*@mired.org> http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.
Aug 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

29
by: pb648174 | last post by:
I have a very long transaction that runs on the same database that other users need to use for existing data. I don't care if they see data from the transaction before it is done and am only using...
5
by: Rahul | last post by:
Hi, Am working with a windows application where I need to show am application screen saver after 1 of system idle state, and its working fine if there is no Key board input or Mouse input. But...
4
by: Tom | last post by:
I have a VB.NET user control that I wrote - this control has three or four other controls on it (textbox, combobox, datetime picker, etc). Now, whenever the control is on a form and the user enters...
0
by: Eric Sabine | last post by:
OK, I'm trying to further my understanding of threading. The code below I wrote as kind of a primer to myself and maybe a template that I could use in the future. What I tried to do was pass data...
3
by: Fia | last post by:
Hi In Visual Basic 6 I could call keypress with an integer of a choosen key. For example I could call a textbox's keypress with the number 13 (for the enter key). But now in Visual Basic .Net I...
0
by: archana | last post by:
Hi all, I am having problem in one web method which i am running asynchronously I set oneway attribute in web method. What i want is once client called this web method this should start...
1
by: Luc The Perverse | last post by:
Hello! You may remember me as the guy who's trying to learn C# and using that old version 2003 of visual studio. (Although free version of command line .NET compiler is available, so if some new...
3
by: Jake Barnes | last post by:
I'm researching the Enter key. This is for an Ajax chat application. The designer tells me that she wants people to be able to submit text simply by hitting the Enter key. She wants this to happen...
4
by: Bullitt | last post by:
Hey, I have a problem with a small program that I want to make. It's a script that keeps running by using a Do While loop. I want to stop the script when a certain key is pressed. But the problem...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.