kitowall 3.5.0 → 3.5.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Jhojan Esteban Molina Valencia
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -66,6 +66,9 @@ npm run package:all
66
66
 
67
67
  ## Flatpak (Linux)
68
68
  ```bash
69
+ # 0) Install host deps (Arch Linux)
70
+ ./BOOTSTRAP_FLATPAK_BUILD_DEPS.sh
71
+
69
72
  # 1) Build desktop binary
70
73
  cd ui
71
74
  npm run tauri:build
@@ -78,6 +81,20 @@ cd ..
78
81
  flatpak-builder flatpak/build-dir flatpak/io.kitotsu.KitoWall.yml --user --install --force-clean
79
82
  ```
80
83
 
84
+ For Flathub source pipeline:
85
+ ```bash
86
+ ./BOOTSTRAP_FLATPAK_BUILD_DEPS.sh
87
+ ./GENERATE_FLATHUB_SOURCES.sh 2.1.0 && ./BUILD_FLATPAK_FROMSOURCE.sh
88
+ ```
89
+
90
+ Integrated local Flatpak (Kitowall + Kitsune + Kitsune-RenderCore in one app):
91
+ ```bash
92
+ ./BOOTSTRAP_FLATPAK_BUILD_DEPS.sh
93
+ ./GENERATE_FLATHUB_SOURCES.sh 2.1.0
94
+ ./BUILD_FLATPAK_INTEGRATED_LOCAL.sh
95
+ flatpak run io.kitotsu.KitoWall
96
+ ```
97
+
81
98
  ## User Docs
82
99
  - Current status: `STATUS.md`
83
100
  - Config examples: `CONFIG_EXAMPLES.md`
package/dist/cli.js CHANGED
File without changes
package/dist/core/live.js CHANGED
@@ -33,6 +33,7 @@ exports.liveViewData = liveViewData;
33
33
  const node_fs_1 = __importDefault(require("node:fs"));
34
34
  const node_os_1 = __importDefault(require("node:os"));
35
35
  const node_path_1 = __importDefault(require("node:path"));
36
+ const node_child_process_1 = require("node:child_process");
36
37
  const node_stream_1 = require("node:stream");
37
38
  const promises_1 = require("node:stream/promises");
38
39
  const exec_1 = require("../utils/exec");
@@ -46,6 +47,7 @@ const LIVE_BROWSER_UA = process.env.KITOWALL_LIVE_UA ||
46
47
  'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36';
47
48
  const LIVE_BROWSER_UA_FALLBACK = process.env.KITOWALL_LIVE_UA_FALLBACK ||
48
49
  'insomnia/12.3.1';
50
+ const INTEGRATED_RENDERCORE_ENV = 'KITOWALL_FLATPAK_INTEGRATED_RENDERCORE';
49
51
  function nowUnix() {
50
52
  return Math.floor(Date.now() / 1000);
51
53
  }
