Show Application in CLI

Linux specific questions.
Post Reply
Dinosaur
Posts: 1481
Joined: Jul 24, 2005 1:13
Location: Hervey Bay (.au)

Show Application in CLI

Post by Dinosaur »

Hi All

I have installed Debian Bookworm OS Lite 64 bit on the Rpi .
The idea is to run my Battery Monitor in the cli on a minimal system.
It is text based output.
No Desktop manager or Xserver etc.

So, if I wait for the boot to finish and then type the command at the prompt, the program 'appears' to run in the cli.
When I quit the program and type in tty , I get back /dev/tty1

I can set the font size using dpkg-reconfigure console-setup and it looks good.
Now I need to automate it, so that it starts at completion of Boot.

Using systemd service file to start a script that executes the program.
The program executes , returns to the command prompt , BUT it is not visible.
When I do systemctl status battery.service I can see it is running.

I can't seem to find which shell it is using so I can change to it.
If I pipe the output from the app to tty1, I get data being re-written but not the formatted text and headers etc.

Is there something I have to do different at compile time or commands to force the output to a particular shell ?
I am just about Googled out, so if anyone has any suggestions , would love to hear them.

Regards

EDIT: No sooner wrote this post and found by putting 'exec "program name" at the end of bash.profile it worked.
The only downside is that when I quit the program, it just restarts.
Will investigate that.
kevin498
Posts: 1
Joined: Apr 09, 2024 6:36

Re: Show Application in CLI

Post by kevin498 »

I've set up Debian Bookworm OS Lite 64-bit on a Raspberry Pi to run a Battery Monitor in the command-line interface (CLI) without a desktop environment. Manually running the program after boot works fine, but automating it using a systemd service file results in the program running in the background without visible output on the terminal. I've tried redirecting the output and modifying bash.profile, which initially helped display the program's output but now causes the program to restart upon quitting.
Last edited by fxm on Apr 11, 2024 5:09, edited 2 times in total.
Reason: Banned after a second post spamming.
Dinosaur
Posts: 1481
Joined: Jul 24, 2005 1:13
Location: Hervey Bay (.au)

Re: Show Application in CLI

Post by Dinosaur »

Hi All

Welcome to the Forum Kevin498.

After my previous post I simplified the running of the Battery Monitor.
created .config/autostart/Lipo4.desktop

Code: Select all

[Desktop Entry]
Name=LiPo4
Comment=Manage Battery Charger
Exec=lxterminal --geometry=80x25 --command sudo LiPo4
Icon=/home/dinosaur/Pictures/trex.jpg
Terminal=true
Type=Application
StartupNotify=true
GenericName=Starts Battery manager
Then place the executable in usr/local/bin

I did install lxterminal as I found it easier to configure so it would take up the whole of my 7" lcd.
Hope it helps.

Regards
badidea
Posts: 2593
Joined: May 24, 2007 22:10
Location: The Netherlands

Re: Show Application in CLI

Post by badidea »

Is Kevin498 human?
Dinosaur
Posts: 1481
Joined: Jul 24, 2005 1:13
Location: Hervey Bay (.au)

Re: Show Application in CLI

Post by Dinosaur »

Hi All
badidea, that was my first thought and I compared my statements with the post.
Perhaps it is time our forum had some way of verifying upon joining.

Haven't joined for a long time, so don't know what the procedure is.

Regards
badidea
Posts: 2593
Joined: May 24, 2007 22:10
Location: The Netherlands

Re: Show Application in CLI

Post by badidea »

I don't mind robots joining the forum, as long as they contribute something useful. And summarizing your problems is not so useful :-)
Dinosaur
Posts: 1481
Joined: Jul 24, 2005 1:13
Location: Hervey Bay (.au)

Re: Show Application in CLI

Post by Dinosaur »

Hi All

I am glad I didn't meet my wife on some forum, I would never had got laid.
:D

REgards
Post Reply