Skip to content

Instantly share code, notes, and snippets.

@Jacajack
Last active December 2, 2017 20:52
Show Gist options
  • Save Jacajack/1aef5ecab2e966413d2a4ccbe678d256 to your computer and use it in GitHub Desktop.
Save Jacajack/1aef5ecab2e966413d2a4ccbe678d256 to your computer and use it in GitHub Desktop.
Quick wine config
#!/bin/bash
opt1="Virtual"
opt2="Manage&Decorate"
opt3="Manage"
opt4="Nothing"
mode=$(xmessage -nearmouse -print -buttons $opt1,$opt2,$opt3,$opt4 "Please select Wine graphics mode...")
#Abort if no choice has been made
if [[ -z $mode ]]; then
exit 0;
fi
desktop=""
manage="N"
decorate="N"
grab="N"
file="wconf.reg"
#Virtual desktop
if [ $mode == $opt1 ]; then
manage="Y"
decorate="Y"
grab="N"
desktop="Default"
fi
#Manage and decorateifconfig
if [ $mode == $opt2 ]; then
manage="Y"
decorate="Y"
grab="N"
desktop=""
fi
#Only manage
if [ $mode == $opt3 ]; then
manage="Y"
decorate="N"
grab="N"
desktop=""
fi
#Do not affect
if [ $mode == $opt4 ]; then
manage="N"
decorate="N"
grab="N"
desktop=""
fi
#Generate the first registry entry
cat > $file << EOF
REGEDIT4
[HKEY_USERS\S-1-5-21-0-0-0-1000\Software\Wine\X11 Driver]
"Decorated"="$decorate"
"GrabFullscreen"="$grab"
"Managed"="$manage"
EOF
regedit $file
rm $file
#Generate the virtual desktop registry entry
cat > $file << EOF
REGEDIT4
[HKEY_USERS\S-1-5-21-0-0-0-1000\Software\Wine\Explorer]
"Desktop"="$desktop"
EOF
regedit $file
rm $file
--- wine.desktop 2017-12-02 21:51:35.582507361 +0100
+++ /usr/share/applications/wine.desktop 2017-12-02 21:42:19.054486049 +0100
@@ -24,7 +24,7 @@
Name[hr]=Wine - dizač Windows programa
Name[he]=Wine — מריץ תכניות Windows
Name[ja]=Wine Windowsプログラムローダー
-Exec=wine start /unix %f
+Exec=sh -c "qwcfg; wine start /unix %f"
MimeType=application/x-ms-dos-executable;application/x-msi;application/x-ms-shortcut;
Icon=wine
NoDisplay=true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment