UBUNTU使用快捷方式启动sh脚本问题
、
1、sudo gedit test1.sh
source /opt/ros/noetic/setup.bash
export ROS_HOSTNAME=localhost
export ROS_MASTER_URI=http://${ROS_HOSTNAME}:11311
roslaunch turtle_tf turtle_tf_demo.launch
top
2、pwd
/home/st/test1.h ‘’‘输出sh文件所在的文件夹’’’
3、cd /usr/share/applications:
sudo gedit testtt.desktop
4、add:
[Desktop Entry]
Encoding=UTF-8
Name=testros
Exec=bash /home/st/test1.sh
Icon=/home/st/2.png
Terminal=true
Type=Application
StartupNotify=true
5、sudo chmod a+x test1.desktop ‘’‘给该文件赋予权限’’’
6、把生成的图标拖到桌面上即可直接点击打开
————————————————