Quake like aterm GameConsole and transparency

Hello

I defined a GameConsole (or HiddenConsole à la taviso) using an aterm.

In my .Xdefaults file, my aterm is set transparent with:

Aterm*foreground: white Aterm*background: black Aterm*loginShell: true Aterm*transparent: true Aterm*shading: 15 Aterm*saveLines: 1000 Aterm*fading: 80 Aterm*cursorColor: white Aterm*scrollBar: false

I use the following function bounded to a key to start the Gameconsole:

[code]DestroyFunc StartTerminal
AddToFunc StartTerminal

  • I Exec exec aterm -geometry 144x20+0+0 -name GameConsole
  • I Wait GameConsole
  • I All (GameConsole) Resize 101 keep
  • I SetEnv OpenedTerm “True”
    [/code]

The problem is that this console isn’t transparent at all! If I remove the parameter “-name GameConsole” the transparency is back! As well When I restart fvwm, the GameConsole become transparent during the restart process.

Any idea, what’s wrong?

Regards, Brice

It’s because by changing the -name of aterm it sets the resource to something other than what you have it listed in ~/.Xdefaults file as (i.e. something other than aterm). Leaving off the ‘-name’ option, as you observed, causes it to work only because aterm defaults to aterm.

Use FvwmIdent for this if you like.

– Thomas Adam

A simple fix could be to use command line options :

aterm -tr -sl 1000 -shading 15 -fade 80 +sb

I tried to put something like GameConsole*transparent: yes in my .Xdefaults file (GameConsole being the resource given by FvwmIdent), as well as the zonk trick but none worked!

Brice

You have to run:

xrdb < ~/.Xdefaults

– Thomas Adam

I did of course but no change at all…

Brice

I got it by using an Eterm instead of an aterm. Dunno why it isn’t working correctly with aterm.

Brice

You can simply use the -title argument of aterm to uniquely tag the console and then use fvwm commands on it, e.g.

+ I Exec exec aterm -title GameConsole -geometry +0+0
+ I Wait GameConsole
...

It doesn’t work too! No transparency at all

Brice

Using FvwmIdent I get:

Name: GameConsole
Icon Name: GameConsole
Class: XTerm
Resource: aterm
...

I have in my .Xdefaults:

aterm*termName: xterm
aterm*transparent: true
aterm*shading: 10
aterm*geometry: 159x61
aterm*title: Konsole
...

This works for me.

It will do, although the ICCCM is quite specific about how the resource of a window is set. If one uses the -name flag, then the resource should be set to the name given.

– Thomas Adam

Let me make it clear, I’ll give the whole code:

.Xdefaults:

[code]Atermgeometry: 80x24
Aterm
foreground: white
Atermbackground: black
Aterm
loginShell: true
Atermtransparent: true
Aterm
shading: 15
AtermsaveLines: 1000
Aterm
fading: 80
AtermcursorColor: white
Aterm
scrollBar: false

GameConsoleforeground: white
GameConsole
background: black
GameConsoletransparent: true
GameConsole
shading: 15
GameConsolesaveLines: 1000
GameConsole
fading: 80
GameConsolecursorColor: white
GameConsole
scrollBar: false
[/code]

The fvwm functions:

[code]DestroyFunc ToggleTerminal
AddToFunc ToggleTerminal

  • I SetEnv OpenedTerm “False”
  • I None (GameConsole) StartTerminal
  • I All (GameConsole) Focus
  • I All (GameConsole) Raise
  • I All (GameConsole, Shaded) WindowShade False
  • I TestRc (NoMatch) SetWindowShadeTrue

DestroyFunc StartTerminal
AddToFunc StartTerminal

  • I Exec exec Eterm --geometry 144x25+0+0 --name GameConsole
  • I Wait GameConsole
  • I All (GameConsole) Resize 101 keep
  • I SetEnv OpenedTerm “True”

DestroyFunc SetWindowShadeTrue
AddToFunc SetWindowShadeTrue

  • I Test (EnvMatch OpenedTerm False) All (GameConsole) WindowShade True

Key ampersand A MS ToggleTerminal
[/code]

Of course at start I execute a xrdb -merge ~/.Xdefaults.

Brice

I seem to recall Eterm needing Esetroot enabled for transparency? Note that the other resource lines work just fine for --name GameConsole, so you might need to check that. Also whilst I am here, let’s change your functions so that they’re a little more… stream-lined:

[code]DestroyFunc ToggleTerminal
AddToFunc ToggleTerminal
#+ I SetEnv OpenedTerm “False”

  • I None (GameConsole) StartTerminal
  • I Next (GameConsole) Focus
  • I Next (GameConsole) Raise
  • I Next (GameConsole, Shaded) WindowShade False
  • I TestRc (NoMatch) Next (GameConsole, !Shaded) WindowShade True
    [/code]

The SetEnv here is useless, since you can just use “None” to check for the presense of a window anyway. Note that for the next three ‘Next’ lines above, you could refactor them into a single line which does those three operations as a function call. It’s up to you. Note the use of “Next” as opposed to “All”. This is important, and a fundamental mistake people seem to make. There’s nothing wrong with it, but it will affect ALL window, including the window just opened. Using Next ensures only the opening window is affected. 99% of times, this is generally what people mean to use when they’re doing something like this.

Again in the above, just change “All” to “Next”, and remove the SetEnv line. Your SetWindowShadeTrue function is no longer needed.

– Thomas Adam

I am trying to implement the same thing, and have it working, except for the transparency thing. I have noticed that aterm is reading the Xdefaults file if you specify GameConsole*: (I was changing the font), and when you restart Fvwm with the concole running, it does honor the transparency setting as defined in Xdefaults or the command invocation. As soon as you close/reopen the GameConsole though, you lose the transparency and have to restart Fvwm to get it back. I’m not sure where this can changed, but it seems like it might have something to do with the console starting shaded and not being able to grab the bg. I dunno. Thanks for the tips and help thomas_adam, zonk, and cstorm.

maybe sending the terminal window a self-update message request will help, e.g. by moving the terminal a few pixels forth and back or by fiddling around with Xlib a bit.
i myself start the terminal on another, unused desk to which i cannot manually navigate and then use the MoveToDesk command to make it appear on my current desk/page. if you have different wallpapers on different desks/pages this, however, could pose some problems.

you’re welcome.

As I mentioned to acercanto via IRC, it’s most likely that aterm isn’t handling Expose events very well.

– Thomas Adam