feat(bar): read the pprof address from NEFERBAR_PPROF
- commit
- 452b6b470328c856f6a3409a2b8c77d58b09aea1
- author
- brice · · 2026-10-08 05:37 UTC
- parent
- cfe73b7
- signature
- GPG Verified
CD88F9E564E0102646FB6077A1A07C7C7C3E349D· arch-gpg Verified for the committer email
2 files · +2 -2
M README.md +1 -1
| @@ -231,7 +231,7 @@ neferbar [-config file] [-display socket] [-pprof addr] [-memstats interval] | |||
| 231 | 231 | |---|---| | |
| 232 | 232 | | `-config` | Config file. Default: `$XDG_CONFIG_HOME/neferbar/config.toml`. | | |
| 233 | 233 | | `-display` | Wayland socket name or path. Default: `$NEFERBAR_DISPLAY`, then `$WAYLAND_DISPLAY`. | | |
| 234 | - | | `-pprof` | Serve Go profiling on a loopback address, such as `localhost:6060`. | | |
| 234 | + | | `-pprof` | Serve Go profiling on a loopback address, such as `localhost:6060`. Default: `$NEFERBAR_PPROF`, so a bar started by the compositor can be profiled. | | |
| 235 | 235 | | `-memstats` | Log allocation counters at this interval. | | |
| 236 | 236 | ||
| 237 | 237 | ## Reading the focused window | |
| @@ -231,7 +231,7 @@ neferbar [-config file] [-display socket] [-pprof addr] [-memstats interval] | |||||
| 231 | |---|---| | 231 | |---|---| | ||
| 232 | | `-config` | Config file. Default: `$XDG_CONFIG_HOME/neferbar/config.toml`. | | 232 | | `-config` | Config file. Default: `$XDG_CONFIG_HOME/neferbar/config.toml`. | | ||
| 233 | | `-display` | Wayland socket name or path. Default: `$NEFERBAR_DISPLAY`, then `$WAYLAND_DISPLAY`. | | 233 | | `-display` | Wayland socket name or path. Default: `$NEFERBAR_DISPLAY`, then `$WAYLAND_DISPLAY`. | | ||
| 234 | - | | `-pprof` | Serve Go profiling on a loopback address, such as `localhost:6060`. | | 234 | + | | `-pprof` | Serve Go profiling on a loopback address, such as `localhost:6060`. Default: `$NEFERBAR_PPROF`, so a bar started by the compositor can be profiled. | |
| 235 | | `-memstats` | Log allocation counters at this interval. | | 235 | | `-memstats` | Log allocation counters at this interval. | | ||
| 236 | 236 | ||||
| 237 | ## Reading the focused window | 237 | ## Reading the focused window | ||
M cmd/neferbar/main.go +1 -1
| @@ -33,7 +33,7 @@ func main() { | |||
| 33 | 33 | } | |
| 34 | 34 | cfgPath := flag.String("config", "", "config file (default: $XDG_CONFIG_HOME/neferbar/config.toml)") | |
| 35 | 35 | display := flag.String("display", os.Getenv("NEFERBAR_DISPLAY"), "Wayland socket name or absolute path (default: $NEFERBAR_DISPLAY, then $WAYLAND_DISPLAY)") | |
| 36 | - | pprofAddr := flag.String("pprof", "", "serve pprof on this loopback address, e.g. localhost:6060") | |
| 36 | + | pprofAddr := flag.String("pprof", os.Getenv("NEFERBAR_PPROF"), "serve pprof on this loopback address, e.g. localhost:6060 (default: $NEFERBAR_PPROF)") | |
| 37 | 37 | memStats := flag.Duration("memstats", 0, "log allocation counters at this interval (0: off)") | |
| 38 | 38 | flag.Parse() | |
| 39 | 39 | ||
| @@ -33,7 +33,7 @@ func main() { | |||||
| 33 | } | 33 | } | ||
| 34 | cfgPath := flag.String("config", "", "config file (default: $XDG_CONFIG_HOME/neferbar/config.toml)") | 34 | cfgPath := flag.String("config", "", "config file (default: $XDG_CONFIG_HOME/neferbar/config.toml)") | ||
| 35 | display := flag.String("display", os.Getenv("NEFERBAR_DISPLAY"), "Wayland socket name or absolute path (default: $NEFERBAR_DISPLAY, then $WAYLAND_DISPLAY)") | 35 | display := flag.String("display", os.Getenv("NEFERBAR_DISPLAY"), "Wayland socket name or absolute path (default: $NEFERBAR_DISPLAY, then $WAYLAND_DISPLAY)") | ||
| 36 | - | pprofAddr := flag.String("pprof", "", "serve pprof on this loopback address, e.g. localhost:6060") | 36 | + | pprofAddr := flag.String("pprof", os.Getenv("NEFERBAR_PPROF"), "serve pprof on this loopback address, e.g. localhost:6060 (default: $NEFERBAR_PPROF)") |
| 37 | memStats := flag.Duration("memstats", 0, "log allocation counters at this interval (0: off)") | 37 | memStats := flag.Duration("memstats", 0, "log allocation counters at this interval (0: off)") | ||
| 38 | flag.Parse() | 38 | flag.Parse() | ||
| 39 | 39 | ||||