raspberry-pidiscordraspbian-buster

Set Discord Web App to run at boot in Raspbian 10 Buster


Would like to get Discord to run on boot in full screen mode.

What I am using:

What I have tried:

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

    1. 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
    
    1. 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
    
    1. Add the script to the autostart file:
    $ echo '@fullscreendiscord' >> /home/pi/.config/lxsession/LXDE/autostart
    
    1. 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