AMAZING FILE MANAGER OPTIONS

The possibility of adding options to the contextual menu of the file manager, becomes the joy of many users who will be able to customize the system even more and according to their tastes, congratulations Deepin.

Several members of the community have shown their creativity, adding commonly used options such as open as administrator, permanently delete, scan for viruses, convert formats, open specific directories and much more.

Then we give you the collection of functions of @Alvaro Samudio and part of the work of @ Isaías Gätjens for you to test them on your system, download them from the following buttons:

Without a doubt, a new level of customization and functionality possibilities are put at our disposal to create the most creative extensions that we can think of.

OPERATION OF EXTENSIONS

The file manager has by default some extensions to compress and decompress files that we can take as a reference to understand how they work. The path where the menu extensions are saved is:

/usr/share/deepin/dde-file-manager/oem-menuextensions/

The code of an extension looks like the launcher of an application, although it possibly has more or less parameters depending on what we want to achieve, always with "Exec" and "Name" as these are mandatory parameters. Being the base structure for the extension the one shown below:

[Desktop Entry] 
Type=Application

Exec= < Ruta de lo que vamos a ejecutar

Name= < Nombre que tendrá en el menú

Icon= < Parámetro opcional que agrega un ícono que 
        precede al texto que muestra la opción del menú

MimeType= < Tipos de archivo filtrado, si se coloca «*», 
            serían todos. La lista de ellos está en 
            la ruta: /usr/share/dde-file-manager

Actions= < Añade acciones como submenús

X-DFM-MenuTypes= < Lugar donde tendrá efecto

X-DFM-SupportSchemes=

X-DFM-SupportSuffix=

X-DFM-ExcludeMimeTypes= < Define los formatos ignorados

To add several options as a submenu, it is necessary to add the parameter “Actions”, followed by the action. The names of the actions must end in «Action», for example, a good name would be «StopAction», the actions are separated by commas (,) when they are several and the last one ends in a semicolon (;).

[Desktop Action «Acción»] 
Exec= < Ruta de lo que vamos a ejecutar

Name= < Nombre que tendrá en el menú
[Desktop Entry]
Name=Compartir por HTTP
Type=Application
X-DFM-MenuTypes=EmptyArea;
Actions=IniciarAction;DetenerAction;

[Desktop Action IniciarAction]
Icon=stock_media-play
Name=Iniciar
Exec=httpshare %U

[Desktop Action DetenerAction]
Icon=player_stop
Name=Detener
Exec=killall httpshare

The actions referred to in the parameter «Actions», will require the creation of the action, we can achieve this by repeating the base code of the «.desktop» just below, leaving a line of space between the two, the name of the action will have to be added inside the square brackets of the 2nd «[Desktop Entry]», in the case of our example, it would be «[Desktop Entry DetenerAction]».

[Desktop Entry]
Type=Application
Name=Anonym
Actions=StartAction;StopAction;ChangeIDAction;ChangeDNSAction;
X-DFM-MenuTypes=EmptyArea;

[Desktop Action StartAction]
Icon=stock_media-play
Name=Start
Exec=pkexec --disable-internal-agent anonsurf start

[Desktop Action StopAction]
Icon=player_stop
Name=Stop
Exec=pkexec --disable-internal-agent anonsurf stop

[Desktop Action ChangeIDAction]
Icon=reload
Name=Change ID
Exec=pkexec --disable-internal-agent anonsurf changeid

[Desktop Action ChangeDNSAction]
Icon=network-server
Name=OpenNIC DNS
Exec=pkexec --disable-internal-agent anonsurf dns

CREATE YOUR OWN EXTENSION

Creating an option for the context menu that allows us to share files on the local network using HTTP is easy. We will start by adding the required parameters in the text editor. In «Exec» we will place the instruction that we would use in the terminal to achieve our objective, or we could, on the other hand, make a script or program and add it in the path «/ usr / bin», in our case for convenience, we opted for the last one option.

The script we have added to "/ usr / bin" is as follows:

#!/bin/bash

DIRECTIP=$(hostname -I | awk '{print $1}')

notify-send -i network 'Compartir por HTTP' "La direccion es: http://$DIRECTIP:8000/"

cd $1

python -m SimpleHTTPServer

We proceed to develop the content of our ".desktop" file:

[Desktop Entry]
Exec=httpshare %U <- Nuestro script

MimeType=* <- Afectará todos los archivos

Name=Compartir por HTTP <- El nombre que saldrá en el gestor de archivos y el escritorio

Type=Application

X-DFM-MenuTypes=EmptyArea; <- Solo se mostrará en el área vacía del gestor de archivos

X-DFM-SupportSchemes=file

X-Deepin-Vendor=user-custom

Once the text file is finished, we must save it by giving it a name to personal liking followed by the extension ".desktop", in our case we have chosen "httpshare.desktop", the path where the file is saved is the one previously specified:

/usr/share/deepin/dde-file-manager/oem-menuextensions/

It only remains to open the file manager again to see our new extension. Do you dare to try it and share your creation with the community?

References: 1, 2, 3



4.9 19 votes
Rate the Article
 
Subscribe
Report of
19 Reviews
More popular
Newer Older
Opinion from the article
See all comments
Aridany Ypunto
Aridany Ypunto (@aridanyypunto)
17 días atrás

Very interesting, I miss certain functions in the context menu but a question: is this only valid for deepin 20 or can it also be used in the current stable version? Thank you

SweetKidder
SweetKidder (@sweetkidder)
Answering to Aridany Ypunto
16 days ago

Aridany Ypunto I would like to know if it can be used in the 15-11.

ErnestoRyes
ErnestoRyes (@ernestoryes)
Answering to Aridany Ypunto
16 days ago

No, it cannot be installed in deepin 15, it gives dependencies error.

Eduardo X
Eduardo X (@eduardx)
16 days ago

Hi, I have been reading your site for a long time but I decided to join to thank you for the great contributions you provide to the deepin community, thanks for the extensions, formidable work.

Isaías Gätjens M
Isaías Gätjens M (@igatjens)
Publisher
17 días atrás

Very good article, many are unaware that the file manager can be added more functions relatively easily.

This design is intended for the community to expand and customize the functions of the file manager.

I think it is worth clarifying that in this article the main characteristics are shown, but in the Deepin documentation on GitHub (see article references), the rest of the characteristics can be consulted.

Эли
Эли (@eli)
Admin
17 días atrás

Excellent functionalities jhalo, Thanks for the post. Especially to the creators of the extensions thanks for sharing.

Car
Car (@car)
17 días atrás

Congratulations to the Latin Code team for these extensions that facilitate and enhance the daily task. ;))

Armando-Lio
Armando-Lio (@armando-lio)
17 días atrás

Fantastic, these options come in handy.

Vicente Blanco Amador
Vicente Blanco Amador (@vicente544blanco)
17 días atrás

Uff people, well, this is useful, good work they are doing in this community.

André Bezerra
André Bezerra (@andrebezerra)
2 days ago

Very good article! I tried to make an extension in my deepin and it worked perfectly! Thanks for sharing!

Frank Alvarez
Frank Alvarez (@franky08)
16 days ago

Excellent options, thank you very much.

Arceli
Arceli (@arceli)
15 days ago

Thank you for sharing with us.

Alberto Jiménez
Alberto Jiménez (@alberto2003)
13 days ago

I would like to add an option to "Print Document" when clicking on a text or photo document etc. otherwise those options are super!

Isaías Gätjens M
Isaías Gätjens M (@igatjens)
Publisher
Answering to Alberto Jiménez
13 days ago

Alberto Jiménez

It is a good idea.

TonyRevuelta
TonyRevuelta (@tonyrevuelta)
12 days ago

Useful these options, thank you very much.

Mauricio
Mauricio (@mauricio)
10 days ago

… And how to send a file by mail, that is: «send to mail recipient«?

Rigo Hernandez
Rigo Hernandez (@rigohernandez96)
Answering to Mauricio
9 days ago

Mauricio I think it can be created by generating a call to mailto: which opens the default mail program or the browser in some cases.

Martin Valladares
Martin Valladares (@mvalladares2006)
5 days ago

Fabulous options, I would like you to create two: 1 One that when you click on a document gives you the option to "Copy to" and 2 an option to "move to" both to allow you to move or copy documents to other folders or places inside of the system. In Windows 10 I had those options and I miss them.

Yarecco Jr.
Yarecco Jr. (@yareccojr)
3 days ago

After latest update something is broken with "open with" as root… it freezes file manager adn drains cpu.
shame

19
0
We would like to know what you think, Join the discussion.x
()
x