Using XTerm comes with little advantage, it is possible to scroll into the “backlog” and make text selections. On a downside, it won't let you click through into the desktop, therefore it is rather useful for people without desktop icons for example.
We will proceed with a first simple example, by writing a Shell script that will use the combo DevilsPie and XTerm. The terminals will all be kept in the background below other windows and never take the focus thanks to DevilsPie. DevilsPie is a tool watching the creation of new windows and applies special rules over them.
Obviously, you need to install the command line tool
devilspie. It's a command to run in the background as a daemon. Configuration files with a
.dsextensions contain matches for windows and rules that are put within the
First exampleThe first example shows how to match only one specific XTerm window.
The DevilsPie configuration:
(if (is (window_class) "DesktopLog") (begin (wintype "dock") (geometry "+20+45") (below) (undecorate) (skip_pager) (opacity 80) ) )
devilspieis running, and spawning a single
#!/bin/sh test `pidof devilspie` || devilspie & xterm -geometry 164x73 -uc -class DesktopLog -T daemon.log -e sudo tail -f /var/log/daemon.log &
To try the example, save the DevilsPie snippet inside the directory
~/.devilspie, and download and execute the Shell script. Make sure to quit any previous DevilsPie process whenever you modify or install a new
Second exampleThe second example is a little more complete, it starts three terminals of which one is coloured in black.
(if (matches (window_class) "DesktopLog[0-9]+") (begin (wintype "dock") (below) (undecorate) (skip_pager) (opacity 80) ) ) (if (is (window_class) "DesktopLog1") (geometry "+480+20") ) (if (is (window_class) "DesktopLog2") (geometry "+20+20") ) (if (is (window_class) "DesktopLog3") (geometry "+20+330") )
#!/bin/sh test `pidof devilspie` || devilspie & xterm -geometry 88x40 -uc -class DesktopLog1 -T daemon.log -e sudo -s tail -f /var/log/daemon.log & xterm -geometry 70x20 -uc -class DesktopLog2 -T auth.log -e sudo -s tail -f /var/log/auth.log & xterm -fg grey -bg black -geometry 70x16 -uc -class DesktopLog3 -T pacman.log -e sudo -s tail -f /var/log/pacman.log &
NB: You will probably notice that setting the geometry is awkward, specially since position and size are in two different files, getting it right needs several tweakings.
This blog post was cross-posted to the Xfce Wiki.
If you don't want a daemon running all the time, you can also use wmctrl, or xdotool. Just create a script ala:ReplyDelete
app - args &
wmctrl -r wintitle -e 0,x,y,w,h
wmctrl -r wintitle -b add,skip_taskbar
i like devilspie, i use it to keep AWN (with "invisible" style) above xfce4-panel and to reduce cairo-clock opacity. But writing scripts for it is an unnecessary pain in the ass, since it's much easier to use gdevilspie (front-end):ReplyDelete