mirror of
https://github.com/obsqrbtz/clrsync.git
synced 2026-04-09 04:29:04 +03:00
Compare commits
55 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 8d73df8fb8 | |||
| c4bab31e3b | |||
| 8e65c52adc | |||
| 164e6f9ac0 | |||
| d951f8d9c8 | |||
| 794193209b | |||
| 2a10aa0226 | |||
| 8caddbbb80 | |||
| c1474ccf0c | |||
| db4cc383d4 | |||
| 52a4b096a5 | |||
| 1e2c7faa38 | |||
| cc4d8f9dbd | |||
| ad92d366b2 | |||
| e44d441453 | |||
| bb1c14d566 | |||
| 2714ae51b7 | |||
| 881bc6e739 | |||
| 65e54f9c0b | |||
| 2c452cb395 | |||
| 2a81fa7b1b | |||
| cf8c93e31b | |||
| 8770dbcef8 | |||
| 236f948fcf | |||
| 3350c41ccc | |||
| 44a34eb216 | |||
| 7535bb51ce | |||
| 4c135edc95 | |||
| 813396920c | |||
| 0cee625e8b | |||
| dfbcdb6e1c | |||
| 23a6a9245d | |||
| 93ab7bef81 | |||
| 792aed7439 | |||
| 38318f0205 | |||
| 8a9695f3b8 | |||
| dd38d08914 | |||
| f55d224fab | |||
| 931277291b | |||
| d8baae2ae9 | |||
| 5dafb6ce8c | |||
| 6c0fffafd3 | |||
| ae5ce52d1d | |||
| f968e23541 | |||
| 6cc3de8e44 | |||
| dbaf693fee | |||
| 2220bfb5de | |||
| 264fc6ce54 | |||
| 33bca75990 | |||
| 1afb9428bd | |||
| f263e31d7d | |||
| 5d87e8df3c | |||
| f39d22b5e3 | |||
| 082d0db47b | |||
| 60d6992850 |
45
.github/workflows/Test PKGBUILD-git.yml
vendored
Normal file
45
.github/workflows/Test PKGBUILD-git.yml
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
name: Test PKGBUILD-git
|
||||
|
||||
on:
|
||||
push:
|
||||
branch: master
|
||||
pull_request:
|
||||
branches: master
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
container: archlinux:latest
|
||||
|
||||
steps:
|
||||
- name: Setup Arch
|
||||
run: |
|
||||
pacman -Sy --noconfirm --needed base-devel git sudo
|
||||
useradd -m builder
|
||||
echo "builder ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Set permissions
|
||||
run: chown -R builder:builder .
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
sudo -u builder bash -c '
|
||||
cd AUR
|
||||
makepkg -p PKGBUILD-git -si --noconfirm
|
||||
'
|
||||
|
||||
- name: Test
|
||||
run: |
|
||||
clrsync_cli --help
|
||||
pacman -Ql clrsync-git
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: clrsync-git
|
||||
path: AUR/*.pkg.tar.zst
|
||||
32
.github/workflows/Test flake.yml
vendored
Normal file
32
.github/workflows/Test flake.yml
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
name: Test flake.nix
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [master]
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Install Nix
|
||||
uses: cachix/install-nix-action@v31
|
||||
with:
|
||||
extra_nix_config: |
|
||||
experimental-features = nix-command flakes
|
||||
|
||||
- name: Build clrsync package
|
||||
run: |
|
||||
nix --extra-experimental-features "flakes nix-command" build .#packages.x86_64-linux.clrsync
|
||||
|
||||
- name: Enter devShell
|
||||
run: |
|
||||
nix --extra-experimental-features "flakes nix-command" develop .#default --command true
|
||||
|
||||
- name: Test clrsync CLI
|
||||
run: |
|
||||
nix --extra-experimental-features "flakes nix-command" run .#clrsync-cli -- --help
|
||||
139
.github/workflows/publish-release.yml
vendored
Normal file
139
.github/workflows/publish-release.yml
vendored
Normal file
@@ -0,0 +1,139 @@
|
||||
name: Build and Release Packages
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- 'v*'
|
||||
|
||||
jobs:
|
||||
build-windows:
|
||||
runs-on: windows-latest
|
||||
outputs:
|
||||
artifact-path: ${{ steps.upload.outputs.artifact-path }}
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Install NSIS
|
||||
run: choco install nsis --no-progress -y
|
||||
|
||||
- name: Setup MSVC
|
||||
uses: microsoft/setup-msbuild@v2
|
||||
|
||||
- name: Configure project
|
||||
run: cmake -B build -S . -A x64
|
||||
|
||||
- name: Build project
|
||||
run: cmake --build build --config Release
|
||||
|
||||
- name: Generate NSIS installer
|
||||
run: cd build && cpack -G NSIS
|
||||
|
||||
- name: Upload installer
|
||||
id: upload
|
||||
uses: actions/upload-artifact@v6
|
||||
with:
|
||||
name: windows-installer
|
||||
path: build/*.exe
|
||||
|
||||
build-ubuntu:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
artifact-path: ${{ steps.upload.outputs.artifact-path }}
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y cmake build-essential git \
|
||||
libglfw3-dev libfreetype6-dev libfontconfig1-dev \
|
||||
libx11-dev libxrandr-dev libxi-dev \
|
||||
mesa-common-dev libgl1-mesa-dev libglu1-mesa-dev \
|
||||
libxinerama-dev libxcursor-dev libxkbcommon-dev
|
||||
|
||||
- name: Configure CMake
|
||||
run: cmake -B build -DCMAKE_BUILD_TYPE=Release -DUSE_SYSTEM_GLFW=OFF
|
||||
|
||||
- name: Build
|
||||
run: cmake --build build --config Release
|
||||
|
||||
- name: Package DEB
|
||||
run: cd build && cpack -G DEB
|
||||
|
||||
- name: Upload DEB
|
||||
id: upload
|
||||
uses: actions/upload-artifact@v6
|
||||
with:
|
||||
name: deb-package
|
||||
path: build/*.deb
|
||||
|
||||
build-fedora:
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: fedora:latest
|
||||
outputs:
|
||||
artifact-path: ${{ steps.upload.outputs.artifact-path }}
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
dnf install -y cmake gcc gcc-c++ make rpm-build git \
|
||||
glfw-devel freetype-devel fontconfig-devel \
|
||||
libX11-devel libXrandr-devel libXi-devel \
|
||||
mesa-libGL-devel mesa-libGLU-devel \
|
||||
libXinerama-devel libXcursor-devel \
|
||||
wayland-devel wayland-protocols-devel
|
||||
|
||||
- name: Configure CMake
|
||||
run: cmake -B build -DCMAKE_BUILD_TYPE=Release -DUSE_SYSTEM_GLFW=ON
|
||||
|
||||
- name: Build
|
||||
run: cmake --build build --config Release
|
||||
|
||||
- name: Package RPM
|
||||
run: cd build && cpack -G RPM
|
||||
|
||||
- name: Upload RPM
|
||||
id: upload
|
||||
uses: actions/upload-artifact@v6
|
||||
with:
|
||||
name: rpm-package
|
||||
path: build/*.rpm
|
||||
|
||||
release:
|
||||
needs: [build-windows, build-ubuntu, build-fedora]
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
steps:
|
||||
- name: Download Windows artifact
|
||||
uses: actions/download-artifact@v6
|
||||
with:
|
||||
name: windows-installer
|
||||
path: artifacts/
|
||||
|
||||
- name: Download DEB artifact
|
||||
uses: actions/download-artifact@v6
|
||||
with:
|
||||
name: deb-package
|
||||
path: artifacts/
|
||||
|
||||
- name: Download RPM artifact
|
||||
uses: actions/download-artifact@v6
|
||||
with:
|
||||
name: rpm-package
|
||||
path: artifacts/
|
||||
|
||||
- name: Create Release and Upload Assets
|
||||
uses: ncipollo/release-action@v1
|
||||
with:
|
||||
tag: ${{ github.ref_name }}
|
||||
name: Release ${{ github.ref_name }}
|
||||
artifacts: |
|
||||
artifacts/*.exe
|
||||
artifacts/*.deb
|
||||
artifacts/*.rpm
|
||||
33
.gitignore
vendored
33
.gitignore
vendored
@@ -3,16 +3,20 @@
|
||||
.vs
|
||||
out
|
||||
|
||||
/build
|
||||
/builddir
|
||||
/build-*
|
||||
build/
|
||||
CMakeCache.txt
|
||||
CMakeFiles/
|
||||
cmake_install.cmake
|
||||
Makefile
|
||||
*.cmake
|
||||
|
||||
/subprojects/glfw-*
|
||||
/subprojects/imgui-*
|
||||
/subprojects/sdl2-*
|
||||
/subprojects/freetype-*
|
||||
/subprojects/libpng-*
|
||||
/subprojects/packagecache
|
||||
AUR/clrsync-git
|
||||
AUR/pkg
|
||||
AUR/src
|
||||
|
||||
result
|
||||
result-*
|
||||
.direnv/
|
||||
|
||||
*.log
|
||||
*tar.zst
|
||||
@@ -21,4 +25,13 @@ out
|
||||
*.swp
|
||||
*.bak
|
||||
*.tmp
|
||||
.DS_Store
|
||||
.DS_Store
|
||||
|
||||
*.swp
|
||||
*.swo
|
||||
*~
|
||||
|
||||
*.o
|
||||
*.a
|
||||
*.so
|
||||
*.dylib
|
||||
36
.vscode/launch.json
vendored
36
.vscode/launch.json
vendored
@@ -5,18 +5,17 @@
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"name": "CLI",
|
||||
"name": "Debug current target",
|
||||
"type": "cppdbg",
|
||||
"request": "launch",
|
||||
"program": "${workspaceFolder}/builddir/clrsync_cli",
|
||||
"program": "${command:cmake.launchTargetPath}",
|
||||
"args": [
|
||||
"--apply",
|
||||
"--theme",
|
||||
"dark"
|
||||
],
|
||||
"preLaunchTask": "Build (meson)",
|
||||
"stopAtEntry": false,
|
||||
"cwd": "${workspaceFolder}/builddir",
|
||||
"cwd": "${workspaceFolder}",
|
||||
"environment": [],
|
||||
"externalConsole": false,
|
||||
"MIMode": "gdb",
|
||||
@@ -33,34 +32,5 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "GUI",
|
||||
"type": "cppdbg",
|
||||
"request": "launch",
|
||||
"program": "${workspaceFolder}/builddir/clrsync_gui",
|
||||
"args": [
|
||||
"--apply",
|
||||
"--theme",
|
||||
"dark"
|
||||
],
|
||||
"preLaunchTask": "Build (meson)",
|
||||
"stopAtEntry": false,
|
||||
"cwd": "${workspaceFolder}/builddir",
|
||||
"environment": [],
|
||||
"externalConsole": false,
|
||||
"MIMode": "gdb",
|
||||
"setupCommands": [
|
||||
{
|
||||
"description": "Enable pretty-printing for gdb",
|
||||
"text": "-enable-pretty-printing",
|
||||
"ignoreFailures": true
|
||||
},
|
||||
{
|
||||
"description": "Set Disassembly Flavor to Intel",
|
||||
"text": "-gdb-set disassembly-flavor intel",
|
||||
"ignoreFailures": true
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
9
.vscode/settings.json
vendored
9
.vscode/settings.json
vendored
@@ -1,9 +0,0 @@
|
||||
{
|
||||
"C_Cpp.default.compileCommands": "/home/dan/src/clrsync/builddir/compile_commands.json",
|
||||
"C_Cpp.default.configurationProvider": "mesonbuild.mesonbuild",
|
||||
"clangd.arguments": [
|
||||
"--compile-commands-dir=${workspaceFolder}/builddir",
|
||||
"--completion-style=detailed",
|
||||
"--header-insertion=never"
|
||||
],
|
||||
}
|
||||
22
.vscode/tasks.json
vendored
22
.vscode/tasks.json
vendored
@@ -1,22 +0,0 @@
|
||||
{
|
||||
"tasks": [
|
||||
{
|
||||
"type": "cppbuild",
|
||||
"label": "Build (meson)",
|
||||
"command": "meson",
|
||||
"args": [
|
||||
"compile",
|
||||
"-C",
|
||||
"builddir"
|
||||
],
|
||||
"options": {
|
||||
"cwd": "${workspaceFolder}"
|
||||
},
|
||||
"group": {
|
||||
"kind": "build",
|
||||
"isDefault": true
|
||||
},
|
||||
}
|
||||
],
|
||||
"version": "2.0.0"
|
||||
}
|
||||
@@ -1,24 +1,33 @@
|
||||
# Maintainer: Daniel Dada <dan@binarygoose.dev>
|
||||
pkgname=clrsync
|
||||
pkgver=0.1.2
|
||||
pkgver=0.1.4
|
||||
pkgrel=1
|
||||
pkgdesc="Color scheme manager"
|
||||
arch=('x86_64')
|
||||
url="https://github.com/obsqrbtz/clrsync"
|
||||
license=('MIT')
|
||||
|
||||
depends=(
|
||||
glfw-x11
|
||||
glfw
|
||||
freetype2
|
||||
fontconfig
|
||||
libx11
|
||||
libxrandr
|
||||
libxi
|
||||
mesa
|
||||
libglvnd
|
||||
libxinerama
|
||||
libxcursor
|
||||
)
|
||||
makedepends=('cmake')
|
||||
|
||||
makedepends=(
|
||||
cmake
|
||||
glfw
|
||||
libx11
|
||||
libxrandr
|
||||
libxi
|
||||
libxinerama
|
||||
libxcursor
|
||||
wayland
|
||||
wayland-protocols
|
||||
)
|
||||
|
||||
source=("$pkgname-$pkgver.tar.gz::https://github.com/obsqrbtz/clrsync/archive/refs/tags/v$pkgver.tar.gz")
|
||||
sha256sums=('SKIP')
|
||||
|
||||
@@ -26,6 +35,7 @@ build() {
|
||||
cd "$pkgname-$pkgver"
|
||||
cmake -B build -S . \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DUSE_SYSTEM_GLFW=ON \
|
||||
-DCMAKE_INSTALL_PREFIX=/usr
|
||||
cmake --build build
|
||||
}
|
||||
@@ -33,5 +43,5 @@ build() {
|
||||
package() {
|
||||
cd "$pkgname-$pkgver"
|
||||
DESTDIR="$pkgdir" cmake --install build
|
||||
install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
|
||||
install -Dm644 LICENSE.txt "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
|
||||
}
|
||||
53
AUR/PKGBUILD-git
Normal file
53
AUR/PKGBUILD-git
Normal file
@@ -0,0 +1,53 @@
|
||||
# Maintainer: Daniel Dada <dan@binarygoose.dev>
|
||||
pkgname=clrsync-git
|
||||
pkgver=r22.d8baae2
|
||||
pkgrel=1
|
||||
pkgdesc="Color scheme manager (git version)"
|
||||
arch=('x86_64')
|
||||
url="https://github.com/obsqrbtz/clrsync"
|
||||
license=('MIT')
|
||||
depends=(
|
||||
glfw
|
||||
freetype2
|
||||
fontconfig
|
||||
mesa
|
||||
libglvnd
|
||||
libxcursor
|
||||
)
|
||||
|
||||
makedepends=(
|
||||
cmake
|
||||
git
|
||||
glfw
|
||||
libx11
|
||||
libxrandr
|
||||
libxi
|
||||
libxinerama
|
||||
libxcursor
|
||||
wayland
|
||||
wayland-protocols
|
||||
)
|
||||
provides=('clrsync')
|
||||
conflicts=('clrsync')
|
||||
source=("$pkgname::git+https://github.com/obsqrbtz/clrsync.git")
|
||||
sha256sums=('SKIP')
|
||||
|
||||
pkgver() {
|
||||
cd "$srcdir/$pkgname"
|
||||
printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
|
||||
}
|
||||
|
||||
build() {
|
||||
cd "$srcdir/$pkgname"
|
||||
cmake -B build -S . \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DUSE_SYSTEM_GLFW=ON \
|
||||
-DCMAKE_INSTALL_PREFIX=/usr
|
||||
cmake --build build
|
||||
}
|
||||
|
||||
package() {
|
||||
cd "$srcdir/$pkgname"
|
||||
DESTDIR="$pkgdir" cmake --install build
|
||||
install -Dm644 LICENSE.txt "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
|
||||
}
|
||||
@@ -6,19 +6,28 @@ pkgdesc="Color scheme manager"
|
||||
arch=('x86_64')
|
||||
url="https://github.com/obsqrbtz/clrsync"
|
||||
license=('MIT')
|
||||
|
||||
depends=(
|
||||
glfw-x11
|
||||
glfw
|
||||
freetype2
|
||||
fontconfig
|
||||
libx11
|
||||
libxrandr
|
||||
libxi
|
||||
mesa
|
||||
libglvnd
|
||||
libxinerama
|
||||
libxcursor
|
||||
)
|
||||
makedepends=('cmake')
|
||||
|
||||
makedepends=(
|
||||
cmake
|
||||
glfw
|
||||
libx11
|
||||
libxrandr
|
||||
libxi
|
||||
libxinerama
|
||||
libxcursor
|
||||
wayland
|
||||
wayland-protocols
|
||||
)
|
||||
|
||||
source=("$pkgname-$pkgver.tar.gz::https://github.com/obsqrbtz/clrsync/archive/refs/tags/v$pkgver.tar.gz")
|
||||
sha256sums=('SKIP')
|
||||
|
||||
@@ -26,6 +35,7 @@ build() {
|
||||
cd "$pkgname-$pkgver"
|
||||
cmake -B build -S . \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DUSE_SYSTEM_GLFW=ON \
|
||||
-DCMAKE_INSTALL_PREFIX=/usr
|
||||
cmake --build build
|
||||
}
|
||||
@@ -33,5 +43,5 @@ build() {
|
||||
package() {
|
||||
cd "$pkgname-$pkgver"
|
||||
DESTDIR="$pkgdir" cmake --install build
|
||||
install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
|
||||
install -Dm644 LICENSE.txt "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
|
||||
}
|
||||
153
CMakeLists.txt
153
CMakeLists.txt
@@ -1,11 +1,26 @@
|
||||
cmake_minimum_required(VERSION 3.25)
|
||||
project(clrsync VERSION 0.1.2 LANGUAGES CXX)
|
||||
project(clrsync VERSION 0.1.4 LANGUAGES CXX)
|
||||
|
||||
include(GNUInstallDirs)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 20)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
|
||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||
|
||||
option(USE_SYSTEM_GLFW "Use system-installed GLFW instead of fetching it statically" OFF)
|
||||
message(STATUS "USE_SYSTEM_GLFW: ${USE_SYSTEM_GLFW}")
|
||||
|
||||
if(WIN32)
|
||||
set(CMAKE_INSTALL_PREFIX "C:/Program Files/clrsync")
|
||||
set(CMAKE_INSTALL_BINDIR "bin")
|
||||
set(CMAKE_INSTALL_LIBDIR "lib")
|
||||
set(CMAKE_INSTALL_DATADIR "share")
|
||||
set(CMAKE_INSTALL_FULL_DATADIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATADIR}")
|
||||
endif()
|
||||
|
||||
set(CMAKE_SKIP_BUILD_RPATH FALSE)
|
||||
set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
|
||||
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
|
||||
@@ -18,132 +33,24 @@ configure_file(
|
||||
)
|
||||
|
||||
configure_file(
|
||||
${CMAKE_SOURCE_DIR}/PKGBUILD.in
|
||||
${CMAKE_SOURCE_DIR}/PKGBUILD
|
||||
${CMAKE_SOURCE_DIR}/AUR/PKGBUILD.in
|
||||
${CMAKE_SOURCE_DIR}/AUR/PKGBUILD
|
||||
@ONLY
|
||||
)
|
||||
|
||||
find_package(OpenGL REQUIRED)
|
||||
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
|
||||
include(Dependencies)
|
||||
include(ImGui)
|
||||
|
||||
if(WIN32)
|
||||
include(FetchContent)
|
||||
FetchContent_Declare(
|
||||
freetype
|
||||
URL https://download.savannah.gnu.org/releases/freetype/freetype-2.14.1.tar.gz
|
||||
)
|
||||
FetchContent_MakeAvailable(freetype)
|
||||
add_subdirectory(src/core)
|
||||
add_subdirectory(src/cli)
|
||||
add_subdirectory(src/gui)
|
||||
|
||||
FetchContent_Declare(
|
||||
glfw
|
||||
GIT_REPOSITORY https://github.com/glfw/glfw.git
|
||||
GIT_TAG 3.3.10
|
||||
)
|
||||
FetchContent_MakeAvailable(glfw)
|
||||
include(Install)
|
||||
include(Packaging)
|
||||
|
||||
else()
|
||||
find_package(Freetype REQUIRED)
|
||||
find_package(PkgConfig REQUIRED)
|
||||
find_package(Fontconfig REQUIRED)
|
||||
pkg_check_modules(GLFW REQUIRED glfw3)
|
||||
endif()
|
||||
message(STATUS "CMAKE_INSTALL_PREFIX: ${CMAKE_INSTALL_PREFIX}")
|
||||
message(STATUS "CMAKE_INSTALL_FULL_DATADIR: ${CMAKE_INSTALL_FULL_DATADIR}")
|
||||
|
||||
set(CORE_SOURCES
|
||||
src/core/palette/color.cpp
|
||||
src/core/io/toml_file.cpp
|
||||
src/core/config/config.cpp
|
||||
src/core/utils.cpp
|
||||
src/core/version.cpp
|
||||
src/core/theme/theme_template.cpp
|
||||
)
|
||||
|
||||
add_library(clrsync_core SHARED ${CORE_SOURCES})
|
||||
target_include_directories(clrsync_core PUBLIC src SYSTEM lib)
|
||||
target_compile_definitions(clrsync_core PRIVATE
|
||||
CLRSYNC_DATADIR=\"${CMAKE_INSTALL_FULL_DATADIR}/clrsync\"
|
||||
)
|
||||
|
||||
add_executable(clrsync_cli src/cli/main.cpp)
|
||||
target_include_directories(clrsync_cli PRIVATE src SYSTEM lib)
|
||||
target_link_libraries(clrsync_cli PRIVATE clrsync_core)
|
||||
|
||||
set(GUI_SOURCES
|
||||
src/gui/main.cpp
|
||||
src/gui/color_scheme_editor.cpp
|
||||
src/gui/template_editor.cpp
|
||||
src/gui/palette_controller.cpp
|
||||
src/gui/template_controller.cpp
|
||||
lib/color_text_edit/TextEditor.cpp
|
||||
src/gui/imgui_helpers.cpp
|
||||
src/gui/imgui_helpers.hpp
|
||||
src/gui/about_window.cpp
|
||||
src/gui/settings_window.cpp
|
||||
src/gui/font_loader.cpp
|
||||
)
|
||||
|
||||
add_executable(clrsync_gui ${GUI_SOURCES})
|
||||
target_include_directories(clrsync_gui PRIVATE src SYSTEM lib)
|
||||
|
||||
if(WIN32)
|
||||
target_link_libraries(clrsync_gui PRIVATE clrsync_core glfw freetype imgui OpenGL::GL)
|
||||
else()
|
||||
target_include_directories(clrsync_gui PRIVATE ${FREETYPE_INCLUDE_DIRS} ${GLFW_INCLUDE_DIRS})
|
||||
target_link_libraries(clrsync_gui PRIVATE clrsync_core imgui ${FREETYPE_LIBRARIES} ${GLFW_LIBRARIES} X11 Xrandr Xi Fontconfig::Fontconfig OpenGL::GL)
|
||||
endif()
|
||||
|
||||
set(imgui_SOURCE_DIR lib/imgui)
|
||||
add_library(imgui STATIC
|
||||
${imgui_SOURCE_DIR}/imgui.cpp
|
||||
${imgui_SOURCE_DIR}/imgui_draw.cpp
|
||||
${imgui_SOURCE_DIR}/imgui_widgets.cpp
|
||||
${imgui_SOURCE_DIR}/imgui_tables.cpp
|
||||
${imgui_SOURCE_DIR}/backends/imgui_impl_glfw.cpp
|
||||
${imgui_SOURCE_DIR}/backends/imgui_impl_opengl3.cpp
|
||||
${imgui_SOURCE_DIR}/misc/freetype/imgui_freetype.cpp
|
||||
)
|
||||
|
||||
target_include_directories(imgui PUBLIC SYSTEM
|
||||
${imgui_SOURCE_DIR}
|
||||
${imgui_SOURCE_DIR}/backends
|
||||
)
|
||||
|
||||
if(WIN32)
|
||||
target_include_directories(imgui PUBLIC ${GLFW_INCLUDE_DIRS} ${freetype_SOURCE_DIR}/include)
|
||||
else()
|
||||
target_include_directories(imgui PUBLIC ${GLFW_INCLUDE_DIRS} ${FREETYPE_INCLUDE_DIRS})
|
||||
endif()
|
||||
|
||||
target_link_libraries(imgui PUBLIC glfw OpenGL::GL freetype)
|
||||
target_compile_definitions(imgui PUBLIC IMGUI_ENABLE_FREETYPE)
|
||||
|
||||
install(TARGETS clrsync_core
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
)
|
||||
|
||||
install(TARGETS clrsync_cli
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
)
|
||||
|
||||
install(TARGETS clrsync_gui
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
)
|
||||
|
||||
install(FILES
|
||||
example_config/config.toml
|
||||
DESTINATION ${CMAKE_INSTALL_DATADIR}/clrsync
|
||||
)
|
||||
|
||||
install(DIRECTORY example_config/templates
|
||||
DESTINATION ${CMAKE_INSTALL_DATADIR}/clrsync
|
||||
FILES_MATCHING PATTERN "*"
|
||||
)
|
||||
|
||||
install(DIRECTORY example_config/palettes
|
||||
DESTINATION ${CMAKE_INSTALL_DATADIR}/clrsync
|
||||
FILES_MATCHING PATTERN "*.toml"
|
||||
)
|
||||
|
||||
if(UNIX AND NOT APPLE)
|
||||
install(FILES resources/clrsync.desktop
|
||||
DESTINATION ${CMAKE_INSTALL_DATADIR}/applications
|
||||
)
|
||||
endif()
|
||||
message(STATUS "CMAKE_INSTALL_PREFIX: ${CMAKE_INSTALL_PREFIX}")
|
||||
message(STATUS "CMAKE_INSTALL_FULL_DATADIR: ${CMAKE_INSTALL_FULL_DATADIR}")
|
||||
|
||||
384
README.md
384
README.md
@@ -1,6 +1,36 @@
|
||||
[](https://opensource.org/licenses/MIT)
|
||||
[](https://nixos.wiki/wiki/Flakes)
|
||||
|
||||
# clrsync
|
||||
|
||||
A theme management tool for synchronizing color schemes across multiple applications. clrsync allows you to define color palettes once and apply them consistently to all your terminal emulators, editors, and other configurable applications.
|
||||
**Notice:** This application is not yet released and is subject to change.
|
||||
Deb, RPM, and AUR packages, as well as a Windows installer, will be available soon.
|
||||
|
||||
A theme management tool for synchronizing color schemes across multiple applications. clrsync allows to define color palettes once and apply them consistently to all configurable applications.
|
||||
|
||||

|
||||
|
||||
## Table of Contents
|
||||
|
||||
- [Features](#features)
|
||||
- [Installation](#installation)
|
||||
- [NixOS](#nixos)
|
||||
- [Home Manager Module](#home-manager-module)
|
||||
- [Package](#package)
|
||||
- [Install to profile](#install-to-profile)
|
||||
- [Run without installing](#run-without-installing)
|
||||
- [Other systems](#other-systems)
|
||||
- [Building](#building)
|
||||
- [Prerequisites](#prerequisites)
|
||||
- [With CMake](#with-cmake)
|
||||
- [Configuration](#configuration)
|
||||
- [Palette Files](#palette-files)
|
||||
- [Template Files](#template-files)
|
||||
- [Color Format Specifiers](#color-format-specifiers)
|
||||
- [Usage](#usage)
|
||||
- [CLI](#cli)
|
||||
- [GUI](#gui)
|
||||
- [Acknowledgments](#acknowledgments)
|
||||
|
||||
## Features
|
||||
|
||||
@@ -8,46 +38,199 @@ A theme management tool for synchronizing color schemes across multiple applicat
|
||||
- **CLI & GUI**: Choose between a command-line interface or a graphical editor
|
||||
- **Live Reload**: Define post-apply hooks (configurable per template)
|
||||
- **Flexible Color Formats**: Support for HEX, RGB, HSL with multi-component access (e.g., `{color.r}`, `{color.hex}`, `{color.hsl}`)
|
||||
- **Pre-built Themes**: Includes popular themes
|
||||
|
||||
## Installation
|
||||
|
||||
### NixOS
|
||||
|
||||
<details>
|
||||
<summary>Home Manager Module</summary>
|
||||
|
||||
1. Add clrsync to your flake inputs
|
||||
|
||||
```nix
|
||||
{
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
home-manager.url = "github:nix-community/home-manager";
|
||||
|
||||
clrsync.url = "github:obsqrbtz/clrsync";
|
||||
};
|
||||
}
|
||||
```
|
||||
|
||||
2. Add clrsync to flake outputs
|
||||
|
||||
```nix
|
||||
outputs =
|
||||
{
|
||||
self,
|
||||
nixpkgs,
|
||||
home-manager,
|
||||
clrsync,
|
||||
...
|
||||
}@inputs:
|
||||
let
|
||||
system = "x86_64-linux";
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
in
|
||||
{
|
||||
# ...
|
||||
homeConfigurations.<Your user name> = home-manager.lib.homeManagerConfiguration {
|
||||
inherit pkgs;
|
||||
extraSpecialArgs = { inherit inputs; };
|
||||
modules = [
|
||||
./home.nix
|
||||
clrsync.homeModules.default
|
||||
];
|
||||
};
|
||||
};
|
||||
```
|
||||
|
||||
3. Configure in home manager
|
||||
|
||||
```nix
|
||||
programs.clrsync = {
|
||||
package = inputs.clrsync.packages.x86_64-linux.default;
|
||||
defaultTheme = "dark";
|
||||
palettesPath = "~/.config/clrsync/palettes";
|
||||
font = "JetBrainsMono Nerd Font Mono";
|
||||
fontSize = 14;
|
||||
applyTheme = true;
|
||||
|
||||
templates = {
|
||||
kitty = {
|
||||
enabled = true;
|
||||
inputPath = "~/.config/clrsync/templates/kitty.conf";
|
||||
outputPath = "~/.config/kitty/clrsync.conf";
|
||||
reloadCmd = "pkill -SIGUSR1 kitty";
|
||||
};
|
||||
|
||||
rofi = {
|
||||
enabled = true;
|
||||
inputPath = "~/.config/clrsync/templates/rofi.rasi";
|
||||
outputPath = "~/.config/rofi/clrsync.rasi";
|
||||
};
|
||||
};
|
||||
};
|
||||
```
|
||||
|
||||
4. Rebuild
|
||||
|
||||
```nix
|
||||
home-manager switch --flake .
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary>Package</summary>
|
||||
|
||||
1. Add clrsync to your flake inputs
|
||||
|
||||
```nix
|
||||
{
|
||||
inputs = {
|
||||
clrsync.url = "github:obsqrbtz/clrsync";
|
||||
};
|
||||
}
|
||||
```
|
||||
|
||||
2. Install the package
|
||||
|
||||
```nix
|
||||
# In NixOS configuration.nix:
|
||||
nixpkgs.overlays = [
|
||||
inputs.clrsync.overlays.default
|
||||
];
|
||||
|
||||
environment.systemPackages = [
|
||||
clrsync
|
||||
];
|
||||
```
|
||||
|
||||
Or for home manager:
|
||||
|
||||
```nix
|
||||
# flake.nix
|
||||
pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
overlays = [
|
||||
clrsync.overlays.default
|
||||
];
|
||||
};
|
||||
```
|
||||
|
||||
```nix
|
||||
# home.nix
|
||||
home.packages = [
|
||||
clrsync
|
||||
];
|
||||
```
|
||||
|
||||
3. Use the app manually
|
||||
|
||||
```shell
|
||||
clrsync_gui
|
||||
|
||||
# or
|
||||
clrsync_cli --apply --theme dark
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary>Install to profile</summary>
|
||||
|
||||
```shell
|
||||
nix profile add github:obsqrbtz/clrsync
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary>Run without installing</summary>
|
||||
|
||||
```shell
|
||||
nix run github:obsqrbtz/clrsync
|
||||
nix run github:obsqrbtz/clrsync#clrsync-cli
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
### Other systems
|
||||
|
||||
Follow the steps from Building section then install with cmake:
|
||||
```bash
|
||||
cd build
|
||||
cmake --install .
|
||||
```
|
||||
|
||||
## Building
|
||||
|
||||
### Prerequisites
|
||||
|
||||
- C++20 compatible compiler (GCC, Clang, or MSVC)
|
||||
- CMake or Meson
|
||||
- CMake
|
||||
- OpenGL
|
||||
- glfw
|
||||
- fontconfig
|
||||
- freetype
|
||||
|
||||
### Using CMake
|
||||
|
||||
### With CMake
|
||||
```bash
|
||||
mkdir build && cd build
|
||||
cmake ..
|
||||
cmake --build .
|
||||
```
|
||||
|
||||
### Using Meson
|
||||
|
||||
```bash
|
||||
meson setup builddir
|
||||
meson compile -C builddir
|
||||
```
|
||||
|
||||
## Installation
|
||||
|
||||
After building, you'll have:
|
||||
- `clrsync_cli` - CLI
|
||||
- `clrsync_gui` - GUI
|
||||
- `libclrsync_core` - Shared lib
|
||||
|
||||
## Configuration
|
||||
|
||||
Create a configuration file at `~/.config/clrsync/config.toml`:
|
||||
|
||||
Edit or create a configuration file at `~/.config/clrsync/config.toml`:
|
||||
```toml
|
||||
[general]
|
||||
palettes_path = "~/.config/clrsync/palettes"
|
||||
default_theme = "dark"
|
||||
default_theme = "cursed"
|
||||
|
||||
[templates.kitty]
|
||||
input_path = "~/.config/clrsync/templates/kitty.conf"
|
||||
@@ -58,79 +241,109 @@ reload_cmd = "pkill -SIGUSR1 kitty"
|
||||
|
||||
### Palette Files
|
||||
|
||||
Create palette files in your `palettes_path` directory:
|
||||
<details>
|
||||
<summary>Example palette file</summary>
|
||||
|
||||
Create palette files in your `palettes_path` directory:
|
||||
```toml
|
||||
# ~/.config/clrsync/palettes/dark.toml
|
||||
[general]
|
||||
name = "dark"
|
||||
name = 'cursed'
|
||||
|
||||
[colors]
|
||||
background = "#111318FF"
|
||||
surface = "#1E1F25FF"
|
||||
surface_variant = "#282A2FFF"
|
||||
|
||||
foreground = "#E2E2E9FF"
|
||||
foreground_secondary = "#A8ABB3FF"
|
||||
|
||||
accent = "#00AA56FF"
|
||||
outline = "#44474FFF"
|
||||
shadow = "#00000080"
|
||||
cursor = "#FFFFFFFF"
|
||||
|
||||
error = "#FF5F5FFF"
|
||||
warning = "#FFC966FF"
|
||||
success = "#6AD68BFF"
|
||||
info = "#5DB2FFFF"
|
||||
|
||||
term_black = "#111318FF"
|
||||
term_red = "#FF5F5FFF"
|
||||
term_green = "#00AA56FF"
|
||||
term_yellow = "#FFC966FF"
|
||||
term_blue = "#5DB2FFFF"
|
||||
term_magenta = "#DEBCDFFF"
|
||||
term_cyan = "#86C9FFFF"
|
||||
term_white = "#E2E2E9FF"
|
||||
|
||||
term_black_bright = "#33353AFF"
|
||||
term_red_bright = "#FFB780FF"
|
||||
term_green_bright = "#00CC6AFF"
|
||||
term_yellow_bright = "#FFD580FF"
|
||||
term_blue_bright = "#86C9FFFF"
|
||||
term_magenta_bright = "#F0D6F0FF"
|
||||
term_cyan_bright = "#BFEFFFFF"
|
||||
term_white_bright = "#FFFFFFFF"
|
||||
accent = '#B44242FF'
|
||||
background = '#151515FF'
|
||||
base00 = '#151515FF'
|
||||
base01 = '#B44242FF'
|
||||
base02 = '#95A328FF'
|
||||
base03 = '#E1C135FF'
|
||||
base04 = '#60928FFF'
|
||||
base05 = '#7C435AFF'
|
||||
base06 = '#A48B4AFF'
|
||||
base07 = '#C2C2B0FF'
|
||||
base08 = '#3F3639FF'
|
||||
base09 = '#DC7671FF'
|
||||
base0A = '#E8E85AFF'
|
||||
base0B = '#9E9052FF'
|
||||
base0C = '#76C39BFF'
|
||||
base0D = '#86596CFF'
|
||||
base0E = '#CEB34FFF'
|
||||
base0F = '#B0AFA8FF'
|
||||
border = '#3F3639FF'
|
||||
border_focused = '#E1C135FF'
|
||||
cursor = '#E1C135FF'
|
||||
editor_background = '#151515FF'
|
||||
editor_command = '#CEB34FFF'
|
||||
editor_comment = '#3F3639FF'
|
||||
editor_disabled = '#3F3639FF'
|
||||
editor_emphasis = '#DC7671FF'
|
||||
editor_error = '#B44242FF'
|
||||
editor_inactive = '#3F3639FF'
|
||||
editor_line_number = '#86596CFF'
|
||||
editor_link = '#60928FFF'
|
||||
editor_main = '#C2C2B0FF'
|
||||
editor_selected = '#3F3639FF'
|
||||
editor_selection_inactive = '#2A2A2AFF'
|
||||
editor_string = '#76C39BFF'
|
||||
editor_success = '#95A328FF'
|
||||
editor_warning = '#E1C135FF'
|
||||
error = '#B44242FF'
|
||||
foreground = '#C2C2B0FF'
|
||||
info = '#60928FFF'
|
||||
on_background = '#C2C2B0FF'
|
||||
on_error = '#151515FF'
|
||||
on_info = '#151515FF'
|
||||
on_success = '#151515FF'
|
||||
on_surface = '#C2C2B0FF'
|
||||
on_surface_variant = '#C2C2B0FF'
|
||||
on_warning = '#151515FF'
|
||||
success = '#95A328FF'
|
||||
surface = '#1C1C1CFF'
|
||||
surface_variant = '#1C1C1CFF'
|
||||
warning = '#E1C135FF'
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
### Template Files
|
||||
|
||||
Create template files using color variables with flexible format specifiers:
|
||||
<details>
|
||||
<summary>Example template file</summary>
|
||||
|
||||
Create template files at `~/.config/clrsync/templates` using color variables:
|
||||
```conf
|
||||
# ~/.config/clrsync/templates/kitty.conf
|
||||
cursor {foreground}
|
||||
cursor {cursor}
|
||||
cursor_text_color {background}
|
||||
|
||||
foreground {foreground}
|
||||
background {background}
|
||||
selection_foreground {foreground_secondary}
|
||||
selection_foreground {on_surface}
|
||||
selection_background {surface}
|
||||
url_color {accent}
|
||||
|
||||
color0 {background}
|
||||
color1 {term_red}
|
||||
color2 {term_green}
|
||||
color3 {term_yellow}
|
||||
color4 {term_blue}
|
||||
color5 {term_magenta}
|
||||
color6 {term_cyan}
|
||||
color7 {term_white}
|
||||
color0 {base00}
|
||||
color8 {base08}
|
||||
color1 {base01}
|
||||
color9 {base09}
|
||||
color2 {base02}
|
||||
color10 {base0A}
|
||||
color3 {base03}
|
||||
color11 {base0B}
|
||||
color4 {base04}
|
||||
color12 {base0C}
|
||||
color5 {base05}
|
||||
color13 {base0D}
|
||||
color6 {base06}
|
||||
color14 {base0E}
|
||||
color7 {base07}
|
||||
color15 {base0F}
|
||||
```
|
||||
|
||||
#### Color Format Specifiers
|
||||
</details>
|
||||
|
||||
Access color components using dot notation:
|
||||
<details>
|
||||
<summary>Color Format Specifiers</summary>
|
||||
|
||||
Format colors using dot notation:
|
||||
```conf
|
||||
# HEX formats
|
||||
{color} # Default: #RRGGBB
|
||||
@@ -160,6 +373,8 @@ Access color components using dot notation:
|
||||
{color.a} # Alpha component
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
## Usage
|
||||
|
||||
### CLI
|
||||
@@ -176,7 +391,7 @@ clrsync_cli --apply
|
||||
|
||||
Apply a specific theme:
|
||||
```bash
|
||||
clrsync_cli --apply --theme rose-pine
|
||||
clrsync_cli --apply --theme cursed
|
||||
```
|
||||
|
||||
Apply a theme from a file path:
|
||||
@@ -202,32 +417,17 @@ clrsync_gui
|
||||
```
|
||||
|
||||
The GUI provides:
|
||||
|
||||
- **Color Scheme Editor**: Visual palette editor with color pickers
|
||||
- **Template Editor**: Edit template files
|
||||
- **Live Preview**: See changes in real-time
|
||||
|
||||
## Example Themes
|
||||
|
||||
The project includes several pre-configured themes in `example_config/palettes/`:
|
||||
- `dark.toml`
|
||||
- `light.toml`
|
||||
- `flexoki.toml`
|
||||
- `flexoki-light.toml`
|
||||
- `rose-pine.toml`
|
||||
- `rose-pine-moon.toml`
|
||||
- `rose-pine-dawn.toml`
|
||||
|
||||
## Acknowledgments
|
||||
|
||||
This project uses the following open-source libraries:
|
||||
|
||||
- **[matugen](https://github.com/InioX/matugen)** - A material you color generation tool
|
||||
- **[Dear ImGui](https://github.com/ocornut/imgui)** - Bloat-free graphical user interface library for C++
|
||||
- **[GLFW](https://www.glfw.org/)** - Multi-platform library for OpenGL, OpenGL ES and Vulkan development
|
||||
- **[toml++](https://github.com/marzer/tomlplusplus)** - Header-only TOML config file parser and serializer for C++17
|
||||
- **[argparse](https://github.com/p-ranav/argparse)** - Argument Parser for Modern C++
|
||||
- **[ImGuiColorTextEdit](https://github.com/BalazsJako/ImGuiColorTextEdit)** - Syntax highlighting text editor for ImGui
|
||||
|
||||
Special thanks to the creators of the included color schemes:
|
||||
- **[Flexoki](https://stephango.com/flexoki)** by Steph Ango
|
||||
- **[Rosé Pine](https://rosepinetheme.com/)** by the Rosé Pine team
|
||||
|
||||
- **cursed** by **[pyratebeard](https://pyratebeard.net)** - Color scheme
|
||||
BIN
assets/screenshot.png
Normal file
BIN
assets/screenshot.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 370 KiB |
67
cmake/Dependencies.cmake
Normal file
67
cmake/Dependencies.cmake
Normal file
@@ -0,0 +1,67 @@
|
||||
find_package(OpenGL REQUIRED)
|
||||
|
||||
if(WIN32)
|
||||
include(FetchContent)
|
||||
|
||||
FetchContent_Declare(
|
||||
freetype
|
||||
URL https://download.savannah.gnu.org/releases/freetype/freetype-2.14.1.tar.gz
|
||||
)
|
||||
FetchContent_MakeAvailable(freetype)
|
||||
else()
|
||||
find_package(Freetype REQUIRED)
|
||||
find_package(PkgConfig REQUIRED)
|
||||
find_package(Fontconfig REQUIRED)
|
||||
find_package(ZLIB REQUIRED)
|
||||
find_package(BZip2 REQUIRED)
|
||||
find_package(PNG REQUIRED)
|
||||
|
||||
find_library(BROTLIDEC_LIBRARY NAMES brotlidec)
|
||||
find_library(BROTLICOMMON_LIBRARY NAMES brotlicommon)
|
||||
|
||||
pkg_check_modules(HARFBUZZ harfbuzz)
|
||||
pkg_check_modules(WAYLAND_CLIENT wayland-client)
|
||||
pkg_check_modules(WAYLAND_EGL wayland-egl)
|
||||
endif()
|
||||
|
||||
if(USE_SYSTEM_GLFW)
|
||||
pkg_check_modules(GLFW REQUIRED glfw3)
|
||||
else()
|
||||
include(FetchContent)
|
||||
FetchContent_Declare(
|
||||
glfw
|
||||
GIT_REPOSITORY https://github.com/glfw/glfw.git
|
||||
GIT_TAG 3.4
|
||||
)
|
||||
set(GLFW_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)
|
||||
set(GLFW_BUILD_TESTS OFF CACHE BOOL "" FORCE)
|
||||
set(GLFW_BUILD_DOCS OFF CACHE BOOL "" FORCE)
|
||||
set(GLFW_BUILD_SHARED_LIBS OFF CACHE BOOL "" FORCE)
|
||||
set(GLFW_INSTALL OFF CACHE BOOL "" FORCE)
|
||||
|
||||
FetchContent_MakeAvailable(glfw)
|
||||
set(GLFW_FOUND TRUE)
|
||||
set(GLFW_INCLUDE_DIRS ${glfw_SOURCE_DIR}/include)
|
||||
set(GLFW_LIBRARIES glfw)
|
||||
endif()
|
||||
|
||||
set(FREETYPE_EXTRA_LIBS "")
|
||||
if(BROTLIDEC_LIBRARY AND BROTLICOMMON_LIBRARY)
|
||||
list(APPEND FREETYPE_EXTRA_LIBS ${BROTLIDEC_LIBRARY} ${BROTLICOMMON_LIBRARY})
|
||||
message(STATUS "Found Brotli libraries")
|
||||
endif()
|
||||
|
||||
if(HARFBUZZ_FOUND)
|
||||
list(APPEND FREETYPE_EXTRA_LIBS ${HARFBUZZ_LIBRARIES})
|
||||
message(STATUS "Found HarfBuzz")
|
||||
endif()
|
||||
|
||||
set(WAYLAND_LIBS "")
|
||||
if(WAYLAND_CLIENT_FOUND)
|
||||
list(APPEND WAYLAND_LIBS ${WAYLAND_CLIENT_LIBRARIES})
|
||||
message(STATUS "Found Wayland client")
|
||||
endif()
|
||||
if(WAYLAND_EGL_FOUND)
|
||||
list(APPEND WAYLAND_LIBS ${WAYLAND_EGL_LIBRARIES})
|
||||
message(STATUS "Found Wayland EGL")
|
||||
endif()
|
||||
32
cmake/ImGui.cmake
Normal file
32
cmake/ImGui.cmake
Normal file
@@ -0,0 +1,32 @@
|
||||
set(IMGUI_SOURCE_DIR ${CMAKE_SOURCE_DIR}/lib/imgui)
|
||||
|
||||
add_library(imgui STATIC
|
||||
${IMGUI_SOURCE_DIR}/imgui.cpp
|
||||
${IMGUI_SOURCE_DIR}/imgui_draw.cpp
|
||||
${IMGUI_SOURCE_DIR}/imgui_widgets.cpp
|
||||
${IMGUI_SOURCE_DIR}/imgui_tables.cpp
|
||||
${IMGUI_SOURCE_DIR}/backends/imgui_impl_glfw.cpp
|
||||
${IMGUI_SOURCE_DIR}/backends/imgui_impl_opengl3.cpp
|
||||
${IMGUI_SOURCE_DIR}/misc/freetype/imgui_freetype.cpp
|
||||
)
|
||||
|
||||
target_include_directories(imgui PUBLIC SYSTEM
|
||||
${IMGUI_SOURCE_DIR}
|
||||
${IMGUI_SOURCE_DIR}/backends
|
||||
)
|
||||
|
||||
target_compile_definitions(imgui PUBLIC IMGUI_ENABLE_FREETYPE)
|
||||
|
||||
if(WIN32)
|
||||
target_include_directories(imgui PUBLIC ${GLFW_INCLUDE_DIRS} ${freetype_SOURCE_DIR}/include)
|
||||
target_link_libraries(imgui PUBLIC freetype)
|
||||
else()
|
||||
target_include_directories(imgui PUBLIC ${GLFW_INCLUDE_DIRS} ${FREETYPE_INCLUDE_DIRS})
|
||||
target_link_libraries(imgui PRIVATE
|
||||
Freetype::Freetype
|
||||
${FREETYPE_EXTRA_LIBS}
|
||||
ZLIB::ZLIB
|
||||
BZip2::BZip2
|
||||
PNG::PNG
|
||||
)
|
||||
endif()
|
||||
39
cmake/Install.cmake
Normal file
39
cmake/Install.cmake
Normal file
@@ -0,0 +1,39 @@
|
||||
install(TARGETS clrsync_core
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
COMPONENT Core
|
||||
)
|
||||
|
||||
install(TARGETS clrsync_cli
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
COMPONENT CLI
|
||||
)
|
||||
|
||||
install(TARGETS clrsync_gui
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
COMPONENT GUI
|
||||
)
|
||||
|
||||
install(FILES example_config/config.toml
|
||||
DESTINATION ${CMAKE_INSTALL_DATADIR}/clrsync
|
||||
COMPONENT Core
|
||||
)
|
||||
|
||||
install(DIRECTORY example_config/templates
|
||||
DESTINATION ${CMAKE_INSTALL_DATADIR}/clrsync
|
||||
COMPONENT Core
|
||||
FILES_MATCHING PATTERN "*"
|
||||
)
|
||||
|
||||
install(DIRECTORY example_config/palettes
|
||||
DESTINATION ${CMAKE_INSTALL_DATADIR}/clrsync
|
||||
COMPONENT Core
|
||||
FILES_MATCHING PATTERN "*.toml"
|
||||
)
|
||||
|
||||
if(UNIX AND NOT APPLE)
|
||||
install(FILES resources/clrsync.desktop
|
||||
DESTINATION ${CMAKE_INSTALL_DATADIR}/applications
|
||||
COMPONENT Core
|
||||
)
|
||||
endif()
|
||||
41
cmake/Packaging.cmake
Normal file
41
cmake/Packaging.cmake
Normal file
@@ -0,0 +1,41 @@
|
||||
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENSE.txt")
|
||||
set(CPACK_PACKAGE_NAME "clrsync")
|
||||
set(CPACK_PACKAGE_VENDOR "Daniel Dada")
|
||||
set(CPACK_PACKAGE_VERSION ${PROJECT_VERSION})
|
||||
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Color scheme manager")
|
||||
set(CPACK_GENERATOR "NSIS;DEB;RPM")
|
||||
|
||||
# Components
|
||||
set(CPACK_COMPONENTS_ALL Core GUI CLI)
|
||||
set(CPACK_COMPONENT_CORE_DISPLAY_NAME "Core Library")
|
||||
set(CPACK_COMPONENT_CORE_DESCRIPTION "clrsync core library and default configs (required)")
|
||||
set(CPACK_COMPONENT_CORE_REQUIRED ON)
|
||||
set(CPACK_COMPONENT_GUI_DISPLAY_NAME "GUI Application")
|
||||
set(CPACK_COMPONENT_GUI_DESCRIPTION "clrsync GUI app")
|
||||
set(CPACK_COMPONENT_GUI_DEPENDS Core)
|
||||
set(CPACK_COMPONENT_CLI_DISPLAY_NAME "Command Line Tool")
|
||||
set(CPACK_COMPONENT_CLI_DESCRIPTION "clrsync CLI app")
|
||||
set(CPACK_COMPONENT_CLI_DEPENDS Core)
|
||||
|
||||
# NSIS
|
||||
set(CPACK_NSIS_INSTALLED_NAME "clrsync")
|
||||
set(CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES64")
|
||||
set(CPACK_NSIS_MODIFY_PATH ON)
|
||||
set(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL ON)
|
||||
set(CPACK_NSIS_MENU_LINKS "bin/clrsync_gui.exe" "clrsync")
|
||||
set(CPACK_NSIS_CREATE_DESKTOP_LINKS "bin/clrsync_gui.exe;clrsync")
|
||||
|
||||
# Debian
|
||||
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Daniel Dada <dan@binarygoose.dev>")
|
||||
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libc6 (>= 2.31), libglfw3, libfreetype6")
|
||||
set(CPACK_DEBIAN_PACKAGE_SECTION "utils")
|
||||
set(CPACK_DEBIAN_PACKAGE_PRIORITY "optional")
|
||||
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "amd64")
|
||||
|
||||
# RPM
|
||||
set(CPACK_RPM_PACKAGE_LICENSE "MIT")
|
||||
set(CPACK_RPM_PACKAGE_GROUP "Applications/System")
|
||||
set(CPACK_RPM_PACKAGE_URL "https://github.com/obsqrbtz/clrsync")
|
||||
set(CPACK_RPM_PACKAGE_REQUIRES "freetype, glfw, fontconfig")
|
||||
|
||||
include(CPack)
|
||||
@@ -1,5 +1,5 @@
|
||||
[general]
|
||||
default_theme = 'dark'
|
||||
default_theme = 'cursed'
|
||||
palettes_path = '~/.config/clrsync/palettes'
|
||||
font = 'JetBrainsMono Nerd Font Mono'
|
||||
font_size = 14
|
||||
|
||||
@@ -1,63 +0,0 @@
|
||||
[colors]
|
||||
accent = '#A6D189FF'
|
||||
background = '#303446FF'
|
||||
border_emphasized = '#8CAAEEFF'
|
||||
border_focused = '#A6D189FF'
|
||||
border_window = '#51576DFF'
|
||||
cursor = '#F2D5CFFF'
|
||||
editor_background = '#303446FF'
|
||||
error = '#E78284FF'
|
||||
floating_window_background = '#414559FF'
|
||||
foreground = '#C6D0F5FF'
|
||||
foreground_emphasis = '#C6D0F5FF'
|
||||
foreground_secondary = '#B5BFE2FF'
|
||||
info = '#8CAAEEFF'
|
||||
menu_option_background = '#414559FF'
|
||||
outline = '#51576DFF'
|
||||
popup_background = '#292C3CFF'
|
||||
shadow = '#00000080'
|
||||
sidebar_background = '#292C3CFF'
|
||||
success = '#A6D189FF'
|
||||
surface = '#292C3CFF'
|
||||
surface_variant = '#414559FF'
|
||||
syntax_error = '#E78284FF'
|
||||
syntax_function = '#8CAAEEFF'
|
||||
syntax_keyword = '#CA9EE6FF'
|
||||
syntax_operator = '#99D1DBFF'
|
||||
syntax_special_keyword = '#E5C890FF'
|
||||
term_black = '#51576DFF'
|
||||
term_black_bright = '#626880FF'
|
||||
term_blue = '#8CAAEEFF'
|
||||
term_blue_bright = '#8CAAEEFF'
|
||||
term_cyan = '#81C8BEFF'
|
||||
term_cyan_bright = '#81C8BEFF'
|
||||
term_green = '#A6D189FF'
|
||||
term_green_bright = '#A6D189FF'
|
||||
term_magenta = '#F4B8E4FF'
|
||||
term_magenta_bright = '#F4B8E4FF'
|
||||
term_red = '#E78284FF'
|
||||
term_red_bright = '#E78284FF'
|
||||
term_white = '#B5BFE2FF'
|
||||
term_white_bright = '#A5ADCEFF'
|
||||
term_yellow = '#E5C890FF'
|
||||
term_yellow_bright = '#E5C890FF'
|
||||
terminal_gray = '#626880FF'
|
||||
text_command = '#A6D189FF'
|
||||
text_comment = '#737994FF'
|
||||
text_disabled = '#737994FF'
|
||||
text_emphasis = '#C6D0F5FF'
|
||||
text_error = '#E78284FF'
|
||||
text_inactive = '#838BA7FF'
|
||||
text_line_number = '#737994FF'
|
||||
text_link = '#8CAAEEFF'
|
||||
text_main = '#C6D0F5FF'
|
||||
text_selected = '#62688038'
|
||||
text_selection_inactive = '#51576D38'
|
||||
text_string = '#A6D189FF'
|
||||
text_success = '#A6D189FF'
|
||||
text_warning = '#E5C890FF'
|
||||
warning = '#EF9F76FF'
|
||||
warning_emphasis = '#E5C890FF'
|
||||
|
||||
[general]
|
||||
name = 'catppuccin-frappe'
|
||||
@@ -1,63 +0,0 @@
|
||||
[colors]
|
||||
accent = '#40A02BFF'
|
||||
background = '#EFF1F5FF'
|
||||
border_emphasized = '#1E66F5FF'
|
||||
border_focused = '#40A02BFF'
|
||||
border_window = '#CCD0DAFF'
|
||||
cursor = '#DC8A78FF'
|
||||
editor_background = '#EFF1F5FF'
|
||||
error = '#D20F39FF'
|
||||
floating_window_background = '#E6E9EFFF'
|
||||
foreground = '#4C4F69FF'
|
||||
foreground_emphasis = '#4C4F69FF'
|
||||
foreground_secondary = '#6C6F85FF'
|
||||
info = '#1E66F5FF'
|
||||
menu_option_background = '#E6E9EFFF'
|
||||
outline = '#CCD0DAFF'
|
||||
popup_background = '#DCE0E8FF'
|
||||
shadow = '#00000040'
|
||||
sidebar_background = '#DCE0E8FF'
|
||||
success = '#40A02BFF'
|
||||
surface = '#DCE0E8FF'
|
||||
surface_variant = '#E6E9EFFF'
|
||||
syntax_error = '#D20F39FF'
|
||||
syntax_function = '#1E66F5FF'
|
||||
syntax_keyword = '#8839EFFF'
|
||||
syntax_operator = '#04A5E5FF'
|
||||
syntax_special_keyword = '#DF8E1DFF'
|
||||
term_black = '#5C5F77FF'
|
||||
term_black_bright = '#6C6F85FF'
|
||||
term_blue = '#1E66F5FF'
|
||||
term_blue_bright = '#1E66F5FF'
|
||||
term_cyan = '#179299FF'
|
||||
term_cyan_bright = '#179299FF'
|
||||
term_green = '#40A02BFF'
|
||||
term_green_bright = '#40A02BFF'
|
||||
term_magenta = '#EA76CBFF'
|
||||
term_magenta_bright = '#EA76CBFF'
|
||||
term_red = '#D20F39FF'
|
||||
term_red_bright = '#D20F39FF'
|
||||
term_white = '#4C4F69FF'
|
||||
term_white_bright = '#4C4F69FF'
|
||||
term_yellow = '#DF8E1DFF'
|
||||
term_yellow_bright = '#DF8E1DFF'
|
||||
terminal_gray = '#9CA0B0FF'
|
||||
text_command = '#40A02BFF'
|
||||
text_comment = '#ACB0BEFF'
|
||||
text_disabled = '#ACB0BEFF'
|
||||
text_emphasis = '#4C4F69FF'
|
||||
text_error = '#D20F39FF'
|
||||
text_inactive = '#8C8FA1FF'
|
||||
text_line_number = '#ACB0BEFF'
|
||||
text_link = '#1E66F5FF'
|
||||
text_main = '#4C4F69FF'
|
||||
text_selected = '#CCD0DA38'
|
||||
text_selection_inactive = '#DCE0E838'
|
||||
text_string = '#40A02BFF'
|
||||
text_success = '#40A02BFF'
|
||||
text_warning = '#DF8E1DFF'
|
||||
warning = '#FE640BFF'
|
||||
warning_emphasis = '#DF8E1DFF'
|
||||
|
||||
[general]
|
||||
name = 'catppuccin-latte'
|
||||
@@ -1,63 +0,0 @@
|
||||
[colors]
|
||||
accent = '#A6DA95FF'
|
||||
background = '#24273AFF'
|
||||
border_emphasized = '#8AADF4FF'
|
||||
border_focused = '#A6DA95FF'
|
||||
border_window = '#494D64FF'
|
||||
cursor = '#F4DBD6FF'
|
||||
editor_background = '#24273AFF'
|
||||
error = '#ED8796FF'
|
||||
floating_window_background = '#363A4FFF'
|
||||
foreground = '#CAD3F5FF'
|
||||
foreground_emphasis = '#CAD3F5FF'
|
||||
foreground_secondary = '#B8C0E0FF'
|
||||
info = '#8AADF4FF'
|
||||
menu_option_background = '#363A4FFF'
|
||||
outline = '#494D64FF'
|
||||
popup_background = '#1E2030FF'
|
||||
shadow = '#00000080'
|
||||
sidebar_background = '#1E2030FF'
|
||||
success = '#A6DA95FF'
|
||||
surface = '#1E2030FF'
|
||||
surface_variant = '#363A4FFF'
|
||||
syntax_error = '#ED8796FF'
|
||||
syntax_function = '#8AADF4FF'
|
||||
syntax_keyword = '#C6A0F6FF'
|
||||
syntax_operator = '#91D7E3FF'
|
||||
syntax_special_keyword = '#EED49FFF'
|
||||
term_black = '#494D64FF'
|
||||
term_black_bright = '#5B6078FF'
|
||||
term_blue = '#8AADF4FF'
|
||||
term_blue_bright = '#8AADF4FF'
|
||||
term_cyan = '#8BD5CAFF'
|
||||
term_cyan_bright = '#8BD5CAFF'
|
||||
term_green = '#A6DA95FF'
|
||||
term_green_bright = '#A6DA95FF'
|
||||
term_magenta = '#F5BDE6FF'
|
||||
term_magenta_bright = '#F5BDE6FF'
|
||||
term_red = '#ED8796FF'
|
||||
term_red_bright = '#ED8796FF'
|
||||
term_white = '#B8C0E0FF'
|
||||
term_white_bright = '#A5ADCBFF'
|
||||
term_yellow = '#EED49FFF'
|
||||
term_yellow_bright = '#EED49FFF'
|
||||
terminal_gray = '#5B6078FF'
|
||||
text_command = '#A6DA95FF'
|
||||
text_comment = '#6E738DFF'
|
||||
text_disabled = '#6E738DFF'
|
||||
text_emphasis = '#CAD3F5FF'
|
||||
text_error = '#ED8796FF'
|
||||
text_inactive = '#8087A2FF'
|
||||
text_line_number = '#6E738DFF'
|
||||
text_link = '#8AADF4FF'
|
||||
text_main = '#CAD3F5FF'
|
||||
text_selected = '#5B607838'
|
||||
text_selection_inactive = '#494D6438'
|
||||
text_string = '#A6DA95FF'
|
||||
text_success = '#A6DA95FF'
|
||||
text_warning = '#EED49FFF'
|
||||
warning = '#F5A97FFF'
|
||||
warning_emphasis = '#EED49FFF'
|
||||
|
||||
[general]
|
||||
name = 'catppuccin-macchiato'
|
||||
@@ -1,63 +0,0 @@
|
||||
[colors]
|
||||
accent = '#A6E3A1FF'
|
||||
background = '#1E1E2EFF'
|
||||
border_emphasized = '#89B4FAFF'
|
||||
border_focused = '#A6E3A1FF'
|
||||
border_window = '#45475AFF'
|
||||
cursor = '#F5E0DCFF'
|
||||
editor_background = '#1E1E2EFF'
|
||||
error = '#F38BA8FF'
|
||||
floating_window_background = '#313244FF'
|
||||
foreground = '#CDD6F4FF'
|
||||
foreground_emphasis = '#CDD6F4FF'
|
||||
foreground_secondary = '#BAC2DEFF'
|
||||
info = '#89B4FAFF'
|
||||
menu_option_background = '#313244FF'
|
||||
outline = '#45475AFF'
|
||||
popup_background = '#181825FF'
|
||||
shadow = '#00000080'
|
||||
sidebar_background = '#181825FF'
|
||||
success = '#A6E3A1FF'
|
||||
surface = '#181825FF'
|
||||
surface_variant = '#313244FF'
|
||||
syntax_error = '#F38BA8FF'
|
||||
syntax_function = '#89B4FAFF'
|
||||
syntax_keyword = '#CBA6F7FF'
|
||||
syntax_operator = '#89DCEBFF'
|
||||
syntax_special_keyword = '#F9E2AFFF'
|
||||
term_black = '#45475AFF'
|
||||
term_black_bright = '#585B70FF'
|
||||
term_blue = '#89B4FAFF'
|
||||
term_blue_bright = '#89B4FAFF'
|
||||
term_cyan = '#94E2D5FF'
|
||||
term_cyan_bright = '#94E2D5FF'
|
||||
term_green = '#A6E3A1FF'
|
||||
term_green_bright = '#A6E3A1FF'
|
||||
term_magenta = '#F5C2E7FF'
|
||||
term_magenta_bright = '#F5C2E7FF'
|
||||
term_red = '#F38BA8FF'
|
||||
term_red_bright = '#F38BA8FF'
|
||||
term_white = '#BAC2DEFF'
|
||||
term_white_bright = '#A6ADC8FF'
|
||||
term_yellow = '#F9E2AFFF'
|
||||
term_yellow_bright = '#F9E2AFFF'
|
||||
terminal_gray = '#585B70FF'
|
||||
text_command = '#A6E3A1FF'
|
||||
text_comment = '#6C7086FF'
|
||||
text_disabled = '#6C7086FF'
|
||||
text_emphasis = '#CDD6F4FF'
|
||||
text_error = '#F38BA8FF'
|
||||
text_inactive = '#7F849CFF'
|
||||
text_line_number = '#6C7086FF'
|
||||
text_link = '#89B4FAFF'
|
||||
text_main = '#CDD6F4FF'
|
||||
text_selected = '#585B7038'
|
||||
text_selection_inactive = '#45475A38'
|
||||
text_string = '#A6E3A1FF'
|
||||
text_success = '#A6E3A1FF'
|
||||
text_warning = '#F9E2AFFF'
|
||||
warning = '#FAB387FF'
|
||||
warning_emphasis = '#F9E2AFFF'
|
||||
|
||||
[general]
|
||||
name = 'catppuccin-mocha'
|
||||
67
example_config/palettes/cursed-light.toml
Normal file
67
example_config/palettes/cursed-light.toml
Normal file
@@ -0,0 +1,67 @@
|
||||
[colors]
|
||||
# General
|
||||
background = "#f5f5f5FF"
|
||||
on_background = "#3d3d2fFF"
|
||||
|
||||
surface = "#e8e8e8FF"
|
||||
on_surface = "#3d3d2fFF"
|
||||
|
||||
surface_variant = "#d0d0c8FF"
|
||||
on_surface_variant = "#3d3d2fFF"
|
||||
|
||||
border_focused = "#c9a305FF"
|
||||
border = "#d0d0c8FF"
|
||||
|
||||
foreground = "#3d3d2fFF"
|
||||
|
||||
cursor = "#c9a305FF"
|
||||
accent = "#b44242FF"
|
||||
|
||||
# Terminal
|
||||
base00 = "#f5f5f5FF"
|
||||
base01 = "#b44242FF"
|
||||
base02 = "#95a328FF"
|
||||
base03 = "#c9a305FF"
|
||||
base04 = "#60928fFF"
|
||||
base05 = "#7c435aFF"
|
||||
base06 = "#a48b4aFF"
|
||||
base07 = "#3d3d2fFF"
|
||||
base08 = "#c0c0b8FF"
|
||||
base09 = "#dc7671FF"
|
||||
base0A = "#d4d430FF"
|
||||
base0B = "#9e9052FF"
|
||||
base0C = "#76c39bFF"
|
||||
base0D = "#86596cFF"
|
||||
base0E = "#b89a1fFF"
|
||||
base0F = "#4f4f48FF"
|
||||
|
||||
# Semantic
|
||||
success = "#95a328FF"
|
||||
info = "#60928fFF"
|
||||
warning = "#c9a305FF"
|
||||
error = "#b44242FF"
|
||||
|
||||
on_success = "#f5f5f5FF"
|
||||
on_info = "#f5f5f5FF"
|
||||
on_warning = "#f5f5f5FF"
|
||||
on_error = "#f5f5f5FF"
|
||||
|
||||
# Code editor
|
||||
editor_background = "#f5f5f5FF"
|
||||
editor_command = "#b89a1fFF"
|
||||
editor_comment = "#a0a098FF"
|
||||
editor_disabled = "#c0c0b8FF"
|
||||
editor_emphasis = "#dc7671FF"
|
||||
editor_error = "#b44242FF"
|
||||
editor_inactive = "#a0a098FF"
|
||||
editor_line_number = "#86596cFF"
|
||||
editor_link = "#60928fFF"
|
||||
editor_main = "#3d3d2fFF"
|
||||
editor_selected = "#d0d0c8FF"
|
||||
editor_selection_inactive = "#e0e0d8FF"
|
||||
editor_string = "#5fa37bFF"
|
||||
editor_success = "#95a328FF"
|
||||
editor_warning = "#c9a305FF"
|
||||
|
||||
[general]
|
||||
name = 'cursed-light'
|
||||
54
example_config/palettes/cursed.toml
Normal file
54
example_config/palettes/cursed.toml
Normal file
@@ -0,0 +1,54 @@
|
||||
[colors]
|
||||
accent = '#B44242FF'
|
||||
background = '#151515FF'
|
||||
base00 = '#151515FF'
|
||||
base01 = '#B44242FF'
|
||||
base02 = '#95A328FF'
|
||||
base03 = '#E1C135FF'
|
||||
base04 = '#60928FFF'
|
||||
base05 = '#7C435AFF'
|
||||
base06 = '#A48B4AFF'
|
||||
base07 = '#C2C2B0FF'
|
||||
base08 = '#3F3639FF'
|
||||
base09 = '#DC7671FF'
|
||||
base0A = '#E8E85AFF'
|
||||
base0B = '#9E9052FF'
|
||||
base0C = '#76C39BFF'
|
||||
base0D = '#86596CFF'
|
||||
base0E = '#CEB34FFF'
|
||||
base0F = '#B0AFA8FF'
|
||||
border = '#3F3639FF'
|
||||
border_focused = '#E1C135FF'
|
||||
cursor = '#E1C135FF'
|
||||
editor_background = '#151515FF'
|
||||
editor_command = '#CEB34FFF'
|
||||
editor_comment = '#3F3639FF'
|
||||
editor_disabled = '#3F3639FF'
|
||||
editor_emphasis = '#DC7671FF'
|
||||
editor_error = '#B44242FF'
|
||||
editor_inactive = '#3F3639FF'
|
||||
editor_line_number = '#86596CFF'
|
||||
editor_link = '#60928FFF'
|
||||
editor_main = '#C2C2B0FF'
|
||||
editor_selected = '#3F3639FF'
|
||||
editor_selection_inactive = '#2A2A2AFF'
|
||||
editor_string = '#76C39BFF'
|
||||
editor_success = '#95A328FF'
|
||||
editor_warning = '#E1C135FF'
|
||||
error = '#B44242FF'
|
||||
foreground = '#C2C2B0FF'
|
||||
info = '#60928FFF'
|
||||
on_background = '#C2C2B0FF'
|
||||
on_error = '#151515FF'
|
||||
on_info = '#151515FF'
|
||||
on_success = '#151515FF'
|
||||
on_surface = '#C2C2B0FF'
|
||||
on_surface_variant = '#C2C2B0FF'
|
||||
on_warning = '#151515FF'
|
||||
success = '#95A328FF'
|
||||
surface = '#1C1C1CFF'
|
||||
surface_variant = '#1C1C1CFF'
|
||||
warning = '#E1C135FF'
|
||||
|
||||
[general]
|
||||
name = 'cursed'
|
||||
@@ -1,63 +0,0 @@
|
||||
[colors]
|
||||
accent = '#00AA56FF'
|
||||
background = '#111318FF'
|
||||
border_emphasized = '#5DB2FFFF'
|
||||
border_focused = '#00AA56FF'
|
||||
border_window = '#44474FFF'
|
||||
cursor = '#FFFFFFFF'
|
||||
editor_background = '#111318FF'
|
||||
error = '#FF5F5FFF'
|
||||
floating_window_background = '#282A2FFF'
|
||||
foreground = '#E2E2E9FF'
|
||||
foreground_emphasis = '#FFFFFFFF'
|
||||
foreground_secondary = '#A8ABB3FF'
|
||||
info = '#5DB2FFFF'
|
||||
menu_option_background = '#282A2FFF'
|
||||
outline = '#44474FFF'
|
||||
popup_background = '#1E1F25FF'
|
||||
shadow = '#00000080'
|
||||
sidebar_background = '#1E1F25FF'
|
||||
success = '#6AD68BFF'
|
||||
surface = '#1E1F25FF'
|
||||
surface_variant = '#282A2FFF'
|
||||
syntax_error = '#FF5F5FFF'
|
||||
syntax_function = '#86C9FFFF'
|
||||
syntax_keyword = '#DEBCDFFF'
|
||||
syntax_operator = '#A8ABB3FF'
|
||||
syntax_special_keyword = '#FFC966FF'
|
||||
term_black = '#111318FF'
|
||||
term_black_bright = '#33353AFF'
|
||||
term_blue = '#5DB2FFFF'
|
||||
term_blue_bright = '#86C9FFFF'
|
||||
term_cyan = '#86C9FFFF'
|
||||
term_cyan_bright = '#BFEFFFFF'
|
||||
term_green = '#00AA56FF'
|
||||
term_green_bright = '#00CC6AFF'
|
||||
term_magenta = '#DEBCDFFF'
|
||||
term_magenta_bright = '#F0D6F0FF'
|
||||
term_red = '#FF5F5FFF'
|
||||
term_red_bright = '#FFB780FF'
|
||||
term_white = '#E2E2E9FF'
|
||||
term_white_bright = '#FFFFFFFF'
|
||||
term_yellow = '#FFC966FF'
|
||||
term_yellow_bright = '#FFD580FF'
|
||||
terminal_gray = '#33353AFF'
|
||||
text_command = '#00AA56FF'
|
||||
text_comment = '#44474FFF'
|
||||
text_disabled = '#44474FFF'
|
||||
text_emphasis = '#FFFFFFFF'
|
||||
text_error = '#FF5F5FFF'
|
||||
text_inactive = '#A8ABB3FF'
|
||||
text_line_number = '#44474FFF'
|
||||
text_link = '#5DB2FFFF'
|
||||
text_main = '#E2E2E9FF'
|
||||
text_selected = '#FFFFFF1A'
|
||||
text_selection_inactive = '#A8ABB338'
|
||||
text_string = '#6AD68BFF'
|
||||
text_success = '#6AD68BFF'
|
||||
text_warning = '#FFC966FF'
|
||||
warning = '#FFC966FF'
|
||||
warning_emphasis = '#FFD580FF'
|
||||
|
||||
[general]
|
||||
name = 'dark'
|
||||
@@ -1,63 +0,0 @@
|
||||
[colors]
|
||||
accent = '#A7C080FF'
|
||||
background = '#272E33FF'
|
||||
border_emphasized = '#7FBBB3FF'
|
||||
border_focused = '#A7C080FF'
|
||||
border_window = '#475258FF'
|
||||
cursor = '#D3C6AAFF'
|
||||
editor_background = '#272E33FF'
|
||||
error = '#E67E80FF'
|
||||
floating_window_background = '#3D484DFF'
|
||||
foreground = '#D3C6AAFF'
|
||||
foreground_emphasis = '#D3C6AAFF'
|
||||
foreground_secondary = '#9DA9A0FF'
|
||||
info = '#7FBBB3FF'
|
||||
menu_option_background = '#3D484DFF'
|
||||
outline = '#475258FF'
|
||||
popup_background = '#2E383CFF'
|
||||
shadow = '#00000080'
|
||||
sidebar_background = '#2E383CFF'
|
||||
success = '#A7C080FF'
|
||||
surface = '#2E383CFF'
|
||||
surface_variant = '#3D484DFF'
|
||||
syntax_error = '#E67E80FF'
|
||||
syntax_function = '#7FBBB3FF'
|
||||
syntax_keyword = '#D699B6FF'
|
||||
syntax_operator = '#83C092FF'
|
||||
syntax_special_keyword = '#DBBC7FFF'
|
||||
term_black = '#475258FF'
|
||||
term_black_bright = '#4F585EFF'
|
||||
term_blue = '#7FBBB3FF'
|
||||
term_blue_bright = '#7FBBB3FF'
|
||||
term_cyan = '#83C092FF'
|
||||
term_cyan_bright = '#83C092FF'
|
||||
term_green = '#A7C080FF'
|
||||
term_green_bright = '#A7C080FF'
|
||||
term_magenta = '#D699B6FF'
|
||||
term_magenta_bright = '#D699B6FF'
|
||||
term_red = '#E67E80FF'
|
||||
term_red_bright = '#E67E80FF'
|
||||
term_white = '#D3C6AAFF'
|
||||
term_white_bright = '#D3C6AAFF'
|
||||
term_yellow = '#DBBC7FFF'
|
||||
term_yellow_bright = '#DBBC7FFF'
|
||||
terminal_gray = '#4F585EFF'
|
||||
text_command = '#A7C080FF'
|
||||
text_comment = '#859289FF'
|
||||
text_disabled = '#859289FF'
|
||||
text_emphasis = '#D3C6AAFF'
|
||||
text_error = '#E67E80FF'
|
||||
text_inactive = '#7A8478FF'
|
||||
text_line_number = '#859289FF'
|
||||
text_link = '#7FBBB3FF'
|
||||
text_main = '#D3C6AAFF'
|
||||
text_selected = '#543A4838'
|
||||
text_selection_inactive = '#51404538'
|
||||
text_string = '#A7C080FF'
|
||||
text_success = '#A7C080FF'
|
||||
text_warning = '#DBBC7FFF'
|
||||
warning = '#E69875FF'
|
||||
warning_emphasis = '#DBBC7FFF'
|
||||
|
||||
[general]
|
||||
name = 'everforest-dark-hard'
|
||||
@@ -1,63 +0,0 @@
|
||||
[colors]
|
||||
accent = '#A7C080FF'
|
||||
background = '#2D353BFF'
|
||||
border_emphasized = '#7FBBB3FF'
|
||||
border_focused = '#A7C080FF'
|
||||
border_window = '#475258FF'
|
||||
cursor = '#D3C6AAFF'
|
||||
editor_background = '#2D353BFF'
|
||||
error = '#E67E80FF'
|
||||
floating_window_background = '#3D484DFF'
|
||||
foreground = '#D3C6AAFF'
|
||||
foreground_emphasis = '#D3C6AAFF'
|
||||
foreground_secondary = '#9DA9A0FF'
|
||||
info = '#7FBBB3FF'
|
||||
menu_option_background = '#3D484DFF'
|
||||
outline = '#475258FF'
|
||||
popup_background = '#343F44FF'
|
||||
shadow = '#00000080'
|
||||
sidebar_background = '#343F44FF'
|
||||
success = '#A7C080FF'
|
||||
surface = '#343F44FF'
|
||||
surface_variant = '#3D484DFF'
|
||||
syntax_error = '#E67E80FF'
|
||||
syntax_function = '#7FBBB3FF'
|
||||
syntax_keyword = '#D699B6FF'
|
||||
syntax_operator = '#83C092FF'
|
||||
syntax_special_keyword = '#DBBC7FFF'
|
||||
term_black = '#475258FF'
|
||||
term_black_bright = '#4F585EFF'
|
||||
term_blue = '#7FBBB3FF'
|
||||
term_blue_bright = '#7FBBB3FF'
|
||||
term_cyan = '#83C092FF'
|
||||
term_cyan_bright = '#83C092FF'
|
||||
term_green = '#A7C080FF'
|
||||
term_green_bright = '#A7C080FF'
|
||||
term_magenta = '#D699B6FF'
|
||||
term_magenta_bright = '#D699B6FF'
|
||||
term_red = '#E67E80FF'
|
||||
term_red_bright = '#E67E80FF'
|
||||
term_white = '#D3C6AAFF'
|
||||
term_white_bright = '#D3C6AAFF'
|
||||
term_yellow = '#DBBC7FFF'
|
||||
term_yellow_bright = '#DBBC7FFF'
|
||||
terminal_gray = '#4F585EFF'
|
||||
text_command = '#A7C080FF'
|
||||
text_comment = '#859289FF'
|
||||
text_disabled = '#859289FF'
|
||||
text_emphasis = '#D3C6AAFF'
|
||||
text_error = '#E67E80FF'
|
||||
text_inactive = '#7A8478FF'
|
||||
text_line_number = '#859289FF'
|
||||
text_link = '#7FBBB3FF'
|
||||
text_main = '#D3C6AAFF'
|
||||
text_selected = '#543A4838'
|
||||
text_selection_inactive = '#51404538'
|
||||
text_string = '#A7C080FF'
|
||||
text_success = '#A7C080FF'
|
||||
text_warning = '#DBBC7FFF'
|
||||
warning = '#E69875FF'
|
||||
warning_emphasis = '#DBBC7FFF'
|
||||
|
||||
[general]
|
||||
name = 'everforest-dark'
|
||||
@@ -1,63 +0,0 @@
|
||||
[colors]
|
||||
accent = '#8DA101FF'
|
||||
background = '#FFF9E8FF'
|
||||
border_emphasized = '#3A94C5FF'
|
||||
border_focused = '#8DA101FF'
|
||||
border_window = '#E6E2CCFF'
|
||||
cursor = '#5C6A72FF'
|
||||
editor_background = '#FFF9E8FF'
|
||||
error = '#F85552FF'
|
||||
floating_window_background = '#F4F0D9FF'
|
||||
foreground = '#5C6A72FF'
|
||||
foreground_emphasis = '#5C6A72FF'
|
||||
foreground_secondary = '#939F91FF'
|
||||
info = '#3A94C5FF'
|
||||
menu_option_background = '#F4F0D9FF'
|
||||
outline = '#E6E2CCFF'
|
||||
popup_background = '#FDFCEEFF'
|
||||
shadow = '#00000040'
|
||||
sidebar_background = '#FDFCEEFF'
|
||||
success = '#8DA101FF'
|
||||
surface = '#FDFCEEFF'
|
||||
surface_variant = '#F4F0D9FF'
|
||||
syntax_error = '#F85552FF'
|
||||
syntax_function = '#3A94C5FF'
|
||||
syntax_keyword = '#DF69BAFF'
|
||||
syntax_operator = '#35A77CFF'
|
||||
syntax_special_keyword = '#DFA000FF'
|
||||
term_black = '#E6E2CCFF'
|
||||
term_black_bright = '#D8CAACFF'
|
||||
term_blue = '#3A94C5FF'
|
||||
term_blue_bright = '#3A94C5FF'
|
||||
term_cyan = '#35A77CFF'
|
||||
term_cyan_bright = '#35A77CFF'
|
||||
term_green = '#8DA101FF'
|
||||
term_green_bright = '#8DA101FF'
|
||||
term_magenta = '#DF69BAFF'
|
||||
term_magenta_bright = '#DF69BAFF'
|
||||
term_red = '#F85552FF'
|
||||
term_red_bright = '#F85552FF'
|
||||
term_white = '#5C6A72FF'
|
||||
term_white_bright = '#5C6A72FF'
|
||||
term_yellow = '#DFA000FF'
|
||||
term_yellow_bright = '#DFA000FF'
|
||||
terminal_gray = '#D8CAACFF'
|
||||
text_command = '#8DA101FF'
|
||||
text_comment = '#A6B0A0FF'
|
||||
text_disabled = '#A6B0A0FF'
|
||||
text_emphasis = '#5C6A72FF'
|
||||
text_error = '#F85552FF'
|
||||
text_inactive = '#939F91FF'
|
||||
text_line_number = '#A6B0A0FF'
|
||||
text_link = '#3A94C5FF'
|
||||
text_main = '#5C6A72FF'
|
||||
text_selected = '#EAE4D938'
|
||||
text_selection_inactive = '#F0EBDB38'
|
||||
text_string = '#8DA101FF'
|
||||
text_success = '#8DA101FF'
|
||||
text_warning = '#DFA000FF'
|
||||
warning = '#F57D26FF'
|
||||
warning_emphasis = '#DFA000FF'
|
||||
|
||||
[general]
|
||||
name = 'everforest-light'
|
||||
@@ -1,63 +0,0 @@
|
||||
[colors]
|
||||
accent = '#66800BFF'
|
||||
background = '#FFFCF0FF'
|
||||
border_emphasized = '#205EA6FF'
|
||||
border_focused = '#66800BFF'
|
||||
border_window = '#DAD8CEFF'
|
||||
cursor = '#100F0FFF'
|
||||
editor_background = '#FFFCF0FF'
|
||||
error = '#AF3029FF'
|
||||
floating_window_background = '#F2F0E5FF'
|
||||
foreground = '#100F0FFF'
|
||||
foreground_emphasis = '#100F0FFF'
|
||||
foreground_secondary = '#403E3CFF'
|
||||
info = '#205EA6FF'
|
||||
menu_option_background = '#F2F0E5FF'
|
||||
outline = '#DAD8CEFF'
|
||||
popup_background = '#F2F0E5FF'
|
||||
shadow = '#00000040'
|
||||
sidebar_background = '#F2F0E5FF'
|
||||
success = '#66800BFF'
|
||||
surface = '#F2F0E5FF'
|
||||
surface_variant = '#E6E4D9FF'
|
||||
syntax_error = '#AF3029FF'
|
||||
syntax_function = '#205EA6FF'
|
||||
syntax_keyword = '#5E409DFF'
|
||||
syntax_operator = '#24837BFF'
|
||||
syntax_special_keyword = '#AD8301FF'
|
||||
term_black = '#FFFCF0FF'
|
||||
term_black_bright = '#6F6E69FF'
|
||||
term_blue = '#205EA6FF'
|
||||
term_blue_bright = '#205EA6FF'
|
||||
term_cyan = '#24837BFF'
|
||||
term_cyan_bright = '#24837BFF'
|
||||
term_green = '#66800BFF'
|
||||
term_green_bright = '#66800BFF'
|
||||
term_magenta = '#A02F6FFF'
|
||||
term_magenta_bright = '#A02F6FFF'
|
||||
term_red = '#AF3029FF'
|
||||
term_red_bright = '#AF3029FF'
|
||||
term_white = '#100F0FFF'
|
||||
term_white_bright = '#100F0FFF'
|
||||
term_yellow = '#AD8301FF'
|
||||
term_yellow_bright = '#AD8301FF'
|
||||
terminal_gray = '#6F6E69FF'
|
||||
text_command = '#66800BFF'
|
||||
text_comment = '#878580FF'
|
||||
text_disabled = '#B7B5ACFF'
|
||||
text_emphasis = '#100F0FFF'
|
||||
text_error = '#AF3029FF'
|
||||
text_inactive = '#6F6E69FF'
|
||||
text_line_number = '#878580FF'
|
||||
text_link = '#205EA6FF'
|
||||
text_main = '#100F0FFF'
|
||||
text_selected = '#E6E4D938'
|
||||
text_selection_inactive = '#F2F0E538'
|
||||
text_string = '#66800BFF'
|
||||
text_success = '#66800BFF'
|
||||
text_warning = '#AD8301FF'
|
||||
warning = '#BC5215FF'
|
||||
warning_emphasis = '#AD8301FF'
|
||||
|
||||
[general]
|
||||
name = 'flexoki-light'
|
||||
@@ -1,63 +0,0 @@
|
||||
[colors]
|
||||
accent = '#879A39FF'
|
||||
background = '#100F0FFF'
|
||||
border_emphasized = '#4385BEFF'
|
||||
border_focused = '#879A39FF'
|
||||
border_window = '#282726FF'
|
||||
cursor = '#CECDC3FF'
|
||||
editor_background = '#100F0FFF'
|
||||
error = '#D14D41FF'
|
||||
floating_window_background = '#1C1B1AFF'
|
||||
foreground = '#CECDC3FF'
|
||||
foreground_emphasis = '#E6E4D9FF'
|
||||
foreground_secondary = '#B7B5ACFF'
|
||||
info = '#4385BEFF'
|
||||
menu_option_background = '#1C1B1AFF'
|
||||
outline = '#282726FF'
|
||||
popup_background = '#1C1B1AFF'
|
||||
shadow = '#00000080'
|
||||
sidebar_background = '#1C1B1AFF'
|
||||
success = '#879A39FF'
|
||||
surface = '#1C1B1AFF'
|
||||
surface_variant = '#282726FF'
|
||||
syntax_error = '#D14D41FF'
|
||||
syntax_function = '#4385BEFF'
|
||||
syntax_keyword = '#8B7EC8FF'
|
||||
syntax_operator = '#3AA99FFF'
|
||||
syntax_special_keyword = '#D0A215FF'
|
||||
term_black = '#100F0FFF'
|
||||
term_black_bright = '#6F6E69FF'
|
||||
term_blue = '#4385BEFF'
|
||||
term_blue_bright = '#4385BEFF'
|
||||
term_cyan = '#3AA99FFF'
|
||||
term_cyan_bright = '#3AA99FFF'
|
||||
term_green = '#879A39FF'
|
||||
term_green_bright = '#879A39FF'
|
||||
term_magenta = '#CE5D97FF'
|
||||
term_magenta_bright = '#CE5D97FF'
|
||||
term_red = '#D14D41FF'
|
||||
term_red_bright = '#D14D41FF'
|
||||
term_white = '#CECDC3FF'
|
||||
term_white_bright = '#E6E4D9FF'
|
||||
term_yellow = '#D0A215FF'
|
||||
term_yellow_bright = '#D0A215FF'
|
||||
terminal_gray = '#6F6E69FF'
|
||||
text_command = '#879A39FF'
|
||||
text_comment = '#575653FF'
|
||||
text_disabled = '#403E3CFF'
|
||||
text_emphasis = '#E6E4D9FF'
|
||||
text_error = '#D14D41FF'
|
||||
text_inactive = '#6F6E69FF'
|
||||
text_line_number = '#575653FF'
|
||||
text_link = '#4385BEFF'
|
||||
text_main = '#CECDC3FF'
|
||||
text_selected = '#28272638'
|
||||
text_selection_inactive = '#1C1B1A38'
|
||||
text_string = '#879A39FF'
|
||||
text_success = '#879A39FF'
|
||||
text_warning = '#D0A215FF'
|
||||
warning = '#DA702CFF'
|
||||
warning_emphasis = '#D0A215FF'
|
||||
|
||||
[general]
|
||||
name = 'flexoki'
|
||||
@@ -1,63 +0,0 @@
|
||||
[colors]
|
||||
accent = '#B8BB26FF'
|
||||
background = '#282828FF'
|
||||
border_emphasized = '#83A598FF'
|
||||
border_focused = '#B8BB26FF'
|
||||
border_window = '#504945FF'
|
||||
cursor = '#EBDBB2FF'
|
||||
editor_background = '#282828FF'
|
||||
error = '#FB4934FF'
|
||||
floating_window_background = '#3C3836FF'
|
||||
foreground = '#EBDBB2FF'
|
||||
foreground_emphasis = '#FBF1C7FF'
|
||||
foreground_secondary = '#D5C4A1FF'
|
||||
info = '#83A598FF'
|
||||
menu_option_background = '#3C3836FF'
|
||||
outline = '#504945FF'
|
||||
popup_background = '#32302FFF'
|
||||
shadow = '#00000080'
|
||||
sidebar_background = '#32302FFF'
|
||||
success = '#B8BB26FF'
|
||||
surface = '#32302FFF'
|
||||
surface_variant = '#3C3836FF'
|
||||
syntax_error = '#FB4934FF'
|
||||
syntax_function = '#83A598FF'
|
||||
syntax_keyword = '#D3869BFF'
|
||||
syntax_operator = '#8EC07CFF'
|
||||
syntax_special_keyword = '#FABD2FFF'
|
||||
term_black = '#282828FF'
|
||||
term_black_bright = '#928374FF'
|
||||
term_blue = '#458588FF'
|
||||
term_blue_bright = '#83A598FF'
|
||||
term_cyan = '#689D6AFF'
|
||||
term_cyan_bright = '#8EC07CFF'
|
||||
term_green = '#98971AFF'
|
||||
term_green_bright = '#B8BB26FF'
|
||||
term_magenta = '#B16286FF'
|
||||
term_magenta_bright = '#D3869BFF'
|
||||
term_red = '#CC241DFF'
|
||||
term_red_bright = '#FB4934FF'
|
||||
term_white = '#A89984FF'
|
||||
term_white_bright = '#EBDBB2FF'
|
||||
term_yellow = '#D79921FF'
|
||||
term_yellow_bright = '#FABD2FFF'
|
||||
terminal_gray = '#928374FF'
|
||||
text_command = '#B8BB26FF'
|
||||
text_comment = '#928374FF'
|
||||
text_disabled = '#665C54FF'
|
||||
text_emphasis = '#FBF1C7FF'
|
||||
text_error = '#FB4934FF'
|
||||
text_inactive = '#7C6F64FF'
|
||||
text_line_number = '#7C6F64FF'
|
||||
text_link = '#83A598FF'
|
||||
text_main = '#EBDBB2FF'
|
||||
text_selected = '#665C5438'
|
||||
text_selection_inactive = '#50494538'
|
||||
text_string = '#B8BB26FF'
|
||||
text_success = '#B8BB26FF'
|
||||
text_warning = '#FABD2FFF'
|
||||
warning = '#FE8019FF'
|
||||
warning_emphasis = '#FABD2FFF'
|
||||
|
||||
[general]
|
||||
name = 'gruvbox-dark'
|
||||
@@ -1,63 +0,0 @@
|
||||
[colors]
|
||||
accent = '#B8BB26FF'
|
||||
background = '#1D2021FF'
|
||||
border_emphasized = '#83A598FF'
|
||||
border_focused = '#B8BB26FF'
|
||||
border_window = '#504945FF'
|
||||
cursor = '#EBDBB2FF'
|
||||
editor_background = '#1D2021FF'
|
||||
error = '#FB4934FF'
|
||||
floating_window_background = '#3C3836FF'
|
||||
foreground = '#EBDBB2FF'
|
||||
foreground_emphasis = '#FBF1C7FF'
|
||||
foreground_secondary = '#D5C4A1FF'
|
||||
info = '#83A598FF'
|
||||
menu_option_background = '#3C3836FF'
|
||||
outline = '#504945FF'
|
||||
popup_background = '#282828FF'
|
||||
shadow = '#00000080'
|
||||
sidebar_background = '#282828FF'
|
||||
success = '#B8BB26FF'
|
||||
surface = '#282828FF'
|
||||
surface_variant = '#3C3836FF'
|
||||
syntax_error = '#FB4934FF'
|
||||
syntax_function = '#83A598FF'
|
||||
syntax_keyword = '#D3869BFF'
|
||||
syntax_operator = '#8EC07CFF'
|
||||
syntax_special_keyword = '#FABD2FFF'
|
||||
term_black = '#1D2021FF'
|
||||
term_black_bright = '#928374FF'
|
||||
term_blue = '#458588FF'
|
||||
term_blue_bright = '#83A598FF'
|
||||
term_cyan = '#689D6AFF'
|
||||
term_cyan_bright = '#8EC07CFF'
|
||||
term_green = '#98971AFF'
|
||||
term_green_bright = '#B8BB26FF'
|
||||
term_magenta = '#B16286FF'
|
||||
term_magenta_bright = '#D3869BFF'
|
||||
term_red = '#CC241DFF'
|
||||
term_red_bright = '#FB4934FF'
|
||||
term_white = '#A89984FF'
|
||||
term_white_bright = '#EBDBB2FF'
|
||||
term_yellow = '#D79921FF'
|
||||
term_yellow_bright = '#FABD2FFF'
|
||||
terminal_gray = '#928374FF'
|
||||
text_command = '#B8BB26FF'
|
||||
text_comment = '#928374FF'
|
||||
text_disabled = '#665C54FF'
|
||||
text_emphasis = '#FBF1C7FF'
|
||||
text_error = '#FB4934FF'
|
||||
text_inactive = '#7C6F64FF'
|
||||
text_line_number = '#7C6F64FF'
|
||||
text_link = '#83A598FF'
|
||||
text_main = '#EBDBB2FF'
|
||||
text_selected = '#665C5438'
|
||||
text_selection_inactive = '#50494538'
|
||||
text_string = '#B8BB26FF'
|
||||
text_success = '#B8BB26FF'
|
||||
text_warning = '#FABD2FFF'
|
||||
warning = '#FE8019FF'
|
||||
warning_emphasis = '#FABD2FFF'
|
||||
|
||||
[general]
|
||||
name = 'gruvbox-dark-hard'
|
||||
@@ -1,63 +0,0 @@
|
||||
[colors]
|
||||
accent = '#79740EFF'
|
||||
background = '#F9F5D7FF'
|
||||
border_emphasized = '#076678FF'
|
||||
border_focused = '#79740EFF'
|
||||
border_window = '#D5C4A1FF'
|
||||
cursor = '#282828FF'
|
||||
editor_background = '#F9F5D7FF'
|
||||
error = '#9D0006FF'
|
||||
floating_window_background = '#F2E5BCFF'
|
||||
foreground = '#3C3836FF'
|
||||
foreground_emphasis = '#282828FF'
|
||||
foreground_secondary = '#504945FF'
|
||||
info = '#076678FF'
|
||||
menu_option_background = '#F2E5BCFF'
|
||||
outline = '#D5C4A1FF'
|
||||
popup_background = '#FBF1C7FF'
|
||||
shadow = '#00000040'
|
||||
sidebar_background = '#FBF1C7FF'
|
||||
success = '#79740EFF'
|
||||
surface = '#FBF1C7FF'
|
||||
surface_variant = '#F2E5BCFF'
|
||||
syntax_error = '#9D0006FF'
|
||||
syntax_function = '#076678FF'
|
||||
syntax_keyword = '#8F3F71FF'
|
||||
syntax_operator = '#427B58FF'
|
||||
syntax_special_keyword = '#B57614FF'
|
||||
term_black = '#F9F5D7FF'
|
||||
term_black_bright = '#928374FF'
|
||||
term_blue = '#076678FF'
|
||||
term_blue_bright = '#458588FF'
|
||||
term_cyan = '#427B58FF'
|
||||
term_cyan_bright = '#689D6AFF'
|
||||
term_green = '#79740EFF'
|
||||
term_green_bright = '#98971AFF'
|
||||
term_magenta = '#8F3F71FF'
|
||||
term_magenta_bright = '#B16286FF'
|
||||
term_red = '#9D0006FF'
|
||||
term_red_bright = '#CC241DFF'
|
||||
term_white = '#7C6F64FF'
|
||||
term_white_bright = '#3C3836FF'
|
||||
term_yellow = '#B57614FF'
|
||||
term_yellow_bright = '#D79921FF'
|
||||
terminal_gray = '#928374FF'
|
||||
text_command = '#79740EFF'
|
||||
text_comment = '#928374FF'
|
||||
text_disabled = '#D5C4A1FF'
|
||||
text_emphasis = '#282828FF'
|
||||
text_error = '#9D0006FF'
|
||||
text_inactive = '#A89984FF'
|
||||
text_line_number = '#A89984FF'
|
||||
text_link = '#076678FF'
|
||||
text_main = '#3C3836FF'
|
||||
text_selected = '#D5C4A138'
|
||||
text_selection_inactive = '#EBDBB238'
|
||||
text_string = '#79740EFF'
|
||||
text_success = '#79740EFF'
|
||||
text_warning = '#B57614FF'
|
||||
warning = '#AF3A03FF'
|
||||
warning_emphasis = '#B57614FF'
|
||||
|
||||
[general]
|
||||
name = 'gruvbox-light-hard'
|
||||
@@ -1,63 +0,0 @@
|
||||
[colors]
|
||||
accent = '#007A35FF'
|
||||
background = '#FFFFFFFF'
|
||||
border_emphasized = '#3399FFFF'
|
||||
border_focused = '#007A35FF'
|
||||
border_window = '#CCCCCCFF'
|
||||
cursor = '#111318FF'
|
||||
editor_background = '#FFFFFFFF'
|
||||
error = '#D00000FF'
|
||||
floating_window_background = '#E8E8E8FF'
|
||||
foreground = '#1E1F25FF'
|
||||
foreground_emphasis = '#111318FF'
|
||||
foreground_secondary = '#44474FFF'
|
||||
info = '#3399FFFF'
|
||||
menu_option_background = '#E8E8E8FF'
|
||||
outline = '#CCCCCCFF'
|
||||
popup_background = '#F5F5F5FF'
|
||||
shadow = '#000000FF'
|
||||
sidebar_background = '#F5F5F5FF'
|
||||
success = '#008833FF'
|
||||
surface = '#F5F5F5FF'
|
||||
surface_variant = '#E8E8E8FF'
|
||||
syntax_error = '#D00000FF'
|
||||
syntax_function = '#0066CCFF'
|
||||
syntax_keyword = '#9933CCFF'
|
||||
syntax_operator = '#44474FFF'
|
||||
syntax_special_keyword = '#FF9900FF'
|
||||
term_black = '#111318FF'
|
||||
term_black_bright = '#888888FF'
|
||||
term_blue = '#3399FFFF'
|
||||
term_blue_bright = '#66B2FFFF'
|
||||
term_cyan = '#0066CCFF'
|
||||
term_cyan_bright = '#99DDFFFF'
|
||||
term_green = '#007A35FF'
|
||||
term_green_bright = '#33CC66FF'
|
||||
term_magenta = '#9933CCFF'
|
||||
term_magenta_bright = '#CC99CCFF'
|
||||
term_red = '#D00000FF'
|
||||
term_red_bright = '#FF6666FF'
|
||||
term_white = '#FFFFFFFF'
|
||||
term_white_bright = '#FFFFFFFF'
|
||||
term_yellow = '#FF9900FF'
|
||||
term_yellow_bright = '#FFCC80FF'
|
||||
terminal_gray = '#CCCCCCFF'
|
||||
text_command = '#007A35FF'
|
||||
text_comment = '#888888FF'
|
||||
text_disabled = '#CCCCCCFF'
|
||||
text_emphasis = '#111318FF'
|
||||
text_error = '#D00000FF'
|
||||
text_inactive = '#44474FFF'
|
||||
text_line_number = '#888888FF'
|
||||
text_link = '#3399FFFF'
|
||||
text_main = '#1E1F25FF'
|
||||
text_selected = '#D6D6D6FF'
|
||||
text_selection_inactive = '#888888FF'
|
||||
text_string = '#008833FF'
|
||||
text_success = '#008833FF'
|
||||
text_warning = '#FF9900FF'
|
||||
warning = '#FF9900FF'
|
||||
warning_emphasis = '#FFCC80FF'
|
||||
|
||||
[general]
|
||||
name = 'light'
|
||||
@@ -1,63 +0,0 @@
|
||||
[colors]
|
||||
accent = '#286983FF'
|
||||
background = '#FAF4EDFF'
|
||||
border_emphasized = '#907AA9FF'
|
||||
border_focused = '#286983FF'
|
||||
border_window = '#CECACDFF'
|
||||
cursor = '#575279FF'
|
||||
editor_background = '#FAF4EDFF'
|
||||
error = '#B4637AFF'
|
||||
floating_window_background = '#F2E9E1FF'
|
||||
foreground = '#575279FF'
|
||||
foreground_emphasis = '#111318FF'
|
||||
foreground_secondary = '#797593FF'
|
||||
info = '#907AA9FF'
|
||||
menu_option_background = '#F2E9E1FF'
|
||||
outline = '#9893A5FF'
|
||||
popup_background = '#FFFAF3FF'
|
||||
shadow = '#00000020'
|
||||
sidebar_background = '#FFFAF3FF'
|
||||
success = '#286983FF'
|
||||
surface = '#FFFAF3FF'
|
||||
surface_variant = '#F2E9E1FF'
|
||||
syntax_error = '#B4637AFF'
|
||||
syntax_function = '#907AA9FF'
|
||||
syntax_keyword = '#D7827EFF'
|
||||
syntax_operator = '#797593FF'
|
||||
syntax_special_keyword = '#EA9D34FF'
|
||||
term_black = '#FAF4EDFF'
|
||||
term_black_bright = '#DFDAD9FF'
|
||||
term_blue = '#907AA9FF'
|
||||
term_blue_bright = '#66B2FFFF'
|
||||
term_cyan = '#56949FFF'
|
||||
term_cyan_bright = '#99DDFFFF'
|
||||
term_green = '#286983FF'
|
||||
term_green_bright = '#33CC66FF'
|
||||
term_magenta = '#D7827EFF'
|
||||
term_magenta_bright = '#CC99CCFF'
|
||||
term_red = '#B4637AFF'
|
||||
term_red_bright = '#FF6666FF'
|
||||
term_white = '#575279FF'
|
||||
term_white_bright = '#111318FF'
|
||||
term_yellow = '#EA9D34FF'
|
||||
term_yellow_bright = '#FFCC80FF'
|
||||
terminal_gray = '#CCCCCCFF'
|
||||
text_command = '#286983FF'
|
||||
text_comment = '#9893A5FF'
|
||||
text_disabled = '#9893A5FF'
|
||||
text_emphasis = '#111318FF'
|
||||
text_error = '#B4637AFF'
|
||||
text_inactive = '#797593FF'
|
||||
text_line_number = '#9893A5FF'
|
||||
text_link = '#907AA9FF'
|
||||
text_main = '#575279FF'
|
||||
text_selected = '#DFDAD979'
|
||||
text_selection_inactive = '#79759338'
|
||||
text_string = '#286983FF'
|
||||
text_success = '#286983FF'
|
||||
text_warning = '#EA9D34FF'
|
||||
warning = '#EA9D34FF'
|
||||
warning_emphasis = '#FFD580FF'
|
||||
|
||||
[general]
|
||||
name = 'rose-pine-dawn'
|
||||
@@ -1,63 +0,0 @@
|
||||
[general]
|
||||
name = "rose-pine-moon"
|
||||
|
||||
[colors]
|
||||
accent = "#3e8fb0FF"
|
||||
background = "#232136FF"
|
||||
border_emphasized = "#c4a7e7FF"
|
||||
border_focused = "#3e8fb0FF"
|
||||
border_window = "#56526eFF"
|
||||
cursor = "#e0def4FF"
|
||||
editor_background = "#232136FF"
|
||||
error = "#eb6f92FF"
|
||||
floating_window_background = "#393552FF"
|
||||
foreground = "#e0def4FF"
|
||||
foreground_emphasis = "#ffffffFF"
|
||||
foreground_secondary = "#908caaFF"
|
||||
info = "#c4a7e7FF"
|
||||
menu_option_background = "#393552FF"
|
||||
outline = "#6e6a86FF"
|
||||
popup_background = "#2a273fff"
|
||||
shadow = "#00000080"
|
||||
sidebar_background = "#2a273fff"
|
||||
success = "#3e8fb0FF"
|
||||
surface = "#2a273fff"
|
||||
surface_variant = "#393552FF"
|
||||
syntax_error = "#eb6f92FF"
|
||||
syntax_function = "#c4a7e7FF"
|
||||
syntax_keyword = "#ea9a97FF"
|
||||
syntax_operator = "#908caaFF"
|
||||
syntax_special_keyword = "#f6c177FF"
|
||||
term_black = "#232136FF"
|
||||
term_black_bright = "#44415aFF"
|
||||
term_blue = "#c4a7e7FF"
|
||||
term_blue_bright = "#66b2ffff"
|
||||
term_cyan = "#9ccfd8FF"
|
||||
term_cyan_bright = "#bfefffff"
|
||||
term_green = "#3e8fb0FF"
|
||||
term_green_bright = "#00cc6aff"
|
||||
term_magenta = "#ea9a97FF"
|
||||
term_magenta_bright = "#f0d6f0FF"
|
||||
term_red = "#eb6f92FF"
|
||||
term_red_bright = "#ffb780FF"
|
||||
term_white = "#e0def4FF"
|
||||
term_white_bright = "#ffffffFF"
|
||||
term_yellow = "#f6c177FF"
|
||||
term_yellow_bright = "#ffd580FF"
|
||||
terminal_gray = "#33353AFF"
|
||||
text_command = "#3e8fb0FF"
|
||||
text_comment = "#6e6a86FF"
|
||||
text_disabled = "#6e6a86FF"
|
||||
text_emphasis = "#ffffffFF"
|
||||
text_error = "#eb6f92FF"
|
||||
text_inactive = "#908caaFF"
|
||||
text_line_number = "#6e6a86FF"
|
||||
text_link = "#c4a7e7FF"
|
||||
text_main = "#e0def4FF"
|
||||
text_selected = "#56526e1A"
|
||||
text_selection_inactive = "#908caa38"
|
||||
text_string = "#3e8fb0FF"
|
||||
text_success = "#3e8fb0FF"
|
||||
text_warning = "#f6c177FF"
|
||||
warning = "#f6c177FF"
|
||||
warning_emphasis = "#ffd580FF"
|
||||
@@ -1,63 +0,0 @@
|
||||
[colors]
|
||||
accent = '#31748FFF'
|
||||
background = '#191724FF'
|
||||
border_emphasized = '#C4A7E7FF'
|
||||
border_focused = '#31748FFF'
|
||||
border_window = '#524F67FF'
|
||||
cursor = '#E0DEF4FF'
|
||||
editor_background = '#191724FF'
|
||||
error = '#EB6F92FF'
|
||||
floating_window_background = '#26233AFF'
|
||||
foreground = '#E0DEF4FF'
|
||||
foreground_emphasis = '#FFFFFFFF'
|
||||
foreground_secondary = '#908CAAFF'
|
||||
info = '#C4A7E7FF'
|
||||
menu_option_background = '#26233AFF'
|
||||
outline = '#6E6A86FF'
|
||||
popup_background = '#1F1D2EFF'
|
||||
shadow = '#00000080'
|
||||
sidebar_background = '#1F1D2EFF'
|
||||
success = '#31748FFF'
|
||||
surface = '#1F1D2EFF'
|
||||
surface_variant = '#26233AFF'
|
||||
syntax_error = '#EB6F92FF'
|
||||
syntax_function = '#C4A7E7FF'
|
||||
syntax_keyword = '#EBBCBAFF'
|
||||
syntax_operator = '#908CAAFF'
|
||||
syntax_special_keyword = '#F6C177FF'
|
||||
term_black = '#191724FF'
|
||||
term_black_bright = '#403D52FF'
|
||||
term_blue = '#C4A7E7FF'
|
||||
term_blue_bright = '#C4A7E7FF'
|
||||
term_cyan = '#9CCFD8FF'
|
||||
term_cyan_bright = '#9CCFD8FF'
|
||||
term_green = '#31748FFF'
|
||||
term_green_bright = '#31748FFF'
|
||||
term_magenta = '#EBBCBAFF'
|
||||
term_magenta_bright = '#F0D6F0FF'
|
||||
term_red = '#EB6F92FF'
|
||||
term_red_bright = '#EB6F92FF'
|
||||
term_white = '#E0DEF4FF'
|
||||
term_white_bright = '#FFFFFFFF'
|
||||
term_yellow = '#F6C177FF'
|
||||
term_yellow_bright = '#F6C177FF'
|
||||
terminal_gray = '#33353AFF'
|
||||
text_command = '#31748FFF'
|
||||
text_comment = '#6E6A86FF'
|
||||
text_disabled = '#6E6A86FF'
|
||||
text_emphasis = '#FFFFFFFF'
|
||||
text_error = '#EB6F92FF'
|
||||
text_inactive = '#908CAAFF'
|
||||
text_line_number = '#6E6A86FF'
|
||||
text_link = '#C4A7E7FF'
|
||||
text_main = '#E0DEF4FF'
|
||||
text_selected = '#524F671A'
|
||||
text_selection_inactive = '#908CAA38'
|
||||
text_string = '#31748FFF'
|
||||
text_success = '#31748FFF'
|
||||
text_warning = '#F6C177FF'
|
||||
warning = '#F6C177FF'
|
||||
warning_emphasis = '#F6C177FF'
|
||||
|
||||
[general]
|
||||
name = 'rose-pine'
|
||||
@@ -1,36 +1,36 @@
|
||||
# BASE COLORS (raw)
|
||||
color1.raw {term_red}
|
||||
color1.raw {base01}
|
||||
|
||||
# HEX
|
||||
color1.hex {term_red.hex}
|
||||
color1.hex.stripped {term_red.hex_stripped}
|
||||
color1.hex {base01.hex}
|
||||
color1.hex.stripped {base01.hex_stripped}
|
||||
|
||||
color1.hexa {term_red.hexa}
|
||||
color1.hexa.stripped {term_red.hexa_stripped}
|
||||
color1.hexa {base01.hexa}
|
||||
color1.hexa.stripped {base01.hexa_stripped}
|
||||
|
||||
# RGB (0–255)
|
||||
color1.rgb {term_red.rgb}
|
||||
color1.r {term_red.r}
|
||||
color1.g {term_red.g}
|
||||
color1.b {term_red.b}
|
||||
color1.rgb {base01.rgb}
|
||||
color1.r {base01.r}
|
||||
color1.g {base01.g}
|
||||
color1.b {base01.b}
|
||||
|
||||
# RGBA (A = 0–1 normalized)
|
||||
color1.rgba {term_red.rgba}
|
||||
color1.a {term_red.a}
|
||||
color1.rgba {base01.rgba}
|
||||
color1.a {base01.a}
|
||||
|
||||
# HSL (normalized 0–1 for s,l, integers for h)
|
||||
color1.hsl {term_red.hsl}
|
||||
color1.h {term_red.h}
|
||||
color1.s {term_red.s}
|
||||
color1.l {term_red.l}
|
||||
color1.hsl {base01.hsl}
|
||||
color1.h {base01.h}
|
||||
color1.s {base01.s}
|
||||
color1.l {base01.l}
|
||||
|
||||
# HSLA
|
||||
color1.hsla {term_red.hsla}
|
||||
color1.hsla_a {term_red.hsla_a}
|
||||
color1.hsla {base01.hsla}
|
||||
color1.hsla_a {base01.hsla_a}
|
||||
|
||||
# Combined custom formats
|
||||
color1.r-g-b {term_red.r}-{term_red.g}-{term_red.b}
|
||||
color1.r-g-b-a {term_red.r}-{term_red.g}-{term_red.b}-{term_red.a}
|
||||
color1.r-g-b {base01.r}-{base01.g}-{base01.b}
|
||||
color1.r-g-b-a {base01.r}-{base01.g}-{base01.b}-{base01.a}
|
||||
|
||||
color1.h-s-l {term_red.h}-{term_red.s}-{term_red.l}
|
||||
color1.h-s-l-a {term_red.h}-{term_red.s}-{term_red.l}-{term_red.hsla_a}
|
||||
color1.h-s-l {base01.h}-{base01.s}-{base01.l}
|
||||
color1.h-s-l-a {base01.h}-{base01.s}-{base01.l}-{base01.hsla_a}
|
||||
@@ -1,32 +1,32 @@
|
||||
cursor {foreground}
|
||||
cursor {cursor}
|
||||
cursor_text_color {background}
|
||||
|
||||
foreground {foreground}
|
||||
background {background}
|
||||
selection_foreground {foreground_secondary}
|
||||
selection_foreground {on_surface}
|
||||
selection_background {surface}
|
||||
url_color {accent}
|
||||
|
||||
color8 {surface_variant}
|
||||
color0 {background}
|
||||
color0 {base00}
|
||||
color8 {base08}
|
||||
|
||||
color1 {term_red}
|
||||
color9 {term_red_bright}
|
||||
color1 {base01}
|
||||
color9 {base09}
|
||||
|
||||
color2 {term_green}
|
||||
color10 {term_green_bright}
|
||||
color2 {base02}
|
||||
color10 {base0A}
|
||||
|
||||
color3 {term_yellow}
|
||||
color11 {term_yellow_bright}
|
||||
color3 {base03}
|
||||
color11 {base0B}
|
||||
|
||||
color4 {term_blue}
|
||||
color12 {term_blue_bright}
|
||||
color4 {base04}
|
||||
color12 {base0C}
|
||||
|
||||
color5 {term_magenta}
|
||||
color13 {term_magenta_bright}
|
||||
color5 {base05}
|
||||
color13 {base0D}
|
||||
|
||||
color6 {term_cyan}
|
||||
color14 {term_cyan_bright}
|
||||
color6 {base06}
|
||||
color14 {base0E}
|
||||
|
||||
color15 {term_white_bright}
|
||||
color7 {term_white}
|
||||
color7 {base07}
|
||||
color15 {base0F}
|
||||
@@ -3,33 +3,39 @@ vim.cmd("syntax reset")
|
||||
vim.g.colors_name = "clrsync"
|
||||
|
||||
local palette = {
|
||||
-- TextEditor
|
||||
Default = "{text_main.hex}",
|
||||
Keyword = "{syntax_keyword.hex}",
|
||||
Number = "{text_warning.hex}",
|
||||
String = "{text_string.hex}",
|
||||
CharLiteral = "{text_string.hex}",
|
||||
Punctuation = "{text_main.hex}",
|
||||
Preprocessor = "{syntax_special_keyword.hex}",
|
||||
Identifier = "{text_main.hex}",
|
||||
KnownIdentifier = "{text_link.hex}",
|
||||
PreprocIdentifier = "{text_link.hex}",
|
||||
-- Editor colors
|
||||
Default = "{editor_main.hex}",
|
||||
Keyword = "{editor_command.hex}",
|
||||
Number = "{editor_warning.hex}",
|
||||
String = "{editor_string.hex}",
|
||||
CharLiteral = "{editor_string.hex}",
|
||||
Punctuation = "{editor_main.hex}",
|
||||
Preprocessor = "{editor_emphasis.hex}",
|
||||
Identifier = "{editor_main.hex}",
|
||||
KnownIdentifier = "{editor_link.hex}",
|
||||
PreprocIdentifier = "{editor_link.hex}",
|
||||
|
||||
Comment = "{text_comment.hex}",
|
||||
MultiLineComment = "{text_comment.hex}",
|
||||
Comment = "{editor_comment.hex}",
|
||||
MultiLineComment = "{editor_comment.hex}",
|
||||
|
||||
Background = "{editor_background.hex}",
|
||||
Cursor = "{cursor.hex}",
|
||||
|
||||
Selection = "{text_selected.hex}",
|
||||
ErrorMarker = "{syntax_error.hex}",
|
||||
Breakpoint = "{syntax_error.hex}",
|
||||
Selection = "{editor_selected.hex}",
|
||||
ErrorMarker = "{editor_error.hex}",
|
||||
Breakpoint = "{editor_error.hex}",
|
||||
|
||||
LineNumber = "{text_line_number.hex}",
|
||||
LineNumber = "{editor_line_number.hex}",
|
||||
CurrentLineFill = "{surface_variant.hex}",
|
||||
CurrentLineFillInactive = "{surface.hex}",
|
||||
|
||||
CurrentLineEdge = "{border_emphasized.hex}",
|
||||
CurrentLineEdge = "{border_focused.hex}",
|
||||
|
||||
-- Semantic colors
|
||||
Success = "{success.hex}",
|
||||
Warning = "{warning.hex}",
|
||||
Error = "{error.hex}",
|
||||
Info = "{info.hex}",
|
||||
}
|
||||
|
||||
-- Helper function to set highlights in Neovim
|
||||
@@ -59,7 +65,7 @@ set_hl("Type", { fg = palette.Keyword })
|
||||
set_hl("Special", { fg = palette.PreprocIdentifier })
|
||||
set_hl("Underlined", { fg = palette.KnownIdentifier })
|
||||
set_hl("Error", { fg = palette.ErrorMarker, bg = palette.Background })
|
||||
set_hl("Todo", { fg = palette.Text, bg = palette.Keyword })
|
||||
set_hl("Todo", { fg = palette.Default, bg = palette.Keyword })
|
||||
|
||||
-- Floating windows
|
||||
set_hl("NormalFloat", { bg = palette.Background })
|
||||
@@ -70,12 +76,12 @@ set_hl("Pmenu", { bg = palette.Background })
|
||||
set_hl("PmenuSel", { bg = palette.Keyword, fg = palette.Background })
|
||||
|
||||
-- Git and diagnostic highlights
|
||||
set_hl("DiffAdd", { fg = palette.Success or palette.Default, bg = palette.Background })
|
||||
set_hl("DiffAdd", { fg = palette.Success, bg = palette.Background })
|
||||
set_hl("DiffChange", { fg = palette.Keyword, bg = palette.Background })
|
||||
set_hl("DiffDelete", { fg = palette.ErrorMarker, bg = palette.Background })
|
||||
set_hl("DiagnosticError", { fg = palette.ErrorMarker })
|
||||
set_hl("DiagnosticWarn", { fg = palette.Number })
|
||||
set_hl("DiagnosticInfo", { fg = palette.Keyword })
|
||||
set_hl("DiagnosticError", { fg = palette.Error })
|
||||
set_hl("DiagnosticWarn", { fg = palette.Warning })
|
||||
set_hl("DiagnosticInfo", { fg = palette.Info })
|
||||
set_hl("DiagnosticHint", { fg = palette.PreprocIdentifier })
|
||||
|
||||
-- Treesitter links
|
||||
@@ -84,4 +90,4 @@ set_hl("@string", { fg = palette.String })
|
||||
set_hl("@function", { fg = palette.Keyword })
|
||||
set_hl("@variable", { fg = palette.Identifier })
|
||||
set_hl("@keyword", { fg = palette.Keyword })
|
||||
set_hl("@type", { fg = palette.Preprocessor })
|
||||
set_hl("@type", { fg = palette.Preprocessor })
|
||||
27
flake.lock
generated
Normal file
27
flake.lock
generated
Normal file
@@ -0,0 +1,27 @@
|
||||
{
|
||||
"nodes": {
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1764950072,
|
||||
"narHash": "sha256-BmPWzogsG2GsXZtlT+MTcAWeDK5hkbGRZTeZNW42fwA=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "f61125a668a320878494449750330ca58b78c557",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"ref": "nixos-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"nixpkgs": "nixpkgs"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
"version": 7
|
||||
}
|
||||
86
flake.nix
Normal file
86
flake.nix
Normal file
@@ -0,0 +1,86 @@
|
||||
{
|
||||
description = "clrsync - Color scheme manager";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
};
|
||||
|
||||
outputs =
|
||||
{ self, nixpkgs, ... }:
|
||||
let
|
||||
supportedSystems = [
|
||||
"x86_64-linux"
|
||||
];
|
||||
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
|
||||
nixpkgsFor = forAllSystems (system: import nixpkgs { inherit system; });
|
||||
in
|
||||
{
|
||||
packages = forAllSystems (
|
||||
system:
|
||||
let
|
||||
pkgs = nixpkgsFor.${system};
|
||||
in
|
||||
rec {
|
||||
clrsync = pkgs.callPackage ./package.nix { };
|
||||
default = clrsync;
|
||||
}
|
||||
);
|
||||
|
||||
homeModules = {
|
||||
default = import ./home-manager-module.nix self;
|
||||
clrsync = self.homeModules.default;
|
||||
};
|
||||
|
||||
apps = forAllSystems (system: {
|
||||
clrsync-gui = {
|
||||
type = "app";
|
||||
program = "${self.packages.${system}.clrsync}/bin/clrsync_gui";
|
||||
meta = {
|
||||
description = "clrsync gui app";
|
||||
license = self.packages.x86_64-linux.licenses.mit;
|
||||
maintainers = [ "Daniel Dada" ];
|
||||
};
|
||||
};
|
||||
|
||||
clrsync-cli = {
|
||||
type = "app";
|
||||
program = "${self.packages.${system}.clrsync}/bin/clrsync_cli";
|
||||
meta = {
|
||||
description = "clrsync cli app";
|
||||
license = self.packages.x86_64-linux.licenses.mit;
|
||||
maintainers = [ "Daniel Dada" ];
|
||||
};
|
||||
};
|
||||
|
||||
default = self.apps.${system}.clrsync-cli;
|
||||
});
|
||||
|
||||
devShells = forAllSystems (
|
||||
system:
|
||||
let
|
||||
pkgs = nixpkgsFor.${system};
|
||||
in
|
||||
{
|
||||
default = pkgs.mkShell {
|
||||
inputsFrom = [ self.packages.${system}.clrsync ];
|
||||
|
||||
buildInputs = with pkgs; [
|
||||
cmake
|
||||
ninja
|
||||
clang-tools
|
||||
gdb
|
||||
];
|
||||
|
||||
shellHook = ''
|
||||
export CMAKE_GENERATOR="Ninja"
|
||||
export CMAKE_EXPORT_COMPILE_COMMANDS=1
|
||||
'';
|
||||
};
|
||||
}
|
||||
);
|
||||
|
||||
overlays.default = final: prev: {
|
||||
clrsync = self.packages.${final.system}.clrsync;
|
||||
};
|
||||
};
|
||||
}
|
||||
155
home-manager-module.nix
Normal file
155
home-manager-module.nix
Normal file
@@ -0,0 +1,155 @@
|
||||
flake:
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.programs.clrsync;
|
||||
|
||||
clrsyncPackage = flake.packages.${pkgs.system}.default;
|
||||
|
||||
templateType = types.submodule {
|
||||
options = {
|
||||
enabled = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
description = "Whether to enable this template.";
|
||||
};
|
||||
inputPath = mkOption {
|
||||
type = types.str;
|
||||
description = "Path to the template input file.";
|
||||
};
|
||||
outputPath = mkOption {
|
||||
type = types.str;
|
||||
description = "Path where the generated output will be written.";
|
||||
};
|
||||
reloadCmd = mkOption {
|
||||
type = types.str;
|
||||
default = "";
|
||||
description = "Command to run after generating the output.";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
configFormat = pkgs.formats.toml { };
|
||||
configFile = configFormat.generate "config.toml" {
|
||||
general = {
|
||||
default_theme = cfg.defaultTheme;
|
||||
palettes_path = cfg.palettesPath;
|
||||
font = cfg.font;
|
||||
font_size = cfg.fontSize;
|
||||
};
|
||||
templates = mapAttrs (
|
||||
name: template: {
|
||||
enabled = template.enabled;
|
||||
input_path = template.inputPath;
|
||||
output_path = template.outputPath;
|
||||
reload_cmd = template.reloadCmd;
|
||||
}
|
||||
) cfg.templates;
|
||||
};
|
||||
in
|
||||
{
|
||||
options.programs.clrsync = {
|
||||
enable = mkEnableOption "clrsync color synchronization";
|
||||
|
||||
defaultTheme = mkOption {
|
||||
type = types.str;
|
||||
default = "cursed";
|
||||
description = "Default theme to use.";
|
||||
};
|
||||
|
||||
palettesPath = mkOption {
|
||||
type = types.str;
|
||||
default = "~/.config/clrsync/palettes";
|
||||
description = "Path to color palettes directory.";
|
||||
};
|
||||
|
||||
font = mkOption {
|
||||
type = types.str;
|
||||
default = "JetBrainsMono Nerd Font Mono";
|
||||
description = "Font family to use.";
|
||||
};
|
||||
|
||||
fontSize = mkOption {
|
||||
type = types.int;
|
||||
default = 14;
|
||||
description = "Font size.";
|
||||
};
|
||||
|
||||
templates = mkOption {
|
||||
type = types.attrsOf templateType;
|
||||
default = { };
|
||||
description = "Template configurations.";
|
||||
example = literalExpression ''
|
||||
{
|
||||
kitty = {
|
||||
enabled = true;
|
||||
inputPath = "~/.config/clrsync/templates/kitty.conf";
|
||||
outputPath = "~/.config/kitty/kitty_test.conf";
|
||||
reloadCmd = "pkill -SIGUSR1 kitty";
|
||||
};
|
||||
}
|
||||
'';
|
||||
};
|
||||
|
||||
applyTheme = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
description = "Whether to apply the default theme on activation.";
|
||||
};
|
||||
|
||||
systemdTarget = mkOption {
|
||||
type = types.str;
|
||||
default = "graphical-session.target";
|
||||
description = "Systemd target to bind the clrsync service to.";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home.packages = [ clrsyncPackage ];
|
||||
|
||||
xdg.enable = true;
|
||||
|
||||
home.activation.clrsyncDesktop = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
|
||||
if [ -d "$HOME/.nix-profile/share/applications" ]; then
|
||||
${pkgs.desktop-file-utils}/bin/update-desktop-database "$HOME/.nix-profile/share/applications" || true
|
||||
fi
|
||||
'';
|
||||
|
||||
xdg.configFile."clrsync/config.toml" = {
|
||||
source = configFile;
|
||||
force = true;
|
||||
};
|
||||
|
||||
home.activation.clrsyncConfig = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
|
||||
run --quiet mkdir -p $HOME/.config/clrsync
|
||||
run --quiet cp -f ${configFile} $HOME/.config/clrsync/config.toml
|
||||
'';
|
||||
|
||||
home.activation.clrsyncApply = mkIf cfg.applyTheme (
|
||||
lib.hm.dag.entryAfter [ "clrsyncConfig" ] ''
|
||||
run --quiet ${clrsyncPackage}/bin/clrsync_cli --apply --theme ${cfg.defaultTheme}
|
||||
''
|
||||
);
|
||||
|
||||
systemd.user.services.clrsync = mkIf cfg.applyTheme {
|
||||
Unit = {
|
||||
Description = "Apply clrsync color palette";
|
||||
After = [ cfg.systemdTarget ];
|
||||
PartOf = [ cfg.systemdTarget ];
|
||||
};
|
||||
Service = {
|
||||
Type = "oneshot";
|
||||
ExecStart = "${clrsyncPackage}/bin/clrsync_cli --apply --theme ${cfg.defaultTheme}";
|
||||
RemainAfterExit = true;
|
||||
};
|
||||
Install = {
|
||||
WantedBy = [ cfg.systemdTarget ];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
107
meson.build
107
meson.build
@@ -1,107 +0,0 @@
|
||||
project('clrsync', 'cpp',
|
||||
version : '0.1.0',
|
||||
default_options : [
|
||||
'cpp_std=c++20',
|
||||
'buildtype=debug',
|
||||
],
|
||||
)
|
||||
|
||||
imgui_dep = dependency('imgui-docking',
|
||||
fallback : ['imgui-docking', 'imgui_dep'],
|
||||
default_options : [
|
||||
'default_library=static',
|
||||
'opengl=enabled',
|
||||
'glfw=enabled',
|
||||
]
|
||||
)
|
||||
|
||||
imgui_dep = declare_dependency(
|
||||
compile_args: ['-DIMGUI_ENABLE_FREETYPE'],
|
||||
dependencies: [imgui_dep]
|
||||
)
|
||||
|
||||
glfw_dep = dependency('glfw3', fallback : ['glfw', 'glfw_dep'])
|
||||
gl_dep = dependency('gl')
|
||||
|
||||
freetype_dep = dependency('freetype2')
|
||||
|
||||
inc_dirs = include_directories('src')
|
||||
lib_inc_dirs = include_directories('lib')
|
||||
|
||||
cpp_args = []
|
||||
if host_machine.system() == 'windows'
|
||||
compiler = meson.get_compiler('cpp')
|
||||
if compiler.get_id() == 'msvc'
|
||||
cpp_args += ['/EHsc']
|
||||
endif
|
||||
endif
|
||||
|
||||
core_sources = [
|
||||
'src/core/palette/color.cpp',
|
||||
'src/core/io/toml_file.cpp',
|
||||
'src/core/config/config.cpp',
|
||||
'src/core/utils.cpp',
|
||||
'src/core/version.cpp',
|
||||
'src/core/theme/theme_template.cpp',
|
||||
]
|
||||
|
||||
text_edit_sources = [
|
||||
'lib/color_text_edit/TextEditor.cpp',
|
||||
]
|
||||
|
||||
clrsync_core = static_library(
|
||||
'clrsync_core',
|
||||
core_sources,
|
||||
include_directories : [inc_dirs, lib_inc_dirs],
|
||||
cpp_args : cpp_args,
|
||||
)
|
||||
|
||||
clrsync_core_dep = declare_dependency(
|
||||
link_with : clrsync_core,
|
||||
include_directories : [inc_dirs, lib_inc_dirs],
|
||||
)
|
||||
|
||||
clrsync_cli = executable(
|
||||
'clrsync_cli',
|
||||
'src/cli/main.cpp',
|
||||
include_directories : [inc_dirs, lib_inc_dirs],
|
||||
link_with : clrsync_core,
|
||||
cpp_args : cpp_args,
|
||||
)
|
||||
|
||||
gui_sources = [
|
||||
'src/gui/main.cpp',
|
||||
'src/gui/color_scheme_editor.cpp',
|
||||
'src/gui/template_editor.cpp',
|
||||
'src/gui/palette_controller.cpp',
|
||||
'src/gui/template_controller.cpp',
|
||||
'src/gui/imgui_helpers.cpp',
|
||||
'src/gui/about_window.cpp',
|
||||
'src/gui/settings_window.cpp',
|
||||
'src/gui/font_loader.cpp',
|
||||
]
|
||||
|
||||
clrsync_gui_link_args = []
|
||||
|
||||
fontconfig_dep = dependency('', required : false)
|
||||
if host_machine.system() == 'linux'
|
||||
fontconfig_dep = dependency('fontconfig', required : true)
|
||||
clrsync_gui_link_args += ['-lX11', '-lXrandr', '-lXi']
|
||||
endif
|
||||
|
||||
clrsync_gui = executable(
|
||||
'clrsync_gui',
|
||||
gui_sources,
|
||||
text_edit_sources,
|
||||
include_directories : [inc_dirs, lib_inc_dirs],
|
||||
dependencies : [
|
||||
clrsync_core_dep,
|
||||
imgui_dep,
|
||||
freetype_dep,
|
||||
glfw_dep,
|
||||
gl_dep,
|
||||
fontconfig_dep,
|
||||
],
|
||||
cpp_args : cpp_args,
|
||||
link_args : clrsync_gui_link_args
|
||||
)
|
||||
97
package.nix
Normal file
97
package.nix
Normal file
@@ -0,0 +1,97 @@
|
||||
{
|
||||
lib,
|
||||
stdenv,
|
||||
cmake,
|
||||
git,
|
||||
pkg-config,
|
||||
makeWrapper,
|
||||
wayland-protocols,
|
||||
glfw,
|
||||
freetype,
|
||||
fontconfig,
|
||||
mesa,
|
||||
xorg,
|
||||
wayland,
|
||||
libxkbcommon,
|
||||
zlib,
|
||||
bzip2,
|
||||
wayland-scanner,
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "clrsync";
|
||||
version = "unstable-2024-12-15";
|
||||
|
||||
src = lib.cleanSourceWith {
|
||||
src = ./.;
|
||||
filter =
|
||||
path: type:
|
||||
let
|
||||
baseName = baseNameOf path;
|
||||
in
|
||||
!(
|
||||
lib.hasSuffix ".o" baseName
|
||||
|| lib.hasSuffix ".a" baseName
|
||||
|| baseName == "build"
|
||||
|| baseName == "CMakeCache.txt"
|
||||
|| baseName == "CMakeFiles"
|
||||
|| baseName == ".git"
|
||||
|| baseName == "result"
|
||||
|| baseName == ".direnv"
|
||||
);
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
cmake
|
||||
git
|
||||
pkg-config
|
||||
makeWrapper
|
||||
wayland-protocols
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
glfw
|
||||
freetype
|
||||
fontconfig
|
||||
xorg.libXcursor
|
||||
mesa
|
||||
xorg.libX11
|
||||
xorg.libXrandr
|
||||
xorg.libXi
|
||||
xorg.libXinerama
|
||||
wayland
|
||||
wayland-scanner
|
||||
wayland-protocols
|
||||
libxkbcommon
|
||||
zlib
|
||||
bzip2
|
||||
];
|
||||
|
||||
cmakeFlags = [
|
||||
"-DCMAKE_BUILD_TYPE=Release"
|
||||
"-DUSE_SYSTEM_GLFW=ON"
|
||||
];
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
cmake --install . --prefix $out
|
||||
|
||||
wrapProgram $out/bin/clrsync_gui \
|
||||
--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath buildInputs}
|
||||
|
||||
wrapProgram $out/bin/clrsync_cli \
|
||||
--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath buildInputs}
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "Color scheme manager with GUI and CLI";
|
||||
homepage = "https://github.com/obsqrbtz/clrsync";
|
||||
license = licenses.mit;
|
||||
platforms = platforms.linux;
|
||||
mainProgram = "clrsync_gui";
|
||||
maintainers = [ ];
|
||||
};
|
||||
}
|
||||
8
src/cli/CMakeLists.txt
Normal file
8
src/cli/CMakeLists.txt
Normal file
@@ -0,0 +1,8 @@
|
||||
add_executable(clrsync_cli main.cpp)
|
||||
|
||||
target_include_directories(clrsync_cli PRIVATE
|
||||
${CMAKE_SOURCE_DIR}/src
|
||||
SYSTEM ${CMAKE_SOURCE_DIR}/lib
|
||||
)
|
||||
|
||||
target_link_libraries(clrsync_cli PRIVATE clrsync_core)
|
||||
@@ -1,16 +1,16 @@
|
||||
#include <iostream>
|
||||
#include <cstdlib>
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
#include <argparse/argparse.hpp>
|
||||
|
||||
#include <core/utils.hpp>
|
||||
#include <core/config/config.hpp>
|
||||
#include <core/io/toml_file.hpp>
|
||||
#include <core/palette/palette_file.hpp>
|
||||
#include <core/palette/palette_manager.hpp>
|
||||
#include <core/theme/theme_template.hpp>
|
||||
#include <core/theme/theme_renderer.hpp>
|
||||
#include <core/theme/theme_template.hpp>
|
||||
#include <core/utils.hpp>
|
||||
#include <core/version.hpp>
|
||||
|
||||
void handle_show_vars()
|
||||
@@ -21,9 +21,8 @@ void handle_show_vars()
|
||||
void handle_list_themes()
|
||||
{
|
||||
auto palette_manager = clrsync::core::palette_manager<clrsync::core::io::toml_file>();
|
||||
palette_manager.load_palettes_from_directory(
|
||||
clrsync::core::config::instance().palettes_path());
|
||||
|
||||
palette_manager.load_palettes_from_directory(clrsync::core::config::instance().palettes_path());
|
||||
|
||||
const auto &palettes = palette_manager.palettes();
|
||||
std::cout << "Available themes:" << std::endl;
|
||||
for (const auto &p : palettes)
|
||||
@@ -36,7 +35,7 @@ int handle_apply_theme(const argparse::ArgumentParser &program, const std::strin
|
||||
{
|
||||
clrsync::core::theme_renderer<clrsync::core::io::toml_file> renderer;
|
||||
std::string theme_identifier;
|
||||
|
||||
|
||||
if (program.is_used("--theme"))
|
||||
{
|
||||
theme_identifier = program.get<std::string>("--theme");
|
||||
@@ -57,7 +56,7 @@ int handle_apply_theme(const argparse::ArgumentParser &program, const std::strin
|
||||
theme_identifier = default_theme;
|
||||
renderer.apply_theme(theme_identifier);
|
||||
}
|
||||
|
||||
|
||||
std::cout << "Applied theme " << theme_identifier << std::endl;
|
||||
return 0;
|
||||
}
|
||||
@@ -70,35 +69,27 @@ void initialize_config(const std::string &config_path)
|
||||
|
||||
void setup_argument_parser(argparse::ArgumentParser &program)
|
||||
{
|
||||
program.add_argument("-a", "--apply")
|
||||
.help("applies default theme")
|
||||
.flag();
|
||||
|
||||
program.add_argument("-a", "--apply").help("applies default theme").flag();
|
||||
|
||||
program.add_argument("-c", "--config")
|
||||
.default_value(clrsync::core::get_default_config_path())
|
||||
.help("sets config file path")
|
||||
.metavar("PATH");
|
||||
|
||||
program.add_argument("-l", "--list-themes")
|
||||
.help("lists available themes")
|
||||
.flag();
|
||||
|
||||
program.add_argument("-s", "--show-vars")
|
||||
.help("shows color keys")
|
||||
.flag();
|
||||
|
||||
|
||||
program.add_argument("-l", "--list-themes").help("lists available themes").flag();
|
||||
|
||||
program.add_argument("-s", "--show-vars").help("shows color keys").flag();
|
||||
|
||||
auto &group = program.add_mutually_exclusive_group();
|
||||
group.add_argument("-t", "--theme")
|
||||
.help("sets theme <theme_name> to apply");
|
||||
group.add_argument("-p", "--path")
|
||||
.help("sets theme file <path/to/theme> to apply");
|
||||
group.add_argument("-t", "--theme").help("sets theme <theme_name> to apply");
|
||||
group.add_argument("-p", "--path").help("sets theme file <path/to/theme> to apply");
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
argparse::ArgumentParser program("clrsync", clrsync::core::version_string());
|
||||
setup_argument_parser(program);
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
program.parse_args(argc, argv);
|
||||
@@ -109,9 +100,9 @@ int main(int argc, char *argv[])
|
||||
std::cerr << program;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
std::string config_path = program.get<std::string>("--config");
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
initialize_config(config_path);
|
||||
@@ -121,19 +112,19 @@ int main(int argc, char *argv[])
|
||||
std::cerr << "Error loading config: " << err.what() << std::endl;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
if (program.is_used("--show-vars"))
|
||||
{
|
||||
handle_show_vars();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
if (program.is_used("--list-themes"))
|
||||
{
|
||||
handle_list_themes();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
if (program.is_used("--apply"))
|
||||
{
|
||||
const std::string default_theme = clrsync::core::config::instance().default_theme();
|
||||
@@ -141,6 +132,6 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
std::cout << program << std::endl;
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
21
src/core/CMakeLists.txt
Normal file
21
src/core/CMakeLists.txt
Normal file
@@ -0,0 +1,21 @@
|
||||
set(CORE_SOURCES
|
||||
palette/color.cpp
|
||||
io/toml_file.cpp
|
||||
config/config.cpp
|
||||
utils.cpp
|
||||
version.cpp
|
||||
theme/theme_template.cpp
|
||||
)
|
||||
|
||||
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
|
||||
|
||||
add_library(clrsync_core SHARED ${CORE_SOURCES})
|
||||
|
||||
target_include_directories(clrsync_core PUBLIC
|
||||
${CMAKE_SOURCE_DIR}/src
|
||||
SYSTEM ${CMAKE_SOURCE_DIR}/lib
|
||||
)
|
||||
|
||||
target_compile_definitions(clrsync_core PUBLIC
|
||||
CLRSYNC_DATADIR=\"${CMAKE_INSTALL_FULL_DATADIR}/clrsync\"
|
||||
)
|
||||
@@ -1,9 +1,15 @@
|
||||
#include "config.hpp"
|
||||
#include "core/utils.hpp"
|
||||
|
||||
#include <core/palette/color.hpp>
|
||||
#include <filesystem>
|
||||
#include <fstream>
|
||||
#include <stdexcept>
|
||||
|
||||
#ifdef _WIN32
|
||||
#include "windows.h"
|
||||
#endif
|
||||
|
||||
namespace clrsync::core
|
||||
{
|
||||
config &config::instance()
|
||||
@@ -23,35 +29,94 @@ void config::initialize(std::unique_ptr<clrsync::core::io::file> file)
|
||||
|
||||
std::filesystem::path config::get_user_config_dir()
|
||||
{
|
||||
auto home = expand_user("~");
|
||||
#ifdef _WIN32
|
||||
if (const char *appdata = std::getenv("APPDATA"))
|
||||
return fs::path(appdata) / "clrsync";
|
||||
else
|
||||
return fs::path("C:/clrsync");
|
||||
return home + "\\.config\\clrsync";
|
||||
|
||||
#else
|
||||
if (const char *xdg = std::getenv("XDG_CONFIG_HOME"))
|
||||
return std::filesystem::path(xdg) / "clrsync";
|
||||
else if (const char *home = std::getenv("HOME"))
|
||||
return std::filesystem::path(home) / ".config/clrsync";
|
||||
else
|
||||
return std::filesystem::path("/tmp/clrsync");
|
||||
return home + "/.config/clrsync";
|
||||
#endif
|
||||
}
|
||||
|
||||
std::filesystem::path config::get_data_dir()
|
||||
{
|
||||
if (std::filesystem::exists(CLRSYNC_DATADIR))
|
||||
return {CLRSYNC_DATADIR};
|
||||
#ifdef _WIN32
|
||||
char buffer[MAX_PATH];
|
||||
GetModuleFileNameA(nullptr, buffer, MAX_PATH);
|
||||
std::filesystem::path exe_path(buffer);
|
||||
std::filesystem::path data_dir = exe_path.parent_path().parent_path() / "share" / "clrsync";
|
||||
return data_dir;
|
||||
#else
|
||||
if (std::filesystem::exists("/usr/share/clrsync"))
|
||||
return {"/usr/share/clrsync"};
|
||||
if (std::filesystem::exists("/usr/local/share/clrsync"))
|
||||
return {"/usr/local/share/clrsync"};
|
||||
return {};
|
||||
#endif
|
||||
}
|
||||
|
||||
void config::copy_file(const std::filesystem::path &src, const std::filesystem::path &dst)
|
||||
{
|
||||
if (std::filesystem::exists(dst))
|
||||
return;
|
||||
|
||||
std::ifstream in(src, std::ios::binary);
|
||||
std::ofstream out(dst, std::ios::binary);
|
||||
out << in.rdbuf();
|
||||
}
|
||||
|
||||
void config::copy_dir(const std::filesystem::path &src, const std::filesystem::path &dst)
|
||||
{
|
||||
for (auto const &entry : std::filesystem::recursive_directory_iterator(src))
|
||||
{
|
||||
auto rel = std::filesystem::relative(entry.path(), src);
|
||||
auto out = dst / rel;
|
||||
|
||||
if (entry.is_directory())
|
||||
{
|
||||
std::filesystem::create_directories(out);
|
||||
}
|
||||
else if (entry.is_regular_file())
|
||||
{
|
||||
copy_file(entry.path(), out);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void config::copy_default_configs()
|
||||
{
|
||||
std::filesystem::path user_config = get_user_config_dir();
|
||||
std::filesystem::path user_dir = get_user_config_dir();
|
||||
std::filesystem::path system_dir = get_data_dir();
|
||||
|
||||
std::filesystem::create_directories(user_dir);
|
||||
|
||||
if (!std::filesystem::exists(user_config))
|
||||
{
|
||||
std::filesystem::create_directories(user_config);
|
||||
auto src = system_dir / "config.toml";
|
||||
auto dst = user_dir / "config.toml";
|
||||
if (!std::filesystem::exists(dst))
|
||||
copy_file(src, dst);
|
||||
}
|
||||
|
||||
std::filesystem::path default_dir = CLRSYNC_DATADIR;
|
||||
std::filesystem::copy(default_dir / "config.toml", user_config / "config.toml");
|
||||
std::filesystem::copy(default_dir / "templates", user_config / "templates",
|
||||
std::filesystem::copy_options::recursive);
|
||||
std::filesystem::copy(default_dir / "palettes", user_config / "palettes",
|
||||
std::filesystem::copy_options::recursive);
|
||||
{
|
||||
auto src = system_dir / "templates";
|
||||
auto dst = user_dir / "templates";
|
||||
|
||||
if (!std::filesystem::exists(dst))
|
||||
std::filesystem::create_directories(dst);
|
||||
|
||||
copy_dir(src, dst);
|
||||
}
|
||||
|
||||
{
|
||||
auto src = system_dir / "palettes";
|
||||
auto dst = user_dir / "palettes";
|
||||
|
||||
if (!std::filesystem::exists(dst))
|
||||
std::filesystem::create_directories(dst);
|
||||
|
||||
copy_dir(src, dst);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -32,6 +32,7 @@ class config
|
||||
|
||||
void update_template(const std::string &key,
|
||||
const clrsync::core::theme_template &theme_template);
|
||||
static std::filesystem::path get_data_dir();
|
||||
|
||||
private:
|
||||
config() = default;
|
||||
@@ -41,6 +42,8 @@ class config
|
||||
std::string m_palettes_dir{};
|
||||
std::unique_ptr<io::file> m_file;
|
||||
std::unordered_map<std::string, theme_template> m_themes{};
|
||||
static void copy_file(const std::filesystem::path& src, const std::filesystem::path& dst);
|
||||
static void copy_dir(const std::filesystem::path& src, const std::filesystem::path& dst);
|
||||
void copy_default_configs();
|
||||
};
|
||||
} // namespace clrsync::core
|
||||
|
||||
@@ -5,50 +5,71 @@
|
||||
|
||||
namespace clrsync::core
|
||||
{
|
||||
constexpr const char *COLOR_KEYS[] = {
|
||||
// UI / Surfaces
|
||||
"background", // main window / editor background
|
||||
"surface", // panels, cards
|
||||
"surface_variant", // alternate rows, subtle panels
|
||||
"foreground", // main text
|
||||
"foreground_secondary", // secondary text / hints
|
||||
"accent", // buttons, highlights, selection
|
||||
"outline", // borders, outlines
|
||||
"shadow", // drop shadows / depth
|
||||
"cursor", // caret / text cursor
|
||||
constexpr const char* COLOR_KEYS[] = {
|
||||
// General UI
|
||||
"background",
|
||||
"on_background",
|
||||
|
||||
// Editor-specific surfaces
|
||||
"editor_background", "sidebar_background", "popup_background", "floating_window_background",
|
||||
"menu_option_background",
|
||||
"surface",
|
||||
"on_surface",
|
||||
|
||||
// Editor text roles
|
||||
"text_main", "text_emphasis", "text_command", "text_inactive", "text_disabled",
|
||||
"text_line_number", "text_selected", "text_selection_inactive",
|
||||
"surface_variant",
|
||||
"on_surface_variant",
|
||||
|
||||
// Editor / Window borders
|
||||
"border_window", "border_focused", "border_emphasized",
|
||||
"border_focused",
|
||||
"border",
|
||||
|
||||
// Syntax highlighting
|
||||
"syntax_function", "syntax_error", "syntax_keyword", "syntax_special_keyword",
|
||||
"syntax_operator",
|
||||
"foreground",
|
||||
|
||||
// Semantic text colors
|
||||
"text_error", "text_warning", "text_link", "text_comment", "text_string", "text_success",
|
||||
"warning_emphasis", "foreground_emphasis",
|
||||
"cursor",
|
||||
"accent",
|
||||
|
||||
// Extra
|
||||
"terminal_gray",
|
||||
// Semantic
|
||||
"success",
|
||||
"info",
|
||||
"warning",
|
||||
"error",
|
||||
|
||||
// Semantic / Status
|
||||
"error", "warning", "success", "info",
|
||||
"on_success",
|
||||
"on_info",
|
||||
"on_warning",
|
||||
"on_error",
|
||||
|
||||
// Terminal colors (normal)
|
||||
"term_black", "term_red", "term_green", "term_yellow", "term_blue", "term_magenta", "term_cyan",
|
||||
"term_white",
|
||||
// Editor
|
||||
"editor_background",
|
||||
"editor_command",
|
||||
"editor_comment",
|
||||
"editor_disabled",
|
||||
"editor_emphasis",
|
||||
"editor_error",
|
||||
"editor_inactive",
|
||||
"editor_line_number",
|
||||
"editor_link",
|
||||
"editor_main",
|
||||
"editor_selected",
|
||||
"editor_selection_inactive",
|
||||
"editor_string",
|
||||
"editor_success",
|
||||
"editor_warning",
|
||||
|
||||
// Terminal colors (bright)
|
||||
"term_black_bright", "term_red_bright", "term_green_bright", "term_yellow_bright",
|
||||
"term_blue_bright", "term_magenta_bright", "term_cyan_bright", "term_white_bright"};
|
||||
// Terminal
|
||||
"base00",
|
||||
"base01",
|
||||
"base02",
|
||||
"base03",
|
||||
"base04",
|
||||
"base05",
|
||||
"base06",
|
||||
"base07",
|
||||
"base08",
|
||||
"base09",
|
||||
"base0A",
|
||||
"base0B",
|
||||
"base0C",
|
||||
"base0D",
|
||||
"base0E",
|
||||
"base0F",
|
||||
};
|
||||
|
||||
constexpr size_t NUM_COLOR_KEYS = std::size(COLOR_KEYS);
|
||||
} // namespace clrsync::core
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#define CLRSYNC_CORE_PALETTE_PALETTE_MANAGER_HPP
|
||||
|
||||
#include "core/utils.hpp"
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
#include <unordered_map>
|
||||
|
||||
@@ -19,6 +20,11 @@ template <typename FileType> class palette_manager
|
||||
void load_palettes_from_directory(const std::string &directory_path)
|
||||
{
|
||||
auto directory_path_expanded = expand_user(directory_path);
|
||||
if (!std::filesystem::exists(directory_path_expanded))
|
||||
{
|
||||
std::cerr << "Palettes directory does not exist\n" ;
|
||||
return;
|
||||
}
|
||||
for (const auto &entry : std::filesystem::directory_iterator(directory_path_expanded))
|
||||
{
|
||||
if (entry.is_regular_file())
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#include "theme_template.hpp"
|
||||
#include "core/utils.hpp"
|
||||
#include <filesystem>
|
||||
#include <format>
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
|
||||
namespace clrsync::core
|
||||
{
|
||||
@@ -45,6 +45,11 @@ void theme_template::set_output_path(const std::string &path)
|
||||
|
||||
void theme_template::load_template()
|
||||
{
|
||||
if (!std::filesystem::exists(m_template_path))
|
||||
{
|
||||
std::cerr << "Template file '" << m_template_path << "' is missing\n";
|
||||
return;
|
||||
}
|
||||
std::ifstream input(m_template_path, std::ios::binary);
|
||||
if (!input)
|
||||
throw std::runtime_error("Failed to open template file: " + m_template_path);
|
||||
|
||||
@@ -13,16 +13,12 @@ void print_color_keys()
|
||||
|
||||
std::string get_default_config_path()
|
||||
{
|
||||
auto home = expand_user("~");
|
||||
#ifdef _WIN32
|
||||
const char *appdata = std::getenv("APPDATA"); // "C:\Users\<User>\AppData\Roaming"
|
||||
if (!appdata)
|
||||
throw std::runtime_error("APPDATA environment variable not set");
|
||||
return std::string(appdata) + "\\clrsync\\config.toml";
|
||||
return home + "\\.config\\clrsync\\config.toml";
|
||||
|
||||
#else
|
||||
const char *home = std::getenv("HOME");
|
||||
if (!home)
|
||||
throw std::runtime_error("HOME environment variable not set");
|
||||
return std::string(home) + "/.config/clrsync/config.toml";
|
||||
return home + "/.config/clrsync/config.toml";
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace clrsync::core
|
||||
|
||||
constexpr uint8_t VERSION_MAJOR = 0;
|
||||
constexpr uint8_t VERSION_MINOR = 1;
|
||||
constexpr uint8_t VERSION_PATCH = 2;
|
||||
constexpr uint8_t VERSION_PATCH = 4;
|
||||
|
||||
const std::string version_string();
|
||||
} // namespace clrsync::core
|
||||
|
||||
41
src/gui/CMakeLists.txt
Normal file
41
src/gui/CMakeLists.txt
Normal file
@@ -0,0 +1,41 @@
|
||||
set(GUI_SOURCES
|
||||
main.cpp
|
||||
color_scheme_editor.cpp
|
||||
template_editor.cpp
|
||||
palette_controller.cpp
|
||||
template_controller.cpp
|
||||
imgui_helpers.cpp
|
||||
imgui_helpers.hpp
|
||||
about_window.cpp
|
||||
settings_window.cpp
|
||||
font_loader.cpp
|
||||
${CMAKE_SOURCE_DIR}/lib/color_text_edit/TextEditor.cpp
|
||||
)
|
||||
|
||||
add_executable(clrsync_gui ${GUI_SOURCES})
|
||||
|
||||
target_include_directories(clrsync_gui PRIVATE
|
||||
${CMAKE_SOURCE_DIR}/src
|
||||
SYSTEM ${CMAKE_SOURCE_DIR}/lib
|
||||
)
|
||||
|
||||
if(WIN32)
|
||||
target_link_libraries(clrsync_gui PRIVATE
|
||||
clrsync_core
|
||||
glfw
|
||||
imgui
|
||||
OpenGL::GL
|
||||
)
|
||||
else()
|
||||
target_link_libraries(clrsync_gui PRIVATE
|
||||
clrsync_core
|
||||
imgui
|
||||
${GLFW_LIBRARIES}
|
||||
${WAYLAND_LIBS}
|
||||
X11
|
||||
Xrandr
|
||||
Xi
|
||||
Fontconfig::Fontconfig
|
||||
OpenGL::GL
|
||||
)
|
||||
endif()
|
||||
@@ -2,6 +2,7 @@
|
||||
#include "template_editor.hpp"
|
||||
#include "color_text_edit/TextEditor.h"
|
||||
#include "imgui.h"
|
||||
#include <iostream>
|
||||
#include <ranges>
|
||||
|
||||
color_scheme_editor::color_scheme_editor()
|
||||
@@ -71,8 +72,20 @@ int main()
|
||||
})");
|
||||
|
||||
m_editor.SetShowWhitespaces(false);
|
||||
apply_palette_to_imgui();
|
||||
apply_palette_to_editor();
|
||||
|
||||
const auto &palettes = m_controller.palettes();
|
||||
|
||||
const auto ¤t = m_controller.current_palette();
|
||||
|
||||
if (!current.colors().empty())
|
||||
{
|
||||
apply_palette_to_imgui();
|
||||
apply_palette_to_editor();
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cout << "WARNING: No palette loaded, skipping theme application\n";
|
||||
}
|
||||
}
|
||||
|
||||
void color_scheme_editor::notify_palette_changed()
|
||||
@@ -159,6 +172,7 @@ void color_scheme_editor::render_controls()
|
||||
apply_palette_to_imgui();
|
||||
apply_palette_to_editor();
|
||||
notify_palette_changed();
|
||||
m_controller.select_palette(new_palette_name_buf);
|
||||
new_palette_name_buf[0] = 0;
|
||||
}
|
||||
ImGui::CloseCurrentPopup();
|
||||
@@ -290,40 +304,37 @@ void color_scheme_editor::render_color_table()
|
||||
ImGui::Spacing();
|
||||
};
|
||||
|
||||
draw_table("UI / Surfaces", {"background", "surface", "surface_variant", "foreground",
|
||||
"foreground_secondary", "accent", "outline", "shadow", "cursor"});
|
||||
draw_table("General UI", {"background", "on_background", "surface", "on_surface",
|
||||
"surface_variant", "on_surface_variant", "foreground",
|
||||
"cursor", "accent"});
|
||||
|
||||
draw_table("Editor Surfaces", {"editor_background", "sidebar_background", "popup_background",
|
||||
"floating_window_background", "menu_option_background"});
|
||||
draw_table("Borders", {"border_focused", "border"});
|
||||
|
||||
draw_table("Editor Text",
|
||||
{"text_main", "text_emphasis", "text_command", "text_inactive", "text_disabled",
|
||||
"text_line_number", "text_selected", "text_selection_inactive"});
|
||||
draw_table("Semantic Colors", {"success", "info", "warning", "error",
|
||||
"on_success", "on_info", "on_warning", "on_error"});
|
||||
|
||||
draw_table("Window Borders", {"border_window", "border_focused", "border_emphasized"});
|
||||
draw_table("Editor", {"editor_background", "editor_command", "editor_comment",
|
||||
"editor_disabled", "editor_emphasis", "editor_error",
|
||||
"editor_inactive", "editor_line_number", "editor_link",
|
||||
"editor_main", "editor_selected", "editor_selection_inactive",
|
||||
"editor_string", "editor_success", "editor_warning"});
|
||||
|
||||
draw_table("Syntax Highlighting", {"syntax_function", "syntax_error", "syntax_keyword",
|
||||
"syntax_special_keyword", "syntax_operator"});
|
||||
|
||||
draw_table("Semantic Text",
|
||||
{"text_error", "text_warning", "text_link", "text_comment", "text_string",
|
||||
"text_success", "warning_emphasis", "foreground_emphasis"});
|
||||
|
||||
draw_table("Extra", {"terminal_gray"});
|
||||
|
||||
draw_table("Status Colors", {"error", "warning", "success", "info"});
|
||||
|
||||
draw_table("Terminal Colors",
|
||||
{"term_black", "term_red", "term_green", "term_yellow", "term_blue", "term_magenta",
|
||||
"term_cyan", "term_white", "term_black_bright", "term_red_bright",
|
||||
"term_green_bright", "term_yellow_bright", "term_blue_bright",
|
||||
"term_magenta_bright", "term_cyan_bright", "term_white_bright"});
|
||||
draw_table("Terminal (Base16)", {"base00", "base01", "base02", "base03",
|
||||
"base04", "base05", "base06", "base07",
|
||||
"base08", "base09", "base0A", "base0B",
|
||||
"base0C", "base0D", "base0E", "base0F"});
|
||||
}
|
||||
|
||||
void color_scheme_editor::render_preview_content()
|
||||
{
|
||||
const auto ¤t = m_controller.current_palette();
|
||||
|
||||
if (current.colors().empty())
|
||||
{
|
||||
ImGui::TextColored(ImVec4(1.0f, 0.3f, 0.3f, 1.0f), "Current palette is empty");
|
||||
return;
|
||||
}
|
||||
|
||||
auto get_color = [&](const std::string &key) -> ImVec4 {
|
||||
auto it = current.colors().find(key);
|
||||
if (it != current.colors().end())
|
||||
@@ -339,7 +350,7 @@ void color_scheme_editor::render_preview_content()
|
||||
const ImVec4 editor_bg = get_color("editor_background");
|
||||
const ImVec4 fg = get_color("foreground");
|
||||
const ImVec4 accent = get_color("accent");
|
||||
const ImVec4 outline = get_color("outline");
|
||||
const ImVec4 border = get_color("border");
|
||||
const ImVec4 error = get_color("error");
|
||||
const ImVec4 warning = get_color("warning");
|
||||
const ImVec4 success = get_color("success");
|
||||
@@ -357,7 +368,7 @@ void color_scheme_editor::render_preview_content()
|
||||
|
||||
ImGui::PushStyleColor(ImGuiCol_ChildBg, editor_bg);
|
||||
ImGui::BeginChild("TerminalPreview", ImVec2(0, 0), true);
|
||||
ImGui::PushStyleColor(ImGuiCol_Border, outline);
|
||||
ImGui::PushStyleColor(ImGuiCol_Border, border);
|
||||
|
||||
struct term_line
|
||||
{
|
||||
@@ -385,9 +396,16 @@ void color_scheme_editor::render_preview_content()
|
||||
void color_scheme_editor::apply_palette_to_editor()
|
||||
{
|
||||
const auto ¤t = m_controller.current_palette();
|
||||
if (current.colors().empty())
|
||||
return;
|
||||
|
||||
auto get_color_u32 = [&](const std::string &key) -> uint32_t {
|
||||
auto get_color_u32 = [&](const std::string &key, const std::string &fallback = "") -> uint32_t {
|
||||
auto it = current.colors().find(key);
|
||||
if (it == current.colors().end() && !fallback.empty())
|
||||
{
|
||||
it = current.colors().find(fallback);
|
||||
}
|
||||
|
||||
if (it != current.colors().end())
|
||||
{
|
||||
const auto &col = it->second;
|
||||
@@ -404,32 +422,32 @@ void color_scheme_editor::apply_palette_to_editor()
|
||||
|
||||
auto palette = m_editor.GetPalette();
|
||||
|
||||
palette[int(TextEditor::PaletteIndex::Default)] = get_color_u32("text_main");
|
||||
palette[int(TextEditor::PaletteIndex::Keyword)] = get_color_u32("syntax_keyword");
|
||||
palette[int(TextEditor::PaletteIndex::Number)] = get_color_u32("text_warning");
|
||||
palette[int(TextEditor::PaletteIndex::String)] = get_color_u32("text_string");
|
||||
palette[int(TextEditor::PaletteIndex::CharLiteral)] = get_color_u32("text_string");
|
||||
palette[int(TextEditor::PaletteIndex::Punctuation)] = get_color_u32("text_main");
|
||||
palette[int(TextEditor::PaletteIndex::Preprocessor)] = get_color_u32("syntax_special_keyword");
|
||||
palette[int(TextEditor::PaletteIndex::Identifier)] = get_color_u32("text_main");
|
||||
palette[int(TextEditor::PaletteIndex::KnownIdentifier)] = get_color_u32("text_link");
|
||||
palette[int(TextEditor::PaletteIndex::PreprocIdentifier)] = get_color_u32("text_link");
|
||||
palette[int(TextEditor::PaletteIndex::Default)] = get_color_u32("editor_main");
|
||||
palette[int(TextEditor::PaletteIndex::Keyword)] = get_color_u32("editor_command");
|
||||
palette[int(TextEditor::PaletteIndex::Number)] = get_color_u32("editor_warning");
|
||||
palette[int(TextEditor::PaletteIndex::String)] = get_color_u32("editor_string");
|
||||
palette[int(TextEditor::PaletteIndex::CharLiteral)] = get_color_u32("editor_string");
|
||||
palette[int(TextEditor::PaletteIndex::Punctuation)] = get_color_u32("editor_main");
|
||||
palette[int(TextEditor::PaletteIndex::Preprocessor)] = get_color_u32("editor_emphasis");
|
||||
palette[int(TextEditor::PaletteIndex::Identifier)] = get_color_u32("editor_main");
|
||||
palette[int(TextEditor::PaletteIndex::KnownIdentifier)] = get_color_u32("editor_link");
|
||||
palette[int(TextEditor::PaletteIndex::PreprocIdentifier)] = get_color_u32("editor_link");
|
||||
|
||||
palette[int(TextEditor::PaletteIndex::Comment)] = get_color_u32("text_comment");
|
||||
palette[int(TextEditor::PaletteIndex::MultiLineComment)] = get_color_u32("text_comment");
|
||||
palette[int(TextEditor::PaletteIndex::Comment)] = get_color_u32("editor_comment");
|
||||
palette[int(TextEditor::PaletteIndex::MultiLineComment)] = get_color_u32("editor_comment");
|
||||
|
||||
palette[int(TextEditor::PaletteIndex::Background)] = get_color_u32("editor_background");
|
||||
palette[int(TextEditor::PaletteIndex::Cursor)] = get_color_u32("cursor");
|
||||
|
||||
palette[int(TextEditor::PaletteIndex::Selection)] = get_color_u32("text_selected");
|
||||
palette[int(TextEditor::PaletteIndex::ErrorMarker)] = get_color_u32("syntax_error");
|
||||
palette[int(TextEditor::PaletteIndex::Breakpoint)] = get_color_u32("syntax_error");
|
||||
palette[int(TextEditor::PaletteIndex::Selection)] = get_color_u32("editor_selected");
|
||||
palette[int(TextEditor::PaletteIndex::ErrorMarker)] = get_color_u32("editor_error");
|
||||
palette[int(TextEditor::PaletteIndex::Breakpoint)] = get_color_u32("editor_error");
|
||||
|
||||
palette[int(TextEditor::PaletteIndex::LineNumber)] = get_color_u32("text_line_number");
|
||||
palette[int(TextEditor::PaletteIndex::LineNumber)] = get_color_u32("editor_line_number");
|
||||
palette[int(TextEditor::PaletteIndex::CurrentLineFill)] = get_color_u32("surface_variant");
|
||||
palette[int(TextEditor::PaletteIndex::CurrentLineFillInactive)] = get_color_u32("surface");
|
||||
|
||||
palette[int(TextEditor::PaletteIndex::CurrentLineEdge)] = get_color_u32("border_emphasized");
|
||||
palette[int(TextEditor::PaletteIndex::CurrentLineEdge)] = get_color_u32("border_focused");
|
||||
|
||||
m_editor.SetPalette(palette);
|
||||
}
|
||||
@@ -438,43 +456,46 @@ void color_scheme_editor::apply_palette_to_imgui() const
|
||||
{
|
||||
const auto ¤t = m_controller.current_palette();
|
||||
|
||||
auto getColor = [&](const std::string &key) -> ImVec4 {
|
||||
if (current.colors().empty())
|
||||
return;
|
||||
|
||||
auto getColor = [&](const std::string &key, const std::string &fallback = "") -> ImVec4 {
|
||||
auto it = current.colors().find(key);
|
||||
if (it == current.colors().end() && !fallback.empty())
|
||||
{
|
||||
it = current.colors().find(fallback);
|
||||
}
|
||||
|
||||
if (it != current.colors().end())
|
||||
{
|
||||
const uint32_t hex = it->second.hex();
|
||||
return {((hex >> 24) & 0xFF) / 255.0f, ((hex >> 16) & 0xFF) / 255.0f,
|
||||
((hex >> 8) & 0xFF) / 255.0f, ((hex) & 0xFF) / 255.0f};
|
||||
}
|
||||
|
||||
std::cout << "WARNING: Color key '" << key << "' not found!\n";
|
||||
return {1, 1, 1, 1};
|
||||
};
|
||||
|
||||
ImGuiStyle &style = ImGui::GetStyle();
|
||||
|
||||
const ImVec4 bg = getColor("editor_background");
|
||||
const ImVec4 sidebar = getColor("sidebar_background");
|
||||
const ImVec4 popup = getColor("popup_background");
|
||||
const ImVec4 menuOpt = getColor("menu_option_background");
|
||||
|
||||
const ImVec4 bg = getColor("background");
|
||||
const ImVec4 surface = getColor("surface");
|
||||
const ImVec4 surfaceVariant = getColor("surface_variant");
|
||||
|
||||
const ImVec4 fg = getColor("text_main");
|
||||
const ImVec4 fgSecondary = getColor("text_inactive");
|
||||
|
||||
const ImVec4 fg = getColor("foreground");
|
||||
const ImVec4 fgInactive = getColor("editor_inactive");
|
||||
const ImVec4 accent = getColor("accent");
|
||||
|
||||
const ImVec4 border = getColor("border_window");
|
||||
const ImVec4 border = getColor("border");
|
||||
|
||||
style.Colors[ImGuiCol_WindowBg] = bg;
|
||||
style.Colors[ImGuiCol_ChildBg] = surface;
|
||||
style.Colors[ImGuiCol_PopupBg] = popup;
|
||||
style.Colors[ImGuiCol_PopupBg] = surface;
|
||||
|
||||
style.Colors[ImGuiCol_Border] = border;
|
||||
style.Colors[ImGuiCol_BorderShadow] = ImVec4(0, 0, 0, 0);
|
||||
|
||||
style.Colors[ImGuiCol_Text] = fg;
|
||||
style.Colors[ImGuiCol_TextDisabled] = fgSecondary;
|
||||
style.Colors[ImGuiCol_TextDisabled] = fgInactive;
|
||||
|
||||
style.Colors[ImGuiCol_Header] = surfaceVariant;
|
||||
style.Colors[ImGuiCol_HeaderHovered] = ImVec4(accent.x, accent.y, accent.z, 0.8f);
|
||||
@@ -490,9 +511,9 @@ void color_scheme_editor::apply_palette_to_imgui() const
|
||||
style.Colors[ImGuiCol_FrameBgActive] =
|
||||
ImVec4(surfaceVariant.x * 1.2f, surfaceVariant.y * 1.2f, surfaceVariant.z * 1.2f, 1.0f);
|
||||
|
||||
style.Colors[ImGuiCol_TitleBg] = sidebar;
|
||||
style.Colors[ImGuiCol_TitleBg] = surface;
|
||||
style.Colors[ImGuiCol_TitleBgActive] = surfaceVariant;
|
||||
style.Colors[ImGuiCol_TitleBgCollapsed] = sidebar;
|
||||
style.Colors[ImGuiCol_TitleBgCollapsed] = surface;
|
||||
|
||||
style.Colors[ImGuiCol_ScrollbarBg] = surface;
|
||||
style.Colors[ImGuiCol_ScrollbarGrab] = surfaceVariant;
|
||||
@@ -513,6 +534,7 @@ void color_scheme_editor::apply_palette_to_imgui() const
|
||||
style.Colors[ImGuiCol_TabActive] = surfaceVariant;
|
||||
style.Colors[ImGuiCol_TabUnfocused] = surface;
|
||||
style.Colors[ImGuiCol_TabUnfocusedActive] = surfaceVariant;
|
||||
style.Colors[ImGuiCol_TabSelectedOverline] = accent;
|
||||
|
||||
style.Colors[ImGuiCol_TableHeaderBg] = surfaceVariant;
|
||||
style.Colors[ImGuiCol_TableBorderStrong] = border;
|
||||
@@ -526,7 +548,7 @@ void color_scheme_editor::apply_palette_to_imgui() const
|
||||
style.Colors[ImGuiCol_SeparatorHovered] = accent;
|
||||
style.Colors[ImGuiCol_SeparatorActive] = accent;
|
||||
|
||||
style.Colors[ImGuiCol_MenuBarBg] = menuOpt;
|
||||
style.Colors[ImGuiCol_MenuBarBg] = surface;
|
||||
|
||||
style.Colors[ImGuiCol_DockingPreview] = ImVec4(accent.x, accent.y, accent.z, 0.7f);
|
||||
style.Colors[ImGuiCol_DockingEmptyBg] = bg;
|
||||
|
||||
@@ -87,15 +87,16 @@ void setup_main_dockspace(bool& first_time)
|
||||
ImGui::SetNextWindowViewport(viewport->ID);
|
||||
|
||||
constexpr ImGuiWindowFlags flags =
|
||||
// ImGuiWindowFlags_NoTitleBar |
|
||||
ImGuiWindowFlags_NoTitleBar |
|
||||
ImGuiWindowFlags_NoCollapse |
|
||||
ImGuiWindowFlags_NoResize |
|
||||
ImGuiWindowFlags_NoMove |
|
||||
ImGuiWindowFlags_NoBringToFrontOnFocus |
|
||||
ImGuiWindowFlags_NoNavFocus;
|
||||
ImGuiWindowFlags_NoNavFocus |
|
||||
ImGuiWindowFlags_MenuBar;
|
||||
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_WindowRounding, 1.0f);
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_WindowBorderSize, 1.0f);
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_WindowRounding, 0.0f);
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_WindowBorderSize, 0.0f);
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(0,0));
|
||||
ImGui::Begin("MainDockSpace", nullptr, flags);
|
||||
ImGui::PopStyleVar(3);
|
||||
@@ -110,20 +111,23 @@ void setup_main_dockspace(bool& first_time)
|
||||
ImGui::DockBuilderAddNode(dockspace_id, ImGuiDockNodeFlags_DockSpace);
|
||||
ImGui::DockBuilderSetNodeSize(dockspace_id, viewport->Size);
|
||||
|
||||
ImGuiID left, right;
|
||||
ImGui::DockBuilderSplitNode(dockspace_id, ImGuiDir_Left, 0.45f, &left, &right);
|
||||
ImGuiID center, right;
|
||||
ImGui::DockBuilderSplitNode(dockspace_id, ImGuiDir_Right, 0.5f, &right, ¢er);
|
||||
|
||||
ImGuiID right_top, right_bottom;
|
||||
ImGui::DockBuilderSplitNode(right, ImGuiDir_Up, 0.6f, &right_top, &right_bottom);
|
||||
ImGuiDockNode* center_node = ImGui::DockBuilderGetNode(center);
|
||||
if (center_node)
|
||||
{
|
||||
center_node->LocalFlags |= ImGuiDockNodeFlags_CentralNode;
|
||||
}
|
||||
|
||||
ImGui::DockBuilderDockWindow("Templates", left);
|
||||
ImGui::DockBuilderDockWindow("Color Schemes", right_top);
|
||||
ImGui::DockBuilderDockWindow("Color Preview", right_bottom);
|
||||
ImGui::DockBuilderDockWindow("Color Schemes", right);
|
||||
ImGui::DockBuilderDockWindow("Templates", center);
|
||||
ImGui::DockBuilderDockWindow("Color Preview", center);
|
||||
|
||||
ImGui::DockBuilderFinish(dockspace_id);
|
||||
}
|
||||
|
||||
ImGui::DockSpace(dockspace_id, ImVec2{0,0});
|
||||
ImGui::DockSpace(dockspace_id, ImVec2{0,0}, ImGuiDockNodeFlags_None);
|
||||
ImGui::End();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
#include <memory>
|
||||
|
||||
#include <GLFW/glfw3.h>
|
||||
#include <GLFW/glfw3native.h>
|
||||
|
||||
|
||||
#include "core/config/config.hpp"
|
||||
#include "core/io/toml_file.hpp"
|
||||
@@ -27,6 +29,18 @@ int main(int, char**)
|
||||
GLFWwindow* window = init_glfw();
|
||||
if (!window) return 1;
|
||||
|
||||
printf("GLFV Version: %s\n", glfwGetVersionString());
|
||||
|
||||
std::cout << "GLFW runtime platform: ";
|
||||
switch (glfwGetPlatform()) {
|
||||
case GLFW_PLATFORM_WAYLAND: std::cout << "Wayland\n"; break;
|
||||
case GLFW_PLATFORM_X11: std::cout << "X11\n"; break;
|
||||
case GLFW_PLATFORM_COCOA: std::cout << "Cocoa\n"; break;
|
||||
case GLFW_PLATFORM_WIN32: std::cout << "Win32\n"; break;
|
||||
default: std::cout << "Unknown\n";
|
||||
}
|
||||
|
||||
|
||||
init_imgui(window, ini_path);
|
||||
|
||||
font_loader loader;
|
||||
|
||||
@@ -28,14 +28,9 @@ void palette_controller::select_palette(const std::string& name)
|
||||
|
||||
void palette_controller::create_palette(const std::string& name)
|
||||
{
|
||||
clrsync::core::palette new_palette = m_current_palette;
|
||||
clrsync::core::palette new_palette = m_palette_manager.load_palette_from_file(clrsync::core::config::get_data_dir().string() + "/palettes/cursed.toml");
|
||||
new_palette.set_name(name);
|
||||
|
||||
auto colors = m_current_palette.colors();
|
||||
for (auto& pair : colors) {
|
||||
new_palette.set_color(pair.first, pair.second);
|
||||
}
|
||||
|
||||
|
||||
auto dir = clrsync::core::config::instance().palettes_path();
|
||||
m_palette_manager.save_palette_to_file(new_palette, dir);
|
||||
|
||||
|
||||
@@ -6,35 +6,42 @@
|
||||
#include <fstream>
|
||||
#include <ranges>
|
||||
|
||||
template_editor::template_editor()
|
||||
: m_template_name("new_template")
|
||||
template_editor::template_editor() : m_template_name("new_template")
|
||||
{
|
||||
TextEditor::LanguageDefinition lang;
|
||||
lang.mName = "Template";
|
||||
|
||||
|
||||
lang.mCommentStart = "/*";
|
||||
lang.mCommentEnd = "*/";
|
||||
lang.mSingleLineComment = "#";
|
||||
|
||||
|
||||
lang.mTokenRegexStrings.push_back(std::make_pair<std::string, TextEditor::PaletteIndex>(
|
||||
"\\{[a-zA-Z_][a-zA-Z0-9_]*(\\.[a-zA-Z_][a-zA-Z0-9_]*)?\\}",
|
||||
"\\{[a-zA-Z_][a-zA-Z0-9_]*(\\.[a-zA-Z_][a-zA-Z0-9_]*)?\\}",
|
||||
TextEditor::PaletteIndex::KnownIdentifier));
|
||||
|
||||
|
||||
lang.mTokenRegexStrings.push_back(std::make_pair<std::string, TextEditor::PaletteIndex>(
|
||||
"\"([^\"]*)\"", TextEditor::PaletteIndex::String));
|
||||
lang.mTokenRegexStrings.push_back(std::make_pair<std::string, TextEditor::PaletteIndex>(
|
||||
"'([^']*)'", TextEditor::PaletteIndex::String));
|
||||
|
||||
|
||||
m_editor.SetLanguageDefinition(lang);
|
||||
m_editor.SetText("# Enter your template here\n# Use {color_key} for color variables\n# Examples: {color.hex}, {color.rgb}, {color.r}\n\n");
|
||||
m_editor.SetText("# Enter your template here\n# Use {color_key} for color variables\n# "
|
||||
"Examples: {color.hex}, {color.rgb}, {color.r}\n\n");
|
||||
m_editor.SetShowWhitespaces(false);
|
||||
}
|
||||
|
||||
void template_editor::apply_current_palette(const clrsync::core::palette& pal)
|
||||
void template_editor::apply_current_palette(const clrsync::core::palette &pal)
|
||||
{
|
||||
auto colors = pal.colors();
|
||||
auto get_color_u32 = [&](const std::string &key) -> uint32_t {
|
||||
if (colors.empty())
|
||||
return;
|
||||
auto get_color_u32 = [&](const std::string &key, const std::string &fallback = "") -> uint32_t {
|
||||
auto it = colors.find(key);
|
||||
if (it == colors.end() && !fallback.empty())
|
||||
{
|
||||
it = colors.find(fallback);
|
||||
}
|
||||
|
||||
if (it != colors.end())
|
||||
{
|
||||
const auto &col = it->second;
|
||||
@@ -48,36 +55,45 @@ void template_editor::apply_current_palette(const clrsync::core::palette& pal)
|
||||
}
|
||||
return 0xFFFFFFFF;
|
||||
};
|
||||
|
||||
|
||||
auto palette = m_editor.GetPalette();
|
||||
|
||||
palette[int(TextEditor::PaletteIndex::Default)] = get_color_u32("text_main");
|
||||
palette[int(TextEditor::PaletteIndex::Keyword)] = get_color_u32("syntax_keyword");
|
||||
palette[int(TextEditor::PaletteIndex::Number)] = get_color_u32("text_warning");
|
||||
palette[int(TextEditor::PaletteIndex::String)] = get_color_u32("text_string");
|
||||
palette[int(TextEditor::PaletteIndex::CharLiteral)] = get_color_u32("text_string");
|
||||
palette[int(TextEditor::PaletteIndex::Punctuation)] = get_color_u32("text_main");
|
||||
palette[int(TextEditor::PaletteIndex::Preprocessor)] = get_color_u32("syntax_special_keyword");
|
||||
palette[int(TextEditor::PaletteIndex::Identifier)] = get_color_u32("text_main");
|
||||
palette[int(TextEditor::PaletteIndex::KnownIdentifier)] = get_color_u32("text_link");
|
||||
palette[int(TextEditor::PaletteIndex::PreprocIdentifier)] = get_color_u32("text_link");
|
||||
|
||||
palette[int(TextEditor::PaletteIndex::Comment)] = get_color_u32("text_comment");
|
||||
palette[int(TextEditor::PaletteIndex::MultiLineComment)] = get_color_u32("text_comment");
|
||||
|
||||
palette[int(TextEditor::PaletteIndex::Background)] = get_color_u32("editor_background");
|
||||
palette[int(TextEditor::PaletteIndex::Cursor)] = get_color_u32("cursor");
|
||||
|
||||
palette[int(TextEditor::PaletteIndex::Selection)] = get_color_u32("text_selected");
|
||||
palette[int(TextEditor::PaletteIndex::ErrorMarker)] = get_color_u32("syntax_error");
|
||||
palette[int(TextEditor::PaletteIndex::Breakpoint)] = get_color_u32("syntax_error");
|
||||
|
||||
palette[int(TextEditor::PaletteIndex::LineNumber)] = get_color_u32("text_line_number");
|
||||
|
||||
palette[int(TextEditor::PaletteIndex::Default)] = get_color_u32("editor_main", "foreground");
|
||||
palette[int(TextEditor::PaletteIndex::Keyword)] = get_color_u32("editor_command", "accent");
|
||||
palette[int(TextEditor::PaletteIndex::Number)] = get_color_u32("editor_warning", "warning");
|
||||
palette[int(TextEditor::PaletteIndex::String)] = get_color_u32("editor_string", "success");
|
||||
palette[int(TextEditor::PaletteIndex::CharLiteral)] = get_color_u32("editor_string", "success");
|
||||
palette[int(TextEditor::PaletteIndex::Punctuation)] =
|
||||
get_color_u32("editor_main", "foreground");
|
||||
palette[int(TextEditor::PaletteIndex::Preprocessor)] =
|
||||
get_color_u32("editor_emphasis", "accent");
|
||||
palette[int(TextEditor::PaletteIndex::Identifier)] = get_color_u32("editor_main", "foreground");
|
||||
palette[int(TextEditor::PaletteIndex::KnownIdentifier)] = get_color_u32("editor_link", "info");
|
||||
palette[int(TextEditor::PaletteIndex::PreprocIdentifier)] =
|
||||
get_color_u32("editor_link", "info");
|
||||
|
||||
palette[int(TextEditor::PaletteIndex::Comment)] =
|
||||
get_color_u32("editor_comment", "editor_inactive");
|
||||
palette[int(TextEditor::PaletteIndex::MultiLineComment)] =
|
||||
get_color_u32("editor_comment", "editor_inactive");
|
||||
|
||||
palette[int(TextEditor::PaletteIndex::Background)] =
|
||||
get_color_u32("editor_background", "background");
|
||||
palette[int(TextEditor::PaletteIndex::Cursor)] = get_color_u32("cursor", "accent");
|
||||
|
||||
palette[int(TextEditor::PaletteIndex::Selection)] =
|
||||
get_color_u32("editor_selected", "surface_variant");
|
||||
palette[int(TextEditor::PaletteIndex::ErrorMarker)] = get_color_u32("editor_error", "error");
|
||||
palette[int(TextEditor::PaletteIndex::Breakpoint)] = get_color_u32("editor_error", "error");
|
||||
|
||||
palette[int(TextEditor::PaletteIndex::LineNumber)] =
|
||||
get_color_u32("editor_line_number", "editor_inactive");
|
||||
palette[int(TextEditor::PaletteIndex::CurrentLineFill)] = get_color_u32("surface_variant");
|
||||
palette[int(TextEditor::PaletteIndex::CurrentLineFillInactive)] = get_color_u32("surface");
|
||||
|
||||
palette[int(TextEditor::PaletteIndex::CurrentLineEdge)] = get_color_u32("border_emphasized");
|
||||
|
||||
|
||||
palette[int(TextEditor::PaletteIndex::CurrentLineEdge)] =
|
||||
get_color_u32("border_focused", "border");
|
||||
|
||||
m_editor.SetPalette(palette);
|
||||
}
|
||||
|
||||
@@ -112,6 +128,12 @@ void template_editor::render_controls()
|
||||
new_template();
|
||||
}
|
||||
|
||||
if (ImGui::IsWindowFocused(ImGuiFocusedFlags_RootAndChildWindows) &&
|
||||
ImGui::IsKeyDown(ImGuiKey_LeftCtrl) && ImGui::IsKeyPressed(ImGuiKey_S))
|
||||
{
|
||||
save_template();
|
||||
}
|
||||
|
||||
ImGui::SameLine();
|
||||
if (ImGui::Button("Save"))
|
||||
{
|
||||
@@ -192,7 +214,23 @@ void template_editor::render_editor()
|
||||
}
|
||||
else
|
||||
{
|
||||
ImGui::Text("Editing: %s", m_template_name.c_str());
|
||||
ImGui::Text("%s", m_template_name.c_str());
|
||||
auto trim_right = [](const std::string &s) -> std::string {
|
||||
size_t end = s.find_last_not_of("\r\n");
|
||||
return (end == std::string::npos) ? "" : s.substr(0, end + 1);
|
||||
};
|
||||
|
||||
std::string current_content = trim_right(m_editor.GetText());
|
||||
std::string saved_content = trim_right(m_saved_content);
|
||||
|
||||
m_has_unsaved_changes = (current_content != saved_content);
|
||||
if (m_has_unsaved_changes)
|
||||
{
|
||||
ImGui::SameLine();
|
||||
ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(1.0f, 0.6f, 0.2f, 1.0f));
|
||||
ImGui::Text("●");
|
||||
ImGui::PopStyleColor();
|
||||
}
|
||||
}
|
||||
|
||||
ImGui::Separator();
|
||||
@@ -346,6 +384,8 @@ void template_editor::save_template()
|
||||
m_template_name = trimmed_name;
|
||||
m_output_path = trimmed_path;
|
||||
m_is_editing_existing = true;
|
||||
m_saved_content = m_editor.GetText();
|
||||
m_has_unsaved_changes = false;
|
||||
|
||||
refresh_templates();
|
||||
}
|
||||
@@ -382,8 +422,10 @@ void template_editor::load_template(const std::string &name)
|
||||
content += line + "\n";
|
||||
}
|
||||
in.close();
|
||||
|
||||
|
||||
m_editor.SetText(content);
|
||||
m_saved_content = content;
|
||||
m_has_unsaved_changes = false;
|
||||
}
|
||||
}
|
||||
catch (const std::exception &e)
|
||||
@@ -396,12 +438,17 @@ void template_editor::load_template(const std::string &name)
|
||||
void template_editor::new_template()
|
||||
{
|
||||
m_template_name = "new_template";
|
||||
m_editor.SetText("# Enter your template here\n# Use {color_key} for color variables\n# Examples: {color.hex}, {color.rgb}, {color.r}\n\n");
|
||||
std::string default_content =
|
||||
"# Enter your template here\n# Use {color_key} for color variables\n# "
|
||||
"Examples: {color.hex}, {color.rgb}, {color.r}\n\n";
|
||||
m_editor.SetText(default_content);
|
||||
m_saved_content = default_content;
|
||||
m_output_path = "";
|
||||
m_reload_command = "";
|
||||
m_enabled = true;
|
||||
m_is_editing_existing = false;
|
||||
m_validation_error = "";
|
||||
m_has_unsaved_changes = false;
|
||||
}
|
||||
|
||||
void template_editor::refresh_templates()
|
||||
|
||||
@@ -32,6 +32,8 @@ private:
|
||||
std::string m_output_path;
|
||||
std::string m_reload_command;
|
||||
std::string m_validation_error;
|
||||
std::string m_saved_content;
|
||||
bool m_has_unsaved_changes = false;
|
||||
|
||||
bool m_enabled{true};
|
||||
bool m_is_editing_existing{false};
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
[wrap-file]
|
||||
directory = freetype-2.14.1
|
||||
source_url = https://download.savannah.gnu.org/releases/freetype/freetype-2.14.1.tar.xz
|
||||
source_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/freetype2_2.14.1-1/freetype-2.14.1.tar.xz
|
||||
source_filename = freetype-2.14.1.tar.xz
|
||||
source_hash = 32427e8c471ac095853212a37aef816c60b42052d4d9e48230bab3bdf2936ccc
|
||||
wrapdb_version = 2.14.1-1
|
||||
|
||||
[provide]
|
||||
dependency_names = freetype2
|
||||
@@ -1,13 +0,0 @@
|
||||
[wrap-file]
|
||||
directory = glfw-3.4
|
||||
source_url = https://github.com/glfw/glfw/archive/refs/tags/3.4.tar.gz
|
||||
source_filename = glfw-3.4.tar.gz
|
||||
source_hash = c038d34200234d071fae9345bc455e4a8f2f544ab60150765d7704e08f3dac01
|
||||
patch_filename = glfw_3.4-1_patch.zip
|
||||
patch_url = https://wrapdb.mesonbuild.com/v2/glfw_3.4-1/get_patch
|
||||
patch_hash = 58a6a6cdb28195d7f7e6f5de85dff7044d378e49b46bf1d4a9b04c97ed93e6b0
|
||||
source_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/glfw_3.4-1/glfw-3.4.tar.gz
|
||||
wrapdb_version = 3.4-1
|
||||
|
||||
[provide]
|
||||
glfw3 = glfw_dep
|
||||
@@ -1,2 +0,0 @@
|
||||
[wrap-redirect]
|
||||
filename = freetype-2.14.1/subprojects/libpng.wrap
|
||||
Reference in New Issue
Block a user