Commit graph

122 commits

Author SHA1 Message Date
Tobi-wan Kenobi
dd6b13265d [modules/pacman] Re-enable pacman update information
see #23
2016-12-11 12:42:49 +01:00
Tobi-wan Kenobi
1d6ca352b9 [modules/xrandr] Re-enable xrandr module
Displays the connected screens and allows the user to enable/disable
them.

see #23
2016-12-11 12:23:33 +01:00
Tobi-wan Kenobi
17ee621a5a [modules/ping] Spawn thread on-the-fly
Instead of having a thread that runs in the background continuously,
spawn a new one for every update interval. That speeds up the tests
quite a lot.

see #23
2016-12-11 11:50:15 +01:00
Tobi-wan Kenobi
71582cbcd7 [modules/ping] Re-enable ping module
Show RTT measured by ICMP echo request/replies for a given host.

For that to work correctly, change the "full_text" callback for a widget
so that the widget itself is also passed as argument in the callback
method. That actually makes a lot of sense, since the widget can now be
used as a repository of state information.

see #23
2016-12-11 11:37:24 +01:00
Tobi-wan Kenobi
666daff9a6 [modules/pulseaudio] Re-enable pulseaudio module
Display volume for default PulseAudio source/sink, change volume and
mute/unmute device.

see #23
2016-12-11 08:51:56 +01:00
Tobi-wan Kenobi
23d7d53fca [modules] critical/warning threshold refactoring
Quite a lot of modules use the "if higher X -> critical, if higher Y ->
warning" idiom now, so extracted that into a common function for reuse.

see #23
2016-12-11 08:25:54 +01:00
Tobi-wan Kenobi
edfccd2d31 [modules/spacer] Re-enable "spacer", the text-display widget
see #23
2016-12-11 08:17:37 +01:00
Tobi-wan Kenobi
c8fc75a401 [modules/load] Re-enable load module
Display system load and show warning/critical error when load is above a
certain threshold (compared to the number of available CPUs).

see #23
2016-12-11 08:01:43 +01:00
Tobi-wan Kenobi
1a4cddb0b6 [core] Fix callback registration ("shadowed" events)
Until now, as soon as a widget registered *any* callback, the default
callbacks (e.g. scroll up/down to go to next/previous workspace) didn't
work anymore, as there was a better match for the general registration
(even though not for the button).

To fix this, merge the callback registration into a flat registration,
where a key is calculated from the ID of the registrar and the
registered button.

see #23
2016-12-11 07:38:56 +01:00
Tobi-wan Kenobi
d91294f010 [modules/battery] Fix ac and unknown display
If the computer runs on AC, display that instead of showing "100%" in
the status.

Also, if reading the charging status fails for some reason (except the
computer being on AC), go into critical state and display "n/a".

see #23
2016-12-11 07:28:15 +01:00
Tobi-wan Kenobi
2cc2cf8282 [core/engine] Add aliasing mechanism to modules
Allow modules to define aliases. This replaces the symlink mechanism
that was in place previously, because it was a bit ugly (and confused
code climate).

see #23
2016-12-11 07:18:06 +01:00
Tobi-wan Kenobi
a1455c9687 [modules/battery] Handle inexistent battery more gracefully 2016-12-10 19:54:31 +01:00
Tobi-wan Kenobi
14b8feeef1 [modules/datetime] Add help text 2016-12-10 19:30:25 +01:00
Tobi-wan Kenobi
d41c142d4a [modules/memory] Re-enable memory usage module
Add module that shows RAM consumption and opens the gnome-system-monitor
on click.

see #23
2016-12-10 19:20:19 +01:00
Tobi-wan Kenobi
e15147fe10 [tests/disk] Add critical/warning threshold tests for disk module
see #23
2016-12-10 18:49:25 +01:00
Tobi-wan Kenobi
12f5ce5977 [modules/disk] Re-enable disk usage module
Add a module that shows the disk usage for various paths and opens
nautilus on that path whenever it is clicked.

see #23
2016-12-10 18:21:01 +01:00
Tobi-wan Kenobi
771c597ce9 [modules/caffeine] Re-implement caffeine module
Add caffeine module & add a framework for testing it (no tests yet,
though).

see #23
2016-12-10 15:36:18 +01:00
Tobi-wan Kenobi
163419063d [tests/battery] Add some tests for the battery module
see #23
2016-12-10 14:50:49 +01:00
Tobi-wan Kenobi
1b8385b33f [modules/brighness] Re-enable brightness module
Add a module for reporting, increasing and decreasing the brightness of
a display.

