Tento článek vás naučí, jak nainstalovat a nastavit různé součásti desktopového prostředí Lightweight X11 Desktop Environment. LXDE je designováno ke spouštění na počítačích s minimálními hardwarovými požadavky. Vyžaduje několik závislostí. Filosofií LXDE je být odlehčené, ale plně použitelné.
- 1 Vlastnosti
- 2 Součásti
- 3 Instalace
- 4 Starting the Desktop
- 5 Tips and Bug Fixes
- 5.1 Autostart Programs
- 5.2 Digital Clock Applet Time
- 5.3 Application Menu Editing
- 5.4 My Documents name
- 5.5 Font Settings
- 5.6 Auto Mount
- 5.7 LXNM
- 5.8 KDM and LXDE session
- 5.9 lxpanel Add Launcher (application)
- 5.10 lxpanel Add Launcher (location)
- 5.11 Icons/Cursors
- 5.12 Replace Window Manager
- 5.13 Shutdown and Reboot from LXDE
- 5.14 Problems when updating to Version 0.4.1 of lxsession
- 5.15 LXsession full
- 5.16 Using KDEmod3 applications under LXDE
- 6 Resources
Některé vlastnosti LXDE:
- Odlehčenost - běží s přijatelnými nároky na paměť (po spuštění Xorg serveru a LXDE je celkové využití paměti asi 45 MB na i686 PC.)
- Rychlost - běží dobře i na starších strojích (hardwarové požadavky LXDE jsou podobné Windows 98)
- Praktický design - uživatelské prostředí gtk2 a vysoké standardy GNOME.
- Nezávislé na desktopu - součásti mohou být použité bez LXDE.
- Vyhovující standardům - dodržuje specifikace projektu Freedesktop.
Informace o některých součástech:
- PCManFM: Správce souborů, funkce desktopu a tapeta na plochu.
- LXPanel: Panel se správcem aplikací, aplikačním menu a spoustou appletů.
- LXSession: Správce sezení s podporou standardů X11 a podporou příkazů shutdown/reboot/suspend (vyžaduje HAL).
- LXAppearance: Editor témat, který dokáže změnit témata GTK+, témata ikon a fontů pro aplikace GTK.
- Openbox: Odlehčený, podporující standardy a vysoce konfigurovatlený správce oken (doporučený, ale nevyvíjený projektem LXDE).
- Obconf - Nástroj pro konfiguraci témat Openboxu.
- GPicView: Jednoduchý odlehčený prohlížeč obrázků.
- Leafpad: Odlehčený a jednoduchý textový editor (nevyvíjený projektem LXDE).
- XArchiver: Odlehčený archivátor souborů (nevyvíjený projektem LXDE).
- LXNM Odlehčený správce sítě pro bezdrátové sítě - ve vývoji. Balíček Template:Package AUR lze nalézt v repozitáři AUR.
LXDE is modular so you can choose the packages you need. Some packages are experimental and you will need to use the AUR repository to install them.
Install the LXDE group by:
# pacman -S lxde
Installing the group lxde will install the following packages:
You will also need to install Gamin. Gamin is a file and directory monitoring tool designed to be a subset of the FAM. It runs on demand for programs that have support for it so does not require a daemon like fam does. If you have fam installed, remove it from the DAEMONS array in Template:Filename and stop the daemon before installing gamin.
pacman -S gamin
Other lightweight packages you might want to install:
pacman -S mousepad xarchiver obconf epdfview
For more look at Lightweight_Applications.
Starting the Desktop
You can start LXDE in several different ways. If you are using display managers like SLiM, GDM, or KDM, open the session option and choose LXDE. To be able to do this from the console, several other options exist.
To use startx you will need to define LXDE in your [[Beginners'_Guide#C:_Test_X|Template:Filename]] file:
exec ck-launch-session startlxde
This will launch LXDE with HAL support that provides the ability to restart or shutdown your computer from the logout dialog. If you don't want to use HAL:
$ xinit /usr/bin/startlxde
- Or from a console-kit session:
$ xinit /usr/bin/ck-launch-session startlxde
If you want to run startx at boot automatically, take a look at the starting X at boot guide.
Tips and Bug Fixes
Tips to help with LXDE programs and bug fixes.
- .desktop files
$ ln -s /usr/share/applications/lxterminal.desktop ~/.config/autostart/
- autostart file
A second method is to use a Template:Filename file.
$ touch ~/.config/lxsession/LXDE/autostart
And add the program you would like to start on a newline with the @ prefix (and without & at the end):
- Global autostart
A third method is to use the global file Template:Filename. This file is not a shell script, but each line represents a different command to be executed. If a line begins with @, the command following the @ will be automatically re-executed if it crashes. If both Template:Filename and Template:Filename files are present, all entries in both files will be executed.
Digital Clock Applet Time
To get standard time (not military time) use for hh:mm and hh:mm:ss format respectively (Template:Codeline for more options):
Application Menu Editing
The application menu works by resolving files with program start information in them (called Template:Filename files) located in Template:Filename. Many desktop environments run programs that supersede these settings to allow customization of the menu. LXDE has yet to create an application menu editor but you can manually build them yourself if you are so inclined.
To remove items from the menu, you'll have to edit the Template:Filename files and describe that the program shouldn't be displayed. First, copy the files from your global list location to your local user's menu location.
cp /usr/share/applications/example.desktop ~/.local/share/applications
Then add to the file NoDisplay=true. To expedite the process for a good number of files you can put it in a loop. For example:
cd /usr/share/applications for i in program1.desktop program2.desktop ...; do cp /usr/share/applications/$i \ /home/user/.local/share/applications/; echo "NoDisplay=true" >> \ /home/user/.local/share/applications/$i; done
This will work for all applications except KDE applications. For these the only way to remove them from the menu is to log into KDE itself and use it's menu editor. For every item that you do not want displayed, check the 'Show only in KDE' option.
My Documents name
The folder on the Desktop named 'My Documents' is hard-coded into pcmanfm. At this time there is no ability to be able to rename it.
Most users of LXDE usually try to use GTK programs because GTK is used as a backend for LXDE. To set the fonts, you can use Template:Package Official and set the main font but for other fonts you will need to use the Gnome 'Font Preferences' Control Panel. To install it:
pacman -S gnome-control-center
After you have set your preferences, you can remove the programs as the settings will be retained.
# gpasswd -a your_username hal
Then pmount is required for mounting removable devices without root access:
pacman -S pmount
Now logout and back in again to so that your user is recognized as part of the hal group.
NTFS with Chinese Characters
For a storage device that has an NTFS filesystem, you will need to install the NTFS-3G package. Generally, PCManFM works well, however there is one bug affecting NTFS users that if you have files or folders on an NTFS filesystem, the names of which contain non-latin characters (ie: Chinese Characters) may disappear when opening (or automounting) the NTFS volume. This happens because the lxsession (or lxsession-lite) mounthelper is not correctly parsing the policies and locale option. There is a workaround for this:
- Remove the "/sbin/mount.ntfs-3g" which is a symlink.
- Create a new "/sbin/mount.ntfs-3g" with a new bash script containing:
#!/bin/bash /bin/ntfs-3g $1 $2 -o locale=en_US.UTF-8
- Make it executable:
chmod +x /sbin/mount.ntfs-3g
- Add "NoUpgrade = sbin/mount.ntfs-3g" to pacman.conf under the "[options]"
LXNM is a program based on scripts that attempts to manage the network connections. It is script-based and strives to make networking configuration as automatic as possible. It is not a full blown networking system like NetworkManager. If you want greater control, Wicd and Gnome's verions of NetworkManager works well with LXDE. Template:Package AUR is in the AUR:
yaourt -S lxnm
The main script will need to be run as root. If you plan on consistently using it, put it in your Template:Filename. LXNM works with the Network Status Monitor of the Lxpanel so you'll need to add that too the panel. LXNM works well most of the time, though at times it can take awhile to get a connection.
KDM and LXDE session
As of KDE 4.3.3, KDM will not recognize the LXDE desktop session. To have it do so:
# cp /usr/share/xsessions/LXDE.desktop /usr/share/apps/kdm/sessions/
lxpanel Add Launcher (application)
lxpanel comes with a launcher applet by default and all you need to do to add new apps to it is:
- Make sure launch bar applet is enabled:
- 1a. right click the panel
- 1b. select "add/remove panel items"
- 1c. make sure "application launch bar" is listed (if it's not, select "add" and add it)
- Right click anywhere on the launch bar applet
- Choose "application launch bar settings"
- Choose "add"
- Direct it to the .desktop file of whatever application you want to add (found in usr/share/applications)
lxpanel Add Launcher (location)
To add a launcher to a specific location such as a media hard drive or folder you need to create a .desktop file and save it in /usr/share/applications. You can then add it the same way as adding an application to the panel.
Here is a custom .desktop file as an example, edit lines "Exec" and "Icon" as needed:
[Desktop Entry] Version=1.0 Encoding=UTF-8 Name=media Exec=pcmanfm /mnt/xbox (basically you're telling pcmanfm to open a specific location - /mnt/xbox in this case) Icon=xbmc.png (this should be the name of an icon in /usr/share/pixmaps) Terminal=false X-MultipleArgs=false Type=Application Categories=Application StartupNotify=true
Setting up icons and cursors.
A basic way of doing this is to add the cursor to the default theme. First you will need the directory:
Then you can specify to add to the icon theme the cursor. This will use the Template:Package Official pointer theme:
echo '[icon theme] Inherits=Bluecurve' > /usr/share/icons/default/index.theme
Default icons used by lxpanel are stored in Template:Filename and any custom icons you want lxpanel to use need to be saved there as well.
You can change default icons for applications by taking the following steps:
- Save the new icon to /usr/share/pixmaps
- Use a text editor to open the .desktop file of the program whose icon you want to change (.desktop files can be found in /usr/share/applications)
My Documents Icon
The desktop entry for "My Documents" cannot be removed. It is compiled directly into pcmanfm, file src/desktop/desktop-window.c. The icon that is used is gnome-fs-home, with folder-home as fallback. If the chosen icon theme does not have this icon, it needs to be created, or else the desktop entry will have no icon associated with it.
Replace Window Manager
OpenBox, the default window manager of LXDE, can be easily replaced by any one you like, such as fvwm, icewm, dwm and awesome... etc..
The window manager LXDE will attempt to use is defined this file:
Per default this is defined as
Replace openbox-lxde with the window manager of your choice.
It might be also worth looking at:
These default settings however appear to be deprecated, as there is this note in the file:
! This file is kept for backward compatibility. ! Only used by obsolete lxsession, not lxsession-lite.
Anyhow, for example, somebody's /etc/xdg/lxsession/LXDE/default looks like this:
smproxy openbox lxpanel
smproxy is a program provided in xorg. It provides session management support for programs which don't know X11 R6 session management protocol. It is highly recommended you include this line in your desktop.
Shutdown and Reboot from LXDE
To be able to shutdown, reboot, suspend and so on from lxde make sure that DBus and HAL are running. Then add your user to the power group.
# gpasswd -a <USERNAME> power
If you still encounter problems, add inbetween the <config></config> tags in /etc/PolicyKit/PolicyKit.conf the folowing lines:
<match action="org.freedesktop.hal.power-management.shutdown"> <return result="yes"/> </match> <match action="org.freedesktop.hal.power-management.reboot"> <return result="yes"/> </match> <match action="org.freedesktop.hal.power-management.suspend"> <return result="yes"/> </match> <match action="org.freedesktop.hal.power-management.hibernate"> <return result="yes"/> </match>
Then restart HAL.
Problems when updating to Version 0.4.1 of lxsession
When starting GTK2 programs you get:
GTK+ icon them is not properly set
This usually means you don't have an XSETTINGS manager running. Desktop environment like GNOME or XFCE automatically execute their XSETTING managers like gnome-settings-daemon or xfce-mcs-manager.
Functionality/Config files of lxde-settings-daemon was recently merged into lxsession. If you made customizations to config files you are in need of merging those config files:
You can also use lxappearance from the community repository to fix this.
There are some bugs in lxsession related to session management. lxsession-lite is a version of lxsession which does not have the session management capability. The stability of lxsession-lite is better than lxsession, however it can not save and restore sessions. Thus it is recommended to use lxsession-lite till the problems in lxsession are fixed.
Using KDEmod3 applications under LXDE
As older versions of KDEmod[-legacy] are still installed under /opt/kde/bin, they are not automatically recognized by LXDE. To use them, you can either edit your PATH with the following command:
echo 'PATH=$PATH:/opt/kde/bin' >> /etc/rc.local
or you can add the following script to /etc/profile.d:
Save it as "kde3path.sh" and make it executable:
chmod +x /etc/profile.d/kde3path.sh