Commit graph

22 commits

Author SHA1 Message Date
Tobi-wan Kenobi
f6db8b0a85 [themes] Move theme folder out of Python folder
fixes #16
2016-11-25 17:57:41 +01:00
Tobi-wan Kenobi
dead54ed1f [modules/cmus] Add controls for cmus (next/prev/shuffle/repeat)
Add controls that allow the user to switch to the next and previous song
in cmus, toggle shuffle and repeat. Pause/play is toggled by clicking on
the song title itself.

fixes #5
2016-11-12 12:11:42 +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
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
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
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
d62258c89d [all] Major refactoring
Introduce an "Engine" class to abstract some of the details of loading
modules, registering events, etc.
2016-11-04 21:03:12 +01:00
Tobias Witek
f02c49286b [main] Add available themes to listing output 2016-10-31 16:47:34 +01:00
Tobias Witek
83bb1deb52 [themes] Add cycling for individual elements
Add functionality to provide lists of values for individual elements of
a theme (e.g. the prefix) and those will be cycled for each call.

This can be used, for example, to show a "charging" symbol for the
battery that continuously goes throw all the battery stages to "animate"
the charging icon.
2016-10-31 11:46:07 +01:00
Tobias Witek
14bce293eb [themes] Add support for generic warning/critical colors
Font and background colors for warning and critical elements can now be
specified using fg-warning, fg-critical, bg-warning and bg-critical.

Also, optionally, the "urgent" flag will be set towards the i3bar, if
possible.
2016-10-31 11:35:12 +01:00
Tobias Witek
23617fbdb7 [themes] Cycle handling bugfix
Cycling was accidentially more important than the individual widget
themes.
2016-10-31 11:05:54 +01:00
Tobias Witek
2a35905b89 [themes] Add "cycle" theme capability
It is now possible to add a list of theme configurations in the
"default" section called "cycle". These configuration items will be
cycled through module by module. to create "alternate style" effects.
This is *only* possible in the "default" configuration part, but any
module-specific configurations still take precedence.

Also, removed the capability of per-widget themes. That simply
complicates things and probably doesn't really bring any benefits.
2016-10-31 10:45:15 +01:00
Tobias Witek
656c499c95 [themes] Add custom separators
Add the possibility to configure custom separators in the theme file.
These will only be used if the default i3bar separators have been
disabled. Background color will always be taken from the previous
element (to work nicely with my long-term plan, a powerline-like status
line).
2016-10-31 08:14:12 +01:00
Tobias Witek
7b48b08365 [themes] Add font and background colors to themes
Themes can now specify "fg" (font color) and "bg" (background color) on
all levels.
2016-10-31 07:54:18 +01:00
Tobias Witek
8538f272d6 [rework] Replace old-style string formatting with new-style 2016-10-31 07:46:21 +01:00
Tobias Witek
60f63f3269 [themes] Configure presence of default i3bar separators
For each theme & module, it is now possible to configure whether the
default i3bar separators should be drawn or not.
2016-10-31 07:39:26 +01:00
Tobias Witek
97273b5a41 [themes] Add state-dependent themeing
Module themes (only!) can now contain state-specific theme information -
for example, the "battery" module has different states for charging and
discharging, and those can have different prefix and postfix
configurations to indicate what is going on.
2016-10-31 07:34:43 +01:00
Tobias Witek
3ca53dd0fa [themes] Make individual items theme-able (a bit)
Individual items in the bar can now be configured with a prefix and a
suffix. It works like this:

* If there is a specific module configuration in the theme
  configuration, use that (i.e. { "<modulename>": { "prefix: " a " } })
* Otherwise, if there is a configuration in the "default" section of the
  theme, use that
* Otherwise, if the module object itself has a method called like the
  required attribute (prefix, suffix), use that
* Otherwise, leave prefix/suffix empty ("")
2016-10-31 07:18:57 +01:00