Skip to content

Quick start

Create a folder inside Waydir's plugins directory. The fastest way to open that folder is Preferences -> Plugins -> Open plugins folder.

OSPlugin folder
Linux~/.config/waydir/plugins/
macOSApp support directory, then plugins/
WindowsApp support directory, then plugins/

1. Create the folder

text
selection-count/
  manifest.json
  init.lua

2. Add manifest.json

json
{
  "id": "selection-count",
  "name": "Selection Count",
  "version": "1.0.0",
  "author": "you",
  "description": "Shows how many items are selected.",
  "api_version": 2,
  "permissions": []
}

This plugin only shows a toast, so it needs no permissions.

3. Add init.lua

lua
waydir.register({
  id = "count",
  menu = "context",
  title = "Show selection count",
  when = { min = 1 },
  run = function(ctx)
    waydir.toast("Selected: " .. ctx.count .. " (" .. ctx.dir .. ")")
  end,
})

4. Reload and test

Open Preferences -> Plugins and click Reload plugins. Then select one or more files or folders, right-click, and choose Show selection count.

If the plugin does not appear, check that:

  • the folder contains both manifest.json and init.lua;
  • api_version is 2;
  • the selected files match the when filter;
  • the plugin is not disabled in Preferences.

MIT licensed. Open source.