Skip to content

Fallback config/CSS paths hardcoded to /usr/local break custom prefix installs #726

@ljdi

Description

@ljdi

Describe the bug

When building swaync with a custom prefix (e.g. --prefix=~/.local), swaync fails to start because the fallback paths for config.json and style.css in src/functions.vala are hardcoded to /usr/local/etc/xdg/swaync/.

This means meson install correctly installs the files to ~/.local/etc/xdg/swaync/, but swaync only searches /usr/local/etc/xdg/swaync/ as the fallback, so it can't find them.

This affects any installation with a non-default prefix, including:

  • User-local installs: --prefix=~/.local
  • FreeBSD ports: /usr/local
  • NetBSD pkgsrc: /usr/pkg

To Reproduce

meson setup --prefix=~/.local build
ninja -C build
meson install -C build
swaync

Output:

Starting SwayNotificationCenter version swaync 0.12.6 (git-1043ef9, branch 'main')
COULD NOT FIND CONFIG FILE! REINSTALL THE PACKAGE!

After creating ~/.config/swaync/config.json:

COULD NOT FIND CSS FILE! REINSTALL THE PACKAGE!

Expected behavior

swaync should find the system-level config and CSS files installed under the custom prefix.

Root cause

src/functions.vala lines 148 and 190 hardcode the fallback path:

paths += "/usr/local/etc/xdg/swaync/style.css";
paths += "/usr/local/etc/xdg/swaync/config.json";

These should use the meson build-time config_path instead.

Related: #4, #167, #168

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions