Automatically starting Discord

Karl Auer kauer at biplane.com.au
Wed Oct 25 01:55:34 UTC 2023


A silly thing that might help someone else.

Discord, for several versions now, does not survive suspension.
Although Discord is autostarted when I log in, that doesn't help when
it dies after suspending.

No problem, I wrote a cron job that runs once every minute and starts
Discord if it's not running. This works fine.

Except - when run this way, Discord doesn't know about any mics or
cams. In the user settings in "Voice & Video" there are no devices at
all to choose from. So I get instant messaging OK, but to use voice or
the cam I need to stop Discord completely and start it again from
inside X.

So I moved my Discord-restarter into the autostart list, turning it
into a simple loop that runs forever, checking once per minute to see
if Discord is running, and starting it if it isn't. Because it is being
started from inside my X environment, Discord finds my mics and cams
just fine.

Now I barely notice that Discord dies when I unsuspend my computer.

Regards, K.

-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Karl Auer (kauer at biplane.com.au)
http://www.biplane.com.au/kauer






More information about the ubuntu-users mailing list