Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/logging/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Terminal 在Raspberry Pi上从我的桌面运行脚本时出现问题_Terminal_Raspberry Pi_Raspbian - Fatal编程技术网

Terminal 在Raspberry Pi上从我的桌面运行脚本时出现问题

Terminal 在Raspberry Pi上从我的桌面运行脚本时出现问题,terminal,raspberry-pi,raspbian,Terminal,Raspberry Pi,Raspbian,我有一个简单的脚本,我想从我的桌面上运行,使它更容易。我把它放在一个.desktop文件中,双击它会打开一个小窗口,上面写着“这个文本文件'alerter.desktop'似乎是一个可执行脚本。你想用它做什么?”选项是“执行”“在终端中执行”“打开”“取消”。单击任一执行选项时,终端闪烁一秒钟,然后消失。在终端中键入脚本时,脚本工作正常 文件内容: ... [Desktop Entry] Name=alerter Comment=Starts alerter

我有一个简单的脚本,我想从我的桌面上运行,使它更容易。我把它放在一个.desktop文件中,双击它会打开一个小窗口,上面写着“这个文本文件'alerter.desktop'似乎是一个可执行脚本。你想用它做什么?”选项是“执行”“在终端中执行”“打开”“取消”。单击任一执行选项时,终端闪烁一秒钟,然后消失。在终端中键入脚本时,脚本工作正常

文件内容:

    ...
    [Desktop Entry]
    Name=alerter
    Comment=Starts alerter
    Exec=lxterminal -e ./docker_run.bash -c ./config/discord-alerts.yaml -a discord -w 
    https://discordapp.com/api/webhooks/blahblahblah
    Terminal=true
    Type=Application
    Path=/home/pi/inventory-hunter
    ...

提前感谢您的帮助

尝试以以下方式包装exec命令:

sh -c "lxterminal -e ./docker_run.bash -c ./config/discord-alerts.yaml -a discord -w"

同时将终端设置为false。

它现在将终端打开到inventory hunter目录,但实际上不运行脚本。不过这是一个进步,所以谢谢你。