It seems that you're using an outdated browser. Some things may not work as they should (or don't work at all).
We suggest you upgrade newer and better browser like: Chrome, Firefox, Internet Explorer or Opera

×
avatar
Anders_Jenbo: Audio is fixed now :D
I‘ve seen that in the changelog of the latest release, well done!

Learning about this project at the exact time I couldn’t run Diablo with WINE anymore saved me a lot of time in debugging, that I can spend playing Diablo instead.
I’m going to follow development closely, and of course open issues on the bugs tracker if I can spot anything not behaving as expected ;)
avatar
shmerl: What's the recommended scriptable way to restore monitor gamma levels, after some Wine games modify them?

I found xgamma tool, but it's tied to Xorg, so not sure if it's a suitable approach in general case like for Wayland. I suppose it depends on how gamma modification from XWayland would work, i.e. whether it persist after some game closes down. I haven't been using Wayland session recently due to some annoying bugs in KWin, but still would good to know if there is a generic approach.
I'm not sure about restoring gamma levels but I usually just set

[HKEY_CURRENT_USER\Software\Wine\X11 Driver]
"UseXVidMode"="N"

for my wine prefixes. This prevents wine from changing the gamma levels at all.
avatar
VodkaChicken: I'm not sure about restoring gamma levels but I usually just set

[HKEY_CURRENT_USER\Software\Wine\X11 Driver]
"UseXVidMode"="N"

for my wine prefixes. This prevents wine from changing the gamma levels at all.
That's not necessarily a good thing, if the game has a legitimate reason to alter gamma levels. The game might look bad in result if it's disabled. But the key is to restore it back once it exists.
Post edited March 21, 2019 by shmerl
avatar
shmerl: What's the recommended scriptable way to restore monitor gamma levels, after some Wine games modify them?

I found xgamma tool, but it's tied to Xorg, so not sure if it's a suitable approach in general case like for Wayland. I suppose it depends on how gamma modification from XWayland would work, i.e. whether it persist after some game closes down. I haven't been using Wayland session recently due to some annoying bugs in KWin, but still would good to know if there is a generic approach.
You use plasma then? When it happens I just go to system settings -> gamma and everything works back automatically without need to actually change anything. It's just 2 clicks so never even bothered to find more sophisticated solution.
avatar
meelten: You use plasma then? When it happens I just go to system settings -> gamma and everything works back automatically without need to actually change anything. It's just 2 clicks so never even bothered to find more sophisticated solution.
Yeah, I know that method. Even faster, just do:

Alt+F2 (opens kickoff launcher), then start typing "kg" and press enter when "kgamma" is suggested. But I'm asking how to script that, for my Wine games launching scripts.
Post edited March 21, 2019 by shmerl
avatar
shmerl: What's the recommended scriptable way to restore monitor gamma levels, after some Wine games modify them?
rgamma=$(xgamma 2>&1|sed 's/->//'|cut -d',' -f1|awk '{print $2}')
ggamma=$(xgamma 2>&1|sed 's/->//'|cut -d',' -f2|awk '{print $2}')
bgamma=$(xgamma 2>&1|sed 's/->//'|cut -d',' -f3|awk '{print $2}')

Run your game here…

xgamma -rgamma $rgamma -ggamma $ggamma -bgamma $bgamma
source

You need to have the "xgamma" command available, it is provided by:
- "x11-xserver-utils" on Debian
- "xorg-xgamma" on Arch Linux
- "x11-apps/xgamma" on Gentoo

-----

The sed+cut+awk could probably be converted into a single awk call, but I’m not good enough with it yet to do it.

-----

Got it!
rgamma=$(xgamma 2>&1|awk '{sub(/,/, ""); print $3}')
ggamma=$(xgamma 2>&1|awk '{sub(/,/, ""); print $5}')
bgamma=$(xgamma 2>&1|awk '{sub(/,/, ""); print $7}')
Post edited March 21, 2019 by vv221
avatar
vv221: You need to have the "xgamma" command available, it is provided by:
Yeah, xgamma works for X session, I know. I was more interested in Wayland use case :)
avatar
shmerl: Yeah, xgamma works for X session, I know. I was more interested in Wayland use case :)
Woops, looks like I’ve been too quick when reading your post ;)
Post edited March 21, 2019 by vv221
avatar
shmerl: What's the recommended scriptable way to restore monitor gamma levels, after some Wine games modify them?

I found xgamma tool, but it's tied to Xorg, so not sure if it's a suitable approach in general case like for Wayland. I suppose it depends on how gamma modification from XWayland would work, i.e. whether it persist after some game closes down. I haven't been using Wayland session recently due to some annoying bugs in KWin, but still would good to know if there is a generic approach.
xgamma is tied to X11, but so is wine. So if the gamma modification from wine works, xgamma should work as well, no?
(just guessing here, I always disable XVidmode with the registry key posted above)
avatar
vv221: The sed+cut+awk could probably be converted into a single awk call, but I’m not good enough with it yet to do it.
Just an idea how to do this in one match:

xgamma 2>&1 | { read gamma; rgx='Red ([^,]+), Green ([^,]+), Blue ([^,]+)'; [[ "$gamma" =~ $rgx ]]; red=${BASH_REMATCH[1]}; green=${BASH_REMATCH[2]}; blue=${BASH_REMATCH[3]}; echo "$red $green $blue"; }

(Note, GOG swallows double spaces, it should be Red␣␣([^,]+), and so on.
Post edited March 21, 2019 by shmerl
avatar
vv221: The sed+cut+awk could probably be converted into a single awk call, but I’m not good enough with it yet to do it.
avatar
shmerl: Just an idea how to do this in one match:

xgamma 2>&1 | { read gamma; rgx='Red ([^,]+), Green ([^,]+), Blue ([^,]+)'; [[ "$gamma" =~ $rgx ]]; red=${BASH_REMATCH[1]}; green=${BASH_REMATCH[2]}; blue=${BASH_REMATCH[3]}; echo "$red $green $blue"; }

(Note, GOG swallows double spaces, it should be Red␣␣([^,]+), and so on.
Bashisms are not allowed in ./play.it scripts, so no arrays for me ;)
But I found a way using only awk, I edited my post to add it.
avatar
immi101: xgamma is tied to X11, but so is wine. So if the gamma modification from wine works, xgamma should work as well, no?
(just guessing here, I always disable XVidmode with the registry key posted above)
Yeah, I suppose KWin could even properly handle XWayland application closing and not keep altered gamma around. I didn't test it yet, just was wondering if anyone did. I should go back to Wayland session and play around more with Wine in it.

Due to bugs like this: https://bugs.kde.org/show_bug.cgi?id=387313 I'm still hesitant to switch fully.

avatar
vv221: Bashisms are not allowed in ./play.it scripts, so no arrays for me ;)
But I found a way using only awk, I edited my post to add it.
Well, at least Bash has built in regexes, so I don't mind using "bashisms" when working with Bash scripts. Who doesn't have Bash today? Otherwise things are really messed up and you are just better off using serious scripting languages like Python or Ruby :)
Post edited March 21, 2019 by shmerl
avatar
ciemnogrodzianin: Game: Brothers in Arms: Road to Hill 30
Have you had a chance to also try Brothers in Arms: Hell's Highway meanwhile? As it seems to be the easiest in the series I'm still interested in the game when it runs with Wine.
avatar
vv221: rgamma=$(xgamma 2>&1|awk '{sub(/,/, ""); print $3}')
ggamma=$(xgamma 2>&1|awk '{sub(/,/, ""); print $5}')
bgamma=$(xgamma 2>&1|awk '{sub(/,/, ""); print $7}')
Shouldn't that be gsub() instead of sub()?

You also can do it in one command instead of calling xgamma and awk 3 times:
options=$(xgamma 2>&1 | awk '{gsub(/,/,""); printf "-rgamma %s -ggamma %s -bgamma %s",$3,$5,$7}')
game
xgamma $options
Post edited March 22, 2019 by eiii
avatar
eiii: (…)
I’m still learning my way around awk, so thanks for both tips ;)