Launch audiogame-manager with the -u flag for a ui to access any of its usage flags, e.g. play, install, remove.
This commit is contained in:
1 parent
d759d2fcab
commit
ea56ce95d4
4 files changed
+30
-3
No files matched your search
@@ -1,3 +1,5 @@
|
||||
# shellcheck shell=bash
|
||||
|
||||
# Create desktop launcher file
|
||||
desktop_launcher() {
|
||||
local desktopFile="${HOME}/audiogame-manager.desktop"
|
||||
@@ -18,7 +20,7 @@ desktop_launcher() {
|
||||
'Name=Audiogame manager'
|
||||
'GenericName=Audiogame Manager'
|
||||
'Comment=Play audio games'
|
||||
"Exec=${terminal} -t \"Audiogame Manager\" -e \"/usr/bin/bash -c 'nohup $(readlink -e "$0") 2> /dev/null'\""
|
||||
"Exec=${terminal} -t \"Audiogame Manager\" -e \"/usr/bin/bash -c 'nohup $(readlink -e "$0") -u 2> /dev/null'\""
|
||||
'Terminal=false'
|
||||
'Type=Application'
|
||||
'StartupNotify=false'
|
||||
|
||||
@@ -49,7 +49,7 @@ agm_menu() {
|
||||
--selectable-labels \
|
||||
--search-column=1 \
|
||||
--height=400 \
|
||||
--width=600)
|
||||
--width=600) || return $?
|
||||
|
||||
# Strip trailing pipes and return the mapped value
|
||||
if [[ -n "$selectedDescription" ]]; then
|
||||
@@ -74,7 +74,7 @@ agm_menu() {
|
||||
--no-tags \
|
||||
--menu "$text" 0 0 0 \
|
||||
"${dialogArgs[@]}" \
|
||||
--stdout)
|
||||
--stdout) || return $?
|
||||
|
||||
# Return the mapped value
|
||||
if [[ -n "$selectedDescription" ]]; then
|
||||
|
||||
@@ -17,6 +17,14 @@ Get usage instructions.
|
||||
|
||||
Select from a list of games to install.
|
||||
|
||||
./audiogame-manager.sh -u
|
||||
|
||||
Choose **Play**, **Install**, **Remove**, or **Force Stop**, then select a game
|
||||
in the corresponding menu. This uses Yad when a display and Yad are available,
|
||||
or console dialog otherwise. Cancel closes the action menu without starting an
|
||||
action. Desktop shortcuts created with `-D` now open this menu; recreate existing
|
||||
shortcuts with `-D` to use it.
|
||||
|
||||
With no arguments, the list of installed games will be displayed. In all the menus, both installer and launcher, use the up and down arrow keys to find the game you want. Press enter on the game to perform the action. For more detailed help, try the -h flag.
|
||||
|
||||
Use `./audiogame-manager.sh -s` to open the launcher without automatically
|
||||
|
||||
@@ -359,6 +359,21 @@ ensure_wine_bottles() {
|
||||
}
|
||||
|
||||
|
||||
# Choose a manager action using the current console or graphical interface.
|
||||
action_menu() {
|
||||
local selectedAction
|
||||
selectedAction="$(agm_menu "Audiogame Manager" "Audiogame Manager" \
|
||||
"Please select an action" \
|
||||
play "Play" install "Install" remove "Remove" stop "Force Stop")" || return 0
|
||||
|
||||
case "$selectedAction" in
|
||||
play) game_launcher;;
|
||||
install) game_installer;;
|
||||
remove) game_removal;;
|
||||
stop) kill_game;;
|
||||
esac
|
||||
}
|
||||
|
||||
# Install games
|
||||
game_installer() {
|
||||
export LANG="en_US.UTF-8"
|
||||
@@ -1020,6 +1035,7 @@ declare -A command=(
|
||||
[S:]="Speech rate. Requires -V voice name, the default is 7. Values 0-9 or A."
|
||||
[s]="Skip automatic NVDA controller DLL replacement when launching games."
|
||||
[t]="Total games. Show how many games are currently available."
|
||||
[u]="Choose Play, Install, Remove, or Force Stop from a menu."
|
||||
[v:]="Select the voice to be installed, default is Bdl. Options are alan, bdl, clb, or slt."
|
||||
[V:]="Select the default voice for a bottle."
|
||||
)
|
||||
@@ -1089,6 +1105,7 @@ while getopts "${args}" i ; do
|
||||
agm_infobox "Linux Game Manager" "Linux Game Manager" "There are currently ${gameCount} games available."
|
||||
exit 0
|
||||
;;
|
||||
u) action_menu; exit $?;;
|
||||
v)
|
||||
# shellcheck disable=SC2034
|
||||
voiceName="${OPTARG}"
|
||||
|
||||
Reference in new issue
Block a user