Giter VIP home page Giter VIP logo

i3status-rust's Introduction

i3status-rust

demo1

i3status-rs is a feature-rich and resource-friendly replacement for i3status, written in pure Rust. It provides a way to display "blocks" of system information (time, battery status, volume, etc) on bars that support the i3bar protocol.

Getting Started

Install from one of the packages below:

Packaging status

  • For Fedora/CentOS, you can install from the COPR.

  • For NixOS, you can also use Home Manager: programs.i3status-rust.enable = true see available options

  • NOTE: Installation via cargo is not supported.

Otherwise refer to manual install docs.

Configuration

After installing i3status-rust, edit the example configuration to your liking. The default location is $XDG_CONFIG_HOME/i3status-rust/config.toml.

There are some optional global configuration variables, defined either at the top-level or in a TOML table.

[icons] table:

Key Description Default
icons The icon set that should be used. "none"
[icons.icons_overrides] Refer to Themes and Icons below. None

[theme] table:

Key Description Default
theme The theme that should be used. "plain"
[theme.theme_overrides] Refer to Themes and Icons below. None

Global variables:

Key Description Default
icons_format A string to customise the appearance of each icon. Can be used to edit icons' spacing or specify a font that will be applied only to icons via pango markup. For example, " <span font_family='NotoSans Nerd Font'>{icon}</span> ". " {icon} "
invert_scrolling Whether to invert the direction of scrolling, useful for touchpad users. false
error_format A string to customise how block errors are displayed. See below for available placeholders. "$short_error_message|X"
error_fullscreen_format A string to customise how block errors are displayed when clicked. See below for available placeholders. "$full_error_message"

Available error_format and error_fullscreen_format placeholders:

Placeholder Value
full_error_message The full error message
short_error_message The short error message, if available

Further documentation

Latest release

Master

Integrate it into i3/sway

Next, edit your bar configuration to use i3status-rust. For example:

bar {
    font pango:DejaVu Sans Mono, FontAwesome 12
    position top
    status_command path/to/i3status-rs path/to/your/config.toml
    colors {
        separator #666666
        background #222222
        statusline #dddddd
        focused_workspace #0088CC #0088CC #ffffff
        active_workspace #333333 #333333 #ffffff
        inactive_workspace #333333 #333333 #888888
        urgent_workspace #2f343a #900000 #ffffff
    }
}

In order to use the built-in support for the Font Awesome icon set, you will need to include it in the font parameter, as above. Check to make sure that "FontAwesome" will correctly identify the font by using fc-match, e.g.

$ fc-match FontAwesome
fontawesome-webfont.ttf: "FontAwesome" "Regular"

Note that the name of the Font Awesome font may have changed in version 5 or above.
You can use fc-list to see the names of your available Awesome Fonts.

$ fc-list | grep -i awesome
/usr/share/fonts/TTF/fa-solid-900.ttf: Font Awesome 5 Free,Font Awesome 5 Free Solid:style=Solid
/usr/share/fonts/TTF/fa-regular-400.ttf: Font Awesome 5 Free,Font Awesome 5 Free Regular:style=Regular

In this example, you have to use Font Awesome 5 Free instead of the FontAwesome 12 in the example configuration above. You can verify the name again using fc-match

See #130 for further discussion.

Finally, reload i3: i3 reload.

Behavior

Each block has a State that defines its colors: one of "Idle", "Info", "Good", "Warning", "Critical" or "Error". The state is determined by the logic in each block, for example, the Music block state is "Info" when there is an active player.

When the state is "Error", a short error will be displayed in the block. The full message can be toggled by clicking on the block (overrides any click actions defined in the config). The block will be restarted after error_interval has elapsed.

i3bar has a "power savings" feature that pauses the bar via SIGSTOP when it is hidden or obscured by a fullscreen container. If this causes issues with your bar, try running i3status-rs with the --never-stop argument, which changes the signal sent by i3 from SIGSTOP to SIGCONT.

In addition to the per-block signal config option, i3status-rs can be signalled to force an update of all blocks by sending it the SIGUSR1 signal. It can also be restarted in place (useful for testing changes to the config file) by sending it the SIGUSR2 signal.

Debugging

