X-Git-Url: https://git.madduck.net/etc/awesome.git/blobdiff_plain/e25277ef15b7bcbdcbd2033e6f1488f042111610..49e226be45dd4178d37bd99848b8a7e72684bee4:/fs.md?ds=sidebyside diff --git a/fs.md b/fs.md index 0659682..6525e41 100644 --- a/fs.md +++ b/fs.md @@ -1,31 +1,42 @@ +[<- widgets](https://github.com/copycat-killer/lain/wiki/Widgets) + Shows disk space usage for a set partition. Displays a notification when the partition is full or has low space. mypartition = lain.widgets.fs() -The function takes a table as optional argument, which can contain: +### input table Variable | Meaning | Type | Default --- | --- | --- | --- +`timeout` | Refresh timeout seconds -| int | 600 `partition` | Partition to monitor | string | "/" -`refresh_timeout` | Refresh timeout seconds | int | 600 -`header` | Text to show before value | string | " Hdd " -`header_color` | Header color | string | `beautiful.fg_normal` or "#FFFFFF" -`color` | Value color | string | `beautiful.fg_focus` or "#FFFFFF" -`footer` | Text to show after value | string | "%" -`shadow` | Hide the widget if `partition` < 90 | boolean | false +`settings` | User settings | function | empty function + +`settings` can use the following `partition` related value strings: `used`, `available`, `size_mb`, `size_gb`. + +It can also use value strings in these formats: + + fs_info[p .. "used_p"] + fs_info[p .. "avail_p"] + fs_info[p .. "size_mb"] + fs_info[p .. "size_gb"] + +where `p` is the last column of the output of `df` ("/", "/home", "/boot", ...). + +This means you can set the widget for a certain partition, but you can look up at others too. -**Note**: `footer` color is `color`. +Finally, `settings` can modify `notification_preset` table too. This table will be the preset for the naughty notifications. Check [here](http://awesome.naquadah.org/doc/api/modules/naughty.html#notify) for the list of variables it can contain. -`lain.widgets.fs` outputs the following table: +### output table -Variable | Type ---- | --- -`widget` | `wibox.widget.textbox` -`show` | function +Variable | Meaning | Type +--- | --- | --- +`widget` | The widget | `wibox.widget.textbox` +`show` | The notification | function -You can display a notification of current disk space usage with a key binding like this: +You can display the notification with a key binding like this: awful.key({ altkey }, "h", function () mypartition.show(7) end),