multiple youtube tabs: find most recent one?
Hi everybody,
I use brotab quite a lot for quickly navigating my too large amount of open tabs.
Is there a way to jump to the most recently played youtube tab?
For example, I can brotab list | grep youtube and will get this output
a.1.16 (3) ComfyUI Tutorial Series: Ep01 - Introduction and Installation - YouTube https://www.youtube.com/watch?v=Zko_s2LO9Wo&list=PL-pohOSaL8P9kLZP8tQ1K1QWdZEgwiBM0
a.1.29 (1) What Do I Owe - YouTube https://www.youtube.com/watch?v=ZtXQMD1iXUk
a.1.43 (3) Taiwan: Last Week Tonight with John Oliver (HBO) - YouTube https://www.youtube.com/watch?v=9Y18-07g39g
a.1.51 New Issue https://github.com/balta2ar/brotab/issues/new?q=youtube
I just recently paused a.1.43. Is there some way for brotab to "know" this?
My default routine (for example, gmail, protonmail, plex, nextcloud, ...) is to find a tab by (part of) it's name. Then navigate to it. But these are all pages where usually (99% of time time) only one instance is open. If multiple, I pick the first occurrence.
But with youtube, it could be, like in the example above, the third one.
Usually the youtube tab I want is the one that I opened most recently; so let's say I pause youtube, then go to gmail, then to protonmail, and then want to return to youtube, I want to go to that youtube tab I had opened last.
Is it possible to filter for this? brotab list does not show which tab was active when - but perhaps there is another method to do this that I just don't know about?
I expected brotab list | grep -F "YouTube" to not include a.1.51 because it only has youtube, not YouTube, but it does. So my initial though workaround is not possible:
- list all tabs with
YouTube - just expect the last one (in this case,
a.1.43) to be it - focus that tab
What would work is brotab list | grep -F " - YouTube". This will not output the github tab, as it does not include the space and dash. But even so, while this is the wanted tab in this case, what if I had focused a.1.29 most recently and wanted that one? Then just picking the one at the end wouldn't be the solution.
Is what I attempt to do possible with brotab, and, if so, how would I go on about it? Thanks in advance for your help :)
You can use playerctl for that: playerctl metadata --player=firefox --format "{{xesam:url}}"
And integrate it into a script to update it before mapping pause, to pause the music
or always update a text file with the most recent, if it changed