在Mint Linux中的“开始”-》“控制面板”-》“系统设置面板”菜单,打开的系统设置界面中,单击“键盘”,打开键盘配置界面,单击“键盘快捷键”标签页,单击“自定义快捷键”打开添加快捷键的对话框,选择带有中文路径的执行文件,如:当前用户目录下的 下载/runwps.sh 在进行选定了后,结果在“指令”栏中显示的为/home/user/%E4%B8%8B%E8%BD%BD/runwps.sh, 其中是由于中文的 下载 二字被 以UTF8的编码形式进行了显示,%E4%B8%8B%E8%BD%BD,通过查看此部分的源代码,找到了问题所在,修改如下:
def onFilePicked(self, widget):
//not support chinese in filepath.
#path = self.file_picker.get_uri()[7:]
//support chinese in filepath
path = self.file_picker.get_filename()
self.command_entry.set_text(path)
以上代码中,//not support chinese in filepath. #path = self.file_picker.get_uri()[7:] 是不支持中文的,因为是以URI的形式进行获取的;
//support chinese in filepath
path = self.file_picker.get_filename()
此段代码是能够支持中文路径的,至此,问题就解决了;再次运行就不再有这个问题了。
Federa 15 Gnome3下使用自定义快捷键:http://www.linuxdiyf.com/linux/5773.html
Fedora 16下Gnome 3.2自定义快捷键:http://www.linuxdiyf.com/linux/5016.html