Tuesday, May 27, 2014

Dual Monitor Setup and Linux


Dell XPS - l502x and 19'Dell monitor

The l502x, where can I start ? Most days I love it, the other days I loathe it. I spent more on it than a MacBook air would cost, and I did not get the high screen resolution, light weight or battery life. Things that are proving very important as I am concentrating more on development. But what I did get is a Nvidia GPU and JBL speakers(which are awesome btw). And all this I can live with, especially given that it can run games on Windows 7 like a boss. But then Nvidia had to go and add Optimus technology to it and not provide support(sketchy support) for that in Linux. And Linux being my primary OS, it makes me hate by little machine sometimes.

So, now I go ahead and buy a monitor so that I could have more screen real estate. Got a cheap 19 inch monitor for 40 euros. The monitor has a VGA port only and the lappy has HDMI and mini display ports.  Now I for one did not know that the small pesky port was a mini display port and went ahead and bought a VGA to HDMI convertor and a HDMI cable, 30 more euros down the drain. And did it work ? No. Neither Linux nor Windows seem to detect it. Tested all PnC and the bottom line was that by Nvidia which owns the HDMI port on my lappy was not ready to accept my monitor for output. 

So after some head banging on the Internet, I decided that the mini display port was the way to go. So I bought another mini display port o VGA converter. And it worked from the get go. No new packages need to be installed, no new drivers need to be installed, nothing. I could even have bumblebee installed and do my power saving for the laptop.

So, for this setup, just get a mini display port to VGA converter.

Multiple Screen Wallpapers

To get the multiple-screen wallpapers going on Linux, install nitrogen. The thing is pretty self explanatory and does not need much sorcery. You can refer to the description here. (However, there seems to be some bug with nitrogen and crashes after some random time.)

Screen resolution

In case I am travelling and my native resolution does not provide me with much real estate on the screen, I use the software called newrez developed by Marc. This can be accessed from here. This is again a simple program and pretty easy to use.
The site does say that it supports dual monitor, but I was getting errors on running it for multiple monitors. But the code is readable in newrez file. One can always debug that to get it to work on dual monitors.


Conky

On multiple screens conky is again difficult to use. I found a cool config here. While running this, conky was crashing on my. So I had to compare the default config(this was working for me, /etc/conky/conky.conf)  with the new config from noobslab. The variable "own_window_type override" turned out to be the culprit, so I had to comment that out.

But then conky was getting printed in the middle of the second monitor. This can be solved by changing the value of gap_x and testing it till you get it placed in the desired location.

Terminator

I was also looking for some cool themes for my terminator window. 
First off I needed to add the cowsay|fortune|toilet combo that would print a output as below whenever the terminal was opened.

I then wanted to have a terminator color scheme that was better than solarized(though this is pretty cool, it feels out of place in backgrounds where the colors are bright like green, yellow, etc). On wandering the Internet I  stumbled upon this site, where you can adjust the color settings to get a terminator theme of your liking. The changing of settings takes a little time to getting used to(just make sure that the column before the column 40m is pretty neat, that would take care of most of your daily terminal views). Once the settings are to your liking, click get scheme, select "terminator" and you have your config file generate. Add the generated config to ~/.config/terminator/config file under "profiles". My config looked like this.

  [[4bit-dirty-yellow]]
    scrollbar_position = hidden
    palette = "#363b2c:#731f34:#3e780f:#73520f:#194469:#4d1f69:#197843:#868b7c:#545949:#8a1f3e:#488f0f:#8a610f:#194e80:#5b1f80:#198f51:#909686"
    background_color = "#e6ac2f"
    background_image = None
    foreground_color = "#363b2c"

The code for terminal prompt.

#! /usr/bin/python
import os; 
import random;

#Get the list of files in the cows location !!
var1 = os.listdir("/usr/share/cowsay/cows");
var2 = ["-b", "-d", "-g", "-p", "-s", "-t", "-w", "-y"];

#Generate a random
rand1 = random.randint(0,len(var1)-1);
rand2 = random.randint(0,len(var2)-1);

#Generate the command string
cmd1 = str("fortune -a | cowsay -n " +var2[rand2]+ " -f /usr/share/cowsay/cows/" + var1[rand1]) + " | toilet -F gay -f term";
#print cmd1;
os.system(cmd1);


No comments:

Post a Comment