4 ms·
It should use ^Title and ^Artist, otherwise something with "Artist" or "Title" will give wonky results. More importantly, you can get the same results by just
by arp242 3y ago
It should use ^Title and ^Artist, otherwise something with "Artist" or "Title" will give wonky results.
More importantly, you can get the same results by just one or two dbus-send commands instead of using that "sp" script + something to clean it up.
The sp-metadata function uses tons of processes to clean the output[1], and sp-current launches a few more. If you're doing this in a loop for your WM status display this sort of stuff really adds up. Even on modern systems launching processes isn't free and relatively slow, and launching >20 of them every few seconds is going to use non-trivial amounts of CPU and will needlessly drain your battery.
I don't really know what that dbus command outputs, but I bet that with you might go a long way with "dbus-send ... | grep -o ..." or something.
So in general I'd say this is a classic case of "you're not even using the right solution, and no amount of GPT is going to help".
[1]: https://gist.github.com/streetturtle/fa6258f3ff7b17747ee3#file-sp-L98 https://gist.github.com/streetturtle/fa6258f3ff7b17747ee3#fi...
- thomasahle 3y agoThe "^Title and ^Artist" is a good point. The "sp current" issue seems less fair to bring up, as the entire article was using that throughout as well.