

Code: Select all
...
while read myline ; do
if [[ -n "${myline}" ]]; then
MenuExecName="$(sed 's/Exec=\([^ ]*\) .*/\1/' ${myline})"
echo "${MenuExecName}" >> entryname
fi
done < execfulllistCode: Select all
sed: impossible de lire Exec=kdenlive -caption "%c" %i %m: Aucun fichier ou répertoire de ce type
Code: Select all
blahblah..
enuExecName="$(echo ${myline} | sed 's/Exec=\([^ ]*\) .*/\1/' )"
blahblah..Code: Select all
sed 's/Exec=\([^ ]*\) .*/\1/' execfullist > entryname
Code: Select all
MenuExecName="$(echo ${myline} | sed 's/Exec=\([^ ]*\) .*/\1/' \
| sed 's/Exec=//' | sed 's/TryExec=//' )"Code: Select all
cat execfullist | sed -e '/^Exec=/!d' -e 's/^Exec=\([^ ]*\) .*/\1/'Code: Select all
sed -e '/^Exec=/!d' -e 's/^Exec=\([^ ]*\) .*/\1/' execfullist > entryname
Code: Select all
MenuExecName="$(echo ${myline} | sed 's/Exec=\([^ ]*\) .*/\1/' \
| sed 's/Exec=\|TryExec=//' )"Code: Select all
/usr/bin/firefoxoh my mistakeDominique_71 wrote:It doesn't filter out the Exec= when the command doesn't have parameters. But it is not so important because it work if I pipe a few sed calls.
Code: Select all
sed -e '/^Exec=/!d' -e 's/^Exec=\([^ ]*\).*/\1/'find ? or sed? if it's sed, then, instead of the above command, you can run thisBut I find another problem with this script. It is some desktop file that have command such asand find don't like it. Is it possible to filter out the path?Code: Select all
/usr/bin/firefox
Code: Select all
sed -e '/^Exec=/!d' -e 's;^Exec=\([^ ]*\).*;\1;'
It work, but the generated files are not the sames. The TryExec= lines are just blank lines with your syntax.truc wrote:should do it.Code: Select all
sed -e '/^Exec=/!d' -e 's/^Exec=\([^ ]*\).*/\1/'
But I find another problem with this script. It is some desktop file that have command such asand find don't like it. Is it possible to filter out the path?Code: Select all
/usr/bin/firefox
Sorry, my fault. I use find later to search for existing menu entries.find ? or sed? if it's sed, then, instead of the above command, you can run thisCode: Select all
sed -e '/^Exec=/!d' -e 's;^Exec=\([^ ]*\).*;\1;'
Was it your problem? give us more code!
Code: Select all
FC_MENUBASE="/usr/share/fvwm-crystal/fvwm/Applications"
...
while read myline ; do
if [[ -n "${myline}" ]]; then
MenuExecName="$(echo ${myline} | sed 's/Exec=\([^ ]*\) .*/\1/' \
| sed 's/Exec=\|TryExec=//' )"
# MenuExecName="$(echo ${myline} | sed -e '/^Exec=/!d' -e 's/^Exec=\([^ ]*\).*/\1/' )"
echo "${MenuExecName}" >> entryname
fi
done < execfulllist
while read myline ; do
if [[ -n "${myline}" ]]; then
EntryFile="$( find $FC_MENUBASE -type f -iname "*${myline}*" )"
if [[ -z "$EntryFile" ]]; then
echo "${myline}" >> entrytodo
else
echo "${EntryFile}" >> entryexist
fi
fi
done < entryname
Code: Select all
sed -e '/^Exec=/!d' -e 's;^Exec=\([^ ]*\).*;\1;'Code: Select all
sed -e '/^\(Try\|\)Exec=/!d' -e 's:^.\{0,3\}Exec=\([^ ]*\).*:\1:' -e 's:.*/::'

Code: Select all
#!/bin/bash
# Write a FVWM-Crystal menu entry
# Usage: gen-fvwm-crystal-menuentry <exec_name> <entry_name> <category> <command>
# Where are the Fvwm-Crystal menu files:
#FC_MENUBASE="~/.fvwm-crystal/Applications"
FC_MENUBASE="/home/dom/CrystalAudio/tmp/Applications"
SLUT="$@"
gen_entry() {
mkdir -p "${FC_MENUBASE}/${3}"
(
echo "#!/bin/sh"
echo
echo "exec $4 ${SLUT}"
) > ${FC_MENUBASE}/${3}/~${1}~${2}
}
gen_entry $1 $2 $3 $4
Code: Select all
./gen-fvwm-crystal-menu-entry.bash test1 test2 test3 test4Code: Select all
#!/bin/sh
exec test4 test1 test2 test3 test4
Code: Select all
#!/bin/sh
exec test4 $@
Code: Select all
echo "exec $4 \$@"
Your problem is that you have:Dominique_71 wrote:when it should beCode: Select all
#!/bin/sh exec test4 $@
Code: Select all
SLUT="$@"
Code: Select all
foo="\$@"
Don't use "$USER" here as it can be faked. Better to use something like:Dominique_71 wrote: EDIT: I just find at I can get which user run the script with something as "your_id=${USER}", so it will be easy to do a test for FC_MENUBASE. Remain the $@...
Code: Select all
FOO="$(id -nu)"

Thank you Thomas,ThomasAdam wrote: Note that whilst it is a nice idea of yours to autogenerate this, what you're doing leaves yourself *wide* open to massive exploits. I don't see *any* error checking in any of this.
-- Thomas Adam

