You are not logged in.

#1 2020-09-09 21:24:51

mattyc
Member
Registered: 2020-08-30
Posts: 3

Sed script which doesn't output onto Polybar

I'm currently trying to run:

playerctl --ignore-player=playerctld status --format '{{ playerName }}' --follow 2> /dev/null | sed -E '/chrome/I s//chrome_emoji/;/spotify/I s//spotify_emoji/'

Within my polybar config, currently it looks like Polybar doesn't handle pipe at all, so I was wondering if someone has had a similar experience?
Note that the command itself works fine without sed. And the command works in the terminal.

The full module for Polybar is as follows:

[module/current-player]
type = custom/script
format = <label>
format-background = #999
format-foreground = #000
format-padding = 4
format-font = 3

exec = "playerctl --ignore-player=playerctld status --format '{{ playerName }}' --follow 2> /dev/null | sed -E '/chrome/I s//chrome_emoji/;/spotify/I s//spotify_emoji/'"
tail = true
label = "%output%"

Please feel free to point me in the correct direction if this isn't the best place for this advice.

Offline

#2 2020-09-10 01:32:40

fistrosan
Member
Registered: 2020-04-01
Posts: 171

Re: Sed script which doesn't output onto Polybar

Paste the playerctl into a shell script and execute that script within exec = "". That should do the job.

Offline

Board footer

Powered by FluxBB