My fav script to unpack anything, found a few years ago somewhere
I had found a zsh version somewhere which I've updated a few times over the years though I don't get a chance to use it much. :'D
Deleted Comment
Use of AI and Third-Party AI Providers. Some of our Services have features and functionality powered by our trusted third-party AI providers (“AI Providers”). AI-powered chat service provided by Microsoft Copilot relies on search services from Bing. By utilizing our Services, you consent to sharing data that you provide to us, or that resides within your Yahoo account, including your Yahoo Mail inbox with our AI Providers for the purpose of enhancing features within our Services made available to you. In some instances, use of AI query features may be governed by the AI Provider’s terms of service and privacy policy. You understand and agree that content or responses generated by AI may contain inaccuracies and should never be relied upon without independent verification. Yahoo does not control the content or responses provided by AI Providers, and makes no representations or warranties about the accuracy or completeness of such content or responses (or the sites and sources accessed through such content or responses). You also agree not to enter sensitive personal information into any AI powered query. function sp-metadata {
# Prints the currently playing track in a parseable format.
dbus-send \
--print-reply `# We need the reply.` \
--dest=$SP_DEST \
$SP_PATH \
org.freedesktop.DBus.Properties.Get \
string:"$SP_MEMB" string:'Metadata' \
| grep -Ev "^method" `# Ignore the first line.` \
| grep -Eo '("(.*)")|(\b[0-9][a-zA-Z0-9.]*\b)' `# Filter interesting fiels.`\
| sed -E '2~2 a|' `# Mark odd fields.` \
| tr -d '\n' `# Remove all newlines.` \
| sed -E 's/\|/\n/g' `# Restore newlines.` \
| sed -E 's/(xesam:)|(mpris:)//' `# Remove ns prefixes.` \
| sed -E 's/^"//' `# Strip leading...` \
| sed -E 's/"$//' `# ...and trailing quotes.` \
| sed -E 's/"+/|/' `# Regard "" as seperator.` \
| sed -E 's/ +/ /g' `# Merge consecutive spaces.`
}
But as the other replier mentioned, the point was to show off an example of how text manipulation skills can solve many problems, not solve this specific problem in the best way possible.It's buried in my gentoo config, but I wonder if there'd be a good way to make this useful on other distros.
[1]: https://github.com/search?q=repo%3Amid-kid%2Fgentoo-config%2...
[2]: https://github.com/mid-kid/config/blob/master/shell/.zprofil...