Nautilus and Thunar have a such context menu option under Properties/Permissions, but not PCManFM, Lubuntu's default file and desktop manager (at least not yet in the present v. 1.1.).
But under "Open with"/(again)"Open with"/"Custom command line", it is possible to add new custom commands.
This creates a file with extension .desktop
in ~/.local/share/applications
which can be edited further so as to get a proper name and icon.
What is the command to add in this way for making a file executable?
That is: how to use sudo chmod +x filename
to make it work in this way?
Best Answer
Considering the example from the answer - of using the "Open with" option:
The command
sudo chmod +x
must run in a terminal (gnome-terminal -e "sudo chmod +x %f"
) or alternatively the lineTerminal=true
should be in a desktop file in~/.local/share/applications/make_exec.desktop
:For an application to appear in the context menu, it may need a desktop file in
/usr/share/applications
, but also you may need to edit as administrator/usr/share/applications/mimeinfo.cache
and in the line of the intended file type to add the application.desktop.So, in the present case, open
/usr/share/applications/mimeinfo.cache
and addmake_exec.desktop
to the linetext/plain
.Considering the creation of custom actions - like in Thunar, Nautilus or Dolphin:
PCManFM supports custom actions.
Those created with Nautilus configuration tool (for Nautilus) appear in PCManFM too. These are .desktop files created in
~/.local/share/file-manager/actions
. So, they can be added manually without the Nautilus tool.The form of these files should be like those presented here or here.
So, for the present purpose, create the file
~/.local/share/file-manager/actions/make_executable.desktop
with these lines: