I've looked at this question but there's nothing automatic about it, I'm not trying to open a GUI and fiddle with settings everytime I start and stop playing a game.
In Steam, it's possible to edit the launch options of a game. For instance I use bumblebee to enable my laptop's nvidia card by adding primusrun %command%
to the launch options. Here we should be able to call starting and ending scripts (or just string together some commands) to disable HUD hotkey buttons during gameplay and re-enable them afterward. Something along the lines of launchscript ; %command% ; endscript
perhaps.
This means we need a command line way to enable and disable the HUD hotkey. This answer shows a CLI method. I've tried this and it works from the terminal but not when I try to call it via the launch options within Steam. When trying it with bash -c
I run into issues with the delimiters but that is solved using gsettings instead.
I've tried all of the following but with no success:
dconf write /org/compiz/integrated/show-hud '[""]' ; primusrun %command%
bash -c 'dconf write /org/compiz/integrated/show-hud '[""]'' ; primusrun %command%
bash -c 'dconf write /org/compiz/integrated/show-hud '[""]' ; primusrun %command%'
bash -c "dconf write /org/compiz/integrated/show-hud '[""]' ; primusrun %command%"
I've also tried using gsettings rather than dconf.
e.g. bash -c 'gsettings set org.compiz.integrated show-hud '[""]'' ; primusrun %command%
but again it works in the terminal but not from the launch options.
I'm pretty sure I'm just running into syntax problems, how can I get this to work properly?
Make a script nohudrun like the primusrun is done:
And invoke it like that:
LD_LIBRARY_PATH=/usr/lib is for breaking from x32 environment of Steam, because dconf can't find x64 libs (maybe there is a better way). That is the cause why it fails from 'launch options', I think.
You can also add some locking to be able to correctly restore the keybinding when multiple games are run through that script.
P. S. How to know what's wrong? Just print stderr to file: