Replace open file dialog with ranger
Whenever I want to upload a file via Chromium or Firefox
a dialog to select files will pop up.
Is it possible to replace this dialog with ranger --choosefiles
in a new terminal window?
ranger manpage: https://ranger.github.io/ranger.1.html
Ubuntu 18.04. My window manager is i3.
browser
add a comment |
Whenever I want to upload a file via Chromium or Firefox
a dialog to select files will pop up.
Is it possible to replace this dialog with ranger --choosefiles
in a new terminal window?
ranger manpage: https://ranger.github.io/ranger.1.html
Ubuntu 18.04. My window manager is i3.
browser
add a comment |
Whenever I want to upload a file via Chromium or Firefox
a dialog to select files will pop up.
Is it possible to replace this dialog with ranger --choosefiles
in a new terminal window?
ranger manpage: https://ranger.github.io/ranger.1.html
Ubuntu 18.04. My window manager is i3.
browser
Whenever I want to upload a file via Chromium or Firefox
a dialog to select files will pop up.
Is it possible to replace this dialog with ranger --choosefiles
in a new terminal window?
ranger manpage: https://ranger.github.io/ranger.1.html
Ubuntu 18.04. My window manager is i3.
browser
browser
edited Jan 18 at 18:53
Codito ergo sum
1,5023825
1,5023825
asked Jan 18 at 9:22
canochordocanochordo
62
62
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
Is it possible? Probably yes. It is all open source software, after all. Will it be trivial? Most likely not.
Applications can provide their own "open file" dialog, but more frequently call upon the common dialog provided by the toolbox that the application uses, e.g. GTK3 or QT5, to provide consistency between different applications that use the same toolkit. That is also what Chromium or Firefox do. Replacing these calls to the system dialogs with your custom dialog would require to "hack" the API of the specific toolkit such that a call to that dialog returns your custom dialog instead.
add a comment |
Yes, it is possible - at least for Firefox.
A new standard has been developed to allow arbitrary program to use the current desktop environment's "default" file dialogs without needing to know about the specific implementation. This is called the xdg-desktop-portal
protocol and it was developed for desktop containers, but Firefox has recently added support for it (see below for details).
If you can create a new xdg-desktop-portal
implementation for Ranger (there are already implementations for KDE and GTK file dialogs), then you can use these under Firefox.
Chrome has a different mechanism (it chooses correctly KDE or GTK file dialogs depending if running under Plasma or GNOME), but I'm not sure if it can be overriden to support another implementation.
- The
xdg-desktop-portal
specification can be found here: https://github.com/flatpak/xdg-desktop-portal. - The KDE implementation can be found here: https://github.com/KDE/xdg-desktop-portal-kde. It may help you write your own.
- Here are instructions on how to enable this feature on Firefox 64 (where it isn't the default yet): https://www.reddit.com/r/kde/comments/a5cxwk/firefox_v64_can_now_use_the_kde_file_selection/
Just checked, Chrome has specific implementation for GTK and KDE: codereview.chromium.org/7885002/patch/11002/11003 , so there's no way to add another option without patching Chrome (which you can't - contrary to what @vanadium say. You can patch Chromium, but that will not help you if you want to use Chrome and its additional feature).
– Guss
Jan 18 at 10:18
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1110803%2freplace-open-file-dialog-with-ranger%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
Is it possible? Probably yes. It is all open source software, after all. Will it be trivial? Most likely not.
Applications can provide their own "open file" dialog, but more frequently call upon the common dialog provided by the toolbox that the application uses, e.g. GTK3 or QT5, to provide consistency between different applications that use the same toolkit. That is also what Chromium or Firefox do. Replacing these calls to the system dialogs with your custom dialog would require to "hack" the API of the specific toolkit such that a call to that dialog returns your custom dialog instead.
add a comment |
Is it possible? Probably yes. It is all open source software, after all. Will it be trivial? Most likely not.
Applications can provide their own "open file" dialog, but more frequently call upon the common dialog provided by the toolbox that the application uses, e.g. GTK3 or QT5, to provide consistency between different applications that use the same toolkit. That is also what Chromium or Firefox do. Replacing these calls to the system dialogs with your custom dialog would require to "hack" the API of the specific toolkit such that a call to that dialog returns your custom dialog instead.
add a comment |
Is it possible? Probably yes. It is all open source software, after all. Will it be trivial? Most likely not.
Applications can provide their own "open file" dialog, but more frequently call upon the common dialog provided by the toolbox that the application uses, e.g. GTK3 or QT5, to provide consistency between different applications that use the same toolkit. That is also what Chromium or Firefox do. Replacing these calls to the system dialogs with your custom dialog would require to "hack" the API of the specific toolkit such that a call to that dialog returns your custom dialog instead.
Is it possible? Probably yes. It is all open source software, after all. Will it be trivial? Most likely not.
Applications can provide their own "open file" dialog, but more frequently call upon the common dialog provided by the toolbox that the application uses, e.g. GTK3 or QT5, to provide consistency between different applications that use the same toolkit. That is also what Chromium or Firefox do. Replacing these calls to the system dialogs with your custom dialog would require to "hack" the API of the specific toolkit such that a call to that dialog returns your custom dialog instead.
answered Jan 18 at 9:44
vanadiumvanadium
5,47011229
5,47011229
add a comment |
add a comment |
Yes, it is possible - at least for Firefox.
A new standard has been developed to allow arbitrary program to use the current desktop environment's "default" file dialogs without needing to know about the specific implementation. This is called the xdg-desktop-portal
protocol and it was developed for desktop containers, but Firefox has recently added support for it (see below for details).
If you can create a new xdg-desktop-portal
implementation for Ranger (there are already implementations for KDE and GTK file dialogs), then you can use these under Firefox.
Chrome has a different mechanism (it chooses correctly KDE or GTK file dialogs depending if running under Plasma or GNOME), but I'm not sure if it can be overriden to support another implementation.
- The
xdg-desktop-portal
specification can be found here: https://github.com/flatpak/xdg-desktop-portal. - The KDE implementation can be found here: https://github.com/KDE/xdg-desktop-portal-kde. It may help you write your own.
- Here are instructions on how to enable this feature on Firefox 64 (where it isn't the default yet): https://www.reddit.com/r/kde/comments/a5cxwk/firefox_v64_can_now_use_the_kde_file_selection/
Just checked, Chrome has specific implementation for GTK and KDE: codereview.chromium.org/7885002/patch/11002/11003 , so there's no way to add another option without patching Chrome (which you can't - contrary to what @vanadium say. You can patch Chromium, but that will not help you if you want to use Chrome and its additional feature).
– Guss
Jan 18 at 10:18
add a comment |
Yes, it is possible - at least for Firefox.
A new standard has been developed to allow arbitrary program to use the current desktop environment's "default" file dialogs without needing to know about the specific implementation. This is called the xdg-desktop-portal
protocol and it was developed for desktop containers, but Firefox has recently added support for it (see below for details).
If you can create a new xdg-desktop-portal
implementation for Ranger (there are already implementations for KDE and GTK file dialogs), then you can use these under Firefox.
Chrome has a different mechanism (it chooses correctly KDE or GTK file dialogs depending if running under Plasma or GNOME), but I'm not sure if it can be overriden to support another implementation.
- The
xdg-desktop-portal
specification can be found here: https://github.com/flatpak/xdg-desktop-portal. - The KDE implementation can be found here: https://github.com/KDE/xdg-desktop-portal-kde. It may help you write your own.
- Here are instructions on how to enable this feature on Firefox 64 (where it isn't the default yet): https://www.reddit.com/r/kde/comments/a5cxwk/firefox_v64_can_now_use_the_kde_file_selection/
Just checked, Chrome has specific implementation for GTK and KDE: codereview.chromium.org/7885002/patch/11002/11003 , so there's no way to add another option without patching Chrome (which you can't - contrary to what @vanadium say. You can patch Chromium, but that will not help you if you want to use Chrome and its additional feature).
– Guss
Jan 18 at 10:18
add a comment |
Yes, it is possible - at least for Firefox.
A new standard has been developed to allow arbitrary program to use the current desktop environment's "default" file dialogs without needing to know about the specific implementation. This is called the xdg-desktop-portal
protocol and it was developed for desktop containers, but Firefox has recently added support for it (see below for details).
If you can create a new xdg-desktop-portal
implementation for Ranger (there are already implementations for KDE and GTK file dialogs), then you can use these under Firefox.
Chrome has a different mechanism (it chooses correctly KDE or GTK file dialogs depending if running under Plasma or GNOME), but I'm not sure if it can be overriden to support another implementation.
- The
xdg-desktop-portal
specification can be found here: https://github.com/flatpak/xdg-desktop-portal. - The KDE implementation can be found here: https://github.com/KDE/xdg-desktop-portal-kde. It may help you write your own.
- Here are instructions on how to enable this feature on Firefox 64 (where it isn't the default yet): https://www.reddit.com/r/kde/comments/a5cxwk/firefox_v64_can_now_use_the_kde_file_selection/
Yes, it is possible - at least for Firefox.
A new standard has been developed to allow arbitrary program to use the current desktop environment's "default" file dialogs without needing to know about the specific implementation. This is called the xdg-desktop-portal
protocol and it was developed for desktop containers, but Firefox has recently added support for it (see below for details).
If you can create a new xdg-desktop-portal
implementation for Ranger (there are already implementations for KDE and GTK file dialogs), then you can use these under Firefox.
Chrome has a different mechanism (it chooses correctly KDE or GTK file dialogs depending if running under Plasma or GNOME), but I'm not sure if it can be overriden to support another implementation.
- The
xdg-desktop-portal
specification can be found here: https://github.com/flatpak/xdg-desktop-portal. - The KDE implementation can be found here: https://github.com/KDE/xdg-desktop-portal-kde. It may help you write your own.
- Here are instructions on how to enable this feature on Firefox 64 (where it isn't the default yet): https://www.reddit.com/r/kde/comments/a5cxwk/firefox_v64_can_now_use_the_kde_file_selection/
answered Jan 18 at 10:13
GussGuss
2,27322135
2,27322135
Just checked, Chrome has specific implementation for GTK and KDE: codereview.chromium.org/7885002/patch/11002/11003 , so there's no way to add another option without patching Chrome (which you can't - contrary to what @vanadium say. You can patch Chromium, but that will not help you if you want to use Chrome and its additional feature).
– Guss
Jan 18 at 10:18
add a comment |
Just checked, Chrome has specific implementation for GTK and KDE: codereview.chromium.org/7885002/patch/11002/11003 , so there's no way to add another option without patching Chrome (which you can't - contrary to what @vanadium say. You can patch Chromium, but that will not help you if you want to use Chrome and its additional feature).
– Guss
Jan 18 at 10:18
Just checked, Chrome has specific implementation for GTK and KDE: codereview.chromium.org/7885002/patch/11002/11003 , so there's no way to add another option without patching Chrome (which you can't - contrary to what @vanadium say. You can patch Chromium, but that will not help you if you want to use Chrome and its additional feature).
– Guss
Jan 18 at 10:18
Just checked, Chrome has specific implementation for GTK and KDE: codereview.chromium.org/7885002/patch/11002/11003 , so there's no way to add another option without patching Chrome (which you can't - contrary to what @vanadium say. You can patch Chromium, but that will not help you if you want to use Chrome and its additional feature).
– Guss
Jan 18 at 10:18
add a comment |
Thanks for contributing an answer to Ask Ubuntu!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1110803%2freplace-open-file-dialog-with-ranger%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown