Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Portage & Programming
  • Search

bash: filtrering text. [solved]

Problems with emerge or ebuilds? Have a basic programming question about C, PHP, Perl, BASH or something else?
Post Reply
Advanced search
17 posts • Page 1 of 1
Author
Message
Dominique_71
Veteran
Veteran
User avatar
Posts: 1957
Joined: Wed Aug 17, 2005 1:01 pm
Location: Switzerland (Romandie)

bash: filtrering text. [solved]

  • Quote

Post by Dominique_71 » Fri Feb 16, 2007 1:33 pm

I try to write a script that will search for application type desktop files and generate the non existing entry in my fvwm-crystal menu.

I cannot figure out how I can filter out some non wanted string.

It is an Exec=string key in the desktop file. The string part of this key can be just the command name, or the command name followed by a lot of different things.
Some examples from some desktop files:
Exec=Frinika
Exec=kino %F
Exec=xdg-open http://localhost:631/

To search for the existent entry, I must keep only the command name, as example Friniky or kino or xdg-open. How can I filter out both the Exec= and the command parameters?

I try a few things with sed and grep, but it was not working.
Last edited by Dominique_71 on Sat Apr 07, 2007 9:32 pm, edited 5 times in total.
"Confirm You are a robot." - the singularity
Top
truc
Advocate
Advocate
User avatar
Posts: 3199
Joined: Mon Jul 25, 2005 9:24 am

  • Quote

Post by truc » Fri Feb 16, 2007 1:53 pm

Code: Select all

sed s/Exec=\([^ ]*\) .*/\1/
:?:
The End of the Internet!
Top
Dominique_71
Veteran
Veteran
User avatar
Posts: 1957
Joined: Wed Aug 17, 2005 1:01 pm
Location: Switzerland (Romandie)

  • Quote

Post by Dominique_71 » Fri Feb 16, 2007 2:41 pm

Thank you,

My script use some temporary files as it make debugging easier. I have now the following:

Code: Select all

...
while read myline ; do
		if [[ -n "${myline}" ]]; then
			MenuExecName="$(sed 's/Exec=\([^ ]*\) .*/\1/' ${myline})"
			echo "${MenuExecName}" >> entryname
		fi
done < execfulllist
I get a lot of errors

Code: Select all

sed: impossible de lire Exec=kdenlive -caption "%c" %i %m: Aucun fichier ou répertoire de ce type
It mean sed: unable to read Exec=...: no file or directory of this type.
"Confirm You are a robot." - the singularity
Top
truc
Advocate
Advocate
User avatar
Posts: 3199
Joined: Mon Jul 25, 2005 9:24 am

  • Quote

Post by truc » Fri Feb 16, 2007 2:49 pm

${myline} is not a file.. it's a variable

so you here is what you can do

Code: Select all

blahblah..
enuExecName="$(echo ${myline} | sed 's/Exec=\([^ ]*\) .*/\1/' )"
blahblah..
but.. once you've finished with all your debugging, you could do this

Code: Select all

sed 's/Exec=\([^ ]*\) .*/\1/' execfullist > entryname
instead of your while loop
The End of the Internet!
Top
Dominique_71
Veteran
Veteran
User avatar
Posts: 1957
Joined: Wed Aug 17, 2005 1:01 pm
Location: Switzerland (Romandie)

  • Quote

Post by Dominique_71 » Fri Feb 16, 2007 3:23 pm

Thanks, it begin to work.

It is still 2 problems. With the commands that doesn't have any parameters, I get "Exec=command" and it is some entries in my input file that begin with TryExec= and not Exec=. I try the following and it work well:

Code: Select all

MenuExecName="$(echo ${myline} | sed 's/Exec=\([^ ]*\) .*/\1/' \
			| sed 's/Exec=//' | sed 's/TryExec=//' )"
Do you know if it is possible to combine the 3 sed commands in only one that will do the same?
"Confirm You are a robot." - the singularity
Top
truc
Advocate
Advocate
User avatar
Posts: 3199
Joined: Mon Jul 25, 2005 9:24 am

  • Quote

Post by truc » Fri Feb 16, 2007 3:55 pm

Code: Select all

cat execfullist | sed -e '/^Exec=/!d' -e 's/^Exec=\([^ ]*\) .*/\1/'
should do it then :?:

EDIT: even

Code: Select all

sed -e '/^Exec=/!d' -e 's/^Exec=\([^ ]*\) .*/\1/' execfullist > entryname
should work :)
The End of the Internet!
Top
Dominique_71
Veteran
Veteran
User avatar
Posts: 1957
Joined: Wed Aug 17, 2005 1:01 pm
Location: Switzerland (Romandie)

  • Quote

Post by Dominique_71 » Fri Feb 16, 2007 4:37 pm

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.

Edit: I find a way to simplify a little my chain:

Code: Select all

MenuExecName="$(echo ${myline} | sed 's/Exec=\([^ ]*\) .*/\1/' \
			| sed 's/Exec=\|TryExec=//' )"
