update widgets readme from master

This commit is contained in:
streetturtle 2019-12-15 15:38:54 -05:00
parent 8dcde91012
commit f71e023fb6
18 changed files with 701 additions and 192 deletions

View File

@ -8,30 +8,25 @@ Simple and easy-to-install widget for Awesome Window Manager.
This widget consists of:
- an icon which shows the battery level:
![Battery Widget]({{'/assets/img/screenshots/battery-wid-1.png' | relative_url }})
![Battery Widget](../awesome-wm-widgets/assets/img/screenshots/battery-widget/bat-wid-1.png)
- a pop-up window, which shows up when you hover over an icon:
![Battery Widget]({{'/assets/img/screenshots/battery-wid-2.png' | relative_url }})
![Battery Widget](../awesome-wm-widgets/assets/img/screenshots/battery-widget/bat-wid-2.png)
Alternatively you can use a tooltip (check the code):
![Battery Widget]({{'/assets/img/screenshots/battery-wid-22.png' | relative_url }})
- a pop-up warning message which appears on bottom right corner when battery level is less that 15% (you can get the image [here](https://vk.com/images/stickers/1933/512.png)):
![Battery Widget]({{'/assets/img/screenshots/battery-wid-3.png' | relative_url }})
![Battery Widget](../awesome-wm-widgets/assets/img/screenshots/battery-widget/bat-wid-22.png)
- a pop-up warning message which appears on bottom right corner when battery level is less that 15% (you can get the image [here](../awesome-wm-widgets/assets/img/screenshots/battery-widgetttps://vk.com/images/stickers/1933/512.png)):
![Battery Widget](../awesome-wm-widgets/assets/img/screenshots/battery-widget/bat-wid-3.png)
Note that widget uses the Arc icon theme, so it should be [installed](https://github.com/horst3180/arc-icon-theme#installation) first under **/usr/share/icons/Arc/** folder.
Note that widget uses the Arc icon theme, so it should be [installed](../awesome-wm-widgets/assets/img/screenshots/battery-widgetttps://github.com/horst3180/arc-icon-theme#installation) first under **/usr/share/icons/Arc/** folder.
## Installation
This widget reads the output of acpi tool.
- install `acpi` and check the output:
{% highlight bash %}
{% endhighlight %}
```bash
$ sudo apt-get install acpi
$ acpi
Battery 0: Discharging, 66%, 02:34:06 remaining
```
Then refer to the [installation](https://github.com/streetturtle/awesome-wm-widgets#installation) section of the repo.
Then refer to the [installation](../awesome-wm-widgets/assets/img/screenshots/battery-widgetttps://github.com/streetturtle/awesome-wm-widgets#installation) section of the repo.

View File

@ -1,32 +1,40 @@
---
layout: page
---
# Batteryarc widget
This widget is more informative version of [battery widget](https://github.com/streetturtle/awesome-wm-widgets/tree/master/battery-widget).
This widget is more informative version of [battery widget](../awesome-wm-widgets/assets/img/screenshots/batteryarc-widgetttps://github.com/streetturtle/awesome-wm-widgets/tree/master/battery-widget).
Depending of the battery status it may look one of the following ways:
Depending of the battery status it could look following ways:
- ![10_d]({{'/assets/img/screenshots/batteryarc-10_d.png' | relative_url }}) - less than 15 percent
- ![10_c]({{'/assets/img/screenshots/batteryarc-10_c.png' | relative_url }}) - less than 15 percent, charging
- ![20_d]({{'/assets/img/screenshots/batteryarc-20_d.png' | relative_url }}) - between 15 and 40 percent
- ![20_c]({{'/assets/img/screenshots/batteryarc-20_c.png' | relative_url }}) - between 15 and 40 percent, charging
- ![80_d]({{'/assets/img/screenshots/batteryarc-80_d.png' | relative_url }}) - more than 40 percent
- ![80_c]({{'/assets/img/screenshots/batteryarc-80_c.png' | relative_url }}) - more than 40 percent, charging
- ![10_d](../awesome-wm-widgets/assets/img/screenshots/batteryarc-widget/10_d.png) - less than 15 percent
- ![10_c](../awesome-wm-widgets/assets/img/screenshots/batteryarc-widget/10_c.png) - less than 15 percent, charging
- ![20_d](../awesome-wm-widgets/assets/img/screenshots/batteryarc-widget/20_d.png) - between 15 and 40 percent
- ![20_c](../awesome-wm-widgets/assets/img/screenshots/batteryarc-widget/20_c.png) - between 15 and 40 percent, charging
- ![80_d](../awesome-wm-widgets/assets/img/screenshots/batteryarc-widget/80_d.png) - more than 40 percent
- ![80_c](../awesome-wm-widgets/assets/img/screenshots/batteryarc-widget/80_c.png) - more than 40 percent, charging
Widget uses following beautiful variables with values:
If a battery level is low then warning popup will show up:
```lua
theme.widget_main_color = "#74aeab"
theme.widget_red = "#e53935"
theme.widget_yellow = "#c0ca33"
theme.widget_green = "#43a047"
theme.widget_black = "#000000"
theme.widget_transparent = "#00000000"
```
![warning](../awesome-wm-widgets/assets/img/screenshots/batteryarc-widget/warning.png)
which means that you need to copy the code above and paste it in your **theme.lua**. Otherwise you can change colors directly in the widget.
## Customization
It is possible to customize widget by providing a table with all or some of the following config parameters:
| Name | Default | Description |
|---|---|---|
| `font` | Font | Play 6 |
| `arc_thickness` | 2 | Thickness of the arc |
| `show_current_level`| false | Show current charge level |
| `main_color` | `beautiful.fg_color` | Color of the text with the current charge level and the arc |
| `low_level_color` | #e53935 | Arc color when battery charge is less that 15% |
| `medium_level_color` | #c0ca33 | Arc color when battery charge is between 15% and 40% |
| `charging` | `beautiful.fg_color` | Color of the circle inside the arc when charging |
| `warning_msg_title` | _Huston, we have a problem_ | Title of the warning popup |
| `warning_msg_text` | _Battery is dying_ | Text of the warning popup |
| `warning_msg_position` | `bottom_right` | Position of the warning popup |
| `warning_msg_icon` | ~/.config/awesome/awesome-wm-widgets/batteryarc-widget/spaceman.jpg | Icon of the warning popup |
## Installation
@ -39,11 +47,17 @@ s.mytasklist, -- Middle widget
{ -- Right widgets
layout = wibox.layout.fixed.horizontal,
...
batteryarc_widget,
...
--[[default]]
batteryarc_widget(),
--[[or customized]]
batteryarc_widget({
show_current_level = true,
arc_thickness = '1',
}),
}
...
```
You can get the icon for warning popup [here](https://vk.com/images/stickers/1933/512.png)
## Troubleshooting
In case of any doubts or questions don't hesitate to raise an [issue](https://github.com/streetturtle/awesome-wm-widgets/issues/new).
In case of any doubts or questions please raise an [issue](../awesome-wm-widgets/assets/img/screenshots/batteryarc-widgetttps://github.com/streetturtle/awesome-wm-widgets/issues/new).

View File

@ -1,10 +1,32 @@
---
layout: page
---
# Brightness widget
This widget represents current brightness level: ![Brightness widget]({{'/assets/img/screenshots/brightness-wid-1.png' | relative_url }})
This widget represents current brightness level: ![Brightness widget](../awesome-wm-widgets/assets/img/screenshots/brightness-widget/br-wid-1.png)
## Customization
It is possible to customize widget by providing a table with all or some of the following config parameters:
| Name | Default | Description |
|---|---|---|
| `get_brightness_cmd` | `light -G` | Get current screen brightness |
| `inc_brightness_cmd` | `light -A 5` | Increase brightness |
| `dec_brightness_cmd` | `light -U 5`| Decrease brightness |
| `path_to_icon` | `/usr/share/icons/Arc/status/symbolic/display-brightness-symbolic.svg` | Path to the icon |
| `font` | `Play 9` | Font |
### Example:
```lua
brightness_widget({
get_brightness_cmd = 'xbacklight -get',
inc_brightness_cmd = 'xbacklight -inc 5',
dec_brightness_cmd = 'xbacklight -dec 5'
})
```
## Installation
@ -23,7 +45,7 @@ First you need to get the current brightness level. There are two options:
- using `light` command
Install it from this git repo: [github.com/haikarainen/light](https://github.com/haikarainen/light) and check if it works but running
Install it from this git repo: [github.com/haikarainen/light](../awesome-wm-widgets/assets/img/screenshots/brightness-widgetttps://github.com/haikarainen/light) and check if it works but running
```bash
git clone https://github.com/haikarainen/light.git && \
@ -33,8 +55,6 @@ First you need to get the current brightness level. There are two options:
49.18
```
Depending on the chosen option change `GET_BRIGHTNESS_CMD` variable in **brightness.lua**.
Then clone this repo under **~/.config/awesome/**:
```bash
@ -54,7 +74,15 @@ s.mytasklist, -- Middle widget
{ -- Right widgets
layout = wibox.layout.fixed.horizontal,
...
brightness_widget,
-- default
brightness_widget(),
-- or customized
brightness_widget({
get_brightness_cmd = 'xbacklight -get',
inc_brightness_cmd = 'xbacklight -inc 5',
dec_brightness_cmd = 'xbacklight -dec 5'
})
}
...
```

View File

@ -0,0 +1,98 @@
---
layout: page
---
# Brightness widget
This widget represents current brightness level: ![Brightness widget](../awesome-wm-widgets/assets/img/screenshots/brightnessarc-widget/br-wid-1.png)
## Customization
It is possible to customize widget by providing a table with all or some of the following config parameters:
| Name | Default | Description |
|---|---|---|
| `get_brightness_cmd` | `light -G` | Get current screen brightness |
| `inc_brightness_cmd` | `light -A 5` | Increase brightness |
| `dec_brightness_cmd` | `light -U 5`| Decrease brightness |
| `color` | `beautiful.fg_color` | Color of the arc |
| `path_to_icon` | `/usr/share/icons/Arc/status/symbolic/display-brightness-symbolic.svg` | Path to the icon |
### Example:
```lua
brightnessarc_widget({
get_brightness_cmd = 'xbacklight -get',
inc_brightness_cmd = 'xbacklight -inc 5',
dec_brightness_cmd = 'xbacklight -dec 5'
color = '/usr/share/icons/Arc/status/symbolic/brightness-display-symbolic.svg'
})
```
## Installation
First you need to get the current brightness level. There are two options:
- using `xbacklight` command (depending on your video card (I guess) it may or may not work)
To check if it works install xbackligth and check if it works:
```bash
sudo apt-get install xbacklight
xbacklight -get
```
If there is no output it means that it doesn't work, but there is a second option:
- using `light` command
Install it from this git repo: [github.com/haikarainen/light](../awesome-wm-widgets/assets/img/screenshots/brightnessarc-widgetttps://github.com/haikarainen/light) and check if it works but running
```bash
git clone https://github.com/haikarainen/light.git && \
cd ./light && \
sudo make && sudo make install \
light -G
49.18
```
Then clone this repo under **~/.config/awesome/**:
```bash
git clone https://github.com/streetturtle/awesome-wm-widgets.git ~/.config/awesome/
```
Require widget at the beginning of **rc.lua**:
```lua
local brightnessarc_widget = require("awesome-wm-widgets.brightnessarc-widget.brightnessarc")
```
Add widget to the tasklist:
```lua
s.mytasklist, -- Middle widget
{ -- Right widgets
layout = wibox.layout.fixed.horizontal,
...
-- default
brightnessarc_widget(),
-- or customized
brightnessarc_widget({
get_brightness_cmd = 'xbacklight -get',
inc_brightness_cmd = 'xbacklight -inc 5',
dec_brightness_cmd = 'xbacklight -dec 5'
})
}
...
```
## Controls
In order to change brightness by shortcuts you can add them to the `globalkeys` table in the **rc.lua**:
```lua
awful.key({ modkey }, ";", function () awful.spawn("light -A 5") end, {description = "increase brightness", group = "custom"}),
awful.key({ modkey, "Shift"}, ";", function () awful.spawn("light -U 5") end, {description = "decrease brightness", group = "custom"}),
```
On laptop you can use `XF86MonBrightnessUp` and `XF86MonBrightnessDown` keys.

View File

@ -0,0 +1,31 @@
---
layout: page
---
# Calendar Widget
Calendar widget for Awesome WM - slightly improved version of the `wibox.widget.calendar`. Also supports mouse scroll up/down in order ot switch month - scroll up - shows next month, scroll down - previous.
Top center placement:
![calendar_top](../awesome-wm-widgets/assets/img/screenshots/calendar-widget/calendar_top.png)
Top right placement:
![calendar_top_right](../awesome-wm-widgets/assets/img/screenshots/calendar-widget/calendar_top_right.png)
The placement is setup in theme.lua by `calendar_placement` variable, currently supported `top` (default), `top_right`, `bottom_right`.
# How to use
This widget needs an 'anchor' - another widget which triggers visibility of the calendar. Default `mytextclock` is the perfect candidate!
```lua
local calendar_widget = require("awesome-wm-widgets.calendar-widget.calendar")
-- ...
-- Create a textclock widget
mytextclock = wibox.widget.textclock()
mytextclock:connect_signal("button::press",
function(_, _, _, button)
if button == 1 then calendar_widget.toggle() end
end)
```

View File

@ -5,13 +5,11 @@ layout: page
This widget shows the average CPU load among all cores of the machine:
![screenshot]({{'/assets/img/screenshots/cpu-widget.gif' | relative_url }}){:.center-image}
When the load is more than 80% the graph becomes red. You can easily customize the widget by changing colors, step width, step spacing, width and interval.
![screenshot](../awesome-wm-widgets/assets/img/screenshots/cpu-widget/cpu.gif)
## How it works
To measure the load I took Paul Colby's bash [script](http://colby.id.au/calculating-cpu-usage-from-proc-stat/) and rewrote it in Lua, which was quite simple.
To measure the load I took Paul Colby's bash [script](../awesome-wm-widgets/assets/img/screenshots/cpu-widgetttp://colby.id.au/calculating-cpu-usage-from-proc-stat/) and rewrote it in Lua, which was quite simple.
So awesome simply reads the first line of /proc/stat:
```bash
@ -21,27 +19,51 @@ cpu 197294 718 50102 2002182 3844 0 2724 0 0 0
and calculates the percentage.
## Customization
It is possible to customize widget by providing a table with all or some of the following config parameters:
| Name | Default | Description |
|---|---|---|
| `width` | 50 | Width of the widget |
| `step_width` | 2 | Width of the step |
| `step_spacing` | 1 | Space size between steps |
| `color` | `beautiful.fg_normal` | Color of the graph |
### Example
```lua
cpu_widget({
width = 70,
step_width = 2,
step_spacing = 0,
color = '#434c5e'
})
```
The config above results in the following widget:
![custom](../awesome-wm-widgets/assets/img/screenshots/cpu-widget/custom.png)
## Installation
1. Clone this repo under **~/.config/awesome/**
Clone/download repo and use widget in **rc.lua**:
```bash
git clone https://github.com/streetturtle/awesome-wm-widgets.git ~/.config/awesome/
```
1. Require spotify-widget at the beginning of **rc.lua**:
```lua
local cpu_widget = require("awesome-wm-widgets.cpu-widget.cpu-widget")
```
1. Add widget to the tasklist:
```lua
s.mytasklist, -- Middle widget
{ -- Right widgets
layout = wibox.layout.fixed.horizontal,
...
cpu_widget,
...
```
```lua
local cpu_widget = require("awesome-wm-widgets.cpu-widget.cpu-widget")
...
s.mytasklist, -- Middle widget
{ -- Right widgets
layout = wibox.layout.fixed.horizontal,
...
-- default
cpu_widget(),
-- or custom
cpu_widget({
width = 70,
step_width = 2,
step_spacing = 0,
color = '#434c5e'
})
...
```

View File

@ -3,16 +3,16 @@ layout: page
---
# Email widget
This widget consists of an icon with counter which shows number of unread emails: ![email icon]({{'/assets/img/screenshots/email-widget-1.png' | relative_url }})
and a popup message which appears when mouse hovers over an icon: ![email popup]({{'/assets/img/screenshots/email-widget-2.png' | relative_url }})
This widget consists of an icon with counter which shows number of unread emails: ![email icon](../awesome-wm-widgets/assets/img/screenshots/email-widget/em-wid-1.png)
and a popup message which appears when mouse hovers over an icon: ![email popup](../awesome-wm-widgets/assets/img/screenshots/email-widget/em-wid-2.png)
Note that widget uses the Arc icon theme, so it should be [installed](https://github.com/horst3180/arc-icon-theme#installation) first under **/usr/share/icons/Arc/** folder.
Note that widget uses the Arc icon theme, so it should be [installed](../awesome-wm-widgets/assets/img/screenshots/email-widgetttps://github.com/horst3180/arc-icon-theme#installation) first under **/usr/share/icons/Arc/** folder.
## Installation
To install it put **email.lua** and **email-widget** folder under **~/.config/awesome**. Then
- in **email.lua** cahnge path to python scripts;
- in **email.lua** change path to python scripts;
- in python scripts add your credentials (note that password should be encrypted using pgp for example);
- add widget to awesome:
@ -35,4 +35,4 @@ This widget uses the output of two python scripts, first is called every 20 seco
``` bash
python ~/.config/awesome/email/count_unread_emails.py
python ~/.config/awesome/email/read_emails.py
```
```

79
_widgets/gerrit-widget.md Normal file
View File

@ -0,0 +1,79 @@
---
layout: page
---
# Gerrit widget
It shows number of currently assigned reviews in [Gerrit](../awesome-wm-widgets/assets/img/screenshots/gerrit-widgetttps://www.gerritcodereview.com/) to the user (by default) :
![gerrit_widget](../awesome-wm-widgets/assets/img/screenshots/gerrit-widget/gerrit_widget.png)
when clicked it shows reviews in a list:
![popup](../awesome-wm-widgets/assets/img/screenshots/gerrit-widget/popup.png)
left click on an item will open review in the default browser, right click will copy the review number, which you can use to checkout this review by running `git-review -d <review number>`.
Also, if a new review is assigned to the user, there will be a pop-up:
![new_review](../awesome-wm-widgets/assets/img/screenshots/gerrit-widget/new_review.png)
## Customization
It is possible to customize widget by providing a table with all or some of the following config parameters:
| Name | Default | Description |
|---|---|---|
| `icon`| `/.config/awesome/awesome-wm-widgets/gerrit-widget/gerrit_icon.svg`| Path to the icon |
| `host` | Required | Ex https://gerrit.tmnt.com |
| `query` | `is:reviewer AND status:open AND NOT is:wip` | Query to retrieve reviews |
## Prerequisite
- [curl](../awesome-wm-widgets/assets/img/screenshots/gerrit-widgetttps://curl.haxx.se/) - is used to communicate with gerrit's [REST API](../awesome-wm-widgets/assets/img/screenshots/gerrit-widgetttps://gerrit-review.googlesource.com/Documentation/rest-api.html)
- setup [netrc](../awesome-wm-widgets/assets/img/screenshots/gerrit-widgetttps://ec.haxx.se/usingcurl-netrc.html) which is used to store username and password in order to call API's endpoints.
## Installation
1. This widget relies on Gerrit [REST API](../awesome-wm-widgets/assets/img/screenshots/gerrit-widgetttps://gerrit-review.googlesource.com/Documentation/rest-api.html), so you need to have a permission to access it. You also need to setup [netrc](../awesome-wm-widgets/assets/img/screenshots/gerrit-widgetttps://ec.haxx.se/usingcurl-netrc.html), as widget uses curl to communicate with API and you have to be authenticated.
To test if you have access to API and netrc setup is correct run following command, you should have a json response:
```bash
curl -s --request GET --netrc https://gerrit-host.com/a/changes/\?q\=status:open+AND+NOT+is:wip+AND+is:reviewer | tail -n +2
```
Note: `tail -n +2` is needed to skip first line of the response, as gerrit returns some characters there in order to prevent XSS hacks.
1. Download json parser for lua from [github.com/rxi/json.lua](../awesome-wm-widgets/assets/img/screenshots/gerrit-widgetttps://github.com/rxi/json.lua) and place it under **~/.config/awesome/** (don't forget to star a repo):
```bash
wget -P ~/.config/awesome/ https://raw.githubusercontent.com/rxi/json.lua/master/json.lua
```
1. Clone this repo (if not cloned yet) under **~/.config/awesome/**:
```bash
git clone https://github.com/streetturtle/awesome-wm-widgets.git ~/.config/awesome/
```
1. Require widget at the top of the **rc.lua**:
```lua
local gerrit_widget = require("awesome-wm-widgets.gerrit-widget.gerrit")
```
1. Add widget to the tasklist:
```lua
s.mytasklist, -- Middle widget
{ -- Right widgets
layout = wibox.layout.fixed.horizontal,
...
--default
gerrit_widget({host = 'https://gerrit.tmnt.com'}),
--customized
gerrit_widget({
host = 'https://gerrit.tmnt.com',
query = 'is:reviewer AND is:wip'
})
...
```

36
_widgets/jira-widget.md Normal file
View File

@ -0,0 +1,36 @@
---
layout: page
---
# Jira widget
The widget shows the number of assigned tickets to the user and when clicked shows them in the list with some additional information. When item in the list is clicked - it opens the issue in browser
## How it works
Widget users cURL to query JIRA's REST API. In order to be authenticated, widget uses netrc feature of the cURL, which is basically to store basic auth credentials in a .netrc file in home folder.
## Customization
It is possible to customize widget by providing a table with all or some of the following config parameters:
| Name | Default | Description |
|---|---|---|
| `host` | Required | Ex: _http://jira.tmnt.com_ |
| `query` | `jql=assignee=currentuser() AND resolution=Unresolved` | JQL query |
| `icon` | `~/.config/awesome/awesome-wm-widgets/jira-widget/jira-mark-gradient-blue.svg` | Path to the icon |
## Installation
Clone/download repo and use widget in **rc.lua**:
```lua
local jira_widget = require("awesome-wm-widgets.jira-widget.jira")
...
s.mytasklist, -- Middle widget
{ -- Right widgets
layout = wibox.layout.fixed.horizontal,
...
-- default
jira_widget({host = 'http://jira.tmnt.com'}),
...
```

View File

@ -13,5 +13,17 @@ Install `mpd` (Music Player Daemon itself) and `mpc` (Music Player Client - prog
sudo apt-get install mpd mpc
```
Set them up and then just follow the [installation](https://github.com/streetturtle/awesome-wm-widgets#installation) section of the repo.
## Installation
To use this widget clone repo under **~/.config/awesome/** and then add it in **rc.lua**:
```lua
local mpdarc_widget = require("awesome-wm-widgets.mpdarc-widget.mpdarc")
...
s.mytasklist, -- Middle widget
{ -- Right widgets
layout = wibox.layout.fixed.horizontal,
...
mpdarc_widget,
...
```

View File

@ -0,0 +1,19 @@
---
layout: page
---
# Pomodoro Widget
:construction: This widget is under construction :construction_worker:
## Installation
This widget is based on [@jsspencer](../awesome-wm-widgets/assets/img/screenshots/pomodoroarc-widgetttps://github.com/jsspencer)' [pomo](../awesome-wm-widgets/assets/img/screenshots/pomodoroarc-widgetttps://github.com/jsspencer/pomo) - a simple pomodoro timer.
So first install/clone it anywhere you like, then either
- in widget's code provide path to the pomo.sh, or
- add pomo.sh to the PATH, or
- make a soft link in /usr/local/bin/ to it:
```bash
sudo ln -sf /opt/pomodoro/pomo.sh /usr/local/bin/pomo
```
Note that by default widget's code expects third way and calls script by `pomo`.

View File

@ -5,29 +5,8 @@ layout: page
This widget shows the RAM usage. When clicked another widget appears with more detailed information:
![screenshot]({{'/assets/img/screenshots/ram-widget.gif' | relative_url }}){:.center-image}
![screenshot](../awesome-wm-widgets/assets/img/screenshots/ram-widget/out.gif)
## Installation
1. Clone this repo under **~/.config/awesome/**
```bash
git clone https://github.com/streetturtle/awesome-wm-widgets.git ~/.config/awesome/
```
1. Require spotify-widget at the beginning of **rc.lua**:
```lua
local ram_widget = require("awesome-wm-widgets.ram-widget.ram-widget")
```
1. Add widget to the tasklist:
```lua
s.mytasklist, -- Middle widget
{ -- Right widgets
layout = wibox.layout.fixed.horizontal,
...
ram_widget,
...
```
Please refer to the [installation](../awesome-wm-widgets/assets/img/screenshots/ram-widgetttps://github.com/streetturtle/awesome-wm-widgets#installation) section of the repo.

View File

@ -3,10 +3,10 @@ layout: page
---
# Spotify widget
This widget displays currently playing song on [Spotify for Linux](https://www.spotify.com/download/linux/) client: ![screenshot]({{'/assets/img/screenshots/spotify-widget.png' | relative_url }}) and consists of two parts:
This widget displays currently playing song on [Spotify for Linux](../awesome-wm-widgets/assets/img/screenshots/spotify-widgetttps://www.spotify.com/download/linux/) client: ![screenshot](../awesome-wm-widgets/assets/img/screenshots/spotify-widget/spo-wid-default.png) and consists of two parts:
- status icon which shows if music is currently playing
- artist and name of the current song playing
- artist and name of the current song
## Controls
@ -16,41 +16,59 @@ This widget displays currently playing song on [Spotify for Linux](https://www.s
## Dependencies
Note that widget uses the Arc icon theme, so it should be [installed](https://github.com/horst3180/arc-icon-theme#installation) first under **/usr/share/icons/Arc/** folder.
Note that widget uses the Arc icon theme, so it should be [installed](../awesome-wm-widgets/assets/img/screenshots/spotify-widgetttps://github.com/horst3180/arc-icon-theme#installation) first under **/usr/share/icons/Arc/** folder.
## Customization
It is possible to customize widget by providing a table with all or some of the following config parameters:
| Name | Default | Description |
|---|---|---|
| `play_icon` | `/usr/share/icons/Arc/actions/24/player_play.png` | Play icon |
| `pause_icon` | `/usr/share/icons/Arc/actions/24/player_pause.png` | Pause icon |
| `font` | `Play 9`| Font |
### Example:
```lua
spotify_widget({
font = 'Ubuntu Mono 9',
play_icon = '/usr/share/icons/Papirus-Light/24x24/categories/spotify.svg',
pause_icon = '/usr/share/icons/Papirus-Dark/24x24/panel/spotify-indicator.svg'
})
```
Gives following widget:
![screenshot](../awesome-wm-widgets/assets/img/screenshots/spotify-widget/spo-wid-custom.png)
## Installation
1. Install [sp](https://gist.github.com/streetturtle/fa6258f3ff7b17747ee3) - CLI client for [Spotify for Linux](https://www.spotify.com/ca-en/download/linux/):
First you need to have spotify CLI installed, it uses dbus to communicate with spotify-client:
```bash
$ sudo git clone https://gist.github.com/fa6258f3ff7b17747ee3.git ~/dev/
$ sudo ln -s ~/dev/sp /usr/local/bin/
```
```bash
git clone https://gist.github.com/fa6258f3ff7b17747ee3.git
cd ./fa6258f3ff7b17747ee3
chmod +x sp
sudo cp ./sp /usr/local/bin/
```
Check if it works by running `sp help`.
1. Get an 'id' and 'secret' from [developer.spotify.com](https://beta.developer.spotify.com/documentation/general/guides/app-settings/) and paste it in the header of the `sp` (`SP_ID` and `SP_SECRET`) - this enables search feature.
1. Clone this repo under **~/.config/awesome/**
```bash
git clone https://github.com/streetturtle/awesome-wm-widgets.git ~/.config/awesome/
```
1. Require spotify-widget at the beginning of **rc.lua**:
```lua
local spotify_widget = require("awesome-wm-widgets.spotify-widget.spotify")
```
1. Add widget to the tasklist:
```lua
s.mytasklist, -- Middle widget
{ -- Right widgets
layout = wibox.layout.fixed.horizontal,
...
spotify_widget,
...
```
Then clone repo under **~/.config/awesome/** and add widget in **rc.lua**:
```lua
local spotify_widget = require("awesome-wm-widgets.spotify-widget.spotify")
...
s.mytasklist, -- Middle widget
{ -- Right widgets
layout = wibox.layout.fixed.horizontal,
...
-- default
spotify_widget(),
-- customized
spotify_widget({
font = 'Ubuntu Mono 9',
play_icon = '/usr/share/icons/Papirus-Light/24x24/categories/spotify.svg',
pause_icon = '/usr/share/icons/Papirus-Dark/24x24/panel/spotify-indicator.svg'
}),
...
```

View File

@ -0,0 +1,49 @@
---
layout: page
---
# Stackoverflow widget
When clicked, widget shows latest questions from stackoverflow.com with a given tag(s).
![screenshot](../awesome-wm-widgets/assets/img/screenshots/stackoverflow-widget/screenshot.png)
## Customization
It is possible to customize widget by providing a table with all or some of the following config parameters:
| Name | Default | Description |
|---|---|---|
| `icon`| `/.config/awesome/awesome-wm-widgets/stackoverflow-widget/so-icon.svg` | Path to the icon |
| `limit` | 5 | Number of items to show in the widget |
| `tagged` | awesome-wm | Tag, or comma-separated tags |
## Installation
1. Clone this repo (if not cloned yet) under **~/.config/awesome/**:
```bash
git clone https://github.com/streetturtle/awesome-wm-widgets.git ~/.config/awesome/
```
1. Require widget at the top of the **rc.lua**:
```lua
local stackoverflow_widget = require("awesome-wm-widgets.stackoverflow-widget.stackoverflow")
```
1. Add widget to the tasklist:
```lua
s.mytasklist, -- Middle widget
{ -- Right widgets
layout = wibox.layout.fixed.horizontal,
...
--default
stackoverflow_widget(),
--customized
stackoverflow_widget({
limit = 10
})
...
```

View File

@ -3,15 +3,22 @@ layout: page
---
# Volume widget
Simple and easy-to-install widget for Awesome Window Manager which represents the sound level: ![Volume Widget](
{{'/assets/img/screenshots/volume-widget.png' | relative_url }})
Simple and easy-to-install widget for Awesome Window Manager which shows the sound level: ![Volume Widget](../awesome-wm-widgets/assets/img/screenshots/volume-widget/vol-widget-1.png)
Note that widget uses the Arc icon theme, so it should be [installed](https://github.com/horst3180/arc-icon-theme#installation) first under **/usr/share/icons/Arc/** folder.
Note that widget uses the Arc icon theme, so it should be [installed](../awesome-wm-widgets/assets/img/screenshots/volume-widgetttps://github.com/horst3180/arc-icon-theme#installation) first under **/usr/share/icons/Arc/** folder.
## Customization
It is possible to customize widget by providing a table with all or some of the following config parameters:
| Name | Default | Description |
|---|---|---|
| `volume_audio_controller` | `pulse` | audio device |
| `notification` | `false` | Display a notification on mouseover |
| `notification_position` | `top_right` | The notification position |
## Installation
- clone/copy **volume.lua** file;
- include `volume.lua` and add volume widget to your wibox in rc.lua:
@ -23,19 +30,56 @@ s.mytasklist, -- Middle widget
{ -- Right widgets
layout = wibox.layout.fixed.horizontal,
...
volume_widget,
...
volume_widget(),
...
```
- _Optional step._ In Arc icon theme the muted audio level icon (![Volume-widget]({{'/assets/img/screenshots/audio-volume-muted-symbolic.png' | relative_url }}) looks like 0 level icon, which could be a bit misleading.
So I decided to use original muted icon for low audio level, and the same icon, but colored in red for muted audio level. Fortunately icons are in svg format, so you can easily recolor them with `sed`, so it would look like this (![Volume Widget]({{'/assets/img/screenshots/audio-volume-muted-symbolic_red.png' | relative_url }}))):
- _Optional step._ In Arc icon theme the muted audio level icon (![Volume-widget](../awesome-wm-widgets/assets/img/screenshots/volume-widget/audio-volume-muted-symbolic.png)) looks like 0 level icon, which could be a bit misleading.
So I decided to use original muted icon for low audio level, and the same icon, but colored in red for muted audio level. Fortunately icons are in svg format, so you can easily recolor them with `sed`, so it would look like this (![Volume Widget](../awesome-wm-widgets/assets/img/screenshots/volume-widget/audio-volume-muted-symbolic_red.png)):
```bash
cd /usr/share/icons/Arc/status/symbolic &&
sudo cp audio-volume-muted-symbolic.svg audio-volume-muted-symbolic_red.svg &&
sudo sed -i 's/bebebe/ed4737/g' ./audio-volume-muted-symbolic_red.svg
cd /usr/share/icons/Arc/status/symbolic &&
sudo cp audio-volume-muted-symbolic.svg audio-volume-muted-symbolic_red.svg &&
sudo sed -i 's/bebebe/ed4737/g' ./audio-volume-muted-symbolic_red.svg
```
### Pulse or ALSA only
Try running this command:
```bash
amixer -D pulse sget Master
```
If that prints something like this, then the default setting of 'pulse' is probably fine:
```
Simple mixer control 'Master',0
Capabilities: pvolume pvolume-joined pswitch pswitch-joined
Playback channels: Mono
Limits: Playback 0 - 64
Mono: Playback 64 [100%] [0.00dB] [on]
```
If it prints something like this:
```bash
$ amixer -D pulse sget Master
ALSA lib pulse.c:243:(pulse_connect) PulseAudio: Unable to connect: Connection refused
amixer: Mixer attach pulse error: Connection refused
```
then set `volume_audio_controller` to `alsa_only` in widget constructor:
```lua
volume_widget({
volume_audio_controller = 'alsa_only'
})
```
.
## Control volume
To mute/unmute click on the widget. To increase/decrease volume scroll up or down when mouse cursor is over the widget.
@ -43,7 +87,7 @@ To mute/unmute click on the widget. To increase/decrease volume scroll up or dow
If you want to control volume level by keyboard shortcuts add following lines in shortcut section of the **rc.lua** (the commands could be slightly different depending on your PC configuration):
```lua
awful.key({ modkey}, "[", function () awful.spawn("amixer -D pulse sset Master 5%-") end, {description = "increase volume", group = "custom"}),
awful.key({ modkey}, "]", function () awful.spawn("amixer -D pulse sset Master 5%+") end, {description = "decrease volume", group = "custom"}),
awful.key({ modkey}, "[", function () awful.spawn("amixer -D pulse sset Master 5%+") end, {description = "increase volume", group = "custom"}),
awful.key({ modkey}, "]", function () awful.spawn("amixer -D pulse sset Master 5%-") end, {description = "decrease volume", group = "custom"}),
awful.key({ modkey}, "\", function () awful.spawn("amixer -D pulse set Master +1 toggle") end, {description = "mute volume", group = "custom"}),
```

View File

@ -3,9 +3,45 @@ layout: page
---
# Volumearc widget
Almost the same as [volumebar widget](https://github.com/streetturtle/awesome-wm-widgets/tree/master/volumebar-widget), but using arcchart:
Almost the same as [volumebar widget](../awesome-wm-widgets/assets/img/screenshots/volumearc-widgetttps://github.com/streetturtle/awesome-wm-widgets/tree/master/volumebar-widget), but using [arcchart](../awesome-wm-widgets/assets/img/screenshots/volumearc-widgetttps://awesomewm.org/doc/api/classes/wibox.container.arcchart.html):
![screenshot]({{'/assets/img/screenshots/volumearc-widget.gif' | relative_url }}){:.center-image}
![screenshot](../awesome-wm-widgets/assets/img/screenshots/volumearc-widget/out.gif)
Supports
- scroll up - increase volume,
- scroll down - decrease volume,
- left click - mute/unmute.
## Customization
It is possible to customize widget by providing a table with all or some of the following config parameters:
| Name | Default | Description |
|---|---|---|
| `main_color` | `beautiful.fg_normal` | Color of the arc |
| `mute_color` | `beautiful.fg_urgent` | Color of the arc when mute |
| `path_to_icon` | /usr/share/icons/Arc/status/symbolic/audio-volume-muted-symbolic.svg | Path to the icon |
| `thickness` | 2 | The arc thickness |
| `height` | `beautiful.fg_normal` | Widget height |
| `get_volume_cmd` | `amixer -D pulse sget Master` | Get current volume level |
| `inc_volume_cmd` | `amixer -D pulse sset Master 5%+` | Increase volume level |
| `dec_volume_cmd` | `amixer -D pulse sset Master 5%-` | Decrease volume level |
| `tog_volume_cmd` | `amixer -D pulse sset Master toggle` | Mute / unmute |
### Example:
```lua
volumearc_widget({
main_color = '#af13f7',
mute_color = '#ff0000',
thickness = 5,
height = 25
})
```
The config above results in the following widget:
![custom](../awesome-wm-widgets/assets/img/screenshots/volumearc-widget/custom.png)
## Installation
@ -17,29 +53,13 @@ Almost the same as [volumebar widget](https://github.com/streetturtle/awesome-wm
1. Require volumearc widget at the beginning of **rc.lua**:
```lua
local volumearc_widget = require("awesome-wm-widgets.volumearc-widget.volumearc")
```
1. Add widget to the tasklist:
```lua
s.mytasklist, -- Middle widget
{ -- Right widgets
layout = wibox.layout.fixed.horizontal,
...
volumearc_widget,
...
```
## Control volume
To mute/unmute click on the widget. To increase/decrease volume scroll up or down when mouse cursor is over the widget.
If you want to control volume level by keyboard shortcuts add following lines in shortcut section of the **rc.lua** (the commands could be slightly different depending on your PC configuration):
```lua
awful.key({ modkey}, "[", function () awful.spawn("amixer -D pulse sset Master 5%-") end, {description = "increase volume", group = "custom"}),
awful.key({ modkey}, "]", function () awful.spawn("amixer -D pulse sset Master 5%+") end, {description = "decrease volume", group = "custom"}),
awful.key({ modkey}, "\", function () awful.spawn("amixer -D pulse set Master +1 toggle") end, {description = "mute volume", group = "custom"}),
require("volumearc")
...
s.mytasklist, -- Middle widget
{ -- Right widgets
layout = wibox.layout.fixed.horizontal,
...
volumearc_widget,
...
```

View File

@ -5,22 +5,55 @@ layout: page
Almost the same as volume widget, but more minimalistic:
![screenshot]({{'/assets/img/screenshots/volumebar-widget.gif' | relative_url }}){:.center-image}
![screenshot](../awesome-wm-widgets/assets/img/screenshots/volumebar-widget/out.gif)
Supports
- scroll up - increase volume,
- scroll down - decrease volume,
- left click - mute/unmute.
## Installation
## Customization
It is possible to customize widget by providing a table with all or some of the following config parameters:
| Name | Default | Description |
|---|---|---|
| `main_color` | `beautiful.fg_normal` | Color of the bar |
| `mute_color` | `beautiful.fg_urgent` | Color of the bar when mute |
| `width` | 50 | The bar width |
| `shape` | `bar` | [gears.shape](../awesome-wm-widgets/assets/img/screenshots/volumebar-widgetttps://awesomewm.org/doc/api/libraries/gears.shape.html), could be `octogon`, `hexagon`, `powerline`, etc |
| `margin` | `10` | Top and bottom margin (if your wibar is 22 px high, bar will be 2 px (22 - 2*10)) |
| `get_volume_cmd` | `amixer -D pulse sget Master` | Get current volume level |
| `inc_volume_cmd` | `amixer -D pulse sset Master 5%+` | Increase volume level |
| `dec_volume_cmd` | `amixer -D pulse sset Master 5%-` | Decrease volume level |
| `tog_volume_cmd` | `amixer -D pulse sset Master toggle` | Mute / unmute |
### Example:
```lua
volumebar_widget({
main_color = '#af13f7',
mute_color = '#ff0000',
width = 80,
shape = 'rounded_bar',
margins = 8
})
```
Above config results in following widget:
![custom](../awesome-wm-widgets/assets/img/screenshots/volumebar-widget/custom.png)
## Installation
1. Clone this repo under **~/.config/awesome/**
```bash
git clone https://github.com/streetturtle/awesome-wm-widgets.git ~/.config/awesome/
```
1. Require volumearc widget at the beginning of **rc.lua**:
1. Require volumebar widget at the beginning of **rc.lua**:
```lua
local volumebar_widget = require("awesome-wm-widgets.volumebar-widget.volumebar")
@ -33,22 +66,21 @@ Supports
{ -- Right widgets
layout = wibox.layout.fixed.horizontal,
...
volumebar_widget,
--[[default]]
volumebar_widget(),
--[[or customized]]
volumebar_widget({
main_color = '#af13f7',
mute_color = '#ff0000',
width = 80,
shape = 'rounded_bar', -- octogon, hexagon, powerline, etc
-- bar's height = wibar's height minus 2x margins
margins = 8
}),
...
```
## Control volume
To mute/unmute click on the widget. To increase/decrease volume scroll up or down when mouse cursor is over the widget.
If you want to control volume level by keyboard shortcuts add following lines in shortcut section of the **rc.lua** (the commands could be slightly different depending on your PC configuration):
```lua
awful.key({ modkey}, "[", function () awful.spawn("amixer -D pulse sset Master 5%-") end, {description = "increase volume", group = "custom"}),
awful.key({ modkey}, "]", function () awful.spawn("amixer -D pulse sset Master 5%+") end, {description = "decrease volume", group = "custom"}),
awful.key({ modkey}, "\", function () awful.spawn("amixer -D pulse set Master +1 toggle") end, {description = "mute volume", group = "custom"}),
```
## Troubleshooting
If the bar is not showing up, try to decrease top or bottom margin - widget uses hardcoded margins for vertical alignment, so if your wibox is too small then bar is simply hidden by the margins.

View File

@ -3,9 +3,35 @@ layout: page
---
# Weather widget
![Weather Widget]({{'/assets/img/screenshots/weather-widget.png' | relative_url }}){:.center-image}
![Weather Widget](../awesome-wm-widgets/assets/img/screenshots/weather-widget/weather-widget.png)
Note that widget uses the Arc icon theme, so it should be [installed](../awesome-wm-widgets/assets/img/screenshots/weather-widgetttps://github.com/horst3180/arc-icon-theme#installation) first under **/usr/share/icons/Arc/** folder.
## Customization
It is possible to customize widget by providing a table with all or some of the following config parameters:
| Name | Default | Description |
|---|---|---|
| `font` | `Play 9` | Font |
| `city` | `Montreal,ca` | City name and country code, [more info](../awesome-wm-widgets/assets/img/screenshots/weather-widgetttps://openweathermap.org/current) |
| `api_key` | none| API key, required |
| `units` | `metric` | `metric` for celsius, `imperial` for fahrenheit |
| `both_units_widget` | `false` | show temperature in both units (15°C (59°F)) or in one (15°C) |
| `both_units_popup` | `false` | same as above but for popup |
| `notification_position` | `top_right` | The notification position |
### Example:
```lua
weather_widget({
api_key = 'your-api-key',
units = 'imperial',
font = 'Ubuntu Mono 9'
}),
```
Note that widget uses the Arc icon theme, so it should be [installed](https://github.com/horst3180/arc-icon-theme#installation) first under **/usr/share/icons/Arc/** folder.
## Installation
@ -15,7 +41,7 @@ Note that widget uses the Arc icon theme, so it should be [installed](https://gi
$ sudo apt-get install lua-socket
```
1. Download json parser for lua from [github.com/rxi/json.lua](https://github.com/rxi/json.lua) and place it under **~/.config/awesome/** (don't forget to star a repo <i class="fa fa-github-alt"></i> ):
1. Download json parser for lua from [github.com/rxi/json.lua](../awesome-wm-widgets/assets/img/screenshots/weather-widgetttps://github.com/rxi/json.lua) and place it under **~/.config/awesome/** (don't forget to star a repo <i class="fa fa-github-alt"></i> ):
```bash
wget -P ~/.config/awesome/ https://raw.githubusercontent.com/rxi/json.lua/master/json.lua
@ -27,7 +53,7 @@ Note that widget uses the Arc icon theme, so it should be [installed](https://gi
git clone https://github.com/streetturtle/awesome-wm-widgets.git ~/.config/awesome/
```
1. Get Open Weather Map app id here: [openweathermap.org/appid](https://openweathermap.org/appid) and place it in **~/.config/awesome/awesome-wm-widgets/secrets.lua**, or directly in the widget. Don't forget to set also your city.
1. Get Open Weather Map app id here: [openweathermap.org/appid](../awesome-wm-widgets/assets/img/screenshots/weather-widgetttps://openweathermap.org/appid).
1. Require weather widget at the beginning of **rc.lua**:
@ -42,9 +68,16 @@ Note that widget uses the Arc icon theme, so it should be [installed](https://gi
{ -- Right widgets
layout = wibox.layout.fixed.horizontal,
...
weather_widget,
--default
weather_widget({api_key = 'your-api-key'}),
--customized
weather_widget({
api_key = 'your-api-key',
units = 'imperial',
font = 'Ubuntu Mono 9'
})
...
```
You can read how it works in more details [here](http://pavelmakhov.com/2017/02/weather-widget-for-awesome-wm)
You can read how it works in more details [here](../awesome-wm-widgets/assets/img/screenshots/weather-widgetttp://pavelmakhov.com/2017/02/weather-widget-for-awesome-wm)