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.
.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.--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).