
Я создал 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
не может найти файл?
Спасибо
решение1
Проблема была в кавычках в команде!
использование recode windows-1256 %F
вместо recode windows-1256 "%F"
решило проблему!