Run i3status-rust in a terminal to check the JSON it is outputting.
In addition, some blocks have debug logs that can be enabled like so: RUST_LOG=block=debug i3status-rs where "block" is the block name.

Contributing

We welcome new contributors! Take a gander at CONTRIBUTING.md.

License

This project is licensed under the GPLv3. See the LICENSE file for details.

i3status-rust's People

Contributors

akechishiro avatar ammgws avatar arathunku avatar atheriel avatar bim9262 avatar carloabelli avatar cfsmp3 avatar dependabot[bot] avatar drogglbecher avatar etrombly avatar flying7eleven avatar freswa avatar ghedamat avatar gladoskar avatar greshake avatar jonascir avatar keeslinp avatar kennylevinsen avatar matthiaskrgr avatar maxverevkin avatar nukesor avatar picojr avatar pitkley avatar rtxm avatar se-spiess avatar shazow avatar simao avatar svmnotn avatar themadprofessor avatar vanille-n 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  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  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  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

i3status-rust's Issues

Use ACPI command for battery information.

Wouldn't it be easier to implement things like time left and less configuration for batteries if you used a command like 'acpi -bi' and stripped the out put for just the information you need? I would work on a block doing this but rust still confuses me.

[Low Prio] Performance and Interface Optimization

This codebase isn't perfect- there is still a lot of stuff I'm not happy with, but I'm not sure how to handle them more elegantly. For example, we should allow people to register click handler during the construction of widgets, like this: TextWidget::new().with_click(|event| <handle>). For that, we need to update a map of click handlers every time we update our view.

  • Minimize copying and string comparisons
  • Add more elegant click handlers

Usage without i3

Hi, is it possible to use i3status-rust without i3? I would like to play with this bar but am not using i3 myself. I would be fine running i3bar, but not using i3 - if that's even possible.

Time module does not respect locale

I use a different time locale with setting LC_TIME in /etc/locale.conf. The status bar is ignoring this and showing the day of the week and the name of the month (%A and %B options) in English while the same formatting options in my terminal does not show it in English.

I looked at your code, but as I am not that familiar with Rust, I cannot tell if the problem is in your code or if the problem is upstream in that chrono does not provide this option. If the latter is the case, please excuse for me raising the problem here and feel free to close it.

Reloading block on keypress

Is it possible to make a block reload by pressing a key? Like when I would press my mediakey to increase volume the volume block would immediately reload and show the correct output? So I would put something like this in my i3config

bindsym mediakey reload volumeblock && amixer sset Master 5%+

[Low Prio] New Themes

We should have more themes than solarized-dark, especially a simple text/i3status style one. To add them, just edit the src/themes.rs file. It should be obvious how to add a new theme. Every theme is Json, containing foreground and background colors for each block state (Warning, Info, Critical etc). Also here you can define the separator symbol.

Invalid file name in power_supply

Config

An Archlinux with a Linux kernel V4.11.7-1

Issue

The battery block try to open files named charge_full and charge_now from the /sys/class/power_supply/BAT{nb} forlder but with my pc config the files are named energy_full and energy_now.

Do any other archlinux user have this issue?

Solution

I changed manually the values and everything work well.

I will propose a PR later with a clean way to do it without creating breaking changes.

Error with sound module

With the sound module present I get a panic. Possibly realted to #20

Using latest master: d06583b

config.json:

[                                                                               
  {"block": "disk_space", "path": "/", "alias": "/", "type": "available", "unit": "GB", "interval": 20},
  {"block": "memory", "type":"memory", "format_mem":"{Mup}%", "format_swap":"{SUp}%"},
  {"block": "cpu", "interval": 1},                                              
  {"block": "load", "interval": 1, "format": "{1m}"},                           
  {"block": "sound"},                                                           
  {"block": "music", "player": "clementine", "buttons": ["play", "next"]},      
  {"block": "time", "interval": 60, "format": "%a %d/%m %R"}                    
]    

Amixer output:

amixer get Master
Simple mixer control 'Master',0
  Capabilities: pvolume pvolume-joined pswitch pswitch-joined
  Playback channels: Mono
  Limits: Playback 0 - 64
  Mono: Playback 41 [64%] [-23.00dB] [on]

