|
| 1 | +Contrib |
| 2 | +------- |
| 3 | +Contrib libraries, or widget types, are extra snippets of code you can |
| 4 | +use. Some are for less common hardware, and other were contributed by |
| 5 | +Vicious users. The contrib directory also holds widget types that were |
| 6 | +obsoleted or rewritten. Contrib widgets will not be imported by init |
| 7 | +unless you explicitly enable it, or load them in your rc.lua. |
| 8 | + |
| 9 | + |
| 10 | +Usage within Awesome |
| 11 | +-------------------- |
| 12 | +To use contrib widgets uncomment the line that loads them in |
| 13 | +init.lua. Or you can load them in your rc.lua after you require |
| 14 | +Vicious: |
| 15 | + |
| 16 | + vicious = require("vicious") |
| 17 | + vicious.contrib = require("vicious.contrib") |
| 18 | + |
| 19 | + |
| 20 | +Widget types |
| 21 | +------------ |
| 22 | +Most widget types consist of worker functions that take the "format" |
| 23 | +argument given to vicious.register as the first argument, "warg" as |
| 24 | +the second, and return a table of values to insert in the format |
| 25 | +string. But we have not insisted on this coding style in contrib. So |
| 26 | +widgets like PulseAudio have emerged that are different. These widgets |
| 27 | +could also depend on Lua libraries that are not distributed with the |
| 28 | +core Lua distribution. Ease of installation and use does not |
| 29 | +necessarily have to apply to contributed widgets. |
| 30 | + |
| 31 | +**vicious.contrib.ac** |
| 32 | + |
| 33 | +Provide status about the power supply (AC) |
| 34 | +Supported platforms: Linux (required tools: `sysfs`) |
| 35 | + |
| 36 | +- Arguments: |
| 37 | + * takes the AC device as an argument, i.e "AC" or "ACAD" |
| 38 | + * the device is linked under /sys/class/power_supply/ and should |
| 39 | + have a file called "online" |
| 40 | +- Returns |
| 41 | + * if AC is connected, $1 returns "On", if not it returns "Off", |
| 42 | + if AC doesn't exist, $1 is "N/A" |
| 43 | + |
| 44 | +**vicious.contrib.ati** |
| 45 | + |
| 46 | +Provides various info about ATI GPU status. |
| 47 | +Supported platforms: Linux (required tools: `sysfs`) |
| 48 | + |
| 49 | +- Arguments: |
| 50 | + * takes card ID as an argument, i.e. "card0" (and where possible, |
| 51 | + uses debugfs to gather data on radeon power management) |
| 52 | +- Returns: |
| 53 | + * a table with string keys: {method}, {dpm_state}, |
| 54 | + {dpm_perf_level}, {profile}, {engine_clock mhz}, {engine_clock khz}, |
| 55 | + {memory_clock mhz}, {memory_clock khz}, {voltage v}, {voltage mv} |
| 56 | + |
| 57 | +**vicious.contrib.batpmu** |
| 58 | + |
| 59 | +**vicious.contrib.batproc** |
| 60 | + |
| 61 | +**vicious.contrib.countfiles** |
| 62 | + |
| 63 | +**vicious.contrib.dio** |
| 64 | + |
| 65 | +Provides I/O statistics for requested storage devices |
| 66 | + |
| 67 | +- Arguments: |
| 68 | + - takes the disk as an argument, i.e. "sda" (or a specific |
| 69 | + partition, i.e. "sda/sda2") |
| 70 | +- Returns: |
| 71 | + - a table with string keys: {total_s}, {total_kb}, {total_mb}, |
| 72 | + {read_s}, {read_kb}, {read_mb}, {write_s}, {write_kb}, {write_mb} |
| 73 | + and {sched} |
| 74 | + |
| 75 | +**vicious.contrib.mpc** |
| 76 | + |
| 77 | +vicious.contrib.netcfg |
| 78 | + - |
| 79 | + |
| 80 | +**vicious.contrib.net** |
| 81 | + |
| 82 | +**vicious.contrib.openweather** |
| 83 | + |
| 84 | +Provides weather information for a requested city |
| 85 | + |
| 86 | +- Arguments |
| 87 | + * takes OpenWeatherMap city ID as an argument, i.e. "1275339" |
| 88 | +- Returns |
| 89 | + * a table with string keys: {city}, {wind deg}, {wind aim}, |
| 90 | + {wind kmh}, {wind mps}, {sky}, {weather}, {temp c}, {humid}, {press} |
| 91 | + |
| 92 | +**vicious.contrib.nvinf** |
| 93 | + |
| 94 | +provides GPU utilization, core temperature, clock frequency information about Nvidia GPU from nvidia-settings |
| 95 | +Supported Platforms: platform independent |
| 96 | + |
| 97 | +- Arguments |
| 98 | + * takes optional card ID as an argument, i.e. "1", or defaults to ID 0 |
| 99 | +- Returns |
| 100 | + * first 4 values as usage of GPU core, memory, video engine and |
| 101 | + PCIe bandwidth, 5th as temperature of requested graphics device, 6th |
| 102 | + as frequency of GPU core, 7th as memory transfer rate |
| 103 | + |
| 104 | +**vicious.contrib.nvsmi** |
| 105 | + |
| 106 | +Provides (very basic) information about Nvidia GPU status from SMI |
| 107 | +Supported Platforms: platform independent |
| 108 | + |
| 109 | +- Arguments: |
| 110 | + * takes optional card ID as an argument, i.e. "1", or defaults to ID 0 |
| 111 | +- Returns: |
| 112 | + * returns 1st value as temperature of requested graphics device |
| 113 | + |
| 114 | +**vicious.contrib.ossvol** |
| 115 | + |
| 116 | +**vicious.contrib.pop** |
| 117 | + |
| 118 | +**vicious.contrib.pulse** |
| 119 | + |
| 120 | +Provides volume levels of requested pulseaudio sinks and functions to |
| 121 | +manipulate them |
| 122 | + |
| 123 | +- Arguments |
| 124 | + * takes the name of a sink as an optional argument. a number will |
| 125 | + be interpret as an index, if no argument is given, it will take |
| 126 | + the first-best |
| 127 | + * to get a list of available sinks use the command: pacmd |
| 128 | + list-sinks | grep 'name:' |
| 129 | +- Returns |
| 130 | + * returns 1st value as the volume level |
| 131 | +- vicious.contrib.pulse.add(percent, sink) |
| 132 | + * @percent is a number, which increments or decrements the volume |
| 133 | + level by its value in percent |
| 134 | + * @sink optional, same usage as in vicious.contrib.pulse |
| 135 | + * returns the exit status of pacmd |
| 136 | +- vicious.contrib.pulse.toggle(sink) |
| 137 | + * inverts the volume state (mute -> unmute; unmute -> mute) |
| 138 | + * @sink optional, same usage as in vicious.contrib.pulse |
| 139 | + * returns the exit status of pacmd |
| 140 | + |
| 141 | +**vicious.contrib.rss** |
| 142 | + |
| 143 | +**vicious.contrib.sensors** |
| 144 | + |
| 145 | +**vicious.contrib.wpa** |
| 146 | + |
| 147 | +Provides information about the wifi status |
| 148 | +Supported Platforms: platform independent (`wpa_cli`) |
| 149 | + |
| 150 | +- Arguments |
| 151 | + - takes the interface as an argument, i.e "wlan0" or "wlan1" |
| 152 | +- Returns |
| 153 | + - a table with string keys: {ssid}, {qual}, {ip}, {bssid} |
| 154 | + |
| 155 | +**vicious.contrib.buildbot** |
| 156 | + |
| 157 | +Provides last build status for configured buildbot builders (http://trac.buildbot.net/) |
| 158 | +Supported Platforms: platform independent |
| 159 | + |
| 160 | +- Returns: |
| 161 | + * returns build status in the format: [<builderName>.<currentBuildNumber>.<lastSuccessfulBuildNumber>] |
| 162 | + * if <currentBuildNumber> is the same as <lastSuccessfulBuildNumber> only one number is displayed |
| 163 | + * <buildNumber> colors: red - failed, green - successful, yellow - in progress |
| 164 | + * it depends on lua json parser (e.g. liblua5.1-json on Ubuntu 12.04) |
| 165 | + |
| 166 | + |
| 167 | +Usage examples |
| 168 | +--------------------------------- |
| 169 | +Pulse Audio widget |
| 170 | + vol = wibox.widget.textbox() |
| 171 | + vicious.register(vol, vicious.contrib.pulse, " $1%", 2, "alsa_output.pci-0000_00_1b.0.analog-stereo") |
| 172 | + vol:buttons(awful.util.table.join( |
| 173 | + awful.button({ }, 1, function () awful.util.spawn("pavucontrol") end), |
| 174 | + awful.button({ }, 4, function () vicious.contrib.pulse.add(5,"alsa_output.pci-0000_00_1b.0.analog-stereo") end), |
| 175 | + awful.button({ }, 5, function () vicious.contrib.pulse.add(-5,"alsa_output.pci-0000_00_1b.0.analog-stereo") end) |
| 176 | + )) |
| 177 | + |
| 178 | +Buildbot widget |
| 179 | + buildbotwidget = wibox.widget.textbox() |
| 180 | + local buildbotwidget_warg = { |
| 181 | + {builder="coverage", url="http://buildbot.buildbot.net"}, |
| 182 | + {builder="tarball-slave", url="http://buildbot.buildbot.net"} |
| 183 | + } |
| 184 | + vicious.register(buildbotwidget, vicious.contrib.buildbot, "$1,", 3600, buildbotwidget_warg) |
0 commit comments