Skip to content

--reload flag doesn't work for included files #1909

@nathanchere

Description

@nathanchere

Describe the issue

When splitting configuration into multiple files and loading them using include-file directives, the --reload flag only picks up changes at the top config level.

Expected behavior:
Polybar should also reload when any files referenced with include-file are changed,.

To Reproduce

The simplest way is to create an empty file and reference it from your polybar config, e.g.:

[settings]
margin-top = 0
margin-bottom = 0
include-file = ~/.config/polybar/extra.config

Whenever you run Polybar with --reload and then save changes to extra.config, Polybar should reload.

Additional context

The file system watchers are set in main.cpp:

config_watch = inotify_util::make_watch(conf.filepath());

   if (cli->has("reload")) {
      config_watch = inotify_util::make_watch(conf.filepath());
    }

Fortunately this already happens after configuration is loaded, and it looks like a fairly straight-forward task to keep track of include-file calls and create a watcher for each one.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions