From 73ae98d3e227cd3983679395674bd954c68461fc Mon Sep 17 00:00:00 2001 From: Nikolay Bely Date: Fri, 7 Feb 2025 11:05:54 +0700 Subject: [PATCH] Vibe fps control --- README.md | 6 ++++++ patches/0004-Vibe-animation-max-FPS.patch | 11 +++++++++++ repack.sh | 1 + templates/default.conf | 3 ++- templates/yandex-music.sh | 1 + 5 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 patches/0004-Vibe-animation-max-FPS.patch diff --git a/README.md b/README.md index ce0e2b6..3b26b7d 100644 --- a/README.md +++ b/README.md @@ -163,6 +163,12 @@ Yandex Music's custom Windows-styled titlebar can be enabled by setting `CUSTOM_ *** +### Vibe animation FPS control + +Vibe animation FPS can be control by setting `VIBE_ANIMATION_MAX_FPS` option from `0` (black screen) to any reasonable number. Default `25`. + +*** + ## Manual Build ### Prerequisites diff --git a/patches/0004-Vibe-animation-max-FPS.patch b/patches/0004-Vibe-animation-max-FPS.patch new file mode 100644 index 0000000..532f65b --- /dev/null +++ b/patches/0004-Vibe-animation-max-FPS.patch @@ -0,0 +1,11 @@ +diff --git a/main/lib/preload.js b/main/lib/preload.js +--- a/main/lib/preload.js ++++ b/main/lib/preload.js +@@ -12,2 +12,3 @@ const deviceInfo_js_1 = require("./deviceInfo.js"); + const trayEnabled = process.env.TRAY_ENABLED && process.env.TRAY_ENABLED > 0; ++const vibeAnimationMaxFps = process.env.VIBE_ANIMATION_MAX_FPS ?? 25; + electron_1.contextBridge.exposeInMainWorld('VERSION', String(config_js_1.config.buildInfo.VERSION)); +@@ -19,2 +20,3 @@ const deviceInfo_js_1 = require("./deviceInfo.js"); + electron_1.contextBridge.exposeInMainWorld('IS_TRAY_ENABLED', trayEnabled); ++electron_1.contextBridge.exposeInMainWorld('VIBE_ANIMATION_MAX_FPS', vibeAnimationMaxFps); + electron_1.contextBridge.exposeInMainWorld('desktopEvents', { diff --git a/repack.sh b/repack.sh index 3905695..a74e1f6 100755 --- a/repack.sh +++ b/repack.sh @@ -77,6 +77,7 @@ find "./" -type f \( -name "*.js" -o -name "*.js.map" \) -print0 | while IFS= re sed -i 's/LINUX:"98548790"/LINUX:"95673843"/g' "$file" sed -i 's/LINUX:"d2bcdb71-90ac-493b-b68f-024321954a5d"/LINUX:"0d8ab1a6-1667-42cb-a98f-2fe7eff4b137"/g' "$file" sed -i 's/case n.t.LINUX:e="uVNvVMAvdrvjtwN0VlhEt2"/case n.t.LINUX:e="kzqU4XhfCaY6B6JTHODeq5"/g' "$file" + sed -i 's/t\.MAX_FPS=25/t.MAX_FPS=window.VIBE_ANIMATION_MAX_FPS??25/g' "$file" done echo ".js chunks patched" diff --git a/templates/default.conf b/templates/default.conf index b875b3a..7dfe4bb 100644 --- a/templates/default.conf +++ b/templates/default.conf @@ -1,4 +1,5 @@ ELECTRON_CUSTOM_BIN= ELECTRON_ARGS="--no-sandbox" TRAY_ENABLED=0 -DEV_TOOLS=0 \ No newline at end of file +DEV_TOOLS=0 +VIBE_ANIMATION_MAX_FPS=25 diff --git a/templates/yandex-music.sh b/templates/yandex-music.sh index 3764e9d..33d26b0 100644 --- a/templates/yandex-music.sh +++ b/templates/yandex-music.sh @@ -25,5 +25,6 @@ ELECTRON_BIN=${ELECTRON_CUSTOM_BIN:-%electron_path%} export TRAY_ENABLED=${TRAY_ENABLED:-0} export DEV_TOOLS=${DEV_TOOLS:-0} export CUSTOM_TITLE_BAR=${CUSTOM_TITLE_BAR:-0} +export VIBE_ANIMATION_MAX_FPS=${VIBE_ANIMATION_MAX_FPS:-25} exec "${ELECTRON_BIN}" "%asar_path%" $ELECTRON_ARGS $WAYLAND_FLAGS