Choose style:

Author Topic: Adding a Shell Launcher in Panel  (Read 1489 times)

0 Members and 1 Guest are viewing this topic.

Offline josephgodwinke

  • nOOb
  • *
  • Posts: 5
  • Karma: 0
  • Web Security is an illusion
    • View Profile
  • Peppermint version(s): 7 Respin x64
Adding a Shell Launcher in Panel
« on: May 11, 2017, 04:14:48 am »
I have successfully added a shell script to panel with this command
Code: [Select]
'/usr/local/mantra/OWASP Mantra'
however when I launch it, it does nothing. On the other hand when I launch the script from folder as root it launches no problem. I believe this must be a noob question so what is the command to launch it as root thinking thats the problem. ???
Design, Development, Exploitation!

Online PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 26295
  • Karma: 2855
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 10
Re: Adding a Shell Launcher in Panel
« Reply #1 on: May 11, 2017, 07:44:08 am »
What happens if you run:
Code: [Select]
'/usr/local/mantra/OWASP Mantra'
in a terminal ?
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec

Offline josephgodwinke

  • nOOb
  • *
  • Posts: 5
  • Karma: 0
  • Web Security is an illusion
    • View Profile
  • Peppermint version(s): 7 Respin x64
Re: Adding a Shell Launcher in Panel
« Reply #2 on: May 11, 2017, 09:22:32 am »
What happens if you run:
Code: [Select]
'/usr/local/mantra/OWASP Mantra'
in a terminal ?

It just hangs for eternity, then i try as root i change directory to mantra at /usr/local/ and try to run OWASP Mantra from terminal and it hangs for eternity too.   ???
Design, Development, Exploitation!

Online PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 26295
  • Karma: 2855
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 10
Re: Adding a Shell Launcher in Panel
« Reply #3 on: May 11, 2017, 09:34:54 am »
what is it, and where did you get it ?
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec

Online PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 26295
  • Karma: 2855
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 10
Re: Adding a Shell Launcher in Panel
« Reply #4 on: May 11, 2017, 10:52:11 am »
Okay I found it.

This application is designed to be portable, so the startup script assumes it was NOT installed "as root", so it would have ended up in your home folder and have had write permissions to its "profile" directory without elevated privileges.

You have 2 options

a) remove your root installation of it with
Code: [Select]
sudo rm -rv /usr/local/mantra
then install it again AS A REGULAR USER.

or

b) edit it's startup script to copy its "profile" directory to your home folder where it WILL have write permission
Code: [Select]
sudo pluma '/usr/local/mantra/OWASP Mantra'
and make it read
Code: [Select]
#!/bin/sh
#Version 0.0.8
#Put together by Alexander S.T. Ross (abushcrafter)
#Based on the luncher from: https://www.privacyfoundation.de/wiki/PortableLinuxApps
#Also based on the luncher from: http://portools.com/apps/iceweasel-portable

#Works with any mozzila base based app like Firefox,ThunderBird,SongBird,SunBird,Fennec (Firefox Mobile),Seamonkey,etc.

#The reason for the bit of code, for disabling error output of the $app. Is because if you are for instants using Firefox, some addons like ReadItLater reviles (In a URL) your password and user-name of your ReadItLater account. This info then ends up in the system log: "/tmp/xerrs.log".

#ChangeLog ----------------------------------------------------------------------
#   2010/10/31  Alexander .S.T. Ross (abushcrafter) Email: <http://www.google.com/recaptcha/mailhide/d?k=01uNeUuXxeNm9FA3Zciuoqzw==&c=nVfKeb7kjqZVVIQanqJwEC2DP5zrALkSERTopYvj_pU=>
#      * 0.0.7: Now finds out what the current version of the Mozilla app is. Thanks to my dad.
#      * 0.0.7: Now gives you a splash screen telling you that Mozilla app is now closed.
#      * 0.0.7: Added some Debug/Info echos.
#      * 0.0.7: Removed Dingo's <http://dokupuppylinux.co.cc/> Puppy Linux font fix as it's fixed in newer versions of Puppy Linux (.E.G. Lupu 5.*.* (Might have not been fixed in first few version?)).
#      * 0.0.7: Removed nooby mistakes of mine. .E.G. variables being exported, "exec" being used to run the Mozilla app.

#   2010/11/01  Alexander .S.T. Ross (abushcrafter) Email: <http://www.google.com/recaptcha/mailhide/d?k=01uNeUuXxeNm9FA3Zciuoqzw==&c=nVfKeb7kjqZVVIQanqJwEC2DP5zrALkSERTopYvj_pU=>
#      * 0.0.8: Fixed all bugs. Now works.
#      * 0.0.8: Added more echos.

app="firefox"

