-A simple command line program to allow electron apps to stream with audio on Linux via pipewire
+
-## Usage
+
-Grab the [prebuild](/prebuilt/) or [build from source](#compiling)
+venmic - screenshare support for pipewire
-#### List available targets (apps that are playing audio)
+
-This will print a list of names, newline separated
+## π Usage
-```
-./vencord-virtmic --list-targets
-```
+_venmic_ can be used as node-module or as a local rest-server.
-#### Create a virtual mic for a target
+The node-module is intended for internal usage by [Vesktop](https://github.com/Vencord/Vesktop).
-This will create a virtual mic called `vencord-virtmic` you can use
+The Rest-Server exposes three simple endpoints
+* (GET) `/list`
+ > List all available applications to share
-```
-./vencord-virtmic Firefox
-```
+* (POST) `/link`
+ > Expects a JSON-Body containing the target application, i.e. `{"name": "Firefox", "mode": "include"}`
+ > Valid values for `mode` are:
+ > * `include`
+ > The specified application will be shared
+ > * `exclude`
+ > All _but_ the specified application will be shared
-## Compiling
+* (GET) `/unlink`
+ > Unlinks the currently linked application
-I did this on fedora, but it should work similarly on other distros.
+## ποΈ Compiling
-- Install the build essentials (make, cmake, g++, ...)
-- Install pipewire-devel, expected-devel,
+* Rest-Server
+ ```bash
+ git clone https://github.com/Vencord/linux-virtmic && cd linux-virtmic
+ cmake -B build && cmake --build build
+ ```
-```sh
-git clone https://github.com/Vencord/linux-virtmic --recurse-submodules
-mkdir build
-cd build
-cmake ..
-make
-```
+* Node-Addon
+ ```bash
+ git clone https://github.com/Vencord/linux-virtmic && cd linux-virtmic
+ pnpm install
+ ```
-You should now find the addon at build/vencord-virtmic
+## π€ Acknowledgements
-## Acknowledgements
+This project heavily relies on the following projects:
-This library is heavily based on the amazing work by the https://github.com/Soundux/rohrkabel/ library
+* [Soundux/rohrkabel](https://github.com/Soundux/rohrkabel/)
+* [cmake-js](https://github.com/cmake-js/cmake-js)
+
+Kudos to all the developers involved, keep up the great work!
diff --git a/addon/CMakeLists.txt b/addon/CMakeLists.txt
new file mode 100644
index 0000000..0d2316e
--- /dev/null
+++ b/addon/CMakeLists.txt
@@ -0,0 +1,53 @@
+cmake_minimum_required(VERSION 3.16)
+project(venmic-addon LANGUAGES CXX VERSION 2.0)
+
+# --------------------------------------------------------------------------------------------------------
+# Create library
+# --------------------------------------------------------------------------------------------------------
+
+add_library(${PROJECT_NAME} SHARED)
+add_library(vencord::venmic-addon ALIAS ${PROJECT_NAME})
+
+target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20)
+set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "" SUFFIX ".node")
+set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 20 CXX_EXTENSIONS OFF CXX_STANDARD_REQUIRED ON)
+
+if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
+ target_compile_options(${PROJECT_NAME} PRIVATE -Wall -Wextra -Wpedantic -Werror -pedantic -pedantic-errors -Wfatal-errors)
+endif()
+
+target_compile_options(${PROJECT_NAME} PRIVATE -Wno-unknown-warning-option -Wno-missing-field-initializers -Wno-cast-function-type)
+
+# --------------------------------------------------------------------------------------------------------
+# Add source files
+# --------------------------------------------------------------------------------------------------------
+
+file(GLOB src "*.cpp")
+target_sources(${PROJECT_NAME} PRIVATE ${src})
+
+# --------------------------------------------------------------------------------------------------------
+# Setup Dependencies
+# --------------------------------------------------------------------------------------------------------
+
+include("../cmake/cpm.cmake")
+
+CPMFindPackage(
+ NAME range-v3
+ GIT_TAG 0.12.0
+ GIT_REPOSITORY "https://github.com/ericniebler/range-v3"
+)
+
+target_link_libraries(${PROJECT_NAME} PUBLIC vencord::venmic range-v3::meta)
+
+# --------------------------------------------------------------------------------------------------------
+# CMake.js related
+# --------------------------------------------------------------------------------------------------------
+
+add_definitions(-DNAPI_VERSION=7)
+
+target_link_libraries(${PROJECT_NAME} PUBLIC ${CMAKE_JS_LIB})
+target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_JS_INC})
+
+if(MSVC AND CMAKE_JS_NODELIB_DEF AND CMAKE_JS_NODELIB_TARGET)
+ execute_process(COMMAND ${CMAKE_AR} /def:${CMAKE_JS_NODELIB_DEF} /out:${CMAKE_JS_NODELIB_TARGET} ${CMAKE_STATIC_LINKER_FLAGS})
+endif()
diff --git a/addon/addon.cpp b/addon/addon.cpp
new file mode 100644
index 0000000..09bacb3
--- /dev/null
+++ b/addon/addon.cpp
@@ -0,0 +1,120 @@
+#include