But I find another problem with this script. It is some desktop file that have command such as

Code: Select all

/usr/bin/firefox
and find don't like it. Is it possible to filter out the path?
"Confirm You are a robot." - the singularity
Top
truc
Advocate
Advocate
User avatar
Posts: 3199
Joined: Mon Jul 25, 2005 9:24 am

  • Quote

Post by truc » Fri Feb 16, 2007 4:55 pm

Dominique_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.
oh my mistake

Code: Select all

sed -e '/^Exec=/!d' -e 's/^Exec=\([^ ]*\).*/\1/'
should do it
But I find another problem with this script. It is some desktop file that have command such as

Code: Select all

/usr/bin/firefox
and find don't like it. Is it possible to filter out the path?
find ? or sed? if it's sed, then, instead of the above command, you can run this

Code: Select all

sed -e '/^Exec=/!d' -e 's;^Exec=\([^ ]*\).*;\1;'

Was it your problem? give us more code!
The End of the Internet!
Top
Dominique_71
Veteran
Veteran
User avatar
Posts: 1957
Joined: Wed Aug 17, 2005 1:01 pm
Location: Switzerland (Romandie)

  • Quote

Post by Dominique_71 » Fri Feb 16, 2007 5:24 pm

truc wrote:

Code: Select all

sed -e '/^Exec=/!d' -e 's/^Exec=\([^ ]*\).*/\1/'
should do it.
It work, but the generated files are not the sames. The TryExec= lines are just blank lines with your syntax.
But I find another problem with this script. It is some desktop file that have command such as

Code: Select all

/usr/bin/firefox
and find don't like it. Is it possible to filter out the path?
find ? or sed? if it's sed, then, instead of the above command, you can run this

Code: Select all

sed -e '/^Exec=/!d' -e 's;^Exec=\([^ ]*\).*;\1;'

Was it your problem? give us more code!
Sorry, my fault. I use find later to search for existing menu entries.

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
Edit: I try you last syntax,

Code: Select all

sed -e '/^Exec=/!d' -e 's;^Exec=\([^ ]*\).*;\1;'
but I still have the path when the (Try)Exec=filename include the full path in filename, and the TryExec line are blank lines.
"Confirm You are a robot." - the singularity
Top
truc
Advocate
Advocate
User avatar
Posts: 3199
Joined: Mon Jul 25, 2005 9:24 am

  • Quote

Post by truc » Fri Feb 16, 2007 10:29 pm

oh :S I didn't know you also want the TryExec lines (was doing my best to delete them :lol: )
so...

Code: Select all

 sed -e '/^\(Try\|\)Exec=/!d' -e 's:^.\{0,3\}Exec=\([^ ]*\).*:\1:' -e 's:.*/::'
:?:

(it should also delete the path)
The End of the Internet!
Top
Dominique_71
Veteran
Veteran
User avatar
Posts: 1957
Joined: Wed Aug 17, 2005 1:01 pm
Location: Switzerland (Romandie)

  • Quote

Post by Dominique_71 » Sat Feb 17, 2007 10:55 am

Thank you, it work fine.

I have now a skeleton that look for the keys I need to be able to generate the entries.
I also begun to write another script that reorganize Crystal menu (at least Crystal multimedia menu need to be reorganized because it correspond to 4 main categories of freedesktop specs) and write the new entries.

I will have to mix the 2 scripts together. But it will take some time. And I will maybe reopen this topic later.
"Confirm You are a robot." - the singularity
Top
Dominique_71
Veteran
Veteran
User avatar
Posts: 1957
Joined: Wed Aug 17, 2005 1:01 pm
Location: Switzerland (Romandie)

  • Quote

Post by Dominique_71 » Sun Feb 25, 2007 9:58 pm

I am done with the script that reorganize FVWM-Crystal menu and I have a new problem. I try to write a function that will write the enry file for the menu and I cannot get it to write the right charachters:

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
If I call this with

Code: Select all

./gen-fvwm-crystal-menu-entry.bash test1 test2 test3 test4
I get the file /home/dom/CrystalAudio/tmp/Applications/test3/~test1~test2 and that is correct. The content of the file is

Code: Select all

#!/bin/sh

exec test4 test1 test2 test3 test4
when it should be

Code: Select all

#!/bin/sh

exec test4 $@
Another problem is at I must write the path in whole, I mean with the leading "/home/dom" in FC_MENUBASE. I cannot figure out how I can made it to work with "~/CrystalAudio/tmp/Applications".

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 $@...

EDIT 2:I find it too. It is just to write

Code: Select all

echo "exec $4 \$@"
Last edited by Dominique_71 on Mon Feb 26, 2007 10:24 am, edited 1 time in total.
"Confirm You are a robot." - the singularity
Top
ThomasAdam
Guru
Guru
Posts: 448
Joined: Sun Mar 20, 2005 10:27 pm
Location: England
Contact:
Contact ThomasAdam
Website

  • Quote

Post by ThomasAdam » Mon Feb 26, 2007 10:22 am

Dominique_71 wrote:when it should be

Code: Select all

#!/bin/sh

exec test4 $@
Your problem is that you have:

Code: Select all

SLUT="$@"
Which your shell (bash in this case) is correctly interpolating. If all you want is a literal "$@" to be embedded in your script, then you want:

Code: Select all

foo="\$@"
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.
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 $@...
Don't use "$USER" here as it can be faked. Better to use something like:

Code: Select all

FOO="$(id -nu)"
Although it's academic at this point, and you'd do well to rethink parts of this.

-- Thomas Adam
Top
Dominique_71
Veteran
Veteran
User avatar
Posts: 1957
Joined: Wed Aug 17, 2005 1:01 pm
Location: Switzerland (Romandie)

  • Quote

Post by Dominique_71 » Mon Feb 26, 2007 5:01 pm

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
Thank you Thomas,

What is here will be only a little part of the final script. I done a few try with some functions and now I must assemble all of it. What I think to do when searching for desktop files is to first search for desktop files in only a few system directories as /usr/share/applications, and second eliminate all the non application type desktop files and all with a OnlyShowIn key. After that, I will filter out all the parameters in the command line, mainly because the commands will just not work with those parameters in something else as kde. As example, if a desktop file contain "Exec=rm -f -R ?*", the resulting command in the fvwm-crystal menu file will be "exec FvwmCommand 'rm $@'" if the desktop file contain the key Terminal=true, "exec rm $@" otherwise.

What are you thinking exactly when saying wide open to massive exploits? All what my script will do is to search for existing desktop file and generate FVWM-Crystal menu entries. The only user interaction will be the possibility to search for a specific desktop file or not. If an exploit exist in a desktop file, it will already be a problem for all the users of wm as gnome or kde that use directly the desktop files to generate their menu.
"Confirm You are a robot." - the singularity
Top
Dominique_71
Veteran
Veteran
User avatar
Posts: 1957
Joined: Wed Aug 17, 2005 1:01 pm
Location: Switzerland (Romandie)

  • Quote

Post by Dominique_71 » Tue Feb 27, 2007 9:13 am

Here is what I have for now. The only useful features at that time are icon generation and menu entries generation from new desktop file or a program name:
Otherwise, it display some informations (most of them will be commented out or removed later:

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"

Any comment from bash expert will be welcome. It is my first big script and I am sure at many things can be better or even can be wrong. Don't look too much at the algorithm, it work for now, but more about security issues as Thomas suggested. I made an assumption from the beginning: users have only valid application type desktop files in their system, so it is not the job of this script to check if a desktop file is valid or some kind of garbage. With security issues, I am thinking about all I don't know about bash scripting and how users can try to trick a script (see Thomas remark about the use of id against $USER.).

EDIT: I updated with what I have done today. I changed the command line that will be inserted in the menu entries. Some of the parameters will be incorporated, but not all.

EDIT": I updated with the final (at least for now) version of this scipt.
Last edited by Dominique_71 on Wed Mar 14, 2007 2:49 pm, edited 2 times in total.
"Confirm You are a robot." - the singularity
Top
Dominique_71
Veteran
Veteran
User avatar
Posts: 1957
Joined: Wed Aug 17, 2005 1:01 pm
Location: Switzerland (Romandie)

  • Quote

Post by Dominique_71 » Thu Mar 01, 2007 10:37 pm

Well, I updated the script in the last post. It begin to work. If you want to try it, it is best to first do a backup of ~/.fvwm-crystal/applications and to run is as normal user. The categories in fvwm-crystal menu are not exactly the sames. As example, I moved graphics out of multimedia and it is a few more main categories. If you want to reorganize the original fvwm-crystal menu, you can use the following script:

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"

"Confirm You are a robot." - the singularity
Top
Dominique_71
Veteran
Veteran
User avatar
Posts: 1957
Joined: Wed Aug 17, 2005 1:01 pm
Location: Switzerland (Romandie)

  • Quote

Post by Dominique_71 » Wed Mar 14, 2007 3:02 pm

I updated the first script. It work with both new and old type dektop files. The non valid files are very few now. Thoses files are only the files with non valid main category for which it is no existing menu entries. In case of existing fvwm-crystal menu entries, they are eliminated before the category test and just not accounted at all.

To test the script, I moved both the Applications and icons directories, so the script redone the whole menu and a lot of icons from the scratch. It done a very good job. It was only 4 non valid files on more as 1000 found desktop files and a lot of generated menu entries and icons.

For error testing, much of the tests are done in the multiple sed statements.

So, the 2 scripts are working very well for me, but I will appreciate comments. But try to be specific, just say "you are open to massive exploits" doesn't help me. So, in such cases, give me at least some pointer(s) to documentation(s) that deal with the thing(s) you are thinking must be ameliorated.
"Confirm You are a robot." - the singularity
Top
Post Reply

17 posts • Page 1 of 1

Return to “Portage & Programming”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic