#!/usr/bin/env bash set -e HDR_ENVS=(DXVK_HDR=1 PROTON_ENABLE_HDR=1 PROTON_ENABLE_WAYLAND=1) ########## # Public ########## export LANG=zh_CN.UTF-8 export XMODIFIERS=@im=fcitx export GTK_IM_MODULE=fcitx export DXVK_HUD='fps,gpuload,memory,compiler,opacity=0.8' ############## # Proton/Wine ############## export PROTONPATH="$HOME/.local/data/proton/default" ############# # Gamescope ############# GAMESCOPE_ARGS='-r 180 --framerate-limit 180 -S integer --adaptive-sync' GAMESCOPE_CLI="gamescope -W 2560 -H 1440 ${GAMESCOPE_ARGS} --" #GAMESCOPE_HDR_CLI="gamescope --hdr-enabled ${GAMESCOPE_ARGS} --" _RUNTIME_DIR="${XDG_RUNTIME_DIR:-/tmp}/games-runtime" mkdir -p "${_RUNTIME_DIR}"; cd "${_RUNTIME_DIR}" if [[ "$1" = '-i' ]]; then shift export DRI_PRIME=pci-0000_00_02_0 # igpu-intel export VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/intel_icd.json export DXVK_HUD="devinfo,${DXVK_HUD}" #else # export DRI_PRIME=pci-0000_03_00_0 # dgpu-amd # export VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/radeon_icd.json fi case "$1" in hoyold) export WINEPREFIX="$HOME/.local/data/wineprefix/miHoYold" # For GI/ZZZ export WINE_ENABLE_TIMEOUT_FIX=1 export UMU_USE_STEAM=1 case "$2" in 'gih') export GAMEID=umu-gi umu-run 'G:\GenshinImpact\genshin-hdr.exe' -o 1 -m 1000 -s 500 -u 450 exec env ${HDR_ENVS[@]} gamemoderun umu-run 'G:\GenshinImpact\ungi.exe' 90 'G:\GenshinImpact\CN\YuanShen.exe' -popupwindow -window-mode borderless ;; 'gi') GAMEID=umu-gi exec gamemoderun umu-run 'G:\GenshinImpact\ungi.exe' 90 'G:\GenshinImpact\CN\YuanShen.exe' ;; #GAMEID=umu-zzz PROTON_DXVK_LLASYNC=1 \ 'zzz') GAMEID=umu-zzz exec gamemoderun umu-run 'G:\ZenlessZoneZero\CN\ZenlessZoneZero.exe' -use-d3d12 ;; #gamescope -W 1080 -H 660 -r 60 -S integer --adaptive-sync -- \ 'hsr') GAMEID=umu-hsr exec taskset 0xffffff00 \ umu-run 'G:\HonkaiStarRail\CN\StarRail.exe' ;; 'launcher') GAMEID=umu-hoyolauncher exec umu-run 'C:\Program Files\miHoYo Launcher\launcher.exe' ;; 'wine') shift 2; GAMEID=umu-hoyo exec umu-run "$@" ;; esac ;; hoyo|mi[Hh]o[Yy]o) export WINEPREFIX="$HOME/.local/data/wineprefix/miHoYo" # For GI/ZZZ export WINE_ENABLE_TIMEOUT_FIX=1 export UMU_USE_STEAM=1 case "$2" in 'gih') export GAMEID=umu-gi umu-run 'G:\GenshinImpact\genshin-hdr.exe' -o 1 -m 1000 -s 500 -u 450 exec env ${HDR_ENVS[@]} gamemoderun umu-run 'G:\GenshinImpact\ungi.exe' 90 'G:\GenshinImpact\CN\YuanShen.exe' -popupwindow -window-mode borderless ;; 'gi') GAMEID=umu-gi exec gamemoderun umu-run 'G:\GenshinImpact\ungi.exe' 90 'G:\GenshinImpact\CN\YuanShen.exe' ;; #GAMEID=umu-zzz PROTON_DXVK_LLASYNC=1 \ 'zzz') GAMEID=umu-zzz exec gamemoderun umu-run 'G:\ZenlessZoneZero\CN\ZenlessZoneZero.exe' -use-d3d12 ;; #gamescope -W 1080 -H 660 -r 60 -S integer --adaptive-sync -- \ 'hsr') GAMEID=umu-hsr exec taskset 0xffffff00 \ umu-run 'G:\HonkaiStarRail\CN\StarRail.exe' ;; 'launcher') GAMEID=umu-hoyolauncher exec umu-run 'C:\Program Files\miHoYo Launcher\launcher.exe' ;; 'wine') shift 2; GAMEID=umu-hoyo exec umu-run "$@" ;; esac ;; ace) export WINEPREFIX="$HOME/.local/data/wineprefix/ACE" case "$2" in 'taoyuan') GAMEID=umu-taoyuan exec gamemoderun linuwux $GAMESCOPE_CLI umu-run 'G:\Tencent\Taoyuan\launcher\yc_launcher.exe';; 'endfield') GAMEID=umu-endfield exec gamemoderun umu-run 'G:\Hypergryph\Arknights Endfield\EndfieldDirectLauncher.exe';; 'hypergryph') GAMEID=umu-hypergryph exec gamemoderun umu-run 'G:\Hypergryph\Hypergryph Launcher\Launcher.exe';; 'wine') shift 2; GAMEID=umu-ace exec umu-run "$@";; esac ;; cracks) export WINEPREFIX="$HOME/.local/data/wineprefix/Cracks" case "$2" in 'tf3') GAMEID=umu-tf3 exec gamemoderun umu-run 'G:\TransportFever3\TransportFever3.exe';; 'shapez2') GAMEID=umu-shapez2 exec gamemoderun umu-run 'G:\Shapez2\shapez 2.exe';; 'factorio') GAMEID=umu-factorio exec gamemoderun umu-run 'G:\Factorio\bin\x64\factorio.exe';; 'afterinc') GAMEID=umu-afterinc exec gamemoderun umu-run 'G:\AfterIncRevival\After Inc. Revival.exe';; 'cities2') GAMEID=umu-cities exec gamemoderun umu-run 'G:\CitiesSkylinesII\Cities2.exe';; 'palworld') GAMEID=umu-palworld exec gamemoderun umu-run 'G:\Palworld\Palworld.exe';; 'wine') shift 2; GAMEID=umu-cracks exec umu-run "$@";; esac ;; launchers) export WINEPREFIX="$HOME/.local/data/wineprefix/Launchers" case "$2" in 'hypergryph') GAMEID=umu-hypergryphlauncher exec umu-run 'C:\Installed\Hypergryph Launcher\Launcher.exe';; 'wine') shift 2; GAMEID=umu-launchers exec umu-run "$@";; esac ;; netdisks) export WINEPREFIX="$HOME/.local/data/wineprefix/Netdisks" export DXVK_HUD=0 case "$2" in 'quark') GAMEID=umu-quark exec umu-run 'C:\Installed\QuarkCloudDrive\quark_cloud_drive.exe';; 'wine') shift 2; GAMEID=umu-launchers exec umu-run "$@";; esac ;; esac echo None