1

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,

cubick
  • 293
  • 3
  • 13
RhinoTekMN
  • 39
  • 2
  • 14

1 Answers1

2
  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
ThatOneLukas
  • 86
  • 1
  • 4
  • I am using the Pi-Apps distribution of Discord (Web App). After following you instruction (which make complete sense) it did not work. I believe this is due to some weird way in which Pi-Apps installs Discord, as I cannot find the actual install only .desktop files. – RhinoTekMN Mar 23 '21 at 20:25
  • Can you launch Discord with by running `discord` in a terminal? You could also try the Firefox version – ThatOneLukas Mar 24 '21 at 07:22
  • You can also try running `/usr/share/discord-linux-armv7l/discord` in a terminal. If this one works you can try replacing `discord &` with `/usr/share/discord-linux-armv7l/discord &` in /bin/fullscreendiscord – ThatOneLukas Mar 24 '21 at 07:28
  • You should also make sure you have the `xdotool` apt package installed if it does not go to fullscreen. – ThatOneLukas Mar 24 '21 at 07:31
  • So I have confirmed xdotool is installed. I also know that if I input exec electron-discord-webapp it will run, but if I put that before the & in the bash script I get nothing. Any ideas? If it helps the path for the app is /usr/share/application/electron-discord-webapp ( – RhinoTekMN Mar 24 '21 at 12:12
  • So you can run it with `/usr/share/application/electron-discord-webapp`? – ThatOneLukas Mar 24 '21 at 12:16
  • Can you comment the output of `command -v electron-discord-webapp` – ThatOneLukas Mar 24 '21 at 12:40
  • That outputs `/usr/bin/electron-discord-webapp` – RhinoTekMN Mar 24 '21 at 14:23
  • Haven't solved it yet but wanted to get you the rep reward – RhinoTekMN Mar 24 '21 at 15:34
  • Have you tried the Firefox script? You can replace `firefox` with `chromium` if you want – ThatOneLukas Mar 24 '21 at 16:00
  • This is directly C&P from my fullscreendiscord script `!/bin/bash # open Discord in the Background firefox https://discord.com/app & #find Discord and then execture fn+F11(fullscreen sleep 1 ; xdotool search --sync --onlyvisible --class "Firefox" windowkeyactivate Fn+F11` – RhinoTekMN Mar 24 '21 at 19:08
  • You shouldn't need the Fn "key" on there. After all it's just virtually sending keypresses to certain X clients – ThatOneLukas Mar 25 '21 at 16:07