see #23
2016-12-10 14:31:18 +01:00
Tobi-wan Kenobi
7ea8c5320d [modules] Add help texts
see #23
2016-12-10 12:03:58 +01:00
Tobi-wan Kenobi
4d4a7bf29d [modules/battery] Re-enable battery module
Extend theme to be able to accept lists of values and cycle through
them. Use this to "animate" the charging symbol for the battery.

see #23
2016-12-10 12:00:08 +01:00
Tobi-wan Kenobi
72e375ac8b [modules/nic] Check for vanished interfaces
If a widget exists for an interface that is not there anymore (i.e. a
tunnel interface that has been removed, or a USB device that has been
unplugged), remove that widget from the list.

see #23
2016-12-10 11:33:35 +01:00
Tobi-wan Kenobi
a045962d00 [modules/nic] Re-enable NIC module
Re-add the NIC module with all its functionality (hopefully...).

This introduces a new concept: Instead of having separate queries for
critical and warning (which really are just another set of states), a
module can now return a list of states for each widget. All the state
information is then merged together into a single theme. So, for
instance, the NIC module can return a state saying "critical -
wlan-down", which applies the theme information for both "critical" and
"wlan-down".

see #23
2016-12-10 11:25:02 +01:00
Tobi-wan Kenobi
761b81970d [modules/cpu] Pad to 3 digits before comma to fix width
I cannot get the min_width property to work right now, so in order to
fix the width of the CPU widget, pad the utilization to 3 digits (so
that even 100% aligns nicely).

see #23
2016-12-10 09:04:12 +01:00
Tobi-wan Kenobi
b1ec41f905 [modules/cmus] Add mouse controls
Enable play/pause, repeat/shuffle toggle, next/prev song by clicking on
the various elements in the bar.

see #23
2016-12-10 08:19:24 +01:00
Tobi-wan Kenobi
1a3217bb5f [modules/cmus] Add status callback
Inform the theme about the current playback status (start, stop, repeat,
shuffle).

see #23
2016-12-10 08:16:27 +01:00
Tobi-wan Kenobi
225d471c6a [modules/cpu] Add configurable warning and critical thresholds
The cpu module now has cpu.warning and cpu.critical thresholds. If the
CPU utilization is higher than any of those values, the widget's state
changes to warning or critical, respectively.

see #23
2016-12-10 08:09:13 +01:00
Tobi-wan Kenobi
87e76b9e40 [modules/cmus] Re-add cmus module
Re-add a first version of the cmus module originally contributed by
@paxy97.

Still missing:
* Icon themes (status)
* On-click actions

see #23
2016-12-10 07:47:24 +01:00
Tobi-wan Kenobi
e72c25b0bc [core] Add input processing
Create infrastructure for input event handling and add i3bar event
processing. For each event, callbacks can be registered in the input
module.
Modules and widgets both identify themselves using a unique ID (the
module name for modules, a generated UUID for the widgets). This ID is
then used for registering the callbacks. This is possible since both
widgets and modules are statically allocated & do not change their IDs.

Callback actions can be either callable Python objects (in which case
the event is passed as parameter), or strings, in which case the string
is interpreted as a shell command.

see #23
2016-12-09 19:29:16 +01:00
Tobi-wan Kenobi
252260c249 [modules/datetime] Use parameter functionality to get format
Make the format string of the datetime module configurable using the new
parameter() method in the module.

Also, restructured the setting of the config information a bit so that
the parameter() method can be used in the constructor of a module.

see #23
2016-12-09 08:23:53 +01:00
Tobi-wan Kenobi
f40418475f [modules/datetime] Re-enable datetime module
Add datetime module + aliases date and time.

see #23
2016-12-09 07:11:23 +01:00
Tobi-wan Kenobi
f645203579 [core] Widget creation/update overhaul
Until now, widgets were re-created during each iteration. For multiple,
reasons, using static widget objects is much easier, so instead of
creating new widgets continuously, modules now create the widgets during
instantiation and get the list of widgets passed as parameter whenever
an update occurs. During the update, they can still manipulate the
widget list by removing and adding elements as needed.

Advantages:
* Less memory fragmentation (fewer (de)allocations)
* Easier event management (widgets now have static IDs)
* Easier module code (widget contents can simply be the result of a
  callback)

see #23
2016-12-08 08:44:54 +01:00
Tobi-wan Kenobi
aacc56a4e2 [modules/cpu] Add initial version of CPU utilization module
Re-enable the CPU utilization module as proof-of-concept for the new
core engine.

see #23
2016-12-04 17:45:42 +01:00
Tobi-wan Kenobi
b6eb3ee8e6 [output/i3bar] Add flush method
flush() terminates a single iteration of widget drawing.

