SOLVED LM19-64-cinn Custom Nemo action not appearing on right-click menu

Questions about applications and software
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
User avatar
sadhu
Level 5
Level 5
Posts: 862
Joined: Fri Nov 22, 2013 9:48 am
Location: Sri Lanka
Contact:

SOLVED LM19-64-cinn Custom Nemo action not appearing on right-click menu

Post by sadhu »

I have a symbolic link for /home/sadhu/.config/nemo/ pointing to /ddr/shared_configuration/nemo

I created the following nemo action, which is saved as du.nemo_action in folder nemo/actions

Code: Select all

[Nemo Action]
Name=Disk Usage
Comment=Gives total disk usage for selected file(s)
Exec=/ddr/bin/mydu %U
Extensions=any
Selection=notnone
Quote=double
Active=true
The action does not appear, even after I have reloaded nemo.

The mydu script is simple, and it works: du -hc $1 | tail -n1 | xargs notify-send

I have created nemo actions before, but I've lost them and now I can't seem to get this one to work.


Thanks,
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
sabbe sattā bhavantu sukhitattā. LM 21.2-64 Cinn 5.8.4
User avatar
smurphos
Level 18
Level 18
Posts: 8498
Joined: Fri Sep 05, 2014 12:18 am
Location: Irish Brit in Portugal
Contact:

Re: LM19-64-cinn Custom Nemo action not appearing on right-click menu

Post by smurphos »

Can you clarify? Is the issue the action not appearing in the context issue when you have files / folders selected or the notification not appearing when you select the action?

I can't reproduce the first issue - the action appears in the context menu.

I'm not sure %U is the right parameter to pass though - %F works my end, along with using "$@" in the script so that multiple selections are actually supported. As %F passes multiple selections space delimited, $1 in the script will only ever pick up the first selection. $@ will collect all arguments.

Code: Select all

[Nemo Action]
Name=Disk Usage
Comment=Gives total disk usage for selected file(s)
Exec=<scripts/du.sh %F>
Extensions=any
Selection=notnone
Quote=double
Active=true

Code: Select all

#!/bin/bash
du -hc "$@" | tail -n1 | xargs notify-send
For custom Nemo actions, useful scripts for the Cinnamon desktop, and Cinnamox themes visit my Github pages.
User avatar
sadhu
Level 5
Level 5
Posts: 862
Joined: Fri Nov 22, 2013 9:48 am
Location: Sri Lanka
Contact:

Re: LM19-64-cinn Custom Nemo action not appearing on right-click menu

Post by sadhu »

Thanks for the tip re "$@"

This is the content of part of my .config/nemo/actions directory

Code: Select all

-rw-rw-r-- 1 sadhu sadhu  147 Oct  7 12:46  du.action
-rw-rw-r-- 1 sadhu sadhu  162 Oct  7 13:03  du.nemo_action
I didn't know which name (action or nemo_action) was proper, so both are included. I've tried naming the direcory nemo/action and nemo/actions but in both cases it still doesn't work.

I'll try in LM18.3 and see what happens. Works OK in L18.3-64-cin

Scratching my head....

Here's what the context menu looks like:
Screenshot from 2019-10-08 20-41-19.png
sabbe sattā bhavantu sukhitattā. LM 21.2-64 Cinn 5.8.4
User avatar
smurphos
Level 18
Level 18
Posts: 8498
Joined: Fri Sep 05, 2014 12:18 am
Location: Irish Brit in Portugal
Contact:

Re: LM19-64-cinn Custom Nemo action not appearing on right-click menu

Post by smurphos »

Doh - I should have read your first post properly instead of getting stuck into how the action worked - the actions folder should be

~/.local/share/nemo/actions not ~.config/nemo/actions

The correct extension for the action file is *.nemo_action

As an aside I maintain a small github repo of useful actions - do you mind if I add your action or a variation of it to that repo?

https://github.com/smurphos/nemo_action ... on_scripts
For custom Nemo actions, useful scripts for the Cinnamon desktop, and Cinnamox themes visit my Github pages.
User avatar
sadhu
Level 5
Level 5
Posts: 862
Joined: Fri Nov 22, 2013 9:48 am
Location: Sri Lanka
Contact:

Re: LM19-64-cinn Custom Nemo action not appearing on right-click menu

Post by sadhu »

Thanks Smurphos!

What a compliment -- that you wish to add my action to your repo! If you could send me a copy of your version I'd be grateful. Or else a link to it.

Duh is right! The nemo_sample_actions file should really specify this. But there were probably some sites that mentioned it, but missed by skim-reading.

I no longer read anything thoroughly... :( See https://www.theatlantic.com/magazine/ar ... id/306868/


Be Well and Happy
-Sadhu
sabbe sattā bhavantu sukhitattā. LM 21.2-64 Cinn 5.8.4
User avatar
smurphos
Level 18
Level 18
Posts: 8498
Joined: Fri Sep 05, 2014 12:18 am
Location: Irish Brit in Portugal
Contact:

Re: LM19-64-cinn Custom Nemo action not appearing on right-click menu

Post by smurphos »

sadhu wrote: Wed Oct 09, 2019 2:25 am Thanks Smurphos!

What a compliment -- that you wish to add my action to your repo! If you could send me a copy of your version I'd be grateful. Or else a link to it.
Here is it. I went with a zenity window with a list of the selection rather than a notification and have added link support...

https://github.com/smurphos/nemo_action ... age-action

Image
For custom Nemo actions, useful scripts for the Cinnamon desktop, and Cinnamox themes visit my Github pages.
Locked

Return to “Software & Applications”