Skip to content

Run commands on startup

Hi, I'm wondering if someone can help me understand a problem I'm having? I run Arch with Cinnamon as my DE. I have a couple of commands I run at startup (feh, setxkbmap for my compose key) which I'd like to be able to run automatically. I've tried including them in my .xinitrc after the exec cinnamon-session command (because it doesn't make logical sense to set the background before cinnamon is running, and I have had problems trying it in the past lol) and that doesn't work, because as I understand it, exec cinnamon-session is continuously running. Following that, I've also tried following the instructions on the Arch wiki and here to create an Autostart file, which hasn't worked either. It seems like there's no way to do this in Cinnamon, then, and I'll have to keep running the commands myself - but I don't know any other Arch+Cinnamon users and I'd love for some help confirming my suspicions! Thank you!

2 points6 comments
Open on Reddit
About this post
Posted
Archived
Score
2 · 75% up
Kind
Text
ID
hlxtew

Author

4
posts
4
comments
0
media
View profile

6 comments

It doesn't make sense to put it after an exec because then it will never get run.

Feh doesn't set the background in a DE/WM, it sets the background of the X display, which is why it works even if you run it before the DE/WM.

4 points

I seem to remember that somewhere in the menu of Cinnamon there is Startup applications or similar through which you can launch an application or a custom command.

1 points

Okay this is wicked, definitely playing around with it, I think it's exactly what I want. Thanks so much!

1 points

autostart should work (haven't used it myself, but articles about cinnamon covers them). IIRC there is also a startup applications part in the cinnamon settings that might be useful to you.

If putting your commands before the exec line in the .xinitrc just doesn't work, there is also the super hacky option of spawning a subshell with a delay in the .xinitrc. I'm not recommending this avenue, but it's a silly option

(sleep 1; firstthing & secondthing & thirdthing & ...)
1 points

Have u installed xorg-init? create a .xprofile in ~/ and put these in it. Could work.

1 points

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.