Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
tree: ce29e54e13
Fetching contributors…

Cannot retrieve contributors at this time

executable file 45 lines (39 sloc) 1.338 kb
#!/bin/bash
# Required: lp64
PREFIX="$1"
RELATIVEPATH="$2"
if [ -z "$PREFIX" ]; then
echo "Usage: $0 <prefixname> [<relative program path>]"
echo "relative program path: unix path from drive C root"
echo " (eg. 'Program Files/GOG.com/Lure of Temptress/')"
exit 1
fi
WINEPREFIX="$HOME/.PlayOnLinux/wineprefix/$PREFIX"
if [ ! -d "$WINEPREFIX" ]; then
echo "Prefix \`$PREFIX' does not exist."
exit 1
fi
if [ ! -d "$WINEPREFIX/drive_c/users/Public/Start Menu" ]; then
echo "Could not find global menu data"
exit 1
fi
for user in "Public" "`id -un`"; do
cd "$WINEPREFIX/drive_c/users/$user/Start Menu" &&
find . -type f -a -name '*.lnk' -print| \
while read lnkname; do
# echo "----------"
# echo "$lnkname"
LABEL="${lnkname##*/}"
LABEL="${LABEL%.lnk}"
IFS='' LP_OUT="$(lp64 $lnkname)"
BIN="$(echo $LP_OUT|perl -ne 'chomp; if(/^ID List:\s*(.*)/) { print $1 }')"
# echo "raw bin: $BIN"
BIN="${BIN//\\//}"
# echo "forward slashes bin: $BIN"
BIN="${BIN#*drive_c/}"
[ -n "$RELATIVEPATH" ] && BIN="${BIN#$RELATIVEPATH}"
# echo "relative bin: $BIN"
ARGS="$(echo $LP_OUT|perl -ne 'chomp; if(/^cmdline args:\s*(.*)/) { print $1 }')"
echo -e " * $LABEL\t[\"$BIN\" $ARGS]"
done
done
Jump to Line
Something went wrong with that request. Please try again.