Page 1 of 2

How to make gxmessage always on top?

Posted: Sat 20 Apr 2013, 16:17
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!

yaf-splash

Posted: Mon 22 Apr 2013, 18:12
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.

________________________________________

Posted: Mon 22 Apr 2013, 22:07
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.

Posted: Tue 23 Apr 2013, 01:31
by Subito Piano
Thanks, guys! :-)

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

Posted: Tue 23 Apr 2013, 02:17
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?

Posted: Sat 27 Aug 2016, 12:30
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:

Posted: Sat 13 Oct 2018, 02:57
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?

Posted: Sat 13 Oct 2018, 09:49
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

Posted: Sat 13 Oct 2018, 10:03
by MochiMoppel
My question was rather if it is installed, not if it can be installed

Posted: Sat 13 Oct 2018, 11:28
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.

Posted: Sun 14 Oct 2018, 03:13
by MochiMoppel
Thanks for your research. I find the results a bit disappointing :(
Just curious: Does -nofocus work in Easy?

Posted: Sun 14 Oct 2018, 12:58
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"

Posted: Sun 14 Oct 2018, 14:26
by MochiMoppel
Keef wrote:...but stays in the terminal with:

Code: Select all

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

Posted: Wed 06 Mar 2019, 08:24
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.

Posted: Wed 06 Mar 2019, 19:28
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.

Posted: Thu 07 Mar 2019, 02:23
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?

Posted: Thu 07 Mar 2019, 07:45
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>

Posted: Sun 10 Mar 2019, 09:43
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"

Posted: Sun 10 Mar 2019, 18:30
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.

Posted: Mon 11 Mar 2019, 01:57
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.