random game from cartridges.
This commit is contained in:
parent
024b5696ab
commit
829052147b
9
rand-game
Executable file
9
rand-game
Executable file
@ -0,0 +1,9 @@
|
||||
#!/bin/sh
|
||||
|
||||
random=$(jq 'select(.hidden != true) | select(.removed != true) | select(.name | contains("Proton") | not) | select(.name | contains("Steam") | not) | input_filename' -r "$HOME"/.local/share/cartridges/games/*.json | sort -R | head -n 1)
|
||||
name=$(jq '.name' -r "$random")
|
||||
exec=$(jq '.executable | if type == "array" then .[] end' -r "$random")
|
||||
|
||||
answer=$(printf "yes\nno" | dmenu -p "Want to play $name?")
|
||||
|
||||
[ "$answer" = "yes" ] && eval "$exec" || exit
|
Loading…
Reference in New Issue
Block a user