Commit graph

19 commits

Author SHA1 Message Date
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
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
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
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
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
ca64851687 [modules/disk] Fix multi-instance disk 2016-11-27 18:36:45 +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
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
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
6fa7f9d789 [modules/disk] Show used instead of free disk 2016-11-03 19:44:11 +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
bb6ca556c7 [modules] Add support for disk utilization
Add a new module "disk" that takes an optional parameter (the path) and
displays free & total disk space, along with the usage percentage.

Also, added Tunnel/VPN support to the themeing of the "net" module.
2016-10-31 13:34:48 +01:00