Skip to content

Instantly share code, notes, and snippets.

@panta82
Last active March 27, 2024 20:00
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save panta82/df28c33ca87de9264b52fd7a53e61601 to your computer and use it in GitHub Desktop.
Save panta82/df28c33ca87de9264b52fd7a53e61601 to your computer and use it in GitHub Desktop.
Foobar2000 + wine setup

1. Install wine:

sudo apt install wine-stable winetricks

2. Get foobar installation here: https://mega.nz/file/HJhlEIIJ#PfjkrfPPu0TGzJ_ukgn2LX3fWRWsZK7o16beHAh4roY

Unpack it under /home/panta/.wine/drive_c/opt/.

3. Enable font smoothing. It can be done through winetricks, or using wine-font-smoothing.sh. Select 3rd option (rgb). This will make fonts not look like shit.

4. Run winecfg and switch Windows version to "Windows XP". That will make volume control work.

5. Using winetricks, import wine_breeze_colors.reg. This will make UI look white and pretty instead of gray and old.

6. Save foobar.sh under /usr/local/bin/foobar2000.

7. Save foobar2000.desktop under /usr/share/applications/foobar2000.desktop

8. Run sudo update-desktop-database.

#!/bin/sh
cd /home/panta/.wine/drive_c/opt/foobar2000
if [ "$1" != "" ]; then
filename=`echo z:$1 | sed 's/\\//\\\\/g'`
wine foobar2000.exe "$filename" >/dev/null 2>&1 &
else
wine foobar2000.exe >/dev/null 2>&1 &
fi
[Desktop Entry]
Type=Application
Name=foobar2000
GenericName=Plays Music
Version=1.0
Encoding=UTF-8
Terminal=false
Exec=/usr/local/bin/foobar2000
Comment=Plays Music
Icon=/home/panta/.wine/drive_c/opt/foobar2000/foobar.png
Categories=GNOME;GTK;AudioVideo;Audio;Player;
#!/bin/sh
# Quick and dirty script for configuring wine font smoothing
#
# Author: Igor Tarasov <tarasov.igor@gmail.com>
WINE=${WINE:-wine}
WINEPREFIX=${WINEPREFIX:-$HOME/.wine}
DIALOG=whiptail
if [ ! -x "`which "$WINE"`" ]
then
echo "Wine was not found. Is it really installed? ($WINE)"
exit 1
fi
if [ ! -x "`which "$DIALOG"`" ]
then
DIALOG=dialog
fi
TMPFILE=`mktemp` || exit 1
$DIALOG --menu \
"Please select font smoothing mode for wine programs:" 13 51\
4\
1 "Smoothing disabled"\
2 "Grayscale smoothing"\
3 "Subpixel smoothing (ClearType) RGB"\
4 "Subpixel smoothing (ClearType) BGR" 2> $TMPFILE
STATUS=$?
ANSWER=`cat $TMPFILE`
if [ $STATUS != 0 ]
then
rm -f $TMPFILE
exit 1
fi
MODE=0 # 0 = disabled; 2 = enabled
TYPE=0 # 1 = regular; 2 = subpixel
ORIENTATION=1 # 0 = BGR; 1 = RGB
case $ANSWER in
1) # disable
;;
2) # enable
MODE=2
TYPE=1
;;
3) # enable cleartype rgb
MODE=2
TYPE=2
;;
4) # enable cleartype bgr
MODE=2
TYPE=2
ORIENTATION=0
;;
*)
rm -f $TMPFILE
echo Unexpected option: $ANSWER
exit 1
;;
esac
echo "REGEDIT4
[HKEY_CURRENT_USER\Control Panel\Desktop]
\"FontSmoothing\"=\"$MODE\"
\"FontSmoothingOrientation\"=dword:0000000$ORIENTATION
\"FontSmoothingType\"=dword:0000000$TYPE
\"FontSmoothingGamma\"=dword:00000578" > $TMPFILE
echo -n "Updating configuration... "
$WINE regedit $TMPFILE 2> /dev/null
rm -f $TMPFILE
echo ok
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Control Panel\Colors]
"ActiveBorder"="239 240 241"
"ActiveTitle"="71 80 87"
"AppWorkSpace"="239 240 241"
"Background"="26 26 26"
"ButtonAlternateFace"="179 180 181"
"ButtonDkShadow"="248 249 249"
"ButtonFace"="239 240 241"
"ButtonHilight"="248 249 249"
"ButtonLight"="179 180 181"
"ButtonShadow"="179 180 181"
"ButtonText"="0 0 0"
"GradientActiveTitle"="71 80 87"
"GradientInactiveTitle"="239 240 241"
"GrayText"="100 101 102"
"Hilight"="61 174 233"
"HilightText"="255 255 255"
"HotTrackingColor"="61 174 233"
"InactiveBorder"="239 240 241"
"InactiveTitle"="239 240 241"
"InactiveTitleText"="189 195 195"
"InfoText"="0 0 0"
"InfoWindow"="255 255 225"
"Menu"="248 249 249"
"MenuBar"="239 240 241"
"MenuHilight"="61 174 233"
"MenuText"="0 0 0"
"Scrollbar"="239 240 241"
"TitleText"="255 255 255"
"Window"="255 255 255"
"WindowFrame"="179 180 181"
"WindowText"="0 0 0"
@kalavinka
Copy link

kalavinka commented Mar 17, 2023

Thanks for posting this gist! It helped me a lot in getting foobar working. Starring it for future convenience.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment