Dual monitor Awesome WM with xrandr

I struggled a couple of days until I figured it out that setting up dual monitor via xrandr is needed after X started and before aweome started, so in between.

The solution was adding xrandr exec line into my .xinitrc

# ~/.xinitrc
xrandr --setprovideroutputsource modesetting NVIDIA-0
xrandr --auto

function VGAConnected {
   ! xrandr | grep "^VGA-1" | grep disconnected
if VGAConnected; then
    xrandr --output eDP-1-1 --mode 1920x1080 --primary \
           --output VGA-1-1 --mode 1920x1080 --rotate normal --right-of eDP-1-1

exec awesome -c .config/awesome/rc.lua

to get the screen names (eDP-1-1, VGA-1-1, etc.) just run xrandr without args.

Fixing unknown public key

While installing a package from AUR I got the following error:

FAILED (unknown public key 2E1AC68ED40814E0)

The fix was to download the public key with gpg:

$ gpg --recv-key 2E1AC68ED40814E0
gpg: /home/mike/.gnupg/trustdb.gpg: trustdb created
gpg: key 93298290: public key "Tor Browser Developers (signing key) <torbrowser@torproject.org>" imported
gpg: no ultimately trusted keys found
gpg: Total number processed: 1
gpg:               imported: 1

Ignore mplayer config for one run

I got the following error from mplayer:
FATAL: Could not initialize video filters (-vf) or video output (-vo).

I have VDPAU set in .mplayer/config by default.

To ignore user config for one playback I used the -noconfig user param.

On the Arch Linux wiki there’s mentioned a shell script to auto detect VDPAU compatibility.

Switching keyboard layout in X on Linux

Finally I decided to reserve time to figure out how to switch keyboard layout to be able to write language specific characters.

As usually the Arch Wiki was very resourceful and helpful https://wiki.archlinux.org/index.php/Keyboard_configuration_in_Xorg

Just run the following in terminal and it worked with Alt+Shift

mike@localhost$ setxkbmap -model pc104 -layout us,sk -variant ,qwerty -option grp:alt_shift_toggle

I then added the configuration into Xorg servers config to avoid issuing the command after restart.

# /etc/X11/xorg.conf.d/00-keyboard.conf
Section "InputClass"
    Identifier "system-keyboard"
    MatchIsKeyboard "on"
    Option "XkbLayout" "us,sk"
    Option "XkbModel" "pc104"
    Option "XkbVariant" ",qwerty"
    Option "XkbOptions" "grp:alt_shift_toggle"

logrotate error: stat of /var/log/xferlog failed

In Arch Linux the logrotate service was failing:

user@host# systemctl start logrotate.service 
Job for logrotate.service failed. See "systemctl status logrotate.service" and "journalctl -xe" for details.

So I ran it by hand to debug:

user@host# logrotate /etc/logrotate.conf

And the following error appeared:

logrotate error: stat of /var/log/xferlog failed

I fired up a grep for xferlog in the /etc directory:

user@host:/etc# grep -r xferlog *

Solution was commenting the xferlog rule in logrotate.d/proftpd. I don’t need the transfer log.