2013-09-07 14:34:38 +02:00
[<- widgets ](https://github.com/copycat-killer/lain/wiki/Widgets )
2013-09-07 12:27:10 +02:00
Shows disk space usage for a set partition.
Displays a notification when the partition is full or has low space.
mypartition = lain.widgets.fs()
2013-09-10 23:00:43 +02:00
### input table
2013-09-07 12:27:10 +02:00
Variable | Meaning | Type | Default
--- | --- | --- | ---
2013-09-10 23:00:43 +02:00
`timeout` | Refresh timeout seconds -| int | 600
2013-09-07 12:27:10 +02:00
`partition` | Partition to monitor | string | "/"
2013-09-10 23:00:43 +02:00
`settings` | User settings | function | empty function
2013-09-07 12:27:10 +02:00
2013-09-11 16:19:34 +02:00
`settings` can use the following `partition` related float values: `used` and `available` , `size_mb` , `size_gb` .
2013-09-07 12:27:10 +02:00
2013-09-10 23:00:43 +02:00
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"]
2013-09-10 23:14:30 +02:00
where `p` is the last column of `df` command ("/", "/home", "/boot", ...).
2013-09-10 23:00:43 +02:00
This means you can set the widget for a certain partition, but you can look up at others too.
2013-09-10 23:13:33 +02:00
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. Default definition:
notification_preset = { fg = beautiful.fg_normal }
2013-09-10 23:00:43 +02:00
### output table
2013-09-07 12:27:10 +02:00
2013-09-07 13:21:12 +02:00
Variable | Meaning | Type
--- | --- | ---
`widget` | The widget | `wibox.widget.textbox`
`show` | The notification | function
2013-09-07 12:27:10 +02:00
2013-09-07 13:21:34 +02:00
You can display the notification with a key binding like this:
2013-09-07 12:27:10 +02:00
awful.key({ altkey }, "h", function () mypartition.show(7) end),
where ``altkey = "Mod1"`` and ``show`` argument is an optional integer, meaning timeout seconds.