Xterm added as valid terminal.
This commit is contained in:
@@ -39,6 +39,7 @@ python3 .codex/skills/linux-game-manager-dev/scripts/audit_game_catalog.py
|
|||||||
- `game_launcher` enumerates `.launch/*.sh` entries.
|
- `game_launcher` enumerates `.launch/*.sh` entries.
|
||||||
- Entries with first line `#//` are skipped.
|
- Entries with first line `#//` are skipped.
|
||||||
- Selected launcher is sourced/executed.
|
- Selected launcher is sourced/executed.
|
||||||
|
- Text-terminal launchers can fall back to `xterm`, which inherits the requested working directory before executing the game command.
|
||||||
|
|
||||||
3. **Removal flow**
|
3. **Removal flow**
|
||||||
- `game_removal` resolves launcher entry to real script.
|
- `game_removal` resolves launcher entry to real script.
|
||||||
@@ -57,7 +58,7 @@ python3 .codex/skills/linux-game-manager-dev/scripts/audit_game_catalog.py
|
|||||||
- `-u`: update game
|
- `-u`: update game
|
||||||
- `-t`: show number of available games
|
- `-t`: show number of available games
|
||||||
- `-C`: clear cache
|
- `-C`: clear cache
|
||||||
- `-D`: create desktop launcher
|
- `-D`: create desktop launcher; terminal discovery includes `xterm`, using its `-T` title option instead of `-t`
|
||||||
- `-L`: show license
|
- `-L`: show license
|
||||||
- `-h`: show help
|
- `-h`: show help
|
||||||
- `-N`: enable no-cache mode
|
- `-N`: enable no-cache mode
|
||||||
|
|||||||
+18
-4
@@ -381,13 +381,23 @@ terminal_emulator() {
|
|||||||
# Arguments workingDirectory, rest of arguments
|
# Arguments workingDirectory, rest of arguments
|
||||||
local workingDir="$1"
|
local workingDir="$1"
|
||||||
shift
|
shift
|
||||||
terminals=(
|
local -a terminals=(
|
||||||
"lxterminal"
|
"lxterminal"
|
||||||
"mate-terminal"
|
"mate-terminal"
|
||||||
"gnome-terminal"
|
"gnome-terminal"
|
||||||
|
"xterm"
|
||||||
)
|
)
|
||||||
for i in "${terminals[@]}" ; do
|
for i in "${terminals[@]}" ; do
|
||||||
if command $i --working-directory="${workingDir}" -e "$@" ; then
|
if ! command -v "$i" > /dev/null 2>&1 ; then
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
if [[ "$i" == "xterm" ]]; then
|
||||||
|
if (cd "${workingDir}" && command xterm -e "$@"); then
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
if command "$i" --working-directory="${workingDir}" -e "$@" ; then
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
@@ -415,14 +425,18 @@ desktop_launcher() {
|
|||||||
local launchDirectory
|
local launchDirectory
|
||||||
local terminal
|
local terminal
|
||||||
# Try to find an accessible terminal
|
# Try to find an accessible terminal
|
||||||
for i in mate-terminal lxterminal terminator gnome-terminal ; do
|
for i in mate-terminal lxterminal terminator gnome-terminal xterm ; do
|
||||||
if command -v $i > /dev/null 2>&1 ; then
|
if command -v $i > /dev/null 2>&1 ; then
|
||||||
terminal="$i"
|
terminal="$i"
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
launchDirectory="${scriptRoot}"
|
launchDirectory="${scriptRoot}"
|
||||||
printf -v execLine "Exec=%s -t \"Linux Game Manager\" -e \"/usr/bin/bash -c 'pushd %q;nohup ./%q 2> /dev/null'\"" "${terminal}" "${launchDirectory}" "${0##*/}"
|
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##*/}"
|
||||||
|
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##*/}"
|
||||||
|
fi
|
||||||
dotDesktop=('[Desktop Entry]'
|
dotDesktop=('[Desktop Entry]'
|
||||||
'Name=Linux game manager'
|
'Name=Linux game manager'
|
||||||
'GenericName=Linux game Manager'
|
'GenericName=Linux game Manager'
|
||||||
|
|||||||
Reference in New Issue
Block a user