2

I am trying to add a custom item to the pantheon-files context menu. When you click on a menu item in a folder, the terminal should start and process several commands, and thumbnail files should be created in the same folder at the output. I have next code in /usr/share/contractor/thumbnail.contract :

[Contractor Entry]
Name=Создать миниатюры изображений [500px]
Description=Make thumbnails
Icon=terminal
MimeType=inode;application/x-sh;application/x-executable;
Exec=io.elementary.terminal for file in *.jpg; do convert -scale 500 $file tn_$file ; done
Gettext-Domain=io.elementary.terminal

Unfortunately it does not work( Sorry for my english.

2

Firstly, I would recommend putting custom contracts in ~/.local/share/contractor.

If you do not need terminal to open then this works:

[Contractor Entry]
Name=Создать миниатюры изображений [500px]
Description=Make thumbnails
Icon=terminal
MimeType=inode;application/x-sh;application/x-executable;
Exec=sh -c 'cd %U; for file in *.jpg; do convert -scale 500 $file tn_$file ; done;'
Gettext-Domain=sh

You can get terminal to open as well by appending io.elementary.terminal; to the shell command

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.