Issue
Would like to get Discord to run on boot in full screen mode.
What I am using:
- Raspberry Pi 4 8gb
- Raspbian 10 Buster
- Pi Apps(current) distribution of
- Discord WebApp(current)
What I have tried:
- rc.local
- .bash
- init.d
Not sure if I am following the directions wrong, or because it is a desktop app rather than a .py?
For reference I have tried following these instructions inserting:
usr/shr/applications/electron-dsicord-webapp.desktop
where it lists sample.py
https://www.dexterindustries.com/howto/run-a-program-on-your-raspberry-pi-at-startup/
Anyway, is it possible to script it to run on boot; is it also possible to make it go auto full screen?
Thanks,
Solution
- Create the file
/home/pi/.config/lxsession/LXDE/autostart
and parent directories if not already there:
$ mkdir -p /home/pi/.config/lxsession/LXDE
$ touch /home/pi/.config/lxsession/LXDE/autostart
- Create a script:
$ sudo nano /bin/fullscreendiscord
and then add the following:
#!/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
- Add the script to the autostart file:
$ echo '@fullscreendiscord' >> /home/pi/.config/lxsession/LXDE/autostart
- Reboot to apply the changes
$ sudo reboot
NOTE:
I am expecting that you have Discord installed as a desktop application
If you want to run discord on Firefox, replace /bin/fullscreendiscord with
#!/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
Answered By - ThatOneLukas