{"id":19964887,"url":"https://github.com/infinitimeorg/infinisim","last_synced_at":"2025-04-12T15:38:10.752Z","repository":{"id":36996418,"uuid":"460162884","full_name":"InfiniTimeOrg/InfiniSim","owner":"InfiniTimeOrg","description":"Simulator for InfiniTime user interface without needing a PineTime","archived":false,"fork":false,"pushed_at":"2025-03-09T21:33:45.000Z","size":1283,"stargazers_count":174,"open_issues_count":27,"forks_count":77,"subscribers_count":9,"default_branch":"main","last_synced_at":"2025-04-03T18:12:23.472Z","etag":null,"topics":["hacktoberfest","hacktoberfest2022"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/InfiniTimeOrg.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-02-16T20:14:59.000Z","updated_at":"2025-03-20T13:36:26.000Z","dependencies_parsed_at":"2023-02-16T00:46:04.265Z","dependency_job_id":"8b03f990-b898-4187-9b2e-ffa28d6e852d","html_url":"https://github.com/InfiniTimeOrg/InfiniSim","commit_stats":{"total_commits":144,"total_committers":26,"mean_commits":5.538461538461538,"dds":"0.36111111111111116","last_synced_commit":"832d38f007f80ff8dfd26bbb04d4c263c6d23032"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/InfiniTimeOrg%2FInfiniSim","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/InfiniTimeOrg%2FInfiniSim/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/InfiniTimeOrg%2FInfiniSim/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/InfiniTimeOrg%2FInfiniSim/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/InfiniTimeOrg","download_url":"https://codeload.github.com/InfiniTimeOrg/InfiniSim/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248590562,"owners_count":21129848,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["hacktoberfest","hacktoberfest2022"],"created_at":"2024-11-13T02:25:57.328Z","updated_at":"2025-04-12T15:38:10.728Z","avatar_url":"https://github.com/InfiniTimeOrg.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# [InfiniSim](https://github.com/InfiniTimeOrg/InfiniSim)\n\n[![Build InfiniSim LVGL Simulator](https://github.com/InfiniTimeOrg/InfiniSim/actions/workflows/lv_sim.yml/badge.svg)](https://github.com/InfiniTimeOrg/InfiniSim/actions/workflows/lv_sim.yml)\n\nSimulator for [InfiniTime](https://github.com/InfiniTimeOrg/InfiniTime) project.\n\nExperience the `InfiniTime` user interface directly on your PC, to shorten the time until you get your hands on a real [PineTime smartwatch](https://www.pine64.org/pinetime/).\nOr use it to develop new Watchfaces, new Screens, or quickly iterate on the user interface.\n\nFor a history on how this simulator started and the challenges on its way visit the [original PR](https://github.com/InfiniTimeOrg/InfiniTime/pull/743).\n\n## Get the Sources\n\nClone this repository and tell `git` to recursively download the submodules as well\n\n```sh\ngit clone --recursive https://github.com/InfiniTimeOrg/InfiniSim.git\n```\n\nIf you've already cloned the repository without the submodules (or you want to update them to the latest checked in version) run the following command:\n\n```sh\ngit submodule update --init --recursive\n```\n\n## Build dependencies\n\n- CMake\n- SDL2 (provides the simulator window, handles mouse and keyboard input)\n- Compiler (g++ or clang++)\n- [lv_font_conv](https://github.com/lvgl/lv_font_conv#install-the-script) (for `font.c` generation since [InfiniTime#1097](https://github.com/InfiniTimeOrg/InfiniTime/pull/1097))\n  - Note: requires Node.js v14.0.0 or later\n- [Pillow](https://python-pillow.org/) (for `resource.zip` generation when `BUILD_RESOURCES=ON`, which is the default)\n- optional: `libpng`, see `-DWITH_PNG=ON` cmake setting below for more info\n\nOn Ubuntu/Debian install the following packages:\n\n```sh\nsudo apt install -y cmake libsdl2-dev g++ npm libpng-dev\n```\n\nOn Arch Linux the following packages are needed:\n\n```sh\nsudo pacman -S cmake sdl2 gcc npm libpng\n```\n\nOn Fedora the following packages are needed:\n\n```sh\nsudo dnf install cmake SDL2-devel g++ npm patch perl libpng-devel\n```\n\nOn OpenSUSE (Tumbleweed) the following packages are needed:\n\n```sh\nsudo zypper install cmake libSDL2-devel gcc-c++ gcc npm libpng16-devel patch\n```\n\nThen install the `lv_font_conv` executable to the InfiniSim source directory (will be installed at `node_modules/.bin/lv_font_conv`)\n\n```sh\nnpm install lv_font_conv@1.5.2\n```\n\nWhen you want to create a `resource.zip` file then install the `pillow` Python library to the InfiniSim source directory (will be installed in `.venv/`)\n\n```sh\npython3 -m venv .venv\nsource .venv/bin/activate\npip install wheel Pillow\n```\n\nOptionally, depending on your distro, it may also serve the Pip package as official native installation packages:\n\nOn Ubuntu/Debian \n\n```sh\nsudo apt install python3-pil\n```\n\nOn OpenSUSE (Tumbleweed) \n\n```sh\nsudo zypper install python311-Pillow\n```\n\n## Configure and Build\n\nIn the most basic configuration tell cmake to configure the project and build it with the following two commands:\n\n```sh\ncmake -S . -B build\ncmake --build build -j4\n```\n\nThe following configuration settings can be added to the first `cmake -S . -B build` call\n\n- `-DInfiniTime_DIR=InfiniTime`: a full path to an existing InfiniTime repository checked out.\n  Inside that directory the `src/libs/lvgl` submodule must be checked out as well.\n  The default value points to the InfiniTime submodule in this repository.\n- `-DMONITOR_ZOOM=1`: scale simulator window by this factor\n- `-DBUILD_RESOURCES=ON`: enable/disable `resource.zip` creation, will be created in the `\u003cbuild-dir\u003e/resources` folder\n- `-DWITH_PNG=ON`: enable/disable the screenshot to `PNG` support.\n  Per default InfiniSim tries to use `libpng` to create screenshots in PNG format.\n  This requires `libpng` development libraries as build and runtime dependency.\n  Can be disabled with cmake config setting `-DWITH_PNG=OFF`.\n- `-DENABLE_USERAPPS`: ordered list of user applications to build into InfiniTime.\n  Values must be fields from the enumeration `Pinetime::Applications::Apps` and must be separated by a comma.\n  Ex: `-DENABLE_USERAPPS=\"Apps::Timer, Apps::Alarm\"`.\n  The default list of user applications will be selected if this variable is not set.\n\n## Run Simulator\n\nWhen the build was successful the simulator binary can be started with\n\n```sh\n./build/infinisim\n```\n\n![Running Simulator](https://user-images.githubusercontent.com/9076163/151057090-66fa6b10-eb4f-4b62-88e6-f9f307a57e40.gif)\n\nTo hide the second simulator-status-window start the binary with the `--hide-status` option\n\n```sh\n./build/infinisim --hide-status\n```\n\n- Left mouse button: simulates your finger, just click to tap, click and drag to swipe\n- Right mouse button: simulates the hardware button (for example turn the screen off or on again)\n\nUsing the keyboard the following events can be triggered:\n\n- `r` ... enable ringing\n- `R` ... disable ringing\n- `m` ... let motor run for 100 ms\n- `M` ... let motor run for 255 ms\n- `n` ... send notification\n- `N` ... clear new notification flag\n- `b` ... connect Bluetooth\n- `B` ... disconnect Bluetooth\n- `v` ... increase battery voltage and percentage\n- `V` ... decrease battery voltage and percentage\n- `c` ... charging,\n- `C` ... not charging\n- `l` ... increase brightness level\n- `L` ... lower brightness level\n- `p` ... enable print lvgl memory usage to terminal\n- `P` ... disable print memory usage\n- `s` ... increase step count by 500 steps\n- `S` ... decrease step count by 500 steps\n- `h` ... set heartrate running, and on further presses increase by 10 bpm\n- `H` ... stop heartrate\n- `i` ... take screenshot\n- `I` ... start/stop Gif screen capture\n- `w` ... generate weather data\n- `W` ... clear weather data\n\nAdditionally using the arrow keys the respective swipe gesture can be triggered.\nFor example pressing the UP key triggers a `SwipeUp` gesture.\n\n## Littlefs-do helper\n\nTo help working with the SPI-raw file the tool `littlefs-do` is provided (in the build directory).\nThe SPI-raw file emulates the persistent 4MB storage available over the SPI bus on the PineTime.\n\n```sh\n$ ./littlefs-do --help\nUsage: ./littlefs-do \u003ccommand\u003e [options]\nCommands:\n  -h, --help           show this help message for the selected command and exit\n  -v, --verbose        print status messages to the console\n  stat                 show information of specified file or directory\n  ls                   list available files in 'spiNorFlash.raw' file\n  mkdir                create directory\n  rmdir                remove directory\n  rm                   remove directory or file\n  cp                   copy files into or out of flash file\n  settings             list settings from 'settings.h'\n  res                  resource.zip handling\n```\n\n### Resource loading\n\nTo load resource zip files into the SPI raw file for the simulator to use the `res load` command can be used.\n\n```sh\n$ ./littlefs-do res --help\nUsage: ./littlefs-do res \u003caction\u003e [options]\nactions:\n  load res.zip         load zip file into SPI memory\nOptions:\n  -h, --help           show this help message for the selected command and exit\n```\n\n## Licenses\n\nThis project is released under the GNU General Public License version 3 or, at your option, any later version.\nThe same license as [InfiniTime](https://github.com/InfiniTimeOrg/InfiniTime).\n\nThe simulator is based on [lv_sim_eclipse_sdl](https://github.com/lvgl/lv_sim_eclipse_sdl) project under the MIT license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finfinitimeorg%2Finfinisim","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finfinitimeorg%2Finfinisim","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finfinitimeorg%2Finfinisim/lists"}