ubuntu下编写shell脚本并在桌面上设置快捷方式

版权声明:转载请附此链接 https://blog.csdn.net/qq_42393859/article/details/86144526

1、sudo gedit realsense.sh
#! /bin/bash
realsense-viewer

2、pwd
/home/suns/Workspace/zz/   '''输出sh文件所在的文件夹'''

3、go to  /usr/share/applications:
sudo gedit realsense.desktop

4、add:
[Desktop Entry]
Encoding=UTF-8
Name=realsense
Type=Application
Icon=cheese        '''图标可自选,换对应的路径即可'''
Categories=Application;
StartupNotify=true
Terminal=false
Exec=sh /home/suns/Workspace/zz/realsense.sh  '''sh 后跟 要执行sh文件的绝对路径即可'''

5、sudo chmod a+x realsense.desktop  '''给该文件赋予权限'''

6、把生成的图标拖到桌面上即可直接点击打开

猜你喜欢

转载自blog.csdn.net/qq_42393859/article/details/86144526