Commit graph

2662 commits

Author SHA1 Message Date
Tobi-wan Kenobi
418dc1be86 [modules/cmus] Make displayed string configurable
Allow the user to use all tags read by cmus (cmus-remote -Q|grep ^tag)
as part of the displayed data (plus the special 'tags' "duration" and
"position").
2016-11-12 08:34:21 +01:00
Tobi-wan Kenobi
507e0c36cc [doc] Add screenshots for brightness + cmus modules 2016-11-09 19:43:15 +01:00
Tobi-wan Kenobi
e4ff22f1e0 [themes] Add brightness and cmus module support
Add themeing for brightness and cmus
2016-11-09 19:39:12 +01:00
Tobi-wan Kenobi
a43938b1c8 [modules/cmus] Add vim line + change default text
Slightly adapt default text to indicate that cmus is not running.
2016-11-09 19:38:32 +01:00
Tobi-wan Kenobi
ba466d5179 [modules/brightness] Add callbacks for increasing/decreasing brightness
Use xbacklight to increase or decrease brightness when the user uses the
mouse wheel over the brightness widget.
2016-11-09 19:37:09 +01:00
Tobi-wan Kenobi
f164aee5c9 [modules/brightness] Add missing integer casting for calculation
To display a nice percentage-based brightness, round it to int in all
circumstances.
2016-11-09 19:32:26 +01:00
tobi-wan-kenobi
da4dd7c7a1 Merge pull request #10 from paxy97/master
Add brightness and Cmus modules
2016-11-09 19:30:29 +01:00
Pavle Portic
56524ce54b Add Cmus player module 2016-11-07 22:14:46 +01:00
Pavle Portic
3a19be09c3 Add brightness module 2016-11-07 22:00:02 +01:00
Tobias Witek
9c95c0b319 [tests] Added first module tests (for CPU)
I finally *really* need to get started on testing. I've had too many
releases in too short time intervals now, all because of small
bugs/oversights.
2016-11-06 14:30:59 +01:00
Tobias Witek
af6055bd83 [modules/nic] Interfaces were always up
Wrong initialization of the status variable led to interfaces that were
always in up state.
2016-11-06 10:59:25 +01:00
Tobias Witek
b6c430a8da [themes] Update battery themes
Names of discharging states have changed.
2016-11-06 10:57:42 +01:00
Tobias Witek
89f49856d9 [modules/nic] Too many addresses per interface
Addresses were not cleared correctly, resulting in too many IPs being
displayed for the second, third, etc. interface.
2016-11-06 08:21:33 +01:00
Tobias Witek
749a9761b2 [modules/dnf] Fix for python2
This usage of split actually broke python2.... Wonder why I never
noticed that before.
2016-11-05 20:04:04 +01:00
Tobias Witek
6de18f831d [modules] Add module to measure the RTT of an address
The module simply calls the external tool "ping" to retriev RTT
information and displays the average RTT in the widget.

Addresses issue #6
2016-11-05 19:55:43 +01:00
Tobias Witek
45f84a6b39 [doc] README: Add new syntax for "list" command 2016-11-05 18:07:00 +01:00
Tobias Witek
b33bc791f7 [doc] Update README 2016-11-05 18:06:06 +01:00
Tobias Witek
e2a6d41389 [theme] Add YAML as optional format for themes
This addresses issue #4
2016-11-05 16:53:34 +01:00
Tobias Witek
6eea8da1af [output] bugfix: enable scroll-wheeling again
The callback registration/lookup logic was flawed, so that callbacks
without module name were never executed.
2016-11-05 16:39:46 +01:00
Tobias Witek
4e0e3ef427 [general] Add Python3 support
* Change some formatting to please python3
* remote pyroute2 dependency, for which I didn't find a python3 module
  in Fedora24

this solves #1
2016-11-05 16:33:35 +01:00
Tobias Witek
caceb6f20f [help] Update and beautify the commandline help output 2016-11-05 16:18:53 +01:00
Tobias Witek
3af8ee771d [general] Refactoring
* remove (hopefully) unnecessary import statements
* make some code a bit more compact
* remove dead code ... again: hopefully so
2016-11-05 15:54:34 +01:00
Tobias Witek
e889098c77 [modules/disk] Remove "custom" instance callback
This callback just makes it really hard to see for the user what is
going on. The alias the user provides should *always* match the
instance, so that it can be used in a meaningful way in the click
action, for example (otherwise, something like "nautilus {instance}"
gets really hard to interpret.
2016-11-05 15:45:33 +01:00
Tobias Witek
67142d642b [module/output] Re-enable user configurable mouse click events
This is now much nicer implemented to address issue #3. A user can now
have a configuration parameter mapped to a module instance (via the
module name or the instance name) with the value "left-click",
"right-click", etc., like this:

-m disk:home -p home.left-click="nautilus {instance}"
2016-11-05 15:39:21 +01:00
Tobias Witek
26f5fd3064 [modules] Re-enable preconfigured on-click actions 2016-11-05 15:28:33 +01:00
Tobias Witek
c821deec1c [modules/time] bugfix: Use module instance format 2016-11-05 14:43:03 +01:00
Tobias Witek
2d873387ea [modules] Re-enable DNF module 2016-11-05 14:37:07 +01:00
Tobias Witek
4e648cf009 [modules] Add module-specific configuration
Big oversight in my previous commits: Widgets need to be able to have
specific configurations (i.e. the path for different instances of the
"disk" module has to be different).

To account for that, it is now possible to assign an "alias" to a module
instance using ":" (for example: -m "disk:home"). This alias is then
used for the configuration parameter resolution automatically, for
example:

-m disk:home -p home.path=/home

As a consequence, parameter names in the module code are now relative to
the module, which means: shorter!
2016-11-05 14:26:02 +01:00
Tobias Witek
9f9b27ad7a [modules] Re-enable spacer 2016-11-05 13:53:08 +01:00
Tobias Witek
fb466bfd91 [modules] Re-enable pulseaudio modules 2016-11-05 13:50:51 +01:00
Tobias Witek
db8737a6aa [modules/nic] Add interface type cache to avoid too many open files
Repeatedly querying the interface type the way I'm doing right now
results in "too many files open" pretty quickly. Obviously, it's a bit
of a concern that I am leaking a file descriptor somewhere, but for now,
the quickfix is to cache the type (it shouldn't change, anyhow).
2016-11-05 13:47:27 +01:00
Tobias Witek
a9a62a738d [modules] Re-enable nic module + allow widget states
All callback from a widget into a module (e.g. for retrieving the status
or the criticality state) now get a widget passed. This has the purpose
of allowing a module to store state/widget specific data somewhere. This
way, for instance, it is possible to store the interface name as part of
the widget, thus making it possible to show the status of the correct
interface.
2016-11-05 13:42:26 +01:00
Tobias Witek
bd0089dac0 [modules] Re-enable "disk" module 2016-11-05 13:23:46 +01:00
Tobias Witek
286aff2aa0 [output] Allow modules to pass back a single widget
Since "single widget" is the 99% use-case, make it easier for a module
to return a single widget.
2016-11-05 13:12:30 +01:00
Tobias Witek
2cfb0997a0 [modules] Re-enable battery module
Enable battery module with new states:
* discharging-[10,25,50,80,100]
* charging
* charged
2016-11-05 13:09:28 +01:00
Tobias Witek
18d7e1befb [config] Allow parameter passing via commandline
Allow the user to specify arbitrary configuration parameters from the
commandline and evaluate those in the modules (and elsewhere). Re-enable
the CPU module as a first showcase of this functionality.
2016-11-05 12:28:05 +01:00
Tobias Witek
353c47d76e [general] Very minor refactoring 2016-11-05 12:18:30 +01:00
Tobias Witek
73d62d7ded [widgets] Pass through some information to the underlying module object
For determining status, critical/warning state, etc. simply let the
widget pass through a call to the underlying object.
2016-11-05 12:14:33 +01:00
Tobias Witek
2f0cc30c38 [config] Write custom action for printing theme/module details 2016-11-05 12:07:54 +01:00
Tobias Witek
998db40a2d [theme] Re-implement rotation of values for theme entries
Allow theme entries to be lists that are then iterated. For this
purpose, extend the Config class so that it can serve as generic store
for data items. That makes it easy to centralize code used for rotation
etc. in a single place.
2016-11-05 11:57:09 +01:00
Tobias Witek
98acd15edf [theme] Re-implement colorscheme cycling
Again, allow the "default" section to contain cycles that are used one
after the other for each widget.
2016-11-05 11:40:27 +01:00
Tobias Witek
bab7821607 [all] Refactor module <-> output communication
Modules now return "bumblebee.output.Widget" objects, so that they can
actually define a list of items to be drawn in the bar.
2016-11-05 08:59:43 +01:00
Tobias Witek
7f91b8298f [modules] Refactor module initialization
Modules now get an output and a complete config object. This should make
customization much easier in the future.
2016-11-05 08:11:08 +01:00
Tobias Witek
c2adf38b92 [engine] Remove obsolete Argument class 2016-11-05 08:00:47 +01:00
Tobias Witek
a8b29ed22e [config] Beautify help output a bit 2016-11-05 07:59:58 +01:00
Tobias Witek
a58610f3ee [config] Start refactoring by creating separate config class
Add a class that will hold all configuration and argument information
and serve as central repository for this kind of information.
2016-11-05 07:54:36 +01:00
Tobias Witek
df27355977 [tests] Add framework for unittests 2016-11-05 07:54:16 +01:00
Tobias Witek
9da9fdaaa5 [engine] Add missing import 2016-11-05 06:47:22 +01:00
Tobias Witek
55474aadc3 [general] Minor refactoring
Shuffled some code around in an attempt to make it easier to read and
understand.
2016-11-04 21:41:22 +01:00
Tobias Witek
47935942f0 [engine] Reformat a bit (line breaking)
Break some extensively long lines
2016-11-04 21:18:07 +01:00