You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
dotfiles/pkgs/playerctl-solid-emoji.diff

38 lines
1.7 KiB

diff --git a/playerctl/playerctl-formatter.c b/playerctl/playerctl-formatter.c
index caeb853..37a78b6 100644
--- a/playerctl/playerctl-formatter.c
+++ b/playerctl/playerctl-formatter.c
@@ -596,11 +596,11 @@ static GVariant *helperfn_emoji(struct token *token, GVariant **args, int nargs,
if (pctl_parse_playback_status(status_str, &status)) {
switch (status) {
case PLAYERCTL_PLAYBACK_STATUS_PLAYING:
- return g_variant_new("s", "▶️");
+ return g_variant_new("s", "");
case PLAYERCTL_PLAYBACK_STATUS_STOPPED:
- return g_variant_new("s", "⏹️");
+ return g_variant_new("s", "");
case PLAYERCTL_PLAYBACK_STATUS_PAUSED:
- return g_variant_new("s", "⏸️");
+ return g_variant_new("s", "");
}
}
} else if (g_strcmp0(key, "volume") == 0 &&
@@ -613,6 +613,17 @@ static GVariant *helperfn_emoji(struct token *token, GVariant **args, int nargs,
} else {
return g_variant_new("s", "🔊");
}
+ } else if (g_strcmp0(key, "playerName") == 0 && g_variant_is_of_type(value, G_VARIANT_TYPE_STRING)) {
+ const gchar *playerName_str = g_variant_get_string(value, NULL);
+ if (g_strcmp0(playerName_str, "spotify") == 0) {
+ return g_variant_new("s", "");
+ } else if (g_strcmp0(playerName_str, "firefox") == 0) {
+ return g_variant_new("s", "");
+ } else if (g_strcmp0(playerName_str, "chromium") == 0) {
+ return g_variant_new("s", "");
+ } else if (g_strcmp0(playerName_str, "mpv") == 0) {
+ return g_variant_new("s", "");
+ }
}
g_variant_ref(value);