Files
hyprdots/hypr/rungame
2025-10-22 14:17:33 +05:30

25 lines
1.1 KiB
Bash
Executable File

#!/bin/sh
gamedir="$HOME/Games"
games=$(find "$gamedir" -maxdepth 5 -type f -name '*.exe' -executable | sed "s|$gamedir/||g;/[U|u]nin.*/d")
[ -z "$games" ] && notify-send -e -u critical "No games installed" && exit 1
game=$(printf '%s\n' "$games" | bemenu --fn 'IBM Plex Sans 15' -i -c -W 0.5 -B 3 -p "PLAY GAME: " -l 15 -P ">> " --bdr="#$GLOBAL_ACCENT" --tf="#$GLOBAL_ACCENT" --hf="#$GLOBAL_ACCENT")
[ -z "$game" ] && notify-send -e -h "string:x-canonical-private-synchronous:${0##*/}" -u critical "No game selected" && exit 1
cd "$(dirname "$gamedir"/"$game")" || (notify-send -e -h "string:x-canonical-private-synchronous:${0##*/}" -u critical "Directory Not found" && exit 1)
gamename=$(basename "$game")
notify-send -e -h "string:x-canonical-private-synchronous:${0##*/}" -i "wine" "Launching $gamename"
trap 'wineserver -k' INT HUP
#DXVK_CONFIG=dxgi.hideAmdGpu=True WINEFSYNC=1 WINEESYNC=1 MANGOHUD=1 gamescope -W 1280 -H 800 -r 60 -- gamemoderun wine "$gamename"
#hyprctl keyword monitor "eDP-1",'1280x800@60','auto','1'
WINEFSYNC=1 WINEESYNC=1 MANGOHUD=1 env -u DISPLAY gamemoderun wine "$gamename"
#hyprctl keyword monitor "eDP-1",highrr,'auto','1'