Monday, April 29, 2024
 Popular · Latest · Hot · Upcoming
3
rated 0 times [  3] [ 0]  / answers: 1 / hits: 2415  / 2 Years ago, sat, october 15, 2022, 5:51:22

I want to make a shortcut that will run utorrent every time i click it without me doing all the commands in terminal every time...



I created a script the run cd my utorrent folder and then do the ./utserver. After that i need to make my firefox open in u torrent link "http://localhost...etc" . But my problem is that ./torrent don't finish for about 2-3 mins although in that time if i manually open the link for u torrent in firefox it starts fine so i need a command that will open this link in firefox after about 4-5 secs even if ./utorrent (command) wasn't finished...



(but not instantly after started because utorrent wont start) does anyone have an idea how can i do this?



Thanks in advance.


More From » 12.04

 Answers
1

Another alternative would be sleep



sleep 360; /path/to/firefox blah blah (or on separate lines if in your script)



Sleep takes an argument in seconds and waits that long before stopping and letting the shell move on. In this case, if this is in your script, make sure you run the script with & after it or your terminal will be blocked until it is done.



./myScript &



And if you want to close your terminal without stopping the script



nohup ./myscript >/dev/null 2>&1 &


[#33258] Monday, October 17, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
bjecterless

Total Points: 59
Total Questions: 96
Total Answers: 105

Location: Argentina
Member since Thu, Mar 18, 2021
3 Years ago
bjecterless questions
;