Is there a way to autostart with scripts in xinitrc like /paths/to/scripts because i try to do that but it doesn't work.
https://wiki.archlinux.org/title/Xinit#xinitrc
Maybe post your whole xinitrc and explain more clearly what you're trying to do and how it isn't working.
There are many common mistakes, usually stemming from not understanding how xinitrc works (see "man startx"), but there can also be something more tricky going on. Can't tell with the information provided.
heres the xinitrc config i want to set ~/.local/bin/systemalert &
it doesnt work i try so many ways like sh ~/.local/bin/systemalert & or bash ~/.local/bin/systemalert &
Shouldnt that file be .xinitrc (note the period)
And, I have to ask, is the script being called, set with +x ?
My xinitrc is in ~/.config/x11/xinitrc
and yes my scripts set +x
~/.xinitrc
The way i start startx is alias sx='startx /home/supercore/.config/x11/xinitrc'
For shits and giggles, to run your script, use the complete path and not the ~
I put the full paths in xintitrc you can see the pictures it doesnt work.
Does your script require sudo access?
No my scripts dont have sudo or doas.
I will show 1 scripts /home/supercore/.local/bin/systemalert
#!/bin/sh
mpg123 /home/supercore/.local/share/sounds/computer_magic-.mp3
There is no dot before local in scripts paths on your screenshot.
I know i put the dot it still doesnt work, ok i think you cannot use scripts in xinitrc it doesnt work and sorry to take all your time thank you to for trying to help me "cds and also "darcy"
Why not run it from .bashrc, .xprofile, or .profile
which mpg123 ?
what is the PATH variable?
Can you post the file instead of an image of the file so we can test it and manipulate it?
If you want help with a config file or shell code, it would be common courtesy to actually post the text.... as text.
FWIW - there are several unconventional aspects to that file. The PATH variable is not set. You are ending with an exec statement. From man exec...
It is perfectly expected if you are loading a window manager. But you should be aware that you lose your shell.
FWIW - my tone might be coming across a little annoyed and it is. Others might be less inclined to be aggravated by this, but for an old foggie like myself I find it disrespectful to lazily whip out your cellphone and take a picture of a coding/admin problem and post a picture of your file rather than posting the actually file with cut and paste, and then ask for help. The membership is happy to help and want to encourage your requests to help, information and feedback, but it is not too much to ask for you to come half way so they can effectively be helpful and so their time is not wasted. They are volunteers, you know, and even paid staff don't deserve being treated like that.
FWIW - my ./.xinitrc file does not have #!/bin/sh
It doesn't run as a script but is imported by startx.
The display settings ect are set up by startx.
It can be a complete script, as you have it. It is a client script to xinit. Philosophically, I keep it simple and let the window manager do its thing.
You are right. It doesn't need the shebang as xinit (startx) sources the contents of the file rather than executing it directly.
However OP is doing things in a non-standard way
startx /home/supercore/.config/x11/xinitrc
In this case it's not an .xinitrc file it's a script and the shebang is needed.
Doing it that way, passing a script or program directly to startx, like /usr/bin/startplasma-x11 or /home/supercore/.config/x11/xinitrc will result in ~/.xinitrc not being sourced at all.