Skip to content

Instantly share code, notes, and snippets.

@brccabral
Last active September 17, 2025 23:13
Show Gist options
  • Select an option

  • Save brccabral/0d4b9f6e4d8132e4cb5fa6a3308e0076 to your computer and use it in GitHub Desktop.

Select an option

Save brccabral/0d4b9f6e4d8132e4cb5fa6a3308e0076 to your computer and use it in GitHub Desktop.
Nemo actions

Nemo actions

Nemo is a free and open-source software and official file manager of the Cinnamon desktop environment. It is a fork of GNOME Files (formerly named Nautilus).

Nautilus is default in GNOME desktop, but although I use Ubuntu, which has GNOME as default, I don't like Nautilus.

Nemo has some features that works best for me, thus I decided to install Nemo on my Ubuntu GNOME.

  • Copy current path from the top bar
  • Right click option to open current folder as root (good to copy files to protected locations)
  • Create custom actions. This is the focus for this gist.

Install Nemo

sudo apt install nemo

Make Nemo default file manager

xdg-mime default nemo.desktop inode/directory application/x-gnome-saved-search

Hide GNOME desktop icons

gsettings set org.gnome.desktop.background show-desktop-icons false

Show Nemo desktop icons

It is marked as deprecated

gsettings set org.nemo.desktop show-desktop-icons true

Increase thumbnail limit to 100MB

gsettings set org.nemo.preferences thumbnail-limit 104857600

Add Nemo-desktop to your autostart

Grab the file below, nemo-desktop.desktop, and copy it to your autostart folder ~/.config/autostart/nemo-desktop.desktop, or execute this to create and save the file

mkdir ~/.config/autostart
touch ~/.config/autostart/nemo-desktop.desktop
cat <<EOF > ~/.config/autostart/nemo-desktop.desktop
[Desktop Entry]
Type=Application
Exec=nemo-desktop
Hidden=false
NoDisplay=false
X-GNOME-Autostart-enabled=true
Name[en_US]=nemo-desktop
Name=nemo-desktop
Comment[en_US]=Nemo Desktop icons
Comment=Nemo Desktop icons
EOF

To go back to nautilus

xdg-mime default nautilus.desktop inode/directory application/x-gnome-saved-search
rm ~/.config/autostart/nemo-desktop.desktop
gsettings set org.gnome.desktop.background show-desktop-icons true
gsettings set org.nemo.desktop show-desktop-icons false
sudo apt purge nemo nemo*
sudo apt autoremove

Nemo Actions

This is a great feature. We can create a configuration file that adds your own commands to the Nemo context menu, the list that opens when you right click in Nemo.
The sample file at /usr/share/nemo/actions/sample.nemo_action has details on what options can be used for each config.
We can setup actions for when you click on a blank space in the folder, when we click on a file, and we can filter specifc extensions or formats, if we have more than X number of files selected. More options in the Nemo documentation.
Currently I am using actions only for blank spaces in a folder.

  • git init %F - Initiates a git repository in current folder without command line or other tools
  • code %F - Open current folder in VSCode
  • git-cola cola -r %F - Open current folder in Git-Cola, an application for Git GUI
  • python3 -m venv %F/.venv - Create a Python virtual environment in current folder

Copy *.nemo_action files to actions folder

The Nemo actions folder is located at ~/.local/share/nemo/actions. Just copy files below to this location

[Nemo Action]
Name=Cmake Build Debug
Comment=Run cmake with debug config
Exec=cmake_build_debug.sh "%P"
Selection=s
Extensions=txt;
Dependencies=cmake
Terminal=true
[Nemo Action]
Name=Compile Atari ASM
Comment=Compile Atari ASM
Quote=double
Exec=compile_atari.sh %P "%e"
Selection=s
Extensions=asm;
Dependencies=dasm
Terminal=false
[Nemo Action]
Active=true
Name=Create Python .venv
Comment=Create a Python virtual environment in this folder
Exec=python3 -m venv "%F/.venv"
Selection=none
Extensions=dir;
Icon-Name=python3
Dependencies=python3;
[Nemo Action]
Active=true
Name=Git Init
Comment=Initiate a Git Repository
Exec=git init "%F"
Selection=none
Extensions=dir;
Icon-Name=git-cola
Dependencies=git;
[Nemo Action]
Name=Make Executable
Comment=Make a file executable (chmod +x)
Exec=chmod +x "%F"
Selection=s
Extensions=none;sh;desktop;
Dependencies=chmod
Terminal=false
[Desktop Entry]
Type=Application
Exec=nemo-desktop
Hidden=false
NoDisplay=false
X-GNOME-Autostart-enabled=true
Name[en_US]=nemo-desktop
Name=nemo-desktop
Comment[en_US]=Nemo Desktop icons
Comment=Nemo Desktop icons
[Nemo Action]
Active=true
Name=Open Git-Cola
Comment=Open Git-Cola in this folder
Exec=/bin/bash -c 'QT_QPA_PLATFORMTHEME=qt5ct git-cola cola -r "%F"'
Selection=none
Extensions=dir;
Icon-Name=git-cola
Dependencies=git-cola;
[Nemo Action]
Active=true
Name=Open Kate
Comment=Open Kate in this folder
Exec=kate "%P"
Selection=none
Extensions=dir;
Icon-Name=kate
Dependencies=kate;
[Nemo Action]
Active=true
Name=Open VSCode
Comment=Open VSCode in this folder
Exec=code ""%P""
Selection=none
Extensions=dir;
Icon-Name=com.visualstudio.code
Dependencies=code;
[Nemo Action]
Active=true
Name=Open VSCodium
Comment=Open VSCodium in this folder
Exec=codium "%P"
Selection=none
Extensions=dir;
Icon-Name=/usr/share/codium/resources/app/resources/linux/code.png
Dependencies=codium;
[Nemo Action]
Active=true
Name=Tar Extraction
Comment=Extract tar files
Exec=tar -xf "%F" --directory "%P"
Selection=s
Extensions=gz;tar;
Icon-Name=package-x-generic
Dependencies=tar;
[Nemo Action]
Active=true
Name=Zip Extraction
Comment=Extract zip files
Exec=bash -c 'mkdir -p "%P/%e" & unzip "%F" -d "%P/%e"'
Selection=s
Extensions=zip;
Icon-Name=package-x-generic
Dependencies=unzip;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment