Table of Contents

X Window system

based on XFCE

Font smoothing

| ~/.fonts.conf
<?xml version="1.0" ?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<!--
    <match target="font">
	<edit name="autohint" mode="assign"><bool>true</bool></edit>
    </match>
-->
 <!--
            use rgb sub-pixel ordering to improve glyph appearance on
            LCD screens.  Changes affecting rendering, but not matching
            should always use target="font".
   -->
       <match target="font">
            <edit name="rgba" mode="assign"><const>rgb</const></edit>
            <edit name="hintstyle" mode="assign"><const>hintfull</const></edit>
       </match>
</fontconfig>

Focus stealing

set default window manager

update-alternatives --config x-session-manager
# /usr/bin/startxfce4
update-alternatives --config x-window-manager
# /usr/bin/xfwm4
update-alternatives --config x-terminal-emulator
# /usr/bin/xfce4-terminal.wrapper

Enable CTRL+ALT+DEL to kill X-server

dpkg-reconfigure keyboard-configuration

XFCE4: restore working TAB key and CTRL+D

~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml
<property name="&lt;Super&gt;Tab" type="string" value="empty"/>

misc

apt-get install browser-plugin-vlc

Power management

sudo apt-get install acpi-support

Turn off monitors command and lock:

xset dpms force off
xscreensaver-command --lock

Control minitor brightness

xrandr --output HDMI2 --brightness 0.5
xrandr --output VGA1 --brightness 0.5

Enable/disable 2nd monitor

xrandr --output HDMI2 --off
xrandr --output HDMI2 --auto --right-of VGA1

Using Brighntess Controller

sudo apt-get install python-wxgtk3.0 python-pyside

Download and install latest version from http://lordamit.github.io/Brightness. Do not use Ubuntu's deb because it contain old version.

Using Indicator Brightness

apt-get install libappindicator1 libdbusmenu-gtk4 libindicator7 python-appindicator python-gobject
apt-get install notify-osd
 
wget http://launchpadlibrarian.net/196377180/notify-osd-icons_0.8%2B15.04.20150202-0ubuntu1_all.deb
dpkg -i dpkg -i notify-osd-icons_0.8+15.04.20150202-0ubuntu1_all.deb
 
wget http://ppa.launchpad.net/indicator-brightness/ppa/ubuntu/pool/main/i/indicator-brightness/indicator-brightness_0.4~bzr11~ubuntu15.04.1_all.deb
dpkg -i indicator-brightness_0.4~bzr11~ubuntu15.04.1_all.deb
 
 
sudo apt-get install software-properties-common python-software-properties
sudo add-apt-repository ppa:indicator-brightness/ppa
sudo apt-get update
sudo apt-get install indicator-brightness

Open PDFs in okular

Force system to ask how to open file:

mimeopen -d file.pdf

or

xdg-mime query filetype document.pdf
xdg-mime query default application/pdf
xdg-mime default okularApplication_pdf.desktop application/pdf 
# or kde4-okularApplication_pdf.desktop

see

cat /usr/share/applications/mimeinfo.cache and defaults.list 
cat  ~/.local/share/applications/mimeapps.list 

sudo update-mime-database /usr/share/mime

Multimonitor

use xrandr to list available outputs. Example output:

Screen 0: minimum 320 x 200, current 1920 x 1080, maximum 8192 x 8192
VGA1 connected 1366x768+0+0 (normal left inverted right x axis y axis) 410mm x 230mm
   1366x768      59.79*+
...
HDMI1 disconnected (normal left inverted right x axis y axis)
HDMI2 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 477mm x 268mm
   1920x1080     60.00*+
...
DP1 disconnected (normal left inverted right x axis y axis)
HDMI3 disconnected (normal left inverted right x axis y axis)

To set layout of monitor:

xrandr --output VGA1 --right-of HDMI2

You need to create startup script with above command, and configure XFCE to run it at start (read more below).

There is also graphical UI available:

apt-get install arandr

To make settings permanent, use Layout –> Save as This will create executable script in ~/.screenlayout/your_name.sh

Then add above executable script to autostart of XFCE: Application Menu –> Settings –> Session and Startup

remote VNC access

Start VNC after first user login (from autostart):

$ sudo apt-get install x11vnc
$ mkdir -p ~/.config/autostart
$ cd ~/.config/autostart
$ cat > X11VNC.desktop

And paste following content:

[Desktop Entry]
Encoding=UTF-8
Type=Application
Name=X11VNC
Comment=
Exec=x11vnc -forever -usepw -httpport 5900
StartupNotify=false
Terminal=false
Hidden=false

Finish pasting with CTRL+D

Password file (~/.vnc/passwd) you can create using vncpasswd command.

vnc4server

in file ~/.vnc/xstartup

add before executing x-session:

~/.vnc/xstartup
if test -z "$DBUS_SESSION_BUS_ADDRESS" ; then
	eval `dbus-launch --sh-syntax –exit-with-session`
	echo "D-BUS per-session daemon address is: \
	$DBUS_SESSION_BUS_ADDRESS"
fi

Update: It looks like now vncserver expects that xstartup to stay foreground, so simply:

~/.vnc/xstartup
xsession &
dbus-launch --exit-with-session lxsession

Sound

apt-get install pavucontrol pavumeter

Trackball/mouse

apt-get install xinput

For touchscreen, please install also xinput-calibrator

xinput list # to see device list and ids
xinput list-props 10 # list props for device id=10