For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
oldyeller
Posts: 889 Joined: Tue 15 Nov 2011, 14:26
Location: Alaska
#1
Post
by oldyeller » Thu 02 May 2013, 00:47
Hello Everyone,
I have this uninstall script and I would like to improve on it.
Code: Select all
#!/bin/sh
Xdialog -title="Uninstalling" --yesno "Do you really want to Remove Believe?" 0 0
if [ $? -eq 0 ]; then
rm -f /usr/local/bin/Believe
rm -r /usr/local/Manna/Believe
rm -f /usr/local/bin/rmBelieve
fi
What I would like to do is be able to remove this entry in fluxbox menu;
The menu is customize. Just not sure on how to code it. If this can't be done by the script. Than have it open the menu.base for manual editing.
Any help would be great.
Thanks
Last edited by
oldyeller on Thu 02 May 2013, 16:12, edited 1 time in total.
stu91
Posts: 145 Joined: Mon 06 Aug 2012, 15:11
Location: England. Dpup. Dell Inspiron 1501
#2
Post
by stu91 » Thu 02 May 2013, 03:56
oldyeller
Posts: 889 Joined: Tue 15 Nov 2011, 14:26
Location: Alaska
#3
Post
by oldyeller » Thu 02 May 2013, 15:26
Will give it a try.
I did figure out how to have the script open a window that states were to delete the line in the menu.base and than open up the menu.base.
This is the code that I added and I figured out how to do my first Xdialog I will have to finish this I am on the wrong puppy
EDIT:: Now I am on the right puppy
Code: Select all
Xdialog -title="Deleting" --msgbox "Delete line 44 in menu.base, after deleting hit refresh in the menu under settings-fluxbox" 0 0
exec geany /root/.fluxbox/menu.base
oldyeller
Posts: 889 Joined: Tue 15 Nov 2011, 14:26
Location: Alaska
#4
Post
by oldyeller » Thu 02 May 2013, 15:43
This did not work.
Thanks
L18L
Posts: 3479 Joined: Sat 19 Jun 2010, 18:56
Location: www.eussenheim.de/
#5
Post
by L18L » Thu 02 May 2013, 15:56
Code: Select all
sed -i '/Believe/d' $HOME/.fluxbox/menu.base
should delete every line containing Believe in /root/.fluxbox/menu.base
oldyeller
Posts: 889 Joined: Tue 15 Nov 2011, 14:26
Location: Alaska
#6
Post
by oldyeller » Thu 02 May 2013, 16:12
L18L wrote: Code: Select all
sed -i '/Believe/d' $HOME/.fluxbox/menu.base
should delete every line containing Believe in /root/.fluxbox/menu.base
This did the trick
Thanks L18L
stu91
Posts: 145 Joined: Mon 06 Aug 2012, 15:11
Location: England. Dpup. Dell Inspiron 1501
#7
Post
by stu91 » Thu 02 May 2013, 16:13
oldyeller wrote:
This did not work.
Thanks
As L18L points out make sure it points to where ever the fluxbox menu file is located, the -i flag is edit in place.
could also use:
Code: Select all
grep -v 'Believe' /menu/file > /tmp/menu/file
rm -f /menu/file && mv -f /tmp/menu/file /menu/file
grep none matching string lines and send to new /tmp/menu/file - remove old /menu/file and move new /tmp/menu/file to its place.
oldyeller
Posts: 889 Joined: Tue 15 Nov 2011, 14:26
Location: Alaska
#8
Post
by oldyeller » Thu 02 May 2013, 16:20
Hi stu91,
Thanks will take a look at this as well
Cheers
L18L
Posts: 3479 Joined: Sat 19 Jun 2010, 18:56
Location: www.eussenheim.de/
#9
Post
by L18L » Thu 02 May 2013, 16:38
Hi stu91,
did not know this
grep -v ...............
before
thank you