From 6511ed27a72d252fb2929df89468ecd78fce1950 Mon Sep 17 00:00:00 2001 From: Stefano Mazzucco Date: Sun, 16 Jul 2017 13:09:58 +0100 Subject: [PATCH] Improve documentation about installing the widget - remove section about installing from source: this requires some juggling and symlinking, so I will leave it to people who *really* want to do it - explain how to export the local luarocks path when installint locally with luarocks --- README.md | 34 +++++++++++++++++++++++++++------- 1 file changed, 27 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 543db5f..eca6416 100644 --- a/README.md +++ b/README.md @@ -14,9 +14,7 @@ documentation). # Installation -## Using Luarocks - -Probably, the easiest way to install this widget is to use `luarocks`: +The easiest way to install this widget is to use `luarocks`: luarocks install power_widget @@ -25,11 +23,33 @@ it system-wide This will ensure that all its dependencies are installed. -## From source +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. -Alternatively, you can copy the `power_widget.lua` file in your -`~/.config/awesome` folder. You will have to install all the dependencies -manually though (see the `rockspec` file for more information). +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 +``` + +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. # Configuration