Ask Your Question

Autostart Scripts in Fedora 24.

asked 2016-06-28 23:19:24 -0500

PseudoDev gravatar image

hello there!

I have updated to fedora 24. The resolution of my pc was locked at 1024x786 for some reason and i have given up trying to fix it. anyways, xrandr is a good work around but i have to execute the scripts everytime after start up. I looked upon this thread upon starting files on startup. But it didn't work! Where did i go wrong?

Here's what i did:

Created a file named file in "/etc/init.d/" Then, made it executable by using "chmod +x /etc/init.d/" Also, these are the lines i added in the file:

Pastebin copy of my

Where did i go wrong!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2016-06-29 04:34:12 -0500

wulfara gravatar image

Hi. Try this:

Create a file with .desktop extension in your ~/.config/autostart/ something like '~/.config/autostart/resfix.desktop'

Edit that file to look like this:

[Desktop Entry]
Name=Resolution Fix

Change the "Exec" line to match the path of your script. If the script is placed inside your home write the full path (for me it doesn't work if I use "~/..." insted of "/home/myuser/...").

This only works if the script is executable by your user without sudo but as far as I know xrandr can be executed without root access level.

Hope this helps.

edit flag offensive delete link more


Executable? So you mean i need to chmod +x it befor using?

PseudoDev gravatar imagePseudoDev ( 2016-06-29 11:02:31 -0500 )edit

The ".desktop" file doesn't need to be +x, the ".sh" file does

wulfara gravatar imagewulfara ( 2016-06-29 11:19:28 -0500 )edit

You, Sir, are a genius! It worked. Anyways, the whole point of doing what i did earlier to make the commands run as root and make it available for all users. Any idea why that didnt work?

PseudoDev gravatar imagePseudoDev ( 2016-06-29 21:40:38 -0500 )edit

I'm happy I helped :) To autorun root scripts at boot you have to create your own systemd service: - Create a file .service file under /etc/systemd/system something like /etc/systemd/system/resfix.service - Fill it like this:

Description=Resolution fix


  • Enable: systemctl enable resfix.service and reboot. But I'm not a systemd expert and I don't know if that will run after X server does.
wulfara gravatar imagewulfara ( 2016-06-30 03:04:56 -0500 )edit

Another option is to place your script somewhere readable by everybody like /usr/local/bin/ and duplicate my first answer for each user (create ~/.config/autorun/resfix.desktop for everybody). Make sure that is readable and execubable by everybody chmod +rx

wulfara gravatar imagewulfara ( 2016-06-30 03:18:46 -0500 )edit

Question Tools

1 follower


Asked: 2016-06-28 23:19:24 -0500

Seen: 8,679 times

Last updated: Jun 28 '16