aboutsummaryrefslogtreecommitdiff
path: root/contrib/README
blob: 235599c8c790b87afce8cd3a47e5d26f08c53ff6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
Contrib
-------
Contrib libraries, or widget types, are extra snippets of code you can
use. Some are for less common hardware, and other were contributed by
Vicious users. The contrib directory also holds widget types that were
obsoleted or rewritten. Contrib widgets will not be imported by init
unless you explicitly enable it, or load them in your rc.lua.


Usage within Awesome
--------------------
To use contrib widgets uncomment the line that loads them in
init.lua. Or you can load them in your rc.lua after you require
Vicious:

  vicious = require("vicious")
  vicious.contrib = require("vicious.contrib")


Widget types
------------
Most widget types consist of worker functions that take the "format"
argument given to vicious.register as the first argument, "warg" as
the second, and return a table of values to insert in the format
string. But we have not insisted on this coding style in contrib. So
widgets like PulseAudio have emerged that are different. These widgets
could also depend on Lua libraries that are not distributed with the
core Lua distribution. Ease of installation and use does not
necessarily have to apply to contributed widgets.

vicious.contrib.ati
  - provides various info about ATI GPU status
  - takes card ID as an argument, i.e. "card0" (and where possible,
    uses debugfs to gather data on radeon power management)
  - returns a table with string keys: {method}, {dpm_state},
    {dpm_perf_level}, {profile}, {engine_clock mhz}, {engine_clock khz},
    {memory_clock mhz}, {memory_clock khz}, {voltage v}, {voltage mv}

vicious.contrib.batacpi
  -

vicious.contrib.batpmu
  -

vicious.contrib.batproc
  -

vicious.contrib.dio
  - provides I/O statistics for requested storage devices
  - takes the disk as an argument, i.e. "sda" (or a specific
    partition, i.e. "sda/sda2")
  - returns a table with string keys: {total_s}, {total_kb}, {total_mb},
    {read_s}, {read_kb}, {read_mb}, {write_s}, {write_kb}, {write_mb}
    and {sched}

vicious.contrib.mpc
  -

vicious.contrib.netcfg
  -

vicious.contrib.net
  -

vicious.contrib.openweather
  - provides weather information for a requested city
  - takes OpenWeatherMap city ID as an argument, i.e. "1275339"
  - returns a table with string keys: {city}, {wind deg}, {wind aim},
    {wind kmh}, {wind mps}, {sky}, {weather}, {temp c}, {humid}, {press}

vicious.contrib.nvsmi
  - provides (very basic) information about Nvidia GPU status from SMI
  - takes optional card ID as an argument, i.e. "1", or defaults to ID 0
  - returns 1st value as temperature of requested graphics device

vicious.contrib.ossvol
  -

vicious.contrib.pop
  -

vicious.contrib.pulse
    - provides volume levels of requested pulseaudio sinks and
      functions to manipulate them
    - takes the name of a sink as an optional argument.  a number will
      be interpret as an index, if no argument is given, it will take
      the first-best
    - to get a list of available sinks use the command: pacmd
      list-sinks | grep 'name:'
    - returns 1st value as the volume level
  - vicious.contrib.pulse.add(percent, sink)
    - @percent is a number, which increments or decrements the volume
      level by its value in percent
    - @sink optional, same usage as in vicious.contrib.pulse
    - returns the exit status of pacmd
  - vicious.contrib.pulse.toggle(sink)
    - inverts the volume state (mute -> unmute; unmute -> mute)
    - @sink optional, same usage as in vicious.contrib.pulse
    - returns the exit status of pacmd

vicious.contrib.rss
  -

vicious.contrib.sensors
  -

vicious.contrib.buildbot
  - provides last build status for configured buildbot builders (http://trac.buildbot.net/)
  - returns build status in the format: [<builderName>.<currentBuildNumber>.<lastSuccessfulBuildNumber>]
  - if <currentBuildNumber> is the same as <lastSuccessfulBuildNumber> only one number is displayed
  - <buildNumber> colors: red - failed, green - successful, yellow - in progress
  - it depends on lua json parser (e.g. liblua5.1-json on Ubuntu 12.04)


Usage examples
---------------------------------
Pulse Audio widget
  vol = wibox.widget.textbox()
  vicious.register(vol, vicious.contrib.pulse, " $1%", 2, "alsa_output.pci-0000_00_1b.0.analog-stereo")
  vol:buttons(awful.util.table.join(
    awful.button({ }, 1, function () awful.util.spawn("pavucontrol") end),
    awful.button({ }, 4, function () vicious.contrib.pulse.add(5,"alsa_output.pci-0000_00_1b.0.analog-stereo") end),
    awful.button({ }, 5, function () vicious.contrib.pulse.add(-5,"alsa_output.pci-0000_00_1b.0.analog-stereo") end)
  ))

Buildbot widget
  buildbotwidget = wibox.widget.textbox()
  local buildbotwidget_warg = {
    {builder="coverage", url="http://buildbot.buildbot.net"},
    {builder="tarball-slave", url="http://buildbot.buildbot.net"}
  }
  vicious.register(buildbotwidget, vicious.contrib.buildbot, "$1,", 3600, buildbotwidget_warg)