echo "${app}portable:Debug/Info: 0="$0""
dir=${0%/*}
echo "${app}portable:Debug/Info: dir="$dir""
if [ "$dir" = "$0" ]; then
  dir="."
fi
HOME=$HOME/.config/Mantra/profile
cd "$dir/Mantra"
echo "${app}portable:Debug/Info: Current Dir="`pwd`

version=`./$app --version |tr , \ | cut --fields=3 --delimiter=\ `
echo "Welcome to the Linux version of $app $version in portable mode. Feedback is NOT disabled."

#START: Part of Dingo's <http://dokupuppylinux.co.cc/> additions to this script.
if test -d $HOME/.config/Mantra/profile ; then
printf "${app}portable:Debug/Info: Profile Directory already exists!\n"
else
mkdir -p $HOME/.config/Mantra
cp -r $dir/Mantra/profile $HOME/.config/Mantra/
fi
#END: Part of Dingo's <http://dokupuppylinux.co.cc/> additions to this script.

#Remove the "#" from the next line to disable error output.
xterm -e ./$app -no-remote -profile "$HOME/.config/Mantra/profile" $@ #2>/dev/null

echo "${app}portable:Debug/Info: $app is now closed."
yaf-splash -text "$app Is Now Closed" -bg green -fg black -timeout 3 -display :0 -margin 2 -bw 0 -font "9x15B" -outline 0
echo "${app}portable:Debug/Info: ${app}portable is now closed."
SAVE the file and exit pluma

Your launcher should now work.
« Last Edit: May 11, 2017, 11:27:59 am by PCNetSpec »
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec

Offline josephgodwinke

  • nOOb
  • *
  • Posts: 5
  • Karma: 0
  • Web Security is an illusion
    • View Profile
  • Peppermint version(s): 7 Respin x64
Re: Adding a Shell Launcher in Panel
« Reply #5 on: May 13, 2017, 11:43:11 am »
Okay I found it.

This application is designed to be portable, so the startup script assumes it was NOT installed "as root", so it would have ended up in your home folder and have had write permissions to its "profile" directory without elevated privileges.

You have 2 options

a) remove your root installation of it with
Code: [Select]
sudo rm -rv /usr/local/mantra
then install it again AS A REGULAR USER.

or

b) edit it's startup script to copy its "profile" directory to your home folder where it WILL have write permission
Code: [Select]
sudo pluma '/usr/local/mantra/OWASP Mantra'
and make it read
Code: [Select]
#!/bin/sh
#Version 0.0.8
#Put together by Alexander S.T. Ross (abushcrafter)
#Based on the luncher from: https://www.privacyfoundation.de/wiki/PortableLinuxApps
#Also based on the luncher from: http://portools.com/apps/iceweasel-portable

#Works with any mozzila base based app like Firefox,ThunderBird,SongBird,SunBird,Fennec (Firefox Mobile),Seamonkey,etc.

#The reason for the bit of code, for disabling error output of the $app. Is because if you are for instants using Firefox, some addons like ReadItLater reviles (In a URL) your password and user-name of your ReadItLater account. This info then ends up in the system log: "/tmp/xerrs.log".

#ChangeLog ----------------------------------------------------------------------
#   2010/10/31  Alexander .S.T. Ross (abushcrafter) Email: <http://www.google.com/recaptcha/mailhide/d?k=01uNeUuXxeNm9FA3Zciuoqzw==&c=nVfKeb7kjqZVVIQanqJwEC2DP5zrALkSERTopYvj_pU=>
#      * 0.0.7: Now finds out what the current version of the Mozilla app is. Thanks to my dad.
#      * 0.0.7: Now gives you a splash screen telling you that Mozilla app is now closed.
#      * 0.0.7: Added some Debug/Info echos.
#      * 0.0.7: Removed Dingo's <http://dokupuppylinux.co.cc/> Puppy Linux font fix as it's fixed in newer versions of Puppy Linux (.E.G. Lupu 5.*.* (Might have not been fixed in first few version?)).
#      * 0.0.7: Removed nooby mistakes of mine. .E.G. variables being exported, "exec" being used to run the Mozilla app.

#   2010/11/01  Alexander .S.T. Ross (abushcrafter) Email: <http://www.google.com/recaptcha/mailhide/d?k=01uNeUuXxeNm9FA3Zciuoqzw==&c=nVfKeb7kjqZVVIQanqJwEC2DP5zrALkSERTopYvj_pU=>
#      * 0.0.8: Fixed all bugs. Now works.
#      * 0.0.8: Added more echos.

app="firefox"

echo "${app}portable:Debug/Info: 0="$0""
dir=${0%/*}
echo "${app}portable:Debug/Info: dir="$dir""
if [ "$dir" = "$0" ]; then
  dir="."
fi
HOME=$HOME/.config/Mantra/profile
cd "$dir/Mantra"
echo "${app}portable:Debug/Info: Current Dir="`pwd`

version=`./$app --version |tr , \ | cut --fields=3 --delimiter=\ `
echo "Welcome to the Linux version of $app $version in portable mode. Feedback is NOT disabled."

#START: Part of Dingo's <http://dokupuppylinux.co.cc/> additions to this script.
if test -d $HOME/.config/Mantra/profile ; then
printf "${app}portable:Debug/Info: Profile Directory already exists!\n"
else
mkdir -p $HOME/.config/Mantra
cp -r $dir/Mantra/profile $HOME/.config/Mantra/
fi
#END: Part of Dingo's <http://dokupuppylinux.co.cc/> additions to this script.

#Remove the "#" from the next line to disable error output.
xterm -e ./$app -no-remote -profile "$HOME/.config/Mantra/profile" $@ #2>/dev/null

echo "${app}portable:Debug/Info: $app is now closed."
yaf-splash -text "$app Is Now Closed" -bg green -fg black -timeout 3 -display :0 -margin 2 -bw 0 -font "9x15B" -outline 0
echo "${app}portable:Debug/Info: ${app}portable is now closed."
SAVE the file and exit pluma

Your launcher should now work.

This worked . Thanks
Design, Development, Exploitation!

Online PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 26295
  • Karma: 2855
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 10
Re: Adding a Shell Launcher in Panel
« Reply #6 on: May 13, 2017, 03:50:04 pm »
You're welcome :)

Can you please remember to mark topics (SOLVED) when you consider them so .. you can do this by editing the FIRST posting in this topic and changing:-

Subject: Adding a Shell Launcher in Panel (SOLVED)

Thanks in advance.
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec