Skip to content

Instantly share code, notes, and snippets.

@martinlabate
Last active July 21, 2024 17:51
Show Gist options
  • Save martinlabate/c4e6f08880a009f88dc1edaa4c6cd87a to your computer and use it in GitHub Desktop.
Save martinlabate/c4e6f08880a009f88dc1edaa4c6cd87a to your computer and use it in GitHub Desktop.
How to run BlishHUD on Steam Deck

Getting BlishHUD to work correctly on the Deck

Intro

This guide will show you how to use BlishHUD while playing GuildWars2 on the Steam Deck, but requires you to launch the game from the Steam Desktop without BigPicture.

Requirements

  • Guild Wars 2 installed via Steam
  • Blish HUD downloaded

Configure the Deck

First, you need to be on the Deck's desktop. To get there press the STEAM key, go to Power, and press Switch to Desktop

Once the desktop loads go to Settings -> Display Configuration -> Compositor

Here we disable the Allow applications to block compositing option and click apply.

Screenshot of the Compositor setting.

This setting makes the composition of windows (the ability to link 2 or more windows) impossible.


Then, back in Settings, go to Windows Management -> Window Rules and click add new. We will create two rules, one for BlishHUD and one for GuildWars2.

The BlishHUD rule should look like this: Screenshot of the BlishHUD Window Rule. Here in the BlishHUD rule, we make the window transparent by reducing its opacity, and we make it unable to get focus so our inputs go directly to Guildwars and are not interrupted by Blish.


And the Guild Wars rule should look like this: Screenshot of the Guildwars Window Rule. In the GuildWars rule, we make it be below other windows so Blish can be shown on top of it.


Now the last config step, we want the taskbar to hide so it does not show on top of our game. To do so, we right-click the taskbar, click Enter Edit Mode, and then in More Options, we select Auto Hide in the Visibility section

Copy BlishHUD to the correct location

Extract BlishHUD and move the extracted folder to the GuildWars2 folder. To find where the game is installed we can follow these steps:

  • Open Steam in desktop
  • Select GuildWars
  • Click the gear icon
  • Select Manage
  • Click Browse local files

Game Properties

To make BlishHUD launch and work properly when we play GuildWars we need to add some launch options.

  • Open Steam in desktop
  • Select GuildWars
  • Click the gear icon
  • Click Properties

General Tab

Here in the General tab, in LAUNCH OPTIONS we want to paste the following:

BHDIR=$(realpath "$(find -iname "Blish.HUD*")"); rm -f BlishHUD; ln -s "$BHDIR" BlishHUD; rm -f BlishHUD/BlishHUD.exe; ln -s "$BHDIR/Blish HUD.exe" BlishHUD/BlishHUD.exe; echo -e "@echo off\nstart Gw2-64.exe -provider Steam -autologin\nping -n 60 127.0.0.1>nul\ncd BlishHUD\nstart BlishHUD.exe\nexit" > gw2.bat; DXVK_ASYNC=1 MANGOHUD=0 eval $(echo %command% | sed "s/Guild Wars 2\/Gw2-64\.exe.*$/\"Guild Wars 2\"\/gw2.bat/")

This bit of code was made by another user, here is the source.

It does the following:

  • Sets the variable BHDIR to the path of the Blish HUD directory using the realpath command and the find command to locate the directory.
  • Removes any existing BlishHUD symbolic link.
  • Creates a new symbolic link named BlishHUD that points to the Blish HUD directory.
  • Removes any existing BlishHUD.exe file in the BlishHUD directory.
  • Creates a new symbolic link named BlishHUD.exe that points to the Blish HUD.exe file in the Blish HUD directory.
  • Creates a new batch file named gw2.bat that contains some commands to run Guild Wars 2 and Blish HUD. The batch file starts Guild Wars 2 with Steam as provider and autologin enabled. Then it waits for 60 seconds before starting Blish HUD. Finally, it exits.
  • Sets two environment variables (DXVK_ASYNC=1 and MANGOHUD=0) and evaluates %command%, which is a placeholder for the command line arguments passed to Guild Wars 2. The result of this evaluation is used as the argument for the sed command, which replaces the original path to Gw2-64.exe with the path to gw2.bat.

The MANGOHUD variable can be changed to 1 to show frame rate and CPU, GPU, and Ram usage in-game.

The -provider Steam part can be changed to -provider Portal if you want to use an Anet Account to log in.

We need Guild Wars to be running before we launch BlishHUD, that's why we wait 60 seconds before launching it. This can be lowered if you feel it is too long.

Compatibility tab

Now in the Compatibility tab, enable Force the use of a specific Steam Play compatibility tool and select the latest GE Proton version. To get GE-Proton you can follow this guide

GuildWars2 Settings

Blish will be shown on top of Guild Wars but with certain transparency, not full, so the game will look darker. To mitigate this we can play with the transparency setting in the BlishHUD window rule and the Gamma config in the Display GuildWars option, I use it like this. Screenshot of the Guildwars Gamma settings.

@fmazur
Copy link

fmazur commented Oct 21, 2023

@Cathie44
So you need to reproduce what kwin does in gnome-shell.
Mainly speaking Focus Stealing Prevention and Active/Inactive Opacity
image

@Cathie44
Copy link

@fmazur Thanks for the help, i'll try to find a way, now i know what to search for :D

@Cathie44
Copy link

@fmazur so after a lot of trying i'm seeing no option to getting this working in gnome... tho, thanks to my OS, switching desktop enviroments is quite easy, now running KDE and trying to replicate the window settings there...

@Cathie44
Copy link

so now it works! :D With one small but big issue...

the cursor is not captured inside the gamy anymore, meaning that if i grab the camera, the cursor won't stay at it's place when releasing the camera, instead, the cursor travels as i drag the camera and even out of the game window...
I'm using a multi-monitor setup btw

@alexandra-erickson
Copy link

alexandra-erickson commented Oct 25, 2023

Hi! I was able to successfully install and play on the Steam Deck for a couple hours last night, until it decided that it wouldn't pass through keyboard commands. I was able to play for a while with the Steam Deck docked using kbm, and then disconnected and played in controller mode (still in desktop mode). I restarted a few times (game and Steam Deck) and it's still doing it even docked with kbm. It's like Blish is blocking keyboard pass through. Also, if I have the cursor in a text field in another window (ie: web browser), click on GW2 to go back to playing, used WSAD to move, and the text shows up in that text field. However, clicking with the mouse on buttons or windows in GW2 works. The only settings I'd updated were the controller mapping, but even with resetting that it still won't work. Any thoughts? Thanks for the help.

@Angrod
Copy link

Angrod commented Dec 20, 2023

Are there any changes that need to be made to the Launch Options path or should I just be able to paste in front of -provider Portal? Could be that I need to double check some settings but when I added the launch options it would try to launch and exit, without them launches fine.

@jimmon89
Copy link

jimmon89 commented Dec 20, 2023

are you following the General Tab instructions?
the provided bit of launch options in particular.
or are you trying my instructions from further down?

@Angrod
Copy link

Angrod commented Dec 20, 2023

are you following the General Tab instructions? the provided bit of launch options in particular. or are you trying my instructions from further down?

I've only tried the General Tab instructions as of now

@jimmon89
Copy link

i had the same issue with those instructions
that's what lead me to make a proxy exe and an easy to edit batch file to go along with it

@jimmon89
Copy link

jimmon89 commented Dec 20, 2023

it's all open source if you have the know-how to look through the python source and compile it yourself
heck, if you can do it better i invite you to do so XD

@nlfog
Copy link

nlfog commented Dec 20, 2023

I know these instructions are for the Steamdeck Desktop mode, but is there any reason why this wouldn't work for regular linux desktop system?

I'm running KDE Plasma on Arch, and followed all the instructions in this post. I am able to get Blish to run with the game, and even show things like markers, etc. But, as another user here pointed out, when the Blish HUD is overlayed on the game, the game no longer takes keyboard input, so I can't move other than with mouse clicks. If I minimize the HUD, keyboard works again. I've double checked the Window Rules in Plasma, and they're exactly like this post. I feel I'm like 90% of the way there, and just need to get over this last hump.

@Angrod
Copy link

Angrod commented Dec 21, 2023

i had the same issue with those instructions that's what lead me to make a proxy exe and an easy to edit batch file to go along with it

I ended up getting the original launch options to work. I had to rename the BlishHUD folder as "Blish.HUD" and realized I had "HUD" not capitalized in the window rule. I'm using an ANet account so also changed the -provider flag within the command. It launched GW, logged in and I had to login as my character or the opacity wouldnt work properly but I let the .bat file it makes run and that did the trick

@Landrovan
Copy link

Landrovan commented Jan 7, 2024

I think I found a reason for the command line to work or not. Is the $(echo | sed) at the end.
Running steam in a console, when starting a game, the command is shown in the output. I can see that each command start with : "/bin/sh -c ". Then the whole command (with proton and Gw2-64.exe in this case).
So, with the replace of the command line, we end with (really shorten line): "/bin/sh -c $(echo proton Gw2-64.exe | sed ).

So I try to do the same think in a normal command line with a really simpler test. I did "/bin/sh -c $(echo ls -l)". It did NOT work. I only see the output of "ls", NOT "ls -l". So there is a problem withe the $() when used after "sh -c". At least on my computer.
I found that /bin/sh is just a link to bash. OP or those that make it work: what shell do you use (and /bin/sh link to)?

@jabuxas
Copy link

jabuxas commented Mar 18, 2024

by the way, it works on hyprland. here are the rules you need:

windowrulev2=float, title:^(Blish HUD)$
windowrulev2=center, title:^(Blish HUD)$
windowrulev2=nofocus, title:^(Blish HUD)$
windowrulev2=noinitialfocus, title:^(Blish HUD)$
windowrulev2=noborder, title:^(Blish HUD)$
windowrulev2=pin, title:^(Blish HUD)$
windowrulev2=opacity 0.2 0.1, title:^(Blish HUD)$
windowrulev2=workspace 9 silent, title:$(Blish HUD)$

windowrulev2=stayfocused, title:(Guild Wars 2)
windowrulev2=forceinput, title:(Guild Wars 2)

i had to use xembedsniproxy for tray icons because wine systray fucks it all up.

@Sonwon1
Copy link

Sonwon1 commented May 3, 2024

@martinlabate

I noticed there is a difference in the video and the screenshots for the Blish HUD window rules, one has Force stealing prevention and the video has Focus protection.

@Sonwon1
Copy link

Sonwon1 commented May 4, 2024

I have it working with Lutris, Manjaro and KDE.

Edit: Not working, GW2 window grabs the focus away from everything so you are unable to alt tab out to a different window. ;(

@Xnyle
Copy link

Xnyle commented May 28, 2024

My solution is a one-liner which works with any window manager (xfce4wm in my case):

(Im using Blish just for the pathing module)

After having started GW2+Blish:

xprop -id $(wmctrl -l|grep "Guild Wars"|cut -d " " -f 1) -f _NET_WM_WINDOW_OPACITY 32c -set _NET_WM_WINDOW_OPACITY 0xafffffff

What this does is, it changes opacity of GW2, not Blish, Blish then stays in the background of GW2 and cause it is 100% black it blocks all other windows / desktop background below it. Also there are no weird problems regarding keyboard input to solve, cause GW2 is in the front.

The only thing i have to do if there are other windows on the same screen in between Blish and GW2: Tab to Blish, Tab to GW2.

Nice thing is that cause Blish is now in the back, pathing is also quite subtle.

If you want to make changes to the Blish settings itself, you can just tab it to the front for better visibility

Edit: In case you cant tab to Blish, cause your WM hides Blish from the List:

wmctrl -a "Blish HUD" -b add,above,modal

@Sonwon1
Copy link

Sonwon1 commented May 28, 2024

My solution is a one-liner which works with any window manager (xfce4wm in my case):

(Im using Blish just for the pathing module)

After having started GW2+Blish:

xprop -id $(wmctrl -l|grep "Guild Wars"|cut -d " " -f 1) -f _NET_WM_WINDOW_OPACITY 32c -set _NET_WM_WINDOW_OPACITY 0xafffffff

What this does is, it changes opacity of GW2, not Blish, Blish then stays in the background of GW2 and cause it is 100% black it blocks all other windows / desktop background below it. Also there are no weird problems regarding keyboard input to solve, cause GW2 is in the front.

The only thing i have to do if there are other windows on the same screen in between Blish and GW2: Tab to Blish, Tab to GW2.

Nice thing is that cause Blish is now in the back, pathing is also quite subtle.

If you want to make changes to the Blish settings itself, you can just tab it to the front for better visibility

Edit: In case you cant tab to Blish, cause your WM hides Blish from the List:

wmctrl -a "Blish HUD" -b add,above,modal

That's interesting, I'll give that a try. Thank you for the reply!

Edit: Side effect is the GW2 window is dark. You can turn gamma up which washes out GW2. Not prefect however playable. I like the way Burrito is integrated into ArcDPS. It would be nice if the same could be done with Blish HUD like a translation layer to write Blish into the GW2 window.

@Xnyle
Copy link

Xnyle commented Jun 2, 2024

Made my hack solution more usable:

Idea behind it is: I want pathing and heart infos, but i want to quickly turn it off for instance when doing hearts.

start with <script> on

click on terminal or any key -> turn on/off
Press +/- change opacity
Press q end and reset opacity

#!/bin/bash

PREFIX="/......./"
BHP="drive_c/Program Files/BlishHUD/Blish HUD.exe"
INITIALOPAQ=12

if [ "$1" == "on" ]; then
    echo -e "\e[?1000h"
    xprop -id $(wmctrl -l|grep "Guild Wars"|cut -d " " -f 1) -f _NET_WM_WINDOW_OPACITY 32c -set _NET_WM_WINDOW_OPACITY 0xafffffff
    (WINEPREFIX=$PREFIX wine "$PREFIX$BHP") &

    sleep 10;
    wmctrl -a "Blish HUD" -b add,above,modal
    wmctrl -a "Guild Wars 2"
    opaq=0
    opacity=$INITIALOPAQ
    while true; do
        read -s -n 1 keypress
        if [[ $keypress = "q" ]] || [[ $peypress = "Q" ]]; then
            killall "Blish HUD.exe"
            break
        fi

        if [[ $keypress = "+" ]]; then
            ((opacity+=1))
            opacity=$(( $opacity > 15 ? 15 : $opacity ))
        elif [[ $keypress = "-" ]]; then
            ((opacity-=1))
            opacity=$(( $opacity < 0 ? 0 : $opacity ))
        else
            if [[ $opaq -eq 0  ]]; then
                opaq=1
            else
                opaq=0 
           fi
        fi

        hexop=$(printf '%x' $opacity)
        echo $hexop $opacity $opaq

        if [[ $opaq -eq 0  ]]; then
            xprop -id $(wmctrl -l|grep "Guild Wars"|cut -d " " -f 1) -f _NET_WM_WINDOW_OPACITY 32c -set _NET_WM_WINDOW_OPACITY 0x${hexop}fffffff
        else
            xprop -id $(wmctrl -l|grep "Guild Wars"|cut -d " " -f 1) -f _NET_WM_WINDOW_OPACITY 32c -set _NET_WM_WINDOW_OPACITY 0xffffffff
        fi
        read -s -N 99 -t 0.2
    done
fi

echo -e "\e[?1000l"
xprop -id $(wmctrl -l|grep "Guild Wars"|cut -d " " -f 1) -f _NET_WM_WINDOW_OPACITY 32c -set _NET_WM_WINDOW_OPACITY 0xffffffff


@jabuxas
Copy link

jabuxas commented Jun 2, 2024 via email

@nlfog
Copy link

nlfog commented Jun 2, 2024

Does anyone else experience the issue where the mouse works in moving the GW2 camera, but keyboard input doesn't get passed through? When I click on the screen, my right-click can drag around and I can click on the Blish icon and install modules and stuff, but, any keystroke goes to a different window, for example where I'm typing this instead of to GW2.

@Xnyle
Copy link

Xnyle commented Jun 3, 2024

I wonder, would that work on wayland? Also, would I start that script with the launch arguments on steam for example or what?

It has nothing to do with steam, so maybe the whole comment does not belong here. But there is no gist or something on plain old vanilla wine so I thought it might be helpful.

Regarding steam: I'm pretty sure steam also just fires up its own WINEPREFIX, so should be usable there as well. But idk how to fork a process from steams point and click adventure gui. Also the whole idea is that you have an extra terminal window that allows you to control things.
Regarding wayland: It should through Xwayland but its probably better to just use the corresponding wayland tools directly.

@fmazur
Copy link

fmazur commented Jun 3, 2024

When it comes to steam it can be attached to same wineserver matching proton version (or any custom proton) same way as I've described for burrito: AsherGlick/Burrito#144 (comment) just replace ""/home/$USER/Executables/Burrito_Linux/burrito_link.exe"" with path to Blish\ HUD.exe

What I've done is just append Xynle's script https://gist.github.com/martinlabate/c4e6f08880a009f88dc1edaa4c6cd87a?permalink_comment_id=5076097#gistcomment-5076097 to the one from Burrito issue I linked and remove env variables(PREFIX BHP) then replace
(WINEPREFIX=$PREFIX wine "$PREFIX$BHP") &
gamemoderun $PROTON_PATH "/home/$USER/Downloads/Blish.HUD.1.1.1/Blish_HUD.exe" &

I just run Gw2 through steam then at any point run script in the terminal to attach Blish to Gw2.

Then again if you just need pathing you're better off with Burrito on linux.

@Xnyle
Copy link

Xnyle commented Jun 3, 2024

Then again if you just need pathing you're better off with Burrito on linux.

Tehs Trails and it's scripts are so much more than just a path. Also Burrito is quity laggy and sadly dev seems to be dead by now.

The Blish guys could probably implement a second rendering output option via Burritos ArcDPS approach and all would be fine, but for whatever reason they don't seem to want to.

@Sonwon1
Copy link

Sonwon1 commented Jun 3, 2024

Is it Wine that is not drawing transparent windows which is causing the black screen problem?

@fmazur
Copy link

fmazur commented Jun 3, 2024

Is it Wine that is not drawing transparent windows which is causing the black screen problem?

blish-hud/Blish-HUD#873 (comment)

@Sonwon1
Copy link

Sonwon1 commented Jun 3, 2024

Is it Wine that is not drawing transparent windows which is causing the black screen problem?

blish-hud/Blish-HUD#873 (comment)

Okay, so if Wine cannot implement then why not make a translation program that ignores Blish's call to create a transparent window and passes the icon creation into the arcdps-burrito dll sort of like what Burrito does since that is working. Although Burrito is making some type of transparent window through the arcdps-burrito dll.

@jabuxas
Copy link

jabuxas commented Jun 12, 2024

is it possible to make a window unfocusable with x11 properties? im on leftwm

@ngraham20
Copy link

so now it works! :D With one small but big issue...

the cursor is not captured inside the gamy anymore, meaning that if i grab the camera, the cursor won't stay at it's place when releasing the camera, instead, the cursor travels as i drag the camera and even out of the game window... I'm using a multi-monitor setup btw

I'm having this exact same issue. Weirdly, this occurs completely independent of whether I have blishHUD set as an overlay or if I force it behind all my other windows.

Also, I've gotten it to start up just fine on Nobara 39, however I'm finding that the Cursor is completely invisible when it's above the game. I assume this is due to Blish attempting to re-draw the cursor itself, as if I tell KWin to push blish-hud below the game, the cursor renders again.

@olterman
Copy link

windowrulev2=float, title:^(Blish HUD)$
windowrulev2=center, title:^(Blish HUD)$
windowrulev2=nofocus, title:^(Blish HUD)$
windowrulev2=noinitialfocus, title:^(Blish HUD)$
windowrulev2=noborder, title:^(Blish HUD)$
windowrulev2=pin, title:^(Blish HUD)$
windowrulev2=opacity 0.2 0.1, title:^(Blish HUD)$
windowrulev2=workspace 9 silent, title:$(Blish HUD)$

windowrulev2=stayfocused, title:(Guild Wars 2)
windowrulev2=forceinput, title:(Guild Wars 2)

Where did you add these window rules

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