You are not logged in.
Guys i made few .sh files and want to start them on startup but when i add them to startup the konsole starts up but doesn't runs the codes inside of it. Just opens the location of the .sh file.
Offline
Give us more info. Are you using a Desktop Environment?
Is the script executable?
How are you autostarting the file?
etc.
Offline
Give us more info. Are you using a Desktop Environment?
Is the script executable?
How are you autostarting the file?
etc.
Yes i'm using KDE plasma. I'm autostarting file from settings. No script isn't executable because if i make it executable it just bugs out. I mean i'm starting a server with that script if i make it executable it doesn't starts konsole with it. So i can't see whats going on on the server.
Last edited by Welt (2021-07-10 12:07:31)
Offline
Scripts need to be executable to run - or you need to source them into another active shell. This has nothing to do with being able to see them or not. If you want to see the output of a script in a terminal, you need to run a terminal.
So rather than autostarting `/path/to/yourscript.sh`, you should audostart `konsole -e /path/to/yourscript.sh`. Although I'm unfamiliar with konsole, you might need to change the '-e' flag to the appropriate one for that konsole. You might also want to check if it has a --hold flag to remain open after the script finishes.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
Scripts need to be executable to run - or you need to source them into another active shell. This has nothing to do with being able to see them or not. If you want to see the output of a script in a terminal, you need to run a terminal.
So rather than autostarting `/path/to/yourscript.sh`, you should audostart `konsole -e /path/to/yourscript.sh`. Although I'm unfamiliar with konsole, you might need to change the '-e' flag to the appropriate one for that konsole. You might also want to check if it has a --hold flag to remain open after the script finishes.
So i should create a new script which includes "konsole -e /home/supflynn/Desktop/folder/LaunchServer.sh" and should autostart that.
Last edited by Welt (2021-07-10 16:57:16)
Offline
When do you want these scripts to run? On system start-up, on user-login (one particular user or every user), when you start a terminal? Who should these scripts be run as?
Offline
Trilby wrote:Scripts need to be executable to run - or you need to source them into another active shell. This has nothing to do with being able to see them or not. If you want to see the output of a script in a terminal, you need to run a terminal.
So rather than autostarting `/path/to/yourscript.sh`, you should audostart `konsole -e /path/to/yourscript.sh`. Although I'm unfamiliar with konsole, you might need to change the '-e' flag to the appropriate one for that konsole. You might also want to check if it has a --hold flag to remain open after the script finishes.
So i should create a new script which includes "konsole -e /home/supflynn/Desktop/folder/LaunchServer.sh" and should autostart that.
The output i get is:
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'.
Last edited by Welt (2021-07-10 17:02:58)
Offline
When do you want these scripts to run? On system start-up, on user-login (one particular user or every user), when you start a terminal? Who should these scripts be run as?
I want to run these scripts just after my DE is started. As a user.
Offline
And another script i wrote is stays open after completing it's task so is there any way to automate for closing after task is completed and is there a way to set a delay time between those.
Last edited by Welt (2021-07-10 17:48:46)
Offline
so is there any way to automate for closing after task is completed and is there a way to set a delay time between those.
Sure.
https://wiki.archlinux.org/title/KDE#Autostart
https://wiki.archlinux.org/title/Desktop_entries - use "Terminal=true"
To generically have a script keep the terminal open, don't let it exit but stall at the end.
To have it implicitly close the terminal, ensure the script to exit at some point.
If that's too generic, provide more specifics about "script™" and "other script™"…
Offline
So i should create a new script which includes "konsole -e ..."
Not likely, no. I'd assume whatever autostart system you are using can be given command lines with parameters to run, so there is not need for a script, just have that full command autostart.
In fact if these are desktop entries, use the Terminal=true option that seth mentioned and do not even explicitly include "konsole -e" in the command.
(edit: `s/terminal=/Terminal/`, `s/Seth/seth/` - I never figured Terminal for a proper noun, but seth certainly can be improper!)
Last edited by Trilby (2021-07-11 00:04:53)
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
so is there any way to automate for closing after task is completed and is there a way to set a delay time between those.
Sure.
https://wiki.archlinux.org/title/KDE#Autostart
https://wiki.archlinux.org/title/Desktop_entries - use "Terminal=true"To generically have a script keep the terminal open, don't let it exit but stall at the end.
To have it implicitly close the terminal, ensure the script to exit at some point.If that's too generic, provide more specifics about "script™" and "other script™"…
I didn't get it where should i locate my entries. I think desktop entries are my solution but i'm weak about reading documantation so i got confused.
Last edited by Welt (2021-07-11 08:13:32)
Offline
Welt wrote:So i should create a new script which includes "konsole -e ..."
Not likely, no. I'd assume whatever autostart system you are using can be given command lines with parameters to run, so there is not need for a script, just have that full command autostart.
In fact if these are desktop entries, use the Terminal=true option that seth mentioned and do not even explicitly include "konsole -e" in the command.
(edit: `s/terminal=/Terminal/`, `s/Seth/seth/` - I never figured Terminal for a proper noun, but seth certainly can be improper!)
So what's the diffrence but my app's doesn't have .application extension so they aren't desktop entries i guess. I'm really confused can someone clear it up ?
Offline
i'm weak about reading documantation lazy as shit so i got confused didn't bother to read any of this.
ftfy and I guess you're using the wrong distro then.
Seriously, it's only one paragraph and the very top tells you to put them here https://wiki.archlinux.org/title/XDG_Autostart (which you're also not gonna read, I assume)
If this is too much for you, consider purchasing a Tv instead. Or a lava lamp.
Offline
Oh after taking konsole -e "server running code" into the same line it solved. Just remains auto closing window after compliting it's task for another script that i made.
But autostart seems doesn't working.
Plasma can autostart applications and run scripts on startup and shutdown. To autostart an application, navigate to System Settings > Startup and Shutdown > Autostart and add the program or shell script of your choice.I did this but my scripts doesn't running automaticly on start.
Offline
i'm weak about reading documantation lazy as shit so i got confused didn't bother to read any of this.
ftfy and I guess you're using the wrong distro then.
Seriously, it's only one paragraph and the very top tells you to put them here https://wiki.archlinux.org/title/XDG_Autostart (which you're also not gonna read, I assume)
If this is too much for you, consider purchasing a Tv instead. Or a lava lamp.
Hey bro i'm foreign languager so i can't get everything i read i seriosly trying my best.
Offline
Hey as i get desktop entries are for applications so that doesn't apply for me i'm trying to run scripts.
Offline
Seems like i made it working for my auto closing script. So just remains auto starting my server launching script.
Offline
Oh there is that i have 2 script one of them auto starts from settings menu one of them isn't.
Offline
Welt, please stop creating a new post every time you want to add something. If no one has replied, use the edit link to add information to your existing post.
Offline
Hey bro i'm foreign languager so ...
Seth may have been uncomfortably abrupt, but he was also completely right. The problem is most definitely not a language barrier. I empathize with people who have to read documentation in a language that is not native to them, but the kinds of challenges they face and the questions they ask do not at all resemble yours. And claiming your lack of effort is related to speaking a different language is really insulting to every other user for whom English is not their native language.
Make an effort, not an excuse.
You will find this community is very open to issues that come from a language barrier, and we'll work very hard to help speakers of other languages get over any hurdles. But we have no patience for help vampires. There are however always second chances if you can take these posts as constructive criticism and adjust how you seek help here.
Last edited by Trilby (2021-07-11 13:02:08)
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
Hey, "bro" - so am I. Now what?
Also you're posting here in competent enough English, aren't you? So?
And there're translate.google.com and www.deepl.com/translator and dict.cc
Hey as i get desktop entries are for applications so that doesn't apply for me i'm trying to run scripts.
That's not a meaningful differentiation.
You can create .desktop services and make them run anything (executable)
Whether the executable is a bash script, an elf binary, python, perl, … doesn't matter and you don't even reasonably require an icon for the autostart case (because it won't show up in your menu)
Oh there is that i have 2 script one of them auto starts from settings menu one of them isn't.
Instead of useless vague descriptions of the status quo, you should describe the actual status quo.
* what scripts - which one runs, which one doesn't?
* what are their permissions, notably: are they executable?
* how do you currently run them - are there entries in the XDG autostart paths?
Offline
I'm trying my best to get it right guys. Seriosly i'm reading all the links you are sending to me but some of the sentences in the wiki just seems like lack of explanation so i don't get everything i read but i'm really trying my best. Probably you don't believe me so anyways back to the topic. I have two scripts one of them for starting hamachi somewill say use systemctl enable it just straightly bugs up my hamachi. So i created a script for that to start hamachi it works perfectly fine. My servers script works perfectly fine but autostart doesn't working. Hamachi's script both starts auto and works perfectly as intended.
Offline
Instead of useless vague descriptions of the status quo, you should describe the actual status quo.
* what scripts - which one runs, which one doesn't?
* what are their permissions, notably: are they executable?
* how do you currently run them - are there entries in the XDG autostart paths?
You did not cover the second and third point.
Please also post the journal output for the failing service you replaced with a script.
Offline
And if you want to understand why or not the scripts keep the terminal open: post the actual scripts…
Offline