Wine menus - rebuilding, deleting
Wine menus - rebuilding, deleting
Hi
I have a few questions about Wine's menu handling:
1. Is there some kind of command that will build a wine menu based on
all the files in the standard locations (Start menu and Desktop)? This
would be useful for rebuilding the Wine menu after deleting it. (Since
deleting the menu entries belonging to a single prefix is not easy)
winemenubuilder seem to take only single shortcuts as parameters (and
is does not give help on any obvious paramenters (/? -h --help))
according to http://wiki.winehq.org/winemenubuilder
2. Is there a way to delete only a single WINEPREFIX's menu entries?
(The FAQ's methods is a bit of a sledgehammer)
3. If there is no obvious ways to do any of the above, do anyone have
some scripts to assist with these tasks?
I have changed distributions from Gentoo x86 to Ubuntu x86_64 and have
copied several WINEPREFIXes (Actually most of my $HOME, except for
some hidden files, which it though might break some things..) over.
(They seem to work fine except for some weirdness mostly involving the
Gecko upgrade (for some reason I only had the old version in
/usr/share/wine/gecko))
Gert
I have a few questions about Wine's menu handling:
1. Is there some kind of command that will build a wine menu based on
all the files in the standard locations (Start menu and Desktop)? This
would be useful for rebuilding the Wine menu after deleting it. (Since
deleting the menu entries belonging to a single prefix is not easy)
winemenubuilder seem to take only single shortcuts as parameters (and
is does not give help on any obvious paramenters (/? -h --help))
according to http://wiki.winehq.org/winemenubuilder
2. Is there a way to delete only a single WINEPREFIX's menu entries?
(The FAQ's methods is a bit of a sledgehammer)
3. If there is no obvious ways to do any of the above, do anyone have
some scripts to assist with these tasks?
I have changed distributions from Gentoo x86 to Ubuntu x86_64 and have
copied several WINEPREFIXes (Actually most of my $HOME, except for
some hidden files, which it though might break some things..) over.
(They seem to work fine except for some weirdness mostly involving the
Gecko upgrade (for some reason I only had the old version in
/usr/share/wine/gecko))
Gert
Re: Wine menus - rebuilding, deleting
I've used this to rebuild menu structure:Gert van den Berg wrote:1. Is there some kind of command that will build a wine menu based on all the files in the standard locations (Start menu and Desktop)?
Code: Select all
export WINEPREFIX=~/.wine; find $WINEPREFIX/drive_c/ -name "*.lnk" -exec wine winemenubuilder '{}' \;
Just look for entries containing your WINEPREFIX.Gert van den Berg wrote:2. Is there a way to delete only a single WINEPREFIX's menu entries?
Wine menus - rebuilding, deleting
On Sun, Feb 8, 2009 at 7:24 PM, vitamin <[email protected]> wrote:
useful. It is meant for my ~/.wine-* type of prefixes and ignores the
Desktop and icons. It does not do the standard .wine directory,
although it should be easy to add)
If I have some time I might do a Perl script that can handle separate
prefixes. (I would probably need to look inside the .desktop files...)
This should have the advantage of not breaking edits (such as using a
patched Wine-git for Warcraft...)
#!/bin/sh
find="/usr/bin/find"
wine="wine"
rm="/bin/rm"
# Clears menus - leaves desktop and icons alone
"$rm" -f $HOME/.config/menus/applications-merged/wine*
"$rm" -rf $HOME/.local/share/applications/wine
# Rebuild Start Menu for all prefixes starting with ".wine-"
for prefix in "$HOME/".wine-*; do
WINEPREFIX="$prefix"
export WINEPREFIX
"$find" "$WINEPREFIX/drive_c/" -name '*/Start Menu/*.lnk'
-exec "$wine" winemenubuilder '{}' \; 2> /dev/null
done
Thanks. I build the following little script below (If someone finds itGert van den Berg wrote:I've used this to rebuild menu structure:1. Is there some kind of command that will build a wine menu based on all the files in the standard locations (Start menu and Desktop)?
Code:
export WINEPREFIX=~/.wine; find $WINEPREFIX/drive_c/ -name "*.lnk" -exec wine winemenubuilder '{}' \;
useful. It is meant for my ~/.wine-* type of prefixes and ignores the
Desktop and icons. It does not do the standard .wine directory,
although it should be easy to add)
If I have some time I might do a Perl script that can handle separate
prefixes. (I would probably need to look inside the .desktop files...)
This should have the advantage of not breaking edits (such as using a
patched Wine-git for Warcraft...)
#!/bin/sh
find="/usr/bin/find"
wine="wine"
rm="/bin/rm"
# Clears menus - leaves desktop and icons alone
"$rm" -f $HOME/.config/menus/applications-merged/wine*
"$rm" -rf $HOME/.local/share/applications/wine
# Rebuild Start Menu for all prefixes starting with ".wine-"
for prefix in "$HOME/".wine-*; do
WINEPREFIX="$prefix"
export WINEPREFIX
"$find" "$WINEPREFIX/drive_c/" -name '*/Start Menu/*.lnk'
-exec "$wine" winemenubuilder '{}' \; 2> /dev/null
done
Wine menus - rebuilding, deleting
On Mon, Feb 9, 2009 at 7:00 PM, Gert van den Berg <[email protected]> wrote:
which might be hard to find on non-Linux operating systems...
Gert
Should be -wholename, which probably means that it requires GNU find,"$find" "$WINEPREFIX/drive_c/" -name '*/Start Menu/*.lnk' -exec "$wine" winemenubuilder '{}' \; 2> /dev/null
which might be hard to find on non-Linux operating systems...
Gert
-
- Newbie
- Posts: 1
- Joined: Mon May 04, 2009 8:04 am
Thanks for the work you did on this - I needed it to clean out some messy entries in Gnome after moving a $HOME structure to a newer Ubuntu release - the original menus had their titles messed up in ~/.local/share/applications/
I rewrote your script to use shell constructs instead of 'find'. I've copied it here for others to play with.
I rewrote your script to use shell constructs instead of 'find'. I've copied it here for others to play with.
Code: Select all
#!/bin/sh
wine="wine"
rm="/bin/rm"
iterate_start_menu ()
{
local menu_dir
local oldIFS
menu_dir=$1
# don't use space as field-separator otherwise "paths with spaces" will fail to parse correctly
oldIFS=$IFS
IFS=?
echo "menu_dir=${menu_dir}"
# add a trailing slash to the directory name, then the glob wildcard
for entry in ${menu_dir}/*; do
if [ -f "$entry" ]; then
echo "Link: $entry";
"$wine" winemenubuilder "$entry" 2>/dev/null
elif [ -d "$entry" ]; then
echo "Directory: $entry";
iterate_start_menu "$entry"
else
echo "Empty: $entry";
fi
done
IFS=$oldIFS
}
# Delete current user-defined wine menus
"$rm" -f $HOME/.config/menus/applications-merged/wine*
"$rm" -rf $HOME/.local/share/applications/wine
# Rebuild Start Menu for all prefixes starting with ".wine-" or ".wine" itself
for prefix in "$HOME/".wine-* "$HOME/".wine; do
WINEPREFIX="$prefix"
export WINEPREFIX
# do not use a trailing / at the end of the directory name
iterate_start_menu "${WINEPREFIX}/drive_c/windows/profiles/*/Start Menu"
done
Hi,
I tried to renew all my wine Folders in the K Menu. At first I deleted the "Program" Folder.
After executing your script I realize that it has created a lot of files in
and in
I think there are also new files in this folder:
But in the K Menu I cannot find any item to start the wine programs even after running
This happens under openSuse 12.1 with KDE 4.7.3 and wine 1.3.30
Please can anyone help me.
I tried to renew all my wine Folders in the K Menu. At first I deleted the "Program" Folder.
After executing your script I realize that it has created a lot of files in
Code: Select all
$HOME/.config/menus/applications-merged
Code: Select all
$HOME/.local/share/applications/wine
Code: Select all
$HOME/.kde4/share/applnk
Code: Select all
kbuildsycoca4
Please can anyone help me.