I'm using fedora 21 remotely from Win7 remote desktop client. But the tigervnc screen resolution size is not properly set automatically. So I have to enter the following command every time after the gnome3 session begins.

xrandr --output VNC-0 --mode 1280x1024

I want to run this command automatically every time when gnome session begins. How can I do this? By the way my current ".vnc/xstartup" is like following.

$ cat $HOME/.vnc/xstartup

[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
vncconfig -iconic &
dbus-launch --exit-with-session gnome-session &

Any idea?


I searched over the web and found the information about this. So, I tried the following. And it seems working.

1) Make a *.desktop file under the .config/autostart/ directory.

$ vi $HOME/.config/autostart/xrandr-startup.desktop

[Desktop Entry]
Comment=Start these up at login

2) Make a shell script which runs xrandr command.

# vi /usr/local/bin/xrandr-startup.sh

xrandr --output VNC-0 --mode 1280x1024

# chmod +x /usr/local/bin/xrandr-startup.sh

But some times, following dialog displayed before login.

| Authentification Required
| Authentification is required to create a color managed device
| Password: [   ]

I'm not sure how to avoid this.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.