morgant / xwf

X Window Filemanager
GNU General Public License v2.0
6 stars 0 forks source link

xcp should use FreeDesktop.org trash location #8

Open morgant opened 3 years ago

morgant commented 3 years ago

xcp currently stores trash in an xwf-specific location, but it should be updated to use the standard OpenDesktop.org trash location to be compatible with other apps and Desktop Environments.

morgant commented 3 years ago

In order to follow the OpenDesktop.org trash location spec, we'll need to first follow the XDG Base Directory Specification for file paths. Fortunately, there's a libxdg-basedir C library that helps simplify this implementation. Fortunately, libxdg-basedir is available in OpenBSD's ports.

Additionally, it appears that GIO 2.0 has a trash() method which can move files to the appropriate trash location. This would not require libxdg-basedir and I believe it's a prerequisite for Glib 2.0, so should be included in the OpenBSD glib2 port. That said, it doesn't have any methods for emptying the trash, AFAICT.

Update: According to the Arch Linux Wiki, there's a gio utility which includes a trash sub command which also accepts an --empty switch to empty the trash. We could maybe rely on that.