Coder Social home page Coder Social logo

rwaybar's Introduction

rwaybar

A taskbar for Wayland written in Rust. Works on any compositor supporting the layer_shell protocol (sway, most wlroots window managers, kwin).

Available Modules

  • Clipboard (viewer)
  • Clock and calendar
  • Custom scripts or dbus API queries
  • Disk (filesystem) free
  • Icons (including custom images)
  • File reader (for showing battery, temperature, load average, etc.)
  • MPRIS-compliant media player support (title display, basic control)
  • Pipewire and Pulseaudio volume and mute controls
  • Sway (window tree, workspaces, binding mode)
  • Tray

See the configuration documentation for details.

Other Features

  • Clicks can execute custom scripts or provide input to existing ones
  • Support for showing meters by choosing or fading between multiple images or glyphs.
  • Reformatting of values using regular expressions and/or numeric expressions
  • Config reload on SIGHUP

Building

cargo build --release
cp doc/rwaybar.toml ~/.config/
./target/release/rwaybar

You should modify the example config to match your outputs and to configure where and what you want on your bar. Specify the environment variable RUST_LOG=debug to enable more verbose debugging.

You can also enable or disable some features using cargo's feature flags. Currently there are two features:

  • dbus - Enable dbus support. Required for MPRIS and tray; enabled by default.
  • pulse - Enable pulseaudio support. Not enabled by default; requires pulse libraries.

Samples

sample bar

sample bar

These two samples are using the same configuration, only the background color differs. I like a transparent background on my taskbar, but I also configure my desktop background to be a slideshow. This means that I need the bar to be readable regardless of the color of the background, which was done in this example by using text-outline. The tray needs a solid background because some icons (kdeconnect, steam) aren't otherwise visible on light backgrounds.

Note: these images were captured on a scaled (HiDPI) output, which is why they appear double the size defined in the sample bar configuration.

Motivation

This started out as a 'how does wayland work, anyway?' project. I then decided that I liked the look of a transparent bar, and started adding features like text-outline to make the output more readable, and adding modules to display more data. I later decided to remove the C library dependencies that could be replaced by rust-native ones.

rwaybar's People

Contributors

danieldg avatar dvdsk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

dvdsk trax44 ved-un

rwaybar's Issues

How do I produce graphics to wayland/wlroots?

Hi, I am trying to learn how to produce graphics through wayland/wlroots.

I want to get started on how do I like produce graphics on wayland, like what should I do, can I please be given the bare minimal to start on?

Support Cargo install

This would replace:

git clone https://github.com/danieldg/rwaybar
cd rwaybar
cargo build --release
cp target/release/rwaybar <somewhere>
cp doc/rwaybar.toml ~/.config/
$EDITOR ~/.config/rwaybar.toml

with:

cargo install rwaybar
rwaybar  # generates example config if it does not find a config
$EDITOR ~/.config/rwaybar.toml
  • To support cargo install rwaybar needs to be published on crates.io
  • Since we do not clone the repo anymore rwaybar needs to generate the config. A simple const CONFIG: &str = include_str!(doc/rwaybar.toml) combined with a fs::write_all(config_path, CONFIG.as_bytes()) when the config is not found should do the trick.

----------------------- Edit ----------------------
I just realize I can also use cargo install --git https://github.com/danieldg/rwaybar. However I still think it would still be nice to have this on crates.io.

Project name suggestions

I stumbled upon this project through GitHub and am very happy to see a bar that doesn't depend on gtk. The name, to me, just doesn't roll of the tongue well. I have some suggested names wraybar, raybar, or rubar. This is just a suggestion and not a really productive one. (I don't know rust)

Improve error reporting

Hi there, first of all thanks for building a fast zero dependency Wayland compatible bar with excellent documentation in the wiki.

When I started using rwaybar I copied the default config however I then got greeted by less then ideal errors (mostly Error: Os { code: 2, kind: NotFound, message: "No such file or directory" } ). By eliminating most of the config I quickly found out it was due to incorrect font paths.

I think rwaybar could be made easier with better error handling. In the source I saw you bubble errors up using Box<dyn Error>. I have found color_eyre a wonderfull (drop in!) replacement for that. It would make it easy to add context to an error such as the one above.

For example the font not found line:

let file = File::open(&path)?;

could become:

use color_eyre::{Result, eyre::WrapErr};
pub fn new(name: String, path: PathBuf) -> Result<Self> {
    let file = File::open(&path)
        .wrap_err_with(|| format!("Could not open font {name} at given path {path:?}"))? 

Pipewire support

As of Pop-os 22.04 is using Pipewire instead of Pulseaudio. While pipewire should be backwards compatible rwaybar no longer shows the volume as of Pop-os 22.04. Most distros plant upgrade to upgrade to pipewire sometime in the future.

As a first step I think rwaybar would need a clear API for the audio back-end. Then the first implementation could use a compile time feature to switch between implementation. Later it could be auto detected.

An alternative would be figuring out why the volume is not shown on Pipewire even though it should be backward compatible.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.