luastatu...-inotify(7)

πŸ“¦
version 0.6.0 Β· 2 versions
, in nixos 26.05

🌸 Name

luastatus-plugin-inotify β€” the inotify plugin for luastatus, bestie. This page is luastatu...-inotify(7), and it lives in the Miscellaneous Information Manual section. πŸ¦‹

✨ Overview

This plugin monitors inotify events. That’s the whole vibe check: inotify events, monitored by this plugin. πŸ‘‘

πŸŽ€ Options

  • watch: table β€” a table where the keys are the paths to watch and the values are tables with event names, e.g. {["/home/user"] = {"create", "delete", "move"}} (peep the Events and flag names section). πŸ’…
  • greet: boolean β€” whether or not to call cb with what="hello" as soon as the widget starts. Defaults to false.
  • timeout: number β€” if specified and not negative, this plugin calls cb with what="timeout" if no event has occurred in timeout seconds.

πŸ¦‹ cb argument

A table with a what entry, okay? πŸ’–

  • If what is "hello", the function is being called for the first time (and the greet option was set to true).
  • If what is "timeout", the function has not been called for the number of seconds specified as the timeout option.
  • If what is "event", an inotify event has been read; in this case, the table has these additional entries:
    • wd: integer β€” watch descriptor (see the Functions section) of the event.
    • mask: table β€” for each event name or event flag (see the Events and flag names section), this table contains an entry with key equal to its name and true as the value.
    • cookie: number β€” unique cookie associating related events (or, if there are no associated related events, a zero).
    • name: string (optional) β€” present only when an event is returned for a file inside a watched directory; identifies the filename within the watched directory.

πŸ’… Functions

Each file being watched is assigned a watch descriptor, which is a non-negative integer. Slay. ✨

  • wds = luastatus.plugin.get_initial_wds() β€” returns a table that maps initial paths to their watch descriptors.
  • wd = luastatus.plugin.add_watch(path, events) β€” add a new file to watch. Returns a watch descriptor on success, or nil on failure.
  • is_ok = luastatus.plugin.remove_watch(wd) β€” removes a watch by its watch descriptor. Returns true on success, or false on failure.
  • luastatus.plugin.push_timeout(seconds) β€” changes the timeout for one iteration.

πŸ”₯ Events and flag names

Each IN_* constant defined in <sys/inotify.h> corresponds to a string obtained from its name by dropping the initial IN_ and making the rest lower-case, e.g. IN_CLOSE_WRITE corresponds to "close_write".

See inotify(7) for details.

LGPLv3


Bye bestie πŸ’œ the footer in this copy only says luastatu...-inotify(7); no separate source, version, or date line was in the original, so that’s the whole footer vibe. πŸŽ€

πŸ“¦ where this page comes from