Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Questions about xmessage and resources files

119 views
Skip to first unread message

Walter Dnes (delete the 'z' to get my real address)

unread,
Mar 21, 2009, 10:44:24 PM3/21/09
to
I'm running 32-bit Gentoo linux on a Dell X86. I am not a programmer,
but I can struggle through small C programs if need be. I'm in my late
50's and much more comfortable in FORTRAN, BASIC, PL/SQL, etc. A few
years ago I was trying to get by with an older machine with a lot less
memory/diskpace/etc than my current machine. I switched to blackbox WM,
and tried to find a simple program launcher. gnome-panel seems to want
to import 80% of GNOME's libraries. Every other launcher also wanted to
pull in a gazillion libs. I got pissed off enough to do some research,
and ended up writing my own "espl" (Extremely Simple Program Launcher)
script, which requires only xmessage. Even though I now have a more
powerful machine, I've gotten used to the minimalist approach, and stuff
flies a lot faster than it does under GNOME/KDE.

espl uses a ~/.esplrc config file like so, where the first word on each
line is a label, and the rest of the line is a program launch command...
========

4NEC2X wine start c:/windows/profiles/waltdnes/Desktop/4nec2X.lnk
AbiWord /usr/bin/abiword
Firefox /usr/bin/firefox -width 950 -height 1100 -P default -no-remote
Freecell /usr/games/bin/xfreecell
GIMP /usr/bin/gimp
GoogleSearch /usr/bin/firefox -P default http://www.google.com
gnumeric /usr/bin/gnumeric
xterm /usr/bin/xterm -geometry 80x55 -bg black -fg cyan -fn -*-fixed-medium-*-*-*-*-200-*-*-*-*-iso8859-1
Wideopen_ffox /usr/bin/firefox -width 950 -height 1100 -P wideopen -no-remote

========
The ~/bin/espl script is invoked from .xinitrc Here it is in its
entirety.
========

#!/bin/bash
commandline="xmessage -geometry 790x38+0-0 -buttons EXIT:1"
commandarray[1]=exit
buttonpointer=2
while read xlabel xcommand
do
commandarray[${buttonpointer}]=${xcommand}
commandline="${commandline},${xlabel}:${buttonpointer}"
buttonpointer=$(( ${buttonpointer} + 1 ))
done < ~/.esplrc
commandline="${commandline} -file /dev/null"
commandpointer=0
while [[ ${commandpointer} != 1 ]]
do
${commandline}
commandpointer=${?}
eval ${commandarray[${commandpointer}]} &
done

========
The first while loop reads parameters from ~/.esplrc and appends them
to the xmessage commandline, and also stores them in a command array.
When I click on the dialogue, the second while loop does an eval to
launch the command corresponding to the button I've clicked, plus it
restarts xmessage (unless I've clicked on the EXIT button).

I'd like to improve it a bit and I think that ~/.Xdefaults is probably
how it's done, but I don't know for sure.

- How can I set xmessage to be "always on top"? Right now, I have to
{ALT-TAB} to pull up xmessage if it's covered.

- How can I get rid of the border, including the top bar with the
maximize and close buttons? They're not necessary for this specific
use, and they take up screen space.

- Pretty colours would be a nice cosmetic touch.

- Finally, can someone point me to a tutorial on X resource files so
that I don't have to bug this group every so often? <G>.

--
Walter Dnes; my email address is *ALMOST* like wzal...@waltdnes.org
Delete the "z" to get my real address.

Jens Thoms Toerring

unread,
Mar 23, 2009, 4:23:07 PM3/23/09
to
"Walter Dnes (delete the 'z' to get my real address)" <wzal...@waltdnes.org> wrote:
> I'd like to improve it a bit and I think that ~/.Xdefaults is probably
> how it's done, but I don't know for sure.

> - How can I set xmessage to be "always on top"? Right now, I have to
> {ALT-TAB} to pull up xmessage if it's covered.

> - How can I get rid of the border, including the top bar with the
> maximize and close buttons? They're not necessary for this specific
> use, and they take up screen space.

All these are things you have to ask your window manager to do.
It's the window manager that puts the borders and the title bar
around your window and so that's were you have to set your pre-
ferences. Unfortunately, I haven't use blackbox WM, so I'm in no
position to tell you how to ask it nicely. Under fvwm2 you would
set a 'Style' for the xmessage program with e.g. !Title, !Borders
and StaysOnTop to get the desired effect. While a short look at
the blackbox documentation indicates that it's possible I didn't
try to find out all the gory details. See

http://blackboxwm.sourceforge.net/BlackboxDocumentation/BlackboxWindows#SpecialWindowFeatures

and look for "4.2) Toggling window decorations" and "4.5) Always
on top/bottom" - hopefully it makes sense to you;-)

> - Pretty colours would be a nice cosmetic touch.

That's going to be a bit difficult since only very few resources
are listed in the man page for xmessage. The only thing I can
think of is running 'editres' on the xmessage program and see
what resources one is able to identify. I just played around a
bit with it and found that (when put into the .Xresource file)

xmessage*form.background: green

allows you to set the background color of the form

xmessage*message.foreground: blue

sets the color of the text in the message box

xmessage*message.background: yellow

and this the background color. To set the color of the text
and the background of a button with the text '4NEC2X' use

xmessage*4NEC2X.foreground: red
xmessage*4NEC2X.background: yellow

Once you have put it into your .Xresoure file reload it using

xrdb -load $HOME/.Xresources

> - Finally, can someone point me to a tutorial on X resource files so
> that I don't have to bug this group every so often? <G>.

Is this

http://www.linuxdocs.org/HOWTOs/XWindow-User-HOWTO-8.html

of any use to you?
Regards, Jens
--
\ Jens Thoms Toerring ___ j...@toerring.de
\__________________________ http://toerring.de

Walter Dnes (delete the 'z' to get my real address)

unread,
Mar 24, 2009, 6:10:07 AM3/24/09
to
On 23 Mar 2009 20:23:07 GMT, Jens Thoms Toerring, <j...@toerring.de> wrote:

Thank you for the pointers and examples. That's exactly what I was
looking for. I apologize if you got an email reply, I tried to stop it,
but I may have been too late. I got confused with email.

--
Walter Dnes; my email address is *ALMOST* like wzal...@waltdnes.org

Delete the "z" to get my real address.

0 new messages