mirror of
https://github.com/lone-cloud/gerbil
synced 2026-06-03 09:33:10 -07:00
better app name matching for GNOME resources on linux, better app name display in OSX, auto hide menu bar for new html windows
This commit is contained in:
parent
f117c14869
commit
a21857dfb6
4 changed files with 128 additions and 128 deletions
243
.github/workflows/aur-release.yml
vendored
243
.github/workflows/aur-release.yml
vendored
|
|
@ -176,131 +176,136 @@ jobs:
|
|||
- name: Generate PKGBUILD
|
||||
run: |
|
||||
cat > PKGBUILD << 'EOF'
|
||||
# Maintainer: ${{ steps.release_info.outputs.author_name }} <${{ steps.release_info.outputs.author_email }}>
|
||||
pkgname=gerbil
|
||||
pkgver=${{ steps.release_info.outputs.version }}
|
||||
pkgrel=${{ inputs.pkgrel || '1' }}
|
||||
pkgdesc="Run Large Language Models locally"
|
||||
arch=('x86_64')
|
||||
url="https://github.com/lone-cloud/gerbil"
|
||||
license=('AGPL-3.0-or-later')
|
||||
depends=('gtk3' 'nss')
|
||||
optdepends=('alsa-lib: Audio support for sound effects'
|
||||
'libxss: Screen saver detection support')
|
||||
provides=('gerbil')
|
||||
conflicts=('gerbil-git')
|
||||
source=("gerbil-${pkgver}.AppImage::${{ steps.release_info.outputs.appimage_url }}"
|
||||
"gerbil.desktop::https://github.com/lone-cloud/gerbil/releases/download/${{ steps.release_info.outputs.tag }}/gerbil.desktop"
|
||||
"LICENSE::https://github.com/lone-cloud/gerbil/releases/download/${{ steps.release_info.outputs.tag }}/LICENSE")
|
||||
sha256sums=('${{ steps.sha_calc.outputs.sha256_appimage }}'
|
||||
'${{ steps.sha_calc.outputs.sha256_desktop }}'
|
||||
'${{ steps.sha_calc.outputs.sha256_license }}')
|
||||
# Maintainer: ${{ steps.release_info.outputs.author_name }} <${{ steps.release_info.outputs.author_email }}>
|
||||
pkgname=gerbil
|
||||
pkgver=${{ steps.release_info.outputs.version }}
|
||||
pkgrel=${{ inputs.pkgrel || '1' }}
|
||||
pkgdesc="Run Large Language Models locally"
|
||||
arch=('x86_64')
|
||||
url="https://github.com/lone-cloud/gerbil"
|
||||
license=('AGPL-3.0-or-later')
|
||||
depends=('gtk3' 'nss')
|
||||
optdepends=('alsa-lib: Audio support for sound effects'
|
||||
'libxss: Screen saver detection support')
|
||||
provides=('gerbil')
|
||||
conflicts=('gerbil-git')
|
||||
source=("gerbil-${pkgver}.AppImage::${{ steps.release_info.outputs.appimage_url }}"
|
||||
"gerbil.desktop::https://github.com/lone-cloud/gerbil/releases/download/${{ steps.release_info.outputs.tag }}/gerbil.desktop"
|
||||
"LICENSE::https://github.com/lone-cloud/gerbil/releases/download/${{ steps.release_info.outputs.tag }}/LICENSE")
|
||||
sha256sums=('${{ steps.sha_calc.outputs.sha256_appimage }}'
|
||||
'${{ steps.sha_calc.outputs.sha256_desktop }}'
|
||||
'${{ steps.sha_calc.outputs.sha256_license }}')
|
||||
|
||||
prepare() {
|
||||
chmod +x "gerbil-${pkgver}.AppImage"
|
||||
"./gerbil-${pkgver}.AppImage" --appimage-extract
|
||||
}
|
||||
prepare() {
|
||||
chmod +x "gerbil-${pkgver}.AppImage"
|
||||
"./gerbil-${pkgver}.AppImage" --appimage-extract
|
||||
}
|
||||
|
||||
package() {
|
||||
# Install the application
|
||||
install -dm755 "${pkgdir}/opt/gerbil"
|
||||
cp -r squashfs-root/* "${pkgdir}/opt/gerbil/"
|
||||
|
||||
# Fix permissions on extracted files
|
||||
chmod -R 755 "${pkgdir}/opt/gerbil/"
|
||||
|
||||
# Create executable wrapper
|
||||
install -dm755 "${pkgdir}/usr/bin"
|
||||
cat > "${pkgdir}/usr/bin/gerbil" << 'WRAPPER'
|
||||
#!/bin/bash
|
||||
exec "/opt/gerbil/Gerbil" "$@"
|
||||
WRAPPER
|
||||
chmod +x "${pkgdir}/usr/bin/gerbil"
|
||||
|
||||
# Install desktop file and license
|
||||
install -dm755 "${pkgdir}/usr/share/applications"
|
||||
install -dm755 "${pkgdir}/usr/share/licenses/gerbil"
|
||||
cp "${srcdir}/gerbil.desktop" "${pkgdir}/usr/share/applications/"
|
||||
cp "${srcdir}/LICENSE" "${pkgdir}/usr/share/licenses/gerbil/"
|
||||
|
||||
# Install icon to hicolor theme directory and pixmaps as fallback
|
||||
install -dm755 "${pkgdir}/usr/share/icons/hicolor/512x512/apps"
|
||||
install -dm755 "${pkgdir}/usr/share/pixmaps"
|
||||
package() {
|
||||
# Install the application
|
||||
install -dm755 "${pkgdir}/opt/gerbil"
|
||||
cp -r squashfs-root/* "${pkgdir}/opt/gerbil/"
|
||||
|
||||
if [ -f "${pkgdir}/opt/gerbil/usr/share/icons/hicolor/512x512/apps/Gerbil.png" ]; then
|
||||
cp "${pkgdir}/opt/gerbil/usr/share/icons/hicolor/512x512/apps/Gerbil.png" "${pkgdir}/usr/share/icons/hicolor/512x512/apps/gerbil.png"
|
||||
cp "${pkgdir}/opt/gerbil/usr/share/icons/hicolor/512x512/apps/Gerbil.png" "${pkgdir}/usr/share/pixmaps/gerbil.png"
|
||||
else
|
||||
echo "Warning: Could not find Gerbil.png in expected locations"
|
||||
find "${pkgdir}/opt/gerbil" -name "*erbil*.png" -type f | head -1 | while read icon_file; do
|
||||
if [ -n "$icon_file" ]; then
|
||||
echo "Found icon at: $icon_file"
|
||||
cp "$icon_file" "${pkgdir}/usr/share/icons/hicolor/512x512/apps/gerbil.png"
|
||||
cp "$icon_file" "${pkgdir}/usr/share/pixmaps/gerbil.png"
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
# Install shell completions
|
||||
install -dm755 "${pkgdir}/usr/share/bash-completion/completions"
|
||||
install -dm755 "${pkgdir}/usr/share/zsh/site-functions"
|
||||
|
||||
# Bash completion
|
||||
cat > "${pkgdir}/usr/share/bash-completion/completions/gerbil" << 'BASH_COMP'
|
||||
_gerbil() {
|
||||
local cur prev opts
|
||||
COMPREPLY=()
|
||||
cur="${COMP_WORDS[COMP_CWORD]}"
|
||||
prev="${COMP_WORDS[COMP_CWORD-1]}"
|
||||
opts="--version --cli"
|
||||
# Rename main binary to lowercase for consistency
|
||||
if [ -f "${pkgdir}/opt/gerbil/Gerbil" ]; then
|
||||
mv "${pkgdir}/opt/gerbil/Gerbil" "${pkgdir}/opt/gerbil/gerbil"
|
||||
fi
|
||||
|
||||
case "${prev}" in
|
||||
--cli)
|
||||
# Don't complete after --cli, let user type kobold args
|
||||
return 0
|
||||
;;
|
||||
*)
|
||||
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
}
|
||||
complete -F _gerbil gerbil
|
||||
BASH_COMP
|
||||
|
||||
# Zsh completion
|
||||
cat > "${pkgdir}/usr/share/zsh/site-functions/_gerbil" << 'ZSH_COMP'
|
||||
#compdef gerbil
|
||||
# Fix permissions on extracted files
|
||||
chmod -R 755 "${pkgdir}/opt/gerbil/"
|
||||
|
||||
_gerbil() {
|
||||
local context state line
|
||||
|
||||
_arguments -C \
|
||||
'1: :->command' \
|
||||
'*: :->args' && return 0
|
||||
|
||||
case $state in
|
||||
command)
|
||||
local commands=(
|
||||
'--version:Show version information'
|
||||
'--cli:Run in CLI mode (pass remaining args to kobold binary)'
|
||||
)
|
||||
_describe 'commands' commands
|
||||
;;
|
||||
args)
|
||||
case ${words[2]} in
|
||||
--cli)
|
||||
# Don't complete after --cli, let user type kobold args
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
}
|
||||
# Create executable wrapper
|
||||
install -dm755 "${pkgdir}/usr/bin"
|
||||
cat > "${pkgdir}/usr/bin/gerbil" << 'WRAPPER'
|
||||
#!/bin/bash
|
||||
exec "/opt/gerbil/gerbil" "$@"
|
||||
WRAPPER
|
||||
chmod +x "${pkgdir}/usr/bin/gerbil"
|
||||
|
||||
_gerbil "$@"
|
||||
ZSH_COMP
|
||||
}
|
||||
EOF
|
||||
# Install desktop file and license
|
||||
install -dm755 "${pkgdir}/usr/share/applications"
|
||||
install -dm755 "${pkgdir}/usr/share/licenses/gerbil"
|
||||
cp "${srcdir}/gerbil.desktop" "${pkgdir}/usr/share/applications/"
|
||||
cp "${srcdir}/LICENSE" "${pkgdir}/usr/share/licenses/gerbil/"
|
||||
|
||||
# Install icon to hicolor theme directory and pixmaps as fallback
|
||||
install -dm755 "${pkgdir}/usr/share/icons/hicolor/512x512/apps"
|
||||
install -dm755 "${pkgdir}/usr/share/pixmaps"
|
||||
|
||||
if [ -f "${pkgdir}/opt/gerbil/usr/share/icons/hicolor/512x512/apps/Gerbil.png" ]; then
|
||||
cp "${pkgdir}/opt/gerbil/usr/share/icons/hicolor/512x512/apps/Gerbil.png" "${pkgdir}/usr/share/icons/hicolor/512x512/apps/gerbil.png"
|
||||
cp "${pkgdir}/opt/gerbil/usr/share/icons/hicolor/512x512/apps/Gerbil.png" "${pkgdir}/usr/share/pixmaps/gerbil.png"
|
||||
else
|
||||
echo "Warning: Could not find Gerbil.png in expected locations"
|
||||
find "${pkgdir}/opt/gerbil" -name "*erbil*.png" -type f | head -1 | while read icon_file; do
|
||||
if [ -n "$icon_file" ]; then
|
||||
echo "Found icon at: $icon_file"
|
||||
cp "$icon_file" "${pkgdir}/usr/share/icons/hicolor/512x512/apps/gerbil.png"
|
||||
cp "$icon_file" "${pkgdir}/usr/share/pixmaps/gerbil.png"
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
# Install shell completions
|
||||
install -dm755 "${pkgdir}/usr/share/bash-completion/completions"
|
||||
install -dm755 "${pkgdir}/usr/share/zsh/site-functions"
|
||||
|
||||
# Bash completion
|
||||
cat > "${pkgdir}/usr/share/bash-completion/completions/gerbil" << 'BASH_COMP'
|
||||
_gerbil() {
|
||||
local cur prev opts
|
||||
COMPREPLY=()
|
||||
cur="${COMP_WORDS[COMP_CWORD]}"
|
||||
prev="${COMP_WORDS[COMP_CWORD-1]}"
|
||||
opts="--version --cli"
|
||||
|
||||
case "${prev}" in
|
||||
--cli)
|
||||
# Don't complete after --cli, let user type kobold args
|
||||
return 0
|
||||
;;
|
||||
*)
|
||||
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
}
|
||||
complete -F _gerbil gerbil
|
||||
BASH_COMP
|
||||
|
||||
# Zsh completion
|
||||
cat > "${pkgdir}/usr/share/zsh/site-functions/_gerbil" << 'ZSH_COMP'
|
||||
#compdef gerbil
|
||||
|
||||
_gerbil() {
|
||||
local context state line
|
||||
|
||||
_arguments -C \
|
||||
'1: :->command' \
|
||||
'*: :->args' && return 0
|
||||
|
||||
case $state in
|
||||
command)
|
||||
local commands=(
|
||||
'--version:Show version information'
|
||||
'--cli:Run in CLI mode (pass remaining args to kobold binary)'
|
||||
)
|
||||
_describe 'commands' commands
|
||||
;;
|
||||
args)
|
||||
case ${words[2]} in
|
||||
--cli)
|
||||
# Don't complete after --cli, let user type kobold args
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
_gerbil "$@"
|
||||
ZSH_COMP
|
||||
}
|
||||
EOF
|
||||
|
||||
- name: Create .SRCINFO
|
||||
run: |
|
||||
|
|
|
|||
10
package.json
10
package.json
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "gerbil",
|
||||
"productName": "Gerbil",
|
||||
"version": "1.5.3",
|
||||
"version": "1.5.4",
|
||||
"description": "Run Large Language Models locally",
|
||||
"main": "out/main/index.js",
|
||||
"homepage": "./",
|
||||
|
|
@ -165,14 +165,6 @@
|
|||
"compression": "store",
|
||||
"category": "Utility",
|
||||
"icon": "src/assets/icon.png",
|
||||
"desktop": {
|
||||
"entry": {
|
||||
"Name": "Gerbil",
|
||||
"Comment": "Run Large Language Models locally",
|
||||
"Categories": "Utility;",
|
||||
"StartupWMClass": "Gerbil"
|
||||
}
|
||||
},
|
||||
"extraFiles": [
|
||||
{
|
||||
"from": "assets/gerbil.desktop",
|
||||
|
|
|
|||
|
|
@ -16,11 +16,13 @@ import { stopFrontend as stopOpenWebUI } from '@/main/modules/openwebui';
|
|||
import { stopFrontend as stopComfyUI } from '@/main/modules/comfyui';
|
||||
import { setupIPCHandlers } from '@/main/ipc';
|
||||
import { ensureDir } from '@/utils/node/fs';
|
||||
import { PRODUCT_NAME } from '@/constants';
|
||||
|
||||
export async function initializeApp() {
|
||||
const installDir = getInstallDir();
|
||||
|
||||
await app.whenReady();
|
||||
app.setName(PRODUCT_NAME);
|
||||
await initializeConfig();
|
||||
await ensureDir(installDir);
|
||||
|
||||
|
|
|
|||
|
|
@ -142,6 +142,7 @@ export function createMainWindow() {
|
|||
: join(__dirname, '../../assets/icon.png'),
|
||||
title: PRODUCT_NAME,
|
||||
backgroundColor: getBackgroundColor(),
|
||||
autoHideMenuBar: true,
|
||||
},
|
||||
}));
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue