Skip to content

custom/ipc: Only first appearance of %pid% is replaced. #2500

@patrick96

Description

@patrick96

Checklist

  • I have read the appropriate section in the contributing
    guidelines
  • I believe this issue is a problem with polybar itself and not a misconfiguration on my part.
  • I have searched for other open and closed issues that
    may have already reported this problem.
  • I have checked the known issues page for this problem.

Describe the bug

Expected behavior:
Using the %pid% token multiple times in the same hook command or click action should replace all tokens.

Actual behavior:

Only the first instance of %pid% in any hook command or click actions is replaced.

Was it working before?

Seems to have always been like this.

To Reproduce

[bar/example]
modules-left = ipctest
enable-ipc = true
[module/ipctest]
type = custom/ipc
hook-0 = echo "%pid% %pid%"
initial = 1

Screenshots

scrot

Environment:

  • WM: Herbstluftwm
  • Distro: Archlinux
  • Output of polybar -vvv:
polybar 3.5.6-118-gc65f6857

Features: +alsa +curl +i3 +mpd +network(libnl) +pulseaudio +xkeyboard

X extensions: +randr (+monitors) +composite +xkb +xrm +xcursor

Build type: Release
Compiler: /usr/bin/c++
Compiler flags: -D_FORTIFY_SOURCE=2 -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -Wall -Wextra -Wpedantic -Wsuggest-override -O3 -DNDEBUG
Linker flags: -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now 

Additional context

The ipc module just searches for the first instance.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions