Tiny Core Linux
Tiny Core Base => TCB Q&A Forum => Topic started by: saravanan on January 26, 2010, 06:18:24 AM
-
Hi all,
How to restart Xvesa with different resolution in Tinycore.
Please help
-
From the main menu (right click), select Tools -> Xvesa Setup.
-
I need to do this with a command or script.
By default my TC resolution is 1024x786 that is fine, but i also want an option to switch to 800x600 resolution.
Or where do i find the command that is executed behind the process mentioned?
-
The resolution for Xvesa is controlled in .xsession. The script that menu item calls is xsetup.sh.
-
yes i can find the Xvesa startup script in .xsession, when i run xsetup.sh/xsetup command, i can select the resolution and the mouse type, after which i don't find any change in resolution. How to bring the change?
-
Restart X for the changes to take effect - "exit to command line" from the menu, and "startx".
-
Restart X for the changes to take effect - "exit to command line" from the menu, and "startx".
Yes it worked curaga, but i just need to change to 800x600 resolution with a single shot, without requiring the user to select the resolution.
Need it on a single click or that may invoke a script/command that will kill the existing GUI and start the X again with new resolution.
if i kill x while being inside x, it will kill the script too.
How to tackle this ?
-
you could for example use the extension actkbd.
it runs as a daemon by user root in the background and listens for keyboard shortcuts. when pressed, he could invoke a script like
#!/bin/sh
killall Xvesa
DISPLAY=:0 su -c 'startx' tc
the acpi(d) feature in /etc/acpi/events and so on may be used as well.
-
you could for example use the extension actkbd.
it runs as a daemon by user root in the background and listens for keyboard shortcuts. when pressed, he could invoke a script like
#!/bin/sh
killall Xvesa
DISPLAY=:0 su -c 'startx' tc
the acpi(d) feature in /etc/acpi/events and so on may be used as well.
1000 points for gutmensch, thanks :)
-
still i find a problem, when i kill Xveas and restart it by running the command present in .xsession and changing the resolution param like,
Xvesa blah blah 800x600x32 blah blah
starts X, buit there is no background , i can just see the wbar fine and there is no window theme like the proper window border that is used to be there before.
or how to use startx(what does startx command trigger??) and give startx a 800x600 resolution parameter????
-
Xvesa is just the X server, there are other programs running as well like the window manager, mouse_config, etc.
Boot tinycore normally, open a terminal, do "$ ps aux" and look what processes are running. By chance there are some, which you have to kill too, otherwise the whole thing doesn't work, cos he restarts Xvesa but e.g. the window manager is still running and doesn't start again when .xsession is called.
-
Thanks gutmensch, but is there any way to kill all processes started by .xsession and then to run another duplicated.xsession script with just the resolution parameter edited?
-
it doesn't need duplication.. you can edit the .xsession file in place with a command like
sed -i -e 's/800x600/1024x768/' /home/tc/.xsession
which you could call before the restart of Xvesa.
for killing all child processes of .xsession you'll have to do something like here: http://www.unix.com/unix-dummies-questions-answers/5245-script-kill-all-child-process-given-pid.html (http://www.unix.com/unix-dummies-questions-answers/5245-script-kill-all-child-process-given-pid.html)
-
X apps die when X dies. Possibly startx has to be executed from /home/tc for everything to work:
DISPLAY=:0 su -c ' cd /home/tc; startx' tc
-
Nice trick gutmensch, and curaga :)
Thank you,
But rather than invoking this as a key combination triggered event, is there any other way to call the actkbd and run the config file specified?
-
You can have a menu item, icon, or launch that script some other way. This is linux we're talking about :)
Actkbd isn't needed if you don't want a key/key-combo.
-
i opt for an icon rather, how do i do that if i don need actkbd otherwise?
-
See http://tinycorelinux.com/wiki/tiki-index.php?page=iconmenuinfo
http://tinycorelinux.com/wiki/tiki-index.php?page=Creating+Extensions
The recommended way is to create an extension with the icon. Note that for the icon to show a menu item should also be there.
-
yes curaga, i learnt about editing the wbar config file, but what is the command that is required to be executed in case of clicking that icon.
ie. for tat icon info as in wbar conf :
i:/usr/local/tce.icons/something.png
t:restartX
c:/usr/local/bin/restartx.sh
In the above case, what should the restartx.sh contain,
if i add, killall Xvesa; wont this kill the child(restartx.sh) also??, so that it may fail to start X again???
If i am wrong, please guide me.
-
I think that since it's not a X process itself, it should continue to run. If not, you can use "nohup" to protect it.
-
thanks curaga, with nohup it works fine :)