Linux Format - UK (2019-12)

(Antfer) #1
38 LXF257 December 2019 http://www.linuxformat.com

Lightweight Linux


inux distros are assembled in a modular
fashion, which gives you the flexibility to swap
resource-draining components for faster
lightweight alternatives. The most important and often
wasteful component in a desktop is the window
manager that controls the placement and appearance
of windows within the graphical interface.
One of the most popular ones is Openbox – it’s so
bare you might not even notice it’s there! All you get is a
wallpaper-less background and a cursor. An application
menu only appears in the right-click context menu. You
can use the menu to launch applications that run within
windows with the usual controls and behave as you’d
expect in any desktop. You can customise the window
manager using the separate obconf configurator.

Lego it up
Besides the window manager, you’ll also need a file
manager. We’ll use PCManFM, which includes several
useful features like network management and an
impressive context menu without taxing resources.
Openbox also lacks a panel, so we’ll use the lightweight
Cairo-Dock and even the Xcompmgr compositing
manager to add some polish to your lightweight
desktop. All these components are available in the
official repositories of virtually every desktop distro

and can be easily pulled using
your package manager. After
installing the components, you’ll
have to instruct Openbox to assemble them into
a desktop environment.
Setting up Openbox is rather straightforward as its
display and behaviour is controlled by only a handful of
files. There’s the autostart file, which contains the list
of the other components that the desktop will
automatically run when it’s starting up. Then there’s
menu.xml, which describes the content of the
desktop’s right-click application menu. Openbox’s main
configuration file that contains keybindings, virtual
desktop settings and more is rc.xml. The global
versions of these files exist under /etc/xdg/openbox.
Instead of tweaking the files there, you should first
copy them to your current user’s directory with cp -R /
etc/xdg/openbox ~/.config/ and then edit the startup
file, like this:
$ nano ~/.config/openbox/autostart
pcmanfm --desktop &
sleep 2s
pcmanfm --set-wallpaper=/home/bodhi/Pictures/
wallpaper.jpg --wallpaper-mode=crop
cairo-dock -o &
xcompmgr -c -f &
In this file we’ve first invoked PCManFM as the
desktop manager. By default, PCManFM will display
icons for all files and folders in the ~/Desktop folder.
If you want shortcuts for applications on your desktop,
you need to copy the respective .desktop files from
/usr/share/applications into the Desktop folder. The
& symbol at the end of some lines tells the distro to
run the program in the background and move on to the
next item. Without this symbol, the distro would run the
first line and wait until that program was completed
before running the next line, which would prevent our
desktop from loading.
We then pause the script for two seconds for
PCManFM to settle down, before we invoke it again to
draw the wallpaper. Next we use the -o option to force
Cairo-Dock to use the hardware-accelerated OpenGL
backend. The last line calls xcompmgr along with
support for soft shadows and translucency. It also
enables a smooth fade effect when you hide and
restore windows.
That’s all there is to it. Now log out and log back in,
but make sure you change your desktop environment
to Openbox in the login manager. Now enter your
authentication details and you’ll be logged in to your
custom Openbox-managed desktop.
You can now spend some time configuring individual
pieces such as cairo-dock and even Openbox itself to
your liking. Once you get the hang of creating custom
desktops, you can replace components with
alternatives. Try different docks, place widgets on the
desktop with gdesklets, Conky or GkrellM, or perhaps
even an application launcher like Synapse. Ultimately,
there’s no better way to hack your way to a pleasant-
looking desktop.

L


You can edit
Openbox’s config
files by hand,
but it’s more
efficient to tweak
the desktop’s
behaviour via the
obconf tool.

A DESIGNER DISTRO


LEVEL 4


THE BARE NECESSITIES


While we don’t expect many distros to bring back the package
selection section in their installation process, it was nice of Ubiquity
to offer a minimal installation option. It’s been a permanent fixture
since the Ubuntu 18.04 release.
When toggled, the minimal install option only copies the bare
essentials, giving you the flexibility to build your system yourself.
You can avoid installing over 80 packages of bloat: all you get is the
GNOME Desktop, Firefox and some core utilities.
Once inside the installation, you can use the package manager
to pull-in lightweight, responsive apps instead of their heavyweight
and lethargic defaults. While the minimal install comes with the
GNOME desktop, it’s a good idea to replace it with a snappier
alternative to speed up your installation. Xfce is a popular
lightweight desktop environment that you can install over Ubuntu
with sudo apt install xubuntu-desktop. Similarly, LXDE is a speedy
little desktop that can be installed with sudo apt install lubuntu-
desktop. There’s also LXQt, which is LXDE written in Qt. The GNOME
2 fork, MATE, is another option that’s available to most distros.

38 LXF257December 2019 3332Decmbr 019425 1

Lightweight Linux


