Home
Categories
WIKI
Topic
User
LANGUAGE:
中文
English
发现文件管理器的一个 bug,不能用自定义程序打开文件
社区开发
572
views ·
4
replies ·
To
floor
Go
梦幻大陆
deepin
2019-07-02 03:02
Author
我自己编了一个 markdown 文件阅读器 mdview,只要用命令 “mdview ”就可以打开 markdown 文件,但是在文件管理器中右键点击 markdown 文件,点击“打开方式”->“选择默认程序”,把这个程序设置成默认打开程序后,还是不能用双击或者用右键点击选择打开方式的办法用这个程序打开 markdown 文件。
Reply
Like 0
Favorite
View the author
All Replies
走钢丝
deepin
2019-07-02 03:20
#1
需要编写 desktop 文件,你可以在 /usr/share/applications 中找一个打开看看怎么编写,比如编辑器。
Reply
Like 0
View the author
funtoo
deepin
2019-07-02 03:36
#2
先用
$ xdg-mime query default text/markdown
Copy the Code
查询下这个程序是否和markdown文件的mime关联起来了,再用
$ xdg-open foo.md
Copy the Code
看看是否能够正确调用关联的应用打开。
不行的话就得自己编写个.desktop再用
$ xdg-mime default foo.desktop text/markdown
Copy the Code
关联起来。
Reply
Like 0
View the author
st******ra@outlook.com
deepin
2019-07-02 03:39
#3
好像确实有类似的情况。
要不,再试试重新设置一遍默认的打开程序,看有没有效果。 还是不行的话,注销一次,再重新试试呢?
另外,设置这个默认的打开程序 mdview 的时候,选中的确实是这个程序的 可执行文件 吧?
Reply
Like 0
View the author
梦幻大陆
deepin
2019-07-02 22:58
#4
你可以直接测试一下我的程序吗?
源代码:
https://gitee.com/rocket049/golang_test/tree/master/dev/mdview
附件有打包好的可执行程序
Reply
Like 0
View the author
Please
sign
in first
Featured Collection
Change
[Tutorial] deepin25 WSL Offline Installation Guide
UOS AI 2.8 Released! Three New Intelligent Agents & Major Evolution
Solid Q&A | deepin 25 Common Questions – The Immutable System Edition
New Thread
Popular Ranking
Change
Linyaps "YTDownloader" uninstall not possible app.netlify.ytdn
Popular Events
More