this post was submitted on 16 Jun 2023
11 points (100.0% liked)

Steam Deck

14850 readers
55 users here now

A place to discuss and support all things Steam Deck.

Replacement for r/steamdeck_linux.

As Lemmy doesn't have flairs yet, you can use these prefixes to indicate what type of post you have made, eg:
[Flair] My post title

The following is a list of suggested flairs:
[Discussion] - General discussion.
[Help] - A request for help or support.
[News] - News about the deck.
[PSA] - Sharing important information.
[Game] - News / info about a game on the deck.
[Update] - An update to a previous post.
[Meta] - Discussion about this community.

Some more Steam Deck specific flairs:
[Boot Screen] - Custom boot screens/videos.
[Selling] - If you are selling your deck.

These are not enforced, but they are encouraged.

Rules:

Link to our Matrix Space

founded 3 years ago
MODERATORS
 

https://github.com/nbusseneau/hephaistos

Hephaistos patches Hades to allow for custom screen resolutions, including enabling 16:10 support for the Steam Deck. Simply run it in Konsole, and you can select the right aspect ratio. But I play both in handheld and docked, meaning I have to switch between the 16:10 mod and 16:9 each time I play. I currently have two *.sh scripts that I have added as non-Steam games:

  • hephaistos patch 1280 800
  • hephaistos restore

So I just select the correct one, from Game Mode, before launching the game. But launching the game then stalls sometimes, and I have to restart the device to get it to launch.

I have also tried the Bash Shortcuts DeckyLoader plugin, but I cannot get that to work at all

Any ideas for the best way to handle this? Preferably, it would be nice to have a script that finds the current display's resolution/aspect ratio and then use Hephaistos to patch the game accordingly. That way I would not have to make sure I am selecting the correct shortcut before launching the game, it would just be one shortcut to handle the right scenario.

you are viewing a single comment's thread
view the rest of the comments
[–] SatyrSack@lemmy.one 3 points 1 year ago* (last edited 1 year ago)

Great, that definitely does grab the right display dimensions based on the active display, whether that be the built-in display or an external display if docked! I still need to figure out the most efficient way to trigger this from Game Mode before launching the game, but this script does the trick.

#!/bin/bash

# get dimensions of current active display
dimensions=$(xrandr | grep primary | awk -F'[ +]' '{print $4}')
dimensions_x=${dimensions%x*}
dimensions_y=${dimensions#*x}

# get decimal representations of current aspect ratio and "standard" 16:9
ratio_std=$(awk -v var1=16 -v var2=9 'BEGIN { print  ( var1 / var2 ) }')
ratio_active=$(awk -v var1=$dimensions_x -v var2=$dimensions_y 'BEGIN { print  ( var1 / var2 ) }')

# if active display is 16:9, restore Hephaistos, otherwise patch to active dimensions
if (( $(echo "$ratio_active $ratio_std" | awk '{print ($1 == $2)}') )); then
    ./hephaistos restore
else
    ./hephaistos patch $dimensions_x $dimensions_y
fi