Linux Blog

Awesome Piping

Filed under: General Linux,Quick Linux Tutorials — Kaleb at 8:01 am on Wednesday, April 23, 2008

Have you ever wanted to try a tiling window manager. But maybe you don’t want to deal with DWM and its bad config setup that forces you to recompile the app each time you change the config.

I suggest to you AwesomeWM. It was originally based on DWM, however now it is completely on its own. For those of you who don’t know, tiling window mangers are window managers that basically allow you to use ALL of y
our screen. If screen landscape is scarce on your box i suggest a tiling window manager. How do they do this? Its all about managing windows baby. What they do is they make every window you open full screen. that
s right FULL screen and if you open up more then one window in one virtual desktop it cuts them in half so that they are each using half the screen, and so on.

But this article is not about tiling window managers exactly it is about piping in awesome. The AwesomeWM has a status bar that you can edit which by default holds a list of your “tags” (virtual desktops however with a little bit different technique) and a window list of all the windows open on your current tag. However you can edit what is on this status bar with the .awesomerc. Now your asking yourself what can I put on i
t, does it have special keywords like conky or something? The answer is no. it works nothing like conky, however if you do it right you can completely replace conky.

Now how to do this. Open up your .awesomerc file with your favorite editor (i suggest vi or vim, and if you don’t know those why are you even at this site). Now you will see a bunch of lame stuff right, well you need to scroll down to the “status bar” section, this section strangely holds all the things that you will place on your status bar (the status bar section is repeatable so you can have more then one status bar as long as the name is changed).

Now with me I do not like having a list of running windows on my status bar, so I just remove that section,but I do like to have a clock on my status bar, I would assume you would like it to however I don’t know.

At first look it will seem a little complicated to make just a simple clock, but its actually not that bad once you get the hang of it.

What you need to do, for a clock, is create a “textbox” section (yes the time is TEXT strange eh).
It should look something like

textbox clock
{
text=” ”
}

the space between the “” is supposed to be a space so don’t worry about that. Now after you have this set up you are done messing with your .awesomerc. “clock” is now a keyword that you can use to pipe the clock t
o that part of your status bar.

Next what your going to want to do is create a little shell script for rendering your clock it should look something like:

#!/bin/bash

echo “0 widget_tell mystatusbar clock text `date +”%A %B %d, %Y %l:%M %p”`” | awesome-client

Now that is really complicated right. Well not really.

Honestly I have no idea what “0 widget_tell” does, I am assuming is just telling the status bar what to do.

Next in the list you have “mystatusbar” that is the name of your status bar, you should probably know the name of it.

Next should be obvious “clock” is the section of your status bar you want the data to be ported to.

After that comes “text” this just tells it that it is text and not some other type of data.

Then, inside the “ is the command you want to run. This is just the date command that has been modified to output the date in a specific format, it will output the date and time like this “Friday April 18, 2008
2:23 PM”

If you want it in a different way look at “man date” for help (its really simple).

Finally in the command you have “| awesome-client” this will pipe the command to awesome.

Now you need to have this script run on a regular basis, some people do this as a “while true” thing in there .xinit or something however since this is just a clock that only tells me minutes I use the crontab to
run this script every minute. A crontab to run this every minute should look like:
*/1 * * * * ~/scripts/clock.sh
Do all of this and you should have an up and running clock in no time. And like I said before you can put anything you want into this. Even graphics. So now that you know the basic stuff go make a pretty status bar.

Kaleb Porter

porterboy55@yahoo.com

http://kpstuff.servebeer.com (website is temporarily down)

Graphical Shell Scripting

Filed under: Shell Script Sundays — TheLinuxBlog.com at 4:07 pm on Sunday, December 16, 2007

From all of my other previous shell scripting articles you can see that shell scripting is a very good way to get a task done or to automate. This is great but some times a little bit of that three letter acronym “GUI” is a nice touch. Well my friends, if you’ve been reading my articles and following my dialog examples then you are in luck. If not don’t worry, you can view all of the articles in the Shell Script section to the right.

The program to make your GUI’s for your shell scripts is the exact same thing as dialog except its graphical. Its called Xdialog. Once installed you basically use it the same way as dialog. If your thinking about upgrading a script thats written in dialog you might want to think twice because some window managers will display the windows differently.

Check out these Xdialog examples and corresponding screenshots:

Xdialog
 
Xdialog -yesno "Do you like Xdialog?" 5 50 && echo "Thats nice" || echo "Yea, some times its better to stick to CLI"

Xdialog ExampleXdialog Example

KDE Wall Paper Contest

Filed under: General Linux — TheLinuxBlog.com at 8:56 am on Thursday, August 2, 2007

A wall paper contest was posted this morning on Digg and many other blogs. The contest is simple, upload wall papers that you created and you have the possibility of getting them included in the next release of KDE.

After viewing the blog and homepage of the link submitted in the article, I was a bit skeptical as to whether this was just a scheme for a blogger to get some publicity, so I did some research. Turns out that Riccardo Laconelli is not listed in the main credits for the KDE project, but is listed in the KDE lists [lists.kde.org]. It also seems as if he is the developer of the Oxygen theme and has committed various icons to the KDE project.

Should you participate in this contest?

I believe if you have any artistic skills that you should design a wall paper and submit it to the competition. For your efforts you may have your wall paper included one of the most popular window managers and it will make you feel good for contributing. If you enter the competition and your entries are not specific to KDE I urge you to also post your wallpapers on your own site/blog/photo gallery and other Linux wall paper sites. Some people like to be able to use wall papers on other window managers. If I had any artistic skills I would most defiantly be entering this competition myself.

KDE Wallpaper Contest is [http://pd.ruphy.org/]