Tiny Core Linux

Tiny Core Extensions => TCE Q&A Forum => Topic started by: rexi on November 29, 2023, 02:41:49 PM

Title: Shutdown computer without exittc
Post by: rexi on November 29, 2023, 02:41:49 PM
Hello,
is there any way to shut down tinycore (QUI version) without using exittc?
Thanks
Title: Re: Shutdown computer without exittc
Post by: Vaguiner on November 29, 2023, 02:46:23 PM
sudo poweroff
sudo halt
ctrl+alt+f1 + "exit"
Title: Re: Shutdown computer without exittc
Post by: Rich on November 29, 2023, 04:00:19 PM
Hi rexi
You can issue the command:
Code: [Select]
exitcheck.shif you want to shut down.

Or, you can issue the command:
Code: [Select]
exitcheck.sh rebootif you want to reboot.
Title: Re: Shutdown computer without exittc
Post by: rexi on November 30, 2023, 10:23:57 AM
I used exitcheck.sh and shut down the computer. Thank you
And one more question, can this be made into a TCZ extension (or at least if this command/file exists somewhere as a .sh file)?
Title: Re: Shutdown computer without exittc
Post by: Rich on November 30, 2023, 10:55:15 AM
Hi rexi
... (or at least if this command/file exists somewhere as a .sh file)?
It is included as part of the base system:
Code: [Select]
tc@E310:~$ which exitcheck.sh
/usr/bin/exitcheck.sh
tc@E310:~$
Title: Re: Shutdown computer without exittc
Post by: rexi on November 30, 2023, 11:40:14 AM
THX
Title: Re: Shutdown computer without exittc
Post by: rexi on December 22, 2023, 08:42:32 AM
I did a bit of development and ran into a problem. Does anyone know how to block the functionality of the exit button? (see picture)

(https://i.ibb.co/F3gxbKm/exittcz.png)
Title: Re: Shutdown computer without exittc
Post by: Rich on December 22, 2023, 09:16:07 AM
Hi rexi
Are you just trying to remove that menu entry?
Are you just trying to remove both menu entries?
Are you also looking to remove the  Exit  icon?
Title: Re: Shutdown computer without exittc
Post by: rexi on December 22, 2023, 09:29:28 AM
I'm trying to make the exit button not work. But if it is completely removed or the menu is removed, it will not be a problem at all.
(I'm trying to block the terminal  and the command line completely, for my project)
Title: Re: Shutdown computer without exittc
Post by: Rich on December 22, 2023, 09:45:16 AM
Hi rexi
This should remove the icon and one of the  Exit  entries
from the menu:
Code: [Select]
sudo rm /usr/local/share/applications/tinycore-exittc.desktop
setupdesktop > /dev/null 2>&1

This will remove the  exittc  GUI program:
Code: [Select]
sudo rm /usr/local/bin/exittc
I'm not sure where the  Exit  you outlined in red comes from. It may be
hardcoded somewhere, but it will not function.


Edit:  Fixed capitalization on sudo commands (Paul-123)
Title: Re: Shutdown computer without exittc
Post by: rexi on December 22, 2023, 10:13:28 AM
We have already removed the exit application (your method works, but I also used the method where I deleted the application from the boot disk). If I do this and press the red marked button (see image), the tinycore GUI shuts down and tinycore starts in command line mode. And I'm trying to prevent this situation from happening.

But I guess I got the idea. The menu that opens when you click on the screen is part of the FLWM application, if I modified the application so that it did not contain the menu, the problem would be solved.

And you might be wondering why I am trying to remove command line and terminal from linux. The explanation is simple, I am making a tinycore distribution that is supposed to be an alternative to Chrome OS. You can visit my website and download the OS.
http://gogleos.xf.cz/ (http://gogleos.xf.cz/)
The website doesn't look very good (I made it quickly in MS word).
Title: Re: Shutdown computer without exittc
Post by: Rich on December 22, 2023, 10:34:05 AM
Hi rexi
It's hardcoded here right after "New desktop":
https://github.com/tinycorelinux/flwm/blob/f55bf9851cbfeda4643d2b7aa2b5d5496199e079/Menu.C#L276
Title: Re: Shutdown computer without exittc
Post by: curaga on December 22, 2023, 11:05:45 AM
You can edit flwm code or use a different WM. I think some other WMs are meant for kiosk use.
Title: Re: Shutdown computer without exittc
Post by: rexi on December 22, 2023, 01:50:31 PM
I tried deleting files in flwm for a while, but nothing works after trying all logical combinations. In the meantime, I thought about your answer (deleting a piece of source code) and then realized that it would be simpler to modify the exittc application itself. But I realized that I don't know how to compile the application after editing, could someone send me instructions (link to the page) on how to do it?
Title: Re: Shutdown computer without exittc
Post by: Juanito on December 22, 2023, 01:55:44 PM
See https://github.com/tinycorelinux/fltk_projects/blob/master/Makefile
Title: Re: Shutdown computer without exittc
Post by: rexi on December 22, 2023, 02:24:55 PM
They could send something a little more user-friendly (I can't program and I don't know much about linux), but thanks for trying to help.
Title: Re: Shutdown computer without exittc
Post by: rexi on December 22, 2023, 03:27:12 PM
(I made a writing error in the post before)

Could you send something a little more user-friendly (I can't program and I don't know much about linux), but thanks for trying to help.
Title: Re: Shutdown computer without exittc
Post by: Rich on December 22, 2023, 05:00:39 PM
Hi rexi
We have already removed the exit application (your method works, but I also used the method where I deleted the application from the boot disk). If I do this and press the red marked button (see image), the tinycore GUI shuts down and tinycore starts in command line mode. And I'm trying to prevent this situation from happening. ...
Maybe it choked on a  File not found  error.

Try changing this:
Code: [Select]
sudo rm /usr/local/bin/exittcTo this:
Code: [Select]
echo -e "#!/bin/sh\nexit 0" > exittc
chmod 775 exittc
sudo mv exittc /usr/local/bin/

See if that works any better.
Title: Re: Shutdown computer without exittc
Post by: Juanito on December 23, 2023, 04:34:54 AM
To recompile exittc:
Code: [Select]
tce-load -i compiletc git fltk-1.3-dev sstrip
git clone https://github.com/tinycorelinux/fltk_projects
cd fltk_projects

Make your changes to exittc/exittc.cxx

Edit Makefile:

from:
Code: [Select]
DIRS = add2file apps cpanel datetool editor \
exittc filetool flrun \
mirrorpicker mnttool mousetool \
network popask popup services \
stats swapfile tc-install \
tc-wbarconf wallpaper

..to:
Code: [Select]
DIRS = exittc
..then:
Code: [Select]
make V=1
..and your new exittc will be found at exittc/exittc
Title: Re: Shutdown computer without exittc
Post by: Rich on December 23, 2023, 08:29:39 AM
Hi rexi
...
Code: [Select]
echo -e "#!/bin/sh\nexit 0" > exittc
chmod 775 exittc
sudo mv exittc /usr/local/bin/
...
I just tried this and it effectively disabled the  exittc  function.

Clicking on either  Exit  entry in the menu was silently ignored.
Clicking on the  Exit  icon was silently ignored.
Entering  exittc  on the command line was silently ignored.