[Moved to Github] Submenus for Nemo Actions?

Write suggestions and new ideas in here
More ideas here http://community.linuxmint.com/idea/welcome
Forum rules
  • Only post ideas here that are specifically about the Linux Mint distribution or its websites.
  • So that developers and users from any distribution can discuss ideas in one place, post ideas about improving software to the collaboration website for that software instead.
Post Reply
Level 2
Level 2
Posts: 52
Joined: Sat Aug 21, 2010 3:16 pm
Location: Istanbul

[Moved to Github] Submenus for Nemo Actions?

Post by sadi » Mon Jul 03, 2017 8:54 am

Coming from Nautilus, I loved Nemo Actions!
Even though there's a graphical tool for Nautilus Actions, I've found it much more simpler to create Nemo Actions.
It's also so nice to have all those actions and scripts listed in the Preferences (and individually enabled or disabled, etc.)

Now, one more step could bring us closer to perfection in this regard: submenus!
KDE's Dolphin has it, so why not Nemo as well ;-)
Last edited by sadi on Wed Jul 05, 2017 4:44 pm, edited 1 time in total.
OS: Linux Mint 19.2 Cinnamon 64-bit

User avatar
Level 24
Level 24
Posts: 24030
Joined: Wed Jul 06, 2011 3:58 am
Location: The Netherlands

Re: Submenus for Nemo Actions?

Post by xenopeek » Wed Jul 05, 2017 12:58 am

You can post feature requests to the Nemo developers here: https://github.com/linuxmint/nemo/issues

Level 23
Level 23
Posts: 17827
Joined: Sat Dec 06, 2014 7:34 am

Re: Submenus for Nemo Actions?

Post by Cosmo. » Wed Jul 05, 2017 6:29 am

Open nemo and press alt-p and you have the graphical option to enable / disable actions individually.

Level 2
Level 2
Posts: 52
Joined: Sat Aug 21, 2010 3:16 pm
Location: Istanbul

Re: Submenus for Nemo Actions?

Post by sadi » Wed Jul 05, 2017 2:50 pm

Thank you both!

As a second-time newcomer, I didn't know about LM github repositories; it's a great place for issues, ideas, etc. indeed!

As for Actions GUI, although the one inside Nemo has very limited functionality, I don't miss the Nautilus one really -- a good sample nemo.action does the job just fine (although something more like a tutorial/manual could be better).
OS: Linux Mint 19.2 Cinnamon 64-bit

Level 1
Level 1
Posts: 5
Joined: Thu Dec 28, 2017 10:14 am

Re: [Moved to Github] Submenus for Nemo Actions?

Post by ciniset » Fri Dec 29, 2017 9:19 am

hi. I'm new to linux mint/bash/aso but want 2 share a possible solution for those - like me - who need to have right click with nemo_action files organized by submenus. the idea is 2 simulate ur own menus on right click. is just a skeleton but is working and prove the idea.

0. apt install yad

Code: Select all

mkdir ~/.local/share/nemo/custom
2. create the file ~/.local/share/nemo/actions/Custom\ Nemo\ extender.nemo_action
3. put in that file :

Code: Select all

[Nemo Action]
Name=Custom Nemo extender
Comment=Launch custom nemo menu extender

Exec=/home/ciniset/.local/share/nemo/custom/nemoext main
4. create the file /home/ciniset/.local/share/nemo/custom/nemoext

Code: Select all

#! /bin/bash

read_menu_file() {
    unset file_name work_string menu line lenght_dim lines_dim histogram
    work_string="$(cat $file_name | cut -f 1 -d "+")"
    menu=$(cat $file_name | tr "+" " ")

    while read line; do
    done <<< "$work_string"

    for length in "${!histogram[@]}"; do
        lenght_dim=$(( ${length} * 10 ))
    lines_dim=$(( ${#histogram[@]} * 28 ))

if [ "$#" -ne 1 ]; then
    exit        # no menu file

pushd . > /dev/null
if ([ -h "${SCRIPT_PATH}" ]); then
  while([ -h "${SCRIPT_PATH}" ]); do cd `dirname "$SCRIPT_PATH"`; 
  SCRIPT_PATH=`readlink "${SCRIPT_PATH}"`; done
cd `dirname ${SCRIPT_PATH}` > /dev/null
popd  > /dev/null

menu_name=$(echo $SCRIPT_PATH"/"$1)
read_menu_file $menu_name

while true; do
    ANSWER=`yad --mouse --no-buttons --undecorated --skip-taskbar --width=$lenght_dim --height=$lines_dim --list --separator="+" --no-headers --column=Name --column=Type:HD --column=Function:HD  $menu`
    type=$(echo $ANSWER | cut -f 2 -d "+")
    case "$type" in
                submenu=$(echo $ANSWER | cut -f 1 -d "+")
                read_menu_file $SCRIPT_PATH/$submenu
                command=$(echo $ANSWER | cut -f 3 -d "+")
                $command &
5. create the file /home/ciniset/.local/share/nemo/custom/main

Code: Select all

and create the file /home/ciniset/.local/share/nemo/custom/Utils

Code: Select all

ur ready 4 test now :)

short explanation:
create nemo_action file who call a bash script from ~/.local/share/nemo/custom/ who read menu file/files from same folder.
link between menu files are made by name. inside files is <name>+<C(for command)/M(for submenu)>+<command/menu info>

2 cents thoughts: it would be very nice if the submenu feature will be implemented in the future, having already the structure for nemo_action/scripts and being (i believe) relatively easy to create extra folder(submenus) in .local/share/nemo/actions containing .nemo_action files.

I'm ashamed I didn't look also into scripting capability of nemo :oops:
Scripting is solving the whole problem.
Nemo IS great!

Post Reply

Return to “Suggestions & New Ideas”