Commit graph

67 commits

Author SHA1 Message Date
Pavle Portic
be6559a251 [modules/caffeine] Add caffeine module to prevent sleep 2016-11-23 13:57:29 +01:00
tobi-wan-kenobi
5149991ff3 Merge pull request #13 from paxy97/master
Missing battery fix and gruvbox theme
2016-11-18 20:03:34 +01:00
Tobi-wan Kenobi
0c9177cb79 [modules/ping] Allow recovery from unreachable
Due to a bug, when the destination was unreachable, the checking thread
would terminate, effectively keeping the widget stuck in "unreachable"
mode.

Now, enable recovery by keeping the thread running even if the target is
not reachable for some time.
2016-11-18 19:47:28 +01:00
Pavle Portic
3293cbaac4 [modules/battery] Display AC when no battery is present 2016-11-17 23:02:49 +01:00
Tobi-wan Kenobi
d37068b442 [modules/cmus] Always initialize variables
Initialize shuffle and repeat status variables even if cmus is not
running at all.
2016-11-15 20:35:35 +01:00
Tobi-wan Kenobi
36d723e7e6 [modules/memory] Adapt limits
Limits are now actually against the amount of memory used, instead of
memory still free (more intuitive).

fixes #12
2016-11-15 20:34:14 +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
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
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
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
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
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
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
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
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
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
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
89b97d7283 [modules/dnf] Only do update check every 'interval'
Yet another bug in the DNF module - really a troublesome one. Only call
the dnf updateinfo every interval, not every second. That significantly
reduces CPU load.
2016-11-04 19:01:19 +01:00
Tobias Witek
fb6337c625 [modules/dnf] DNF module was not updating properly
Due to name-clashing of the datetime module's "time" alias, time.sleep
didn't work (as it was looked up from the i3bumblebee module),
consequently, the DNF poll thread exited.

While at it, "beautify" the thread cancelling a bit by waiting until
the main thread is not running anymore.
2016-11-04 18:50:38 +01:00
Tobias Witek
6e8acc2765 [modules/memory] Show used instead of free RAM 2016-11-03 19:45:48 +01:00
Tobias Witek
29131e2f65 [modules/nic] Exclude docker and vbox interfaces
Until I have a clue on how to correctly handle them, exclude
docker and vbox network interfaces.
2016-11-03 19:45:12 +01:00
Tobias Witek
5532526595 [modules/dnf] Fix a bug wrt. counter extraction
Bugfixes and enhancements were wrongly extracted.
2016-11-03 19:44:34 +01:00
Tobias Witek
6fa7f9d789 [modules/disk] Show used instead of free disk 2016-11-03 19:44:11 +01:00
Tobias Witek
329f546879 [modules/battery] Cap capacity at 100%
Seems like my laptop at work is overly enthusiastic when it comes to
charging. I don't believe in 105% capacity.
2016-11-03 19:43:30 +01:00
Tobias Witek
4c34cd37d4 [modules] Add default click events to various modules
* cpu+memory: Open "gnome-system-monitor"
* disk: Open nautilus
* pulseaudio: Mute/unmute, open "pavucontrol" on right-click, raise/lower
  volume on mouse wheel up/down
2016-11-01 08:18:46 +01:00
Tobias Witek
fca3171556 [modules] Allow modules to provide default click actions
Pass the "output" object to the modules' constructor to allow them to
define their own callbacks.
Any user-provided callbacks take precedence and override those of the
module.
2016-11-01 08:09:10 +01:00
Tobias Witek
579381978e [output] Add support for click-events in i3
The i3 output now has a separate thread that continuously monitors stdin
for incoming click events. The generic output class also has methods for
registering callbacks (as commands). For now, by default, scroll events
will be used to emulate the next/previous workspace.
2016-11-01 07:46:26 +01:00
Tobias Witek
c0421163d4 [doc] Add description, usage and notes to all modules 2016-10-31 16:08:03 +01:00
Tobias Witek
598f3e70e9 [main] Initial support for "-l" parameter
List all available modules and query their description, notes and usage.
2016-10-31 15:49:15 +01:00
Tobias Witek
f72d905d97 [modules] Add "spacer"
Add a very, very basic module that simply adds a spacer (and empty
element) to the bar.
2016-10-31 15:23:59 +01:00
Tobias Witek
bcf0264f99 [modules] Add DNF supervision module
Add a module that periodically (by default, once every 30min) calls
"dnf updateinfo" and evaluates the results to report the number of
bugfixes, enhancements, etc.

If there's either too many pending updates, or at least one security
update, the module goes critical.
2016-10-31 15:17:51 +01:00
Tobias Witek
b3e17d4899 [modules/date] Combine to datetime module with date and time aliases
Move module "date" to "datetime" (display both date and time), and
create new aliases "time" and "date" (which only show date and time,
respectively).
2016-10-31 14:39:52 +01:00