mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-09-12 10:22:12 +02:00
Merge pull request #2497 from fastfetch-cli/dev
This commit is contained in:
+1
-1
@@ -1,5 +1,5 @@
|
||||
[codespell]
|
||||
check-filenames =
|
||||
builtin = clear,rare,usage,informal
|
||||
skip = */.git,*/cmake-build-*,*/.idea,*/completions,*/presets,*/screenshots,*/tests,*/3rdparty,*/logo/ascii,./src/detection/gpu/asahi_drm.h,./src/detection/cpu/cpu_x86.c,./src/detection/gpu/gpu_bsddrm.c,./src/detection/displayserver/linux/wayland/*-protocol.*,./build,./build-*,./build_*
|
||||
skip = */.git,*/cmake-build-*,*/.idea,*/completions,*/presets,*/screenshots,*/tests,*/3rdparty,*/logo/ascii,./src/detection/gpu/asahi_drm.h,./src/detection/cpu/cpu_x86.c,./src/detection/gpu/gpu_bsddrm.c,./src/detection/displayserver/linux/wayland/*-protocol.*,./build,./build-*,./build_*,./src/common/impl/genconfig.c
|
||||
ignore-words-list = iterm,compiletime,unknwn,pengwin,siduction,master,slave,sur,doas,conexant,ags,bu,renderD,SME,Carmel,kinda
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: "github-actions"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
day: "sunday"
|
||||
cooldown:
|
||||
default-days: 7
|
||||
open-pull-requests-limit: 10
|
||||
commit-message:
|
||||
prefix: "CI"
|
||||
labels:
|
||||
- "ci"
|
||||
groups:
|
||||
github-actions:
|
||||
patterns:
|
||||
- "*"
|
||||
@@ -3,6 +3,9 @@ name: Reusable DragonFly amd64
|
||||
on:
|
||||
workflow_call:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
@@ -12,10 +15,10 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: checkout repository
|
||||
uses: actions/checkout@v7
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
|
||||
- name: Start VM
|
||||
uses: cross-platform-actions/action@master
|
||||
uses: cross-platform-actions/action@5ea7e8e4677bd726033a10b094ba1c5762b15dee # v1.3.0
|
||||
with:
|
||||
operating_system: dragonflybsd
|
||||
version: '6.4.2'
|
||||
@@ -57,7 +60,7 @@ jobs:
|
||||
run: ctest --output-on-failure
|
||||
|
||||
- name: upload artifacts
|
||||
uses: actions/upload-artifact@v7
|
||||
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
||||
with:
|
||||
name: fastfetch-dragonfly-amd64
|
||||
path: ./fastfetch-*.*
|
||||
|
||||
@@ -3,6 +3,9 @@ name: Reusable FreeBSD amd64
|
||||
on:
|
||||
workflow_call:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
@@ -12,10 +15,10 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: checkout repository
|
||||
uses: actions/checkout@v7
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
|
||||
- name: Start VM
|
||||
uses: cross-platform-actions/action@master
|
||||
uses: cross-platform-actions/action@5ea7e8e4677bd726033a10b094ba1c5762b15dee # v1.3.0
|
||||
with:
|
||||
operating_system: freebsd
|
||||
version: '15.1'
|
||||
@@ -58,7 +61,7 @@ jobs:
|
||||
run: ctest --output-on-failure
|
||||
|
||||
- name: upload artifacts
|
||||
uses: actions/upload-artifact@v7
|
||||
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
||||
with:
|
||||
name: fastfetch-freebsd-amd64
|
||||
path: ./fastfetch-*.*
|
||||
|
||||
@@ -3,6 +3,9 @@ name: Reusable Haiku amd64
|
||||
on:
|
||||
workflow_call:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
@@ -12,10 +15,10 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: checkout repository
|
||||
uses: actions/checkout@v7
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
|
||||
- name: Start VM
|
||||
uses: cross-platform-actions/action@master
|
||||
uses: cross-platform-actions/action@5ea7e8e4677bd726033a10b094ba1c5762b15dee # v1.3.0
|
||||
with:
|
||||
operating_system: haiku
|
||||
version: 'r1beta5'
|
||||
@@ -51,7 +54,7 @@ jobs:
|
||||
run: ctest --output-on-failure
|
||||
|
||||
- name: upload artifacts
|
||||
uses: actions/upload-artifact@v7
|
||||
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
||||
with:
|
||||
name: fastfetch-haiku-amd64
|
||||
path: ./fastfetch-*.*
|
||||
|
||||
@@ -3,6 +3,9 @@ name: Reusable Linux armv7l
|
||||
on:
|
||||
workflow_call:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
env:
|
||||
CMAKE_BUILD_TYPE: ${{ vars.CMAKE_BUILD_TYPE || 'RelWithDebInfo' }}
|
||||
|
||||
@@ -11,10 +14,10 @@ jobs:
|
||||
runs-on: ubuntu-24.04
|
||||
steps:
|
||||
- name: checkout repository
|
||||
uses: actions/checkout@v7
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
|
||||
- name: run VM
|
||||
uses: uraimo/run-on-arch-action@v3
|
||||
uses: uraimo/run-on-arch-action@f9b26e3a1a408d5fd530d20c17b9f3f4428ff8d9 # v3.1.0
|
||||
id: runcmd
|
||||
with:
|
||||
arch: armv7
|
||||
@@ -38,7 +41,7 @@ jobs:
|
||||
ctest --output-on-failure
|
||||
|
||||
- name: upload artifacts
|
||||
uses: actions/upload-artifact@v7
|
||||
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
||||
with:
|
||||
name: fastfetch-linux-armv7l
|
||||
path: ./fastfetch-*.*
|
||||
|
||||
@@ -14,6 +14,10 @@ on:
|
||||
description: fastfetch version from linux host build
|
||||
value: ${{ jobs.build.outputs.ffversion }}
|
||||
|
||||
permissions:
|
||||
security-events: write
|
||||
contents: read
|
||||
|
||||
env:
|
||||
CMAKE_BUILD_TYPE: ${{ vars.CMAKE_BUILD_TYPE || 'RelWithDebInfo' }}
|
||||
|
||||
@@ -24,7 +28,7 @@ jobs:
|
||||
ffversion: ${{ steps.ffversion.outputs.ffversion }}
|
||||
steps:
|
||||
- name: checkout repository
|
||||
uses: actions/checkout@v7
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
|
||||
- name: uname -a
|
||||
run: uname -a
|
||||
@@ -48,7 +52,7 @@ jobs:
|
||||
|
||||
- name: Initialize CodeQL
|
||||
if: inputs.arch == 'amd64'
|
||||
uses: github/codeql-action/init@v4
|
||||
uses: github/codeql-action/init@5595ccaf912efad79be6eef63a5619ff05969be3 # v4.37.6
|
||||
with:
|
||||
languages: c
|
||||
|
||||
@@ -60,7 +64,7 @@ jobs:
|
||||
|
||||
- name: perform CodeQL analysis
|
||||
if: inputs.arch == 'amd64'
|
||||
uses: github/codeql-action/analyze@v4
|
||||
uses: github/codeql-action/analyze@5595ccaf912efad79be6eef63a5619ff05969be3 # v4.37.6
|
||||
|
||||
- name: list features
|
||||
run: ./fastfetch --list-features
|
||||
@@ -97,7 +101,7 @@ jobs:
|
||||
cpack -V
|
||||
|
||||
- name: upload artifacts
|
||||
uses: actions/upload-artifact@v7
|
||||
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
||||
with:
|
||||
name: fastfetch-linux-${{ inputs.arch }}
|
||||
path: ./fastfetch-*.*
|
||||
|
||||
@@ -3,6 +3,9 @@ name: Reusable Linux i686
|
||||
on:
|
||||
workflow_call:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
env:
|
||||
CMAKE_BUILD_TYPE: ${{ vars.CMAKE_BUILD_TYPE || 'RelWithDebInfo' }}
|
||||
|
||||
@@ -11,7 +14,7 @@ jobs:
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- name: checkout repository
|
||||
uses: actions/checkout@v7
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
|
||||
- name: uname -a
|
||||
run: uname -a
|
||||
@@ -64,7 +67,7 @@ jobs:
|
||||
run: ctest --output-on-failure
|
||||
|
||||
- name: upload artifacts
|
||||
uses: actions/upload-artifact@v7
|
||||
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
||||
with:
|
||||
name: fastfetch-linux-i686
|
||||
path: ./fastfetch-*.*
|
||||
|
||||
@@ -3,6 +3,9 @@ name: Reusable Linux loong64
|
||||
on:
|
||||
workflow_call:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
env:
|
||||
CMAKE_BUILD_TYPE: ${{ vars.CMAKE_BUILD_TYPE || 'RelWithDebInfo' }}
|
||||
|
||||
@@ -11,10 +14,10 @@ jobs:
|
||||
runs-on: ubuntu-24.04
|
||||
steps:
|
||||
- name: checkout repository
|
||||
uses: actions/checkout@v7
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
|
||||
- name: set up QEMU for loong64
|
||||
uses: docker/setup-qemu-action@06116385d9baf250c9f4dcb4858b16962ea869c3 # v4.1.0
|
||||
uses: docker/setup-qemu-action@96fe6ef7f33517b61c61be40b68a1882f3264fb8 # v4.2.0
|
||||
|
||||
- name: build in loong64 container
|
||||
run: |
|
||||
@@ -51,7 +54,7 @@ jobs:
|
||||
'
|
||||
|
||||
- name: upload artifacts
|
||||
uses: actions/upload-artifact@v7
|
||||
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
||||
with:
|
||||
name: fastfetch-linux-loong64
|
||||
path: ./fastfetch-*.*
|
||||
|
||||
@@ -7,6 +7,9 @@ on:
|
||||
required: true
|
||||
type: string
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
env:
|
||||
CMAKE_BUILD_TYPE: ${{ vars.CMAKE_BUILD_TYPE || 'RelWithDebInfo' }}
|
||||
|
||||
@@ -15,10 +18,10 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: checkout repository
|
||||
uses: actions/checkout@v7
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
|
||||
- name: run VM
|
||||
uses: uraimo/run-on-arch-action@v3
|
||||
uses: uraimo/run-on-arch-action@f9b26e3a1a408d5fd530d20c17b9f3f4428ff8d9 # v3.1.0
|
||||
id: runcmd
|
||||
with:
|
||||
arch: ${{ inputs.arch }}
|
||||
@@ -39,7 +42,7 @@ jobs:
|
||||
ctest --output-on-failure
|
||||
|
||||
- name: upload artifacts
|
||||
uses: actions/upload-artifact@v7
|
||||
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
||||
with:
|
||||
name: fastfetch-linux-${{ inputs.arch }}
|
||||
path: ./fastfetch-*.*
|
||||
|
||||
@@ -10,6 +10,9 @@ on:
|
||||
required: true
|
||||
type: string
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
env:
|
||||
CMAKE_BUILD_TYPE: ${{ vars.CMAKE_BUILD_TYPE || 'RelWithDebInfo' }}
|
||||
|
||||
@@ -18,7 +21,7 @@ jobs:
|
||||
runs-on: ${{ inputs.runs-on }}
|
||||
steps:
|
||||
- name: checkout repository
|
||||
uses: actions/checkout@v7
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
|
||||
- name: uname -a
|
||||
run: uname -a
|
||||
@@ -53,7 +56,7 @@ jobs:
|
||||
run: ctest --output-on-failure
|
||||
|
||||
- name: upload artifacts
|
||||
uses: actions/upload-artifact@v7
|
||||
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
||||
with:
|
||||
name: fastfetch-macos-${{ inputs.arch }}
|
||||
path: ./fastfetch-*.*
|
||||
|
||||
@@ -3,6 +3,9 @@ name: Reusable Musl amd64
|
||||
on:
|
||||
workflow_call:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
env:
|
||||
CMAKE_BUILD_TYPE: ${{ vars.CMAKE_BUILD_TYPE || 'RelWithDebInfo' }}
|
||||
|
||||
@@ -10,10 +13,10 @@ jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
|
||||
- name: setup alpine linux
|
||||
uses: jirutka/setup-alpine@master
|
||||
uses: jirutka/setup-alpine@ae3b3ddba35054804fc4a3507b519fa7e8152050 # v1.4.1
|
||||
with:
|
||||
branch: edge
|
||||
|
||||
@@ -41,7 +44,7 @@ jobs:
|
||||
shell: alpine.sh {0}
|
||||
|
||||
- name: upload artifacts
|
||||
uses: actions/upload-artifact@v7
|
||||
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
||||
with:
|
||||
name: fastfetch-musl-amd64
|
||||
path: ./fastfetch-*.*
|
||||
|
||||
@@ -3,6 +3,9 @@ name: Reusable NetBSD amd64
|
||||
on:
|
||||
workflow_call:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
@@ -12,10 +15,10 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: checkout repository
|
||||
uses: actions/checkout@v7
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
|
||||
- name: Start VM
|
||||
uses: cross-platform-actions/action@master
|
||||
uses: cross-platform-actions/action@5ea7e8e4677bd726033a10b094ba1c5762b15dee # v1.3.0
|
||||
with:
|
||||
operating_system: netbsd
|
||||
version: '10.1'
|
||||
@@ -56,7 +59,7 @@ jobs:
|
||||
run: ctest --output-on-failure
|
||||
|
||||
- name: upload artifacts
|
||||
uses: actions/upload-artifact@v7
|
||||
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
||||
with:
|
||||
name: fastfetch-netbsd-amd64
|
||||
path: ./fastfetch-*.*
|
||||
|
||||
@@ -3,6 +3,9 @@ name: Reusable No Features Test
|
||||
on:
|
||||
workflow_call:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
env:
|
||||
CMAKE_BUILD_TYPE: ${{ vars.CMAKE_BUILD_TYPE || 'RelWithDebInfo' }}
|
||||
|
||||
@@ -12,7 +15,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: checkout repository
|
||||
uses: actions/checkout@v7
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
|
||||
- name: uname -a
|
||||
run: uname -a
|
||||
|
||||
@@ -3,6 +3,9 @@ name: Reusable OmniOS amd64
|
||||
on:
|
||||
workflow_call:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
@@ -12,10 +15,10 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: checkout repository
|
||||
uses: actions/checkout@v7
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
|
||||
- name: Start VM
|
||||
uses: cross-platform-actions/action@master
|
||||
uses: cross-platform-actions/action@5ea7e8e4677bd726033a10b094ba1c5762b15dee # v1.3.0
|
||||
with:
|
||||
operating_system: omnios
|
||||
version: 'r151058'
|
||||
@@ -61,7 +64,7 @@ jobs:
|
||||
cpack -V
|
||||
|
||||
- name: upload artifacts
|
||||
uses: actions/upload-artifact@v7
|
||||
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
||||
with:
|
||||
name: fastfetch-omnios-amd64
|
||||
path: ./fastfetch-*.*
|
||||
|
||||
@@ -3,6 +3,9 @@ name: Reusable OpenBSD amd64
|
||||
on:
|
||||
workflow_call:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
@@ -12,10 +15,10 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: checkout repository
|
||||
uses: actions/checkout@v7
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
|
||||
- name: Start VM
|
||||
uses: cross-platform-actions/action@master
|
||||
uses: cross-platform-actions/action@5ea7e8e4677bd726033a10b094ba1c5762b15dee # v1.3.0
|
||||
with:
|
||||
operating_system: openbsd
|
||||
version: '7.9'
|
||||
@@ -56,7 +59,7 @@ jobs:
|
||||
run: ctest --output-on-failure
|
||||
|
||||
- name: upload artifacts
|
||||
uses: actions/upload-artifact@v7
|
||||
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
||||
with:
|
||||
name: fastfetch-openbsd-amd64
|
||||
path: ./fastfetch-*.*
|
||||
|
||||
@@ -7,23 +7,26 @@ on:
|
||||
required: true
|
||||
type: string
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
release:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: get latest release version
|
||||
id: get_version_release
|
||||
uses: pozetroninc/github-action-get-latest-release@master
|
||||
uses: pozetroninc/github-action-get-latest-release@2a61c339ea7ef0a336d1daa35ef0cb1418e7676c # v0.8.0
|
||||
with:
|
||||
repository: ${{ github.repository }}
|
||||
|
||||
- name: download artifacts
|
||||
if: inputs.ffversion != steps.get_version_release.outputs.release
|
||||
uses: actions/download-artifact@v8
|
||||
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
|
||||
|
||||
- name: create release
|
||||
if: inputs.ffversion != steps.get_version_release.outputs.release
|
||||
uses: ncipollo/release-action@v1
|
||||
uses: ncipollo/release-action@339a81892b84b4eeb0f6e744e4574d79d0d9b8dd # v1.21.0
|
||||
with:
|
||||
tag: ${{ inputs.ffversion }}
|
||||
commit: ${{ github.sha }}
|
||||
@@ -50,7 +53,7 @@ jobs:
|
||||
|
||||
- name: update release body
|
||||
if: inputs.ffversion != steps.get_version_release.outputs.release
|
||||
uses: ncipollo/release-action@v1
|
||||
uses: ncipollo/release-action@339a81892b84b4eeb0f6e744e4574d79d0d9b8dd # v1.21.0
|
||||
with:
|
||||
tag: ${{ inputs.ffversion }}
|
||||
commit: ${{ github.sha }}
|
||||
|
||||
@@ -3,6 +3,9 @@ name: Reusable Solaris amd64
|
||||
on:
|
||||
workflow_call:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
env:
|
||||
CMAKE_BUILD_TYPE: ${{ vars.CMAKE_BUILD_TYPE || 'RelWithDebInfo' }}
|
||||
|
||||
@@ -11,10 +14,10 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: checkout repository
|
||||
uses: actions/checkout@v7
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
|
||||
- name: run VM
|
||||
uses: vmactions/solaris-vm@v1
|
||||
uses: vmactions/solaris-vm@315163f088b66e55bbcc45928bd224d4973b2312 # v1.3.8
|
||||
with:
|
||||
usesh: true
|
||||
envs: 'CMAKE_BUILD_TYPE'
|
||||
@@ -37,7 +40,7 @@ jobs:
|
||||
cpack -V
|
||||
|
||||
- name: upload artifacts
|
||||
uses: actions/upload-artifact@v7
|
||||
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
||||
with:
|
||||
name: fastfetch-solaris-amd64
|
||||
path: ./fastfetch-*.*
|
||||
|
||||
@@ -3,13 +3,16 @@ name: Reusable Spellcheck
|
||||
on:
|
||||
workflow_call:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
spellcheck:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: checkout repository
|
||||
uses: actions/checkout@v7
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
|
||||
- name: Install codespell
|
||||
shell: bash
|
||||
|
||||
@@ -18,6 +18,18 @@ on:
|
||||
msys-arch:
|
||||
required: true
|
||||
type: string
|
||||
secrets:
|
||||
SIGNPATH_API_TOKEN:
|
||||
description: SignPath REST API token used to submit the signing request
|
||||
# Optional so that runs without the secret (pull requests, forks)
|
||||
# still work; the signing step is skipped there anyway.
|
||||
required: false
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
# The SignPath action reads job details and downloads the unsigned
|
||||
# artifact with the workflow token.
|
||||
actions: read
|
||||
|
||||
env:
|
||||
CMAKE_BUILD_TYPE: ${{ vars.CMAKE_BUILD_TYPE || 'RelWithDebInfo' }}
|
||||
@@ -30,10 +42,10 @@ jobs:
|
||||
shell: msys2 {0}
|
||||
steps:
|
||||
- name: checkout repository
|
||||
uses: actions/checkout@v7
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
|
||||
- name: setup-msys2
|
||||
uses: msys2/setup-msys2@v2
|
||||
uses: msys2/setup-msys2@66cd2cce69caa17b53920067426061ca1de3a884 # v2.32.0
|
||||
with:
|
||||
msystem: ${{ inputs.msystem }}
|
||||
update: true
|
||||
@@ -72,7 +84,7 @@ jobs:
|
||||
- if: github.event_name == 'push' && github.repository == 'fastfetch-cli/fastfetch'
|
||||
id: upload-unsigned-artifact
|
||||
name: upload artifacts for signing
|
||||
uses: actions/upload-artifact@v7
|
||||
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
||||
with:
|
||||
name: fastfetch-windows-${{ inputs.arch }}
|
||||
path: |
|
||||
@@ -82,7 +94,7 @@ jobs:
|
||||
|
||||
- if: github.event_name == 'push' && github.repository == 'fastfetch-cli/fastfetch'
|
||||
name: submit signing request
|
||||
uses: signpath/github-action-submit-signing-request@v1
|
||||
uses: signpath/github-action-submit-signing-request@b9d91eadd323de506c0c81cf0c7fe7438f3360fd # v2.2
|
||||
with:
|
||||
api-token: '${{ secrets.SIGNPATH_API_TOKEN }}'
|
||||
organization-id: '${{ vars.SIGNPATH_ORG_ID }}'
|
||||
@@ -99,7 +111,7 @@ jobs:
|
||||
run: 7z a -t7z -mx9 -bd -y fastfetch-windows-${{ inputs.arch }}.7z LICENSE *.dll fastfetch.exe flashfetch.exe presets
|
||||
|
||||
- name: upload true artifacts
|
||||
uses: actions/upload-artifact@v7
|
||||
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
||||
with:
|
||||
name: fastfetch-windows-${{ inputs.arch }}
|
||||
path: ./fastfetch-windows-${{ inputs.arch }}.*
|
||||
|
||||
+13
-29
@@ -6,16 +6,16 @@ on:
|
||||
|
||||
jobs:
|
||||
spellcheck:
|
||||
permissions:
|
||||
contents: read
|
||||
uses: ./.github/workflows/build-spellcheck.yml
|
||||
|
||||
no-features-test:
|
||||
needs: spellcheck
|
||||
name: No-features-test
|
||||
permissions:
|
||||
security-events: write
|
||||
contents: read
|
||||
uses: ./.github/workflows/build-no-features-test.yml
|
||||
secrets: inherit
|
||||
|
||||
linux-hosts:
|
||||
needs: no-features-test
|
||||
@@ -34,40 +34,32 @@ jobs:
|
||||
with:
|
||||
arch: ${{ matrix.arch }}
|
||||
runs-on: ${{ matrix.runs-on }}
|
||||
secrets: inherit
|
||||
|
||||
linux-i686:
|
||||
needs: no-features-test
|
||||
name: Linux-i686
|
||||
permissions:
|
||||
security-events: write
|
||||
contents: read
|
||||
uses: ./.github/workflows/build-linux-i686.yml
|
||||
secrets: inherit
|
||||
|
||||
linux-armv7l:
|
||||
needs: no-features-test
|
||||
name: Linux-armv7l
|
||||
permissions:
|
||||
security-events: write
|
||||
contents: read
|
||||
uses: ./.github/workflows/build-linux-armv7l.yml
|
||||
secrets: inherit
|
||||
|
||||
linux-loong64:
|
||||
needs: no-features-test
|
||||
name: Linux-loong64
|
||||
permissions:
|
||||
security-events: write
|
||||
contents: read
|
||||
uses: ./.github/workflows/build-linux-loong64.yml
|
||||
secrets: inherit
|
||||
|
||||
linux-vms:
|
||||
needs: no-features-test
|
||||
name: Linux-${{ matrix.arch }}
|
||||
permissions:
|
||||
security-events: write
|
||||
contents: read
|
||||
strategy:
|
||||
matrix:
|
||||
@@ -78,19 +70,18 @@ jobs:
|
||||
uses: ./.github/workflows/build-linux-vms.yml
|
||||
with:
|
||||
arch: ${{ matrix.arch }}
|
||||
secrets: inherit
|
||||
|
||||
musl-amd64:
|
||||
needs: no-features-test
|
||||
name: Musl-amd64
|
||||
permissions:
|
||||
contents: read
|
||||
uses: ./.github/workflows/build-musl-amd64.yml
|
||||
secrets: inherit
|
||||
|
||||
macos-hosts:
|
||||
needs: no-features-test
|
||||
name: macOS-${{ matrix.arch }}
|
||||
permissions:
|
||||
security-events: write
|
||||
contents: read
|
||||
strategy:
|
||||
matrix:
|
||||
@@ -103,72 +94,65 @@ jobs:
|
||||
with:
|
||||
arch: ${{ matrix.arch }}
|
||||
runs-on: ${{ matrix.runs-on }}
|
||||
secrets: inherit
|
||||
|
||||
omnios-amd64:
|
||||
needs: no-features-test
|
||||
name: OmniOS-amd64
|
||||
permissions:
|
||||
contents: read
|
||||
uses: ./.github/workflows/build-omnios-amd64.yml
|
||||
secrets: inherit
|
||||
|
||||
solaris-amd64:
|
||||
needs: no-features-test
|
||||
name: Solaris-amd64
|
||||
permissions:
|
||||
contents: read
|
||||
uses: ./.github/workflows/build-solaris-amd64.yml
|
||||
secrets: inherit
|
||||
|
||||
freebsd-amd64:
|
||||
needs: no-features-test
|
||||
name: FreeBSD-amd64
|
||||
permissions:
|
||||
security-events: write
|
||||
contents: read
|
||||
uses: ./.github/workflows/build-freebsd-amd64.yml
|
||||
secrets: inherit
|
||||
|
||||
openbsd-amd64:
|
||||
needs: no-features-test
|
||||
name: OpenBSD-amd64
|
||||
permissions:
|
||||
security-events: write
|
||||
contents: read
|
||||
uses: ./.github/workflows/build-openbsd-amd64.yml
|
||||
secrets: inherit
|
||||
|
||||
netbsd-amd64:
|
||||
needs: no-features-test
|
||||
name: NetBSD-amd64
|
||||
permissions:
|
||||
security-events: write
|
||||
contents: read
|
||||
uses: ./.github/workflows/build-netbsd-amd64.yml
|
||||
secrets: inherit
|
||||
|
||||
dragonfly-amd64:
|
||||
needs: no-features-test
|
||||
name: DragonFly-amd64
|
||||
permissions:
|
||||
security-events: write
|
||||
contents: read
|
||||
uses: ./.github/workflows/build-dragonfly-amd64.yml
|
||||
secrets: inherit
|
||||
|
||||
haiku-amd64:
|
||||
if: false # Disabled because the Haiku build is currently broken
|
||||
needs: no-features-test
|
||||
name: Haiku-amd64
|
||||
permissions:
|
||||
security-events: write
|
||||
contents: read
|
||||
uses: ./.github/workflows/build-haiku-amd64.yml
|
||||
secrets: inherit
|
||||
|
||||
windows-hosts:
|
||||
needs: no-features-test
|
||||
name: Windows-${{ matrix.arch }}
|
||||
permissions:
|
||||
security-events: write
|
||||
contents: read
|
||||
# The SignPath action reads job details and downloads the unsigned
|
||||
# artifact with the workflow token.
|
||||
actions: read
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
@@ -189,7 +173,8 @@ jobs:
|
||||
msystem: ${{ matrix.msystem }}
|
||||
msystem-lower: ${{ matrix.msystem-lower }}
|
||||
msys-arch: ${{ matrix.msys-arch }}
|
||||
secrets: inherit
|
||||
secrets:
|
||||
SIGNPATH_API_TOKEN: ${{ secrets.SIGNPATH_API_TOKEN }}
|
||||
|
||||
release:
|
||||
if: github.event_name == 'push' && github.ref == 'refs/heads/master' && github.repository == 'fastfetch-cli/fastfetch'
|
||||
@@ -215,4 +200,3 @@ jobs:
|
||||
uses: ./.github/workflows/build-release.yml
|
||||
with:
|
||||
ffversion: ${{ needs.linux-hosts.outputs.ffversion }}
|
||||
secrets: inherit
|
||||
|
||||
@@ -243,7 +243,7 @@
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "boolean",
|
||||
"description": "True to show the module only if it succeeded; false to show it only if it failed"
|
||||
"description": "True to show the module only if the last run succeeded; false to show it only if the last run failed"
|
||||
},
|
||||
{
|
||||
"type": "null",
|
||||
|
||||
@@ -16,6 +16,13 @@
|
||||
"separator",
|
||||
"os",
|
||||
"host",
|
||||
{
|
||||
"type": "board",
|
||||
"key": "Host",
|
||||
"condition": {
|
||||
"succeeded": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "kernel",
|
||||
"format": "{release}"
|
||||
|
||||
@@ -10,6 +10,16 @@
|
||||
#define FF_COLOR_MODE_HIDDEN "8;"
|
||||
#define FF_COLOR_MODE_STRIKETHROUGH "9;"
|
||||
|
||||
#define FF_COLOR_MODE_RESET_ "0"
|
||||
#define FF_COLOR_MODE_BOLD_ "1"
|
||||
#define FF_COLOR_MODE_DIM_ "2"
|
||||
#define FF_COLOR_MODE_ITALIC_ "3"
|
||||
#define FF_COLOR_MODE_UNDERLINE_ "4"
|
||||
#define FF_COLOR_MODE_BLINK_ "5"
|
||||
#define FF_COLOR_MODE_INVERSE_ "7"
|
||||
#define FF_COLOR_MODE_HIDDEN_ "8"
|
||||
#define FF_COLOR_MODE_STRIKETHROUGH_ "9"
|
||||
|
||||
#define FF_COLOR_FG_BLACK "30"
|
||||
#define FF_COLOR_FG_RED "31"
|
||||
#define FF_COLOR_FG_GREEN "32"
|
||||
|
||||
+90
-149
@@ -2,8 +2,10 @@
|
||||
|
||||
#include "fastfetch.h"
|
||||
|
||||
#include "common/color.h"
|
||||
#include "common/io.h"
|
||||
#include "common/strutil.h"
|
||||
#include "common/textModifier.h"
|
||||
#include "detection/terminalsize/terminalsize.h"
|
||||
#include "modules/modules.h"
|
||||
|
||||
@@ -409,86 +411,14 @@ static void rowAppendVisual(FFRow* row, const char* s) {
|
||||
row->visualCol += ffUtf8StrWidth(s, len);
|
||||
}
|
||||
|
||||
static void rowAppendVisualTruncated(FFRow* row, const char* s, uint32_t maxWidth) {
|
||||
uint32_t total = (uint32_t) strlen(s);
|
||||
uint32_t bytes = total;
|
||||
if (ffUtf8StrWidth(s, total) > maxWidth) {
|
||||
bytes = 0;
|
||||
uint32_t used = 0;
|
||||
const char* p = s;
|
||||
uint32_t remaining = total;
|
||||
while (remaining > 0 && used < maxWidth) {
|
||||
uint8_t w = 0;
|
||||
uint8_t cbytes = ffUtf8CharLenWidth(p, remaining, &w);
|
||||
if (cbytes == 0 || used + w > maxWidth) {
|
||||
break;
|
||||
}
|
||||
used += w;
|
||||
bytes += cbytes;
|
||||
p += cbytes;
|
||||
remaining -= cbytes;
|
||||
}
|
||||
}
|
||||
ffStrbufAppendNS(&row->buf, bytes, s);
|
||||
row->visualCol += ffUtf8StrWidth(s, bytes);
|
||||
}
|
||||
|
||||
static void rowPadVisual(FFRow* row, uint32_t col) {
|
||||
while (row->visualCol < col) {
|
||||
ffStrbufAppendC(&row->buf, ' ');
|
||||
++row->visualCol;
|
||||
if (row->visualCol < col) {
|
||||
ffStrbufAppendNC(&row->buf, col - row->visualCol, ' ');
|
||||
row->visualCol = col;
|
||||
}
|
||||
}
|
||||
|
||||
static uint32_t rowAnsiSeqLength(const char* s, uint32_t length) {
|
||||
uint32_t i = 1;
|
||||
while (i < length) {
|
||||
uint8_t c = (uint8_t) s[i];
|
||||
if (c >= 0x40 && c <= 0x7e) {
|
||||
return i + 1;
|
||||
}
|
||||
++i;
|
||||
}
|
||||
return length;
|
||||
}
|
||||
|
||||
static void truncateRow(FFRow* row) {
|
||||
FFstrbuf src = row->buf;
|
||||
ffStrbufInitA(&row->buf, row->cols + 32);
|
||||
uint32_t used = 0;
|
||||
uint32_t remaining = src.length;
|
||||
const char* p = src.chars;
|
||||
while (remaining > 0 && used < row->cols) {
|
||||
if (*p == '\x1b') {
|
||||
uint32_t len = rowAnsiSeqLength(p, remaining);
|
||||
ffStrbufAppendNS(&row->buf, len, p);
|
||||
p += len;
|
||||
remaining -= len;
|
||||
} else {
|
||||
uint8_t w = 0;
|
||||
uint8_t cbytes = ffUtf8CharLenWidth(p, remaining, &w);
|
||||
if (cbytes == 0) {
|
||||
cbytes = 1;
|
||||
w = 1;
|
||||
}
|
||||
if (used + w > row->cols) {
|
||||
break;
|
||||
}
|
||||
ffStrbufAppendNS(&row->buf, cbytes, p);
|
||||
used += w;
|
||||
p += cbytes;
|
||||
remaining -= cbytes;
|
||||
}
|
||||
}
|
||||
ffStrbufDestroy(&src);
|
||||
row->visualCol = used;
|
||||
}
|
||||
|
||||
static void finishRow(FFRow* row, FFstrbuf* out, bool isLastRow) {
|
||||
if (row->visualCol > row->cols) {
|
||||
truncateRow(row);
|
||||
ffStrbufAppendS(&row->buf, "\e[m");
|
||||
}
|
||||
if (row->visualCol < row->cols) {
|
||||
rowPadVisual(row, row->cols);
|
||||
}
|
||||
@@ -500,71 +430,67 @@ static void finishRow(FFRow* row, FFstrbuf* out, bool isLastRow) {
|
||||
ffStrbufDestroy(&row->buf);
|
||||
}
|
||||
|
||||
static void drawModuleItem(FFRow* row, const FFGenConfigItem* item, uint32_t cellWidth, bool highlight) {
|
||||
const uint32_t nameMax = cellWidth > 4 ? cellWidth - 4 : 0;
|
||||
|
||||
static void drawModuleItem(FFRow* row, const FFGenConfigItem* item, bool highlight) {
|
||||
if (item->baseInfo == &ffBreakModuleInfo) {
|
||||
rowAppendRaw(row, highlight ? "\e[1;95;7m" : "\e[1;95m");
|
||||
ffStrbufAppendS(&row->buf, "[─]");
|
||||
rowAppendRaw(row, highlight ? "\e[" FF_COLOR_MODE_INVERSE FF_COLOR_FG_MAGENTA "m" : "\e[" FF_COLOR_FG_MAGENTA "m");
|
||||
ffStrbufAppendS(&row->buf, "[-]");
|
||||
row->visualCol += 3;
|
||||
rowAppendRaw(row, "\e[m");
|
||||
rowAppendRaw(row, FASTFETCH_TEXT_MODIFIER_RESET);
|
||||
rowAppendVisual(row, " ");
|
||||
rowAppendRaw(row, highlight ? "\e[1;95;7m" : "\e[1;95m");
|
||||
rowAppendVisualTruncated(row, item->baseInfo->name, nameMax);
|
||||
rowAppendRaw(row, "\e[m");
|
||||
rowAppendRaw(row, "\e[" FF_COLOR_FG_MAGENTA "m");
|
||||
rowAppendVisual(row, item->baseInfo->name);
|
||||
rowAppendRaw(row, FASTFETCH_TEXT_MODIFIER_RESET);
|
||||
return;
|
||||
}
|
||||
if (item->baseInfo == &ffSeparatorModuleInfo) {
|
||||
rowAppendRaw(row, highlight ? "\e[1;96;7m" : "\e[1;96m");
|
||||
ffStrbufAppendS(&row->buf, "[═]");
|
||||
rowAppendRaw(row, highlight ? "\e[" FF_COLOR_MODE_INVERSE FF_COLOR_FG_CYAN "m" : "\e[" FF_COLOR_FG_CYAN "m");
|
||||
ffStrbufAppendS(&row->buf, "[-]");
|
||||
row->visualCol += 3;
|
||||
rowAppendRaw(row, "\e[m");
|
||||
rowAppendRaw(row, FASTFETCH_TEXT_MODIFIER_RESET);
|
||||
rowAppendVisual(row, " ");
|
||||
rowAppendRaw(row, highlight ? "\e[1;96;7m" : "\e[1;96m");
|
||||
rowAppendVisualTruncated(row, item->baseInfo->name, nameMax);
|
||||
rowAppendRaw(row, "\e[m");
|
||||
rowAppendRaw(row, "\e[" FF_COLOR_FG_CYAN "m");
|
||||
rowAppendVisual(row, item->baseInfo->name);
|
||||
rowAppendRaw(row, FASTFETCH_TEXT_MODIFIER_RESET);
|
||||
return;
|
||||
}
|
||||
|
||||
if (item->status == FF_GEN_CONFIG_ITEM_STATUS_SELECTED) {
|
||||
rowAppendRaw(row, highlight ? "\e[1;92;7m" : "\e[1;92m");
|
||||
rowAppendRaw(row, highlight ? "\e[" FF_COLOR_MODE_INVERSE FF_COLOR_FG_GREEN "m" : "\e[" FF_COLOR_FG_GREEN "m");
|
||||
ffStrbufAppendS(&row->buf, "[x]");
|
||||
row->visualCol += 3;
|
||||
rowAppendRaw(row, "\e[m");
|
||||
rowAppendRaw(row, FASTFETCH_TEXT_MODIFIER_RESET);
|
||||
rowAppendVisual(row, " ");
|
||||
rowAppendRaw(row, highlight ? "\e[1;97;7m" : "\e[1;97m");
|
||||
rowAppendVisualTruncated(row, item->baseInfo->name, nameMax);
|
||||
rowAppendRaw(row, "\e[m");
|
||||
rowAppendRaw(row, "\e[" FF_COLOR_FG_GREEN "m");
|
||||
rowAppendVisual(row, item->baseInfo->name);
|
||||
rowAppendRaw(row, FASTFETCH_TEXT_MODIFIER_RESET);
|
||||
} else {
|
||||
rowAppendRaw(row, highlight ? "\e[90;7m" : "\e[90m");
|
||||
if (highlight) {
|
||||
rowAppendRaw(row, "\e[" FF_COLOR_MODE_INVERSE_ "m");
|
||||
}
|
||||
ffStrbufAppendS(&row->buf, "[ ]");
|
||||
row->visualCol += 3;
|
||||
rowAppendRaw(row, "\e[m");
|
||||
rowAppendRaw(row, FASTFETCH_TEXT_MODIFIER_RESET);
|
||||
rowAppendVisual(row, " ");
|
||||
rowAppendVisualTruncated(row, item->baseInfo->name, nameMax);
|
||||
rowAppendRaw(row, "\e[m");
|
||||
rowAppendVisual(row, item->baseInfo->name);
|
||||
rowAppendRaw(row, FASTFETCH_TEXT_MODIFIER_RESET);
|
||||
}
|
||||
}
|
||||
|
||||
static void drawItemCell(FFRow* row, uint32_t startCol, uint32_t cellWidth, const FFGenConfigItem* item, bool highlight) {
|
||||
rowPadVisual(row, startCol);
|
||||
drawModuleItem(row, item, cellWidth, highlight);
|
||||
drawModuleItem(row, item, highlight);
|
||||
rowPadVisual(row, startCol + cellWidth);
|
||||
}
|
||||
|
||||
static void drawLogoOption(FFRow* row, const char* name, bool active) {
|
||||
if (active) {
|
||||
rowAppendRaw(row, "\e[1;92m");
|
||||
rowAppendVisual(row, "● ");
|
||||
rowAppendRaw(row, "\e[m");
|
||||
rowAppendRaw(row, "\e[1m");
|
||||
rowAppendRaw(row, "\e[" FF_COLOR_FG_GREEN "m");
|
||||
rowAppendVisual(row, "[x] ");
|
||||
rowAppendVisual(row, name);
|
||||
rowAppendRaw(row, "\e[m");
|
||||
rowAppendRaw(row, FASTFETCH_TEXT_MODIFIER_RESET);
|
||||
} else {
|
||||
rowAppendRaw(row, "\e[90m");
|
||||
rowAppendVisual(row, "○ ");
|
||||
rowAppendVisual(row, "[ ] ");
|
||||
rowAppendVisual(row, name);
|
||||
rowAppendRaw(row, "\e[m");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -586,17 +512,14 @@ static void renderFrame(FFGenConfigUI* ui, FFstrbuf* out) {
|
||||
// Row 0: title
|
||||
rowInit(&row, cols);
|
||||
rowAppendVisual(&row, " ");
|
||||
rowAppendRaw(&row, "\e[1;36m");
|
||||
rowAppendRaw(&row, FASTFETCH_TEXT_MODIFIER_BOLT);
|
||||
rowAppendVisual(&row, "fastfetch");
|
||||
rowAppendRaw(&row, "\e[m");
|
||||
rowAppendRaw(&row, "\e[1m");
|
||||
rowAppendRaw(&row, FASTFETCH_TEXT_MODIFIER_RESET);
|
||||
rowAppendVisual(&row, " configuration");
|
||||
rowAppendRaw(&row, "\e[m");
|
||||
if (cols >= 48) {
|
||||
rowAppendVisual(&row, " ");
|
||||
rowAppendRaw(&row, "\e[90m");
|
||||
rowAppendVisual(&row, "interactive config generator");
|
||||
rowAppendRaw(&row, "\e[m");
|
||||
rowAppendRaw(&row, FASTFETCH_TEXT_MODIFIER_SOFT);
|
||||
rowAppendVisual(&row, " interactive config generator");
|
||||
rowAppendRaw(&row, FASTFETCH_TEXT_MODIFIER_RESET);
|
||||
}
|
||||
finishRow(&row, out, ++rowCount == ui->rows);
|
||||
|
||||
@@ -607,9 +530,11 @@ static void renderFrame(FFGenConfigUI* ui, FFstrbuf* out) {
|
||||
// Row 2: logo type
|
||||
rowInit(&row, cols);
|
||||
rowAppendVisual(&row, " ");
|
||||
rowAppendRaw(&row, "\e[1;97m");
|
||||
rowAppendVisual(&row, "Logo type:");
|
||||
rowAppendRaw(&row, "\e[m");
|
||||
rowAppendRaw(&row, "\e[" FF_COLOR_MODE_BOLD FF_COLOR_MODE_UNDERLINE_ "m");
|
||||
rowAppendVisual(&row, "L");
|
||||
rowAppendRaw(&row, "\e[24m"); // Reset underline
|
||||
rowAppendVisual(&row, "ogo type:");
|
||||
rowAppendRaw(&row, FASTFETCH_TEXT_MODIFIER_RESET);
|
||||
rowAppendVisual(&row, " ");
|
||||
drawLogoOption(&row, "default", ui->logoType == FF_LOGO_TYPE_AUTO);
|
||||
rowAppendVisual(&row, " ");
|
||||
@@ -617,28 +542,42 @@ static void renderFrame(FFGenConfigUI* ui, FFstrbuf* out) {
|
||||
rowAppendVisual(&row, " ");
|
||||
drawLogoOption(&row, "none", ui->logoType == FF_LOGO_TYPE_NONE);
|
||||
if (cols >= 72) {
|
||||
rowAppendVisual(&row, " ");
|
||||
rowAppendRaw(&row, "\e[90m");
|
||||
rowAppendVisual(&row, "(l)");
|
||||
rowAppendRaw(&row, "\e[m");
|
||||
rowAppendRaw(&row, FASTFETCH_TEXT_MODIFIER_SOFT);
|
||||
switch (ui->logoType) {
|
||||
case FF_LOGO_TYPE_AUTO:
|
||||
rowAppendVisual(&row, " - Built-in ASCII art");
|
||||
break;
|
||||
case FF_LOGO_TYPE_SMALL:
|
||||
rowAppendVisual(&row, " - Built-in ASCII art, small version");
|
||||
break;
|
||||
default:
|
||||
rowAppendVisual(&row, " - Disable logo printing");
|
||||
break;
|
||||
}
|
||||
rowAppendRaw(&row, FASTFETCH_TEXT_MODIFIER_RESET);
|
||||
}
|
||||
finishRow(&row, out, ++rowCount == ui->rows);
|
||||
|
||||
// Row 3: output mode
|
||||
rowInit(&row, cols);
|
||||
rowAppendVisual(&row, " ");
|
||||
rowAppendRaw(&row, "\e[1;97m");
|
||||
rowAppendVisual(&row, "Output:");
|
||||
rowAppendRaw(&row, "\e[m");
|
||||
rowAppendRaw(&row, "\e[" FF_COLOR_MODE_BOLD FF_COLOR_MODE_UNDERLINE_ "m");
|
||||
rowAppendVisual(&row, "O");
|
||||
rowAppendRaw(&row, "\e[24m"); // Reset underline
|
||||
rowAppendVisual(&row, "utput:");
|
||||
rowAppendRaw(&row, FASTFETCH_TEXT_MODIFIER_RESET);
|
||||
rowAppendVisual(&row, " ");
|
||||
drawLogoOption(&row, "minimal", !ui->fullConfig);
|
||||
rowAppendVisual(&row, " ");
|
||||
drawLogoOption(&row, "full", ui->fullConfig);
|
||||
if (cols >= 64) {
|
||||
rowAppendVisual(&row, " ");
|
||||
rowAppendRaw(&row, "\e[90m");
|
||||
rowAppendVisual(&row, "(o)");
|
||||
rowAppendRaw(&row, "\e[m");
|
||||
rowAppendRaw(&row, FASTFETCH_TEXT_MODIFIER_SOFT);
|
||||
if (ui->fullConfig) {
|
||||
rowAppendVisual(&row, " - Full JSON config with all module options");
|
||||
} else {
|
||||
rowAppendVisual(&row, " - Minimal JSON config");
|
||||
}
|
||||
rowAppendRaw(&row, FASTFETCH_TEXT_MODIFIER_RESET);
|
||||
}
|
||||
finishRow(&row, out, ++rowCount == ui->rows);
|
||||
|
||||
@@ -649,14 +588,12 @@ static void renderFrame(FFGenConfigUI* ui, FFstrbuf* out) {
|
||||
// Row 5: modules title
|
||||
rowInit(&row, cols);
|
||||
rowAppendVisual(&row, " ");
|
||||
rowAppendRaw(&row, "\e[1;97m");
|
||||
rowAppendRaw(&row, FASTFETCH_TEXT_MODIFIER_BOLT);
|
||||
rowAppendVisual(&row, "Modules:");
|
||||
rowAppendRaw(&row, "\e[m");
|
||||
rowAppendRaw(&row, "\e[92m");
|
||||
FF_STRBUF_AUTO_DESTROY counter = ffStrbufCreateA(32);
|
||||
ffStrbufAppendF(&counter, " [%u/%u selected]", selectedCount, moduleCount);
|
||||
rowAppendRaw(&row, FASTFETCH_TEXT_MODIFIER_RESET "\e[" FF_COLOR_FG_GREEN "m");
|
||||
FF_STRBUF_AUTO_DESTROY counter = ffStrbufCreateF(" [%u/%u selected]", selectedCount, moduleCount);
|
||||
rowAppendVisual(&row, counter.chars);
|
||||
rowAppendRaw(&row, "\e[m");
|
||||
rowAppendRaw(&row, FASTFETCH_TEXT_MODIFIER_RESET);
|
||||
finishRow(&row, out, ++rowCount == ui->rows);
|
||||
|
||||
// Row 6: blank
|
||||
@@ -687,29 +624,34 @@ static void renderFrame(FFGenConfigUI* ui, FFstrbuf* out) {
|
||||
const FFGenConfigItem* item = FF_LIST_GET(FFGenConfigItem, ui->items, ui->cursor);
|
||||
if (item->baseInfo && item->baseInfo->description) {
|
||||
rowAppendVisual(&row, " ");
|
||||
rowAppendRaw(&row, "\e[90m");
|
||||
rowAppendVisualTruncated(&row, item->baseInfo->description, cols > 4 ? cols - 4 : 1);
|
||||
rowAppendRaw(&row, "\e[m");
|
||||
rowAppendRaw(&row, "\e[" FF_COLOR_MODE_DIM_ "m");
|
||||
rowAppendVisual(&row, item->baseInfo->description);
|
||||
rowAppendRaw(&row, FASTFETCH_TEXT_MODIFIER_RESET);
|
||||
}
|
||||
}
|
||||
finishRow(&row, out, ++rowCount == ui->rows);
|
||||
|
||||
// Help lines
|
||||
rowInit(&row, cols);
|
||||
rowAppendRaw(&row, "\e[90m");
|
||||
rowAppendVisual(&row, " ↑/↓ k/j move ←/→ col Space toggle f/F all/invert K/J reorder b/B break/sep d/D del");
|
||||
rowAppendRaw(&row, "\e[" FF_COLOR_MODE_DIM_ "m");
|
||||
rowAppendVisual(&row, " "
|
||||
#if _WIN32 || __APPLE__ || __linux__ || (__FreeBSD__ && !__DragonFly__)
|
||||
"↑/↓ k/j move ←/→ col"
|
||||
#else
|
||||
"^/v k/j move </> col"
|
||||
#endif
|
||||
" Space toggle f/F all/invert K/J reorder b/B break/sep d/D del");
|
||||
if (ui->confirmingOverwrite) {
|
||||
rowAppendRaw(&row, "\e[m");
|
||||
rowAppendRaw(&row, "\e[1;93m");
|
||||
rowAppendRaw(&row, FASTFETCH_TEXT_MODIFIER_RESET "\e[" FF_COLOR_MODE_BOLD FF_COLOR_FG_YELLOW "m");
|
||||
rowAppendVisual(&row, " File exists. Overwrite? (y/N)");
|
||||
rowAppendRaw(&row, "\e[m");
|
||||
rowAppendRaw(&row, FASTFETCH_TEXT_MODIFIER_RESET);
|
||||
}
|
||||
finishRow(&row, out, ++rowCount == ui->rows);
|
||||
|
||||
rowInit(&row, cols);
|
||||
rowAppendRaw(&row, "\e[90m");
|
||||
rowAppendRaw(&row, "\e[" FF_COLOR_MODE_DIM_ "m");
|
||||
rowAppendVisual(&row, " l/L logo o minimal/full s/Enter save q/Esc quit g/G top/bottom");
|
||||
rowAppendRaw(&row, "\e[m");
|
||||
rowAppendRaw(&row, FASTFETCH_TEXT_MODIFIER_RESET);
|
||||
finishRow(&row, out, ++rowCount == ui->rows);
|
||||
|
||||
ffStrbufAppendS(out, "\e[J");
|
||||
@@ -977,7 +919,6 @@ static int runCui(FFGenConfigUI* ui, bool fileExists) {
|
||||
FF_STRBUF_AUTO_DESTROY frame = ffStrbufCreateA((uint32_t) ui->cols * ((uint32_t) ui->rows + 4));
|
||||
renderFrame(ui, &frame);
|
||||
ffWriteFDData(FFUnixFD2NativeFD(STDOUT_FILENO), frame.length, frame.chars);
|
||||
fflush(stdout);
|
||||
|
||||
char ch = 0;
|
||||
FFGenConfigKey key = readKey(&ch);
|
||||
@@ -1040,13 +981,13 @@ bool ffGenConfigInteractive(FFdata* data) {
|
||||
|
||||
getTerminalSize(&ui.rows, &ui.cols);
|
||||
enterRawMode();
|
||||
ffWriteFDData(FFUnixFD2NativeFD(STDOUT_FILENO), strlen("\e[?1049h\e[?25l"), "\e[?1049h\e[?25l");
|
||||
ffWriteFDData(FFUnixFD2NativeFD(STDOUT_FILENO), strlen("\e[?1049h\e[?25l\e[?7l"), "\e[?1049h\e[?25l\e[?7l");
|
||||
|
||||
const bool fileExists = ffPathExists(data->genConfigPath.chars, FF_PATHTYPE_ANY);
|
||||
int result = runCui(&ui, fileExists);
|
||||
|
||||
restoreRawMode();
|
||||
ffWriteFDData(FFUnixFD2NativeFD(STDOUT_FILENO), strlen("\e[?1049l\e[?25h\e[m"), "\e[?1049l\e[?25h\e[m");
|
||||
ffWriteFDData(FFUnixFD2NativeFD(STDOUT_FILENO), strlen("\e[?1049l\e[?25h\e[?7h" FASTFETCH_TEXT_MODIFIER_RESET), "\e[?1049l\e[?25h\e[?7h" FASTFETCH_TEXT_MODIFIER_RESET);
|
||||
|
||||
bool success = false;
|
||||
if (result == 1) {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#define FASTFETCH_TEXT_MODIFIER_BOLT "\033[1m"
|
||||
#define FASTFETCH_TEXT_MODIFIER_ERROR "\033[1;31m"
|
||||
#define FASTFETCH_TEXT_MODIFIER_RESET "\033[m"
|
||||
#define FASTFETCH_TEXT_MODIFIER_BOLT "\e[1m"
|
||||
#define FASTFETCH_TEXT_MODIFIER_SOFT "\e[2m"
|
||||
#define FASTFETCH_TEXT_MODIFIER_ERROR "\e[1;31m"
|
||||
#define FASTFETCH_TEXT_MODIFIER_RESET "\e[m"
|
||||
|
||||
Reference in New Issue
Block a user