Skip to content

Instantly share code, notes, and snippets.

@martinlabate
Last active July 22, 2024 13:57
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.

@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

@jabuxas
Copy link

jabuxas commented Jul 22, 2024

you add them to your hyprland config

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