| game_select.sh - dotfiles - These are my dotfiles. There are many like it, but … | |
| git clone git://jay.scot/dotfiles | |
| Log | |
| Files | |
| Refs | |
| README | |
| --- | |
| game_select.sh (890B) | |
| --- | |
| 1 #!/bin/sh | |
| 2 | |
| 3 MEDIA_GAMES_DIR=~/media/games | |
| 4 | |
| 5 # Define game paths | |
| 6 stellaris_path=$MEDIA_GAMES_DIR/stellaris/start.sh | |
| 7 gibbous_path=$MEDIA_GAMES_DIR/gibbous/start.sh | |
| 8 rimworld_path=$MEDIA_GAMES_DIR/rimworld/start.sh | |
| 9 atomrpg_path=$MEDIA_GAMES_DIR/atomrpg/start.sh | |
| 10 steam_command=steam | |
| 11 | |
| 12 # Define game list | |
| 13 games=("Stellaris" "Gibbous" "Rimworld" "AtomRPG" "Steam") | |
| 14 | |
| 15 # Prompt user to choose a game | |
| 16 selected_game=$(printf "%s\n" "${games[@]}" | dmenu -p "games ยป") | |
| 17 | |
| 18 # Exit if no game selected | |
| 19 [ -z "$selected_game" ] && exit 0 | |
| 20 | |
| 21 # Launch the selected game | |
| 22 case "$selected_game" in | |
| 23 "Steam") | |
| 24 $steam_command | |
| 25 ;; | |
| 26 "Stellaris") | |
| 27 $stellaris_path | |
| 28 ;; | |
| 29 "Gibbous") | |
| 30 $gibbous_path | |
| 31 ;; | |
| 32 "Rimworld") | |
| 33 $rimworld_path | |
| 34 ;; | |
| 35 "AtomRPG") | |
| 36 $atomrpg_path | |
| 37 ;; | |
| 38 *) | |
| 39 echo "Invalid game selection" | |
| 40 exit 1 | |
| 41 ;; | |
| 42 esac |