mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-17 07:14:28 +01:00
fix: term opening on Linux (#845)
This commit is contained in:
15
.github/workflows/release.yml
vendored
15
.github/workflows/release.yml
vendored
@@ -20,7 +20,7 @@ jobs:
|
|||||||
uses: subosito/flutter-action@v2
|
uses: subosito/flutter-action@v2
|
||||||
with:
|
with:
|
||||||
channel: "stable"
|
channel: "stable"
|
||||||
flutter-version: "3.32.2"
|
flutter-version: "3.32.8"
|
||||||
- uses: actions/setup-java@v4
|
- uses: actions/setup-java@v4
|
||||||
with:
|
with:
|
||||||
distribution: "zulu"
|
distribution: "zulu"
|
||||||
@@ -58,24 +58,17 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
sudo apt update
|
sudo apt update
|
||||||
# Basic
|
# Basic
|
||||||
sudo apt install -y clang cmake ninja-build pkg-config libgtk-3-dev libvulkan-dev desktop-file-utils wget
|
sudo apt install -y clang cmake ninja-build pkg-config libgtk-3-dev mesa-utils libvulkan-dev desktop-file-utils wget
|
||||||
# App Specific
|
# App Specific
|
||||||
sudo apt install -y libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libunwind-dev
|
sudo apt install -y libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libunwind-dev libsecret-1-dev
|
||||||
# Packaging
|
|
||||||
sudo wget https://github.com/AppImage/appimagetool/releases/download/1.9.0/appimagetool-x86_64.AppImage -O /bin/appimagetool
|
|
||||||
sudo chmod +x /bin/appimagetool
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: |
|
run: |
|
||||||
dart run fl_build -p linux
|
dart run fl_build -p linux
|
||||||
- name: Rename artifacts
|
|
||||||
run: |
|
|
||||||
appimage_name=$(ls dist/*/*.AppImage)
|
|
||||||
mv $appimage_name ${{ env.APP_NAME }}_${{ env.BUILD_NUMBER }}_amd64.appimage
|
|
||||||
- name: Create Release
|
- name: Create Release
|
||||||
uses: softprops/action-gh-release@v2
|
uses: softprops/action-gh-release@v2
|
||||||
with:
|
with:
|
||||||
files: |
|
files: |
|
||||||
${{ env.APP_NAME }}_${{ env.BUILD_NUMBER }}_amd64.appimage
|
${{ env.APP_NAME }}_${{ env.BUILD_NUMBER }}_amd64.AppImage
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
|||||||
@@ -281,59 +281,24 @@ bool _checkClient(BuildContext context, String id) {
|
|||||||
|
|
||||||
const _runEmulatorShell = '''
|
const _runEmulatorShell = '''
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# launch_terminal.sh
|
|
||||||
|
|
||||||
TERMINAL="\$1"
|
TERMINAL="\$1"
|
||||||
shift # Remove the first argument (terminal name)
|
shift
|
||||||
|
|
||||||
# Auto detect terminal if not provided
|
|
||||||
if [ -z "\$TERMINAL" ] || [ "\$TERMINAL" = "x-terminal-emulator" ]; then
|
if [ -z "\$TERMINAL" ] || [ "\$TERMINAL" = "x-terminal-emulator" ]; then
|
||||||
# Follow the order of preference
|
for term in kitty alacritty gnome-terminal gnome-console konsole xfce4-terminal terminator tilix wezterm foot xterm; do
|
||||||
for term in kitty alacritty gnome-terminal konsole xfce4-terminal terminator tilix wezterm foot; do
|
command -v "\$term" >/dev/null 2>&1 && { TERMINAL="\$term"; break; }
|
||||||
if command -v "\$term" >/dev/null 2>&1; then
|
|
||||||
TERMINAL="\$term"
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
done
|
done
|
||||||
|
|
||||||
[ -z "\$TERMINAL" ] && TERMINAL="x-terminal-emulator"
|
[ -z "\$TERMINAL" ] && TERMINAL="x-terminal-emulator"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
case "\$TERMINAL" in
|
case "\$TERMINAL" in
|
||||||
gnome-terminal)
|
gnome-terminal|gnome-console) exec "\$TERMINAL" -- "\$@" ;;
|
||||||
exec "\$TERMINAL" -- "\$@"
|
alacritty)
|
||||||
;;
|
"\$TERMINAL" --version 2>&1 | grep -q "alacritty 0\\.1[3-9]" &&
|
||||||
konsole|terminator|tilix)
|
exec "\$TERMINAL" --command "\$@" || exec "\$TERMINAL" -e "\$@" ;;
|
||||||
exec "\$TERMINAL" -e "\$@"
|
kitty|foot) exec "\$TERMINAL" "\$@" ;;
|
||||||
;;
|
wezterm) exec "\$TERMINAL" start -- "\$@" ;;
|
||||||
xfce4-terminal)
|
xfce4-terminal) exec "\$TERMINAL" -e "\$*" ;;
|
||||||
exec "\$TERMINAL" -e "\$*"
|
*) exec "\$TERMINAL" -e "\$@" ;;
|
||||||
;;
|
|
||||||
alacritty)
|
|
||||||
# Check alacritty version
|
|
||||||
if "\$TERMINAL" --version 2>&1 | grep -q "alacritty 0\\.1[3-9]"; then
|
|
||||||
# 0.13.0+
|
|
||||||
exec "\$TERMINAL" --command "\$@"
|
|
||||||
else
|
|
||||||
# Old versions
|
|
||||||
exec "\$TERMINAL" -e "\$@"
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
kitty)
|
|
||||||
exec "\$TERMINAL" "\$@"
|
|
||||||
;;
|
|
||||||
wezterm)
|
|
||||||
exec "\$TERMINAL" start -- "\$@"
|
|
||||||
;;
|
|
||||||
foot)
|
|
||||||
exec "\$TERMINAL" "\$@"
|
|
||||||
;;
|
|
||||||
urxvt|rxvt-unicode)
|
|
||||||
exec "\$TERMINAL" -e "\$@"
|
|
||||||
;;
|
|
||||||
x-terminal-emulator|*)
|
|
||||||
# Default
|
|
||||||
exec "\$TERMINAL" -e "\$@"
|
|
||||||
;;
|
|
||||||
esac
|
esac
|
||||||
''';
|
''';
|
||||||
|
|||||||
Reference in New Issue
Block a user