Dual Monitor Setup with Gnome 3

Gnome 3 has the annoying pre-configuration that workspaces are available only on the primary screen. You can change that with the following command

gsettings set org.gnome.shell.overrides workspaces-only-on-primary false

For further details please see http://ibohm.blogspot.co.at/2012/01/fix-dual-monitors-in-gnome-3-and-some.html

Maybe you also want to change which screen should be considered your primary monitor. First, you need to know your monitors‘ names by running

xrandr

Second, issue the command

xrandr --output  --primary

replacing <display> with you monitor’s name.

For further details please see http://rainhilltrials.blogspot.co.at/2011/09/changing-primary-display-in-gnome-3.html

The following script automates these tasks.

#!/bin/bash

###########################################################
# Author: Christoph D. Hermann
#
# Provided without any warranty.
###########################################################

# defines the name of the monitor port
# enter your external monitor's port name here
# it is one of the output values of xrandr
port="VGA1"

# workspaces on all monitors
# 0 ... keep the current configuration
# 1 ... enable worspaces on all monitors
# 2 ... disable workspaces on all monitors
workspaces=1

# don't change anything here unless you know what you're doing

connected=`xrandr | grep "$port connected"`

# check if a monitor is connected to that port by comparing the lengt
# of the return value
if  [ `expr length "$connected"` -gt `expr length "$port"` ]; then
    echo "Monitor $port is connected. Setting it as the primary monitor.";
    xrandr --output $port --primary;
else
    echo "No monitor conntected to port $port".;
fi

if [ $workspaces -eq 1 ]; then
    echo "Enabling workspaces on all monitors."
    gsettings set org.gnome.shell.overrides workspaces-only-on-primary false;
fi

if [ $workspaces -eq 2 ]; then
    echo "Disabling workspaces on all monitors."
    gsettings set org.gnome.shell.overrides workspaces-only-on-primary true;
fi

For running this script on every log-in, you can add it to the start up programs. For opening the configuration interface issue the command

gnome-session-properties

.

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert.

Time limit is exhausted. Please reload the CAPTCHA.