Skip to content

Conversation

@faervan
Copy link
Owner

@faervan faervan commented Apr 23, 2025

see #24 for the motivation

Conceptual changes

  • subscriptions are separated from modules and named sources
  • modules define the layout of elements inside view. They may depend on sources to get access to variable data.
  • styles define extra attributes of individual modules, such as paddings, margins, fonts and font sizes.
  • themes define the colors to use in the modules and the background of the windows
  • windows are named configurations, defining the variants of the configurations defined above as well as general window settings (e.g. anchor, size, monitor).

  • Multiple windows can be opened simultaneously and managed through the IPC with a built-in intuitive command line interface.
  • All settings can be overridden at runtime through the IPC and the overrides are preserved for the entire lifetime of the daemon even when the original configuration from config files is reloaded.

Configuration

  • Switch from INI to TOML and from the configparser crate to toml, toml-edit and toml-example, enabling seamless parsing using serde instead of doing things manually
  • Split the configuration into "general configuration" (config.toml), "themes" (a themes directory where different color themes can be added and then selected and switched without updating/swapping the main configuration) and "styles" (a styles directory - like themes but storing things like gaps, size, spacing, fonts instead)
  • Store default configurations in /usr/share/crabbar, as specified by the Filesystem Hierarchy Standard
  • Finally finishing the template engine to allow full customization of how a module is displayed during runtime

Logging

Until now, bar-rs only logged it's output to stdout and stderr using println! and eprintln! and used the bar-rs bash script to write this output to a log file.

  • Use the log crate and a fitting logging implementation (fern?) to have a more idiomatic logging approach

Running crabbar / Unix sockets

Currently a bash script is used to launch and kill the main rust binary. This made things overly complex in setting things up the right way.

  • Use clap to parse cli arguments in the main app.
  • Run crabbar as a daemon listening to commands send through a socket or as a oneshot app sending commands though that socket.

Miscellaneous

  • Switch from my own, unnecessary faervan/iced fork back to pop-os/iced (This has been in the template_engine branch for months already)
  • Rework the subscription logic so that the app is only updated as often as needed, saving cpu usage
    • Updates get cached and flushed in a configurable interval
    • Immediately required updates (e.g. if the window title changes) flush the cache and reset the interval

this will close #15 , close #17 and close #24

@faervan faervan added the enhancement New feature or request label Apr 23, 2025
@faervan faervan added this to the Release 0.1 milestone Apr 23, 2025
@faervan faervan self-assigned this Apr 23, 2025
faervan and others added 13 commits July 25, 2025 17:02
solves #15

Allow for multiple instances of crabbar to be created and controlled
through Unix sockets. Removes the need of the previously used bar-rs
bash script by leveraging clap.
- readd subscription logic, State and Message
- drop additional crabbar instances in favor of multiple windows though
the iced daemon
- use XDG_STATE_HOME for logging instead of /var/log
also fix: crabbar not launching when previous instance exited
non-gracefully due to existing socket file
and fix: daemonized stderr not getting piped to the log file
- move Window and directories to core to allow usage by ipc
- use optfield crate to generate override structs that can override
specific configuration settings at runtime
…tion not flushing

also configure clippy to deny unused_trait_names
also fix: windows reading the outputs when the flush task is created,
not when it's executed
faervan added 11 commits August 8, 2025 02:33
also refactor: generic helpers into `helpers` module
and refactor: extract ID WindowRequest handling into extra method
also log to file using fern not daemonize crate and do so even when the
daemon is attached to a terminal
also fix: bar background color not affecting full bar area
Got annoying to search for the important error messages in a jungle of
rustc and clippy warnings
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Full rework + rename to crabbar add a render mechanism for custom item order add an IPC

2 participants