Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use gio as default linux trash impl (backport: 4-0-x) #15422

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 5 additions & 4 deletions atom/common/platform_util_linux.cc
Expand Up @@ -15,7 +15,7 @@
#include "url/gurl.h"

#define ELECTRON_TRASH "ELECTRON_TRASH"
#define ELECTRON_DEFAULT_TRASH "gvfs-trash"
#define ELECTRON_DEFAULT_TRASH "gio"

namespace {

Expand Down Expand Up @@ -125,12 +125,13 @@ bool MoveItemToTrash(const base::FilePath& full_path) {
} else if (trash.compare("trash-cli") == 0) {
argv.push_back("trash-put");
argv.push_back(full_path.value());
} else if (trash.compare("gio") == 0) {
argv.push_back("gio");
argv.push_back("trash");
} else if (trash.compare("gvfs-trash") == 0) {
// retain support for deprecated gvfs-trash
argv.push_back("gvfs-trash");
argv.push_back(full_path.value());
} else {
argv.push_back(ELECTRON_DEFAULT_TRASH);
argv.push_back("trash");
argv.push_back(full_path.value());
}
return XDGUtilV(argv, true);
Expand Down
10 changes: 10 additions & 0 deletions docs/api/environment-variables.md
Expand Up @@ -80,6 +80,16 @@ Don't attach to the current console session.

Don't use the global menu bar on Linux.

### `ELECTRON_TRASH` _Linux_

Set the trash implementation on Linux. Default is `gio`.

Options:
* `gvfs-trash`
* `trash-cli`
* `kioclient5`
* `kioclient`

## Development Variables

The following environment variables are intended primarily for development and
Expand Down