Skip to content

Commit

Permalink
Merge pull request #59 from triyanox/feat/themes-support
Browse files Browse the repository at this point in the history
Support themes and more package managers and more
  • Loading branch information
chaqchase authored Dec 16, 2024
2 parents 4217cee + b20119d commit 3c145ac
Show file tree
Hide file tree
Showing 36 changed files with 3,954 additions and 162 deletions.
191 changes: 191 additions & 0 deletions .github/workflows/package-managers.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,191 @@
name: Package Manager Distribution

on:
release:
types: [published]
workflow_dispatch:

jobs:
macports:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4

- name: Setup MacPorts port
run: |
# Create MacPorts Portfile
mkdir -p macports/lla
cat > macports/lla/Portfile << EOF
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
PortSystem 1.0
PortGroup github 1.0
PortGroup cargo 1.0
github.setup triyanox lla \${version}
categories devel
platforms darwin
license MIT
maintainers github:triyanox
description A modern and extensible log analysis CLI tool
long_description \${description}
checksums \${checksums}
cargo.crates \${crates}
EOF
- name: Create Pull Request for MacPorts
uses: peter-evans/create-pull-request@v5
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "port lla: update to ${{ github.event.release.tag_name }}"
title: "port lla: update to ${{ github.event.release.tag_name }}"
body: |
Update lla port to version ${{ github.event.release.tag_name }}
branch: update-macports
base: master

- name: Create PR in MacPorts
run: |
gh repo fork macports/macports-ports --clone=false
gh pr create --repo macports/macports-ports \
--title "port lla: update to ${{ github.event.release.tag_name }}" \
--body "Update lla port to version ${{ github.event.release.tag_name }}" \
--base master \
--head triyanox:update-macports
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}

scoop:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4

- name: Create Scoop manifest
run: |
mkdir -p scoop
# Create manifest file
cat > scoop/lla.json << EOF
{
"version": "${{ github.event.release.tag_name }}",
"description": "A modern and extensible log analysis CLI tool",
"homepage": "https://github.com/triyanox/lla",
"license": "MIT",
"architecture": {
"64bit": {
"url": "https://github.com/triyanox/lla/releases/download/${{ github.event.release.tag_name }}/lla-windows-amd64.exe",
"bin": "lla-windows-amd64.exe"
}
},
"autoupdate": {
"architecture": {
"64bit": {
"url": "https://github.com/triyanox/lla/releases/download/v$version/lla-windows-amd64.exe"
}
}
}
}
EOF
- name: Create Pull Request for Scoop
uses: peter-evans/create-pull-request@v5
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "lla: update to ${{ github.event.release.tag_name }}"
title: "lla: update to ${{ github.event.release.tag_name }}"
body: |
Update lla to version ${{ github.event.release.tag_name }}
branch: update-scoop
base: master

- name: Create PR in Scoop
run: |
gh repo fork ScoopInstaller/Main --clone=false
gh pr create --repo ScoopInstaller/Main \
--title "lla: update to ${{ github.event.release.tag_name }}" \
--body "Update lla to version ${{ github.event.release.tag_name }}" \
--base master \
--head triyanox:update-scoop
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}

winget:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4

- name: Create Winget manifest
run: |
mkdir -p winget-manifests/l/lla/lla
cat > winget-manifests/l/lla/lla/manifest.yaml << EOF
PackageIdentifier: lla.lla
PackageVersion: ${{ github.event.release.tag_name }}
PackageName: lla
Publisher: triyanox
License: MIT
ShortDescription: A modern and extensible log analysis CLI tool
PackageUrl: https://github.com/triyanox/lla
Installers:
- Architecture: x64
InstallerUrl: https://github.com/triyanox/lla/releases/download/${{ github.event.release.tag_name }}/lla-windows-amd64.exe
InstallerType: portable
InstallerSha256: ${{ github.event.release.assets[0].sha256 }}
ManifestType: singleton
ManifestVersion: 1.0.0
EOF
- name: Create PR in Winget
run: |
gh repo fork microsoft/winget-pkgs --clone=false
gh pr create --repo microsoft/winget-pkgs \
--title "Add lla ${{ github.event.release.tag_name }}" \
--body "Add lla version ${{ github.event.release.tag_name }}" \
--base master \
--head triyanox:add-lla
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}

nix:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup Nix package
run: |
mkdir -p nixpkgs
cat > nixpkgs/default.nix << EOF
{ lib, rustPlatform, fetchFromGitHub }:
rustPlatform.buildRustPackage rec {
pname = "lla";
version = "${{ github.event.release.tag_name }}";
src = fetchFromGitHub {
owner = "triyanox";
repo = "lla";
rev = "v\${version}";
sha256 = "0000000000000000000000000000000000000000000000000000";
};
cargoSha256 = "0000000000000000000000000000000000000000000000000000";
meta = with lib; {
description = "A modern and extensible log analysis CLI tool";
homepage = "https://github.com/triyanox/lla";
license = licenses.mit;
maintainers = with maintainers; [ triyanox ];
};
}
EOF
- name: Create PR in Nixpkgs
run: |
gh repo fork NixOS/nixpkgs --clone=false
gh pr create --repo NixOS/nixpkgs \
--title "lla: init at ${{ github.event.release.tag_name }}" \
--body "Add lla package version ${{ github.event.release.tag_name }}" \
--base master \
--head triyanox:add-lla
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
17 changes: 16 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,17 @@ jobs:
target: aarch64-apple-darwin
artifact_name: lla-macos-arm64

# Windows builds
- os: windows-latest
target: x86_64-pc-windows-msvc
artifact_name: lla-windows-amd64.exe
- os: windows-latest
target: i686-pc-windows-msvc
artifact_name: lla-windows-i686.exe
- os: windows-latest
target: aarch64-pc-windows-msvc
artifact_name: lla-windows-arm64.exe

steps:
- uses: actions/checkout@v4

Expand Down Expand Up @@ -112,7 +123,11 @@ jobs:

- name: Prepare binary
run: |
cp target/${{ matrix.target }}/release/lla ${{ matrix.artifact_name }}
if [ "${{ runner.os }}" = "Windows" ]; then
cp target/${{ matrix.target }}/release/lla.exe ${{ matrix.artifact_name }}
else
cp target/${{ matrix.target }}/release/lla ${{ matrix.artifact_name }}
fi
- name: Upload artifact
uses: actions/upload-artifact@v3
Expand Down
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,28 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.3.5] - 2024-12-16

### Added

- A theming system to customize the look of `lla`
- New configuration option `theme`
- An extensive theming preset library
- Add the `--no-color` flag to disable color output, and works will all listing formats
- New package managers support:

- Flatpak
- Debian
- Scoop
- Winget

- Include window builds in the releases

### Fixed

- Minor fixes and improvements
- Stability improvements

## [0.3.4] - 2024-12-14

### Added
Expand Down
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ resolver = "2"
members = ["lla", "lla_plugin_interface", "plugins/*"]

[workspace.package]
version = "0.3.4"
version = "0.3.5"
edition = "2021"
authors = ["Achaq <[email protected]>"]
license = "MIT"
Expand Down
79 changes: 79 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
- [Filter System](#filter-system)
- [Plugin System](#plugin-system)
- [Configuration](#configuration)
- [Theming](#theming)
- [Development](#development)
- [Plugin Development](#plugin-development)
- [Contributing](#contributing)
Expand Down Expand Up @@ -468,6 +469,80 @@ lla config --set default_sort size
lla config --set default_format long
```

## Theming

LLA includes a powerful theming system that allows you to customize the appearance of your file listings. Themes are defined in TOML files and stored in `~/.config/lla/themes/`.

**Theme Structure:**

```toml
# Theme metadata
name = "my_theme"
author = "Your Name"
description = "A description of your theme"

# Core colors
[colors]
file = "#FFFFFF" # Regular files
directory = "#89AFFF" # Directories
symlink = "#89DBFF" # Symbolic links
executable = "#5DE4B3" # Executable files

# Special files
[special_files]
folders."node_modules" = "#666666"
dotfiles.".env" = "#FFFFC2"
exact_match."README.md" = "#FFFFC2"
patterns."*.min.*" = "#282E30"

# Extension-based colors
[extensions.groups]
rust = ["rs", "toml"]
web = ["html", "css", "js"]

[extensions.colors]
rust = "#FF5733"
web = "#61AFEF"
```

**Built-in Themes:**

- **default**: Traditional terminal colors optimized for visibility
- **dark**: Modern dark theme with enhanced visibility
- **light**: Clean theme optimized for light terminals
- **ayu_dark**, **ayu_light**, **ayu_mirage**: Inspired by the Ayu color scheme
- **catppuccin_mocha**: Soothing pastel theme with warm colors
- **dracula**: Classic Dracula scheme with vibrant colors
- **gruvbox_dark**: Retro groove theme with earthy tones
- **material_ocean**: Deep blue Material Design theme
- **nord**: Arctic, north-bluish color palette
- **one_dark**: Atom-inspired balanced dark theme
- **poimandres**: Deep space aesthetic theme
- **tokyo_night**: Vibrant dark theme inspired by Tokyo nights
- **vesper**: Minimalist dark theme with warm accents

**Using Themes:**

Copy the theme you want to use to your `~/.config/lla/themes/` directory.

and then set the theme in your config or use the command line:

```bash
# Set theme in config
lla config --set theme dark

# Disable colors
lla config --set theme none
```

also you can disable colors all together by using the `--no-colors` flag:

```bash
lla --no-colors # works with all listing commands
```

For more detailed information about theming, see the [themes documentation](themes/README.md).

## Development

### Plugin Development
Expand All @@ -482,6 +557,10 @@ Develop custom plugins using the `Plugin` trait from [lla_plugin_interface](http
4. Push to the branch (`git push origin feature/new-feature`)
5. Open a Pull Request

If you want to add a new theme, please add it to the `themes/` directory.

If you want to add a new plugin, please add it to the `plugins/` directory or you can use your own repo to host it.

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
2 changes: 1 addition & 1 deletion lla/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ walkdir.workspace = true
tempfile.workspace = true
users.workspace = true
parking_lot.workspace = true
lla_plugin_interface = { version = "0.3.4", path = "../lla_plugin_interface" }
lla_plugin_interface = { version = "0.3.5", path = "../lla_plugin_interface" }
once_cell.workspace = true
dashmap.workspace = true
unicode-width.workspace = true
Expand Down
Loading

0 comments on commit 3c145ac

Please sign in to comment.