alexhua / Aria2-Explorer

An aria2 download task management extension for chromium based browser
https://www.aria2e.com/
BSD 3-Clause "New" or "Revised" License
784 stars 66 forks source link

Open downloaded file in folder in Nautilus of Gnome (Ubuntu) #183

Closed ivy-reps closed 4 months ago

ivy-reps commented 4 months ago

Motivation I'm working in Ubuntu and all this time of usage of Aria2 Explorer, I have not seen ability to open folder right from Aria2 Explorer. Then in Windows suddenly I've found that Folder icon. There is no such thing for Linux, so I've changed your code a bit and implement that to work in Linux.

I've removed isWindows variable from <a ng-if="isWindows && isRpcLocalhost && (task.status = condition of your extension that rules whether Folder will be visible or not, and I've implemented aria2:// schema in Gnome of Ubuntu and it works.

Feature Description

  1. Make that Folder icon available to any system with notice that for Unix family customers/users have to implement schema handler by theirs own, for example
  2. Make folder icon much bigger. May be it's even better to move that icon to beggining of the line. Open Folder action/command have much bigger priority then other elements around. Also small icons/ small elements unclickable in now days screens when they are of a size of mouse cursor/pointer

Is the solution code ready Yes

Willing to maintain the related code in the future Yes

Additional context

  1. Line that you can search and will remove isWindows (if you has decided to change that): <a ng-if="isWindows && isRpcLocalhost && (task.status =

  2. Desktop file which can be used as receiver of handler

    Version=1.0
    Type=Application
    Exec=sh -c 'path="%u"; nautilus ${path#aria2://browse/path=}'
    Terminal=false
    Categories=Utility
    MimeType=x-scheme-handler/aria2;
    Name=Open file folder in nautilus
    Comment=Opens folder in which file was downloaded by aria2c
  3. Command that have to be used to handle schema and connect it with receiver or handler or whatever: xdg-mime default org.gnome.Nautilus.desktop x-scheme-handler/aria2

P.S. This line sh -c 'path="%u"; nautilus ${path#aria2://browse/path=}' can be changed to any script that you will prefer to open Aria2 Explorer path. Here ${path#aria2://browse/path=} aria2://browse/path= part will be filtered to leave path only which will be sent as argument of nautilus

Video of how it works in Gnome and Nautilus Screencast from 2024-02-19 12-01-35.webm

alexhua commented 4 months ago

It seems your requirement is similar with #178.

I will add a feature that could let user customize their own scheme URL of open folder handler which is not only for Windows.

Thanks for your feedback. Your self-made handler is worthy of a thumbs up which is a good reference for Linux user.

ivy-reps commented 4 months ago

Your self-made handler is worthy of a thumbs up which is a good reference for Linux user.

Thank you very much, @alexhua. Amazing to here such comment!

offtop Also, I'm sorry for duplication of #178. Sadly I will never call it Download location link and because of that I've created mine one issue.

What do you think about renaming of issues for providing better meaning which can be gotten from issue subject or creating issues aliases, which will drive you to main issue? For example we can request github to implement ability for repository authors to join few Issues into one and mix theirs subjects, or to provide to one issue multiple title fields, which will work as aliases, and also all conversations of issues join will became one issue

I offered that feature here: https://github.com/orgs/community/discussions/109413

alexhua commented 4 months ago

offtop Also, I'm sorry for duplication of #178. Sadly I will never call it Download location link and because of that I've created mine one issue.

No at all. Sometimes, it is hard for issue submitter to tell the similarity of the requirements. Actually, from user's perspective, your proposal is different from #178, but an upcoming new feature will solve both of them. From developer's view, it is a similar requirement. So, don't mind it.

ivy-reps commented 4 months ago

offtop Also, I'm sorry for duplication of #178. Sadly I will never call it Download location link and because of that I've created mine one issue.

No at all. Sometimes, it is hard for issue submitter to tell the similarity of the requirements. Actually, from user's perspective, your proposal is different from #178, but an upcoming new feature will solve both of them. From developer's view, it is a similar requirement. So, don't mind it.

Thank you, very much!

alexhua commented 4 months ago

urlHandler User could customize the handler URL for none-Windows OS right now.

ivy-reps commented 3 months ago

@alexhua, may be it will be rigth for the user expirience to show folder icon always, but until property will not be specified, to inform user that he can specify it in settings, ot better to switch user to configuration page of current RPC active and inform him to set concrete field value. May be will be great to copy default field value as copyable text below that field, because other peoples can implement theirs app handler by your default schema, but the folder will not be available until you set it, or even better to set it by default not as placeholder but as value. Because it's not clear that you can have that folder at all unless you will find it in Windows occasionally or will read some documentation, and it will be hard to understant how it can be set and that this feature is related to concreate RPC and it's not global setting, because I've haven't found that in Global settings.

Anyway, I'm very thankful to implementation! It does work.