MeanEYE / Sunflower

Small and highly customizable twin-panel file manager for Linux with support for plugins.
GNU General Public License v3.0
430 stars 42 forks source link

Extend "Open with..." dialog #39

Closed edmundlaugasson closed 5 years ago

edmundlaugasson commented 10 years ago

I would expect to have ability manage the "Open with..." choices. I mean when I make mouse right click on the file and choose "Open with -> Other application" then I would see the "manage associations" button in that dialog window. This would be especially useful when I accidentally chosed wrong choice and now would correct it. Also "Restore default" association for that filetype would be useful in cases when user does not know, which program should be correct. This could be the same list, which desktop environment has, e.g. in Gnome - http://askubuntu.com/questions/289337/how-can-i-change-file-association-globally I mean then I do not need Ubuntu Tweak but can use Sunflower to open same dialog. Certainly could Sunflower implement its own dialog window to handle file associations. Currently already user can specify its own command, which is very good - feature, that in Gnome currently is missing.

MeanEYE commented 10 years ago

If you go to File properties you can configure application to Open with.

edmundlaugasson commented 10 years ago

Yes but I cannot change current command, e.g. change parameters, etc. By adding new one I can choose parameters but I would see also current command parameters and if needed to improve - I would change it. I mean like under Sunflower's menu "Commands->Edit Commands" I can edit the command directly - in similar way I would see to edit also file open command and if needed, change it.

MeanEYE commented 10 years ago

This option is already available. If you right-click on any item then go to Open with -> Other application you can then specify command and parameters.

edmundlaugasson commented 10 years ago

Sorry - I was not very precise. I cannot change existing ones name and description - only I can add new ones and unclear is - what will be new command name and description. I mean - how can I add new record with defined name and description and how to set it as default and how to see, what is current default. E.g. Nautilus has two records in list with same (Files) name but command is different: one is: nautilus --new-window %U second is: nautilus %U I would now change the name of these records, for example but it seems not possible. Yes - I can change the command but also there would be good option to restore default command. Also there could be opportunity to choose default command for user entered records.

Also unclear is - will my change of command (custom command) be stored permanently or will that change act just once as I currently run it.... There could be option to put checkmark "store permanently" for changed custom command - just an idea...

Probably it means (at least under Ubuntu), that when user would like to change system-wide program name and description - program will create .desktop file under ~/.local/share/applications/ folder, which is at higher level priority for current user than probably same program .desktop file under system-wide folder /usr/share/applications/ - this system-wide .desktop files will be replaced also when upgrading system - also in such cases might users like to use their own .desktop files to run certain apps with custom command parameters (e.g. firefox -private).

Also I noticed, that associations are located for Gnome at: system-wide: /usr/share/gnome/applications/defaults.list for current user: ~/.local/share/applications/defaults.list (this file usually does not exist but can be created) This information comes from http://askubuntu.com/questions/289337/how-can-i-change-file-association-globally

For other desktop environments these files might be located in different places - so it seems like Sunflower needs probably opportunity to choose desktop environment at first and then other settings will be chosen according that. Also desktop environment autodetection might be useful.

MeanEYE commented 10 years ago

At first I did manually parse those locations and look for applications. It was a really bad idea as it caused so many inconsistencies. Sunflower currently uses the same library Nautilus does so behavior is pretty much the same. Customizing commands permanently is a bad idea, especially system-wide. These application files are created by the application developer and they are part of the application package.

Changing association globally (per user) is possible from within Sunflower as well and works as expected. Do you know of some application that allows customizing commands when changing associated application?

edmundlaugasson commented 10 years ago

Ubuntu Tweak in Ubuntu I know and used since I use Ubuntu myself. Under "Admins" there is a such feature to manage filetype associations but commands itself are not possible to change. Usually I do it manually by creating own version of .desktop files into ~/.local/share/applications/ folder. As I said, system-wide icons are overwritten by system when upgrading these software packages but local folders will be untouched.

Similar way there are files with associations: system-wide: /usr/share/gnome/applications/defaults.list for current user: ~/.local/share/applications/defaults.list (this file usually does not exist but can be created). I have not experimented with associations - so I am not familiar with these changes when updating system.

This was an idea and enchancement to change associations by creating appropriate settings to current user with optional possibility to change global associations. But changing global commands in /usr/share/applications/ I would not propose as they will be overwritten anyway when updating software. But change associations globally might be needed when I configure operating system for all users, e.g. in public sector. Actually changing apps running commands might be also needed in such computers at public sector. E.g. to run web browser always in private mode to avoid remembering user credentials and filled forms. In such cases I create copy of application's .desktop file from /usr/share/applications/ to /etc/skel/.local/share/applications/ folder to ensure for new users to get my changes. This /etc/skel/ is default folder for newly created users and default for guest user. Also I usually use guest user for public sector computers as default and log that user in when computer starts to ensure all user changes will be deleted on next log in. In this way I can guarantee clean desktop for new users. I just thought, that Sunflower could be useful to manage such changes graphically but certainly I can do that by manually if you consider such features not to implement into Sunflower.

edmundlaugasson commented 10 years ago

Also "Browse" button would be appreciated. So I can browse the application. It could offer /usr/share/applications and ~/.local/share/applications/ folders but not limited with these folders that user can choose itself.

edmundlaugasson commented 10 years ago

In file properties window there is no choice to change default program and using "Open with..." dialog and choosing manually. I mean when opening properties window and choosing "Open with..." tab then I can only choose between current programs but no browse button and therefore I cannot change program from there. From "Preferences->Associations" I need to know MIME type but very often I do not know. Problems usually appear with unknown filetypes.

edmundlaugasson commented 10 years ago

Also strange is, that under Nautilus is file association but under Sunflower it does not work. Under Nautilus I could also see MIME type from file properties. Sunflower asked me mimetype... And I could not set up application as default... This concerns .mm fileformat. I installed FreeMind and FreePlane but no one are default. In Nautilus I could easily set FreePlane as default.

MeanEYE commented 10 years ago

2014-09-30-000005_410x410_scrot You don't have your applications listed here?

edmundlaugasson commented 10 years ago

Somehow I do not even I installed FreeMind and FreePlane through package manager from Getdeb repository under 64-bit Ubuntu 14.04.1 LTS. There might be an issue, that I need to log out and again in to see newly installed apps. I use laptop and sleep and log out or restart when it is really needed, e.g. after some serious software update or kernel upgrade. But in that "Open With" dialog tab I would see the browse button, where I can choose between already existing applications and also use custom command with custom name and description. Currently in another dialog is only possible to choose custom command but custom name and description is not possible. Also such custom command will not remain permanently and I cannot set it default. Seems like the current dialog on image is the place, where I can change default application permanently but I would also sometimes change these record names, description and commands - in such cases I guess there should be created .desktop file under ~/.local/share/applications/ folder to store user-specific shortcuts to run applications. Because user do not have write permission to system-wide folder /usr/share/applications/ and there will be .desktop files also overwritten when doing software updates. At least Ubuntu and Gnome will store its information in .desktop files and in mentioned folders.