Tiny Core Extensions > TCE Q&A Forum
Running a script on click
edmazing:
I did try that but clicking the icon the script then opens windows without stopping.
The contents of myscript.sh
--- Code: ---#!/bin/sh
xterm -e sh -c "cd /usr/sbin; startp9; setup;"
--- End code ---
(setup and startp9 are both scripts I posted previously)
edmazing:
Ah I was using mksquashfs and it was just adding a user_1,user_2 folder to the existing myapp.tcz
There does seem to be a downside though that any dependencies need to be added to the onboot.lst so the boot time is huge once more.
Rich:
Hi edmazing
Try setting it up like this:
setupP9.sh
--- Code: ---#!/bin/sh
ExtensionList="gcc linux-6.18_api_headers (and so on)"
echo "setting up..."
# Install extensions required for setting up, filter out "already installed" messages.
tce-load -i "$ExtensionList" 2>&1 | grep -v "already installed"
--- End code ---
startP9.sh
--- Code: ---#!/bin/sh
sudo insmod /lib/modules/6.18.2-tinycore/kernel/net/9p/p9net_virtio.ko.gz
sudo mkdir /home/tc/p9
sudo mount -t 9p -o trans=virtio,version=9p2000.L host9p /home/tc/p9
--- End code ---
P9.sh
--- Code: ---#!/bin/sh
xterm -e sh -c "setupP9.sh; startP9.sh; exec sh" &
--- End code ---
P9.desktop
--- Code: ---[Desktop Entry]
Name=P9
Exec=P9.sh
Terminal=false
X-FullPathIcon=/usr/local/share/pixmaps/P9.png
--- End code ---
Then:
--- Code: ---chmod 755 P9.sh
chmod 755 setupP9.sh
chmod 755 startP9.sh
mkdir -p P9/usr/local/bin/
mkdir -p P9/usr/local/share/applications/
mkdir -p P9/usr/local/share/pixmaps/
cp *P9.sh P9/usr/local/bin/
cp P9.desktop P9/usr/local/share/applications/
# Copy the png for your icon to P9/usr/local/share/pixmaps/
mksquashfs P9 $P9.tcz -noappend
--- End code ---
There should be no need to add anything to onboot.lst except P9.tcz.
Leee:
FWIW, I use jwm as my window manager and I have some scripts hooked up to buttons in the "tray" area. The config goes into ~/.jwmrc-tray
--- Code: --- <TrayButton icon="/home/tc/dolly_48.png">
<Button mask="1">exec:aterm --geometry 100x25 -e ~tc/bin/firefix</Button>
<Button mask="2">exec:aterm --geometry 100x25 -e ~tc/bin/firefix --update</Button>
</TrayButton>
--- End code ---
In the above example, left click invokes the script w/o arguments and middle click invokes it with the --update argument. The script opens in a terminal window which closes on exit. If there are messages that need user attention, the script holds the window open by waiting for input.
Of course, if not using jwm, none of this applies.
edmazing:
I went with the extension method.
I've mostly got things down pat but I'm loading the extensions in the wrong order I think? Just alphabetically since I've got a big list
--- Code: ---acl adwaita-icon-theme at-spi2-core attr bash binutils cairo coreutils dbus desktop-file-utils fakeroot file flex fribidi gamin gcc_base-dev gcc_libs-dev gcc_libs gcc gdk-pixbuf2-xlib gdk-pixbuf2 glib2 glibc_base-dev gmp graphite2 gtk-update-icon-cache gtk2 harfbuzz hicolor-icon-theme isl libcroco libffi liblzma librsvg libstartup-notification libtiff libXcomposite libXdamage libXi libxml2 libXrandr libX11-dev libXtst libzstd linux-6.18_api_headers mpc mpfr nano pango pcre pcre21042 pixman readline shared-mime-info udev-lib util-linux xorg-proto xdg-utils geany spacefm;
--- End code ---
Is there a simple way to sort dependencies? Or will I have to trial and error it?
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version