some update of ext description

This commit is contained in:
2016-07-05 17:09:55 +03:00
parent 922c4a57e3
commit d031c03d4d
4 changed files with 56 additions and 52 deletions

View File

@ -25,7 +25,17 @@ simply editing the desktop file.
Items are stored in the two directories: `/usr/share/awesomewidgets/%TYPE%/` and
`$HOME/.local/share/awesomewidgets/%TYPE%/` (path may be differ in depend from
your distro). Settings in the home directory have a higher priority that global
ones.
ones. Common settings for all extensions are:
| Field | Required | Value | Default |
| -------------------|----------|----------------------------------|------------|
| Name | yes | name | none |
| Comment | no | comment | empty |
| X-AW-Active | no | whether or not the item is active, N/A for bars | true |
| X-AW-ApiVersion | yes | API compatibility index. Do not touch it if you don't know what does it mean | 0 |
| X-AW-Interval | no | update interval in standard widget intervals, N/A for bars | 1 |
| X-AW-Number | yes | unique number which will be associated with the item | random number which is less than 1000 |
## <a href="#bars" class="anchor" id="bars"><span class="octicon octicon-link"></span></a>Bars
@ -33,8 +43,6 @@ Directory is `desktops`, configuration files have the following fields:
| Field | Required | Value | Default |
| -------------------|----------|----------------------------------|------------|
| Name | yes | bar name | none |
| Comment | no | comment | empty |
| X-AW-Custom | yes | does value have custom formula or not, boolean | false |
| X-AW-Value | yes | bar value. The following tags are available `cpu*`, `gpu`, `mem`, `swap`, `hdd*`, `bat`. In case of `X-AW-Custom=true` it uses syntax similar to [lambda functions](/projects/awesome-widgets/#lambda) | cpu |
| X-AW-Max | no | maximal possible value, float | 100.0 |
@ -46,7 +54,6 @@ Directory is `desktops`, configuration files have the following fields:
| X-AW-Direction | yes | the fill direction. The following variants are supported `LeftToRight`, `RightToLeft` | LeftToRight |
| X-AW-Height | yes | height, pixels | 100 |
| X-AW-Width | yes | width, pixels | 100 |
| X-AW-Number | yes | unique number which will be associated with the script | random number which is less than 1000 |
## <a href="#quotes" class="anchor" id="quotes"><span class="octicon octicon-link"></span></a>Quotes
@ -56,12 +63,7 @@ following fields:
| Field | Required | Value | Default |
|-------|----------|-------|---------|
| Name | yes | quotes name | none |
| Comment | no | comment | empty |
| X-AW-Ticker | yes | ticker from Yahoo! Finance system | EURUSD=X |
| X-AW-Active | no | whether or not the quotes is active | true |
| X-AW-Interval | no | update interval in standard widget intervals | 1 |
| X-AW-Number | yes | unique number which will be associated with the script | random number which is less than 1000 |
## <a href="#scripts" class="anchor" id="scripts"><span class="octicon octicon-link"></span></a>Scripts
@ -69,14 +71,9 @@ Directory is `scripts`, configuration files have the following fields:
| Field | Required | Value | Default |
|-------|----------|-------|---------|
| Name | yes | script name | none |
| Comment | no | comment | empty |
| Exec | yes | path to executable file | /usr/bin/true |
| X-AW-Prefix | no | prefix to executable file. Usually it's not required, but in other you may want to specify interpreter for example |
| X-AW-Active | no | whether or not the script is active | true |
| X-AW-Redirect | no | stream redirection. The following variants are available `stderr2stdout`, `nothing`, `stdout2stderr`, `swap`. stderr will be available, if you run application in the debug mode | nothing |
| X-AW-Interval | no | update interval in standard widget intervals | 1 |
| X-AW-Number | yes | unique number which will be associated with the script | random number which is less than 1000 |
| X-AW-Filters | no | comma separated filters from `awesomewidgets-extscripts-filters.json` |
## <a href="#upgrade" class="anchor" id="upgrade"><span class="octicon octicon-link"></span></a>Upgrade
@ -85,14 +82,9 @@ Directory is `upgrade`, configuration files have the following fields:
| Field | Required | Value | Default |
|-------|----------|-------|---------|
| Name | yes | upgrade name | none |
| Comment | no | comment | empty |
| Exec | yes | path to executable file | /usr/bin/true |
| X-AW-Filter | no | the regexp which will be applied to command output. If set `X-AW-Null` will be ignored |
| X-AW-Active | no | whether or not the upgrade script is active | true |
| X-AW-Null | no | the number of lines which should be skipped in output | 0 |
| X-AW-Interval | no | update interval in standard widget intervals | 1 |
| X-AW-Number | yes | unique number which will be associated with the bar | random number which is less than 1000 |
## <a href="#weather" class="anchor" id="weather"><span class="octicon octicon-link"></span></a>Weather
@ -102,12 +94,8 @@ following fields:
| Field | Required | Value | Default |
|-------|----------|-------|---------|
| Name | yes | weather name | none |
| Comment | no | comment | empty |
| X-AW-City | yes | city | London |
| X-AW-Country | yes | two-letter country code | uk |
| X-AW-Image | no | use images as weather icon or text. | false |
| X-AW-Provider | yes | weather provider. Supported ones are `Yahoo`, `OWM` | OWM |
| X-AW-TS | yes | time to which weather should be. `0` is a current weather, `1` - weather 3 hours later, etc | 0 |
| X-AW-Active | no | whether or not the monitor is active | true |
| X-AW-Interval | no | update interval in standard widget intervals | 1 |
| X-AW-Number | yes | unique number which will be associated with the upgrade weather | random number which is less than 1000 |

View File

@ -35,7 +35,11 @@ fields inside `[Desktop Entry]` section:
| -------------------|----------|----------------------------------|------------|
| Name | yes | formatter name | none |
| Comment | no | comment | empty |
| X-AW-Type | no | formatter type. The following types are supported: `NoFormat`, `DateTime`, `Float`, `List`, `Script` | NoFormat |
| X-AW-ApiVersion | yes | API compatibility index. Do not touch it if you don't know what does it mean | 0 |
| X-AW-Type | no | formatter type. The following types are supported: `NoFormat`, `DateTime`, `Float`, `List`, `Script`, `String` | NoFormat |
Additionaly the following fields will be added by common extesions: `X-AW-Active`,
`X-AW-Interval`, `X-AW-Number`, but they will be ignored.
Each formatter type has own behaviour and own settings and they are described
below. Also there are system-wide settings which are stored in `/usr/share/awesomewidgets/formatters/`, system formatters will be overwritten by
@ -66,7 +70,7 @@ Converts any number to string.
| X-AW-Multiplier | no | float to which value will be multiplied | 1.0 |
| X-AW-Precision | no | show this count of symbols after dot | -1 (as expected) |
| X-AW-Summand | no | float to which value will be increased | 0.0 |
| X-AW-Width | no | width of the field | 0 (do not limit) |
| X-AW-Width | no | width of the field, negative means left-alignment | 0 (do not limit) |
Please note that actual formula is `X-AW-Multiplier * value + X-AW-Summand`.
@ -80,6 +84,16 @@ Coverts list of string objects to string.
| X-AW-Separator | no | use this separator to join strings | (empty |
| X-AW-Sort | no | boolean, sort or not list | false |
## <a href="#formatter-script" class="anchor" id="formatter-script"><span class="octicon octicon-link"></span></a>String formatter
Improved version of `NoFormat`.
| Field | Required | Value | Default |
| -------------------|----------|----------------------------------|------------|
| X-AW-FillChar | no | char to fill string to `X-AW-Width` | (space) |
| X-AW-ForceWidth | no | strip string after `X-AW-Width` | false |
| X-AW-Width | no | width of the field, negative means left-alignment | 0 (do not limit) |
## <a href="#formatter-script" class="anchor" id="formatter-script"><span class="octicon octicon-link"></span></a>Script formatter
Uses javascript code to convert value to string. Value will be passed as argument

View File

@ -25,7 +25,17 @@ short: aw-v21-bells-and-whistles
Все элементы хранятся в двух директориях: `/usr/share/awesomewidgets/%TYPE%/` и
`$HOME/.local/share/awesomewidgets/%TYPE%/` (пути могут немного отличаться в
зависимости от используемого дистрибутива). Настройки в домашней директории
перезаписывают глобальные настройки.
перезаписывают глобальные настройки. Общие настройки для любого расширения
следующие:
| Поле | Обязательное | Значение | По-умолчанию |
|------|--------------|----------|--------------|
| Name | да | имя | none |
| Comment | нет | комментарий | empty |
| X-AW-Active | нет | активно или нет данное расширение, игнорируется барами | true |
| X-AW-ApiVersion | да | совместимость API. Не меняйте, если не знаете, что делаете | 0 |
| X-AW-Interval | да | интервал запуска расширения в стандартных интервалах обновления виджета, игнорируется барами | 1 |
| X-AW-Number | да | уникальный номер, который будет ассоциирован с данным расширением | случайное число меньше 1000 |
## <a href="#bars" class="anchor" id="bars"><span class="octicon octicon-link"></span></a>Бары
@ -33,8 +43,6 @@ short: aw-v21-bells-and-whistles
| Поле | Обязательное | Значение | По-умолчанию |
|------|--------------|----------|--------------|
| Name | да | имя бара | none |
| Comment | нет | комментарий | empty |
| X-AW-Custom | да | содержит ли значение произвольную формулу или нет | false |
| X-AW-Value | да | значение бара. Доступны теги `cpu*`, `gpu`, `mem`, `swap`, `hdd*`, `bat`. В случае `X-AW-Custom=true` использует синтаксис аналогичный []лямбда функциям](/ru/projects/awesome-widgets/#lambda) | cpu |
| X-AW-Max | нет | максимально возможное значение | 100.0 |
@ -46,7 +54,6 @@ short: aw-v21-bells-and-whistles
| X-AW-Direction | да | направление заполнения. Доступны варианты `LeftToRight`, `RightToLeft` | LeftToRight |
| X-AW-Height | да | высота в пикселях | 100 |
| X-AW-Width | да | ширина в пикселях | 100 |
| X-AW-Number | да | уникальный номер, который будет ассоциирован с данным баром | случайное число меньше 1000 |
## <a href="#quotes" class="anchor" id="quotes"><span class="octicon octicon-link"></span></a>Котировки
@ -55,12 +62,7 @@ Yahoo! Finance"). Директория называется `quotes`, файлы
| Поле | Обязательное | Значение | По-умолчанию |
|------|--------------|----------|--------------|
| Name | да | имя котировок | none |
| Comment | нет | комментарий | empty |
| X-AW-Ticker | да | тикер из системы Yahoo! Finance | EURUSD=X |
| X-AW-Active | нет | активны или нет данные котировки | true |
| X-AW-Interval | да | интервал запуска котировок в стандартных интервалах обновления виджета | 1 |
| X-AW-Number | да | уникальный номер, который будет ассоциирован с данными котировками | случайное число меньше 1000 |
## <a href="#scripts" class="anchor" id="scripts"><span class="octicon octicon-link"></span></a>Скрипты
@ -68,14 +70,9 @@ Yahoo! Finance"). Директория называется `quotes`, файлы
| Поле | Обязательное | Значение | По-умолчанию |
|------|--------------|----------|--------------|
| Name | да | имя скрипта | none |
| Comment | нет | комментарий | empty |
| Exec | да | путь к исполняемому файлу | /usr/bin/true |
| X-AW-Prefix | нет | префикс к исполняемому файлу. Обычно не требуется, однако в отдельных случаях может потребоваться явно указать путь, например, к используемому интерпретатору |
| X-AW-Active | нет | активен или нет данный скрипт | true |
| X-AW-Redirect | нет | перенаправление потоков сообщений. Доступны варианты `stderr2stdout`, `nothing`, `stdout2stderr`, `swap`. stderr доступен, если запустить в режиме отладки | nothing |
| X-AW-Interval | да | интервал запуска скрипта в стандартных интервалах обновления виджета | 1 |
| X-AW-Number | да | уникальный номер, который будет ассоциирован с данным скриптом | случайное число меньше 1000 |
| X-AW-Filters | нет | фильтры из `awesomewidgets-extscripts-filters.json` разделенные запятой |
## <a href="#upgrade" class="anchor" id="upgrade"><span class="octicon octicon-link"></span></a>Обновления
@ -84,14 +81,9 @@ Yahoo! Finance"). Директория называется `quotes`, файлы
| Поле | Обязательное | Значение | По-умолчанию |
|------|--------------|----------|--------------|
| Name | да | имя скрипта обновлений | none |
| Comment | нет | комментарий | empty |
| Exec | да | путь к исполняемому файлу | /usr/bin/true |
| X-AW-Filter | нет | регулярное выражение, которое будет применено к выдаче команды. Если не пустое, параметр `X-AW-Null` будет проигнорирован |
| X-AW-Active | нет | активен или нет данный скрипт обновления | true |
| X-AW-Null | нет | число строк stdout, которые будут пропущены при подсчете | 0 |
| X-AW-Interval | да | интервал запуска скрипта в стандартных интервалах обновления виджета | 1 |
| X-AW-Number | да | уникальный номер, который будет ассоциирован с данным скриптом | случайное число меньше 1000 |
## <a href="#weather" class="anchor" id="weather"><span class="octicon octicon-link"></span></a>Погода
@ -101,12 +93,8 @@ Yahoo! Finance"). Директория называется `quotes`, файлы
| Поле | Обязательное | Значение | По-умолчанию |
|------|--------------|----------|--------------|
| Name | да | имя погоды | none |
| Comment | нет | комментарий | empty |
| X-AW-City | да | город | London |
| X-AW-Country | да | двухбуквенное обозначения страны | uk |
| X-AW-Image | нет | использовать изображения в качестве иконки погоды или текст | uk |
| X-AW-Provider | да | провайдер погоды. Доступны `Yahoo`, `OWM` | OWM |
| X-AW-TS | да | на какое время прогноз (целое число). `0` - текущая погода, `1` - погода через 3 часа и т.д. | 0 |
| X-AW-Active | нет | активен или нет данный монитор погоды | true |
| X-AW-Interval | да | интервал запуска монитора в стандартных интервалах обновления виджета | 1 |
| X-AW-Number | да | уникальный номер, который будет ассоциирован с данным монитором | случайное число меньше 1000 |

View File

@ -36,7 +36,11 @@ cpu=myformatter
| -------------------|--------------|----------------------------------|--------------|
| Name | да | имя форматера | none |
| Comment | нет | комментарий | empty |
| X-AW-Type | нет | тип форматера. Поддерживаются следующие типы: `NoFormat`, `DateTime`, `Float`, `List`, `Script` | NoFormat |
| X-AW-ApiVersion | да | совместимость API. Не меняйте, если не знаете, что делаете | 0 |
| X-AW-Type | нет | тип форматера. Поддерживаются следующие типы: `NoFormat`, `DateTime`, `Float`, `List`, `Script`, `String` | NoFormat |
Дополнительно следующте поля добавлены для совместимости:: `X-AW-Active`,
`X-AW-Interval`, `X-AW-Number`, но они будут проигнорированы.
Каждый тип форматера имеет свое поведение и свои настройки, которые описаны ниже.
Также существуют системные настройки, которые хранятся в `/usr/share/awesomewidgets/formatters/`,
@ -68,7 +72,7 @@ cpu=myformatter
| X-AW-Multiplier | нет | число, на которое значение будет умножено | 1.0 |
| X-AW-Precision | нет | число знаков после запятой | -1 (как получится) |
| X-AW-Summand | нет | число, которое будет добавлено к значению | 0.0 |
| X-AW-Width | нет | ширина числового поля | 0 (не ограничивать) |
| X-AW-Width | нет | ширина числового поля, отрицательное - выравнивание по левому краю | 0 (не ограничивать) |
Конечное значение будет получено по формуле `X-AW-Multiplier * value + X-AW-Summand`.
@ -111,6 +115,16 @@ X-AW-HasReturn=false
})
```
## <a href="#formatter-script" class="anchor" id="formatter-script"><span class="octicon octicon-link"></span></a>String форматер
Улучшенная версия `NoFormat`.
| Поле | Обязательное | Значение | По-умолчанию |
| -------------------|--------------|----------------------------------|--------------|
| X-AW-FillChar | нет | символ для заполнения до `X-AW-Width` | (space) |
| X-AW-ForceWidth | нет | обрезать строку после `X-AW-Width` | false |
| X-AW-Width | нет | ширина поля, отрицательное - выравнивание по левому краю | 0 (не ограничивать) |
# <a href="#macros" class="anchor" id="macros"><span class="octicon octicon-link"></span></a>Макросы
Другая особенность - макросы. Пользователь может определить свою функцию, используя