see #23
2016-12-04 16:14:43 +01:00
Tobi-wan Kenobi
a2c6214baa [core/engine] Add module loading logic
Allow the engine to load modules from the bumblebee/modules/ directory.

see #23
2016-12-04 11:09:10 +01:00
Tobi-wan Kenobi
a8a6c9bba2 [core] Refactor engine
This is going to be a bit more comprehensive than anticipated. In order
to cleanly refactor the core and the engine, basically start from
scratch with the implementation.

Goals:

* Test coverage
* Maintain backwards compatibility with module interface as much as
  possible (but still make modules easier to code)
* Simplicity

see #23
2016-12-03 20:38:54 +01:00
Tobi-wan Kenobi
31067159d6 [modules/nic] Minor refactoring
Remove impractical cache.
2016-12-02 19:06:47 +01:00
Tobi-wan Kenobi
2f3f171ca5 [core] Remove alias from module
Hide alias concept for modules in the engine. That way, the individual
modules never get to know about whether a module has been aliased or
not.

see #23
2016-12-02 18:53:34 +01:00
Tobi-wan Kenobi
f4b114bd6e [modules/nic] Add list of excluded interface prefixes as parameter
"nic.exclude" is now a parameter that can be used to have a custom list
of excluded interface prefixes. Multiple prefixes should be separated by
a comma.

fixes #26
2016-11-30 18:11:32 +01:00
hubertst
e9731b1063 Update nic.py
Exclude veth* interfaces created by minimesos
2016-11-30 11:07:27 +01:00
Tobi-wan Kenobi
4819147410 [modules/layout] Add autodetection and auto-adding of languages
Whenever the language is changed outside the bar, update the bar
accordingly. Also, when a new language is used, automatically append it
to the list of available languages.
2016-11-27 19:48:12 +01:00
Tobi-wan Kenobi
ca64851687 [modules/disk] Fix multi-instance disk 2016-11-27 18:36:45 +01:00
Tobi-wan Kenobi
60d96506e8 [modules/layout] Add rotation logic and language parameter
User can now specify a list of languages as parameter (pipe-separated
list). Variants can also be specified by separating language and variant
with a :

For instance: -p layout.lang="us|rs:latin"

Left click moves on to the next language, right click to the previous.

Right now, there are the following caveats:
* The first entry in the list must be the language used when the bar
  starts
* kxbd changes outside the bar are not picked up automatically
2016-11-27 18:08:22 +01:00
tobi-wan-kenobi
1f1e7748a3 Merge pull request #21 from Pseudonick47/master
Keyboard layout module
2016-11-27 17:33:40 +01:00
Milos Miljanic
488c17ea58 [modules]Keyboard layout 2016-11-27 16:24:11 +01:00
Tobi-wan Kenobi
e8b3dfb4ef [modules/xrandr] Add display on/off toggling
This one is a bit tricky:
* Clicking on an active xrandr output will disable it
* Clicking on a disabled xrandr output will enable it -> if
  it is a left-click, it will put it as the left-most display
  if it is a right-click, as the right-most display

Also, it will reload the i3 bars (using a script that allows
you to write custom pieces of an i3 configuration that is applied
conditionally depending on the screens you have).

It goes like this:
* Base config is in ~/.i3/config.template
* Output-specific config is in ~/.i3/config.<screen name>
* Output-specific config when other screens are also active is in
  ~/.i3/config.<screen>-<other-screens-in-alphabetic-order>

For instance:
$ ls ~/.i3
config.template
config.eDP1 -> will be applied to eDP1 (always)
config.VGA1-eDP1 -> will be applied to VGA1, if eDP1 is also active
config.VGA1 -> will be applied to VGA1 (if eDP1 is inactive)

fixes #19
2016-11-26 13:57:33 +01:00
Milos Miljanic
ce6133acd4 Merge branch 'master' of https://github.com/tobi-wan-kenobi/bumblebee-status 2016-11-26 12:36:40 +01:00
Milos Miljanic
59c0083fc4 Change keyboard layout (not done yet) 2016-11-26 12:33:42 +01:00
Tobi-wan Kenobi
c095b89022 [modules/xrandr] Sort display widgets by position
Show display widgets from left to right according to their relative
xrandr position.

see #19
2016-11-26 08:46:16 +01:00
Tobi-wan Kenobi
4ea0cfae1e [modules/xrandr] Add module to show attached displays
This modules shows attached displays and their states (on or off).
Future versions of this module will order the icons by the relative
order of the screens (left-to-right) and will allow switching monitors
on and off.

see #19
2016-11-26 08:28:19 +01:00