0

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

#!/bin/sh
[ -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?

0

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]
Name=xrandr-startup
GenericName=xrandr-startup
Comment=Start these up at login
Exec=/usr/local/bin/xrandr-startup.sh
Terminal=False
Type=Application
X-GNOME-Autostart-enabled=true

2) Make a shell script which runs xrandr command.

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

#!/bin/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.