Log In  

Cart #trashbin-2 | 2024-03-22 | Embed ▽ | License: CC4-BY-NC-SA
6


A simple trashbin.
Drag some files and drop them in the trashbin.
The trashbin icon uses the theme colors for icons.

Add the following lines to /appdata/system/startup.lua:

create_process("/desktop/trashbin.p64", {
    argv = {
        config_path="/appdata/trashbin.pod",
        trash_dir="/trash"
    }
})

Modify the values for config_path and the trash_dir at will.
The trash_dir will be generated and a trashbin icon will be set in the metadata.
Double-click on the trashbin will open the configured trash_dir in the filenav app.
You can drag and drop the trashbin and it is saved immediately in
the pod configured in the config_path.

changelog

1.1.1

  • fix issue with missing theme pod
    in web player

1.1.0

  • use current theme colors for icon
  • instead of right-click, a double-click
    now opens the configured trash_dir
  • more dynamic sprite for the
    trashbin (thanks to @washburnello)
  • set icon in metadata of trash_dir

1.0.0

  • drag and drop files into the trashbin
  • right-click on trashbin opens
    configured trash_dir
  • drag trashbin to change
    position (thanks to @cubee)
  • new position will be saved in a
    pod configured with config_path
P#143952 2024-03-20 15:49 ( Edited 2024-03-22 22:23)

1

Hi @kr1sp1n, nice to see you here

The uploaded cart needs to be in .p64.png -- is that the problem? You can convert to png by copying it:

cp foo.p64 foo.p64.png

You can then insert it into this post using the id you uploaded with:

[ #foo_id# ] (with added spaces here to make this readable in a post)

P#143961 2024-03-20 17:16 ( Edited 2024-03-20 17:17)

@zep Thanks for the hint with the cp command.
I copied and renamed it outside of Picotron and that seems to corrupt the file somehow.

P#143965 2024-03-20 18:24

Great tool!

A simple suggestion for the sprite. By dropping the top half of the full sprite down one pixel it makes the bulge feel more dynamic.

P#143971 2024-03-20 19:12 ( Edited 2024-03-20 19:13)

> I copied and renamed it outside of Picotron and that seems to corrupt the file somehow

yes – only picotron converts the file format with the cp command, other operating systems are just changing the file name

P#143993 2024-03-20 22:55
1

@washburnello Thanks for your suggestion!
I changed it and since v1.1.0 it's in the cartridge.

P#144121 2024-03-22 09:28

Is there a way for the trashbin icon to colour coordinate with the system theme?
It doesn’t seem to change on mine…

P#145666 2024-04-04 10:34

I’ve had to reshade the icon itself so that it works

P#145668 2024-04-04 10:59

How do we empty the trashbin? If I delete the files in the /trash/ directory on windows it throws a runtime error.

P#145670 2024-04-04 11:37 ( Edited 2024-04-04 11:38)
1

Made my own Waste bin icon.

Followed SabeDoesThings YouTube tutorial for the code.

P#145849 2024-04-05 21:27

[Please log in to post a comment]