Xfce Forum

Sub domains
 

You are not logged in.

#1 2022-09-13 15:14:36

CwF
Member
Registered: 2018-01-28
Posts: 288

xfce4-terminal control options [solved]

I'm exploring using xfce4-termional in a multiplexed kinda way to run a menu (undetermined) to kick out --tab children executing gnutv and mpv instances.

Maunaully executing in that first tab what would maybe come from a menu does work and shows some behaviors I need to figure out.

First is the use of && in the command, and what's the difference between --execute and --command?
If the line is "... --command "pause 600 && gnutv ..." I think 'pause' is the child process that runs and then quits the tab, never executing the gnutv part. --hold doesn't help, and not desired since the gnutv command has a timeout when I'd like the tab to die. Without the pause to delay start and only gnutv with it's switches the tab does execute and disappear after the timeout as desired. How to include a startup delay? I sometime start mpv without an active stream and when the stream becomes active mpv starts - I haven't tried that sequence yet with a --tab.

The imaginary menu in that first tab may become a master replacement for the components I now use to manage multiple tuners. Currently I use a genmon to monitor the active streams and display on hover, and launch a selection menu on click which starts mpv. Works fine, but I may end up with zombies every so often. Some streams are initiated by cron and some manually using a fg/bg structure in a tab. Some are  /dvb0 streams and some are streams to file. Something more unified may solve some issues and give me a tab for each active process. I may eliminate the genmon since I think there is no easy way for the genmon to connect to an existing terminal instance.

Concerning the --role and --startup-id options for xfce4-terminal, do those provide any user method to call up an existing terminal instance? Could the genmon 'call up' the existing set of tabs and focus on one, or add another in focus? In a similar way could the cron spawned instances 'call up' the same unified terminal set of tabs, and add one while active?

So lots of questions! Anyone that can stab at any element here I thanks you!

Last edited by CwF (2022-09-29 21:57:58)

Offline

#2 2022-09-13 15:26:02

KBar
Moderator
Registered: 2021-11-05
Posts: 689

Re: xfce4-terminal control options [solved]

&& is a shell operator that denotes logical AND:

command1 && command2
# command1 is executed; if its exit status is zero, then command2 is executed

You may try using sleep:

sleep 5s # sleep for 5 seconds and then run
command

Remember to edit the subject of your topic to include the [SOLVED] tag once you're satisfied with the answers or have found a solution (in which case, don't forget to share it as well), so that other members of the community can quickly refer to it and save their time. Pretty please! tongue

Offline

#3 2022-09-13 16:01:24

CwF
Member
Registered: 2018-01-28
Posts: 288

Re: xfce4-terminal control options [solved]

KBar wrote:

You may try using sleep:

sorry I mistyped, I am using sleep, why I typed pause???

The behavior I want is sleep, then initialize tuner with a gnutv string, the perhaps another tab instance for mpv...
Come to think of it I could put the sleep before the xfce4-terminal --tab command...yes, that works.

It does hold up the command line until the sleep is over...that's why I've used && at the end to put it in the background - and something I want to avoid. This would change when if I spawn these things from some menu...

Starting a tab for mpv prior to initializing the stream fails. The stream tab starts after a sleep, but the tab for mpv never appears. My genmon menu allows this, so a show starts and the mpv window springs to life. Maybe a --hold would help this, but then needs a manual close separate from mpv.

This brings me to the info bar at the top of the tab which includes a not again checkbox and a relaunch button. For some things that may be convenient. Is this able to display again if I kill it? It's from using --hold I think? Is the color or font addressable in a gtk.css tweak? Maybe similar to the root warning '.thunar infobar', so '.xfce4-terminal infobar'  ?

Offline

#4 2022-09-13 16:11:16

CwF
Member
Registered: 2018-01-28
Posts: 288

Re: xfce4-terminal control options [solved]

So to clarify;

xfce4-terminal --tab --title 12.3 --command "sleep 10 && gnutv -timeout 180 -adapter 3 -out dvr 12.3"

does not work

sleep 10 && xfce4-terminal --tab --title 12.3 --command "gnutv -timeout 180 -adapter 3 -out dvr 12.3"

works in an undesired way< edit to say "if I stay in and expect to use that terminal..."

So I was being dense. From a genmon these commands can be sent to xfce4-terminal and work as expected!

It goes to last open window it seems, so good!

Last edited by CwF (2022-09-29 21:56:46)

Offline

Board footer

Powered by FluxBB