# Desktop Environments

Everthing to do about Desktop Environments, including LXDE, XFCE, KDE and Gnome

# Getting Cursor Pointer Theme for LXDE

1. Installing the package `xcursor-themes`
2. Then go to `Preferences` > `Customize Look and Feel`
3. Select your cursor pointer theme under `Mouse Cursor` tab

# LXDE Volume Keybinding

Add the following lines to `~/.config/openbox/lxde-rc.xml`:

```
<keybind key="XF86AudioMute"> 
  <action name="Execute"> 
    <command>amixer sset Master toggle</command> 
  </action> 
</keybind> 
<keybind key="XF86AudioRaiseVolume"> 
  <action name="Execute"> 
    <command>amixer sset Master 5%+</command> 
  </action> 
</keybind> 
<keybind key="XF86AudioLowerVolume"> 
  <action name="Execute"> 
    <command>amixer sset Master 5%-</command> 
  </action>
</keybind>
```
  
Issue command => `openbox --restart`

# LXDE Blueproximity Settings

**Locking Command**: `xscreensaver-command -activate`  
**Unlock Command**: `pkill xscreensaver`  
**Proximity Command**: `xscreensaver-command -time || daemonize /usr/bin/xscreensaver -no-splash`  
**Daemonize Utility**: To stop blueproximity from hanging when using the proximity command, it requires the daemonize command (http://software.clapper.org/daemonize/). Using "xscreensaver -no-splash &" or "xscreensaver -no-splash" will cause blueproximity to hang.

# Auto Suspend USB

**There are 2 settings that needs to changed:**  
1. Add `usbcore.autosuspend=0 usbcore.autosuspend_delay_ms=-1` to `/boot/grub/grub.cfg` kernel param
2. Disable monitor power manager control in `xfce4-power-manager` settings
3. Install `acpid`
4. Add the following udev rules to `/etc/udev/rules.d/99-usb-autosuspend.rules`:
```
ACTION=="add", SUBSYSTEM=="usb", TEST=="power/control",
ATTR{power/control}="on"
ACTION=="add", SUBSYSTEM=="usb", TEST=="power/autosuspend",
ATTR{power/autosuspend}="0"
ACTION=="add", SUBSYSTEM=="usb", TEST=="power/autosuspend_delay_ms",
ATTR{power/autosuspend_delay_ms}="-1"
```

# LXDE Visual Artifacts when Switching from Desktops with Chrome

LXDE Visual Artifacts when Switching Desktops. Install a [composite manager](http://en.wikipedia.org/wiki/Compositing_window_manager) will remove the artifacts, below is a list of composite managers:

- [xcompmgr](http://www.freedesktop.org/wiki/Software/xapps) - a minimal alternative to Compiz
- [Compton](https://github.com/chjj/compton) - A bug-fixed fork of dcompmgr, which is a fork of xcompmgr
- [Cairo Compmgr (Cairo Composite Manager)](http://cairo-compmgr.tuxfamily.org/) - a compositing add-on for existing window managers. It uses [Cairo](http://en.wikipedia.org/wiki/Cairo_(graphics)), a vector graphics library also used in [GTK+](http://en.wikipedia.org/wiki/GTK%2B).
- [Unagi Compositing Manager](http://unagi.mini-dweeb.org/) - a compositing manager which can be used along with an existing window manager. It uses the XCB library.
I used Compton for my composite manager:

Install `compton` package
Add `@compton -b` to the end of `/etc/xdg/lxsession/LXDE/autostart`

**References:**
1. https://wiki.archlinux.org/index.php/Compton