System info:

LSB Version:	core-9.20160110ubuntu0.2-amd64:core-9.20160110ubuntu0.2-noarch:printing-9.20160110ubuntu0.2-amd64:printing-9.20160110ubuntu0.2-noarch:security-9.20160110ubuntu0.2-amd64:security-9.20160110ubuntu0.2-noarch
Distributor ID:	Ubuntu
Description:	Ubuntu 16.04.2 LTS
Release:	16.04
Codename:	xenial

Rust Trace:

{"version": 1, "click_events": true}
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: ParseIntError { kind: InvalidDigit }', /checkout/src/libcore/result.rs:859
stack backtrace:
   0: std::sys::imp::backtrace::tracing::imp::unwind_backtrace
             at /checkout/src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
   1: std::sys_common::backtrace::_print
             at /checkout/src/libstd/sys_common/backtrace.rs:71
   2: std::panicking::default_hook::{{closure}}
             at /checkout/src/libstd/sys_common/backtrace.rs:60
             at /checkout/src/libstd/panicking.rs:355
   3: std::panicking::default_hook
             at /checkout/src/libstd/panicking.rs:371
   4: std::panicking::rust_panic_with_hook
             at /checkout/src/libstd/panicking.rs:549
   5: std::panicking::begin_panic
             at /checkout/src/libstd/panicking.rs:511
   6: std::panicking::begin_panic_fmt
             at /checkout/src/libstd/panicking.rs:495
   7: rust_begin_unwind
             at /checkout/src/libstd/panicking.rs:471
   8: core::panicking::panic_fmt
             at /checkout/src/libcore/panicking.rs:69
   9: core::result::unwrap_failed
  10: <i3status_rs::blocks::sound::Sound as i3status_rs::block::Block>::update
  11: i3status_rs::main
  12: __rust_maybe_catch_panic
             at /checkout/src/libpanic_unwind/lib.rs:98
  13: std::rt::lang_start
             at /checkout/src/libstd/panicking.rs:433
             at /checkout/src/libstd/panic.rs:361
             at /checkout/src/libstd/rt.rs:56
  14: __libc_start_main
  15: _start

[High Prio] New Blocks

Ordered by importance:

  • NetworkManager with Dbus
  • Brightness
  • Temperature
  • Sound
  • Scriptable Block to execute shell commands etc. (work in progress)
  • Pacman updates
  • Disk Space (work in progress)
  • CPU utilization
  • Load
  • Memory
  • Battery
  • Network

Any more ideas and custom modules are appreciated!

Allow themes to be provided as a text file (launch option?)

I'm currently making a few changes to the default theme and it's kind of irritating how I have to recompile the entire project just to see how a slightly different colour looks (which takes around 50 seconds for me).

It would be nice if I could instead work in a text file and just restart the bar with that as an argument.

I understand if parsing the text file to implement a Theme object could be a lot of work, then this may not be worth it.

Improve network block

It would be nice to have more display options for the "net" block.
For example I would just like to show the interface IP instead of the current
bandwith.

Also an option to hide (or a different text) the block if the interface is down.

Something like (from my old config):

ethernet tun0 {
        format_up = "VPN: %ip"
        format_down = "VPN: down"
}
ethernet net0 {
        format_up = "E: %ip (%speed)"
        format_down = "E: down"
}
ethernet net1 {
        format_up = "E: %ip (%speed)"
        format_down = "E: down"
}

Instead of 'E: down' I would actually prefer to only show the
active interface (not possible with i3status).

Nice status bar. Thanks :)

Random crash after running for a while

I run i3status fine but after some time it crashes. I've run it with a debug build of the latest master (1517618) to provide a detailed stacktrace

