Search:  
Gentoo Wiki

TIP_Console_Text_on_the_Desktop_using_Eterm

This article is part of the Tips & Tricks series.
Terminals / Shells Network X Window System Portage System Filesystems Kernel Other

Contents

General

Ever wondered how people get console-text on the desktop?

Here is how to do it with KDE and Eterm:

kstart --skiptaskbar --skippager --alldesktops --onbottom Eterm -x -O --buttonbar no --scrollbar no \
--no-cursor yes --geometry 80x25+5+20 -e "command here" &

Most flags are self-explainable. Read the man-pages to learn more about customization. Replace command here with your command, and 80x25+5+20 with the coordinates you find fitting for your desktop. If it does complain about not setting the --window or --windowclass, just set it to kdesktop or maybe you would like to do the following:

xprop |grep WM_CLASS 

and then click on a empty space on the desktop and use the value with the --windowclass flag of kstart.


Here are some nifty ways to use it:

fortune: A very core part of the unix-system, Fortune on the desktop may give you more insight in life. Replace "command here" with

watch -tn 60 fortune

To make a new quote appear on the desktop once a minute. Note that watch doesn't hide the text-cursor. Anybody know how to get a rid of that?

RSS-feeds: Nice to have the news on a real terminal instead of using extensions like karamba? This is taken from Dave Taylors Tapping RSS with Shell Scripts. Make a shell-script like this:

url="http://slashdot.org/index.rss"
curl --silent "$url"|\
egrep "(title>|description>)"|\
sed -n '4,$p'|\
sed -e 's/<title>/\n/' \
-e 's/<\/title>//' \
-e 's/<description>/  /' \
-e 's/<\/description>//'|\
head -n 12|\
fmt

And use it with the above code. This way it only updates when Eterm is launched. Replace 12 (in head) with the number of headlines you want times 3. Remove |description (in egrep) to make only the headlines appear. Note: To stay popular with the owners of the feeds, do not update it too often. Most sites only updates this once an hour. Add a cron job fetching the feeds once per hour, and storing them locally.

Personally I have a shell-script to each site I want, and made one script start another. This way, it also hides the text-cursor:

clear
egrep "(title>|description>)" site1.rss|\
sed -n '4,$p'|\
sed -e 's/<title>/\n/' \
-e 's/<\/title>//' \
-e 's/<description>/  /' \
-e 's/<\/description>//'|\
head -n 12|\
fmt
sleep 10
exec ./script2

You may want to use an XML-parser instead of this way. Try to look at Dave Taylor's article. Its excellent.

There are dozens of possibilities out there, the same as with the rest of the desktop extensions - but it's more fun to make it yourself.

Try to mess around with it!


IceWM and Eterm Console Desktop

Here's how to get console text to come up in icewm at startup:

In $HOME/.icewm, create a scripts directory and some scripts:

 mkdir scripts
 touch startup
 touch scripts/dcconfig
 touch scripts/desktopconsole.sh
 chmod a+x startup scripts/dcconfig scripts/desktopconsole.sh
 

Have startup contain the following:

 #!/bin/bash
 sleep 5
 $HOME/.icewm/scripts/desktopconsole.sh &

Have scripts/dcconfig contain the following:

 #!/bin/bash
 /usr/bin/icesh --window focus setLayer Desktop
 /usr/bin/icesh --window focus setTrayOption Exclusive
 /usr/bin/icesh --window focus toggleState Maximized
 /usr/bin/icesh --window focus toggleState AllWorkspaces
 exec /bin/bash --login

Finally, Have scripts/desktopconsole.sh contain the following:

 #!/bin/bash
 STARTUP_SCRIPT="$HOME/.icewm/scripts/dcconfig"
 while true; do
   Eterm --trans -x --scrollbar=off --buttonbar=off -e $STARTUP_SCRIPT
   sleep 2
 done

Now, once you kill and restart x, you will have a terminal as your desktop. If you accidently exit out, it will come right back in 2 seconds.

Fluxbox and Eterm Console Desktop

In ~/.fluxbox/apps parameters for an application can be specified. If you run an application with the specified name (pin2desktop in our case) the program will take the specified settings. To pin an application to the desktop we specify specific parameters for pin2desktop. add the following lines to ~/.fluxbox/apps .

[app]  (pin2desktop)  
  [Sticky]      {yes}  
  [Layer]       {12}  
  [Hidden]      {yes}     # hide it from the iconbar 
  #some optional parameters
  [Dimensions]  {660 474} # it just fits nicely for me
  [Position]    {0 0}     # put it in the upper left corner 
  [Deco]        {0x1c0}   # forgot what it did :)
[end]

More options can be found in man fluxbox in the paragraph application settings Now, any application called pin2desktop will be pinned to the desktop. We can have Eterm use these parameters by using Eterm --name pin2desktop when starting Eterm. To have an instance of Eterm with these parameters run on startup add the following line to ~/.fluxbox/startup .

# Applications you want to run with fluxbox.
# MAKE SURE THAT APPS THAT KEEP RUNNING HACE AN “&” AT THE END.

Eterm --name pin2desktop &

I like to add the following options to this instance of Eterm aswell:

Eterm --name pin2desktop --shade 0 --buttonbar false –w 3 -x&

These additional options can be found in Eterm --help.

I use 2 instances of Eterm with a transparent background. (Add a second pin2desktop2 to apps with a different position and add Eterm --name pin2desktop to startup) It looks really cool, and it is great to work with. You can add shading with --shade if you have a light background. Change the dimensions a bit if you have some black borders.

Note: you can also use the apps thingy for all sorts of nifty stuff like when running applications from the menu

Note: fluxbox uses apps when you have it remember stuff about applications. It gave me some trouble by overriding my changes. Just edit the files while not running fluxbox to some it.

Tip: if you set an Eterm instance for output only, you can use it to display all sorts of nice information from scripts like rss feeds.

Author

meldar
6to ne si ebe6 maikata a ?

See Also

Original Gentoo Forum Post

Retrieved from "http://www.gentoo-wiki.info/TIP_Console_Text_on_the_Desktop_using_Eterm"

Last modified: Sat, 11 Oct 2008 21:55:00 +0000 Hits: 23,820