0

I am trying tu run terminal commands so a terminal window is shown only in a task bar or even not shown at all. There are some approaches of it with xdotool or wmctrl but they work so the window appears for a moment and disappears after it. This is annoying for a user.

So the way would to install the terminal that has the switch of starting in minimized mode. Do you know any like this?

EDIT

The terminal commands are executed by cron.

EDIT 2

The application I am creating has to run teleconsole tunneling program and send a generated key via mail:

#!/bin/bash
debug () { declare input=${1:-$(</dev/stdin)}; echo "[$input]">>debug; echo ----- >> debug; [ ! -z "$input" ] && echo "$input"; }
send () { declare input=${1:-$(</dev/stdin)}; [ -z "$input" ] || echo find00 | mail -s $input [email protected] || echo 'Session id not present'; }

(pgrep teleconsole | grep -Pom1 '\d{1,10}') | debug ||
    (echo Connecting proxy. . . | debug &&
     (/usr/bin/nm-online -t 15 &&
          (sleep 6 &&
           (cat /tmp/tconsole | grep -Pom1 '[0-9a-f]{10,}' | debug | send) & /usr/local/bin/teleconsole | tee /tmp/tconsole))
    )

The issue is that it works when I start it in the terminal window, but crashes when is started via cron.

In cron the teleconsole process starts, the mail is being sent, but the process ends after a few seconds whilst it should be present continuously. I spy it with a command:

watch  -n 0.2 'pgrep teleconsole'

So it happens something I don't know what that kills the process when I when my application is executed in cron.

EDIT 3

I have found a way to debug cron tasks by adding a [email protected] to crontab. The debug information I get is

the connection was closed on the remote side 2020-04-05 15:23:07.891104926 +0200 CEST m=+6.793560437
You have ended your session broadcast and the SSH tunnel is closed.

The information is strange, because only server is started and there is not any remote site yet.

4
  • How do you run commands? If inside an existing terminal, then spawning another terminal should happen only if the command explicitly does it. Maybe you double click something or so; then it's different. But in KDE Plasma I can create a .desktop file that runs a script (or whatever). In this case showing a terminal is optional. Please edit and tell us more about your setup and workflow. Commented Apr 4, 2020 at 9:15
  • @KamilMaciorowski ok I added it Commented Apr 4, 2020 at 9:32
  • Commands executed by cron don't need a terminal in general. In fact they can be silent to a degree that makes diagnosing them somewhat difficult. It looks like some command explicitly creates a window that bothers you. Can you identify the command? What is it? What is the crontab line? In case you cannot make it stop doing this, your desire for --min is justified, but note asking for software recommendation is off-topic here on Super User. Asking for help in adjusting your command(s) is on-topic, but we need to know the command(s). Commented Apr 4, 2020 at 10:01
  • I explored a liitle a way without the terminal but still have trouble. I added the second edit. Commented Apr 5, 2020 at 12:10

0

You must log in to answer this question.

Browse other questions tagged .