Tiny Core Linux
Tiny Core Base => TCB Talk => Topic started by: TopNotch on March 13, 2019, 12:22:38 PM
-
I need a way to exit to terminal from a script. In other words, to what Ctrl-Alt-Backspace does, but from a a script.
I want to open a terminal window, run a script that does a few things, and ends with exiting from GUI to terminal.
-
Hi TopNotch
If you are trying to exit X to end up at the console, then this should get you there:
sudo kill $( cat /tmp/.X${DISPLAY:1:1}-lock ) &
That is how exittc exits to a console prompt.
-
Rich, that works by itself, but here's what I'm trying to do.
Starting from terminal mode, I want to startx, run feh to display a graphic image, and when the user presses Esc to exit form feh, it should go back to terminal mode. I added a line to .xsession to run feh and display the image, and I tried your line after that line. When I press Esc, it goes to a cross-hatch background, not to terminal mode.
-
Hi TopNotch
Please post your .xsession file.
-
There are also image viewers for the framebuffer.
-
curoga, is tere a program in the repository that is an image viewer for the framebuffer? If so, what is it?
Rich, here is my .xsession file:
/usr/local/bin/Xfbdev -mouse /dev/input/mice,5 -nolisten tcp -I >/dev/null 2>&1 &
export XPID=$!
waitforX || ! echo failed in waitforX || exit
"$DESKTOP" 2>/tmp/wm_errors &
export WM_PID=$!
feh ship.jpg
sudo kill $( cat /tmp/.X${DISPLAY:1:1}-lock } &
[ -x $HOME/.setbackground ] && $HOME/.setbackground
[ -x $HOME/.mouse_config ] && $HOME/.mouse_config &
[ $(which "$ICONS".sh) ] && ${ICONS}.sh &
[ -d "$HOME/.X.d" ] && find "$HOME/.X.d" -type f -print | while read F; do . "$F"; done
-
Hi TopNotch
I think your problem is because you inserted those commands in the middle of the file. Either move them to the end like this:
/usr/local/bin/Xfbdev -mouse /dev/input/mice,5 -nolisten tcp -I >/dev/null 2>&1 &
export XPID=$!
waitforX || ! echo failed in waitforX || exit
"$DESKTOP" 2>/tmp/wm_errors &
export WM_PID=$!
[ -x $HOME/.setbackground ] && $HOME/.setbackground
[ -x $HOME/.mouse_config ] && $HOME/.mouse_config &
[ $(which "$ICONS".sh) ] && ${ICONS}.sh &
[ -d "$HOME/.X.d" ] && find "$HOME/.X.d" -type f -print | while read F; do . "$F"; done
feh ship.jpg
sudo kill $( cat /tmp/.X${DISPLAY:1:1}-lock } &
or add an exit statement like this:
/usr/local/bin/Xfbdev -mouse /dev/input/mice,5 -nolisten tcp -I >/dev/null 2>&1 &
export XPID=$!
waitforX || ! echo failed in waitforX || exit
"$DESKTOP" 2>/tmp/wm_errors &
export WM_PID=$!
feh ship.jpg
sudo kill $( cat /tmp/.X${DISPLAY:1:1}-lock } &
exit
[ -x $HOME/.setbackground ] && $HOME/.setbackground
[ -x $HOME/.mouse_config ] && $HOME/.mouse_config &
[ $(which "$ICONS".sh) ] && ${ICONS}.sh &
[ -d "$HOME/.X.d" ] && find "$HOME/.X.d" -type f -print | while read F; do . "$F"; done
-
Hi TopNotch
curoga, is tere a program in the repository that is an image viewer for the framebuffer? If so, what is it?
If my previous answer doesn't solve your problem and you want try a framebuffer based image viewer there's fbv.
-
Forgot to mention that I'm trying to do this on Tiny Core 64. fbv is not in the repository for 64-bit Tiny Core, so I'm trying to compile it. It needs libungif. I see libgif in the repository, but not libungif. Any ideas?
-
Hi TopNotch
I take it my previous suggestions did not help? Try using the source package and build script (ashes) from here:
http://tinycorelinux.net/4.x/x86/tcz/src/fbv/
-
Hi TopNotch
Hi TopNotch
... Try using the source package and build script (ashes) from here:
http://tinycorelinux.net/4.x/x86/tcz/src/fbv/
You'll want to modify these flags for x86_64:
export CFLAGS="-march=i486 -mtune=i686 -Os -pipe"
export CXXFLAGS="-march=i486 -mtune=i686 -Os -pipe"
export LDFLAGS="-Wl,-O1"
as per the Wiki:
http://wiki.tinycorelinux.net/wiki:creating_extensions#installing
-
Rich,
It turns out that the source you gave was too old to build under my version of TC (9.0). I found a later source which builds fine.
https://github.com/godspeed1989/fbv
Thanks for the help.
-
fbv posted to CorePure64 repo