@@ -864,6 +866,121 @@ function normalizeApplyDefaults(raw, fallback) {
864
866
  function rendercoreEnvPath() {
865
867
  return node_path_1.default.join(node_os_1.default.homedir(), '.config', 'kitsune-rendercore', 'env');
866
868
  }
869
+ function integratedRendercoreMode() {
870
+ if (!process.env.FLATPAK_ID)
871
+ return false;
872
+ const v = clean(process.env[INTEGRATED_RENDERCORE_ENV]).toLowerCase();
873
+ return v === '1' || v === 'true' || v === 'yes' || v === 'on';
874
+ }
875
+ function integratedRendercorePidPath() {
876
+ return node_path_1.default.join(getLiveInternalRoot(), 'rendercore.pid');
877
+ }
878
+ function integratedRendercoreLogPath() {
879
+ return node_path_1.default.join(getLiveInternalRoot(), 'rendercore.log');
880
+ }
881
+ function readIntegratedRendercorePid() {
882
+ const p = integratedRendercorePidPath();
883
+ try {
884
+ const raw = clean(node_fs_1.default.readFileSync(p, 'utf8'));
885
+ const pid = Number(raw);
886
+ if (!Number.isInteger(pid) || pid <= 1)
887
+ return null;
888
+ return pid;
889
+ }
890
+ catch {
891
+ return null;
892
+ }
893
+ }
894
+ function processRunning(pid) {
895
+ try {
896
+ process.kill(pid, 0);
897
+ return true;
898
+ }
899
+ catch {
900
+ return false;
901
+ }
902
+ }
903
+ function integratedRendercoreStatus(bin) {
904
+ const pid = readIntegratedRendercorePid();
905
+ if (!pid) {
906
+ return {
907
+ stdout: `Integrated rendercore inactive (bin=${bin})`,
908
+ stderr: '',
909
+ code: 3
910
+ };
911
+ }
912
+ if (!processRunning(pid)) {
913
+ try {
914
+ node_fs_1.default.rmSync(integratedRendercorePidPath(), { force: true });
915
+ }
916
+ catch { }
917
+ return {
918
+ stdout: `Integrated rendercore stale pid file removed (pid=${pid})`,
919
+ stderr: '',
920
+ code: 3
921
+ };
922
+ }
923
+ return {
924
+ stdout: `Integrated rendercore active (pid=${pid}, bin=${bin})`,
925
+ stderr: '',
926
+ code: 0
927
+ };
928
+ }
929
+ function integratedRendercoreStart(bin) {
930
+ ensureLiveDirs();
931
+ const current = integratedRendercoreStatus(bin);
932
+ if (current.code === 0)
933
+ return current;
934
+ const outFd = node_fs_1.default.openSync(integratedRendercoreLogPath(), 'a');
935
+ const child = (0, node_child_process_1.spawn)(bin, [], {
936
+ cwd: node_os_1.default.homedir(),
937
+ env: process.env,
938
+ detached: true,
939
+ stdio: ['ignore', outFd, outFd]
940
+ });
941
+ child.unref();
942
+ node_fs_1.default.closeSync(outFd);
943
+ node_fs_1.default.writeFileSync(integratedRendercorePidPath(), `${child.pid}\n`, 'utf8');
944
+ return {
945
+ stdout: `Integrated rendercore started (pid=${child.pid}, bin=${bin})`,
946
+ stderr: '',
947
+ code: 0
948
+ };
949
+ }
950
+ function integratedRendercoreStop(bin) {
951
+ const pid = readIntegratedRendercorePid();
952
+ if (!pid) {
953
+ return {
954
+ stdout: `Integrated rendercore already stopped (bin=${bin})`,
955
+ stderr: '',
956
+ code: 0
957
+ };
958
+ }
959
+ try {
960
+ process.kill(pid, 'SIGTERM');
961
+ }
962
+ catch { }
963
+ const until = Date.now() + 2000;
964
+ while (Date.now() < until) {
965
+ if (!processRunning(pid))
966
+ break;
967
+ }
968
+ if (processRunning(pid)) {
969
+ try {
970
+ process.kill(pid, 'SIGKILL');
971
+ }
972
+ catch { }
973
+ }
974
+ try {
975
+ node_fs_1.default.rmSync(integratedRendercorePidPath(), { force: true });
976
+ }
977
+ catch { }
978
+ return {
979
+ stdout: `Integrated rendercore stopped (pid=${pid}, bin=${bin})`,
980
+ stderr: '',
981
+ code: 0
982
+ };
983
+ }
867
984
  function syncRendercoreEnv(defaults) {
868
985
  const p = rendercoreEnvPath();
869
986
  (0, fs_1.ensureDir)(node_path_1.default.dirname(p));
@@ -1526,8 +1643,13 @@ async function liveApply(opts) {
1526
1643
  // Live mode owns wallpaper state: stop static rotation services while live is active.
1527
1644
  await (0, workshop_1.workshopCoexistenceEnter)();
1528
1645
  // Keep live authority persistent across session restarts.
1529
- await (0, exec_1.run)(bin, ['service', 'install'], { timeoutMs: 20000 });
1530
- await (0, exec_1.run)(bin, ['service', 'enable'], { timeoutMs: 20000 });
1646
+ if (integratedRendercoreMode()) {
1647
+ integratedRendercoreStart(bin);
1648
+ }
1649
+ else {
1650
+ await (0, exec_1.run)(bin, ['service', 'install'], { timeoutMs: 20000 });
1651
+ await (0, exec_1.run)(bin, ['service', 'enable'], { timeoutMs: 20000 });
1652
+ }
1531
1653
  withLiveLock(() => {
1532
1654
  const current = readIndex();
1533
1655
  const updatedItems = current.items.map(v => (v.id === item.id ? { ...v, last_applied_at: nowUnix() } : v));
@@ -1715,6 +1837,30 @@ async function liveDoctor(opts) {
1715
1837
  async function liveServiceAutostart(action) {
1716
1838
  const index = readIndex();
1717
1839
  let bin = index.runner.bin_name;
1840
+ if (integratedRendercoreMode()) {
1841
+ let out;
1842
+ if (action === 'status') {
1843
+ out = integratedRendercoreStatus(bin);
1844
+ }
1845
+ else if (action === 'start' || action === 'enable' || action === 'install') {
1846
+ out = integratedRendercoreStart(bin);
1847
+ }
1848
+ else if (action === 'stop' || action === 'disable') {
1849
+ out = integratedRendercoreStop(bin);
1850
+ }
1851
+ else {
1852
+ integratedRendercoreStop(bin);
1853
+ out = integratedRendercoreStart(bin);
1854
+ }
1855
+ return {
1856
+ ok: true,
1857
+ action,
1858
+ runner: `${bin} (integrated)`,
1859
+ stdout: out.stdout.trim(),
1860
+ stderr: out.stderr.trim(),
1861
+ code: out.code
1862
+ };
1863
+ }
1718
1864
  let out;
1719
1865
  const extractResult = (err) => {
1720
1866
  const result = err?.result;
@@ -6,21 +6,25 @@ const child_process_1 = require("child_process");
6
6
  function run(cmd, args = [], options = {}) {
7
7
  return new Promise((resolve, reject) => {
8
8
  const isFlatpak = Boolean(process.env.FLATPAK_ID);
9
+ const integratedRendercore = isFlatpak && (process.env.KITOWALL_FLATPAK_INTEGRATED_RENDERCORE === '1'
10
+ || process.env.KITOWALL_FLATPAK_INTEGRATED_RENDERCORE === 'true');
9
11
  const hostCommands = new Set([
10
12
  'swww',
11
13
  'swww-daemon',
12
14
  'hyprctl',
13
15
  'systemctl',
14
- 'which',
15
16
  'xdg-open',
16
17
  'steamcmd',
17
18
  'ffmpeg',
18
19
  'ffprobe',
19
20
  'cargo',
20
21
  'kitsune-livewallpaper',
21
- 'kitsune-rendercore',
22
22
  'dd'
23
23
  ]);
24
+ if (!integratedRendercore) {
25
+ hostCommands.add('which');
26
+ hostCommands.add('kitsune-rendercore');
27
+ }
24
28
  const useHost = isFlatpak && hostCommands.has(cmd);
25
29
  const finalCmd = useHost ? 'flatpak-spawn' : cmd;
26
30
  const finalArgs = useHost ? ['--host', cmd, ...args] : args;
package/package.json CHANGED
@@ -1,7 +1,11 @@
1
1
  {
2
2
  "name": "kitowall",
3
- "version": "3.5.0",
3
+ "version": "3.5.7",
4
4
  "description": "CLI/daemon for Hyprland wallpapers using swww with pack-based rotation.",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "https://github.com/KitotsuMolina/Kitowall"
8
+ },
5
9
  "license": "SEE LICENSE IN LICENSE.md",
6
10
  "type": "commonjs",
7
11
  "files": [