thread 'main' panicked at 'other was less than the current instant', /checkout/src/libstd/sys/unix/time.rs:276
stack backtrace:
   0: std::sys::imp::backtrace::tracing::imp::unwind_backtrace
             at /checkout/src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
   1: std::sys_common::backtrace::_print
             at /checkout/src/libstd/sys_common/backtrace.rs:71
   2: std::panicking::default_hook::{{closure}}
             at /checkout/src/libstd/sys_common/backtrace.rs:60
             at /checkout/src/libstd/panicking.rs:355
   3: std::panicking::default_hook
             at /checkout/src/libstd/panicking.rs:371
   4: std::panicking::rust_panic_with_hook
             at /checkout/src/libstd/panicking.rs:549
   5: std::panicking::begin_panic
             at /checkout/src/libstd/panicking.rs:511
   6: <std::time::Instant as core::ops::Sub>::sub
             at /checkout/src/libstd/sys/unix/time.rs:276
             at /checkout/src/libcore/result.rs:706
             at /checkout/src/libstd/sys/unix/time.rs:275
             at /checkout/src/libstd/time/mod.rs:184
             at /checkout/src/libstd/time/mod.rs:249
   7: i3status_rs::scheduler::UpdateScheduler::do_scheduled_updates
             at src/scheduler.rs:84
   8: i3status_rs::main
             at src/main.rs:181
   9: __rust_maybe_catch_panic
             at /checkout/src/libpanic_unwind/lib.rs:98
  10: std::rt::lang_start
             at /checkout/src/libstd/panicking.rs:433
             at /checkout/src/libstd/panic.rs:361
             at /checkout/src/libstd/rt.rs:56
  11: main
  12: __libc_start_main
  13: _start

System

LSB Version:    :core-4.1-amd64:core-4.1-noarch:cxx-4.1-amd64:cxx-4.1-noarch:desktop-4.1-amd64:desktop-4.1-noarch:languages-4.1-amd64:languages-4.1-noarch:printing-4.1-amd64:printing-4.1-noarch
Distributor ID: CentOS
Description:    CentOS Linux release 7.3.1611 (Core) 
Release:        7.3.1611
Codename:       Core

Multiple timezones support

I would like to display multiple timezones at once in my i3status bar.

E.g. with i3status I had:

tztime DE {
    format = "Germany: %H:%M"
    timezone = "Europe/Berlin"
}

tztime LA {
        format = "LA: %H:%M"
        timezone = "US/Pacific"
}

make custom block command run once

Hello! I am trying to make a block to run only once. I do not know if this is an issue or something i do wrong.

I have this block
[[block]]
block = "custom"
interval = 60
command = "cat /tmp/.email"
on_click = 'python ~/.config/i3/mutt.py'

mutt.py:
import filelock
import os
import sys
import time
parentpid = os.getpid()
lock = filelock.FileLock("/tmp/.mutt_runnning_lock")
try:
with lock.acquire(timeout = .1):
pid = os.fork()
os.kill(parentpid,9)
os.system('termite -e "mutt";~/bin/checkMail.sh &')
lock.release()
except:
exit(0)

what the script does is create a a lockfile. if lockfile can not be acquired it exits.

Problem: when i click multiple times on the block it opens many termite with mutt many times.
When I run the script multiple times from the shell it seems to do what it is supposed to: if mutt is open it does not open multiple instances

Compilation error / overflows with disk_usage block on i686

Hello,

Trying to compile on a Archlinux i686 - Intel Atom Z520

I got a compilation error on this file
https://github.com/greshake/i3status-rust/blob/master/src/blocks/disk_space.rs

error[E0308]: mismatched types
--> src/blocks/disk_space.rs:177:45
|
177 | result = statvfs.f_bavail * statvfs.f_bsize;
| ^^^^^^^^^^^^^^^ expected u64, found u32

using "as u64" I got the code compiling but now, with path bigger than 4Gio, I got an overflow
getting wrong value of statvfs.f_bfree / statvfs.f_bsize (crazy big values)

Using glibc in C/C++ I would define _LARGEFILE_SOURCE and _LARGEFILE64_SOURCE
to solve this problem.

Since I didn't saw any way of doing that using nix-rust,
I reported the bug there, anyway @Susurrus suggested that :

We just wrap the statvfs strict provided by libc. This is likely an issue with the type as it's declared there. Please open and issue there to discuss this and link back to this one.

Here is the nix-rust issue
nix-rust/nix#743

Any Idea of how to correct that (If so, I can provide a pull request) ?

Regards

(However, I'm fine, since I have 13944733703.25GiB available on my disk ;) )

Unable to get fontawesome icons working

Just installed i3status-rust on my ubuntu box and am unable to get the awesome fonts working. I have installed the fontawesome ttf, but I am unable to see the correct icons. I get strange glyphs instead.

Thread leak

I had some crash after long uses and I open htop to see what's going on and it seem that each actions triggered are run in a thread which are never closed. So I have threads poping every 10s and never close.

Lessen config duplication in the code

Currently every block has it's own Config struct, with values that are then moved/copied into the Block struct.
Since we are passing the Config by value, I think it would be easier to simply change the code from:

pub struct Temperature {
    text: ButtonWidget,
    output: String,
    collapsed: bool,
    id: String,
    update_interval: Duration,
}

to:

pub struct Temperature {
    text: ButtonWidget,
    output: String,
    id: String,
    config: TemperatureConfig,
}

This means that in all the places where we would call temp.update_interval we would call temp.config.update_interval however, that also means that we only need to add new config values in a single place instead of in the new fn, the Block struct, and the Config struct.

This is more of an idea I had while trying to see how I would go about implementing #50, so more than anything I just want ideas/reasons for/against making the change. @pitkley your input on this, as the one that set it up in this manner would be greatly appreciated.

[Sound Block] Supporting different audio setups

 $ RUST_BACKTRACE=1 ./i3status-rs -d ../../../i3status-rust.json
{"version": 1, "click_events": true}
thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', /checkout/src/libcore/option.rs:323
stack backtrace:
   0: std::sys::imp::backtrace::tracing::imp::unwind_backtrace
             at /checkout/src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
   1: std::sys_common::backtrace::_print
             at /checkout/src/libstd/sys_common/backtrace.rs:71
   2: std::panicking::default_hook::{{closure}}
             at /checkout/src/libstd/sys_common/backtrace.rs:60
             at /checkout/src/libstd/panicking.rs:355
   3: std::panicking::default_hook
             at /checkout/src/libstd/panicking.rs:371
   4: std::panicking::rust_panic_with_hook
             at /checkout/src/libstd/panicking.rs:549
   5: std::panicking::begin_panic
             at /checkout/src/libstd/panicking.rs:511
   6: std::panicking::begin_panic_fmt
             at /checkout/src/libstd/panicking.rs:495
   7: rust_begin_unwind
             at /checkout/src/libstd/panicking.rs:471
   8: core::panicking::panic_fmt
             at /checkout/src/libcore/panicking.rs:69
   9: core::panicking::panic
             at /checkout/src/libcore/panicking.rs:49
  10: <i3status_rs::blocks::sound::Sound as i3status_rs::block::Block>::update
  11: i3status_rs::main
  12: std::panicking::try::do_call
             at /checkout/src/libstd/panicking.rs:454
  13: __rust_maybe_catch_panic
             at /checkout/src/libpanic_unwind/lib.rs:98
  14: std::rt::lang_start
             at /checkout/src/libstd/panicking.rs:433
             at /checkout/src/libstd/panic.rs:361
             at /checkout/src/libstd/rt.rs:57
  15: __libc_start_main
  16: _start

I just tried using this for the first time, cause this project looks awesome. :-)

However, I got the above the error.

I'm using this version: 86ff6bc

i3status-rust.json

 $ cat i3status-rust.json 
[
  {"block": "temperature", "interval": 10, "collapsed": false},
  {"block": "disk_space", "path": "/", "alias": "/", "type": "available", "unit": "GB", "interval": 20},
  {"block": "memory", "type":"memory", "format_mem":"{Mup}%", "format_swap":"{SUp}%"},
  {"block": "cpu", "interval": 1},
  {"block": "load", "interval": 1, "format": "{1m}"},
  {"block": "sound"},
  {"block": "time", "interval": 60, "format": "%a %d/%m %R"}
]

System info:

 $ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 17.04
Release:	17.04
Codename:	zesty
$ uname -a
Linux Orithyia 4.10.0-19-generic #21-Ubuntu SMP Thu Apr 6 17:04:57 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

Add CI verification step

PRs (and master for that matter) are currently not checked for anything, potentially causing master not to build.

I propose to add a simple CI configuration, using one of the numerous free CI solutions like Travis CI or Circle CI.


