How to make gxmessage always on top?

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Message
Author
User avatar
Subito Piano
Posts: 731
Joined: Mon 28 May 2007, 03:12
Location: UPSTATE New York
Contact:

How to make gxmessage always on top?

#1 Post by Subito Piano »

Hi!

I created a scheduled popup window with gxmessage to remind me of a task. What command do i add to make the window always on top? (For instance, it gets buried underneath my startup programs if the alarm time is 6AM and i start up my laptop at 7AM, so i don't see the popup.)

Here's my script:

Code: Select all

#!/bin/bash
clear
gxmessage TEXT OF MY TASK -center -font "sans-serif 36" -geometry 320x130 -name  ALARM
I tried zenity as well; either way, zenity or gxmessage, i don't know what option to add to keep the window on top.

Thanks!

User avatar
don570
Posts: 5528
Joined: Wed 10 Mar 2010, 19:58
Location: Ontario

yaf-splash

#2 Post by don570 »

Code: Select all

yaf-splash -close box -placement top -bg orange -fontsize large -text "Example text"
I don't know if this is a solution but Barry Kauler likes to use
yaf-splash to give
warnings , and he likes to use the placement option to place the warning
at the top of the computer screen. Maybe he does that to avoid
being covered over...
-placement

Specifies the placement of the splash text using one of the following strings: top-left, top, top-right, left, center, right, bottom-left, bottom, bottom-right. Specifying this setting overrides the position information given in the -geometry option. Center is the default.

________________________________________

disciple
Posts: 6984
Joined: Sun 21 May 2006, 01:46
Location: Auckland, New Zealand

#3 Post by disciple »

If you use JWM you can use a group setting based on the window name and/or class. See http://joewing.net/projects/jwm/config.shtml.

Note that the format has changed, since Jwm now only supports 3 layers instead of five or something. You probably have jwm 2.1 with the old format.
Do you know a good gtkdialog program? Please post a link here

Classic Puppy quotes

ROOT FOREVER
GTK2 FOREVER

User avatar
Subito Piano
Posts: 731
Joined: Mon 28 May 2007, 03:12
Location: UPSTATE New York
Contact:

#4 Post by Subito Piano »

Thanks, guys! :-)

(For any zenity lovers following later on, i did find this to keep zenity on top.)

disciple
Posts: 6984
Joined: Sun 21 May 2006, 01:46
Location: Auckland, New Zealand

#5 Post by disciple »

Although that's not really specific to zenity...

Btw, i thought zenity was long dead. Haven't people switched to yad, which is compatible and alive?
Do you know a good gtkdialog program? Please post a link here

Classic Puppy quotes

ROOT FOREVER
GTK2 FOREVER

phat7
Posts: 179
Joined: Fri 05 Jun 2015, 08:54

#6 Post by phat7 »

On 2012-02-26 , well before this thread, Tim Musson released gxmessage version 2.20.0
New options: -sticky, -ontop, and -noescape

Puppy is still on version 2.14.4 :roll:

User avatar
MochiMoppel
Posts: 2084
Joined: Wed 26 Jan 2011, 09:06
Location: Japan

#7 Post by MochiMoppel »

Does any of the newer Puppies uses gxmessage 2.20 ?

Apart from the useful -ontop feature it might solve my problem with the current version 2.14.4:
I can't make the -nofocus option work. Does this work for anyone?

User avatar
fabrice_035
Posts: 765
Joined: Mon 28 Apr 2014, 17:54
Location: Bretagne / France

#8 Post by fabrice_035 »

hello,

We can install gxmessage 2.20 with puppy packet manager.

Code: Select all

root# gxmessage --version
gxmessage-2.20.0

Code: Select all

root# gxmessage --help

gxmessage - a GTK-based xmessage clone

Usage: gxmessage [OPTIONS] message ...
       gxmessage [OPTIONS] -file FILENAME

xmessage options:
  -file FILENAME         Get message text from file, '-' for stdin
  -buttons BUTTON_LIST   List of "LABEL:EXIT_CODE", comma separated
  -default LABEL         Give keyboard focus to the specified button
  -print                 Send the selected button's LABEL to stdout
  -center                Open the window in the center of the screen
  -nearmouse             Open the window near the mouse pointer
  -timeout SECONDS       Exit with code 0 after SECONDS seconds
  -display DISPLAY       X display to use
  -fn FONT | -font FONT  Set message font (works with GTK font names)
  -fg COLOR              Set message font color
  -bg COLOR              Set message background color
  -geometry GEOMETRY     Set window size (position will be ignored)
  -iconic                Start iconified
  -name NAME             Program name as used by the window manager
  -title TITLE           Set window title to TITLE

