Forum › Forums › General › Tips and Tricks › Script to add a Trash can to ZZZfm
- This topic has 6 replies, 3 voices, and was last updated May 26-10:16 am by PPC.
-
AuthorPosts
-
February 7, 2022 at 11:10 am #76970Member
PPC
I think that one “extra” that most users that come to antiX expect is a Trash can. You can manually add it to zzzfm/spacefm (I have a thread on that). Even being kind of “Power User” I like having a trash can/ recycle bin on my system- it saved me lots of work on the past.
After taking a rest for a couple of days, I think I finally have a working prototype of a script that enables a Trash can in ZZZfm.
I wrote this script to be included in the next FT10 release, but I think regular antiX users may find this one usefull…What the script does:
-it installs trash-cli
-It opens and then closes a zzzfm window, just in case it’s never been run before (no check is done, for now this is an alpha script)
-It alters zzzfm’s config file, adding a (complex) contextual menu entry, that sends files/folders to the trash folder, when you click that contextual menu entry, or press delete. If you are already in the trash folder, this entry/keybinding is disabled.
-It converts the “Delete” keybinding to “Ctrl + Del”
-It adds a Bookmark to the Trash folderTo do’s:
-Enable some checks (to see it the zzzfm’s config file already exists)
-Auto create the usual bookmarks (Downloads, Documents, etc)
-Localize the contextual menu and the trash bookmark – hum… this one will be tricky- I can cheat, and also make sure that the “trans” command is running and if the system language is not english, then get the local word to “Trash” and use that on the contextual menu/Bookmark…The script is over at:
https://gitlab.com/antix-contribs/ft10-transformation/-/raw/main/install_trash-can-alpha3-english.shA Portuguese version is available over at:
https://gitlab.com/antix-contribs/ft10-transformation/-/raw/main/install_trash-can-alpha3.shYou can copy the script to a text document, make it executable and run it- it may trash your zzzfm config file. If that happens, a backup is created in ~/.config/zzzfm/sessionBACKUP-FT10
To restore that backup copy, make sure that zzzfm is closed and run this command on the terminal:
cp ~/.config/zzzfm/sessionBACKUP-FT10 ~/.config/zzzfm/sessionIf at any time you trash your zzzfm configuration (pun intended), delete ~/.config/zzzfm/session to force zzzfm to use the default settings.
P.
February 9, 2022 at 8:48 am #77100ModeratorBobC
::This weekend I will play with this. I don’t need it for me, but, but, but…
I believe that if we can, we should at least try to give the cat at least the chance of one more life if we can find a way that won’t break something else.
- This reply was modified 1 year, 2 months ago by BobC.
February 9, 2022 at 10:15 am #77109MemberPPC
::Well, I think the script to configure zzzfm itself is almost done. You’ll end up with something that looks familiar to most people, even those that never used Linux before. I uploaded a screenshot here: https://i.imgur.com/KdGZIEH.png
The most recent version of the script is: https://gitlab.com/antix-contribs/ft10-transformation/-/raw/main/install_trash-can-alpha65.sh
Please note:
If you do not have trash-cli installed, run the script once, so trash-cli is instaled and then again, so it configures zzzfm (this is an Alpha, after all)Edit: the screenshot is, of course, in my own language, but all the Bookmarks are displayed yout system’s language (except, for now, the Trash related entries that are only in English or Portuguese/Portuguese from Brazil).
-The devices are only displayed on the top left if a non empty device is detected
-The tabs are only displayed on the top, if more than one tab is being used
-I also changed zzzfm’s icon, after I took the screenshot, so it’s now a blue folder (that’s more relatable to most users)- This reply was modified 1 year, 2 months ago by PPC.
February 11, 2022 at 10:06 am #77215MemberPPC
::@BobC – if you want to test the latest iteration of the script, it’s now this: https://gitlab.com/antix-contribs/ft10-transformation/-/raw/main/trasher-gitlab3.sh
Unless some bugs are discovered, with very few changes, this will be implemented in the next FT10 version (because having a well configured File Manager was the last real important thing missing, along with this: I would like to tackle making pulse audio working “out of the box” with F10, to avoid the problem of lack of sound in some applications.
P.
- This reply was modified 1 year, 2 months ago by PPC.
February 12, 2022 at 10:06 am #77262MemberPPC
::And what should be the last version of the script (I have only to implement the localization of “Trash” related entries) is over at: https://gitlab.com/antix-contribs/ft10-transformation/-/raw/main/trasher-gitlab-remake6.sh
In short, this implements a new configuration file in zzzfm, that changes some defaults and adds some extra features (thanks to a couple of scripts):
-Trash can support ( Del – sends files to Trash, Shilt + Del – permanently deletes files)
-Bookmarks: all usual bookmarks are present (like Home folder, Documents, Downloads, etc) plus Trash, Recent files and Cloud Drives (this one depends on the Cloud script, included in the FT10 package)
-Contextual menu includes: “Send to trash”; “Terminal”;“> Wallpaper” (to use currently selected image as wallpaper)
-Devices are shown displaying Label, size, id, mount point (most people just want to able to read the Label of their pendrives/cds/dvd’s, and getting the Linux id of the drive means nothing to them
-The toolbar was cleaned up: I removed the toggle icons for Bookmarks, Devices, Tree. I also added icons to Toggle icon size and 2 buttons to use Compact/Detailed icon’s layout. I also added a “Search”button that uses zzzfm searchTo do:
-Implement localization of Trash related entries, at least to the languages that are 100% supported in FT10 (currently only pt and pt-br localization are supported). For now I’m not using .po/.mo localization files- that will probably change when I insert this script into FT10’s package (for now it’s a stand alone script, with everything included)If anyone has any idea about missing features that could be added to zzzfm, speak now or… 🙂
P.
- This reply was modified 1 year, 2 months ago by PPC.
May 26, 2022 at 7:42 am #83658Memberclementishutin
::This weekend I will play with this. I don’t need it for me, but, but, but…
I believe that if we can, we should at least try to give the cat at least the chance of one more life if we can find a way that won’t break something else.
So how was your experience?
May 26, 2022 at 10:16 am #83667MemberPPC
::For personal reasons I ‘ve been away from the forum, I still take a look at the threads ever now and then. I want to just tell folks here that the “trash can” script was included in the ft10-transformation package, available in the repository. Just install it (you don’t even have to activate the ft10 toolbar) and run the script f10-fm-config.sh to change zzzfm.
It would be highly advisable to back up zzzfm’s config file, to restore everything to the default settigns, if you don’t like my implementation of zzzfm.P.
-
AuthorPosts
- You must be logged in to reply to this topic.