LXDE Tips

Installing

With a Debian distribution, install the lxde package.

    # apt-get install lxde

Configuration

Autostart

To automatically start programs when your session starts you can either;

1.  create a .desktop file in `~/.config/autostart/` e.g.

    $ cat <<EOF >> ~/.config/autostart/lxterminal.desktop
[Desktop Entry]
Type=Application
Exec=lxterminal
OnlyShowIn=LXDE;
EOF

2.  Add an entry to `/etc/xdg/lxsession/LXDE/autostart`

See also:

gnome-power-manager

To use gnome-power-manager to manage the battery, add an entry to /etc/xdg/lxsession/LXDE/autostart e.g.

    $ cat <<EOF | sudo tee -a /etc/xdg/lxsession/LXDE/autostart
@gnome-power-manager
EOF

lxpanel

See http://wiki.lxde.org/en/LXPanel

To restart lxpanel:

    $ killall lxpanel
    $ lxpanel -p LXDE &

Alternatively, you may be able to use:

    $ lxpanelctl restart

Note: lxpanel in Debian 5.0 (Lenny) appears to fail to display the menu if there are other files in ~/.config/lxpanel/LXDE/panels, e.g. a backup file such as panel~. There also seems to be a bug when interactively modifying the panel settings where the alpha value is always set to zero and tintcolor is not updated with any change.

When the panel is initially created, it includes buttons which can't be added using the interactive Application Launch Bar tool. If you wish to add them to an application launch bar, you will need to manually edit the ~/.config/lxpanel/LXDE/panels/panel configuration file. An entry such as the following will replace them:

    Plugin {
        type = launchbar
        Config {
            Button {
                id=/usr/share/applications/lxde-x-www-browser.desktop
            }
            Button {
                id=lxde-screenlock.desktop
            }
            Button {
                id=lxde-logout.desktop
            }
        }
    }

Keyboard Shortcuts

Keyboard and mouse bindings are configured in ~/.config/openbox/lxde-rc.xml

After making any changes, force openbox to reload the configuration with:

    $ openbox --reconfigure

To find the names of keys, run xev in a terminal, e.g. the following output is shown when the Print key is pressed:

    KeyPress event, serial 48, synthetic NO, window 0x3c00001,
        root 0x2d5, subw 0x0, time 8709884, (858,131), root:(1207,181),
        state 0x0, keycode 107 (keysym 0xff61, Print), same_screen YES,
        XLookupString gives 0 bytes:
        XmbLookupString gives 0 bytes:
        XFilterEvent returns: False

The key's name is shown on line three after keysym 0xff61,

Some changes you may like to make:

...
<placement>
  ...
  <monitor>Mouse</monitor>
  ...
</placement>
...
<theme>
  ...
  <keepBorder>no</keepBorder>
  ...
</theme>
...
<desktops>
  ...
  <number>4</number>
  ...
</desktops>
...
<keyboard>
  ...
  <!-- Disable keys which conflict with Eclipse keys
  <keybind key="C-A-Up">
    <action name="DesktopUp">
      <dialog>no</dialog>
      <wrap>no</wrap>
    </action>
  </keybind>
  <keybind key="C-A-Down">
    <action name="DesktopDown">
      <dialog>no</dialog>
      <wrap>no</wrap>
    </action>
  </keybind>
  -->
  ...
  <!-- Modify S-A combinations to match Gnome defaults -->
  <keybind key="C-S-A-Left">
    <action name="SendToDesktopLeft">
      <dialog>no</dialog>
      <wrap>no</wrap>
    </action>
  </keybind>
  <keybind key="C-S-A-Right">
    <action name="SendToDesktopRight">
      <dialog>no</dialog>
      <wrap>no</wrap>
    </action>
  </keybind>
  <keybind key="C-S-A-Up">
    <action name="SendToDesktopUp">
      <dialog>no</dialog>
      <wrap>no</wrap>
    </action>
  </keybind>
  <keybind key="C-S-A-Down">
    <action name="SendToDesktopDown">
      <dialog>no</dialog>
      <wrap>no</wrap>
    </action>
  </keybind>
  <!-- End - Modify S-A combinations to match Gnome defaults -->
  ...
  <keybind key="W-l">
    <action name="Execute">
      <command>xscreensaver-command -lock</command>
    </action>
  </keybind>
  <keybind key="W-t">
    <action name="Execute">
      <command>lxterminal --geometry=96x30</command>
    </action>
  </keybind>
  <keybind key="A-C-l">
    <action name="Execute">
      <command>xscreensaver-command -lock</command>
    </action>
  </keybind>
  <keybind key="W-Print">
    <action name="Execute">
      <startupnotify>
        <enabled>true</enabled>
        <name>Screenshot</name>
      </startupnotify>
      <command>xfce4-screenshooter</command>
    </action>
  </keybind>
  <keybind key="A-F10">
    <action name="MaximizeFull"/>
  </keybind>
  <keybind key="A-F5">
    <action name="UnmaximizeFull"/>
  </keybind>
  <keybind key="A-F9">
    <action name="Iconify"/>
  </keybind>
  <keybind key="A-F7">
    <action name="Move"/>
  </keybind>
  <keybind key="A-F8">
    <action name="Resize"/>
  </keybind>
  ...
</keyboard>

LXAppearance

Many configuration changes can be made using the LXAppearance application, which is available from the LXDE menu under Preferences->Appearance.

Background Wallpaper

To change the background wallpaper, right-click on the desktop and select Desktop Settings from the pop-up menu. The wallpaper can be changed on the Desktop tab.

Desktop files (.desktop) are placed under;

  • /usr/share/applications
  • ~/.local/share/applications

See http://wiki.lxde.org/en/Main_Menu

Screenshots

Alternatively, if you are using Debian 6.0 (Squeeze) or later, you can use the shutter application.

    # apt-get install shutter

or

xfce4 Screenshot

    # apt-get install xfce4-screenshooter

Preferred Applications

You can change the default browser and e-mail client by running /usr/bin/libfm-pref-apps from the libfm-gtk0 package in Debian 6.0 (Squeeze). This is available on the Preferences menu, under Preferred Applications.

Using lightdm Display Manager

On Debian, try setting the default xsession with:

# /usr/lib/i386-linux-gnu/lightdm/lightdm-set-defaults -s lxde

If you are using ~/.xession you will need to modify the exec entry to exec startlxde

See also https://wiki.debian.org/LXDE

Resources


-- Frank Dean - 2 Dec 2011

Related Topics: DebianTips, LinuxHintsAndTips