LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Linux Answers > Applications / GUI / Multimedia
User Name
Password

Notices

By Savet at 2008-10-30 20:51
Scope

This tutorial will go through the steps of starting a transparent, borderless, program in the background of a fluxbox session, that persists across virtual desktops and does not interfere with other windows.

aterm

You could use aterm or eterm, but eterm is a bit more bloated than I prefer, and Iike the way that aterm simulates xterm in its lack of menus. So, for this set of instructions, we will detail setting this up with aterm.

You can download the aterm source from:

http://www.afterstep.org/download.php

Once aterm is installed, we will want to find where aterm was installed to. To do this, we'll run:

Quote:
whereis aterm
On my machine, it returns:

Quote:
bash-3.1$ whereis aterm
aterm: /usr/local/bin/aterm
What we want to do now, is copy the executable to another filename, so we have two separate incarnations of aterm with different names. We'll detail why later on.

as root, run:

Quote:
cp /usr/local/bin/aterm /usr/local/bin/eek_a_unicorn
where eek_a_unicorn is your preferred filename.

Make sure that the program is executable by all users by running as root:

Quote:
chmod 755 /usr/local/bin/eek_a_unicorn
Now, we're going to tell fluxbox that our new file needs special behavior. Open ~/.fluxbox/apps with your favorite text editor, and add the following lines. If you don't have a ~/.fluxbox/apps file, make one. Ensure you are doing this under your user account, as we want the user to have read and write permissions on this file.


Quote:
[app] (eek_a_unicorn)
[Deco] {NONE}
[sticky] {yes}
[Position] {715 0}
[Layer] {12}
[FocusHidden] {yes}
[Tab] {No}
[end]
When you're done, save and exit the file. Let's discuss each of the options, as you may want to modify some of them.

Deco: Tells fluxbox what decorations to give. We're telling it we want none, including borders.

sticky: We're telling it we want the application to persist across desktops. With this option, no matter which virtual desktop you are on, the application follows.

Position: This tells it where to start. "0 0" would be the top left corner, and every positive number moves it's position by Height and Width. To find your desired location, start aterm and drag it to the desired position. Before releasing the window, fluxbox will display an X Y coordinate of it's current location. Use this value. I have mine loading in the upper right corner. This option supposedly also supports absolutes such as UPPERRIGHT, LOWERRIGHT, etc, but I was unable to use these values to change the location. If you wish to play with it, you might try different values of lower case, or capitalizing the first letter.

Layer: 12 tells it that we want it to be at the desktop level. This means that new windows will load over the top of it. Possible values are as follows:

Quote:
2 - AboveDock
4 - Dock
6 - Top
8 - Normal
10 - Bottom
12 - Desktop
FocusHidden: This tells fluxbox that when using the previous/next application buttons, we're going to ignore this application.

Tab: This tells fluxbox that when we cycle through applications using the alt-tab functionality, we're ignoring this application.

Now...remember how I promised I'd explain why we copied the program? The reason is simple. Every time this application loads, it will receive these properties. And if you're like me and use aterm for most of your terminal needs, you don't want them all borderless, hidden behind browsers, and following you across your desktops.

So now, we need to add eek_a_unicorn to our ~/.fluxbox/startup file. This will load our program when fluxbox is started.

You will want to add the following line:

Quote:
/usr/local/bin/eek_a_unicorn -bl -tr +sb -fg darkgray -e top &
...somewhere above the following line:

Quote:
exec /usr/bin/fluxbox
The options for our fie are as follows:

-bl Tells it we want it to be borderless. You're probably asking why we need this if we specified it in the apps file. Or why we even bothered with the apps file if we can declare it here. The answer is that in testing, I never bothered to take this out while editing my startup file. When loading the program at the start of fluxbox, it appears that fluxbox overrides this command and assigns a border regardless of your specification when starting the program.

-tr Tells it we want our new window to be transparent.

+sb Tells it we want no scrollbar. Alternatively, -sb forces a scrollbar

-fg Specifies the foreground (font) color. In my case, I want it to be darkgray so it is barely visible against the background image.

-sh Indicates the amount of shading you wish to have against the background image. This is helpful if you have a background with a lot of colors, and wish to darken it while leaving the image visible. If this is the case, use a brighter font such as white, light grey, green, etc. This option accepts values from 0 to 100. I have found 60 to be a comfortable level of shading.

-e This tells it what command to load. In my example, I'm running top to monitor the most resource intensive programs. If you have other scripts you wish to run, you can do so here...including no script at all by omitting the -e option. It is worth noting that the -e must be declared last, or it will not load correctly as it will attempt to run all remaining options as part of the command called by -e

& The ampersand symbol tells it we want to run the process in the background. If you do not do this, fluxbox will not start correctly.

If you've done everything correctly, your program will load at the correct position, follow you around like a puppy dog, and won't get in the way of your other programs. Also, unlike a wolf kept as a housepet, it won't claim ownership of your fridge by urinating on the front of it because he knows that's where you keep his chicken.

A picture of the final result:
http://farm4.static.flickr.com/3043/...ccf54b00_o.jpg


  



All times are GMT -5. The time now is 03:26 AM.

Main Menu

My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration