-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Print string only if metadata is set #296
Comments
UtkarshVerma
changed the title
Print string only is metadata is set
Print string only if metadata is set
Jan 23, 2023
Same here - am currently hackily using a combination of my $metadata = qx(playerctl $player_arg metadata \\
--format '{{default(artist, "\004\005")}} - {{title}}' 2>/dev/null);
chomp $metadata;
$metadata =~ s/^\004\005 - //; (that pair of characters is STX/ETX, probably semantically invalid but it makes some sense to me) |
hseg
added a commit
to hseg/i3blocks-contrib
that referenced
this issue
Aug 28, 2023
Ignores artist if absent (the hack of giving a control character default and stripping it is unfortunately necessary at the moment, cf altdesktop/playerctl#296) Closes: vivien#498
hseg
added a commit
to hseg/i3blocks-contrib
that referenced
this issue
Feb 11, 2024
Ignores artist if absent (the hack of giving a control character default and stripping it is unfortunately necessary at the moment, cf altdesktop/playerctl#296) Closes: vivien#498
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I wish to replicate the following
mpc
format inplayerctl
:mpc -f "%title%[ - %artist%]" current
It only prints
- %artist%
ifartist
is set. How do I achieve this with playerctl?The text was updated successfully, but these errors were encountered: