2004.07_Desktopia-Xap-Launching Applications with a Different Approach.pdf
(
2013 KB
)
Pobierz
Layout 1
LINUX USER
deskTOPia
the traditional approaches to
launching programs on a GUI-
based desktop. However, none of these
solutions made the developer of
Xap
(X
application panel), a.k.a Rasca, really
happy. He didn’t feel like navigating
menu hierarchies, or filling his desktop
with icons. His Xap [1] utility takes a dif-
ferent approach. It organizes buttons for
launching his favorite programs in win-
dows on the desktop to save space – you
can even use tabs. The tool comes com-
plete with its own file manager.
Button Bar
Mix and Build
You will need to compile the source code
for the tool. The usual three card trick of
./configure ; make ; su -c make install
won’t get you far this time. The
configure
script
, which is supposed to discover the
location of the developer files, returns
incorrect results, and adds the wrong
paths for the
gtk
and
glib
header
files to
the makefile. To prevent this, you need to
tell the
configure
script exactly where the
include files are. Users of Suse Linux 9.0
can type the following to do so:
A program launcher doesn’t always have to be a menu or a desktop icon. Xap
CFLAGS="-I/opt/gnome/include
U
/gtk-1.2 -I/opt/gnome
U
/include/glib-1.2" ./configure
takes an unconventional approach to this task and thus makes users rethink.
BY ANDREA MÜLLER
Redhat 9.0, Suse 8.2, and Mandrake
Linux 9.0, 9.1, 9.2, and 10.0 users will
find the developer files for
gtk
and
glib
below
/usr
. You need to enter:
cutable,
xap
, to
/usr/local
. You can
ignore the error message at the end. Xap
includes links for the KDE 2 menu and is
unable to copy them.
The
tools
tab will be empty at this
stage. Xap checks its config directory,
~/.xap
, to discover the applications it is
expected to manage. Each folder below
that directory represents a Xap tab. The
contents of the
~/.xap/tools
directory
are displayed as programs in a tab called
tools
. To add a program, use the
ln
com-
mand to create a link to the executable
within a directory. For
xterm
we need:
CFLAGS="-I/usr/include/gtk-1.2
U
-I/usr/include/glib-1.2"
U
./configure
Nicely Set Up
The following command
-I
means that the directory that follows,
for example,
/opt/gnome/include/gtk-1.2
,
has the
I
nclude files needed by the com-
piler. The syntax above adds the paths to
the
makefile
. You can then go on to run
make
, which should execute without any
errors now. As an administrative user,
type
make install
to copy the binary exe-
xap &
launches the new tool. The first time you
start the program, it will create its own
configuration directory,
~/.xap
, and
populate the directory with links to its
own tools. The program launches in a
window that you can move around your
desktop as required. The window has
two tabs called
apps
and
tools
.
apps
is
populated with quick start icons for the
programs included with the Xap distribu-
tion: the
xwf
file manager, the
xfi
search
tool, a front-end for GnuPG, and privi-
lege management tool (see Figure 1).
GLOSSARY
gtk
: Short for the Gimp Toolkit, a graphics
library that contains elements required to
draw menus and dialog boxes. Many applica-
tions, including the latest version of Gimp,
already use gtk-2.
Header
: These are files that typically have a
.h suffix and contain library interface defini-
tions. If a program needs library functions,
you need to include the header files for the
library. Header files are normally located in
packages with the same stem name as the
library plus a dev or devel suffix.
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.
78
July 2004
www.linux-magazine.com
Xap
P
anels, desktop icons, or menus are
deskTOPia
LINUX USER
ln -s /usr/bin/xterm ~/.xap
U
/tools/xterm
How do you go about defining an icon
to launch
top
? You won’t get far with a
link, as
top
needs to run in a terminal
window as a “container”. Luckily, the
developer put some thought into this.
The following command
You need to relaunch Xap to tell the tool
to apply the changes.
You can add new tabs by selecting
New Page
in the
xap
pull-
down menu (see Figure 2).
This tells Xap to create a
new folder below
~/.xap
where you can add links to
programs.
ln -s /usr/bin/top
U
~/.xap/tools/top
Figure 1: Xap automati-
cally creates icons for
its own collection of
tools.
creates a link and pops up a
configuration dialog. In the
Options
for the link, select
Start in Terminal Window
and
save your changes by clicking
on
OK
. Under the hood,
xap
converts the link to a definition file. The
file includes details of the icon that
xap
will display, the tooltip text to display on
mouse over, and the command that
xap
executes when a user clicks the icon.
Figure 4: Xpg is graphical front-end for the gpg
encryption tool.
Pretty Desktop
Xap creates an icon for the
xterm
entry we just created,
as it knows the application. It is not so
friendly to unknown apps, however.
They have to make do with a sad looking
gray box. To brighten up the buttons,
simply copy an XPM formatted graphic
to the
~/.xap/.icons
directory. To tell the
program launcher which button the
graphic belongs to, add a name using the
following conventions:
mini-name_of_
link.xpm
. For example, if you have a link
for
sylpheed
,
mini-sylpheed.xpm
would
be the right name for the image. There is
an even easier way of adding an icon to
the launcher. Right-click the launcher
and select
Options
to pop up the configu-
ration dialog (see Figure 2). Enter the
path to the icon to
Icon (XPM)
– with
some luck you might find a suitable icon
in the collection of some 100 that
xap
copies to
/usr/local/share/icons
during
the installation phase.
Double-clicking a file pops up a dialog
where you can associate a program with
the file. The file manager will launch
executables. If you need to edit a script,
avoid double-clicking and select
Open
with
in the context menu.
To create a permanent file association
between PNG images and Gimp, select
Register
in the context menu for a PNG
file. In the dialog box type
gimp
to auto-
matically launch the image manipulation
program whenever you double-click a
file with the
.png
extension.
File Organizer
After creating your quick start icons, it’s
time to investigate the
xap
tools in the
apps
tab. The most important tool is the
one hiding behind the button on the left,
the
xwf
file manager (see Figure 3). The
file manager allows access the other
three programs,
xfi
, a
find
front-end,
xat
,
for displaying and editing file permis-
sions, and
xpg
, a GnuPG front-end.
As the file manager has a single win-
dow view, it makes sense to launch two
instances. This allows you to copy and
move files using drag & drop. Xwf will
copy by default. If you use the center
button on your mouse for the file copy,
the file manager pops up a menu when
you release the button in the target direc-
tory. You can then decide whether you
want to
Copy
or
Move
the files, or create
a
Link
. There is also
Copy (preserve)
that
allows you to keep the permissions and
time stamp for the file while copying.
Search and Encrypt
You can launch a search operation by
first selecting a folder and then
Find
in
the context menu. Enter the search
Pat-
tern
, and in the
Type
check boxes,
specify what you want to find:
Plain file
,
Directory
, or
All
. Click on
find
to launch
the search, and display the matches in
the lower part of the window. If you
want to avoid using the context menu,
you can simply drag & drop the folder
onto the
xfi
icon (the magnifying glass)
in the Xap window.
To encrypt a file, either select
Encrypt
in the context menu, or or drop it onto
the
xpg
icon. The program displays all
the public keys in your keyring in the top
panel (see Figure 4). Select the key for
the user you want to send an encrypted
file. Click on
Encrypt
to finish off the job.
Xap’s drag & drop capabilities and the
tools included with the distribution
make a powerful team. Xap is extremely
flexible and gives users the opportunity
to take a customized environment with
them no matter what kind of machine
they are working on.
Fine Tuning
The pull-down menu for each tab has a
few more features. Select
Rename Page
to
rename a tab, or pop up a quick launch
window by selecting
Execute
. The
Start
application in a terminal
item is useful
for applications that need a console,
such as the system monitor,
top
.
■
INFO
Figure 2: Use the button options to select an icon
and define the executable.
Figure 3: Xwf provides file management facilities
for users.
[1] Xap:
http://mpx.freeshell.net/
www.linux-magazine.com
July 2004
79
Plik z chomika:
Kapy97
Inne pliki z tego folderu:
2010.10_Task Force-Command-Line Task Managers.pdf
(515 KB)
2010.10_Plan on It-Ultimate Gtd System with Org-Mode.pdf
(708 KB)
2010.10_Pdf Power-Creating Pdfs from the Command Line.pdf
(700 KB)
2010.10_Barely There-Lightweight Content Management with Barebones.pdf
(647 KB)
2010.09_One Fell Swoop-Batch Image Conversion with Converseen.pdf
(494 KB)
Inne foldery tego chomika:
Beginners
Business News
Comment
Community
Community Notebook
Zgłoś jeśli
naruszono regulamin