Performance monitoring with a transparent borderless window in Fluxbox
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
By Savet at 2008-10-30 20:51
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.
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.
Make sure that the program is executable by all users by running as root:
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.
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:
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:
/usr/local/bin/eek_a_unicorn -bl -tr +sb -fg darkgray -e top &
...somewhere above the following line:
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.