mirror of
https://github.com/Eugeny/tabby.git
synced 2025-09-10 10:31:51 +00:00
Compare commits
5 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
4efcf1bbd6 | ||
![]() |
abea964d94 | ||
![]() |
2e7b66ac60 | ||
![]() |
c4a514fc4a | ||
![]() |
d525374061 |
20
.github/workflows/build.yml
vendored
20
.github/workflows/build.yml
vendored
@@ -130,7 +130,7 @@ jobs:
|
||||
path: artifact-zip
|
||||
|
||||
Linux-Build:
|
||||
runs-on: ubuntu-24.04
|
||||
runs-on: ${{matrix.os}}
|
||||
needs: Lint
|
||||
strategy:
|
||||
matrix:
|
||||
@@ -138,14 +138,17 @@ jobs:
|
||||
- build-arch: x64
|
||||
arch: amd64
|
||||
rust_triple: x86_64-unknown-linux-gnu
|
||||
os: ubuntu-24.04
|
||||
- build-arch: arm64
|
||||
arch: arm64
|
||||
rust_triple: aarch64-unknown-linux-gnu
|
||||
triplet: aarch64-linux-gnu-
|
||||
os: ubuntu-24.04-arm
|
||||
- build-arch: arm
|
||||
arch: armhf
|
||||
rust_triple: arm-unknown-linux-gnueabihf
|
||||
triplet: arm-linux-gnueabihf-
|
||||
os: ubuntu-24.04
|
||||
fail-fast: false
|
||||
|
||||
env:
|
||||
@@ -167,6 +170,10 @@ jobs:
|
||||
with:
|
||||
node-version: 22
|
||||
|
||||
- name: Install FPM
|
||||
run: |
|
||||
sudo gem install fpm
|
||||
|
||||
- run: rustup target add ${{matrix.rust_triple}}
|
||||
|
||||
- name: Install dependencies
|
||||
@@ -176,12 +183,12 @@ jobs:
|
||||
|
||||
- name: Setup tar to run as root
|
||||
run: sudo chmod u+s "$(command -v tar)"
|
||||
if: matrix.build-arch != 'x64'
|
||||
if: matrix.build-arch == 'arm'
|
||||
|
||||
- name: Download cached sysroot
|
||||
uses: actions/cache@v3
|
||||
id: dl-cached-sysroot
|
||||
if: matrix.build-arch !='x64'
|
||||
if: matrix.build-arch == 'arm'
|
||||
with:
|
||||
key: sysroot-${{matrix.build-arch}}
|
||||
path: /${{matrix.build-arch}}-sysroot
|
||||
@@ -191,7 +198,7 @@ jobs:
|
||||
sudo apt-get update -y && sudo apt-get install debootstrap qemu-user-static binfmt-support -y
|
||||
sudo qemu-debootstrap --include=libfontconfig1-dev,libsecret-1-dev,libnss3,libatk1.0-0,libatk-bridge2.0-0,libgdk-pixbuf2.0-0,libgtk-3-0,libgbm1 --variant=buildd --exclude=snapd --components=main,restricted,universe,multiverse --extractor=dpkg-deb --arch ${{matrix.arch}} bionic /${{matrix.build-arch}}-sysroot/ http://ports.ubuntu.com/ubuntu-ports/
|
||||
sudo find /${{matrix.build-arch}}-sysroot -type l -lname '/*' -exec sh -c 'file="$0"; dir=$(dirname "$file"); target=$(readlink "$0"); prefix=$(dirname "$dir" | sed 's@[^/]*@\.\.@g'); newtarget="$prefix$target"; ln -snf $newtarget $file' {} \; ;
|
||||
if: matrix.build-arch != 'x64' && steps.dl-cached-sysroot.outputs.cache-hit != 'true'
|
||||
if: matrix.build-arch == 'arm' && steps.dl-cached-sysroot.outputs.cache-hit != 'true'
|
||||
|
||||
- name: Setup env to use ${{matrix.build-arch}} sysroot
|
||||
run: |
|
||||
@@ -206,9 +213,9 @@ jobs:
|
||||
elif [[ ${{matrix.arch}} == 'arm64' ]]; then
|
||||
echo "PKG_CONFIG_PATH=/${{matrix.build-arch}}-sysroot/usr/lib/pkgconfig/:/${{matrix.build-arch}}-sysroot/usr/lib/aarch64-linux-gnu/pkgconfig/" >> $GITHUB_ENV
|
||||
fi
|
||||
if: matrix.build-arch != 'x64'
|
||||
if: matrix.build-arch == 'arm'
|
||||
|
||||
- name: Install npm_modules (amd64)
|
||||
- name: Install npm_modules (native)
|
||||
run: |
|
||||
npm i -g yarn node-gyp
|
||||
yarn --network-timeout 1000000 --arch=${{matrix.build-arch}} --target-arch=${{matrix.build-arch}}
|
||||
@@ -225,6 +232,7 @@ jobs:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
KEYGEN_TOKEN: ${{ secrets.KEYGEN_TOKEN }}
|
||||
USE_HARD_LINKS: false
|
||||
USE_SYSTEM_FPM: true
|
||||
# DEBUG: electron-builder,electron-builder:*
|
||||
|
||||
- name: Build web resources (amd64 only)
|
||||
|
@@ -23,6 +23,7 @@ export class ThemesService {
|
||||
) {
|
||||
this.rootElementStyleBackup = document.documentElement.style.cssText
|
||||
this.applyTheme(standardTheme)
|
||||
this.applyThemeVariables()
|
||||
config.ready$.toPromise().then(() => {
|
||||
this.applyCurrentTheme()
|
||||
this.applyThemeVariables()
|
||||
@@ -37,6 +38,11 @@ export class ThemesService {
|
||||
})
|
||||
}
|
||||
|
||||
private getConfigStoreOrDefaults (): any {
|
||||
/// Theme service is active before the vault is unlocked and config is available
|
||||
return this.config.store ?? this.config.getDefaults()
|
||||
}
|
||||
|
||||
private applyThemeVariables () {
|
||||
if (!this.findCurrentTheme().followsColorScheme) {
|
||||
document.documentElement.style.cssText = this.rootElementStyleBackup
|
||||
@@ -60,7 +66,7 @@ export class ThemesService {
|
||||
}
|
||||
|
||||
let background = Color(theme.background)
|
||||
if (this.config.store?.appearance.vibrancy) {
|
||||
if (this.getConfigStoreOrDefaults().appearance.vibrancy) {
|
||||
background = background.fade(0.6)
|
||||
}
|
||||
// const background = theme.background
|
||||
@@ -148,13 +154,13 @@ export class ThemesService {
|
||||
vars['--bs-form-switch-bg'] = `url("data:image/svg+xml,%3csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%27-4 -4 8 8%27%3e%3ccircle r=%273%27 fill=%27${switchBackground}%27/%3e%3c/svg%3e")`
|
||||
}
|
||||
|
||||
vars['--spaciness'] = this.config.store.appearance.spaciness
|
||||
vars['--spaciness'] = this.getConfigStoreOrDefaults().appearance.spaciness
|
||||
|
||||
for (const [bg, fg] of contrastPairs) {
|
||||
const colorBg = Color(vars[bg]).hsl()
|
||||
const colorFg = Color(vars[fg]).hsl()
|
||||
const bgContrast = colorBg.contrast(colorFg)
|
||||
if (bgContrast < this.config.store.terminal.minimumContrastRatio) {
|
||||
if (bgContrast < this.getConfigStoreOrDefaults().terminal.minimumContrastRatio) {
|
||||
vars[fg] = this.ensureContrast(colorFg, colorBg).string()
|
||||
}
|
||||
}
|
||||
@@ -163,7 +169,7 @@ export class ThemesService {
|
||||
document.documentElement.style.setProperty(key, value)
|
||||
}
|
||||
|
||||
document.body.classList.toggle('no-animations', !this.config.store.accessibility.animations)
|
||||
document.body.classList.toggle('no-animations', !this.getConfigStoreOrDefaults().accessibility.animations)
|
||||
}
|
||||
|
||||
private ensureContrast (color: Color, against: Color): Color {
|
||||
@@ -178,7 +184,7 @@ export class ThemesService {
|
||||
while (
|
||||
(step < 1 && color.color[2] > 1 ||
|
||||
step > 1 && color.color[2] < 99) &&
|
||||
color.contrast(against) < this.config.store.terminal.minimumContrastRatio) {
|
||||
color.contrast(against) < this.getConfigStoreOrDefaults().terminal.minimumContrastRatio) {
|
||||
color.color[2] *= step
|
||||
}
|
||||
return color
|
||||
@@ -189,22 +195,22 @@ export class ThemesService {
|
||||
}
|
||||
|
||||
findCurrentTheme (): Theme {
|
||||
return this.findTheme(this.config.store.appearance.theme) ?? this.standardTheme
|
||||
return this.findTheme(this.getConfigStoreOrDefaults().appearance.theme) ?? this.standardTheme
|
||||
}
|
||||
|
||||
/// @hidden
|
||||
_getActiveColorScheme (): any {
|
||||
let theme: PlatformTheme = 'dark'
|
||||
if (this.config.store.appearance.colorSchemeMode === 'light') {
|
||||
if (this.getConfigStoreOrDefaults().appearance.colorSchemeMode === 'light') {
|
||||
theme = 'light'
|
||||
} else if (this.config.store.appearance.colorSchemeMode === 'auto') {
|
||||
} else if (this.getConfigStoreOrDefaults().appearance.colorSchemeMode === 'auto') {
|
||||
theme = this.platform.getTheme()
|
||||
}
|
||||
|
||||
if (theme === 'light') {
|
||||
return this.config.store.terminal.lightColorScheme
|
||||
return this.getConfigStoreOrDefaults().terminal.lightColorScheme
|
||||
} else {
|
||||
return this.config.store.terminal.colorScheme
|
||||
return this.getConfigStoreOrDefaults().terminal.colorScheme
|
||||
}
|
||||
}
|
||||
|
||||
@@ -215,7 +221,7 @@ export class ThemesService {
|
||||
document.querySelector('head')!.appendChild(this.styleElement)
|
||||
}
|
||||
this.styleElement.textContent = theme.css
|
||||
document.querySelector('style#custom-css')!.innerHTML = this.config.store?.appearance?.css
|
||||
document.querySelector('style#custom-css')!.innerHTML = this.getConfigStoreOrDefaults().appearance.css
|
||||
this.themeChanged.next(theme)
|
||||
}
|
||||
|
||||
|
@@ -58,7 +58,7 @@ function sshAuthTypeForMethod (m: AuthMethod): string {
|
||||
case 'saved-password': return 'password'
|
||||
case 'keyboard-interactive': return 'keyboard-interactive'
|
||||
case 'publickey': return 'publickey'
|
||||
case 'agent': return 'agent'
|
||||
case 'agent': return 'publickey'
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user