Files
hyprdots/hypr/rungame
coolnsx 7f905cc49f ...
2024-05-03 16:06:38 +05:30

19 lines
891 B
Bash
Executable File

#!/bin/sh
gamedir="$HOME/games"
games=$(find "$gamedir" -maxdepth 2 -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 'JetBrainsMono Nerd Font 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"
WINEFSYNC=1 WINEESYNC=1 MANGOHUD=1 gamemoderun wine "$gamename"