设置xdg-open打开某文件/目录的默认应用程序
你需要使用xdg-mime工具来获取filetype
xdg-mime query filetype path_to_file
然后你需要在/usr/share/applications中查找有没有你想打开的软件
ls /usr/share/applications | grep program_name
确认后,即可设置默认的打开程序
xdg-mime default program_name.desktop filetype
参考
xdg-mime Arch man
xdg-open Arch man
xdg-settings Arch man