Install the gamescope using your package manager.
-
Run the following command to launch Steam within a Gamescope instance from the terminal:
gamescope -e -- steam -steamdeck
- Run through the set up process by:
- Selecting the language of your choice
- Setting the timezome
- You will then be presented with the home screen (like Big Picture mode).
- Close the window to exit from Steam.
-
Using a code editor, create a new file called
gamescope-session
, add the following lines to the file and then save the file#!/bin/bash STEAM_GAMESCOPE_VRR_SUPPORTED=1 STEAM_MULTIPLE_XWAYLANDS=1 gamescope -W <resolution_width> -H <resolution_height> -r <refresh_rate> -O <output_display> -e --xwayland-count 2 -- steam -steamdeck -steamos3
-
Replace
<resolution_width>
and<resolution_height>
with the width and height of your primary dispaly's resolution,<refresh_rate>
with the refresh rate of your primary display, and<output_display>
with whatever display you wan't to use as the primary. You can get the<output_display>
value for your primary display usingwayland-info
command and looking for thename
field of your primary display.As an example, for me, the command looks like this:
STEAM_GAMESCOPE_VRR_SUPPORTED=1 STEAM_MULTIPLE_XWAYLANDS=1 gamescope -W 1920 -H 1080 -r 165 -O DP-1 -e --xwayland-count 2 -- steam -steamdeck -steamos3
-
The
STEAM_GAMESCOPE_VRR_SUPPORTED=1
flag is required to fix a VRR issue. -
The
STEAM_MULTIPLE_XWAYLANDS=1
flag combined with--xwayland-count 2
option is required when you want to be able to use keyboard and mouse properly inside Gamemode.
-
-
Set the file permissions and copy it to the
/usr/bin/
folder using the commands:chmod +x gamescope-session sudo cp gamescope-session /usr/bin/
-
Create a new file named
steamos-session-select
, add the following lines to the file and save it:#!/bin/bash steam -shutdown
-
Set the file permissions and copy it into
/usr/bin/
folder using the commands:chmod +x steamos-session-select sudo cp steamos-session-select /usr/bin/
-
Create a new file named
steamos-select-branch
, add the following lines to the file and then save it:#!/bin/bash echo "Not applicable for this OS"
-
Set the file permissions and copy it to the
/usr/bin/
folder using the commands:chmod +x ~/Developer/steamos-select-branch sudo cp ~/Developer/steamos-select-branch /usr/bin/
-
Create a new file named
steamos-update
, add the following lines to the file and then save it:#!/bin/bash exit 7;
-
Set the file permissions and copy it to the
/usr/bin/
folder using the commands:chmod +x ~/Developer/steamos-update sudo cp ~/Developer/steamos-update /usr/bin/
-
Create a new file named
jupiter-biosupdate
, add the following lines to the file and then save it:#!/bin/bash exit 0;
-
Set the file permissions and copy it to the
/usr/bin/
folder using the commands:chmod +x ~/Developer/jupiter-biosupdate sudo cp ~/Developer/jupiter-biosupdate /usr/bin/
Before proceeding to the next step, let's recap some info about TTY.
- TTYs are essentially terminal sessions which can run in parallel.
- You can switch between terminal sessions using the keyboard combination
Ctrl+Alt+[F1-F6]
, whereCtrl+Alt+F1
will switch to TTY1,Ctr+Alt+F2
will switch to TTY2 and so on, upto TTY6. - On GNOME (I don't know about other desktop environments), TTY1 corresponds to GDM, the login manager and TTY2 corresponds to the GNOME session itself, while TTY3-TTY6 are available for use. For the sake of an example, let's choose TTY3 as our Gamescope session target.
-
Open a terminal and execute the following command:
sudo systemctl edit getty@tty3
. Replace tty3 with any other tty which you want to use. -
Insert the folling text where the cursor is pointed by default:
[Service] ExecStart= ExecStart=-/sbin/agetty -o '-p -f -- \\u' --noclear --autologin <username> %I TERM Restart=no
Replace
<username>
with you user account's username. -
Save the file and reboot your system.
-
Edit the
~/.bashrc
file and insert the following text at the end:alias gsteam="gamescope-session; chvt 2; exit"
Here, I'm using
chvt 2
since GNOME runs on TTY2. If you know for sure that your desktop environment runs on a different TTY instance, replace2
with whatever instance number you desktop environment runs. -
Save the file and exit.
-
Edit your
~/.bash_profile
file and insert the following text at the end:if [[ $(tty) == "/dev/tty3" ]]; then gsteam fi
Here I'm using
/dev/tty3
. If your selected target TTY was anything else, replacetty3
with your selected target i.e, if you want to usetty5
for the Gamemode, replace/dev/tty3
with/dev/tty5
. -
Save the file and exit.
- Log out and login again and test it out by switching to the selected TTY using the keyboard shortcut. Here, since I used TTY3, I can test it by pressing
Ctrl+Alt+F3
, which should open Steam Gamemode. - You can exit it by going into the menu and selecting
Switch to Desktop
, which should switch you back to your usual Desktop Environment and terminate the Steam Gamemode. - To switch between the TTY sessions (including the one where your desktop environment is running), you can just use the keyboard shortcuts, and both the desktop environment and Steam Gamemode will run in parallel.
- Steam Gamemode will only terminate if you click
Switch to Desktop
in Steam.
Shoutout to shahnawazshahin for the Gamescope Session guide and u/felix_ribeiro for the fix for Keyboard and Mouse input.