sagechanging the resolution in source games doesn't actually change the desktop resolution in my experience
the trick is making a script that manually changes the resolution of your desktop when you open the game, and returns back to your normal desktop resolution when you close it
1.- figure out the xrandr name assigned to your screen by typing "xrandr" on a terminal (for example VGA-1 or LVDS-1)
2.- open hl2.sh in your Team Fortress 2 folder and right under #1/bin/bash create a line and put "xrandr --output LVDSS-1 --mode 1024x768" (replace LVDS-1 with your screen name)
3.- at the end of the file, between "done" and "exit", create a line saying xrandr --output LVDS-1 --mode 1920x1080 (again, replace with your actual screen name, and your native monitor resolution of course). This will execute when you exit the game.
this works on my laptop
Well after a whole afternoon of searching, I found a combination of these instructions & ViewPortOut to be the answer to my problems!
Basically I just replaced "xrandr --output [display] --mode [resolution]" with "nvidia-settings --assign CurrentMetaMode="_______________" and filled the blank space with the normal settings I use for my dual monitor setup (from /etc/X11/xorg.conf), edited my viewport settings to {viewportin=1920x1080, viewportout=1440x1080+240+0} to make a cramped 4:3 desktop (while still being recognized as 1920x1080@144hz), and then made it change back to the original viewport settings at the end of the file.
Obviously I'd still like the old flat panel scaling functionality back but this will do for the time being, I guess I can always make a separate global bind/shortcut for restoring my viewport settings if I ever need to tab out of the game to do something. Thank you very much for your help!
https://i.imgur.com/BmdbELi.jpg
And my hl2.sh:
#!/bin/bash
nvidia-settings --assign CurrentMetaMode="DVI-I-1: 1920x1080_144 +0+267 {viewportin=1920x1080, viewportout=1440x1080+240+0}, HDMI-0: nvidia-auto-select +1920+0 {rotation=left}"
# figure out the absolute path to the script being run a bit
# non-obvious, the ${0%/*} pulls the path out of $0, cd's into the
# specified directory, then uses $PWD to figure out where that
# directory lives - and all this in a subshell, so we don't affect
# $PWD
GAMEROOT=$(cd "${0%/*}" && echo $PWD)
#determine platform
UNAME=`uname`
if [ "$UNAME" == "Darwin" ]; then
# Workaround OS X El Capitan 10.11 System Integrity Protection (SIP) which does not allow
# DYLD_INSERT_LIBRARIES to be set for system processes.
if [ "$STEAM_DYLD_INSERT_LIBRARIES" != "" ] && [ "$DYLD_INSERT_LIBRARIES" == "" ]; then
export DYLD_INSERT_LIBRARIES="$STEAM_DYLD_INSERT_LIBRARIES"
fi
# prepend our lib path to LD_LIBRARY_PATH
export DYLD_LIBRARY_PATH="${GAMEROOT}"/bin:$DYLD_LIBRARY_PATH
elif [ "$UNAME" == "Linux" ]; then
# prepend our lib path to LD_LIBRARY_PATH
export LD_LIBRARY_PATH="${GAMEROOT}"/bin:$LD_LIBRARY_PATH
fi
if [ -z $GAMEEXE ]; then
if [ "$UNAME" == "Darwin" ]; then
GAMEEXE=hl2_osx
elif [ "$UNAME" == "Linux" ]; then
GAMEEXE=hl2_linux
fi
fi
ulimit -n 2048
# enable nVidia threaded optimizations
export __GL_THREADED_OPTIMIZATIONS=1
# and launch the game
cd "$GAMEROOT"
# Enable path match if we are running with loose files
if [ -f pathmatch.inf ]; then
export ENABLE_PATHMATCH=1
fi
# Do the following for strace:
# GAME_DEBUGGER="strace -f -o strace.log"
# Do the following for tcmalloc
# LD_PRELOAD=../src/thirdparty/gperftools-2.0/.libs/libtcmalloc_debug.so:$LD_PRELOAD
STATUS=42
while [ $STATUS -eq 42 ]; do
if [ "${GAME_DEBUGGER}" == "gdb" ] || [ "${GAME_DEBUGGER}" == "cgdb" ]; then
ARGSFILE=$(mktemp $USER.hl2.gdb.XXXX)
echo b main > "$ARGSFILE"
# Set the LD_PRELOAD varname in the debugger, and unset the global version. This makes it so that
# gameoverlayrenderer.so and the other preload objects aren't loaded in our debugger's process.
echo set env LD_PRELOAD=$LD_PRELOAD >> "$ARGSFILE"
echo show env LD_PRELOAD >> "$ARGSFILE"
unset LD_PRELOAD
echo run $@ >> "$ARGSFILE"
echo show args >> "$ARGSFILE"
${GAME_DEBUGGER} "${GAMEROOT}"/${GAMEEXE} -x "$ARGSFILE"
rm "$ARGSFILE"
else
${GAME_DEBUGGER} "${GAMEROOT}"/${GAMEEXE} "$@"
fi
STATUS=$?
done
nvidia-settings --assign CurrentMetaMode="DVI-I-1: 1920x1080_144 +0+267 {viewportin=1920x1080, viewportout=1920x1080+0+0}, HDMI-0: nvidia-auto-select +1920+0 {rotation=left}"
exit $STATUS