Additional gxmessage options:
  -borderless            Open the window without border decoration
  -sticky                Make the window stick to all desktops
  -ontop                 Keep window on top
  -nofocus               Don't focus the window when it opens
  -noescape              Don't allow pressing ESC to close the window
  -encoding CHARSET      Expect CHARSET as the message encoding
  -entry                 Prompt for text to be sent to stdout
  -entrytext TEXT        Same as -entry, but with TEXT as default text
  -wrap                  Wrap lines of text to fit window width
  -help | -?             Show this usage information
  -version               Show gxmessage version and Copyright details

Please report bugs to <trmusson@gmail.com>.
Option -ontop work fine

Distro: tahrpup 6.0.6

User avatar
MochiMoppel
Posts: 2084
Joined: Wed 26 Jan 2011, 09:06
Location: Japan

#9 Post by MochiMoppel »

My question was rather if it is installed, not if it can be installed

User avatar
Keef
Posts: 987
Joined: Thu 20 Dec 2007, 22:12
Location: Staffordshire

#10 Post by Keef »

BionicPup64 has gxmessage-2.12.4.
Easy (which I'm on now) has gxmessage-2.20.4, but that probably doesn't count.
Looking in .packages in Slacko 6.9.9.9 (32bit) it looks like it is gxmessage 2.12.4 also. Other than that, I know nothing useful.

User avatar
MochiMoppel
Posts: 2084
Joined: Wed 26 Jan 2011, 09:06
Location: Japan

#11 Post by MochiMoppel »

Thanks for your research. I find the results a bit disappointing :(
Just curious: Does -nofocus work in Easy?

User avatar
Keef
Posts: 987
Joined: Thu 20 Dec 2007, 22:12
Location: Staffordshire

#12 Post by Keef »

RE gxmessage 2.20.4 on Easy

Focus jumps straight to the dialog box with:

Code: Select all

gxmessage  -buttons  "Hello\, world" "Example"
...but stays in the terminal with:

Code: Select all

gxmessage -nofocus -buttons  "Hello\, world" "Example"

User avatar
MochiMoppel
Posts: 2084
Joined: Wed 26 Jan 2011, 09:06
Location: Japan

#13 Post by MochiMoppel »

Keef wrote:...but stays in the terminal with:

Code: Select all

gxmessage -nofocus -buttons  "Hello\, world" "Example"
I envy you :cry:

User avatar
MochiMoppel
Posts: 2084
Joined: Wed 26 Jan 2011, 09:06
Location: Japan

#14 Post by MochiMoppel »

Sorry for asking again.
Keef wrote:RE gxmessage 2.20.4 on Easy

Focus jumps straight to the dialog box with:

Code: Select all

gxmessage  -buttons  "Hello\, world" "Example"
...but stays in the terminal with:

Code: Select all

gxmessage -nofocus -buttons  "Hello\, world" "Example"
Just to clarify: in 2.14.4 focus also stays in the terminal, but gxmessage becomes the active window. This is a very unusual constellation. With or without -nofocus the terminal window's title bar turns gray and gxmessage's opens with title bar color indicating that the window is active (which according to xprop it indeed is), but the focus remains on the terminal, i.e. keystrokes go to the terminal and not to the active gxmessage. So may question: Has this been fixed in 2.20.4 , i.e would the terminal stay activated?

This might be a better example for testing:

Code: Select all

gxmessage -nofocus -entry Example
Here the entry field has no blinking text cursor at startup. Only when I hover the mouse over the gxmessage window the entry field receives focus and input goes to gxmessage and not to the terminal.

User avatar
Keef
Posts: 987
Joined: Thu 20 Dec 2007, 22:12
Location: Staffordshire

#15 Post by Keef »

When I run your example, the terminal window bar changes from a solid colour (focussed) to shaded (not focussed).
Keyboard input still goes to the terminal, even if mouse over the dialog, or even click on it. There is no cursor in the dialog box. Hope that helps.
Attachments
gxdialog.jpg
(41.28 KiB) Downloaded 132 times

User avatar
MochiMoppel
Posts: 2084
Joined: Wed 26 Jan 2011, 09:06
Location: Japan

#16 Post by MochiMoppel »

Keef wrote:When I run your example, the terminal window bar changes from a solid colour (focussed) to shaded (not focussed).
Really? Your screenshot shows that the terminal window retains its solid color.
Keyboard input still goes to the terminal, even if mouse over the dialog, or even click on it.
Even when you click on the dialog? That would be a serious bug!
Your dialog also shows no title bar though it should. Did you instruct your window manager to open gxmessage undecorated?

User avatar
Keef
Posts: 987
Joined: Thu 20 Dec 2007, 22:12
Location: Staffordshire

#17 Post by Keef »

Yes you are right. Not entirely sure what I managed to do there, and I had tried it several times...
Other behaviour is the same apart from the window bar bit.
The OK button works fine, but not the text box.
I'm am using JWM, and have made no changes, but just checked _root_.jwmrc, and it has:

Code: Select all

<Group>
		<Name>xmessage</Name>
		<!-- <Option>icon:info16.xpm</Option> -->
		<Option>notitle</Option>
		<Option>nolist</Option>
	</Group>

User avatar
MochiMoppel
Posts: 2084
Joined: Wed 26 Jan 2011, 09:06
Location: Japan

#18 Post by MochiMoppel »

Keef wrote:I'm am using JWM, and have made no changes, but just checked _root_.jwmrc, and it has:

Code: Select all

<Group>
		<Name>xmessage</Name>
		<!-- <Option>icon:info16.xpm</Option> -->
		<Option>notitle</Option>
		<Option>nolist</Option>
	</Group>
:shock: This is WRONG! Not your fault. This strange setting exists already in ancient Puppy 4.3 and still exists in even the most recent Puppies. And no dev has ever bothered to change it?

This setting is meant for xmessage and not for gxmessage. At the time of Puppy 4.3 gxmessage did not exist, only xmessage. Since the <Name> tag expects regex syntax, <Name>xmessage</Name> matches any name containing "xmessage", so it unfortunately also matches "gxmessage"

xmessage had (and still has) very limited options and the <Group> setting made perfect sense. Nowadays /usr/bin/xmessage is symlinked to gxmessage and there is no good reason to use the original xmessage, but in many Puppies it still exists and can be used by masochistic or nostalgic minds:

Code: Select all

usage: /usr/X11R7/bin/xmessage [-options] [message ...]
where options include:
    -file filename              file to read message from, "-" for stdin
    -buttons string             comma-separated list of label:exitcode
    -default button             button to activate if Return is pressed
    -print                      print the button label when selected
    -center                     pop up at center of screen
    -nearmouse                  pop up near the mouse cursor
    -timeout secs               exit with status 0 after "secs" seconds

<Option>notitle</Option> renders gxmessage's -title option unusable. No problem for xmessage as no such option exists. Unlike xmessage gxmessage does not need JWM's "notitle" for removing the titlebar since it has a -borderless option.

If devs really see a need to provide a <Group> setting for an application that probably nobody uses anymore then the setting in JWM should be

Code: Select all

<Name>^xmessage$</Name>
matches only and exactly "xmessage" and not gxmessage or any other name containing the string "xmessage"

User avatar
Keef
Posts: 987
Joined: Thu 20 Dec 2007, 22:12
Location: Staffordshire

#19 Post by Keef »

I've got rid of the <Group> setting, so now have a title bar.
When you originally said version 2.14.4, did you mean 2.12.4? (can't find a 2.14.4 anywhere).
On 2.12.4 or 2.20.4, I still can't get the entry box to work when by clicking in the box when -nofocus is used. No blinking cursor at any point.
Tried on upupBB (which has 2.12.4), and also compiled 2.20.4 on it, but got same results.
As before, the gxmessage window becomes active (according to the colour of the title bar anyway) but input remains in the terminal.

User avatar
MochiMoppel
Posts: 2084
Joined: Wed 26 Jan 2011, 09:06
Location: Japan

#20 Post by MochiMoppel »

Keef wrote:I've got rid of the <Group> setting, so now have a title bar.
Good. Let's hope that Puppy devs do the same.
When you originally said version 2.14.4, did you mean 2.12.4?
Yes, sorry :oops:
On 2.12.4 or 2.20.4, I still can't get the entry box to work when by clicking in the box when -nofocus is used
Confirmed for 2.12.4. It's not gxmessage, it's the crappy JWM 2.3. One more reason for me to stay away from it. Newer is not always better.

Post Reply