diff --git a/.editorconfig b/.editorconfig index 91ac9d2a3..b2ae4e980 100644 --- a/.editorconfig +++ b/.editorconfig @@ -12,3 +12,6 @@ trim_trailing_whitespace = false [*.{txt,fflogo}] insert_final_newline = false + +[*.yml] +tab_width = 2 diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml deleted file mode 100644 index 63b3e5f49..000000000 --- a/.github/workflows/codeql-analysis.yml +++ /dev/null @@ -1,70 +0,0 @@ -# For most projects, this workflow file will not need changing; you simply need -# to commit it to your repository. -# -# You may wish to alter this file to override the set of languages analyzed, -# or to provide custom queries or build logic. -# -# ******** NOTE ******** -# We have attempted to detect the languages in your repository. Please check -# the `language` matrix defined below to confirm you have the correct set of -# supported CodeQL languages. -# -name: "CodeQL" - -on: - push: - branches: [ master ] - pull_request: - # The branches below must be a subset of the branches above - branches: [ master ] - schedule: - - cron: '38 20 * * 4' - -jobs: - analyze: - name: Analyze - runs-on: ubuntu-latest - permissions: - actions: read - contents: read - security-events: write - - strategy: - fail-fast: false - matrix: - language: [ 'cpp' ] - # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ] - # Learn more about CodeQL language support at https://git.io/codeql-language-support - - steps: - - name: Checkout repository - uses: actions/checkout@v2 - - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@v1 - with: - languages: ${{ matrix.language }} - # If you wish to specify custom queries, you can do so here or in a config file. - # By default, queries listed here will override any specified in a config file. - # Prefix the list here with "+" to use these queries and those in the config file. - # queries: ./path/to/local/query, your-org/your-repo/queries@main - - # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). - # If this step fails, then you should remove it and run the build manually (see below) - - name: Autobuild - uses: github/codeql-action/autobuild@v1 - - # â„šī¸ Command-line programs to run using the OS shell. - # 📚 https://git.io/JvXDl - - # âœī¸ If the Autobuild fails above, remove it and uncomment the following three lines - # and modify them (or add more) to build your code if your project - # uses a compiled language - - #- run: | - # make bootstrap - # make release - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v1 diff --git a/.github/workflows/compile-and-run-ff.yml b/.github/workflows/compile-and-run-ff.yml deleted file mode 100644 index 7134f8416..000000000 --- a/.github/workflows/compile-and-run-ff.yml +++ /dev/null @@ -1,38 +0,0 @@ -name: CMake - -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - -env: - # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) - BUILD_TYPE: Release - -jobs: - build: - # The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac. - # You can convert this to a matrix build if you need cross-platform coverage. - # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - # Install dependencies, so that CMake enables all modules - - name: install packages - run: sudo apt-get update && sudo apt-get install -y libpci-dev libvulkan-dev libwayland-dev libxrandr-dev libxcb-randr0-dev libdconf-dev libxfconf-0-dev librpm-dev libzstd-dev - - # Just build fastfetch normally. This is to check for compilation/program errors. - - name: Configure CMake - run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} - - - name: Build - run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} - - - name: Run fastfetch - working-directory: ${{github.workspace}}/build - # Execute tests defined by the CMake configuration. - # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail - run: ./fastfetch - diff --git a/.github/workflows/fastfetch-check.yml b/.github/workflows/fastfetch-check.yml new file mode 100644 index 000000000..0d00af14a --- /dev/null +++ b/.github/workflows/fastfetch-check.yml @@ -0,0 +1,61 @@ +name: "build, run and analyze fastfetch" + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +env: + BUILD_TYPE: Release + +jobs: + analyze: + name: Analyze + runs-on: ubuntu-latest + permissions: + actions: read + contents: read + security-events: write + strategy: + fail-fast: false + matrix: + language: [ 'cpp' ] + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Initialize CodeQL + uses: github/codeql-action/init@v1 + with: + languages: ${{ matrix.language }} + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v1 + + build: + name: Build + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Install packages + run: sudo apt-get update && sudo apt-get install -y libpci-dev libvulkan-dev libwayland-dev libxrandr-dev libxcb-randr0-dev libdconf-dev libxfconf-0-dev librpm-dev libzstd-dev + + - name: Configure + working-directory: ${{github.workspace}}/build + run: cmake .. -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} + + - name: Build + working-directory: ${{github.workspace}}/build + run: cmake --build . + + - name: Run fastfetch + working-directory: ${{github.workspace}}/build + run: ./fastfetch + + - name: Run fastfetch-test-strbuf + working-directory: ${{github.workspace}}/build + run: ./fastfetch-test-strbuf diff --git a/presets/verbose b/presets/verbose index 7a2c0e336..f7463a40d 100644 --- a/presets/verbose +++ b/presets/verbose @@ -23,3 +23,5 @@ --memory-format "Used: {}; Total: {}; Percentage: {}" --disk-format "Used: {}; Total: {}; Files: {}; Percentage: {}" --battery-format "Manufactor: {}; Model: {}; Technology: {}; Capacaty: {}; Status: {}" +--player-format "Name: {}" +--song-format "Song: {}; Artist: {}; Album: {}" diff --git a/src/detection/media.c b/src/detection/media.c index f58ade837..361a5a1eb 100644 --- a/src/detection/media.c +++ b/src/detection/media.c @@ -3,11 +3,11 @@ #include #include +#define FF_DBUS_MPRIS_PREFIX "org.mpris.MediaPlayer2." + #ifdef FF_HAVE_DBUS #include -#define FF_DBUS_MPRIS_PREFIX "org.mpris.MediaPlayer2." - #define FF_DBUS_ITER_CONTINUE(iterator) \ { \ if(!data->ffdbus_message_iter_has_next(&iterator)) \