自定义Nemo动作未显示在右键菜单的问题排查求助
Let's walk through the most common issues that might be preventing your Nemo action from appearing in the right-click menu:
1. Incorrect File Location or Naming
Nemo only reads action files from specific directories, and they must have the .nemo_action file extension.
- Make sure your action file is saved in either:
~/.local/share/nemo/actions/(for your user account only)/usr/share/nemo/actions/(for all users on the system)
- Double-check the filename ends with
.nemo_action(e.g.,add-to-portamusic.nemo_action) — if it uses a different extension like.txt, Nemo will completely ignore it.
2. Missing Executable Permissions on Your Script
The script you're calling (/home/usrname/bin/add-to-portamusic.sh) needs to be marked as executable for Nemo to recognize and run it — this is a frequent hidden culprit for the action not showing up.
Run this command in your terminal to fix the permissions:
chmod +x /home/usrname/bin/add-to-portamusic.sh
Also, replace usrname in the path with your actual username (e.g., /home/jane/bin/add-to-portamusic.sh) — placeholder values will break the file path entirely.
3. Verify Nemo Action Configuration Syntax
Your config looks mostly correct, but let's double-check a few critical details:
Selection=NotNoneis properly set (it ensures the action appears when at least one file/folder is selected)EscapeSpaces=trueis good practice for handling filenames with spaces, so that's fineTerminal=truewill launch the script in a terminal window — while this doesn't prevent the action from showing, you can set it tofalseif you don't need visible output- Ensure there are no typos in
Active=true(capitalization matters here; lowercaseactivewon't work)
4. Restart Nemo to Load the New Action
Nemo caches action files on startup, so you need to restart it to pick up your new configuration. Run this command in the terminal:
nemo -q
Then open Nemo again and try right-clicking a file/folder. If that doesn't work, log out and log back in to fully refresh the desktop environment.
5. Test with a Simplified Script (Rule Out Script Issues)
To confirm the problem isn't with your transcoding script itself, create a simple test script first:
#!/bin/bash echo "Selected items: $@" > ~/nemo-test-log.txt exit 0
Save this as test-action.sh, make it executable, update your Nemo action's Exec line to point to this test script, restart Nemo, and check if the action appears. If it does, the issue lies in your original transcoding script, not the Nemo action configuration.
内容的提问来源于stack exchange,提问作者Omar and Lorraine

