2

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?

1 Answer 1

1

Make a script nohudrun like the primusrun is done:

#!/bin/sh

old_key="$(LD_LIBRARY_PATH=/usr/lib dconf read /org/compiz/integrated/show-hud)"
LD_LIBRARY_PATH=/usr/lib dconf write /org/compiz/integrated/show-hud "['']" 
"$@"
LD_LIBRARY_PATH=/usr/lib dconf write /org/compiz/integrated/show-hud "$old_key"

And invoke it like that:

nohudrun primusrun %command%

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:

dconf write /org/compiz/integrated/show-hud "['']" 2>>/home/velkan/errr
3
  • Unfortunately, this is not working. The game just never starts. Is there a particular directory I should be putting the script in?
    – Insperatus
    Apr 21, 2015 at 23:18
  • Better specify the full path like /home/velkan/nohudrun primusrun %command% (or put the script in some directory that in the $PATH variable; but that is not recommended), and don't forget to make it executable
    – Velkan
    Apr 22, 2015 at 11:08
  • I didi try that, but I'll try again. I tried both using the full path and also adding the directory to the $PATH variable (think I failed in that though)
    – Insperatus
    Apr 22, 2015 at 22:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .