From 5b132fa81250c7adffe3f4aeb1355d7a0d27dec9 Mon Sep 17 00:00:00 2001 From: cronyakatsuki Date: Sun, 22 May 2022 19:36:32 +0200 Subject: [PATCH] Added support for category's. --- dmenu-games | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/dmenu-games b/dmenu-games index fb2dcbc..72d5148 100755 --- a/dmenu-games +++ b/dmenu-games @@ -2,6 +2,19 @@ # dmenu script to open up my games -choice=$(game-run | dmenu -p "Choose game to run:") +list=$( game-run --list categories | dmenu -p "Choose game category:") -game-run "$choice" +[ -z "$list" ] && exit 0 + +if [ -z "$1" ]; then + game=$(game-run --list $list | sed '/-18+/d' | dmenu -p "Choose game to run:") +elif [ "$1" = "-a" ]; then + game=$(game-run --list $list | dmenu -p "Choose game to run:") +else + printf '%s\n' "Option $1 doesn't exit!!" + exit 1 +fi + +[ -z "$game" ] && exit 0 + +game-run "$game"