Help: How to convert this bash+awk script in awk script only?

This is the final first release of the dynamic menu generator for pekwm (WM).

#!/bin/bash

function param_val {
    awk "/^${1}=/{gsub(/^${1}="'/,""); print; exit}' $2
}
 
echo "Dynamic {" 
for CF in `ls -c1 /usr/share/applications/*.desktop`
do
    name=$(param_val Name $CF)

    executable=$(param_val Exec $CF)

    icon=$(param_val Icon $CF)

    categories=$(param_val Categories $CF | awk -F ";" '{print $1}')

    echo " Entry = \"$name\" { Actions = \"Exec $executable\" }"

done
echo "}"

Someone could help to convert this script on awk only?
While maintain the same clearity as now with this hybrid combination of bash+awk?

Note:
I decide to split it for maintain the discussion more clear, with an initial problem and with a final end.
So now i ask only one question each time.

#! /bin/sh


awk '
FILENAME!=f {
	if ( NR>1 ) {
		print "}"
	}
	print "Dynamic {"
	name=0
	exec=0
}
/^Name=/ && name==0 {
	sub("^Name="," Entry = ")
	print
	name=1
} 
/^Exec=/ && exec==0 {
	sub("^Exec="," Action = \"")
	print $0 "\""
	exec=1

}
{
	f=FILENAME
}
END {
	print "}"
}
' /usr/share/applications/*

I left out icon and category, since they weren't being printed:

awk -F= '
   BEGIN{print "Dynamic {"} 
   /^Name=/{name=$2} 
   /^Exec=/{executable=$2}
   name && executable{
     print " Entry = " name " { Actions = \"Exec " executable "\" }"
     name=executable=""
   }
   END{print "}"}
' /usr/share/applications/*.desktop

Thanks for the attempt but i prefer an awk script only. Don't a awk script that is launched from a bash script.
Probably Icon will be few useful but i need Categories because, once is clear, with your help how is possible convert the initial script (in particular how convert the function param_val (after try few days without success ... :wall:) and Categories ... later, i will make an attempt of using associative array for build a menu with submenu.
But until i don't known how resolve the initial issue, i'm stopped. :frowning: