Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] How do I use appExclusions? #1556

Closed
herrbrixter opened this issue Feb 8, 2025 · 3 comments
Closed

[Question] How do I use appExclusions? #1556

herrbrixter opened this issue Feb 8, 2025 · 3 comments

Comments

@herrbrixter
Copy link

Hi Jan,

I'm using Stretchly on my Windows laptop. I want Stretchly to run only when I'm browsing the internet. I have no idea how to use json and I just guessed this code below:

"appExclusions": [
{
"rule": "resume",
"active": true,
"commands": [
"Firefox",
"Edge",
"Chrome"
]
}
]

After I modified the json file, Stretchly doesn't start anymore.

[2025-02-08 20:16:18.740] [error] SyntaxError: Expected ',' or '}' after property value in JSON at position 15434 (line 518 column 2)
at JSON.parse ()
at Conf._deserialize (C:\Program Files\Stretchly\resources\app.asar\node_modules\conf\dist\source\index.js:67:43)
at get store (C:\Program Files\Stretchly\resources\app.asar\node_modules\conf\dist\source\index.js:278:43)
at ElectronStore._get (C:\Program Files\Stretchly\resources\app.asar\node_modules\conf\dist\source\index.js:473:33)
at ElectronStore.get (C:\Program Files\Stretchly\resources\app.asar\node_modules\conf\dist\source\index.js:155:25)
at C:\Program Files\Stretchly\resources\app.asar\node_modules\conf\dist\source\index.js:257:46
at EventEmitter.onChange (C:\Program Files\Stretchly\resources\app.asar\node_modules\conf\dist\source\index.js:334:30)
at EventEmitter.emit (node:events:530:35)
at fs.watch.debounceFn.wait (C:\Program Files\Stretchly\resources\app.asar\node_modules\conf\dist\source\index.js:397:29)
at Timeout.later [as _onTimeout] (C:\Program Files\Stretchly\resources\app.asar\node_modules\debounce-fn\index.js:29:28)
[2025-02-08 20:16:22.669] [error] SyntaxError: Expected ',' or '}' after property value in JSON at position 15434 (line 518 column 2)
at JSON.parse ()
at Conf._deserialize (C:\Program Files\Stretchly\resources\app.asar\node_modules\conf\dist\source\index.js:67:43)
at get store (C:\Program Files\Stretchly\resources\app.asar\node_modules\conf\dist\source\index.js:278:43)
at ElectronStore._get (C:\Program Files\Stretchly\resources\app.asar\node_modules\conf\dist\source\index.js:473:33)
at ElectronStore.get (C:\Program Files\Stretchly\resources\app.asar\node_modules\conf\dist\source\index.js:155:25)
at Timeout.updateTray [as _onTimeout] (C:\Program Files\Stretchly\resources\app.asar\app\main.js:1186:16)
at listOnTimeout (node:internal/timers:581:17)
at process.processTimers (node:internal/timers:519:7)
[2025-02-08 20:16:47.454] [info] Stretchly: initializing...
[2025-02-08 20:17:05.676] [info] Stretchly: arguments received from second instance:
[2025-02-08 20:17:05.677] [info] Stretchly: command 'help' executed in second instance, dropped in main instance

Can you tell me what I did wrong?

Thanks!

@herrbrixter
Copy link
Author

I found it. I was missing a comma. I just copy pasted the code from the Readme

"appExclusions": [
{
"rule": "resume",
"active": true,
"commands": [
"Firefox"
]
}
],

Stretchly runs now but it is paused even if I'm using Firefox now in the foreground. Do you know why Stretchly is paused?

Does appExclusions check if Firefox is running in the foreground? If Firefox is in the background, I'd like Stretchly to pause.

I guess I don't understand how appExclusions is supposed to work.

@hovancik
Copy link
Owner

hovancik commented Feb 8, 2025

Hi, your json looks ok to me, but you need to check how the process of Firefox is called with Task Manager or something similar. For example on Linux, it is firefox

Also make sure to follow instructions here: https://github.com/hovancik/stretchly?tab=readme-ov-file#advanced-preferences

@herrbrixter
Copy link
Author

Thanks. I changed it to "firefox" and it worked!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants