commit 7e0c3d136e2189322ffb70db799540ebdfca3db0 Author: ivaquero Date: Sun Jul 30 12:34:38 2023 +0800 build: 🎉 begin! diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..271ec6d --- /dev/null +++ b/.gitignore @@ -0,0 +1,1135 @@ +* +!*.* +!*/ + +### C ### +# Prerequisites +*.d + +# Object files +*.o +*.ko +*.obj +*.elf + +# Linker output +*.ilk +*.map +*.exp + +# Precompiled Headers +*.gch +*.pch + +# Libraries +*.lib +*.a +*.la +*.lo + +# Shared objects (inc. Windows DLLs) +*.dll +*.so +*.so.* +*.dylib + +# Executables +*.exe +*.out +*.app +*.i*86 +*.x86_64 +*.hex + +# Debug files +*.dSYM/ +*.su +*.idb +*.pdb + +# Kernel Module Compile Results +*.mod* +*.cmd +.tmp_versions/ +modules.order +Module.symvers +Mkfile.old +dkms.conf + +### C++ ### +# Prerequisites + +# Compiled Object files +*.slo + +# Precompiled Headers + +# Compiled Dynamic libraries + +# Fortran module files +*.mod +*.smod + +# Compiled Static libraries +*.lai + +# Executables + +## Various built-in generators +# cmake_find_package generator https://docs.conan.io/en/latest/reference/generators/cmake_find_package.html +Find*.cmake + +# cmake_paths generator https://docs.conan.io/en/1.4/integrations/cmake/cmake_paths_generator.html +conan_paths.* + +# Environment activation scripts produced by https://docs.conan.io/en/latest/mastering/virtualenv.html#virtualenv-generator +activate_run.ps1 +activate_run.sh +deactivate_run.ps1 +deactivate_run.sh +environment_run.ps1.env +environment_run.sh.env + +### Homebrew ### +Brewfile.lock.json + +### Julia ### +# Files generated by invoking Julia with --code-coverage +*.jl.cov +*.jl.*.cov + +# Files generated by invoking Julia with --track-allocation +*.jl.mem + +# System-specific files and directories generated by the BinaryProvider and BinDeps packages +# They contain absolute paths specific to the host computer, and so should not be committed +deps/deps.jl +deps/build.log +deps/downloads/ +deps/usr/ +deps/src/ + +# Build artifacts for creating documentation generated by the Documenter package +docs/build/ +docs/site/ + +# File generated by Pkg, the package manager, based on a corresponding Project.toml +# It records a fixed state of all packages used by the project. As such, it should not be +# committed for packages, but should be committed for applications that require a static +# environment. +Manifest.toml + +### JupyterNotebooks ### +# gitignore template for Jupyter Notebooks +# website: http://jupyter.org/ + +.ipynb_checkpoints +*/.ipynb_checkpoints/* + +# IPython +profile_default/ +ipython_config.py + +# Remove previous ipynb_checkpoints +# git rm -r .ipynb_checkpoints/ + +### macOS ### +# General +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +### macOS Patch ### +# iCloud generated files +*.icloud + +### Node ### +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +lerna-debug.log* +.pnpm-debug.log* + +# Diagnostic reports (https://nodejs.org/api/report.html) +report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json + +# Runtime data +pids +*.pid +*.seed +*.pid.lock + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage +*.lcov + +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Bower dependency directory (https://bower.io/) +bower_components + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (https://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +node_modules/ +jspm_packages/ + +# Snowpack dependency directory (https://snowpack.dev/) +web_modules/ + +# TypeScript cache +*.tsbuildinfo + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# Optional stylelint cache +.stylelintcache + +# Microbundle cache +.rpt2_cache/ +.rts2_cache_cjs/ +.rts2_cache_es/ +.rts2_cache_umd/ + +# Optional REPL history +.node_repl_history + +# Output of 'npm pack' +*.tgz + +# Yarn Integrity file +.yarn-integrity + +# dotenv environment variable files +.env +.env.development.local +.env.test.local +.env.production.local +.env.local + +# parcel-bundler cache (https://parceljs.org/) +.cache +.parcel-cache + +# Next.js build output +.next +out + +# Nuxt.js build / generate output +.nuxt +dist + +# Gatsby files +.cache/ +# Comment in the public line in if your project uses Gatsby and not Next.js +# https://nextjs.org/blog/next-9-1#public-directory-support +# public + +# vuepress build output +.vuepress/dist + +# vuepress v2.x temp and cache directory +.temp + +# Docusaurus cache and generated files +.docusaurus + +# Serverless directories +.serverless/ + +# FuseBox cache +.fusebox/ + +# DynamoDB Local files +.dynamodb/ + +# TernJS port file +.tern-port + +# Stores VSCode versions used for testing VSCode extensions +.vscode-test + +# yarn v2 +.yarn/cache +.yarn/unplugged +.yarn/build-state.yml +.yarn/install-state.gz +.pnp.* + +### Node Patch ### +# Serverless Webpack directories +.webpack/ + +# Optional stylelint cache + +# SvelteKit build / generate output +.svelte-kit + +### NodeChakraTimeTravelDebug ### +# gitignore template for NodeChakra Time Travel Debug +# website: https://marketplace.visualstudio.com/items?itemName=ttd-trace-tools.node-chakracore-time-travel-debugger + +# Ignore time-travel trace files +# https://github.com/mrkmarron/node-chakracore-time-travel-debugger#notes +_ttd_log_ + +### Nuxtjs ### +# Nuxt build + +# Nuxt generate + +### PyCharm ### +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider +# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 + +# User-specific stuff +.idea/**/workspace.xml +.idea/**/tasks.xml +.idea/**/usage.statistics.xml +.idea/**/dictionaries +.idea/**/shelf + +# AWS User-specific +.idea/**/aws.xml + +# Generated files +.idea/**/contentModel.xml + +# Sensitive or high-churn files +.idea/**/dataSources/ +.idea/**/dataSources.ids +.idea/**/dataSources.local.xml +.idea/**/sqlDataSources.xml +.idea/**/dynamic.xml +.idea/**/uiDesigner.xml +.idea/**/dbnavigator.xml + +# Gradle +.idea/**/gradle.xml +.idea/**/libraries + +# Gradle and Maven with auto-import +# When using Gradle or Maven with auto-import, you should exclude module files, +# since they will be recreated, and may cause churn. Uncomment if using +# auto-import. +# .idea/artifacts +# .idea/compiler.xml +# .idea/jarRepositories.xml +# .idea/modules.xml +# .idea/*.iml +# .idea/modules +# *.iml +# *.ipr + +# CMake +cmake-build-*/ + +# Mongo Explorer plugin +.idea/**/mongoSettings.xml + +# File-based project format +*.iws + +# IntelliJ +out/ + +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Cursive Clojure plugin +.idea/replstate.xml + +# SonarLint plugin +.idea/sonarlint/ + +# Crashlytics plugin (for Android Studio and IntelliJ) +com_crashlytics_export_strings.xml +crashlytics.properties +crashlytics-build.properties +fabric.properties + +# Editor-based Rest Client +.idea/httpRequests + +# Android studio 3.1+ serialized cache file +.idea/caches/build_file_checksums.ser + +### PyCharm Patch ### +# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721 + +# *.iml +# modules.xml +# .idea/misc.xml +# *.ipr + +# Sonarlint plugin +# https://plugins.jetbrains.com/plugin/7973-sonarlint +.idea/**/sonarlint/ + +# SonarQube Plugin +# https://plugins.jetbrains.com/plugin/7238-sonarqube-community-plugin +.idea/**/sonarIssues.xml + +# Markdown Navigator plugin +# https://plugins.jetbrains.com/plugin/7896-markdown-navigator-enhanced +.idea/**/markdown-navigator.xml +.idea/**/markdown-navigator-enh.xml +.idea/**/markdown-navigator/ + +# Cache file creation bug +# See https://youtrack.jetbrains.com/issue/JBR-2257 +.idea/$CACHE_FILE$ + +# CodeStream plugin +# https://plugins.jetbrains.com/plugin/12206-codestream +.idea/codestream.xml + +# Azure Toolkit for IntelliJ plugin +# https://plugins.jetbrains.com/plugin/8053-azure-toolkit-for-intellij +.idea/**/azureSettings.xml + +### PyCharm+all ### +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider +# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 + +# User-specific stuff + +# AWS User-specific + +# Generated files + +# Sensitive or high-churn files + +# Gradle + +# Gradle and Maven with auto-import +# When using Gradle or Maven with auto-import, you should exclude module files, +# since they will be recreated, and may cause churn. Uncomment if using +# auto-import. +# .idea/artifacts +# .idea/compiler.xml +# .idea/jarRepositories.xml +# .idea/modules.xml +# .idea/*.iml +# .idea/modules +# *.iml +# *.ipr + +# CMake + +# Mongo Explorer plugin + +# File-based project format + +# IntelliJ + +# mpeltonen/sbt-idea plugin + +# JIRA plugin + +# Cursive Clojure plugin + +# SonarLint plugin + +# Crashlytics plugin (for Android Studio and IntelliJ) + +# Editor-based Rest Client + +# Android studio 3.1+ serialized cache file + +### PyCharm+all Patch ### +# Ignore everything but code style settings and run configurations +# that are supposed to be shared within teams. + +.idea/* + +!.idea/codeStyles +!.idea/runConfigurations + +### PyCharm+iml ### +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider +# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 + +# User-specific stuff + +# AWS User-specific + +# Generated files + +# Sensitive or high-churn files + +# Gradle + +# Gradle and Maven with auto-import +# When using Gradle or Maven with auto-import, you should exclude module files, +# since they will be recreated, and may cause churn. Uncomment if using +# auto-import. +# .idea/artifacts +# .idea/compiler.xml +# .idea/jarRepositories.xml +# .idea/modules.xml +# .idea/*.iml +# .idea/modules +# *.iml +# *.ipr + +# CMake + +# Mongo Explorer plugin + +# File-based project format + +# IntelliJ + +# mpeltonen/sbt-idea plugin + +# JIRA plugin + +# Cursive Clojure plugin + +# SonarLint plugin + +# Crashlytics plugin (for Android Studio and IntelliJ) + +# Editor-based Rest Client + +# Android studio 3.1+ serialized cache file + +### PyCharm+iml Patch ### +# Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-249601023 + +*.iml +modules.xml +.idea/misc.xml +*.ipr + +### pydev ### +.pydevproject + +### Python ### +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions + +# Distribution / packaging +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +share/python-wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.nox/ +.coverage +.coverage.* +nosetests.xml +coverage.xml +*.cover +*.py,cover +.hypothesis/ +.pytest_cache/ +cover/ + +# Translations +*.mo +*.pot + +# Django stuff: +local_settings.py +db.sqlite3 +db.sqlite3-journal + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +.pybuilder/ +target/ + +# Jupyter Notebook + +# IPython + +# pyenv +# For a library or package, you might want to ignore these files since the code is +# intended to run in multiple environments; otherwise, check them in: +# .python-version + +# pipenv +# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. +# However, in case of collaboration, if having platform-specific dependencies or dependencies +# having no cross-platform support, pipenv may install dependencies that don't work, or not +# install all needed dependencies. +#Pipfile.lock + +# poetry +# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control. +# This is especially recommended for binary packages to ensure reproducibility, and is more +# commonly ignored for libraries. +# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control +#poetry.lock + +# pdm +# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control. +#pdm.lock +# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it +# in version control. +# https://pdm.fming.dev/#use-with-ide +.pdm.toml + +# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm +__pypackages__/ + +# Celery stuff +celerybeat-schedule +celerybeat.pid + +# SageMath parsed files +*.sage.py + +# Environments +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ +.dmypy.json +dmypy.json + +# Pyre type checker +.pyre/ + +# pytype static type analyzer +.pytype/ + +# Cython debug symbols +cython_debug/ + +# PyCharm +# JetBrains specific template is maintained in a separate JetBrains.gitignore that can +# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore +# and can be added to the global gitignore or merged into this file. For a more nuclear +# option (not recommended) you can uncomment the following to ignore the entire idea folder. +#.idea/ + +### Python Patch ### +# Poetry local configuration file - https://python-poetry.org/docs/configuration/#local-configuration +poetry.toml + +### Rust ### +# Generated by Cargo +# will have compiled files and executables +debug/ + +# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries +# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html +Cargo.lock + +# These are backup files generated by rustfmt +**/*.rs.bk + +# MSVC Windows builds of rustc generate these, which store debugging information + +### StorybookJs ### +# gitignore template for the Storybook, UI guide for front apps +# website: https://storybook.js.org/ + +storybook-static/ + +### Vim ### +# Swap +[._]*.s[a-v][a-z] +!*.svg # comment out if you don't need vector files +[._]*.sw[a-p] +[._]s[a-rt-v][a-z] +[._]ss[a-gi-z] +[._]sw[a-p] + +# Session +Session.vim +Sessionx.vim + +# Temporary +.netrwhist +*~ +# Auto-generated tag files +tags +# Persistent undo +[._]*.un~ + +### vs ### +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Mono auto generated files +mono_crash.* + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ +[Ll]ogs/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUnit +*.VisualState.xml +TestResult.xml +nunit-*.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.meta +*.iobj +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Coverlet is a free, cross platform Code Coverage Tool +coverage*[.json, .xml, .info] + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# NuGet Symbol Packages +*.snupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx +*.appxbundle +*.appxupload + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- [Bb]ackup.rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# BeatPulse healthcheck temp database +healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# Ionide (cross platform F# VS Code tools) working folder +.ionide/ + +### Vue ### +# gitignore template for Vue.js projects +# +# Recommended template: Node.gitignore + +# TODO: where does this rule come from? +docs/_book + +# TODO: where does this rule come from? +test/ + +### Vuejs ### +# Recommended template: Node.gitignore + +npm-debug.log +yarn-error.log + +### yarn ### +# https://yarnpkg.com/getting-started/qa#which-files-should-be-gitignored + +.yarn/* +!.yarn/releases +!.yarn/patches +!.yarn/plugins +!.yarn/sdks +!.yarn/versions + +# if you are NOT using Zero-installs, then: +# comment the following lines +!.yarn/cache + +# and uncomment the following lines +# .pnp.* + +.vscode +*.pdf +*/*.pdf +*/test.* +*/.obsidian/* diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..0b71fc7 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,25 @@ +cmake_minimum_required(VERSION 3.5) +project(clock) + +set(CMAKE_AUTOUIC ON) +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_STANDARD_REQUIRED ON) +set(CMAKE_PREFIX_PATH "/opt/homebrew/opt/qt@5") + +find_package(Qt5 COMPONENTS Core Gui Widgets REQUIRED) + +include_directories( + . +) + +set (SRCS + clock.cpp + clock.h + main.cpp +) + +add_executable(${CMAKE_PROJECT_NAME} ${SRCS}) + +target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE Qt5::Core Qt5::Gui Qt5::Widgets) diff --git a/README.md b/README.md new file mode 100644 index 0000000..21140df --- /dev/null +++ b/README.md @@ -0,0 +1,39 @@ +# ⏰ Floating Clock + +![code size](https://img.shields.io/github/languages/code-size/ivaquero/floating-clock.svg) +![repo size](https://img.shields.io/github/repo-size/ivaquero/floating-clock.svg) + +This project aims to build a cross-platform floating clock based on PySide6 & Qt5. + +## Motivation + +When coding in full screen mode, I often forget the time. +When on macOS / Linux, the clock on the menu bar is too small to be noticeable, so is the clock on Windows. + +![clock](clock.png) + +## Roadmap + +- [ ] Main Window + - [x] Frameless + - [x] Drag and Move + - [x] Right Click Menu + - [x] Always On Top + - [ ] Show in Fullscreen Mode +- [x] Font + - [x] Set Color + - [x] Set Background Color + - [x] Change Size +- [x] Configuratin File + - [x] Read Settings + - [x] Write Settings + - [x] Reset Settings +- [ ] Time + - [ ] Select Time Zone + - [ ] Set Alarms + +## For Testing + +```python +python -m pip install -r requirements.txt +``` diff --git a/clock.cpp b/clock.cpp new file mode 100644 index 0000000..e1ae518 --- /dev/null +++ b/clock.cpp @@ -0,0 +1,169 @@ +#include "clock.h" + +Clock::Clock(QWidget *parent) : QWidget{parent}, pressed(false) { + + // geometry of Main Window (x, y, width, height) + setGeometry(1100, 800, 180, 60); + + // hide frame + setWindowFlag(Qt::WindowStaysOnTopHint, true); + setWindowFlag(Qt::FramelessWindowHint, true); + setAttribute(Qt::WA_TranslucentBackground); + + // clock object + QTimer *clock = new QTimer(this); + connect(clock, &QTimer::timeout, this, &Clock::showTime); + clock->start(1000); // update the clock per second + show(); + + settings = new QSettings( + QString("%1/config.ini").arg(QCoreApplication::applicationDirPath()), + QSettings::IniFormat); + + font = QFont(); + font.setFamily(settings->value("USER/FONT_FAMILY").toString()); + font.setPointSize(settings->value("USER/FONT_SIZE").toInt()); + + // load settings + settings = new QSettings( + QString("%1/config.ini").arg(QCoreApplication::applicationDirPath()), + QSettings::IniFormat); + + // font object + font = QFont(); + font.setFamily(settings->value("DEFAULT/FONT_FAMILY").toString()); + font_size_step = settings->value("USER/FONT_SIZE_STEP").toInt(); + + // label object + label = new QLabel(); + label->setAlignment(Qt::AlignCenter); + + // layout + QVBoxLayout *layout = new QVBoxLayout(this); + layout->addWidget(label); + setLayout(layout); + + reloadUI(); +} + +void Clock::showTime() { + QString current_time = QTime::currentTime().toString("hh:mm"); + label->setText(current_time); +} + +void Clock::reloadUI() { + font_size = settings->value("USER/FONT_SIZE").toInt(); + font.setPointSize(font_size); + label->setFont(font); + label->setStyleSheet(QString("color: %1; background-color: %2") + .arg(settings->value("USER/FONT_COLOR").toString(), + settings->value("USER/BG_COLOR").toString())); +} + +void Clock::resetUI() { + QString default_bg_color = settings->value("DEFAULT/BG_COLOR").toString(); + QString default_font_color = settings->value("DEFAULT/FONT_COLOR").toString(); + QString default_font_size = settings->value("DEFAULT/FONT_SIZE").toString(); + + settings->setValue("USER/BG_COLOR", default_bg_color); + settings->setValue("USER/FONT_COLOR", default_font_color); + settings->setValue("USER/FONT_SIZE", default_font_size); + + reloadUI(); +} + +void Clock::increaseFontSize() { + font_size += font_size_step; + changeFontSize(); +} + +void Clock::decreaseFontSize() { + font_size -= font_size_step; + changeFontSize(); +} + +void Clock::changeFontSize() { + font.setPointSize(font_size); + label->setFont(font); +} + +void Clock::setFontColor(const QString &color) { + settings->setValue("USER/FONT_COLOR", color); + reloadUI(); +} + +void Clock::setBackgroundColor(const QString &color) { + settings->setValue("USER/BG_COLOR", color); + reloadUI(); +} + +void Clock::mousePressEvent(QMouseEvent *event) { + pressed = true; + oldPos = event->pos(); + QWidget::mousePressEvent(event); +} + +void Clock::mouseMoveEvent(QMouseEvent *event) { + if (pressed) { + move(pos() + (event->pos() - oldPos)); + } + QWidget::mouseMoveEvent(event); +} + +void Clock::mouseReleaseEvent(QMouseEvent *event) { + pressed = false; + oldPos = event->pos(); + QWidget::mouseReleaseEvent(event); +} + +void Clock::mouseRightMenu(const QPoint &pos) { + QMenu menu(this); + + // font size + QMenu *font_size_menu = menu.addMenu("font size"); + QAction *larger_action = new QAction("larger", this); + QAction *smaller_action = new QAction("smaller", this); + + connect(larger_action, &QAction::triggered, this, &Clock::increaseFontSize); + connect(smaller_action, &QAction::triggered, this, &Clock::decreaseFontSize); + + font_size_menu->addAction(larger_action); + font_size_menu->addAction(smaller_action); + + QStringList ft_colors = {"none", "blue", "orange", "green", + "red", "yellow", "white"}; + QStringList bg_colors = {"none", "blue", "orange", "green", + "red", "yellow", "white"}; + + // font color + QMenu *font_color_menu = menu.addMenu("font color"); + QList font_color_actions; + for (const QString &color : ft_colors) { + QAction *action = new QAction(color, this); + connect(action, &QAction::triggered, [=]() { setFontColor(color); }); + font_color_actions.append(action); + } + font_color_menu->addActions(font_color_actions); + + // background color + QMenu *bg_color_menu = menu.addMenu("bg color"); + QList bg_color_actions; + for (const QString &color : bg_colors) { + QAction *action = new QAction(color, this); + connect(action, &QAction::triggered, [=]() { setBackgroundColor(color); }); + bg_color_actions.append(action); + } + bg_color_menu->addActions(bg_color_actions); + + // reset + QAction *reset_action = new QAction("reset", this); + connect(reset_action, &QAction::triggered, this, &Clock::resetUI); + menu.addAction(reset_action); + + // quit + QAction *quit_action = new QAction("quit", this); + connect(quit_action, &QAction::triggered, this, &Clock::close); + menu.addAction(quit_action); + + menu.exec(mapToGlobal(pos)); +} diff --git a/clock.h b/clock.h new file mode 100644 index 0000000..530e7a9 --- /dev/null +++ b/clock.h @@ -0,0 +1,53 @@ +#ifndef CLOCK_H +#define CLOCK_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +class Clock : public QWidget { + Q_OBJECT +public: + explicit Clock(QWidget *parent = nullptr); + void reloadUI(); + void resetUI(); + void increaseFontSize(); + void decreaseFontSize(); + void changeFontSize(); + void setFontColor(const class QString &color); + void setBackgroundColor(const class QString &color); + +protected: + void mousePressEvent(QMouseEvent *event); + // void mousePressEvent(QMouseEvent *event) ; + void mouseMoveEvent(QMouseEvent *event); + // void mouseMoveEvent(QMouseEvent *event); + void mouseReleaseEvent(QMouseEvent *event); + // void mouseReleaseEvent(QMouseEvent *event) ; + void mouseRightMenu(const QPoint &pos); + +signals: + +public slots: + void showTime(); + +private: + bool pressed; + QPoint oldPos; + QSettings *settings; + QFont font; + int font_size_step; + int font_size; + QLabel *label; +}; + +#endif // CLOCK_H diff --git a/clock.png b/clock.png new file mode 100644 index 0000000..390e557 Binary files /dev/null and b/clock.png differ diff --git a/clock.py b/clock.py new file mode 100644 index 0000000..25babd6 --- /dev/null +++ b/clock.py @@ -0,0 +1,166 @@ +import sys + +from PySide6.QtCore import QPoint, QSettings, Qt, QTime, QTimer +from PySide6.QtGui import QAction, QFont, QMouseEvent +from PySide6.QtWidgets import QApplication, QLabel, QMenu, QVBoxLayout, QWidget + + +class Clock(QWidget): + def __init__(self, parent=None) -> None: + super().__init__(parent) + + # geometry of Mmin window (x, y, width, height) + self.setGeometry(1100, 800, 180, 60) + + # hide frame + self.setWindowFlag(Qt.WindowStaysOnTopHint, True) + self.setWindowFlag(Qt.FramelessWindowHint, True) + self.setAttribute(Qt.WA_TranslucentBackground) + + # mouse & menu + self.pressed = False + self.oldPos = QPoint(0, 0) + self.setContextMenuPolicy(Qt.CustomContextMenu) + self.customContextMenuRequested.connect(self.mouseRightMenu) + + # clock object + clock = QTimer(self) + clock.timeout.connect(self.showTime) + clock.start(1000) # update the clock per second + self.show() + + self.settings = QSettings(f"{sys.argv[0]}/../config.ini", QSettings.IniFormat) + font = QFont() + font.setFamily(self.settings.value("USER/FONT_FAMILY")) + font.setPointSize(int(self.settings.value("USER/FONT_SIZE"))) + + # load settings + self.settings = QSettings(f"{sys.argv[0]}/../config.ini", QSettings.IniFormat) + + # # font object + self.font = QFont() + self.font.setFamily(self.settings.value("DEFAULT/FONT_FAMILY")) + self.font_size_step = int(self.settings.value("USER/FONT_SIZE_STEP")) + + # label object + self.label = QLabel() + self.label.setAlignment(Qt.AlignCenter) + + # layout + layout = QVBoxLayout(self, spacing=0) + layout.addWidget(self.label) + self.setLayout(layout) + + self.reloadUI() + + def reloadUI(self): + self.font_size = int(self.settings.value("USER/FONT_SIZE")) + self.font.setPointSize(self.font_size) + self.label.setFont(self.font) + self.label.setStyleSheet( + f"color: {self.settings.value('USER/FONT_COLOR')}; " + f"background-color: {self.settings.value('USER/BG_COLOR')}" + ) + + def resetUI(self): + default_bg_color = self.settings.value("DEFAULT/BG_COLOR") + default_font_color = self.settings.value("DEFAULT/FONT_COLOR") + default_font_size = self.settings.value("DEFAULT/FONT_SIZE") + + self.settings.setValue("USER/BG_COLOR", default_bg_color) + self.settings.setValue("USER/FONT_COLOR", default_font_color) + self.settings.setValue("USER/FONT_SIZE", default_font_size) + + self.reloadUI() + + def increaseFontSize(self): + self.font_size += self.font_size_step + self.changeFontSize() + + def decreaseFontSize(self): + self.font_size -= self.font_size_step + self.changeFontSize() + + def changeFontSize(self): + font = self.label.font() + font.setPointSize(self.font_size) + self.label.setFont(font) + + def setFontColor(self, color: str) -> None: + self.settings.setValue("USER/FONT_COLOR", color) + self.reloadUI() + + def setBackgroundColor(self, color: str) -> None: + self.settings.setValue("USER/BG_COLOR", color) + self.reloadUI() + + def mousePressEvent(self, event: QMouseEvent) -> None: + self.pressed = True + self.oldPos = event.pos() + super().mousePressEvent(event) + + def mouseMoveEvent(self, event: QMouseEvent) -> None: + if self.pressed: + self.move(self.pos() + (event.pos() - self.oldPos)) + super().mouseMoveEvent(event) + + def mouseReleaseEvent(self, event: QMouseEvent) -> None: + self.pressed = False + self.oldPos = event.pos() + super().mouseReleaseEvent(event) + + def mouseRightMenu(self, pos) -> None: + menu = QMenu(self) + + # font size + font_size_menu = menu.addMenu("font size") + larger_action = QAction("larger", self) + smaller_action = QAction("smaller", self) + + larger_action.triggered.connect(self.increaseFontSize) + smaller_action.triggered.connect(self.decreaseFontSize) + + font_size_menu.addAction(larger_action) + font_size_menu.addAction(smaller_action) + + ft_colors = ["none", "blue", "orange", "green", "red", "yellow", "white"] + bg_colors = ["none", "blue", "orange", "green", "red", "yellow", "white"] + + # font color + font_color_menu = menu.addMenu("font color") + font_color_actions = [ + QAction(color, self, triggered=lambda c=color: self.setFontColor(c)) + for color in ft_colors + ] + font_color_menu.addActions(font_color_actions) + + # background color + bg_color_menu = menu.addMenu("bg color") + bg_color_actions = [ + QAction(color, self, triggered=lambda c=color: self.setBackgroundColor(c)) + for color in bg_colors + ] + bg_color_menu.addActions(bg_color_actions) + + # reset + reset_action = QAction("reset", self) + reset_action.triggered.connect(self.resetUI) + menu.addAction(reset_action) + + # quit + quit_action = QAction("quit", self) + quit_action.triggered.connect(self.close) + menu.addAction(quit_action) + + menu.exec(self.mapToGlobal(pos)) + + def showTime(self): + current_time = QTime.currentTime().toString("hh:mm") + self.label.setText(current_time) + + +if __name__ == "__main__": + app = QApplication(sys.argv) + clock = Clock() + clock.show() # show all the widgets + app.exit(app.exec()) # start the app diff --git a/compile_commands.json b/compile_commands.json new file mode 100644 index 0000000..752ab72 --- /dev/null +++ b/compile_commands.json @@ -0,0 +1,161 @@ +[ + { + "arguments": [ + "clang", + "-Wno-documentation-unknown-command", + "-Wno-unknown-warning-option", + "-Wno-unknown-pragmas", + "-nostdinc", + "-nostdinc++", + "-DQT_QML_DEBUG", + "-g", + "-std=gnu++17", + "-arch", + "arm64", + "-isysroot", + "/Library/Developer/CommandLineTools/SDKs/MacOSX13.3.sdk", + "-fPIC", + "-fsyntax-only", + "--target=arm64-apple-darwin22.5.0", + "-DQT_CORE_LIB", + "-DQT_GUI_LIB", + "-DQT_WIDGETS_LIB", + "-DQ_CREATOR_RUN", + "-I/Applications/Qt Creator.app/Contents/Resources/cplusplus/wrappedQtHeaders", + "-I/Applications/Qt Creator.app/Contents/Resources/cplusplus/wrappedQtHeaders/QtCore", + "-I/Users/integzz/Documents/proj-clock/build-clock-Desktop_arm_darwin_generic_mach_o_64bit-Debug/clock_autogen/include", + "-I/opt/homebrew/opt/qt@5/include", + "-I/opt/homebrew/opt/qt@5/include/QtWidgets", + "-I/opt/homebrew/opt/qt@5/include/QtGui", + "-I/Library/Developer/CommandLineTools/SDKs/MacOSX13.3.sdk/System/Library/Frameworks/OpenGL.framework/Headers", + "-I/opt/homebrew/opt/qt@5/include/QtCore", + "-I/opt/homebrew/opt/qt@5/include/mkspecs/macx-clang", + "-F", + "/Library/Developer/CommandLineTools/SDKs/MacOSX13.3.sdk/System/Library/Frameworks", + "-isystem", + "/Library/Developer/CommandLineTools/SDKs/MacOSX13.3.sdk/usr/include/c++/v1", + "-isystem", + "/Applications/Qt Creator.app/Contents/Resources/libexec/clang/lib/clang/16/include", + "-isystem", + "/Library/Developer/CommandLineTools/SDKs/MacOSX13.3.sdk/usr/include", + "-isystem", + "/Library/Developer/CommandLineTools/usr/include", + "-fmessage-length=0", + "-fdiagnostics-show-note-include-stack", + "-fretain-comments-from-system-headers", + "-fmacro-backtrace-limit=0", + "-ferror-limit=1000", + "-x", + "c++", + "/Users/integzz/Documents/proj-clock/main.cpp" + ], + "directory": "/usr/bin/clangd", + "file": "/Users/integzz/Documents/proj-clock/main.cpp" + }, + { + "arguments": [ + "clang", + "-Wno-documentation-unknown-command", + "-Wno-unknown-warning-option", + "-Wno-unknown-pragmas", + "-nostdinc", + "-nostdinc++", + "-DQT_QML_DEBUG", + "-g", + "-std=gnu++17", + "-arch", + "arm64", + "-isysroot", + "/Library/Developer/CommandLineTools/SDKs/MacOSX13.3.sdk", + "-fPIC", + "-fsyntax-only", + "--target=arm64-apple-darwin22.5.0", + "-DQT_CORE_LIB", + "-DQT_GUI_LIB", + "-DQT_WIDGETS_LIB", + "-DQ_CREATOR_RUN", + "-I/Applications/Qt Creator.app/Contents/Resources/cplusplus/wrappedQtHeaders", + "-I/Applications/Qt Creator.app/Contents/Resources/cplusplus/wrappedQtHeaders/QtCore", + "-I/Users/integzz/Documents/proj-clock/build-clock-Desktop_arm_darwin_generic_mach_o_64bit-Debug/clock_autogen/include", + "-I/opt/homebrew/opt/qt@5/include", + "-I/opt/homebrew/opt/qt@5/include/QtWidgets", + "-I/opt/homebrew/opt/qt@5/include/QtGui", + "-I/Library/Developer/CommandLineTools/SDKs/MacOSX13.3.sdk/System/Library/Frameworks/OpenGL.framework/Headers", + "-I/opt/homebrew/opt/qt@5/include/QtCore", + "-I/opt/homebrew/opt/qt@5/include/mkspecs/macx-clang", + "-F", + "/Library/Developer/CommandLineTools/SDKs/MacOSX13.3.sdk/System/Library/Frameworks", + "-isystem", + "/Library/Developer/CommandLineTools/SDKs/MacOSX13.3.sdk/usr/include/c++/v1", + "-isystem", + "/Applications/Qt Creator.app/Contents/Resources/libexec/clang/lib/clang/16/include", + "-isystem", + "/Library/Developer/CommandLineTools/SDKs/MacOSX13.3.sdk/usr/include", + "-isystem", + "/Library/Developer/CommandLineTools/usr/include", + "-fmessage-length=0", + "-fdiagnostics-show-note-include-stack", + "-fretain-comments-from-system-headers", + "-fmacro-backtrace-limit=0", + "-ferror-limit=1000", + "-x", + "c++", + "/Users/integzz/Documents/proj-clock/clock.cpp" + ], + "directory": "/usr/bin/clangd", + "file": "/Users/integzz/Documents/proj-clock/clock.cpp" + }, + { + "arguments": [ + "clang", + "-Wno-documentation-unknown-command", + "-Wno-unknown-warning-option", + "-Wno-unknown-pragmas", + "-nostdinc", + "-nostdinc++", + "-DQT_QML_DEBUG", + "-g", + "-std=gnu++17", + "-arch", + "arm64", + "-isysroot", + "/Library/Developer/CommandLineTools/SDKs/MacOSX13.3.sdk", + "-fPIC", + "-fsyntax-only", + "--target=arm64-apple-darwin22.5.0", + "-DQT_CORE_LIB", + "-DQT_GUI_LIB", + "-DQT_WIDGETS_LIB", + "-DQ_CREATOR_RUN", + "-I/Applications/Qt Creator.app/Contents/Resources/cplusplus/wrappedQtHeaders", + "-I/Applications/Qt Creator.app/Contents/Resources/cplusplus/wrappedQtHeaders/QtCore", + "-I/Users/integzz/Documents/proj-clock/build-clock-Desktop_arm_darwin_generic_mach_o_64bit-Debug/clock_autogen/include", + "-I/opt/homebrew/opt/qt@5/include", + "-I/opt/homebrew/opt/qt@5/include/QtWidgets", + "-I/opt/homebrew/opt/qt@5/include/QtGui", + "-I/Library/Developer/CommandLineTools/SDKs/MacOSX13.3.sdk/System/Library/Frameworks/OpenGL.framework/Headers", + "-I/opt/homebrew/opt/qt@5/include/QtCore", + "-I/opt/homebrew/opt/qt@5/include/mkspecs/macx-clang", + "-F", + "/Library/Developer/CommandLineTools/SDKs/MacOSX13.3.sdk/System/Library/Frameworks", + "-isystem", + "/Library/Developer/CommandLineTools/SDKs/MacOSX13.3.sdk/usr/include/c++/v1", + "-isystem", + "/Applications/Qt Creator.app/Contents/Resources/libexec/clang/lib/clang/16/include", + "-isystem", + "/Library/Developer/CommandLineTools/SDKs/MacOSX13.3.sdk/usr/include", + "-isystem", + "/Library/Developer/CommandLineTools/usr/include", + "-fmessage-length=0", + "-fdiagnostics-show-note-include-stack", + "-fretain-comments-from-system-headers", + "-fmacro-backtrace-limit=0", + "-ferror-limit=1000", + "-x", + "c++-header", + "/Users/integzz/Documents/proj-clock/clock.h" + ], + "directory": "/usr/bin/clangd", + "file": "/Users/integzz/Documents/proj-clock/clock.h" + } +] diff --git a/config.ini b/config.ini new file mode 100644 index 0000000..2cf1b50 --- /dev/null +++ b/config.ini @@ -0,0 +1,13 @@ +[DEFAULT] +BG_COLOR=NONE +FONT_COLOR=blue +FONT_FAMILY=Arial +FONT_SIZE=50 +FONT_SIZE_STEP=10 + +[USER] +BG_COLOR=NONE +FONT_COLOR=blue +FONT_FAMILY=Arial +FONT_SIZE=50 +FONT_SIZE_STEP=10 diff --git a/main.cpp b/main.cpp new file mode 100644 index 0000000..0d69e94 --- /dev/null +++ b/main.cpp @@ -0,0 +1,10 @@ +#include + +#include "clock.h" + +int main(int argc, char *argv[]) { + QApplication app(argc, argv); + + Clock clock; + return app.exec(); +} diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..9137a62 --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +pyside6