2003.11_Desktopia-Ion-a Window Manager that Tiles Applications.pdf

(2057 KB) Pobierz
Layout 1
LINUX USER
deskTOPia
Jumping Tasks
Many modern window managers are overloaded with features. Ion concen-
trates on the essentials and breaks new ground in doing so. This is a must for
keyboard fans. Rather than burying your screen under a mountain of different
window tasks, Ion cleverly tiles then onto the screen.
BY ANDREA MÜLLER
unmanageable with all of those over-
lapping windows? Ion provides a GUI
comprising of multiple Frames tiled
adjacently or vertically. Each frame can
contain multiple application windows,
so-called Clients. This takes the Ion win-
dow manager [2] a step further than
pwm [1], which was also authored by
Tuomo Valkonen, and also allows you to
run multiple applications in a single win-
dow frame.
version requires the Lua [3] program-
ming language (see Box 1 for details on
installing Lua ). Apart from that, Ion is
quite frugal in its use of resources, and
requires on the libltdl library from the
libtool package, version 1.4.3 or later.
After installing Lua, it’s time to install
Ion itself. To do so, unpack the source
code by typing tar -xzf ion-devel-
20030627.tar.gz and change to the new
ion-devel-20030627 subdirectory created
by this step. However, before you start
compiling the window manager, you will
need to edit system.mk to suit your
requirements. Listing 1 provides an
example that shows you how to modify
the installation path and disable Xin-
erama support. Typical alternatives to
the defaults are available in the file; you
just need to remove the hash sign (#) for
the required options and add them to the
appropriate standard lines.
Yo u can now type make depend and
make to compile Ion. Assuming that you
are root , make install will then install
your new window manager to /usr/
local/.
Unfortunately, there is no patent
recipe for launching Ion. As an example,
you would configure the kdm login man-
ager for your distribution using the KDE
control center, adding a new type called
Ion under System Administration /
Login manager / Sessions .
If you do not use a GUI login manager,
you will need to edit the file appropriate
to your distribution – check the manual
to find out which file this is. For most
systems, an entry such as exec
/usr/local/bin/ion in ~/.xinitrc should
do the trick, and allow you to launch the
window manager of your choice when
you enter the startx command.
By default. Ion uses run-mailcap as an
editor and file viewer. Unfortunately, this
program is not available for many distri-
butions. To ensure that the view and edit
function keys actually provide the
expected functions, add the following
(you will need root privileges):
Installation – Special Request
Only
Unfortunately, of all the major distribu-
tions only Debian provides Ion packages;
this means working with a compiler on
most other systems. The latest developer
version of the Ion window manager
proved so stable in our lab tests that we
prefer to use it rather than the stable ver-
sion, which is fairly ancient by now,
dating from February 2002. There is a
downside, however, as the developer
Box 1: Installing Lua
The Lua programming language is mainly
used for configuring other programs. It is
typically embedded in another program that
will call Lua functions to perform specific
tasks. Ion leverages this capability when a
user calls a window action by pressing a key-
board shortcut. For example, [Alt-a] adds
another window to the active frame. You can
achieve the same effect by pressing [Alt-F3]
to open a Lua command line and type
QueryLib.query_attachclient(_) .
Lua does not come with a configure script, so
you will need to edit the config file in the
lua-5.0 directory, after launching tar -xzf lua-
5.0.tar.gz to unpack the tarball. The individ-
ual lines in the config file are well
documented.
Now go on to compile and install Lua using
the following commands:
make
make so
su
Enter your root password
make install
make soinstall
The make so and make soinstall are not typi-
cally required, but install the shared libraries.
deskTOPia
Only you can decide how your desktop
looks. With deskTOPia we regularly take you
with us on a journey into the land of win-
dow managers and desktop environments,
presenting the useful and the colorful view-
ers and pretty toys.
82
November 2003
www.linux-magazine.com
Ion
I s your desktop too cluttered or
593051614.006.png
deskTOPia
LINUX USER
#!/bin/sh
exec xterm -e vim "$1" > U
/dev/null
scale tiled windows that you have
created in this way; alternatively,
click on the border of the window
and, holding down the left mouse
key, drag the window to the
required size (see Figure 3). If
you want to move an application
to another frame, press down the
center mouse key, drag the appli-
cation tab to the target frame and
drop the tab.
You can navigate the frame
landscape by pressing [Alt-p]
(up) and [Alt-n] (down), and
press [Alt-Tab] to jump to adja-
cent frames. If things start to get
cluttered, you can press [Alt-
Enter] to expand a frame to full-screen
display on a new desktop. Pressing [Alt-
Enter] a second time reverts to the
normal display and packs the program
away in its original frame. [Alt-c] allows
you to remove applications and superflu-
ous frames.
to the /usr/local/share/ion-
devel/ion-edit file and the
following to /usr/local/share/ion-
devel/ion-view:
#!/bin/sh
exec xterm -e less "$1" > U
/dev/null
This example specifies vim as your
editor and less as your viewer, but
you can modify both commands as
required.
Figure 1: Use the tabs to toggle between the programs in a frame
A Special Kind of Desktop
After all that installation work, you
might be in for a disappointment when
you launch Ion for the first time: an
empty frame is all you get, and clicking
will get you nowhere. Ion will support
your mouse, but the easiest way of con-
trolling the window manager is to use
the keyboard (Table 1 contains a list of
major functions). The commands fol-
lowed by (CL) for command line, tell Ion
to open a command line for further inter-
action.
To get started, you might like to press
[Alt-F1] to open the Ion manpage that
provides a description of Ion’s naviga-
tional commands. [F2] opens an xterm
in a new tab (see Figure 1). Now the
frame has more than one tab, you can
actually do something useful with your
mouse, that is, click to switch tabs.
Alternatively, use the keyboard shortcut
[Alt-k] [n] to jump to the next window in
the current frame.
Press [F3] to launch a program, such
as the Mozilla Web browser for example.
This opens a command line at the bot-
tom of the screen, allowing you to type
the required command. A [Tab] based
auto-complete function just like in the
Shell will save you a lot of typing (see
Figure 2), and you can press [Ctrl-c] if
you change your mind. Prepend a colon
to launch text-based applications that
run in a terminal window, for example:
My Desktop Collection
You are bound to run out of space
sometime, no matter how big your
screen is. In this case, press [F9] to open
a command line that allows you to jump
to an existing desktop or create a new
one. Pressing [Tab] on the command line
displays a list of the current desktops. If
you specify a name that is not on the list,
Ion will create a desktop with that name.
You can also press [Alt-left arrow] and
[Alt-right arrow] instead of [F9] to
navigate the current desktops.
:mutt
Effective Diversity
A single large frame may make sense for
a browser, but there are situ-
ations where you need to
monitor multiple programs.
The keyboard shortcut [Alt-
s] splits the current frame
horizontally; to split verti-
cally press [Alt-k] [s]
instead. You can split frames
as many times as you like,
the only restriction being
your screen size.
Pressing [Alt-r] and then
the arrow keys allows you to
Listing 1: system.mk
#Installation path
PREFIX=/usr/local
[...]
#Disable Xinerama support. If you
intend to run Ion on a multiple
screen System,
#leave the default
#XINERAMA_LIBS=-lXinerama
DEFINES += -DCF_NO_XINERAMA
Figure 2: The Ion command line has an auto-complete function
GLOSSARY
Compiler: A program that translates source
code to binary object code. This step is neces-
sary before running a program written in a
language like C or C++.
Shared libraries :Program libraries that have
a similar function to Windows DLL files. Pro-
grams load the functions they need at
runtime, thus saving hard disk space and
memory.
Xinerama: A XFree86 extension that allows
you to create a desktop that spans multiple
screens.
www.linux-magazine.com November 2003
83
593051614.007.png 593051614.008.png 593051614.009.png 593051614.001.png 593051614.002.png
LINUX USER
deskTOPia
If you need an application from
another desktop, there is no need to
search for it: [Alt-a] opens a command
line where you can use the auto-com-
plete function to select and access the
required window.
Although a frame based approach is
practical, a desktop that allows you to
move windows arbitrarily is better suited
to some applications. The Gimp is one
example of this. When working with The
Gimp you typically want to have multi-
ple windows on view simultaneously
and at user-definable positions. The
good news is that Ion supports so-called
floating desktops with applications like
The Gimp in mind. Floating desktops
provide similar functionality to many
other window managers. However, this
mode is not accessible by shortcut in
contrast to the tiled desktop. Instead,
press [F9] and type the following in the
command line
WFloatWS:NAME
where NAME is the name of
the new desktop. Then press
[F2] to launch xterm and call
your programs. You can group
windows in this mode by
holding down the center
mouse key and dragging the
title bar of a window to
another active application
(see Figure 4).
You are in for a treat next
time you start Ion, as the win-
dow manager saves and
restores your desktops and
frame arrangements without launching
the programs that you were running
when you quit the previous session.
Figure 4: Two programs in a floating window
To modify the desktop to suit your own
personal requirements, copy the ion-
core.lua file from this directory to
~/.ion-devel/ and modify it to reflect
your requirements. If you want Ion to
display the frame contents while you are
resizing a frame, for example, replace
FALSE with TRUE in
Settings
Ion’s default configuration is stored in
the /usr/local/etc/ion-devel/ directory.
enable_opaque_resize(FALSE)
You do not need an editor to change
Ion’s color scheme, however. Ion pro-
vides a number of new outfits as look
files in the configuration directory. Sim-
ply create a symbolic link called
draw.lua for the required look in the
~/.ion-devel/ directory. To imitate the
style we used for our screenshots, enter
the following
ln -sf /usr/local/etc/ion-devel U
/look-greyviolet.lua U
~/.ion-devel/draw.lua
Ion should now sport a gray/violet color
scheme when next launched.
GLOSSARY
Figure 3: Use the tiling functions to create variable-sized frames
Symbolic link: An entry in a filesystem that
looks like a normal file or directory but actu-
ally points to a file or directory located at a
different position in the filesystem.
Table 1: Major Shortcuts
Key
Function
[Alt-Arrow right/left] One desktop right/left
[Alt-g]
[F1]
Display a manpage (CL)
Jump to another frame (CL)
INFO
[F2]
Launch xterm
[Alt-p/n/Tab]
One frame up/down/right
[F3]
Launch a program (CL)
[Alt-c]
Close active object
[1] Joachim Moskalewski:
“Cleverly Contrived”, Linux Magazine,
Issue 18: March 2002, p77-79, http://www.
linux-magazine.com/issue/18/PWM.pdf
[2] http://modeemi.fi/~tuomov/ion/
[3] http://www.lua.org/
[F4]
Open an SSH connection (CL)
[Alt-k] [c]
Kill active application
[F5]
Edit file (CL)
[Alt-k] [n/p]
Move to next/previous tab in a
frame
[F6]
View file (CL)
[F9]
Switch desktop or create a new
desktop (CL)
[Alt-a]
Add application to active frame
(CL)
[F12]
Quit Ion (CL)
[Alt-s]/[Alt-k] [s]
Tile frame horizontally/vertically
84
November 2003
www.linux-magazine.com
593051614.003.png 593051614.004.png 593051614.005.png
Zgłoś jeśli naruszono regulamin