Tiny Core Linux
Tiny Core Base => TCB Talk => Topic started by: ikeji on March 02, 2016, 02:06:22 AM
-
Hi,
I want to create package that uses X and start automatically.
What's the correct way to do this?
Option A
Do something like "echo 'newprog&' >> /home/tc/.xsession" in tce.installed.
Option B
Include a file /home/tc/.X.d/newprog.sh
I feel both A and B is not good because it's will be backuped by filetool.sh.
Is there any good way to do this?
-
From the FAQ:
How do I start X apps on boot?
Add them to files in /home/tc/.X.d, one per file, backgrounded. Here's how to start Opera at boot:
opera &
You can add files to /opt/.xfiletool.lst to exclude them from your backup
-
You can add files to /opt/.xfiletool.lst to exclude them from your backup
Did you prefer to add to /opt/.xfiletool.lst from tce.installed script?
I think it will be overwritten by restore step.
-
Why are you worried about not backing up the file?
-
I had a similar problem, but I did not want anything that needs a writable disk (burnable to CD). So I repackaged TinyCore. To keep my changes separate from the original files, I did not modify the original files, but created a script that will patch the original files.
Another advantage of this approach is that I added a boot option for this. So I can boot the unmodified version or a patched version.
A script that will patch ".xsession" may look like this. I'm no sed expert, maybe there are better ways to do this. But it works.
#!/bin/sh
sed -i '
/"$DESKTOP"/ i if [ -s /etc/sysconfig/rdesktop ]; then
/"$DESKTOP"/ i XIT=1
/"$DESKTOP"/ i while [ $XIT -gt 0 ]; do
/"$DESKTOP"/ i /usr/local/bin/startrdesktop
/"$DESKTOP"/ i /usr/local/bin/exittc_a;
/"$DESKTOP"/ i XIT=$?;
/"$DESKTOP"/ i done
/"$DESKTOP"/ i fi
' /home/"$USER"/.xsession
It starts a RDP client. If the RDP client terminates a modified version of "exittc" will ask the user, if he likes to shutdown or restart the RDP client.