Tiny Core Linux
Tiny Core Base => TCB Q&A Forum => Topic started by: uggla on January 31, 2011, 12:18:13 PM
-
Hi!
I have three boot options: Xorg, Xvesa and xvnc. Xorg and Xvesa automatically adds the correct line to .xsession but xvnc doesn't. How can I achieve this?
-
x11vnc is not an X server. It will let you connect via VNC to an existing one (xorg or xvesa).
If you want a standalone VNC server, I recommend tightvnc. Note that it doesn't have the mentioned autoconfig either, because it is assumed the general user will not want their only display be vnc.
-
You can use x11vnc as a xserver without loading either Xorg or Xvesa.
http://forum.tinycorelinux.net/index.php?topic=7720.0
-
Xvnc != x11vnc.
-
Oops! Sorry I got confused (I'll change the thread title). Well, how can I add the right xvnc command to .xsession at boot?
-
Personally I have ".xsession.Xvesa_base" ".xsession.Xorg" ".xsession.Xvesa_new" in backup; then I copy the appropriate one to .xsession
-
Would it work to create three different extensions with different .xsession that I put in xorg.lst, xvesa.lst, xvnc.lst?
-
Not sure if an extension would be a good idea for a configuration file like .xsession
In any such case, you would have to exclude home/tc/.xsession from backup, to avoid overwriting the file.
-
I have a persistent home, but if I would put it in backup the way you suggested can I place the copy command in bootlocal.sh and have the correct x start at boot?
-
Edit .xsession to have the correct line for your VNC options, and add "echo Xvnc > /etc/sysconfig/desktop" to bootsync.sh. Untested, but should let you have your only display be VNC.
-
But if I boot with xorg or xvesa won't my vnc options cause trouble? Do I still need three different .xsession files?
-
It's not clear what you want here... If you want our help, do describe your situation in more detail.
-
I want three boot alternatives in Grub:
1. TC with Xorg
2. TC with Xvesa
3. TC with (only) Xvnc
To achieve this I have created three different onboot.lst-files that are passed as boot option. One loads xorg, the next loads xvesa and the last loads tightvnc. Xorg and Xvesa automatically alters .xsession at boot. I need a simple way to do that for Xvnc as well.
-
Oh ok. To do that either edit the tightvnc extension, or check for a bootcode in bootsync.sh. In the second case, your boot entry would include something like "xvnc".
grep xvnc /proc/cmdline && echo Xvnc > /etc/sysconfig/desktop && cp /path/to/.xsession.xnvc /home/tc/.xsession
-
I will test that. Thanks!
-
Is there a simple way to substitute the first line in a text file? (Googled echo, cat, tail and sed but got only confused).
-
Is there a simple way to substitute the first line in a text file? (Googled echo, cat, tail and sed but got only confused).
sed '1s/^/inserted-text\n/' -i /home/tc/.xsession
-
That wasn't quite right. This worked though:
sed -e '1d' -e '2i\newtext' -i /home/tc/.xsession
-
My reply was based on the snippet I tested with busybox sed:
tc@box:~$ seq 1 3|sed '1s/^/first\n/'
first
1
2
3
A different sed might give you different results.
-
I got the same result but I wanted to substitute the first line, not add a new one.
-
Whilst a "delete first line and insert before the second" approach (as mentioned in reply #17) should work I wonder why you don't just substitute the entire line (via a 's/^.*$/replacemnet text/' expression).
Or along the lines of the formerly shown example:
tc@box:~$ seq 1 3 | sed '1s#^.*$#first#'
first
2
3
BTW, a few good links related to SED are mentioned here (http://forum.tinycorelinux.net/index.php?topic=5942.0).
-
I got the same result but I wanted to substitute the first line, not add a new one.
Sorry, I see that now. I did not read your question clearly.
-
Thanks anyway, you pointed me in the right direction. ;)