/home/pi/.config/lxsession/LXDE/autostart
如果还没有,请创建文件和父目录:
$ mkdir -p /home/pi/.config/lxsession/LXDE
$ touch /home/pi/.config/lxsession/LXDE/autostart
- 创建一个脚本:
$ sudo nano /bin/fullscreendiscord
然后添加以下内容:
#!/bin/bash
# open Discord in the background
discord &
# find Discord and then execute ctrl+shift+F (fullscreen on Discord)
sleep 6 ; xdotool search --sync --onlyvisible --class "Discord" windowactivate key ctrl+shift+F
- 将脚本添加到自动启动文件:
$ echo '@fullscreendiscord' >> /home/pi/.config/lxsession/LXDE/autostart
- 重新启动以应用更改
$ sudo reboot
笔记:
我希望您将 Discord 作为桌面应用程序安装
如果你想在 Firefox 上运行 discord,请将 /bin/fullscreendiscord 替换为
#!/bin/bash
# open Firefox with Discord open in the background
firefox https://discord.com/app &
# find Firefox and then execute F11
sleep 1 ; xdotool search --sync --onlyvisible --class "Firefox" windowactivate key F11