LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
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 06-28-2009, 04:34 AM   #1
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Servers: Debian Squeeze and Wheezy. Desktop: Slackware64 14.0. Netbook: Slackware 13.37
Posts: 8,551
Blog Entries: 28

Rep: Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176
Graphical dialog from bash without grabbing focus


Hello

I want to display an un-intrusive graphical dialog to notify the workstation user that a bash script has finished running. It should be "top level", so visible to the user when it appears but should not grab focus, so the user can continue working in the current window and dismiss the notification when convenient.

Researching gdialog, xdialog, xmessage and zenity it seems none of them can do this; they all grab focus.

Any suggestions?

Best

Charles
 
Old 06-28-2009, 05:16 AM   #2
Hko
Senior Member
 
Registered: Aug 2002
Location: Groningen, The Netherlands
Distribution: ubuntu
Posts: 2,530

Rep: Reputation: 108Reputation: 108
One way I can think of for zenity is to edit its glade file. Downside of this is that all "zenity's" on your system will start without focus.

Anyway, to do this edit /usr/share/zenity/zenity.glade (on ubuntu/debian, may be different location on other distro's). Search for the line reading:
Code:
<property name="focus_on_map">True</property>
and change 'True' to 'False'.

Last edited by Hko; 06-28-2009 at 05:39 AM.
 
Old 06-28-2009, 05:24 AM   #3
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728
kdialog has a "nograb" option, but I can't make it work......
 
Old 06-29-2009, 03:01 PM   #4
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Servers: Debian Squeeze and Wheezy. Desktop: Slackware64 14.0. Netbook: Slackware 13.37
Posts: 8,551
Blog Entries: 28

Original Poster
Rep: Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176
Thanks Hko and pixellany

A couple of links for anyone netsearching this issue.

There's some discussion of zenity and focus at https://bugs.launchpad.net/zenity/+bug/272083 including Hko's suggested workaround and a version of zenity with a --focus option (but it's probably both "on top" and focus).

Zenity enhancement requests are listed at http://live.gnome.org/Zenity after clicking "More information". It includes an "Always on top" enhancement request but nothing about focus.

I submitted an enhancement request for a command line option not to grab focus.

If I get kdialog's nograb option to work, I'll post back.

Best

Charles
 
  


Reply

Tags
bash, focus, xdialog, zenity


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 to set the focus to the window my bash program is running in? jlinkels Programming 1 09-18-2008 05:26 AM
Bash Loop Dialog xlordt Programming 5 09-26-2006 09:40 AM
Prevent gaim grabbing window focus chrism01 Linux - Software 1 01-31-2006 07:00 PM
Simple bash script help, grabbing part of a string colabus Linux - Newbie 3 04-25-2005 09:42 AM
How to focus / restore / min / max windows with bash ? peb Linux - Newbie 2 02-29-2004 01:21 AM


All times are GMT -5. The time now is 08:49 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration