Code Monkey home page Code Monkey logo

bumblebee-status's Introduction

bumblebee-status

logo courtesy of kellya - thank you!

Documentation Status Commits since release AUR version (release) AUR version (git) PyPI version Contributors Tests

Code Climate Test Coverage Issue Count CodeQL License

Many, many thanks to all contributors! I am still amazed by and deeply grateful for how many PRs this project gets.

Click here for a list of available modules

Solarized Powerline

bumblebee-status is a modular, theme-able status line generator for the i3 window manager.

Focus is on:

I hope you like it and I appreciate any kind of feedback: bug reports, feature requests, etc. :)

Thanks a lot!

Required i3wm version: 4.12+ (in earlier versions, blocks won't have background colors)

Supported Python versions: 3.4, 3.5, 3.6, 3.7, 3.8, 3.9

Supported FontAwesome version: 4 (free version of 5 doesn't include some of the icons)


NOTE

The default branch for this project is main. If you are curious why: ZDNet:github-master-alternative


Example usage:

bar {
	status_command <path>/bumblebee-status -m cpu memory battery time \
		pasink pasource -p time.format="%H:%M" -t solarized
}

Documentation

See the docs for detailed documentation.

See FAQ for. well, FAQs.

Other resources:

Installation

# from git (development snapshot)
$ git clone git://github.com/tobi-wan-kenobi/bumblebee-status

# from AUR:
git clone https://aur.archlinux.org/bumblebee-status.git
cd bumblebee-status
makepkg -sicr

# from PyPI (thanks @tony):
# will install bumblebee-status into ~/.local/bin/bumblebee-status
pip install --user bumblebee-status

There is also a SlackBuild available here: slackbuilds:bumblebee-status - many thanks to @Tonus1!

An ebuild, for Gentoo Linux, is available on gallifrey overlay. Instructions for adding the overlay can be found here.

bumblebee-status is also avaliable in nixpkgs unstable channel- many thanks to [@augustebaum][https://github.com/augustebaum]!

For installing from nixpkgs, add the following snippet into your configuration.nix:

{
  environment.systemPackages = with pkgs; [
      (bumblebee-status.override{plugins = p:[p.cpu];})
  ];
}

replace [p.cpu] with the list of plugins that you want to use.

Dependencies

Available modules lists the dependencies (Python modules and external executables) for each module. If you are not using a module, you don't need the dependencies.

Some themes (e.g. all ‘powerline’ themes) require Font Awesome http://fontawesome.io/ and a powerline-compatible font (powerline-fonts) https://github.com/powerline/fonts

Usage

Normal usage

In your i3wm configuration, modify the status_command for your i3bar like this:

bar {
	status_command <path to bumblebee-status/bumblebee-status> \
		-m <list of modules> \
		-p <list of module parameters> \
		-t <theme>
}

You can retrieve a list of modules (and their parameters) and themes by entering:

$ cd bumblebee-status
$ ./bumblebee-status -l themes
$ ./bumblebee-status -l modules

To change the update interval, use:

$ ./bumblebee-status -m <list of modules> -p interval=<interval in seconds>

The update interval can also be changed on a per-module basis, like this:

$ ./bumblebee-status -m cpu memory -p cpu.interval=5s memory.interval=1m

All modules can be given "aliases" using <module name>:<alias>, by which they can be parametrized, for example:

$ ./bumblebee-status -m disk:root disk:home -p root.path=/ home.path=/home

As a simple example, this is what my i3 configuration looks like:

bar {
	font pango:Inconsolata 10
	position top
	tray_output none
	status_command ~/.i3/bumblebee-status/bumblebee-status -m nic disk:root cpu \
		memory battery date time pasink pasource dnf \
		-p root.path=/ time.format="%H:%M CW %V" date.format="%a, %b %d %Y" \
		-t solarized-powerline
}

Restart i3wm and - that's it!

Examples

List of themes

bumblebee-status's People

Contributors

alexmohr avatar cddmp avatar cphyc avatar cristianmiranda avatar duarte-figueiredo avatar fredj avatar gkeep avatar ibrokemypie avatar izn avatar jayvdb avatar joshbarrass avatar kellya avatar lonesomebyte537 avatar ltperiwinkle avatar lucassouto avatar martindoublem avatar meain avatar mihaimorariu avatar miljanic avatar nayaverdier avatar nepoz avatar piyueh avatar rad4day avatar rosalogia avatar soykan avatar tfwiii avatar tobi-wan-kenobi avatar yashar-sb-sb avatar yvesh avatar zerorust 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

bumblebee-status's Issues

ModuleNotFoundError thrown for unused modules

The README says that dependencies like psutil, netifaces, and requests are not required by the core, and only required by individual modules. However, loading bumblebee-status with unrelated modules throws errors if these dependencies are not installed.

$ ./bumblebee-status -m datetime                                                                                                        
Traceback (most recent call last):
  File "./bumblebee-status", line 36, in <module>
    main()
  File "./bumblebee-status", line 18, in main
    inp=inp,
  File "/home/cjlarose/dev/bumblebee-status/bumblebee/engine.py", line 82, in __init__
    self._aliases = self._read_aliases()
  File "/home/cjlarose/dev/bumblebee-status/bumblebee/engine.py", line 119, in _read_aliases
    mod = importlib.import_module("bumblebee.modules.{}".format(module["name"]))
  File "/usr/lib/python3.6/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 978, in _gcd_import
  File "<frozen importlib._bootstrap>", line 961, in _find_and_load
  File "<frozen importlib._bootstrap>", line 950, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 655, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 205, in _call_with_frames_removed
  File "/home/cjlarose/dev/bumblebee-status/bumblebee/modules/cpu.py", line 10, in <module>
    import psutil
ModuleNotFoundError: No module named 'psutil'

This appears to be caused by the way that aliases are implemented. Aliases for modules are defined in the modules themselves, and instances of bumblebee.engine.Engine import all modules in their initializers in order to read those aliases.

[modules] Fixed-length modules

The length of some modules (e.g. cmus) fluctuates quite a lot depending on the content. It would be nice to have the option to restrict the length by padding/truncating the contents.

Python3 compatibility

Make all modules compatible with python3. That way, #!/usr/bin/env python in the main file is OK :)

YAML Support

Add support for using YAML as alternative for jSON when defining templates.

[config] Add config file option

Make it possible to provide the module configuration also as configuration file.

Parameters on the commandline should take precedence.

[modules] Add xrandr module

Add a module that allows a user to:

  • see which screens are attached
  • toggle each screen on/off (as left/rightmost screen)

[modules/xrandr] Switching off a display crashes the module, and bumblebee-status

It is a dual monitor setup. Running it on a console shows where the problem lies. The bug seems to be related to be using python 3, since sys.maxint (line 40) is not available on python 3. Switching it to sys.maxsize seems to be the fix if I'm understanding python documentation properly (and switching it locally seems to fix the issue).

Add support for Python 3.2

For some reason, I left out python 3.2 from the Travis tests, and I think it's because there was some issue.

[themes] Deduplicate colors & icons

Right now, each theme has 2 conceptual contents:

  • Icon sets
  • Colors

So, for example, we have powerline-solarized, powerline-gruvbox.

It would be nicer to have a theme that is composed of iconsets and colors. Especially for the iconsets, it could even make sense to have a "nesting" (i.e. use icons of iconset A and fallback to iconset B if icons are missing in A).

cannot start bumblebee after last update

i think that this commit introduced this issue: 251f8d2#diff-8cd86bca63308fc9023fb6f0117ce31eR16

output:

╰─ bumblebee-status -m kernel
Traceback (most recent call last):
  File "/usr/bin/bumblebee-status", line 64, in <module>
    main()
  File "/usr/bin/bumblebee-status", line 17, in main
    filename="{}/debug.log".format(os.path.dirname(os.path.realpath(__file__)))
  File "/usr/lib/python3.6/logging/__init__.py", line 1776, in basicConfig
    h = FileHandler(filename, mode)
  File "/usr/lib/python3.6/logging/__init__.py", line 1025, in __init__
    StreamHandler.__init__(self, self._open())
  File "/usr/lib/python3.6/logging/__init__.py", line 1054, in _open
    return open(self.baseFilename, self.mode, encoding=self.encoding)
PermissionError: [Errno 13] Permission denied: '/usr/share/bumblebee-status/debug.log'

Icons don't appear

Hi, thanks a lot for your work :)

I tried to make this bumblebee-status works on my computer, and it appears that
it works fine except for the icons part. I have no icons at all, I tried to run the testjson.sh
script and it told me that this is not json so I assume at least a part of the problem comes
from here but I don't know what to do in order to make it work.

Thanks

gpmdp has dependency not listed

gpmdp seems to need gpmdp(obv), but also gpmdp-remote, which is not so obvious. Looking at the code, it's running commands, expecting that to be installed. Should be listed in module listings.

Debug mode

Hi, is there a way to access error logs once executed in i3bar? I'm having problems with xrandr module, whenever I click on it, nothing happens and no click events work anymore on any modules. I'd like to debug that but I'm having problems figuring out how to do it. I'd appreciate some pointers.

Best
—Michal Siedlaczek

[themes] Improve theme selection logic

While I like the way themes are constructed (i.e. you have a default theme, which can be overriden by a module theme, which can be overriden by an instance theme), the structure in the code is weird and confusing.

  • Passing the instance should be more straight forward, right now, the logic is distributed between modules and widgets. Maybe modules should have their own widgets derived from the general Widget class?

  • The code in theme.py to determine which theme to use is also far from easy to understand and actually doesn't work correctly in certain corner cases (i.e. cycles are not possible outside the "default" path)

Icons not showing up.

Hi, I'm having a problem with a few of the icons not showing up. I am unable to see the icon for the time module and the pasink module. All other icons appear to have rendered correctly, and this happens with multiple different fonts.

font-awesome is installed, and the icons render correctly when I open the json file with emacs configured to use the same font.

I tried using pango:Inconsolata as I saw that's what you used in another issue.

Have you got any advice on how to troubleshoot this issue?

Finally, thanks for the tool, much appreciated. 👍

Better event specification

The current way of specifying events on the commandline is ugly. Improve that.

For example:

bumblebee-status --parameter disk.left_click=<command> --parameter disk.<path>.left_click=<command>

[module/redshift] Without internet connection, module blocks update for whole bar

When redshift tries to automatically determine the location, invoking "redshift -p" hangs, consequently blocking the whole i3bar from updating.

Unfortunately, there's not a really easy solution to this. Probably, the best approach is to have an "asynchronous execution" command in utils that invokes a callback when it completes (i.e. decouple the i3bar update from the command update)

[core] Improve instance/widget/module logic

The current distinction between a module, a widget, and an instance is blurry (even to me) and confusing at best (error-prone, usually).

Improve this and also find a better way to provide an interface for the modules.

  • Hide alias implementation from module
  • simplify callbacks and get/set by unifying (possibly with mixin)
  • Add callbacks to widgets? (overhead, but nicer representation of the actual concept) - maybe make persistent widgets in the bargain
  • Don't store any more state in the module, put all of it into the widget
  • Widgets have "names" (which are the instances, internally) - or maybe solve that using IDs? (danger: if the IDs change, that probably causes strange timing issues when the bar gets updated during a click)

Overall goal: After this ticket is done, there should be significantly less code than before

Make limits and other arguments configurable

Avoid hard-coded values in the modules. Instead, create something like a config repository. Ideally, the config parameters can come from either a configuration file or a commandline switch. That also gets rid of the incredibly ugly "splitter" hack.

For instance:

bumblebee-status -m disk time --parameter disk.path=/ --parameter time.format="%H:%M" --parameter interval=5

Or, in the config file:

interval = 5
[disk]
path=/

[time]
format = "%H:M%"

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.