2016-10-04 23:56:52 +02:00
|
|
|
# A widget for the Awesome Window Manager to monitor the network with Connman
|
|
|
|
|
|
|
|
This widget uses the
|
|
|
|
[`connman_dbus`](https://luarocks.org/modules/stefano-m/connman_dbus)
|
|
|
|
library.
|
|
|
|
|
|
|
|
# Requirements
|
|
|
|
|
|
|
|
In addition to the requirements listed in the `rockspec` file, you will need
|
|
|
|
the [Awesome Window Manager](https://awesomewm.org)
|
|
|
|
and Connman (for more information about this, see the
|
|
|
|
[`connman_dbus`](https://luarocks.org/modules/stefano-m/connman_dbus)
|
|
|
|
documentation).
|
|
|
|
|
|
|
|
# Installation
|
|
|
|
|
2019-08-21 21:48:20 +02:00
|
|
|
## Luarocks
|
|
|
|
|
2016-10-04 23:56:52 +02:00
|
|
|
Probably, the easiest way to install this widget is to use `luarocks`:
|
|
|
|
|
|
|
|
luarocks install connman_widget
|
|
|
|
|
|
|
|
You can use the `--local` option if you don't want or can't install
|
|
|
|
it system-wide
|
|
|
|
|
|
|
|
This will ensure that all its dependencies are installed.
|
|
|
|
|
2017-07-16 14:14:46 +02:00
|
|
|
Note that if you install with `--local` you will have to make sure that the
|
|
|
|
`LUA_PATH` environment variable includes the local luarocks path. This can be
|
|
|
|
achieved by `eval`ing the command `luarocks path --bin` **before** Awesome is
|
|
|
|
started.
|
|
|
|
|
|
|
|
For example, if you start Awesome from the Linux console (e.g. `xinit
|
|
|
|
awesome`) and you use `zsh`, you can add the following lines to your
|
|
|
|
`~/.zprofile`:
|
|
|
|
|
|
|
|
``` shell
|
|
|
|
if (( $+commands[luarocks] )); then
|
|
|
|
eval `luarocks path --bin`
|
|
|
|
fi
|
|
|
|
```
|
|
|
|
|
|
|
|
If you use `bash`, you can add the following lines to your `~/.bash_profile`:
|
|
|
|
|
|
|
|
``` shell
|
|
|
|
if [[ -n "`which luarocks 2>/dev/null`" ]]; then
|
|
|
|
eval `luarocks path --bin`
|
|
|
|
fi
|
|
|
|
```
|
2016-10-04 23:56:52 +02:00
|
|
|
|
2017-07-16 14:14:46 +02:00
|
|
|
If you use
|
|
|
|
an [X Display Manager](https://en.wikipedia.org/wiki/Display_manager) you will
|
|
|
|
need to do what explained above in your `~/.xprofile` or `~/.xinitrc`. See the
|
|
|
|
documentation of your display manager of choice for more information.
|
2016-10-04 23:56:52 +02:00
|
|
|
|
2019-08-21 21:48:20 +02:00
|
|
|
## NixOS
|
|
|
|
|
|
|
|
If you are on NixOS, you can install this package from
|
|
|
|
[nix-stefano-m-overlays](https://github.com/stefano-m/nix-stefano-m-nix-overlays).
|
|
|
|
|
|
|
|
|
2016-10-04 23:56:52 +02:00
|
|
|
# Configuration
|
|
|
|
|
2019-05-08 18:04:44 +02:00
|
|
|
The widget will display the network icons defined in your GTK+ theme and it
|
|
|
|
will resize them to fit in the available space. This means that you can switch
|
|
|
|
your icon theme, for example using `lxappearance`, and update the widget by
|
|
|
|
restarting AwesomeWM.
|
2016-10-04 23:56:52 +02:00
|
|
|
|
|
|
|
Depending on your network devices, you may need some or all of the icons
|
|
|
|
whose name starts with `network-`.
|
|
|
|
|
|
|
|
You can specify a GUI client to be launched when the widget is right-clicked.
|
2019-05-08 18:04:44 +02:00
|
|
|
This can be done by changing the `gui_client` field of the widget. A list of
|
|
|
|
[Desktop clients is also available on the Arch
|
|
|
|
wiki](https://wiki.archlinux.org/index.php/Connman).
|
2016-10-04 23:56:52 +02:00
|
|
|
|
|
|
|
# Mouse controls
|
|
|
|
|
|
|
|
When the widget is focused:
|
|
|
|
|
2017-06-05 16:39:24 +02:00
|
|
|
* Right button: launches GUI client (defined by the `gui_client` field)
|
2016-10-04 23:56:52 +02:00
|
|
|
|
|
|
|
# Tooltip
|
|
|
|
|
2017-06-05 16:39:24 +02:00
|
|
|
The tooltip shows the currently connected network, its status and - if
|
|
|
|
applicable - the signal strength.
|
2016-10-04 23:56:52 +02:00
|
|
|
|
|
|
|
# Usage
|
|
|
|
|
|
|
|
Add the following to your `~/.config/awesome/rc.lua`:
|
|
|
|
|
|
|
|
Require the module:
|
|
|
|
|
2016-10-22 00:20:43 +02:00
|
|
|
```lua
|
|
|
|
-- require *after* `beautiful.init` or the theme will be inconsistent!
|
|
|
|
local connman = require("connman_widget")
|
2017-06-05 16:39:24 +02:00
|
|
|
-- set the GUI client.
|
2016-10-22 00:20:43 +02:00
|
|
|
connman.gui_client = "wicd"
|
|
|
|
```
|
2016-10-04 23:56:52 +02:00
|
|
|
|
|
|
|
Add the widget to your layout:
|
|
|
|
|
2017-06-05 16:39:24 +02:00
|
|
|
- Awesome 4.x
|
|
|
|
|
|
|
|
``` lua
|
|
|
|
-- Add widgets to the wibox
|
|
|
|
s.mywibox:setup {
|
|
|
|
|
|
|
|
-- more setup
|
|
|
|
|
|
|
|
{ -- Right widgets
|
|
|
|
layout = wibox.layout.fixed.horizontal,
|
|
|
|
wibox.widget.systray(),
|
|
|
|
connman, -- <- connman widget
|
|
|
|
mytextclock,
|
|
|
|
s.mylayoutbox,
|
|
|
|
},
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
- Awesome 3.x
|
|
|
|
|
2016-10-22 00:20:43 +02:00
|
|
|
```lua
|
|
|
|
right_layout:add(connman)
|
|
|
|
```
|
2016-10-04 23:56:52 +02:00
|
|
|
|
|
|
|
# Limitations
|
|
|
|
|
|
|
|
Currently, only wired (ethernet) and WiFi connections are supported.
|
2017-07-16 14:15:50 +02:00
|
|
|
|
|
|
|
# Contributing
|
|
|
|
|
|
|
|
This project is developed in the author's spare time. Contributions in the form
|
|
|
|
of issues, patches and pull requests are welcome.
|