this post was submitted on 24 Dec 2024
322 points (96.3% liked)

Programmer Humor

19865 readers
30 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 2 years ago
MODERATORS
322
submitted 1 week ago* (last edited 1 week ago) by [email protected] to c/programmer_humor
 
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 128 points 1 week ago (9 children)

I've found out the hard way: Running the script during startup, and running it using the proper user authorization, are two different things.

[–] [email protected] 79 points 1 week ago (2 children)

And environment


DISPLAY and PATH in particular.

[–] [email protected] 48 points 1 week ago

You’re right and I’m dumb. I forgot to absolute-ify one of the paths, which caused the script to be dependent on my user environment, which isn’t loaded by the desktop file.

[–] [email protected] 28 points 1 week ago (1 children)

Knowing that the environment is finicky, I made sure to only use absolute paths to all files and executables.

But thanks for the hint.

[–] [email protected] 9 points 1 week ago (1 children)

What are you using as a Desktop Environment? Certain with DEs the Autostart programs need to be added in the config file.

[–] [email protected] 8 points 1 week ago (1 children)
[–] [email protected] 6 points 1 week ago* (last edited 1 week ago) (1 children)

According to the Arch Wiki you need to place the .desktop file in:

~/.config/autostart/*****.desktop

You also need to add the following line to the .desktop file:

X-GNOME-Autostart-enabled=true

But that's probably the hard way to do it, I think the settings panel should also have a Startup Application tab.

[–] [email protected] 5 points 1 week ago (1 children)

Thanks for looking that up. That’s where my desktop file is located. And it has the X-GNOME-Autostart-enabled=true line. The settings panel does have a Startup Application tab, and that’s what I used. It created the .desktop file in the appropriate location.

[–] [email protected] 5 points 1 week ago (1 children)

surprised_pikachu_face.jpeg

Check your journald and/or make your script log it's actions.

Script > ~/script.log
[–] [email protected] 11 points 1 week ago

Thank for your help. Upon looking at it again I noticed the one filepath that relied on my profile being loaded. Corrected that. Works now.

Trés stupide

load more comments (6 replies)