inuxdistrosareassembledinamodular
fashion, which gives you the flexibility to swap
resource-draining components for faster
lightweight alternatives. The most important and often
wastefulcomponent in a desktop is the window
manager that controls the placement and appearance
ofwindows within the graphical interface.
Oneof the most popular ones is Openbox – it’s so
bareyou might not even notice it’s there! All you get is a
wallpaper-less background and a cursor. An application
menuonly appears in the right-click context menu. You
canusethe menu to launch applications that run within
windows with the usual controls and behave as you’d
expectin any desktop. You can customise the window
manager using the separate obconf configurator.

Legoit up
Besidesthe window manager, you’ll also need a file
manager. We’ll use PCManFM, which includes several
usefulfeatures like network management and an
impressive context menu without taxing resources.
Openbox also lacks a panel, so we’ll use the lightweight
Cairo-Dock and even the Xcompmgr compositing
manager to add some polish to your lightweight
desktop. All these components are available in the
officialrepositories of virtually every desktop distro

andcanbeeasilypulled using
your package manager. After
installing the components, you’ll
have to instruct Openbox to assemble them into
a desktop environment.
Setting up Openbox is rather straightforward as its
display and behaviour is controlled by only a handful of
files. There’s the autostart file, which contains the list
of the other components that the desktop will
automatically run when it’s starting up. Then there’s
menu.xml, which describes the content of the
desktop’s right-click application menu. Openbox’s main
configuration file that contains keybindings, virtual
desktop settings and more is rc.xml. The global
versions of these files exist under /etc/xdg/openbox.
Instead of tweaking the files there, you should first
copy them to your current user’s directory with cp -R /
etc/xdg/openbox ~/.config/ and then edit the startup
file, like this:
$ nano ~/.config/openbox/autostart
pcmanfm --desktop &
sleep 2s
pcmanfm --set-wallpaper=/home/bodhi/Pictures/
wallpaper.jpg --wallpaper-mode=crop
cairo-dock -o &
xcompmgr -c -f &
In this file we’ve first invoked PCManFM as the
desktop manager. By default, PCManFM will display
icons for all files and folders in the ~/Desktop folder.
If you want shortcuts for applications on your desktop,
you need to copy the respective .desktop files from
/usr/share/applications into the Desktop folder. The
& symbol at the end of some lines tells the distro to
run the program in the background and move on to the
next item. Without this symbol, the distro would run the
first line and wait until that program was completed
before running the next line, which would prevent our
desktop from loading.
We then pause the script for two seconds for
PCManFM to settle down, before we invoke it again to
draw the wallpaper. Next we use the -o option to force
Cairo-Dock to use the hardware-accelerated OpenGL
backend. The last line calls xcompmgr along with
support for soft shadows and translucency. It also
enables a smooth fade effect when you hide and
restore windows.
That’s all there is to it. Now log out and log back in,
but make sure you change your desktop environment
to Openbox in the login manager. Now enter your
authentication details and you’ll be logged in to your
custom Openbox-managed desktop.
You can now spend some time configuring individual
pieces such as cairo-dock and even Openbox itself to
your liking. Once you get the hang of creating custom
desktops, you can replace components with
alternatives. Try different docks, place widgets on the
desktop with gdesklets, Conky or GkrellM, or perhaps
even an application launcher like Synapse. Ultimately,
there’s no better way to hack your way to a pleasant-
looking desktop.

L


You can edit
Openbox’s config
files by hand,
but it’s more
efficient to tweak
the desktop’s
behaviour via the
obconf tool.

A DESIGNER DISTRO


LEVEL 4


THEBARENECESSITIES


Whilewedon’texpectmanydistrostobringbackthepackage
selectionsectionintheirinstallationprocess,itwasniceofUbiquity
toofferaminimalinstallationoption.It’sbeenapermanentfixture
sincetheUbuntu18.04release.
Whentoggled,theminimalinstalloptiononlycopiesthebare
essentials,givingyoutheflexibilitytobuildyoursystemyourself.
Youcanavoidinstallingover 80 packagesofbloat:allyougetisthe
GNOMEDesktop,Firefoxandsomecoreutilities.
Onceinsidetheinstallation,youcanusethepackagemanager
topull-inlightweight,responsiveappsinsteadoftheirheavyweight
andlethargicdefaults.Whiletheminimalinstallcomeswiththe
GNOMEdesktop,it’sagoodideatoreplaceitwithasnappier
alternativetospeedupyourinstallation.Xfceisapopular
lightweightdesktopenvironmentthatyoucaninstalloverUbuntu
with sudoaptinstallxubuntu-desktop.Similarly,LXDEisaspeedy
littledesktopthatcanbeinstalledwithsudoaptinstalllubuntu-
desktop.There’salsoLXQt,whichisLXDEwritteninQt.TheGNOME
2 fork,MATE,isanotheroptionthat’savailabletomostdistros.
Free download pdf