Home
Categories
WIKI
Topic
User
LANGUAGE:
中文
English
小技巧,在终端打开图形界面程序,不影响当前终端使用
Apps Section
928
views ·
0
replies ·
To
floor
Go
junmoxiao
deepin
2018-02-22 22:30
Author
很多图形程序,比如gedit sublime2
如果在终端打开一个文档的话,当前终端就会用于gui程序输出调试信息,无法使用,而且还不能关,
大家一般都是在后面加&
比如gedit 1.c &,如果还要去除调试信息,还要输入
gedit 1.c >/dev/null 2>/dev/null &
很麻烦,
现在教大家一种方法,可以像sublime3 code这些软件一样,在终端打开gui程序但是不影响当前终端的使用
我们在/usr/local/bin下创建程序的同名文件
sudo gedit /usr/local/bin/gedit
#!/usr/bin/python
import os
import sys
if len(sys.argv) == 1:
os.system('/usr/bin/gedit >/dev/null 2>/dev/null &')
else:
os.system('/usr/bin/gedit ' + sys.argv[1] + ' >/dev/null 2>/dev/null &')
Copy the Code
然后sudo chmod +x /usr/local/bin/gedit
其他软件类似
Reply
Like 0
Favorite
View the author
All Replies
No replies yet
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
How to fix grub boot menu that has disappeared?
Looking Deepin ci 25.2.0 Developer/Unstable repositories
Popular Events
More
如果在终端打开一个文档的话,当前终端就会用于gui程序输出调试信息,无法使用,而且还不能关,
大家一般都是在后面加&
比如gedit 1.c &,如果还要去除调试信息,还要输入
gedit 1.c >/dev/null 2>/dev/null &
很麻烦,
现在教大家一种方法,可以像sublime3 code这些软件一样,在终端打开gui程序但是不影响当前终端的使用
我们在/usr/local/bin下创建程序的同名文件
sudo gedit /usr/local/bin/gedit
其他软件类似