Following is a very simple Travis configuration (.travis.yml) which at least checks if a commit builds successfully:

language: rust
rust:
  - stable
  - beta
  - nightly
os:
  - linux
matrix:
  allow_failures:
    - rust: nightly
script:
  - cargo build -v
  - cargo test

(I have added cargo test although there aren't any tests yet. This will take the burden of remembering to add a test-run to the CI configuration once tests might be added.)

Proposal: Change update interval consistently to milliseconds

I would like to discuss a proposed change of consistently switching to milliseconds from seconds in our update interval configurations.
I know that any block implementation can handle this on its own, but I would prefer to have it consistently for all blocks.
Some blocks would benefit from a more fine-grained update interval, f.e. I would CPU utilization to 250 or 500 ms.
Opinions?

Error handling

Currently, there is almost no error-handling, except for some expects. I would like to introduce some form of error-handling to make working with Results easier by using the ? operator.

Functions like this:

pub fn get_file(name: &str) -> String {
    let mut file_contents = String::new();
    let mut file = File::open(name).expect(&format!("Unable to open {}", name));
    file.read_to_string(&mut file_contents).expect(&format!("Unable to read {}", name));
    file_contents
}

could be reduced to:

pub fn get_file(name: &str) -> Result<String> {
    let mut file_contents = String::new();
    let mut file = File::open(name)?;
    file.read_to_string(&mut file_contents)?;
    file_contents
}

Additionally, we could allow Blocks to return e.g. Result<Duration, SomeError> and handle the error-case outside of the block, rather than forcing the blocks to panic! if they can't continue causing the whole of i3status-rs to crash.


I did not want to go ahead with an implementation quite yet, rather I'd love some input on this. Personally, I would probably pick error-chain to take the burden of writing all the error-conversions needed for easy error-handling, especially since I had a good experiences in previous projects I used it in (at least after some initial learning and understanding).

Writing the conversion manually is also an option, see for example how hyper does it. What has been written in hyper is (roughly) comparable to what error-chain generates.

Do you have any other experiences, opinions or ideas?

[Low Prio] Add source documentation

The source code does not have a lot of rustdoc compatible documentation.
I added #![warn(missing_docs)], to speed this up a bit.

Nobody likes warnings on build! :-)

Account for not having a battery

A strange sounding issue I know...

I sync config between my desktop and laptop, 1 of which doesnt have a battery. Because of the missing battery, the entire bar fails to load.

IMO the nicest solution would be for the block not to render. However some people may want it to display NO BAT or similar, which could probably be user configured?

Missing font requirement: PowerlineSymbols

The built-in themes slick, solarized-dark, and modern use a powerline symbol as the separator. This character is not part of FontAwesome, but requires the installation of the font PowerlineSymbols.
On Arch Linux, it is available in the package powerline-fonts

Better README, or perhaps enabling the Wiki feature

