Я создал скрипт Nautilus Action
для изменения кодировки файлов с помощью приложения recode
.
Мое действие:
[Desktop Entry]
Type=Action
ToolbarLabel[en_US]=Convert Encoding From Windows-12
ToolbarLabel[en]=Convert Encoding From Windows-12
ToolbarLabel[C]=Convert Encoding From Windows-12
Tooltip[en_US]=Converts file content encoding from Windows-1256 and saves as UTF-8
Tooltip[en]=Converts file content encoding from Windows-1256 and saves as UTF-8
Tooltip[C]=Converts file content encoding from Windows-1256 and saves as UTF-8
Name[en_US]=Convert Encoding From Windows-1256
Name[en]=Convert Encoding From Windows-1256
Name[C]=Convert Encoding From Windows-1256
Profiles=profile-zero;
[X-Action-Profile profile-zero]
SelectionCount==1
MimeTypes=all/allfiles;
Matchcase=false
Basenames=*.srt;
Exec=recode windows-1256 "%F"
Name[en_US]=Default profile
Name[en]=Default profile
Name[C]=Default profile
ExecutionMode=DisplayOutput
Некоторое время код работал правильно, но теперь он не работает!
Когда я устанавливаю ExecutionMode
действия в DisplayOutput
, он отображает это:
Run command:
/bin/sh -c 'recode windows-1256 "'\''/home/ariyan/a.srt'\''"'
Standard output:
Standard error:
recode: fopen ('/home/ariyan/a.srt'): No such file or directory
он не может найти файл, пока он там есть! (Когда я запускаю ту же команду в окне терминала, она работает)
В чем проблема?
Почему sh
не удается найти файл?
Спасибо
Проблема заключалась в кавычках в команде!
использование recode windows-1256 %F
вместо recode windows-1256 "%F"
решило проблему!