Log In  


Cart #trashman-3 | 2025-03-01 | Embed ▽ | License: CC4-BY-NC-SA
5

This is a trash manager for Picotron that loosely follows the XDG Trash Specification. You can use it to delete and and later restore files from trash.

Full usage instructions are in the README (also available from "Help" inside the cart), but basically you can drag/drop files to move them to trash. Left click a file in trash to restore it, right click a file in trash to permanently delete it.

You can also use Trash Manager as a CLI utility.
trash [files] to move files to trash
trash --list [search] or trash --search [search] to list/search trash
trash --restore [files]
trash --restore-all to restore all files
trash --delete [files] to permanently delete files
trash --empty or trash --delete-all to permanently delete all trash

Finally, you can use it in the tooltray. You can drop files to the indicator to move them to trash, and you left click the indicator to open the GUI or right click it to empty the trash.

Changelog

v1.0.1 (2025-02-18):

  • Use argv[0] instead of prog_name (0.1.1e compatibility)
  • Use open instead of accessing notebook.p64 directly
  • Support installing tooltray widget by dragging to tooltray
  • Ctrl+Drag to move tooltray indicator (Tip: Hold right click on the indicator to focus it first)
  • Move delete action in for tooltray to Middle Click (0.1.1e compatibility)
  • Remove gap between final item and status bar
  • Must be unsandboxed to work!

v1.0.2 (2025-02-18):

  • Fix bug where can't open cart from indicator or double click
  • All instances of help use open

v1.0.3 (2025-03-01):

5


Here's a script to integrate trashman with filenav.p64, using sedish

It replaces delete_selected_files in /system/apps/filenav.p64/finfo.lua with a version that calls trash.p64 instead of moving the files to /ram/compost.

sedish("/system/apps/filenav.p64/finfo.lua", {
	{
		[[function delete_selected_files()]],
		[[function delete_selected_files()
	if fstat("/appdata/system/util/trash.p64") == "folder" then
		local trash = {"--"}

		for k,v in pairs(finfo) do
			if (v.selected) then
				local fullpath = fullpath(v.filename)
				add(trash, fullpath)
			end
		end

		create_process("/appdata/system/util/trash.p64", {argv=trash})
		notify(string.format("moved %d items to trash", #trash - 1))
		return
	end]]
	}
})


[Please log in to post a comment]