Currently the README involves a lot of scrolling since it doesn't have a table of contents, however that table would add more scrolling... I think enabling the wiki would be better. However I think no matter which choice we take, we need the following:

  • Table of Contents for all available blocks.
  • How to override themes/icons (this should be stated somewhere to avoid things like #86, unless I misunderstood that issue).
  • A set format for blocks to follow, currently that is just sort of maintained by copy paste but it isn't specified anywhere as to how the documentation of a new block should be when adding one.
  • Requirements for themes, and/or more importantly icon sets.

This list is just a quick take on what is missing, if anyone has anything to add I'll expand the list.

Add flag to suppress errors on startup

I use i3status-rs on both my pc and notebook, sharing the same configuration. But since only the notebook has a battery, the configuration doesn't work on my PC and I have to always comment the battery block.

It would be great if we have a flag to just ignore any block with errors, but show the other ones.

Pacman Block not updating package lists

Seems like pacman -Sup isn't enough after all, we need to use the method I suggested earlier to @keeslinp:
Look at the guys from bumblebee-status: https://github.com/tobi-wan-kenobi/bumblebee-status/blob/master/bumblebee/modules/pacman.py

They use a bash script and fakeroot:

#!/usr/bin/bash

if ! type -P fakeroot >/dev/null; then
error 'Cannot find the fakeroot binary.'
exit 1
fi

if [[ -z $CHECKUPDATES_DB ]]; then
CHECKUPDATES_DB="${TMPDIR:-/tmp}/checkup-db-${USER}/"
fi

trap 'rm -f $CHECKUPDATES_DB/db.lck' INT TERM EXIT

DBPath="${DBPath:-/var/lib/pacman/}"
eval $(awk -F' *= *' '$1 ~ /DBPath/ { print $1 "=" $2 }' /etc/pacman.conf)

mkdir -p "$CHECKUPDATES_DB"
ln -s "${DBPath}/local" "$CHECKUPDATES_DB" &> /dev/null
fakeroot -- pacman -Sy --dbpath "$CHECKUPDATES_DB" --logfile /dev/null &> /dev/null
fakeroot pacman -Su -p --dbpath "$CHECKUPDATES_DB"

exit 0

Memory block wrong used percentage

The metric used to calculate memory used may be inaccurate/ non- intuitive. Htop shows 25% memory used, while the memory block shows 53%.

[Low Prio] New Icon packs

We should add some more icon pack choices from font icon sets like font-awesome. To do that just edit src/icons.rs and add your theme. It should be obvious how, but if you have questions don't hesitate to ask.

Memory block doesn't filter click events

The click function is called on every click on any block. The memory module needs to assign a name/id to the displaying widget and match on that id when the event comes in. Otherwise, it doesn't matter where you click and the memory block switches states.

Net block

I started working on a net block (just rx and tx). Before I get much farther was wondering if people wanted it configurable to show a specific output, like MBps, or have it scale with a label that changes. I have the output labeled "โฌ†" and "โฌ‡", is that something people would want configurable as well, or would those defaults be ok?

Also related, I think it would be nice to have a graph output similar to i3pystatus.

Allow for themes and icons to be defined in a file

This way we can avoid having to recompile every single time we want to test color or icon changes.
Changing the themes in a file seems more useful than the icons, but the code shouldn't be too different

Memory module

  • insert clickability
  • add documentation
  • remove ancient comments
  • try to sleep

Bug: BAT0/charge_full can't be read

My batter doesn't support doing charge_full but BAT0/capacity does work (exactly the same as far as I can tell). How would you feel about me adding an option so that someone can specify the proper endpoint. Alternatively if there are only a few proper endpoints across the majority of devices it can just detect which one works.

change brightness control from xrandr to sysfs

xrandr changes the brightness of the display using gamma rather than changing the brightness in hardware, so it doesn't really save much power. Using /sys/class/backlight/ directly would require a udev rule for a regular user, but saves a lot more power. Not sure if this would be better as an entirely separate block, or an option.

MouseButton enum not working for others than LeftClick

I want to implement scrolling features for xrand but it looks like all other buttons expect of LeftClick have no effect. For simplicity I changed the ... event.button == MouseButton::LeftClick... in memory.rs:443 to ... event.button == MouseButton::RightClick... but in the bar nothing happens when clicking the right button.
Did I forgot something?

Hide (music) block when inactive

Would it be possible to hide the music block when music is inactive/stopped? Takes a lot of space on my 1366x768 display... :/

This may be a good feature for other blocks too; not sure there.

Fail to compile on Debian docker image

It seems we miss some dependencies here. This is crucial for future packaging.
The result of my try inside a docker container:

error: failed to run custom build command for `dbus v0.5.3`
process didn't exit successfully: `/home/phantom/app/target/release/build/dbus-d1ec11d4d82de6d9/build-script-build` (exit code: 101)
--- stderr
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Error(PkgConfig(Failure { command: "\"pkg-config\" \"--libs\" \"--cflags\" \"dbus-1 >= 1.6\"", output: Output { status: ExitStatus(ExitStatus(256)), stdout: "", stderr: "Package dbus-1 was not found in the pkg-config search path.\nPerhaps you should add the directory containing `dbus-1.pc\'\nto the PKG_CONFIG_PATH environment variable\nNo package \'dbus-1\' found\n" } }), State { next_error: None })', /checkout/src/libcore/result.rs:860
note: Run with `RUST_BACKTRACE=1` for a backtrace.

warning: build failed, waiting for other jobs to finish...
error: build failed

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.