Post here if you are a new Porteus member and you're looking for some help.
-
mcabel
- White ninja
- Posts: 19
- Joined: 09 Aug 2018, 23:56
- Distribution: mgame
Post#1
by mcabel » 05 Dec 2022, 20:13
How do I put this .sh on startup?
Redshift3000.sh
mcabel
-
Ed_P
- Contributor
- Posts: 8373
- Joined: 06 Feb 2013, 22:12
- Distribution: Cinnamon 5.01 ISO
- Location: Western NY, USA
Post#2
by Ed_P » 05 Dec 2022, 21:45
Add the .sh file to /etc/profile.d as root.
Ed
Ed_P
-
ncmprhnsbl
- DEV Team
- Posts: 3941
- Joined: 20 Mar 2012, 03:42
- Distribution: v5.0-64bit
- Location: australia
-
Contact:
Post#3
by ncmprhnsbl » 06 Dec 2022, 01:03
Ed_P wrote: ↑05 Dec 2022, 21:45
Add the .sh file to /etc/profile.d as root.
generally, this location is for setting environment variables, not random commands..
putting that command in /etc/rc.d/rc.local is more conventional
or
creating a .desktop file and putting it in ~/.config/autostart (or /etc/xdg/autostart) like this:
redshift.desktop:
Code: Select all
[Desktop Entry]
Version=1.0
Type=Application
Name=redshift
Exec=redshift -P -O 3000
or in that .desktop:
Exec=/path/to/the/script.sh
or
add to the APPEND line of /boot/syslinux/porteus.cfg :
guiexec=reshift~-P~-O~3000 (~ replaces spaces) or guiexec=/path/to/the/script.sh
Forum Rules : https://forum.porteus.org/viewtopic.php?f=35&t=44
ncmprhnsbl
-
gnintilgyes
- Black ninja
- Posts: 73
- Joined: 14 Sep 2022, 17:52
- Distribution: Debian
Post#4
by gnintilgyes » 06 Dec 2022, 02:37
ncmprhnsbl wrote: ↑06 Dec 2022, 01:03
generally, this location is for setting environment variables, not random commands..
putting that command in /etc/rc.d/rc.local is more conventional
or
creating a .desktop file and putting it in ~/.config/autostart (or /etc/xdg/autostart) like this:
redshift.desktop:
Code: Select all
[Desktop Entry]
Version=1.0
Type=Application
Name=redshift
Exec=redshift -P -O 3000
I learned something else about Linux. Even though once I had to tread around "/etc/rc.d" looking how to turn "init 3" into "init 4" after I installed Slackware 32-bit and created a regular user. :)
gnintilgyes
-
Ed_P
- Contributor
- Posts: 8373
- Joined: 06 Feb 2013, 22:12
- Distribution: Cinnamon 5.01 ISO
- Location: Western NY, USA
Post#5
by Ed_P » 06 Dec 2022, 06:45
ncmprhnsbl wrote: ↑06 Dec 2022, 01:03
Ed_P wrote: ↑05 Dec 2022, 21:45
Add the .sh file to /etc/profile.d as root.
generally, this location is for setting environment variables, not random commands..
putting that command in /etc/rc.d/rc.local is more conventional
or
creating a .desktop file and putting it in ~/.config/autostart (or /etc/xdg/autostart) like this:
redshift.desktop:
Code: Select all
[Desktop Entry]
Version=1.0
Type=Application
Name=redshift
Exec=redshift -P -O 3000
or in that .desktop:
Exec=/path/to/the/script.sh
or
add to the APPEND line of /boot/syslinux/porteus.cfg : guiexec=reshift~-P~-O~3000 (~ replaces spaces) or guiexec=/path/to/the/script.sh
An excellent posting
ncmp.
We need to find a way to add it to the forum's help file.
Ed
Ed_P
-
roro
- Black ninja
- Posts: 65
- Joined: 04 Aug 2022, 08:41
- Distribution: Porteus 5.0 XFCE
Post#6
by roro » 06 Dec 2022, 16:58
Hi ncmp... and ED_P
Now I've learned two things at once
"desktop file" and "autostart"
That means I have to check the forum every day.
But where do I have to save the desktop file
/home/guest/.config/autostart
or /etc/xdg/autostart
Both: autostart, what is the difference, what is xdg ?
roro
-
ncmprhnsbl
- DEV Team
- Posts: 3941
- Joined: 20 Mar 2012, 03:42
- Distribution: v5.0-64bit
- Location: australia
-
Contact:
Post#7
by ncmprhnsbl » 07 Dec 2022, 01:12
roro wrote: ↑06 Dec 2022, 16:58
Both: autostart, what is the difference, what is xdg
/home/guest/.config/autostart starts for guest user only, /etc/xdg/autostart starts for all users (when they login to X)
xdg is an acronym for "X (or cross) desktop group" , which is a freedesktop.org creation that handles/standardizes various functions across desktop environments, like for example: autostart, config file locations, standard desktop folders...
(don't worry, i had to look that up
)
Forum Rules : https://forum.porteus.org/viewtopic.php?f=35&t=44
ncmprhnsbl
-
Kulle
- Warlord
- Posts: 602
- Joined: 28 Jan 2017, 10:39
- Distribution: v4.0 64bit Xfce
- Location: Berlin
Post#8
by Kulle » 26 Mar 2023, 10:36
"Script.sh" file at startup
Two possibilities:
a) creating a .desktop file "Script.sh" and putting it in ~/.config/autostart
or
b) Cheatcode: guiexec=/usr/bin/Script.sh
What is better? What is recommended?
Kulle
-
Ed_P
- Contributor
- Posts: 8373
- Joined: 06 Feb 2013, 22:12
- Distribution: Cinnamon 5.01 ISO
- Location: Western NY, USA
Post#9
by Ed_P » 26 Mar 2023, 14:29
Kulle wrote: ↑26 Mar 2023, 10:36
What is better?
b) Cheatcode: guiexec=/home/guest/startup.sh
Easier to maintain, as in use or comment out or change to a different file.
Ed
Ed_P
-
Rava
- Contributor
- Posts: 5416
- Joined: 11 Jan 2011, 02:46
- Distribution: XFCE 5.01 x86_64 + 4.0 i586
- Location: Forests of Germany
Post#10
by Rava » 28 Mar 2023, 23:46
Ed_P wrote: ↑26 Mar 2023, 14:29
b) Cheatcode: guiexec=/home/guest/startup.sh
Easier to maintain, as in use or comment out or change to a different file.
when you use a rootcopy/ folder then putting the script into rootcopy/home/guest/.config/autostart is as easy to change.
When you not have a rootcopy/ folder, then Ed_P is correct.
Cheers!
Yours Rava
Rava
-
Ed_P
- Contributor
- Posts: 8373
- Joined: 06 Feb 2013, 22:12
- Distribution: Cinnamon 5.01 ISO
- Location: Western NY, USA
Post#11
by Ed_P » 29 Mar 2023, 05:39
Will my approach work with the rootcopy function? Does your approach allow the name of the script to be changed before booting Porteus?
Ed
Ed_P
-
Rava
- Contributor
- Posts: 5416
- Joined: 11 Jan 2011, 02:46
- Distribution: XFCE 5.01 x86_64 + 4.0 i586
- Location: Forests of Germany
Post#12
by Rava » 29 Mar 2023, 06:22
No and No.
But does your approach allow the changing (as in: creating, editing) of the script prior booting Porteus? No it also does not.
Cheers!
Yours Rava
Rava
-
Ed_P
- Contributor
- Posts: 8373
- Joined: 06 Feb 2013, 22:12
- Distribution: Cinnamon 5.01 ISO
- Location: Western NY, USA
Post#13
by Ed_P » 29 Mar 2023, 12:51
Rava wrote: ↑29 Mar 2023, 06:22
But does your approach allow the changing (as in: creating, editing) of the script prior booting Porteus?
Yes it does. I boot my ISO and update my scripts on my USB drive before rebooting the drive.
Ed
Ed_P
-
Rava
- Contributor
- Posts: 5416
- Joined: 11 Jan 2011, 02:46
- Distribution: XFCE 5.01 x86_64 + 4.0 i586
- Location: Forests of Germany
Post#14
by Rava » 29 Mar 2023, 16:02
Ed_P wrote: ↑29 Mar 2023, 12:51
Rava wrote: ↑29 Mar 2023, 06:22
But does your approach allow the changing (as in: creating, editing) of the script prior booting Porteus?
Yes it does. I boot my ISO and update my scripts on my USB drive before rebooting the drive.
I wrote:
Can you update your script prior booting Port.
Booting Port via ISO is still booting Port. So the correct answer is: no, you cannot change the script without booting Port.
Cheers!
Yours Rava
Rava
-
Ed_P
- Contributor
- Posts: 8373
- Joined: 06 Feb 2013, 22:12
- Distribution: Cinnamon 5.01 ISO
- Location: Western NY, USA
Post#15
by Ed_P » 29 Mar 2023, 20:33
Rava wrote: ↑29 Mar 2023, 16:02
Booting Port via ISO is still booting Port. So the correct answer is: no, you cannot change the script without booting Port.
Ok but actually I can update it without booting Port or the ISO. I plug the USB stick into my Windows system and add/delete/rename the script that way. NO booting needed.
Ed
Ed_P