May 16, 2009

Sticky xfce4-terminal in Fluxbox

xfce4-terminals do not want to stay in any one place on the desktop. Upon closing and reopening of the terminal, it defaults to whatever plan the xfce4-terminal uses . Using the manager tweaks for 'smart placement' in xfce4 will not affect placement in Fluxbox.
Luckily, Fluxbox has a way to control every aspect of the desktop, including telling xfce4-terminal to stay put.

Here's how to use an instance of xfce4-terminal in your root window with transparency, and how to keep it there every time you reopen it.

This is based on settings I use, and can easily be changed by everybody to suit thier needs.

First go into xfce4-terminal preferences, by opening a terminal, and 'rightclicking' in any empty space.
Goto preferences > appearance, set background for 'transparent background' and set the slider dead middle (good start place).

The terminal colors can be adjusted here as well. Disable the scrollbar as well since mouse wheel-scrolling is enabled by default.
In order to keep the transparency level the same for both the standard xfce4-terminal, and the new StickyTerm, I am setting it in preferences as well.

No need to 'un-check' anything else. Options for ShowDisplay, ShowToolbars, and ShowBorders, can be adjusted from the ~/.fluxbox menu when we add the entry for the StickyTerm. Doing it this way, only the StickyTerm is affected.

When you edit your Fluxbox menu, you can isolate other options for the xfce4-terminal. Look at 'man xfce4-terminal' and 'xfce4-terminal -h' for other options.

Next, close any open xfce4-terminals, and open ~/.fluxbox/apps.
This is where fluxbox stores certain application settings, and we gotta delete a few:) You can choose to only delete the entries for xfce4-terminal s if you like, or, you can delete all of the contents.
No worries here. Fluxbox automatically changes these all the time. You will not destroy anything.

This file is saving the position and size placement settings for all of the windows that you may have resized or changed in some way during a fluxbox session. This does not affect the sane defaults of Fluxbox. It is regenerated automatically.

If there is nothing in apps, it is because you have not specified anything to save by 'right-clicking' on one of the Fluxbox window menu bar and selecting save on close.
Copy and paste this into ~/.fluxbox/apps to freeze all instances of xfce4-terminal in one position on the desktop.

[app] (name=xfce4-terminal)
[Position] (UPPERLEFT) {24 100}
[Sticky] {yes}
[Close] {no}

Then save and close ~/.fluxbox/apps. This should be done while all terminals are closed to avoid file contamination of the position.
The code entered is telling Fluxbox to open any instance of xfce4-terminal in the same place on your desktop, and to maintain this as default.

One thing to note here is:
I cannot isolate the sticky terminal placement from the other terminal placements. This will open ALL of them at the same start point on your desktop, with no cascading.
This won't matter if you leave at least the border settings checked in preferences, or have keys set up to move windows, or have some other way to move other terminal instances away from the inbedded one.

( look in the keys guide for key settings to move windows around.

Also remember that you may exit a terminal with no buttons, by typing 'exit' and hitting enter.

Add this line to your ~/.fluxbox menu to start a sticky terminal from the menu:

[exec] (""StickyTerm"") {/usr/bin/xfce4-terminal --geometry=50X12 --hide-borders --hide-menubar --hide-toolbars}

This sets the size, and hide options for StickyTerm only. You can still change the settings for other instances of the xfce4-terminal as well by rightclicking on any empty space in the terminal window, >preferences. . . Explore.

Save the Fluxbox menu, close, and enjoy.

You can find other terminal options in ~/.config/terminal/terminalrc.
You can also add a line to ~/.fluxbox/startup to have the StickyTerm start when Fluxbox does.

exec /usr/bin/""xfce4""-terminal --geometry=50X12 --hide-borders --hide-menubar --hide-toolbars &

Please comment if you are using this  'how -to'.  All suggestions and comments welcome.

Click Here!