Add the ui to Linux Game Manager. -u is taken so used -U instead.
This commit is contained in:
1 parent
40803a7162
commit
176503ab1b
2 files changed
+23
-2
No files matched your search
@@ -11,6 +11,11 @@ Current base dependencies checked on launch: `7z`, `curl`, `dialog`, `jq`, `yad`
|
||||
|
||||
## Desktop shortcuts
|
||||
|
||||
Use `./linux-game-manager.sh -U` to choose Play, Install, Remove, or Update
|
||||
from an action menu. The lowercase `-u` still opens game updates directly.
|
||||
New manager shortcuts created with `-D` open the action menu using `-U`.
|
||||
Recreate existing manager shortcuts with `-D` to use this behavior.
|
||||
|
||||
Open `./linux-game-manager.sh`, select an installed game, and choose **Desktop
|
||||
Shortcut**. This works in both the graphical and console menus and creates an
|
||||
executable `.desktop` file in `~/Desktop`. Existing files are left intact, and
|
||||
|
||||
+18
-2
@@ -440,6 +440,20 @@ open_url() {
|
||||
xdg-open "${*}" 2> /dev/null
|
||||
}
|
||||
|
||||
action_menu() {
|
||||
local selectedAction
|
||||
selectedAction="$(ui_menu "Linux Game Manager" "Linux Game Manager" \
|
||||
"Please select an action" \
|
||||
play "Play" install "Install" remove "Remove" update "Update")" || return 0
|
||||
|
||||
case "$selectedAction" in
|
||||
play) game_launcher ;;
|
||||
install) game_installer ;;
|
||||
remove) game_removal ;;
|
||||
update) game_update ;;
|
||||
esac
|
||||
}
|
||||
|
||||
# Create desktop launcher file
|
||||
desktop_launcher() {
|
||||
local desktopFile="${HOME}/linux-game-manager.desktop"
|
||||
@@ -460,9 +474,9 @@ desktop_launcher() {
|
||||
done
|
||||
launchDirectory="${scriptRoot}"
|
||||
if [[ "${terminal}" == "xterm" ]]; then
|
||||
printf -v execLine "Exec=xterm -T \"Linux Game Manager\" -e /usr/bin/bash -c \"pushd %q;nohup ./%q 2> /dev/null\"" "${launchDirectory}" "${0##*/}"
|
||||
printf -v execLine "Exec=xterm -T \"Linux Game Manager\" -e /usr/bin/bash -c \"pushd %q;nohup ./%q -U 2> /dev/null\"" "${launchDirectory}" "${0##*/}"
|
||||
else
|
||||
printf -v execLine "Exec=%s -t \"Linux Game Manager\" -e \"/usr/bin/bash -c 'pushd %q;nohup ./%q 2> /dev/null'\"" "${terminal}" "${launchDirectory}" "${0##*/}"
|
||||
printf -v execLine "Exec=%s -t \"Linux Game Manager\" -e \"/usr/bin/bash -c 'pushd %q;nohup ./%q -U 2> /dev/null'\"" "${terminal}" "${launchDirectory}" "${0##*/}"
|
||||
fi
|
||||
dotDesktop=('[Desktop Entry]'
|
||||
'Name=Linux game manager'
|
||||
@@ -1066,6 +1080,7 @@ declare -A command=(
|
||||
[r]="Remove game. Remove a game and its menu entry."
|
||||
[t]="Total games. Show how many games are currently available."
|
||||
[u]="Update games. Run available game update scripts."
|
||||
[U]="Choose Play, Install, Remove, or Update from a menu."
|
||||
)
|
||||
|
||||
# Convert the keys of the associative array to a format usable by getopts
|
||||
@@ -1088,6 +1103,7 @@ while getopts "${args}" i ; do
|
||||
exit 0
|
||||
;;
|
||||
u) game_update ;;
|
||||
U) action_menu; exit $? ;;
|
||||
esac
|
||||
done
|
||||
|
||||
|
||||
Reference in new issue
Block a user