LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-03-2008, 03:23 AM   #1
dale_chip
Member
 
Registered: Jun 2007
Location: India
Posts: 41

Rep: Reputation: 15
To bring a window in the foreground


I want to run a program as a reminder.
My program will periodically display certain messages , like reminders etc. etc.
I intend to run the program in a terminal window which i will minimize after running the program.
I 've made my program as a shell script. But what i want is that every time a reminder is fired the terminal window running my program must come in the foreground so that i can see the message.
I do not want to use bell sound as i often fail to hear it.

Can any plz tell me how can i bring the terminal window from a minimized state to the foreground of all my running windows.

I am using fc5.
Thank you.
 
Old 04-03-2008, 11:29 AM   #2
osor
HCL Maintainer
 
Registered: Jan 2006
Distribution: (H)LFS, Gentoo
Posts: 2,450

Rep: Reputation: 78
Quote:
Originally Posted by dale_chip View Post
Can any plz tell me how can i bring the terminal window from a minimized state to the foreground of all my running windows.
You will either need to use Xlib code directly or use a scriptable utility that does it for you. In the latter case you might try wmctrl. E.g.,
Code:
wmctrl -ia $WINDOWID
 
Old 04-05-2008, 10:05 AM   #3
kalleanka
Member
 
Registered: Aug 2003
Location: Mallorca, Spain
Distribution: xubuntu
Posts: 551

Rep: Reputation: 38
not easy since it depends on your wm and the wm can override your xcommands.
 
Old 04-05-2008, 07:30 PM   #4
osor
HCL Maintainer
 
Registered: Jan 2006
Distribution: (H)LFS, Gentoo
Posts: 2,450

Rep: Reputation: 78
Quote:
Originally Posted by kalleanka View Post
not easy since it depends on your wm and the wm can override your xcommands.
It depends on your window manager following the EWMH “standard” (or at least the part of it pertaining to window switching). Most window managers follow this correctly. In fact, the above works for me in an xterm with XFCE4. E.g., if I do:
Code:
sleep 3; wmctrl -ia $WINDOWID
and minimize the xterm while it’s sleeping, it will restore itself after the appropriate time.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how can i bring the backgroud process to foreground ZAMO Linux - Enterprise 10 03-05-2012 09:35 AM
Command to bring a selected window to the top? crazyjimbo Linux - Software 3 12-03-2006 02:24 PM
How to bring a background diamon to foreground lieuquocdat Linux - Software 8 07-20-2006 06:53 AM
how do i bring the linux window into a lindows Os ErichKnoop Red Hat 1 02-27-2004 10:19 AM
How to bring up application window to front from shell script. aleksas_m Linux - General 2 08-21-2003 01:22 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:04 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration