Tuesday, January 17, 2017

Why Linux sucks

First off, I love Linux (sorry Richard; Gnu/Linux). I particularly love Xubuntu. It's simple, stays out of your way and most importantly to my eye, blue.

I recently purchased a second hand Xeon tower. It came with a bottom of the line Quadro video card. I was fine with it since I had no intention of using the computer to do any heavy 3D applications, just be a workstation and display a desktop. Well, two actually. Because of the limited ram in the card it wasn't able to drive two 1080p monitors and provided me with some incredibly slow reactions as it desperately tried to shuffle memory around.

I upgraded to a slightly more modern 710 card. This provided enough ram and power to run the two monitors without any tearing or hesitation, even with the Nouveau driver. I was happy. I had my favorite desktop with two monitors and set down to get some work done. My computer froze. It locked up completely. I couldn't even ssh in from my laptop. It had completely stopped responding.

Despondent, I powered off the machine and started it back up, watching the startup carefully for issues as it booted. Other than the expected journal recovery nothing seemed amiss. I went through the logs and found no hint of any issues. In desperation I decided that it might be something to do with the way Ubuntu was configuring things and distro hopped to Cent OS, Slackware and even tried Arch and Gentoo. All eventually did the same thing, regardless of desktop environment.

I went back to Xubuntu and everything seemed to work fine for a few days and then it happened again. Then I noticed when it was happening. While the graphics were performing some work intensive action. I swapped out the Nouveau driver for the proprietary Nvidia one. I haven't had a problem since. This leads me to believe there is a serious issue with the open source driver. I'm not sure what it is, or even how to report the bug since I can't reliably replicate it. I am just disappointed.

Saturday, January 7, 2017

LightDM with multiple monitors

I've come across a small annoyance with LightDM. I'm not sure if this problem exists with others, such as GDM, but it would probably fix that too, if it does. After a time, which can be set by the user, the screen goes black and locks as it should. However, when using more than one monitor, the lock screen can seem to appear at random on any screen. Actually, it's not random. It shows up on the screen where the mouse was when it locked. If you wish that it stayed on the same monitor all the time, then here's the solution. It requires the xdotool to be installed. It may even come with your distribution, but usually isn't installed by default. Next add the simple script below to your path. Add it as an autorun application and your done! Your login screen will always show up on the left most monitor (and so will your mouse).
#!/bin/sh
# TITLE: Move Mouse
# DATE:  03 DEC 2016
#
# DESCRIPTION: This simple script moves the mouse to the to the left side of
#    the screen for the purpose of keeping the login window on
#   the left monitor
#
dbus-monitor --session "type='signal',interface='org.mate.ScreenSaver'" |  \
while read x 
  do 
    case "$x" in  
      *"boolean true"*) xdotool mousemove 100 200
    esac 
done &

How the script works
The script tells dbus to let it know when then screen saver goes active. At that time it executes the xdotool command that moves the mouse to location 100 by 200 pixels. If you wish it to display on another monitor you will have to move the mouse to a value larger than the width of the left most monitor (or two if you have three or more). 'interface' is the dbus name for your action you are monitoring. In this example the mate screensaver. If you have another screensaver running you will have to change it to the appropriate name.