Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Thu 14 Dec 2017, 17:08
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
Script to run Chrome as Spot in Slacko
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [7 Posts]  
Author Message
belham2

Joined: 15 Aug 2016
Posts: 1361

PostPosted: Fri 03 Nov 2017, 12:35    Post subject:  Script to run Chrome as Spot in Slacko  

Hi all,

This is probably brain-dead simple for you guys, but it is proving a brick wall to my old brain. Courtesy of murga poster "Watchdog', he has a trick for getting the latest downloadable (from Google) Chrome to run as both "Spot" plus with "Sandboxing" fully employed.
Here's how things are structured at the moment:

1) In Slacko64-700 (6.9.9.9.)
2) have placed the latest, full Google Chrome64 in "Spot" directory
3) also placed palemoon64 in /opt/directory for use as a LIB_PATH when launching Chrome in Spot
4) in "spot" directory is also this simple script:

Code:

# cat /root/spot/chrome.sh
#!/bin/sh
SPOT_HOME=$(awk -F: '$1=="spot" {print $6}' /etc/passwd)
cd $SPOT_HOME/Downloads
LD_LIBRARY_PATH=/mnt/sda1/palemoon_64:$LD_LIBRARY_PATH
exec ~/google/chrome/google-chrome --user-data-dir="$SPOT_HOME/.config/chrome" "$@"


5) Now Chrome will launch, but only when you enter these 4 commands in a terminal

Code:

chown -R spot /root/spot
cd /root/spot
su spot
sh chrome.sh



....then Chrome starts up right away, as previously mentioned with both as "Spot' and "Sandbox" function fully employed.


My question is this: it's a pain in the butt to have to type those 4 commands in a terminal every time you want to launch Chrome. Is there a way to put all of those 4 commands in "one script", so that when that script is clicked, it will launch--perform those 4 commands---and thus Chrome will start right up???

Thank you for help/advice/tips/etc.
Back to top
View user's profile Send private message 
puppyluvr


Joined: 06 Jan 2008
Posts: 3454
Location: Chickasha Oklahoma

PostPosted: Fri 03 Nov 2017, 12:41    Post subject:  

Very Happy Hello,
Put them in a script.
Put a " | " between the commands, bash will execute them sequentially.

_________________
Close the Windows, and open your eyes, to a whole new world
I am Lead Dog of the
Puppy Linux Users Group on Facebook
Join us!

Puppy since 2.15CE...
Back to top
View user's profile Send private message Visit poster's website 
belham2

Joined: 15 Aug 2016
Posts: 1361

PostPosted: Fri 03 Nov 2017, 13:24    Post subject:  

puppyluvr wrote:
Very Happy Hello,
Put them in a script.
Put a " | " between the commands, bash will execute them sequentially.



Awwwww, goddang it, it was that simple? I should be whipped Embarassed Rolling Eyes

Thank you so much, Puppyluvr!! Wink
Back to top
View user's profile Send private message 
belham2

Joined: 15 Aug 2016
Posts: 1361

PostPosted: Fri 03 Nov 2017, 13:39    Post subject:  

{followup}

..Hi again, puppyluvr. I tried these two ways below, but neither of them worked. How am I doing it wrong? Embarassed

Code:

#!/bin/sh
chown -R spot /root/spot | cd /root/spot | su spot | sh chrome.sh


Code:

#!/bin/sh
chown -R spot /root/spot |
cd /root/spot |
su spot |
sh chrome.sh
Back to top
View user's profile Send private message 
fredx181


Joined: 11 Dec 2013
Posts: 2634
Location: holland

PostPosted: Fri 03 Nov 2017, 14:00    Post subject:  

I think adding the " | " is not right, doesn't this just work ?

Code:
#!/bin/sh
chown -R spot /root/spot
cd /root/spot
su spot
sh chrome.sh
 


Or maybe:
Code:
#!/bin/sh
chown -R spot /root/spot
cd /root/spot
xhost +local:spot
su spot -c ./chrome.sh
 


Sorry didn't test, not on a puppy now, so just guessing, hopefully brings you in right direction.

Fred

_________________
Dog Linux website
Back to top
View user's profile Send private message 
amigo

Joined: 02 Apr 2007
Posts: 2634

PostPosted: Fri 03 Nov 2017, 14:09    Post subject:  

Put a " | " between the commands, bash will execute them sequentially.
This is not correct. The pipe '|' funnels the output of the program on the left side of it, to the program on the right side *as stdinput*.
Not to be confused with &&, which does what you said '|' does, or '||' which is equal to 'or' -run the left-side program, and only if it fails then run the right-side program

cat run-spot-run
#!/bin/sh
chown -R spot /root/spot
cd /root/spot
su spot
sh chrome.sh

copy run-spot-run anywhere in your path you want, even put a link to it on your pinboard. Then just clicking the icon would do the whole thing.
Back to top
View user's profile Send private message 
belham2

Joined: 15 Aug 2016
Posts: 1361

PostPosted: Fri 03 Nov 2017, 14:14    Post subject:  

Thank you, Fred & Amigo (and puppyluvr)!

I ended up using Fred's 2nd example and Chrome fired right up.

Thank you so much all. Very Happy Wink
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [7 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Off-Topic Area » Programming
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0407s ][ Queries: 14 (0.0056s) ][ GZIP on ]