Update formatting.
This commit is contained in:
parent
41754e8ad1
commit
e1c508c53b
16 changed files with 287 additions and 278 deletions
45
dmenu-games
45
dmenu-games
|
@ -1,43 +1,42 @@
|
|||
#!/bin/sh
|
||||
|
||||
# dmenu script to open up my games
|
||||
load_config () {
|
||||
. $HOME/.config/dmenu/config
|
||||
load_config() {
|
||||
. $HOME/.config/dmenu/config
|
||||
}
|
||||
|
||||
get_category () {
|
||||
category=$( game-run list | $DMENU -p "Choose game category:")
|
||||
get_category() {
|
||||
category=$(game-run list | $DMENU -p "Choose game category:")
|
||||
|
||||
[ -z "$category" ] && exit 0
|
||||
[ -z "$category" ] && exit 0
|
||||
}
|
||||
|
||||
menu () {
|
||||
while [ -z "$game" ]
|
||||
do
|
||||
[ -z "$1" ] && game=$(game-run list "$category" | sed '/-18+/d' | $DMENU -p "Choose game to run:")
|
||||
menu() {
|
||||
while [ -z "$game" ]; do
|
||||
[ -z "$1" ] && game=$(game-run list "$category" | sed '/-18+/d' | $DMENU -p "Choose game to run:")
|
||||
|
||||
[ "$1" = "-a" ] && game=$(game-run list "$category" | $DMENU -p "Choose game to run:")
|
||||
[ "$1" = "-a" ] && game=$(game-run list "$category" | $DMENU -p "Choose game to run:")
|
||||
|
||||
[ -z "$game" ] && get_category
|
||||
done
|
||||
[ -z "$game" ] && get_category
|
||||
done
|
||||
}
|
||||
|
||||
launch_game () {
|
||||
if game-run launch "$game"; then
|
||||
quick-notify "Game run" "Launching $game"
|
||||
else
|
||||
quick-notify "Game run" "Failed to launch $game"
|
||||
fi
|
||||
launch_game() {
|
||||
if game-run launch "$game"; then
|
||||
quick-notify "Game run" "Launching $game"
|
||||
else
|
||||
quick-notify "Game run" "Failed to launch $game"
|
||||
fi
|
||||
}
|
||||
|
||||
main () {
|
||||
load_config
|
||||
main() {
|
||||
load_config
|
||||
|
||||
get_category
|
||||
get_category
|
||||
|
||||
menu
|
||||
menu $@
|
||||
|
||||
launch_game
|
||||
launch_game
|
||||
}
|
||||
|
||||
main $@
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue