Python script to convert Nemo actions to json configuration entry for the great Actions For Nautilus project
Considering this simple Nemo action:
[Nemo Action]
Name=Copy filename
Exec="echo -n %f | xclip -f -selection primary | xclip -selection clipboard"
Icon=system-run
Selection=notnone
Extensions=any
Executing action-converter.py test.nemo_action
will output:
{
"type": "command",
"label": "Copy filename",
"command_line": "echo -n %f | xclip -f -selection primary | xclip -selection clipboard",
"use_shell": true,
"file_extensions": [
"any"
]
},
-> to display result and to it to clipboard, you may use the provided convert.sh
command:
./convert.sh my-action.nemo_action
- json is displayed
- json is copied to clipboard