My configuration files for Debian/Ubuntu applications
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. ## Usage
  2. [Read here.](https://github.com/lcpz/lain/wiki/Widgets#usage)
  3. ### Description
  4. Shows file systems informations.
  5. If a partition is given in input, a notification will be displayed when it is almost full.
  6. ```lua
  7. local mypartition = lain.widget.fs()
  8. ```
  9. ## Input table
  10. Variable | Meaning | Type | Default
  11. --- | --- | --- | ---
  12. `timeout` | Refresh timeout (in seconds) | integer | 600
  13. `partition` | (Optional) Partition to watch: a notification will be displayed when full | string | `nil`
  14. `threshold` | Percentage threshold at which the notification is triggered | integer | 99
  15. `notification_preset` | Notification preset | table | See [default `notification_preset`](https://github.com/lcpz/lain/wiki/fs#default-notification_preset)
  16. `followtag` | Display the notification on currently focused screen | boolean | false
  17. `showpopup` | Display popups with mouse hovering | string, possible values: "on", "off" | "on"
  18. `settings` | User settings | function | empty function
  19. `widget` | Widget to render | function | `wibox.widget.textbox`
  20. `settings` can use the table `fs_now`, which contains a string entry for each file system path available. For instance, root infos are located in the variable `fs_now["/"]`. Every entry in this table have the following variables:
  21. Variable | Meaning | Type
  22. --- | --- | ---
  23. `units` | (multiple of) units used | string ("Kb", "Mb", "Gb", and so on)
  24. `percentage` | the used percentage | integer
  25. `size` | size in `units` of the given fs | float
  26. `used` | amount of space used in the given fs, expressed in `units` | float
  27. `free` | amount of free space in the given fs, expressed in `units` | float
  28. Usage example:
  29. ```lua
  30. -- shows used (percentage) and remaining space in home partition
  31. local fsroothome = lain.widget.fs({
  32. settings = function()
  33. widget:set_text("/home: " .. fs_now["/home"].percentage .. "% (" ..
  34. fs_now["/home"].free .. " " .. fs_now["/home"].units .. " left)")
  35. end
  36. })
  37. -- output example: "/home: 37% (239.4 Gb left)"
  38. ```
  39. With multiple screens, the default behaviour is to show a visual notification pop-up window on the first screen. By setting `followtag` to `true` it will be shown on the currently focused tag screen.
  40. ### Default `notification_preset`
  41. ```lua
  42. notification_preset = {
  43. font = "Monospace 10",
  44. fg = "#FFFFFF",
  45. bg = "#000000"
  46. }
  47. ```
  48. ## Output table
  49. Variable | Meaning | Type
  50. --- | --- | ---
  51. `widget` | The widget | `wibox.widget.textbox`
  52. `show` | The notification | function
  53. You can display the notification with a key binding like this:
  54. ```lua
  55. awful.key({ altkey }, "h", function () mypartition.show(seconds, scr) end),
  56. ```
  57. where ``altkey = "Mod1"`` and ``show`` arguments, both optionals, are:
  58. * `seconds`, notification time in seconds
  59. * `scr`, screen which to display the notification in
  60. ## Note
  61. Naughty notifications require `notification_preset.font` to be **monospaced**, in order to correctly display the output.