Code: Select all
#!/bin/bash
#
# Generate FVWM-Crystal menu from desktop and icons files provided by the applications.
#
# Author: Dominique Michel <dominique.michel@citycable.ch>, 2007
#
# Provided as it without any garanty of any kind.
# Released under the GPL version 2 license.
#
# Usage:
# gen-fvwm-crystal-menu : will search for all the desktop files in the system and
# generate the corresponding entries and icons if they don't already exist.
# gen-fvwm-crystal-menu <name> : will search only for <name>.desktop and
# generate the corresponding entry and icons if they don't already exist.
#
# When running this script as user, the files will be generated in FVWM_USERDIR,
# as root, in FVWM_SYSTEMDIR
#
# For a detailled view of the algorhythm, open generate_menu.png in your favorite
# picture viewer.
#
# # # # # # # # # # # # # # # # # # # # # # # # # # #
# Change the following variables if needed
#
# Where to search for .desktop files:
DesktopDir="/usr/share/applications /usr/local/share /usr/kde/3.5/share/applications /usr/share/applnk /usr/share/gnome/apps /usr/kde/3.5/share/applnk /usr/kde/3.5/share/apps/kappfinder/apps"
#
# Where are the Fvwm-Crystal menu files:
FC_MENUBASEROOT="/usr/share/fvwm-crystal/fvwm/Applications"
FC_MENUBASEUSER="/.fvwm-crystal/Applications"
#
# Where are the Fvwm-Crystal icons files:
FC_ICONBASEROOT="/usr/share/fvwm-crystal/fvwm/icons/Default"
FC_ICONBASEUSER="/.fvwm-crystal/icons/Default"
SIZES="22x22 32x32 48x48"
#
# Where are the system wide icons files:
SYSTEM_ICONDIRS="/usr/share/pixmaps /usr/share/icons /usr/kde/3.5/share/icons"
#
# # # # # # # # # # # # # # # # # # # # # # # # # # #
# Don't change anything past this line
# # # # # # # # # # # # # # # # # # # # # # # # # # #
# Type of .desktop files to search for
DESKTYPE="Type=Application"
# Other variables
your_id="$(id -un)"
# User dependent variables
# Test which user run the script. Ir root, install in FVWM-SYSTEMDIR,
# otherwise in FVWM_USERDIR. If ROOT, existing entry will be searched
# only in FVWM_SYSTEMDIR, otherwise in both FVWM_DIR.
if [[ "${your_id}" == root ]]; then
FC_MENUBASE="${FC_MENUBASEROOT}"
FC_ICONBASE="${FC_ICONBASEROOT}"
FC_MENUEXIST="${FC_MENUBASEROOT}"
FC_ICONEXIST="${FC_ICONBASEROOT}"
else
FC_MENUBASE="/home/${your_id}${FC_MENUBASEUSER}"
FC_ICONBASE="/home/${your_id}${FC_ICONBASEUSER}"
FC_MENUEXIST="${FC_MENUBASEROOT} /home/${your_id}${FC_MENUBASEUSER}"
FC_ICONEXIST="${FC_ICONBASEROOT} /home/${your_id}${FC_ICONBASEUSER}"
fi
echo "You are running generate-fvwm-crystal-menu as user ${your_id}."
echo "FVWM-Crystal menu entries will be installed in"
echo "$FC_MENUBASE and the icons in $FC_ICONBASE"
echo "The program will search for existing menu entries in $FC_MENUEXIST and for existing"
echo " icons in $FC_ICONEXIST"
echo ""
echo "Are you sure that you want to process? yes/no"
read PROCESS
if [[ "${PROCESS}" == yes ]]; then
echo "Installing the menu entries in $FC_MENUBASE and the icons in $FC_ICONBASE"
else
if [[ "${PROCESS}" == no ]]; then
echo "abort"
else
echo "Please answer yes or no !"
fi
exit
fi
# / FIXME (this part work, see searchkeystrings())
# Locale test
#echo ""
#echo "This program can search for localized strings in the key Name"
#echo "This way, FVWM-Crystal will use your favorite language if it have been implemented in the desktop file, English otherwise."
#echo "You must enter the right locale string or press enter for the default, English."
#echo "The form of this entry can be lang_COUNTRY@MODIFIER, lang_COUNTRY, lang@MODIFIER or lang."
#echo "Typical values are az, ca, cs, el, en_CA, en_GB, es, fr, hr, hu, ja, ko, mk, ms, nb, nl, #no, pl, pt, sq, sr@Latn, sv or zh_TW. (Non complete list.)"
#echo "Please enter the right locale string and press enter, or press enter for the default, English."
#read LOC
#if [[ "${LOC}" != "" ]]; then
# USERLOC="[${LOC}]"
# else USERLOC=""
#fi
#echo "The key Name$USERLOC will be searched first."
# END FIXME /
# Parameter test
if [[ $1 == "" ]]; then
echo "- Searching for all the desktop files in $DesktopDir"
echo ""
echo "This will go fast..."
searchdesktop="searchallappdesktop"
else
echo "- Searching for $1.desktop in $DesktopDir"
searchdesktop="searchoneappdesktop"
fi
# Remove the temp files if the user press Ctrl-C
USER_INTERRUPT=13
trap 'rm -f filelist filelist1; exit $USER_INTERRUPT' TERM INT
# # # # # # # # # # # # # # # # # # # # # # # # # # #
# Some functions
# Create icons
# createicon <commandname> <iconfile>
createicon() {
if [[ ! -z "`find ${FC_ICONEXIST}/22x22 -name "$1.png"`" ]]; then
# fvwm-crystal icon exists, nothing to do (1)
echo "Icon for $1 exist, skip"
else
if [[ -r "$2" ]]; then
# use file hint pointed to by menu entry
ICONSRCFILE="$2"
else
# try to find a suitable icon in the system directories
ICONSRCFILE=`find $SYSTEM_ICONDIRS -type f -iname "$1.png"`
if [ -z "$ICONSRCFILE" ]; then
ICONSRCFILE=`find $SYSTEM_ICONDIRS -type f -iname "$1.xpm"`
fi
fi
if [[ "$ICONSRCFILE" != "" ]]; then
for i in $ICONSRCFILE; do
# convert the first found file to png of required sizes
for size in ${SIZES}; do
mkdir -p "${FC_ICONBASE}/${size}/apps"
convert -resize ${size} "$i" "${FC_ICONBASE}/${size}/apps/$1.png"
echo "Icon for $1 created as ${FC_ICONBASE}/${size}/apps/$1.png"
done
break
done
else
echo "Original icon for $1 don't exist, skip."
fi
fi
}
# Search desktop files new format
echo -n "" > filelist
# Search for application type desktop file
searchallappdesktop() {
echo -n "" > filelist1
DesktopFile="$(find ${DesktopDir} -iname ?*.desktop -type f)"
echo "$DesktopFile" >> filelist1
echo "Sorting out non application type desktop files."
echo "This will take a while..."
while read myline ; do
if [[ -n "${myline}" ]]; then
TestDeskType="$(grep -h '\<Type\>' "${myline}")"
OnlyShowIn="$(grep -h '\<OnlyShowIn\>' "${myline}")"
NotShowIn="$(grep -h '\<NotShowIn\>' "${myline}")"
NoDisplay="$(grep -h '\<NoDisplay\>' "${myline}")"
Hidden="$(grep -h '\<Hidden\>' "${myline}")"
if [[ "${TestDeskType}" == "${DESKTYPE}" ]] && [[ "${OnlyShowIn}" == "" ]] && [[ "${NotShowIn}" == "" ]] && [[ "${NoDisplay}" == "" ]] && [[ "${Hidden}" == "" ]]; then
echo "${myline}" >> filelist
fi
fi
done < filelist1
rm filelist1
}
searchoneappdesktop() {
echo -n "" > filelist1
DesktopFile="$(find ${DesktopDir} -iname $1.desktop -type f)"
echo "$DesktopFile" >> filelist1
while read myline ; do
if [[ -n "${myline}" ]]; then
TestDeskType="$(grep -h '\<Type\>' "${myline}")"
OnlyShowIn="$(grep -h '\<OnlyShowIn\>' "${myline}")"
NotShowIn="$(grep -h '\<NotShowIn\>' "${myline}")"
NoDisplay="$(grep -h '\<NoDisplay\>' "${myline}")"
Hidden="$(grep -h '\<Hidden\>' "${myline}")"
if [[ "${TestDeskType}" == "${DESKTYPE}" ]] && [[ "${OnlyShowIn}" == "" ]] && [[ "${NotShowIn}" == "" ]] && [[ "${NoDisplay}" == "" ]] && [[ "${Hidden}" == "" ]]; then
echo "${myline}" >> filelist
fi
fi
break
done < filelist1
rm filelist1
}
# Search TryExec in desktop file, Exec if not found
searchexecname() {
EXEC="$(cat ${1} | sed -e '/Desktop Entry/,/Desktop Action/ !d' -e '/^\Exec=/!d' -e 's:^.\{0,3\}Exec=\([^ ]*\).*:\1:' -e 's:.*/::')"
export EXEC
}
# Search for icon name in desktop file
searchiconname() {
ICONNAME="$(cat ${1} | sed -e '/Icon=/!d' -e 's/Icon=//')"
export ICONNAME
}
# Search for key strings in desktop file
searchkeystrings() {
CATNAME="$(cat ${1} | sed -e '/Desktop Entry/,/Desktop Action/ !d' -e '/Categories=/!d' -e 's/Categories=//' -e 's/;/ /g')"
export CATNAME
# echo "CATNAME = $CATNAME"
# if [[ -n "${2}" ]]; then
# SOFTNAME="$(cat ${1} | sed -e '/Name${2}=/!d' -e 's/Name${2}=//')"
# else
SOFTNAME="$(cat ${1} | sed -e '/Desktop Entry/,/Desktop Action/ !d' -e '/^\Name=/!d' -e 's/Name=//' -e 's/ /_/g' -e 's:/:-:')"
# fi
export SOFTNAME
COMMANDF="$(cat ${1} | sed -e '/Desktop Entry/,/Desktop Action/ !d' -e '/^\Exec=/!d' -e 's/Exec=//' -e 's:.%.*::' -e 's/ -caption//')"
export COMMANDF
TERMINAL="$(cat ${1} | sed -e '/Terminal=true/!d' -e 's/Terminal=//')"
export TERMINAL
}
# Search for existing menu entry
searchexist() {
EntryExist="$(find ${FC_MENUEXIST} -iname *${2}~?* -type f)"
if [[ "${EntryExist}" != "" ]]; then
echo "${EntryExist} exist, skip"
EXIST="true"
export EXIST
createicon $EXEC $ICONNAME
else
echo "${EntryExist} dont exist"
EXIST="false"
export EXIST
createicon $EXEC $ICONNAME
fi
}
# Generate the category path for the menu
# 1) search for main category
# 2) search for sub-category
# special cases: if both audio and audiovideo are in the desktop file,
# audio will be preferred; if both audiovideo are in the desktop file,
# video will be preferred.
#
# main categories
maincategory() {
MAINCAT=""
export MAINCAT
case "$1" in
Audio)
MAINCAT="/Multimedia/Audio"
export MAINCAT
;;
AudioVideo | Multimedia)
MAINCAT="/Multimedia/Audio-Video"
export MAINCAT
;;
Development)
MAINCAT="/Development"
export MAINCAT
;;
Education)
MAINCAT="/Knowledge"
export MAINCAT
;;
Games | Game)
MAINCAT="/20~Games"
export MAINCAT
;;
Graphics)
MAINCAT="/Graphics"
export MAINCAT
;;
Internet | Network)
MAINCAT="/Network"
export MAINCAT
;;
Office)
MAINCAT="/Office"
export MAINCAT
;;
Settings)
MAINCAT="/Settings"
export MAINCAT
;;
System)
MAINCAT="/System"
export MAINCAT
;;
Utilities | Utility)
MAINCAT="/Utilities"
export MAINCAT
;;
Video)
MAINCAT="/Multimedia/Video"
export MAINCAT
;;
esac
}
# sub categories
category() {
SUBCAT=""
export SUBCAT
case "$1" in
2DGraphics)
SUBCAT="/2D_Graphics"
export SUBCAT
;;
3DGraphics)
SUBCAT="/3D_Graphics"
export SUBCAT
;;
Accessibility)
SUBCAT="/Accessibility"
export SUBCAT
;;
ActionGame)
SUBCAT="/Action_Games"
export SUBCAT
;;
AdventureGame)
SUBCAT="/Adventure_Games"
export SUBCAT
;;
ArcadeGame)
SUBCAT="/Arcade_Games"
export SUBCAT
;;
Amusement)
SUBCAT="/Amusement"
export SUBCAT
;;
Archiving)
SUBCAT="/Archiving"
export SUBCAT
;;
Art)
SUBCAT="/Art"
export SUBCAT
;;
ArtificialIntelligence)
SUBCAT="/Artificial_Intelligence"
export SUBCAT
;;
Astronomy)
SUBCAT="/Astronomy"
export SUBCAT
;;
AudioVideoEditing)
SUBCAT="/Audio-Video_Editing"
export SUBCAT
;;
Biology)
SUBCAT="/Biology"
export SUBCAT
;;
BlocksGame)
SUBCAT="/Blocks_Games"
export SUBCAT
;;
BoardGame)
SUBCAT="/Board_Games"
export SUBCAT
;;
Building)
SUBCAT="/Building"
export SUBCAT
;;
Calculator)
SUBCAT="/Calculators"
export SUBCAT
;;
Calendar)
SUBCAT="/Calendars"
export SUBCAT
;;
CardGame)
SUBCAT="/Card_Games"
export SUBCAT
;;
Chart)
SUBCAT="/Charts"
export SUBCAT
;;
Chat)
SUBCAT="/Chat"
export SUBCAT
;;
Chemistry)
SUBCAT="/Chemistry"
export SUBCAT
;;
Clock)
SUBCAT="/Clocks"
export SUBCAT
;;
Compression)
SUBCAT="/Compression"
export SUBCAT
;;
ComputerScience)
SUBCAT="/Computer_Science"
export SUBCAT
;;
ConsoleOnly)
SUBCAT="/Console_Only"
export SUBCAT
;;
Construction)
SUBCAT="/Construction"
export SUBCAT
;;
ContactManagement)
SUBCAT="/Contact_Management"
export SUBCAT
;;
Core)
SUBCAT="/Core"
export SUBCAT
;;
DataVisualization)
SUBCAT="/Data_Visualization"
export SUBCAT
;;
Database)
SUBCAT="/Databases"
export SUBCAT
;;
Dialup)
SUBCAT="/Dial-up"
export SUBCAT
;;
Debugger)
SUBCAT="/Debuggers"
export SUBCAT
;;
DesktopSettings)
SUBCAT="/Desktop_Settings"
export SUBCAT
;;
Dialup)
SUBCAT="/Dialup"
export SUBCAT
;;
Dictionary)
SUBCAT="/Dictionaries"
export SUBCAT
;;
DiscBurning)
SUBCAT="/Disc_Burning"
export SUBCAT
;;
Documentation)
SUBCAT="/Documentation"
export SUBCAT
;;
Economy)
SUBCAT="/Economy"
export SUBCAT
;;
Electricity)
SUBCAT="/Electricity"
export SUBCAT
;;
Electronics)
SUBCAT="/Electronics"
export SUBCAT
;;
Email)
SUBCAT="/13~Email"
export SUBCAT
;;
Emulator)
SUBCAT="/Emulators"
export SUBCAT
;;
Engineering)
SUBCAT="/Engineering"
export SUBCAT
;;
FileManager)
SUBCAT="/File_Managers"
export SUBCAT
;;
FileSystem)
SUBCAT="/File_Systems"
export SUBCAT
;;
FileTools)
SUBCAT="/File_Tools"
export SUBCAT
;;
FileTransfer)
SUBCAT="/File_Transfer"
export SUBCAT
;;
Finance)
SUBCAT="/Finance"
export SUBCAT
;;
FlowChart)
SUBCAT="/Flow_Charts"
export SUBCAT
;;
Geography)
SUBCAT="/Geography"
export SUBCAT
;;
Geology)
SUBCAT="/Geology"
export SUBCAT
;;
Geoscience)
SUBCAT="/Geoscience"
export SUBCAT
;;
GNOME)
SUBCAT=""
export SUBCAT
;;
GTK)
SUBCAT=""
export SUBCAT
;;
GUIDesigner)
SUBCAT="/GUI_Designers"
export SUBCAT
;;
HamRadio)
SUBCAT="/Ham_Radio"
export SUBCAT
;;
HardwareSettings)
SUBCAT="/Hardware_Settings"
export SUBCAT
;;
History)
SUBCAT="/History"
export SUBCAT
;;
IDE)
SUBCAT="/IDE"
export SUBCAT
;;
ImageProcessing)
SUBCAT="/Image_Processing"
export SUBCAT
;;
IRCClient)
SUBCAT="/IRC_Clients"
export SUBCAT
;;
InstantMessaging)
SUBCAT="/Instant_Messaging"
export SUBCAT
;;
Java)
SUBCAT="/Java"
export SUBCAT
;;
KDE)
SUBCAT=""
export SUBCAT
;;
KDE-settins-hardware)
SUBCAT=""
export SUBCAT
;;
KidsGame)
SUBCAT="/Kids_Games"
export SUBCAT
;;
Languages)
SUBCAT="/Languages"
export SUBCAT
;;
Literature)
SUBCAT="/Literature"
export SUBCAT
;;
LogicGame)
SUBCAT="/Logic_Games"
export SUBCAT
;;
Math)
SUBCAT="/Math"
export SUBCAT
;;
MedicalSoftware)
SUBCAT="/Medical_Softwares"
export SUBCAT
;;
Midi)
SUBCAT="/MIDI"
export SUBCAT
;;
Mixer)
SUBCAT="/10~Mixers"
export SUBCAT
;;
Monitor)
SUBCAT="/Monitors"
export SUBCAT
;;
Motif)
SUBCAT="/Motif"
export SUBCAT
;;
Music)
SUBCAT="/Music"
export SUBCAT
;;
News)
SUBCAT="/News"
export SUBCAT
;;
NumericalAnalysis)
SUBCAT="/Numerical_Analysis"
export SUBCAT
;;
OCR)
SUBCAT="/OCR"
export SUBCAT
;;
P2P)
SUBCAT="/P2P"
export SUBCAT
;;
PackageManager)
SUBCAT="/Package_Managers"
export SUBCAT
;;
ParallelComputing)
SUBCAT="/Parallel_Computing"
export SUBCAT
;;
PDA)
SUBCAT="/PDA"
export SUBCAT
;;
Photography)
SUBCAT="/Photography"
export SUBCAT
;;
Physics)
SUBCAT="/Physics"
export SUBCAT
;;
Player)
SUBCAT="/Players"
export SUBCAT
;;
Presentation)
SUBCAT="/Presentations"
export SUBCAT
;;
Printing)
SUBCAT="/Printing"
export SUBCAT
;;
Profiling)
SUBCAT="/Profiling"
export SUBCAT
;;
ProjectManagement)
SUBCAT="/Project_Management"
export SUBCAT
;;
Publishing)
SUBCAT="/Publishing"
export SUBCAT
;;
QT)
SUBCAT=""
export SUBCAT
;;
RasterGraphics)
SUBCAT="/Raster_Graphics"
export SUBCAT
;;
Recorder)
SUBCAT="/Recorders"
export SUBCAT
;;
RemoteAccess)
SUBCAT="/Remote_Access"
export SUBCAT
;;
RevisionControl)
SUBCAT="/Revision_Control"
export SUBCAT
;;
Robotics)
SUBCAT="/Robotics"
export SUBCAT
;;
RolePlaying)
SUBCAT="/Role_Playing"
export SUBCAT
;;
Scanning)
SUBCAT="/Scanning"
export SUBCAT
;;
Science)
SUBCAT="/Science"
export SUBCAT
;;
Security)
SUBCAT="/Security"
export SUBCAT
;;
Sequencer)
SUBCAT="/Sequencers"
export SUBCAT
;;
Simulation)
SUBCAT="/Simulation"
export SUBCAT
;;
Sports)
SUBCAT="/Sports"
export SUBCAT
;;
SportsGame)
SUBCAT="/Sports_Games"
export SUBCAT
;;
Spreadsheet)
SUBCAT="/Spreadsheets"
export SUBCAT
;;
StrategyGame)
SUBCAT="/Strategy_Games"
export SUBCAT
;;
Sun-Supported)
SUBCAT=""
export SUBCAT
;;
Telephony)
SUBCAT="/Telephony"
export SUBCAT
;;
TelephonyTools)
SUBCAT="/Telephony_Tools"
export SUBCAT
;;
TerminalEmulator)
SUBCAT="/Terminals"
export SUBCAT
;;
TextEditor)
SUBCAT="/Text_Editors"
export SUBCAT
;;
TextTools)
SUBCAT="/Text_Tools"
export SUBCAT
;;
Translation)
SUBCAT="/Translation"
export SUBCAT
;;
Tuner)
SUBCAT="/Tuners"
export SUBCAT
;;
TV)
SUBCAT="/TV"
export SUBCAT
;;
VectorGraphics)
SUBCAT="/Vector_Graphics"
export SUBCAT
;;
VideoConference)
SUBCAT="/Webcam"
export SUBCAT
;;
Viewer)
SUBCAT="/Viewers"
export SUBCAT
;;
WebBrowser)
SUBCAT="/10~Web_Browsers"
export SUBCAT
;;
WebDevelopment)
SUBCAT="/Web_Development"
export SUBCAT
;;
WordProcessor)
SUBCAT="/Word_Processors"
export SUBCAT
;;
X-KDE*)
SUBCAT=""
export SUBCAT
;;
X-Red-Hat*)
SUBCAT=""
export SUBCAT
;;
X-"$2")
SUBCAT="/$2"
export SUBCAT
;;
*)
SUBCAT=""
export SUBCAT
;;
esac
}
gen_category() {
# Test for X-Category
MAIN_CAT=""
SUB_CAT=""
if [[ "$1" != "" ]]; then
for i in $1; do
XEXIST="$(echo "$i" | sed -e 's/.*X-.*/X-/')"
if [[ "$XEXIST" == "X-" ]]
then XCAT="$(echo "$i" | sed -e 's/X-//')"
category "$i" "$XCAT"
SUB_CAT="${SUB_CAT} ${SUBCAT}"
export SUB_CAT
else
maincategory "$i"
MAIN_CAT="${MAIN_CAT} ${MAINCAT}"
export MAIN_CAT
category "$i"
SUB_CAT="${SUB_CAT} ${SUBCAT}"
export SUB_CAT
fi
done
else
case "$2" in
/usr/share/applnk*)
CATNAME="$(echo ${2} | sed -e 's:/usr/share/applnk::' -e 's:/: :g')"
;;
/usr/share/gnome/apps*)
CATNAME="$(echo ${2} | sed -e 's:/usr/share/gnome/apps::' -e 's:/: :g')"
;;
/usr/kde/3.5/share/applnk*)
CATNAME="$(echo ${2} | sed -e 's:/usr/kde/3.5/share/applnk::' -e 's:/: :g')"
;;
/usr/kde/3.5/share/apps/kappfinder/apps*)
CATNAME="$(echo ${2} | sed -e 's:/usr/kde/3.5/share/apps/kappfinder/apps::' -e 's:/: :g')"
;;
*)
CATNAME=""
;;
esac
for i in $CATNAME; do
XEXIST="$(echo "$i" | sed -e 's/.*X-.*/X-/')"
if [[ "$XEXIST" == "X-" ]]
then XCAT="$(echo "$i" | sed -e 's/X-//')"
category "$i" "$XCAT"
SUB_CAT="${SUB_CAT} ${SUBCAT}"
export SUB_CAT
else
maincategory "$i"
MAIN_CAT="${MAIN_CAT} ${MAINCAT}"
export MAIN_CAT
category "$i"
SUB_CAT="${SUB_CAT} ${SUBCAT}"
export SUB_CAT
fi
done
fi
}
echo -n "" > non_valid_cat.log
check_category() {
# Check at it is only one main cat in the menu
TMP_CAT="$(echo $1 | sed -e 's/ //g')"
MAIN__CAT="${MAIN_CAT}"
if [[ "$TMP_CAT" != "" ]]; then
AV=""
A=""
V=""
for i in $1; do
if [[ "$i" == "/Multimedia/Audio-Video" ]]; then
AV="AV"
fi
if [[ "$i" == "/Multimedia/Audio" ]]; then
A="A"
fi
if [[ "$i" == "/Multimedia/Video" ]]; then
V="V"
fi
done
if [[ "${AV}" == "AV" ]] && [[ "${A}" == "A" ]] && [[ "${V}" == "V" ]]; then
MAIN__CAT=""
echo "$2" >> non_valid_cat.log
else
if [[ "${AV}" == "AV" ]] && [[ "${A}" == "A" ]]; then
MAIN__CAT="/Multimedia/Audio"
fi
if [[ "${AV}" == "AV" ]] && [[ "${V}" == "V" ]]; then
MAIN__CAT="/Multimedia/Video"
fi
fi
else
MAIN__CAT=""
echo "$2" >> non_valid_cat.log
fi
CATEGORY=""
for i in $MAIN__CAT; do
if [[ "$MAIN__CAT" != "" ]]; then
SUB_CAT2="$(echo $3 | sed -e 's/ //g')"
CATEGORY="$i$SUB_CAT2"
fi
break
done
export CATEGORY
}
# Write a FVWM-Crystal menu entry
# Usage: gen_entry <exec_name> <entry_name> <category> <command>
# Usage: gen_consoleentry <exec_name> <entry_name> <category> <command>
gen_entry() {
mkdir -p "${FC_MENUBASE}${3}"
FNAME="${FC_MENUBASE}$3/~$1~$2"
(
echo "#!/bin/sh"
echo
echo "exec $4 \$@"
) > "${FNAME}"
chmod +x "${FNAME}"
}
gen_consoleentry() {
mkdir -p "${FC_MENUBASE}${3}"
FNAME="${FC_MENUBASE}$3/~$1~$2"
(
echo "#!/bin/sh"
echo
echo "exec FvwmCommand 'A $4 \$@'"
) > "${FNAME}"
chmod +x "${FNAME}"
}
# # # # # # # # # # # # # # # # # # # # # # # # # # #
# Do something now
$searchdesktop $1
# Main loop
while read myline ; do
searchexecname "${myline}"
searchiconname "${myline}"
searchexist "${myline}" $EXEC
if [[ "$EXIST" == "false" ]]; then
searchkeystrings "${myline}" $USERLOC
gen_category "$CATNAME" "${myline}"
check_category "$MAIN_CAT" "${myline}" "$SUB_CAT"
if [[ "$MAIN__CAT" != "" ]]; then
echo "Generation of menu entry for ${EXEC}"
if [[ "$TERMINAL" == "true" ]]; then
gen_consoleentry "$EXEC" "$SOFTNAME" "$CATEGORY" "$COMMANDF"
else
gen_entry "$EXEC" "$SOFTNAME" "$CATEGORY" "$COMMANDF"
fi
fi
fi
done < filelist
rm filelist
echo ""
echo "All is done"
echo ""
echo "You will find the list of the desktop files with non valid Main Category in non_valid_cat.log"

Code: Select all
#!/bin/bash
#
# Made FVWM-Crystal original menu compliant with Freedesktop specifications
#
# Author: Dominique Michel, 2007
#
# Released under the GPL version 2 license.
#
# Usage: Just run this script as root
#
# FVWM-Crystal Categories FreeDesktop Categories
# /20~Games /Action_Games Game --> ActionGame
# /Adventure_Games AdventureGame
# /Arcade_Games ArcadeGame
# /Blocks_Games BlocksGame
# /Board_Games BoardGame
# /Card_Games CardGame
# /Emulators Emulator
# /Kids_Games KidsGame
# /Logic_Games LogicGame
# /Role_Playing RolePlaying
# /Simulation Simulation
# /Sports_Games SportsGame
# /Strategy_Games StartegyGame
# /Shooters X-Shooters
# /Development /Building Development --> Building
# /Databases Database
# /Debuggers Debugger
# /GUI_Designers GUIDesigner
# /IDE IDE
# /Profiling Profiling
# /Project_Management ProjectManagement
# /Revision_Control RevisionControl
# /Translation Translation
# /Web_Development WebDevelopment
# /Network /Chat Network --> Chat
# /Dial-up Dialup
# /13~Email Email
# /File_Transfer FileTransfer
# /Ham_Radio HamRadio
# /IRC_Clients IRCCClient
# /Instant_Messaging InstantMessaging
# /News News
# /P2P P2P
# /Remote_Access RemoteAcces
# /Telephony Telephony
# /Video_Conference VideoConference
# /10~Web-Browsers WebBrowser
# /Web_Development WebDevelopment
# /20~Jabber X-Jabber
# /Multimedia/Audio /Audio-Video_Editing Audio --> AudioVideoEditing
# /Ham_Radio HamRadio
# /MIDI Midi
# /10~Mixers Mixer
# /Players Player
# /Recorders Recorder
# /Sequencers_ Sequencer
# /Tuners Tuner
# /Engineering Engineering
# /Rhythm X-Rhythm
# /Multimedia/Audio-Video /Audio-Video_Editing AudioVideo --> AudioVideoEditing
# /Databases Database
# /Disc_Burning DiscBurning
# /MIDI Midi
# /10~Mixers Mixer
# /Music Music
# /Players Player
# /Recorders Recorder
# /Sequencers Sequencer
# /TV TV
# /Tuners Tuner
# /Graphics /2D_Graphics /Raster_Graphics Graphics --> 2DGraphics --> RasterGraphics
# /Vector_Graphics VectorGraphics
# /3D_Graphics 3DGraphics
# OCR OCR
# /Photography Photography
# /Publishing Publishing
# /Raster_Graphics RasterGraphics
# /Scanning /OCR Scanning --> OCR
# /Vector_Graphics VectorGraphics
# /Viewers Viewer
# /Engineering Engineering
# /Multimedia/Video /Audio-Video_Editing Video --> AudioVideoEditing
# /Players Player
# /Recorders Recorder
# /TV TV
# /Office /Calendars Office --> Calendar
# /Charts Chart
# /Contact_Management ContactManagement
# /Databases Database
# /Dictionaries Dictionary
# /13~Email Email
# /Finance Finance
# /Flow_Charts FlowChart
# /PDA PDA
# /Photography Photography
# /Presentations Presentation
# /Project_Management ProjectManagement
# /Publishing Publishing
# /Spreadsheets Spreadsheet
# /Viewers Viewer
# /Word_Processors WordProcessor
# /KOffice X-KOffice
# /OpenOffice.org X-OpenOffice.org
# /System /Emulators System --> Emulator
# /File_Managers FileManager
# /File_Systems FileSystem
# /File_Tools /File_Managers FileTools --> FileManager
# /Monitors Monitor
# /Security Security
# /Terminals TerminalEmulator
# /Knowledge /Art Education --> Art
# /Artificial_Intelligence ArtificialIntelligence
# /Astronomy Astronomy
# /Biology Biology
# /Chemistry Chemistry
# /Computer_Science /Parallel_Computing ComputerScience --> ParallelComputing
# /Construction Construction
# /Data_Visualization DataVisualization
# /Economy Economy
# /Electricity Electricity
# /Geography Geography
# /Geology Geology
# /Geoscience Geoscience
# /History History
# /Image_Processing ImageProcessing
# /Languages Languages
# /Literature Literature
# /Math Math
# /Medical_Softwares MedicalSoftware
# /Music Music
# /Numerical_Analysis NumericalAnalysis
# /Parallel_Computing ParallelComputing
# /Physics Physics
# /Robotics Robotics
# /Science /Artificial_Intelligence Science --> ArtificialIntelligence
# /Astronomy Astronomy
# /Biology Biology
# /Chemistry Chemistry
# /Computer_Science ComputerScience -->
# /Data_Visualization DataVisualization
# /Electricity Electricity
# /Geology Geology
# /Geoscience Geoscience
# /Image_Processing ImageProcessing
# /Math Math -->
# /Medical_Softwares MedicalSoftware
# /Numerical_Analysis NumericalAnalysis
# /Parallel_Computing ParallelComputing
# /Physics Physics
# /Robotics Robotics
# /Sports Sports
# /Settings /Accessibility Settings --> Accessibility
# /Desktop_Settings DesktopSettings
# /Hardware_Settings /Printing HardwareSettings --> Printing
# /Package_Managers PackageManager
# /Printing Printing
# /Security Security
# /Utilities /Accessibility Utility --> Accessibility
# /Archiving /Compression Archiving --> Compression
# /Calculators Calculator
# /Clocks Clock
# /Compression Compression
# /File_Tools /File_Managers FileTools --> FileManager
# /Telephony_Tools TelephonyTools
# /Text_Editors TextEditor
# /Text_Tools /Dictionaries TextTools --> Dictionary
# sub-categories that can be in any main category
# /Amusement any --> Amusement
# /Console_Only ConsoleOnly
# /Core Core
# /Documentation Documentation
# /Electronics Electronics
# /Engineering Engineering
# /GTK /GNOME GTK --> GNOME
# /Java Java
# /Motif Motif
# /QT /KDE Use the normal sub-cats or X-Cats
# non-used in FVWM. The other wm know what to do. reserved --> Applet
# desktop file must include a OnlyShowIn statement Screensaver
# OnlyShowIn = GNOME, KDE, ROX, XFCE, old Shell
# TrayIcon
# Additional categories can be made with the prefix "X-"
# Where is the Fvwm-Crystal menu:
FC_MENUBASE="/usr/share/fvwm-crystal/fvwm/Applications"
# Where are the icons
FC_ICONBASE="/usr/share/fvwm-crystal/fvwm/icons/Default"
SIZES="22x22 32x32 48x48"
# Some functions
# Make sure that the destination directory exist
# makedir <dir>
makedir() {
if [[ ! -d "${FC_MENUBASE}${1}" ]]; then
mkdir -p "${FC_MENUBASE}${1}"
fi
}
# Write the FVWM-Crystal menu entry
# writefile <dir> <filename> <command>
writefile() {
echo "#!/bin/sh" > "${FC_MENUBASE}${1}/$2"
echo "" >> "${FC_MENUBASE}${1}/$2"
echo "$3" >> "${FC_MENUBASE}${1}/$2"
}
# Create the FVWM-Crystal menu entry
# createfile <dir> <filename> <command>
createfile() {
makedir "$1"
writefile "$1" "$2" "$3"
}
# Remove directory
# removedir <dir>
removedir() {
if [[ -d "${FC_MENUBASE}$1" ]]; then
rm -r "${FC_MENUBASE}$1"
fi
}
# Move directory
# movedir <dir> <destdir>
movedir() {
if [[ ! -d "${FC_MENUBASE}$2" ]]; then
mv "${FC_MENUBASE}$1" "${FC_MENUBASE}$2"
else
removedir "$1"
fi
}
# Move file
# movefile <file> <dest/file>
movefile() {
if [[ -a "${FC_MENUBASE}$1" ]]; then
mv "${FC_MENUBASE}$1" "${FC_MENUBASE}$2"
fi
}
# Rename icon
# renicon <file> <dest/file>
renicon() {
for size in ${SIZES}; do
if [[ -a "${FC_ICONBASE}/${size}$1" ]]; then
mv "${FC_ICONBASE}/${size}$1" "${FC_ICONBASE}/${size}$2"
fi
done
}
#test
#createfile "$1" "$2" "$3"
# First, we need to reorganize the Crystal menu
echo ""
echo "FVWM-Crystal menu reorganization"
echo "Reorganizing Multimedia menu"
makedir "/Multimedia/Audio"
movedir "/Multimedia/10~Mixers" "/Multimedia/Audio/10~Mixers"
movedir "/Multimedia/Audio_players" "/Multimedia/Audio/Players"
makedir "/Multimedia/Audio-Video"
makedir "/Graphics/Engineering"
movefile "/Multimedia/20~Image_editors/~dia~Dia" "/Graphics/Engineering/~dia~Dia"
makedir "/Graphics/3D_Graphics"
movefile "/Multimedia/20~Image_editors/20~blender~Blender" "/Graphics/3D_Graphics/20~blender~Blender"
movefile "/Multimedia/20~Image_editors/~wings3d~Wings_3D" "/Graphics/3D_Graphics/~wings3d~Wings_3D"
makedir "/Graphics/2D_Graphics"
movefile "/Multimedia/20~Image_editors/20~gimp~GIMP" "/Graphics/2D_Graphics/20~gimp~GIMP"
movefile "/Multimedia/20~Image_editors/~tuxpaint~TuxPaint" "/Graphics/2D_Graphics/~tuxpaint~TuxPaint"
movefile "/Multimedia/20~Image_editors/20~pixel32~Pixel32" "/Graphics/2D_Graphics/20~pixel32~Pixel32"
makedir "/Graphics/Vector_Graphics"
movefile "/Multimedia/20~Image_editors/~xfig~XFig" "/Graphics/Engineering/~xfig~XFig"
movefile "/Multimedia/20~Image_editors/20~inkscape~Inkscape" "/Graphics/Vector_Graphics/20~inkscape~Inkscape"
movefile "/Multimedia/20~Image_editors/~qcad~qCAD" "/Graphics/Vector_Graphics/~qcad~qCAD"
movefile "/Multimedia/20~Image_editors/~sodipodi~Sodipodi" "/Graphics/Vector_Graphics/~sodipodi~Sodipodi"
makedir "/Graphics/Scanning"
movefile "/Multimedia/20~Image_editors/~xsane~XSane" "/Graphics/Scanning/~xsane~XSane"
removedir "/Multimedia/20~Image_editors"
makedir "/Multimedia/Video"
movedir "/Multimedia/Video_players" "/Multimedia/Video/Players"
makedir "/Multimedia/Audio/Recorders"
movefile "/Multimedia/Audio_tools/~ardour~Ardour" "/Multimedia/Audio/Recorders/~ardour~Ardour"
movefile "/Multimedia/Audio_tools/~easytag~EasyTag" "/Multimedia/Audio/~easytag~EasyTag"
movefile "/Multimedia/Audio_tools/~exfalso~Ex_Falso" "/Multimedia/Audio/~exfalso~Ex_Falso"
makedir "/Multimedia/Audio-Video/Disc_Burning"
movefile "/Multimedia/Audio_tools/~grip~Grip" "/Multimedia/Audio-Video/Disc_Burning/~grip~Grip"
makedir "/Multimedia/Audio/Rhythm"
movefile "/Multimedia/Audio_tools/~hydrogen~Hydrogen" "/Multimedia/Audio/Rhythm/~hydrogen~Hydrogen"
movefile "/Multimedia/Audio_tools/~lmms~LMMS" "/Multimedia/Audio/~lmms~LMMS"
makedir "/Multimedia/Audio/Engineering"
movefile "/Multimedia/Audio_tools/~qjackctl~QJackCtl" "/Multimedia/Audio/Engineering/~qjackctl~QJackCtl"
movefile "/Multimedia/Audio_tools/~sound-juicer~Sound_Juicer" "/Multimedia/Audio-Video/Disc_Burning/~sound-juicer~Sound_Juicer"
makedir "/Multimedia/Audio/Audio-Video_Editing"
movefile "/Multimedia/Audio_tools/~sweep~Sweep" "/Multimedia/Audio/Audio-Video_Editing/~sweep~Sweep"
movefile "/Multimedia/Audio_tools/~audacity~Audacity" "/Multimedia/Audio/Audio-Video_Editing/~audacity~Audacity"
removedir "/Multimedia/Audio_tools"
makedir "/Multimedia/Audio/Tuners"
movefile "/Multimedia/Tools/~ipodder~iPodder" "/Multimedia/Audio/Tuners/~ipodder~iPodder"
movefile "/Multimedia/Tools/~streamtuner~StreamTuner" "/Multimedia/Audio/~streamtuner~StreamTuner"
removedir "/Multimedia/Tools"
makedir "/Graphics/Photography"
movefile "/Multimedia/Image_tools/20~f-spot~F-Spot" "/Graphics/Photography/20~f-spot~F-Spot"
movefile "/Multimedia/Image_tools/~digikam~DigiKam" "/Graphics/Photography/~digikam~DigiKam"
movefile "/Multimedia/Image_tools/~gcolor2~gColor2" "/Graphics/~gcolor2~gColor2"
movefile "/Multimedia/Image_tools/~gpaint~gPaint" "/Graphics/Photography/~gpaint~gPaint"
makedir "/Graphics/Viewers"
movefile "/Multimedia/Image_tools/~gqview~GQview" "/Graphics/Viewers/~gqview~GQview"
movefile "/Multimedia/Image_tools/~gthumb~gThumb" "/Graphics/Viewers/~gthumb~gThumb"
movefile "/Multimedia/Image_tools/~gwenview~Gwenview" "/Graphics/Viewers/~gwenview~Gwenview"
movefile "/Multimedia/Image_tools/~kpaint~kPaint" "/Graphics/Photography/~kpaint~kPaint"
movefile "/Multimedia/Image_tools/~kview~kView" "/Graphics/Viewers/~kview~kView"
movefile "/Multimedia/Image_tools/~qcomicbook~QComicBook" "/Graphics/Viewers/~qcomicbook~QComicBook"
removedir "/Multimedia/Image_tools"
makedir "/Multimedia/Audio-Video/Databases"
movefile "/Multimedia/Video_tools/20~monotheka~Monotheka" "/Multimedia/Audio-Video/Databases/20~monotheka~Monotheka"
makedir "/Multimedia/Video/TV"
movefile "/Multimedia/Video_tools/20~nvtv~nVidia_TV-Out" "/Multimedia/Video/TV/20~nvtv~nVidia_TV-Out"
movefile "/Multimedia/Video_tools/20~tvtime~TVTime" "/Multimedia/Video/TV/20~tvtime~TVTime"
movefile "/Multimedia/Video_tools/20~xawtv~xawTV" "/Multimedia/Video/TV/20~xawtv~xawTV"
movefile "/Multimedia/Video_tools/20~zapping~Zapping" "/Multimedia/Video/TV/20~zapping~Zapping"
movefile "/Multimedia/Video_tools/~acidrip~AcidRip" "/Multimedia/Audio-Video/Disc_Burning/~acidrip~AcidRip"
makedir "/Multimedia/Video/Audio-Video_Editing"
movefile "/Multimedia/Video_tools/~avidemux~AVIdemux" "/Multimedia/Video/Audio-Video_Editing/~avidemux~AVIdemux"
makedir "/Multimedia/Audio-Video/Audio-Video_Editing"
movefile "/Multimedia/Video_tools/~cinelerra~Cinelerra" "/Multimedia/Audio-Video/Audio-Video_Editing/~cinelerra~Cinelerra"
movefile "/Multimedia/Video_tools/~gcfilms~GCfilms" "/Multimedia/Audio-Video/Databases/~gcfilms~GCfilms"
removedir "/Multimedia/Video_tools"
echo "Reorganizing Games menu"
movedir "/20~Games/Arcade" "/20~Games/Arcade_Games"
movedir "/20~Games/Board" "/20~Games/Board_Games"
movedir "/20~Games/Card" "/20~Games/Card_Games"
movedir "/20~Games/Logic" "/20~Games/Logic_Games"
movedir "/20~Games/RPG" "/20~Games/Role_Playing"
movedir "/20~Games/Strategy" "/20~Games/Strategy_Games"
movedir "/20~Games/20~FPP" "/20~Games/Action_Games"
movedir "/20~Games/Tetris-like" "/20~Games/Blocks_Games"
makedir "/20~Games/Emulators"
movefile "/20~Games/Others/~BillardGL~BillardGL" "/20~Games/Board_Games/~BillardGL~BillardGL"
movefile "/20~Games/Others/~billard-gl~BillardGL" "/20~Games/Board_Games/~billard-gl~BillardGL"
movefile "/20~Games/Others/~dosbox~DOSBox" "/20~Games/Emulators/~dosbox~DOSBox"
movefile "/20~Games/Others/~foobillard~FooBillard" "/20~Games/Board_Games/~foobillard~FooBillard"
movefile "/20~Games/Others/~kolf~Kolf" "/20~Games/Board_Games/~kolf~Kolf"
makedir "/20~Games/Kids_Games"
movefile "/20~Games/Others/~ktuberling~KTuberling" "/20~Games/Kids_Games/~ktuberling~KTuberling"
movefile "/20~Games/Others/~pydance~PyDance" "/20~Games/Arcade_Games/~pydance~PyDance"
removedir "/20~Games/Others"
echo "Reorganizing Development menu"
makedir "/Utilities"
movedir "/Development/Text_editors" "/Utilities/Text_Editors"
echo "Reorganizing Network menu"
movedir "/Internet" "/Network"
renicon "/categories/Internet.png" "/categories/Network.png"
movedir "/Network/10~Web_browsers" "/Network/10~Web-Browsers"
movedir "/Network/7~RSS_readers" "/Network/News"
makedir "/Network/File_Transfer"
makedir "/Network/P2P"
movefile "/Network/File_sharing/~amule~aMule" "/Network/P2P/~amule~aMule"
movefile "/Network/File_sharing/~azureus~Azureus" "/Network/P2P/~azureus~Azureus"
movefile "/Network/File_sharing/~btdownloadgui~BitTorrent_GUI" "/Network/P2P/~btdownloadgui~BitTorrent_GUI"
movefile "/Network/File_sharing/~btdownloadgui.py~BitTorrent_GUI" "/Network/P2P/~btdownloadgui.py~BitTorrent_GUI"
movefile "/Network/File_sharing/~d4x~Downloader_for_X" "/Network/File_Transfer/~d4x~Downloader_for_X"
movefile "/Network/File_sharing/~gftp~gFTP" "/Network/File_Transfer/~gftp~gFTP"
movefile "/Network/File_sharing/~giFTcurs~giFTcurs" "/Network/P2P/~giFTcurs~giFTcurs"
movefile "/Network/File_sharing/~giFToxic~giFToxic" "/Network/P2P/~giFToxic~giFToxic"
movefile "/Network/File_sharing/~gtk-gnutella~GTK_Gnutella" "/Network/P2P/~gtk-gnutella~GTK_Gnutella"
movefile "/Network/File_sharing/~kmldonkey~kMLDonkey" "/Network/P2P/~kmldonkey~kMLDonkey"
movefile "/Network/File_sharing/~ktorrent~kTorrent" "/Network/P2P/~ktorrent~kTorrent"
movefile "/Network/File_sharing/~mlgui~MLDonkey" "/Network/P2P/~mlgui~MLDonkey"
movefile "/Network/File_sharing/~mlgui~MLDonkey" "/Network/P2P/~mlgui~MLDonkey"
movefile "/Network/File_sharing/~qtorrent~QTorrent" "/Network/P2P/~qtorrent~QTorrent"
movefile "/Network/File_sharing/~valknut~Valknut" "/Network/P2P/~valknut~Valknut"
movefile "/Network/File_sharing/~xmule~xMule" "/Network/P2P/~xmule~xMule"
removedir "/Network/File_sharing"
movedir "/Network/IRC_clients" "/Network/IRC_Clients"
movefile "/Network/Usenet/10~slrn-pl~slrn-pl" "/Network/News/10~slrn-pl~slrn-pl"
movefile "/Network/Usenet/10~slrn~slrn" "/Network/News/10~slrn~slrn"
movefile "/Network/Usenet/~knode~kNode" "/Network/News/~knode~kNode"
movefile "/Network/Usenet/~pan~Pan" "/Network/News/~pan~Pan"
removedir "/Network/Usenet"
movedir "/Network/IM" "/Network/Instant_Messaging"
movedir "/Network/Instant_Messaging/20~Voice" "/Network/Telephony"
movedir "/Network/Others" "/Network/Dial-up"
echo "Reorganizing Office menu"
movedir "/Office/DTP" "/Office/Publishing"
makedir "/Office/Word_Processors"
movefile "/Office/GNOME_Office/~abiword~Abiword" "/Office/Word_Processors/~abiword~Abiword"
makedir "/Office/Spreadsheets"
movefile "/Office/GNOME_Office/~gnumeric~Gnumeric" "/Office/Spreadsheets/~gnumeric~Gnumeric"
removedir "/Office/GNOME_Office"
makedir "/Office/13~Email"
movefile "/Office/PIM/~balsa-ab~Balsa_Address_Book" "/Office/13~Email/~balsa-ab~Balsa_Address_Book"
makedir "/Office/Contact_Management"
movefile "/Office/PIM/~dlume~Dlume" "/Office/Contact_Management/~dlume~Dlume"
makedir "/Office/PDA"
movefile "/Office/PIM/~jpilot~J-Pilot" "/Office/PDA/~jpilot~J-Pilot"
movefile "/Office/PIM/~kaddressbook~kAddressBook" "/Office/Contact_Management/~kaddressbook~kAddressBook"
movefile "/Office/PIM/~kontact~Kontact" "/Office/Contact_Management/~kontact~Kontact"
makedir "/Office/Calendars"
movefile "/Office/PIM/~korganizer~kOrganizer" "/Office/Calendars/~korganizer~kOrganizer"
movefile "/Office/PIM/~kpilot~kPilot" "/Office/PDA/~kpilot~kPilot"
movefile "/Office/PIM/~rubrica~Rubrica" "/Office/Contact_Management/~rubrica~Rubrica"
movefile "/Office/PIM/~wyrd~Wyrd" "/Office/Calendars/~wyrd~Wyrd"
removedir "/Office/PIM"
echo "Reorganizing Other things"
movefile "/Other/CD_burning/10~gnomebaker~GnomeBaker" "/Multimedia/Audio-Video/Disc_Burning/10~gnomebaker~GnomeBaker"
movefile "/Other/CD_burning/10~graveman~Graveman" "/Multimedia/Audio-Video/Disc_Burning/10~graveman~Graveman"
movefile "/Other/CD_burning/10~k3b~K3B" "/Multimedia/Audio-Video/Disc_Burning/10~k3b~K3B"
movefile "/Other/CD_burning/~xcdroast~XCDRoast" "/Multimedia/Audio-Video/Disc_Burning/~xcdroast~XCDRoast"
makedir "/Knowledge/Astronomy"
movefile "/Other/Knowledge/~basket~Basket" "/Knowledge/~basket~Basket"
movefile "/Other/Knowledge/~celestia~Celestia" "/Knowledge/Astronomy/~celestia~Celestia"
movefile "/Other/Knowledge/~freemind~FreeMind" "/Knowledge/~freemind~FreeMind"
movefile "/Other/Knowledge/~ktouch~kTouch" "/Knowledge/~ktouch~kTouch"
makedir "/Office/Dictionaries"
movefile "/Other/Knowledge/~stardict~StarDict" "/Office/Dictionaries/~stardict~StarDict"
movefile "/Other/Knowledge/~stellarium~Stellarium" "/Knowledge/Astronomy/~stellarium~Stellarium"
movefile "/Other/Knowledge/~tomboy~Tomboy" "/Knowledge/~tomboy~Tomboy"
movefile "/Other/Knowledge/~ydpdict~YDP_Dictionary" "/Office/Dictionaries/~ydpdict~YDP_Dictionary"
movefile "/Other/Knowledge/~zim~Zim" "/Knowledge/~zim~Zim"
movedir "/Other/Security" "/System/Security"
removedir "/Other"
makedir "/Settings/Package_Managers"
movefile "/System/Configuration/10~drakconf~Mandrivia_Control_Center" "/Settings/10~drakconf~Mandrivia_Control_Center"
movefile "/System/Configuration/10~gnome-control-center~GNOME_Control_Center" "/Settings/10~gnome-control-center~GNOME_Control_Center"
movefile "/System/Configuration/10~kcontrol~KDE_Control_Center" "/Settings/10~kcontrol~KDE_Control_Center"
movefile "/System/Configuration/~aptitude~Aptitude" "/Settings/Package_Managers/~aptitude~Aptitude"
movefile "/System/Configuration/~aptsh~AptSh" "/Settings/Package_Managers/~aptsh~AptSh"
movefile "/System/Configuration/~gconf-editor~GConf_Editor" "/Settings/~gconf-editor~GConf_Editor"
movefile "/System/Configuration/~nvidia-settings~nVidia_Settings" "/Settings/~nvidia-settings~nVidia_Settings"
movefile "/System/Configuration/~porthole~Porthole" "/Settings/Package_Managers/~porthole~Porthole"
movefile "/System/Configuration/~smart~Smart" "/Settings/~smart~Smart"
movefile "/System/Configuration/~synaptic~Synaptic" "/Settings/Package_Managers/~synaptic~Synaptic"
removedir "/System/Configuration"
movefile "/System/Others/~mysqlcc~MySQLCC" "/System/~mysqlcc~MySQLCC"
movefile "/System/Others/~nessus~Nessus" "/System/Security/~nessus~Nessus"
makedir "/System/Monitors"
movefile "/System/Others/~qps~qps" "/System/Monitors/~qps~qps"
makedir "/Office/Finance"
movefile "/System/Others/~qtstalker~QTStalker" "/Office/Finance/~qtstalker~QTStalker"
movefile "/System/Others/~vmware~VMware" "/System/~vmware~VMware"
removedir "/System/Others"
movedir "/System/File_managers" "/System/File_Managers"
movefile "/Development/IDE/~glade-2~Glade" "/Development/IDE/~glade-2~Glade-2"
