youtube-viewer icon indicating copy to clipboard operation
youtube-viewer copied to clipboard

Config file, player definition with environment variable/value stored in the external file.

Open ZaxonXP opened this issue 3 years ago • 1 comments

Hi,

Sometime ago I wanted to have gapless playback, so I found a way that I can play one audio in one instance of mpv, then run in pause mode the other mpv with the next audio. When the first one ended, the next one would play immediately. For that I had to use two separated sockets (/tmp/soc1, /tmp/soc2) to be able to send pause command. The info about currently used socket I stored in a third file (/tmp/soc_used). This also allows me to globally control the playback (play/pause, next, etc.). I know, nothing to do with the youtube-viewer so far, but it should allow you to understand the rest. :)

So now, I would like to use this idea with youtube-viewer, but I do not know how to get the content of the /tmp/soc_used and place it in the youtube-viewer.config file?

The content of the /tmp/soc_used would be either /tmp/soc1 or /tmp/soc2.

Alternatively I could read the content of /tmp/soc_used and store it in the shell variable. But then, how can I define it in the youtube-viewer.config file? Can I use the $ENV{VAR_NAME} in the config? Will it be expanded to the proper value? Can the shell exported variables be used inside the config file?

Kind regards, Piotr

ZaxonXP avatar Jun 23 '21 22:06 ZaxonXP

Or maybe I need to create shell script where I will read what I need and use this script inside the config file? Why did I not think of it sooner? ;)

Either way I would like to know if I can use a shell variables in the config file.

ZaxonXP avatar Jun 23 '21 22:06 ZaxonXP