ChromeBook - how to start a terminal application by clicking an icon

53 Views Asked by At

Chromebook with linux enabled, but not developer mode

Version 119.0.6045.209 (64 bit)

The following works fine in the terminal

cat /home/martin/helloworld.sh:

#!/bin/bash
echo Hello World
sleep 10

-rwxr-xr-x 1 martin martin 36 Dec 11 13:46 helloworld.sh

martin@penguin:~$ ./helloworld.sh 
Hello World from home
martin@penguin:~$ 

I would like to invoke this application by clicking on an icon on the desktop (or in the taskbar).

I have tried different settings within a .desktop file (with or without menulibre)

#!/usr/bin/xdg-open

[Desktop Entry]
Version=1.1
Type=Application
Name=HelloWorld
Icon=applications-other
Exec=/home/martin/helloworld.sh
Terminal=true

I can invoke HelloWorld, which ChromeOS sees as an application. A terminal window appears, briefly containing ======== (a message from linux?), before immmediately going blank. The terminal window does not close.

I have also tried

Exec=/usr/bin/python3 /home/martin/helloworld.py

Which starts python (good!), but ignores the python file (not good)

Python 3.9.2 (default, Feb 28 2021, 17:03:44) 
[GCC 10.2.1 20210110] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> 

I have restarted the computer a number of times.

Instead of using .desktop, would it be possible to just have a link on the desktop - how would that link be executed? So, a link to helloworld.sh which would automatically be executed in a new terminal window.

0

There are 0 best solutions below