this post was submitted on 24 Dec 2024
156 points (100.0% liked)

Programmer Humor

420 readers
32 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
 
top 14 comments
sorted by: hot top controversial new old
[–] 01189998819991197253@infosec.pub 67 points 3 weeks ago (1 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.

[–] qjkxbmwvz@startrek.website 37 points 3 weeks ago (2 children)

And environment


DISPLAY and PATH in particular.

[–] bleistift2@sopuli.xyz 20 points 3 weeks 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.

[–] bleistift2@sopuli.xyz 15 points 3 weeks ago

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

But thanks for the hint.

[–] SnotFlickerman@lemmy.blahaj.zone 26 points 3 weeks ago* (last edited 3 weeks ago) (3 children)

When all else fails...

crontab -e

@reboot sleep 300 && sudo ./myshell.sh

(this is actually broken on some distros)

[–] Scoopta@programming.dev 16 points 3 weeks ago (1 children)

I've been in the systemd world so long none of my systems even have cron

[–] GravitySpoiled@lemmy.ml 19 points 3 weeks ago (1 children)

That sounds like a sad world. I like cron

[–] Scoopta@programming.dev 2 points 3 weeks ago

LOL, I actually like systemd timers, cron seems easier to setup quickly but I do like some of the features of timers combined with services.

[–] bleistift2@sopuli.xyz 3 points 3 weeks ago (1 children)
[–] SnotFlickerman@lemmy.blahaj.zone 13 points 3 weeks ago* (last edited 3 weeks ago)

Just to make sure it pops off after fully starting up. I run a lot of old hardware, so it's useful for me. You may not need a delay.

[–] bleistift2@sopuli.xyz 3 points 3 weeks ago

Thanks. man 5 crontab says the @reboot syntax is supported, so I’ll give that a try if I don’t stumble upon a different solution.

[–] boredsquirrel@slrpnk.net 11 points 3 weeks ago (1 children)

Never heard of a .application file

Normally you need a .desktop file

[–] bleistift2@sopuli.xyz 12 points 3 weeks ago* (last edited 3 weeks ago)

Indeed, I made this meme from memory and got the extension wrong.

I corrected the meme. Thanks for pointing out the error

[–] majiks@lemm.ee 2 points 3 weeks ago

gnome-terminal -- sh -c "my_command" This will open that command in new terminal window at login