N
N
Name_One2016-12-23 15:29:34
linux
Name_One, 2016-12-23 15:29:34

Autorun .sh not working?

Yes, the Internet canopy of similar questions, but nothing helps me.
The problem is the screen resolution, there is no required size.
Created a .sh file in the "Home Folder" section (maybe it's in Cyrillic?);
I put this in there:

#!/bin/bash
cvt 1280 1024
xrandr --newmode "1280x1024_60.00"  109.00  1280 1368 1496 1712  1024 1027 1034 1063 -hsync +vsync
xrandr --addmode VGA-1 1280x1024_60.00
xrandr --output VGA-1 --mode 1280x1024_60.00

(If you run it manually, it works.)
But then hell begins, you need to add it to autoload.
Tried adding my .sh to "Startup", no result.
I tried to add this code to the rc.local file:
/bin/bash /home/larsenone/bin/screen.sh
And I tried the variant with xorg.conf
Most often, the rc.local file helps everyone and this is where the conversation ends.
Has anyone encountered such an ambush?

Answer the question

In order to leave comments, you need to log in

5 answer(s)
N
Name_One, 2016-12-30
@Name_One

Everything turned out to be much simpler) It was necessary in the file properties to check the box " Allow file execution as a program ".
But anyway, thank you all.

M
Mika Slepinin, 2016-12-23
@mikalaikaia

If the system has systemd, try adding autorun through it, something like this:

[Unit]
Description=xrandr

[Service]
ExecStart='xrandr --newmode ... и так далее'

[Install]
WantedBy=multi-user.target

A
Anton Shvets, 2016-12-23
@Xuxicheta

/home/larsenone/bin/screen.sh - is this how it starts?
And another question, is the disk with / home registered in fstab?

N
Nikolai Romanovich, 2016-12-23
@MikalaiR

Try to write this code in ~/.xinitrc

Z
Zhep Ebrilov, 2016-12-29
@baragoon

or in ~/.config/autostart/ create file.desktop and run the desired script in it

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question