Vencord icon indicating copy to clipboard operation
Vencord copied to clipboard

feat(plugin): CustomIdle

Open waresnew opened this issue 1 year ago • 6 comments

Fulfills Vencord/plugin-requests#199

Main feature is changing the timer until your status gets set to idle (or preventing auto-idle forever)

image

There's also a confirmation notification where it'll let you stay idle, even if you come back to Discord

image

You'll stay idle until you click "Exit idle"

waresnew avatar Apr 08 '24 20:04 waresnew

ngl i think it'd be better to do like a "You are currently still idle. Click the button to exit idle" bar instead of the grace period

also bc the way I animated the grace period notification is kinda ugly

lemme change that

waresnew avatar Apr 08 '24 20:04 waresnew

keep in mind that this idle timer is coupled with mobile notifications. so if you set it to a very high number or disable it outright, it might break mobile notifications

Vendicated avatar Apr 08 '24 20:04 Vendicated

keep in mind that this idle timer is coupled with mobile notifications. so if you set it to a very high number or disable it outright, it might break mobile notifications

oh ok i'll make a more precise patch for disabling then

waresnew avatar Apr 08 '24 20:04 waresnew

aight it won't affect mobile notifications now (it'll respect the setting in vanilla discord)

you can see here:

image

^ I'm online (disabled auto-idle) but I'm afk

Also changed the "grace period" thing to this:

image

waresnew avatar Apr 09 '24 20:04 waresnew

Cool af

Golonchy avatar Apr 11 '24 08:04 Golonchy

Bump

zzzealed avatar Apr 22 '24 20:04 zzzealed

Did some testing with this and feel it’s ready for use. Vesktop currently does not handle Idling very well and this as a workaround seems like a fair consideration to me. Could not produce any bugs with this branch. At this time, I have to run four Discord tabs, instead of two to keep my Discord online at all times, which is incredibly inefficient. How ready would you say this is or what’s blocking this from being added to the plugin library, @Vendicated?

R00tB33rMan avatar May 07 '24 11:05 R00tB33rMan

Requesting addition here, works well

JosTheDude avatar May 07 '24 14:05 JosTheDude

I was deperatly looking for a plugin like this. When I have Discord open on my second monitor and have an eye on it, I am there. Hands on my keyboard and mouse, and always an eye on Discord. But I still get set to idle when I don't actually click into the client for too long and then they think I'm not available and nobody messages me any more :( I'm so glad there's a plugin in development to fix this!! I have a question though. I am absolutely not familiar with github though, so sorry if this is a stupid question: can this already be installed and if so, how? I saw some people in the comments tested it, so I guess they installed it somehow, but then there are also comments suggesting it's not available yet?

Kromilan avatar May 14 '24 23:05 Kromilan

can this already be installed and if so, how?

it can be installed, but it's not an official plugin yet (vee needs to approve it first) so you need to install the dev version of Vencord. then you download the index.ts in this pull request and you move it to src/userplugins/customidle (create a folder)

however you won't get any support with dev versions/unofficial plugins like this one so you have to figure it out yourself in the end

waresnew avatar May 15 '24 00:05 waresnew

I'm so happy you've made this dream come true! I understand it isn't officially released, But, I found it amazing how BetterDiscord had something like it, and I was just wondering beyond wonder why Vencord didn't have any option for it! Thanks @waresnew

UglukOrc avatar May 15 '24 05:05 UglukOrc

How ready would you say this is or what’s blocking this from being added to the plugin library, @Vendicated?

@R00tB33rMan there's nothing blocking it from being merged, it's just that i haven't gotten to it yet! there's quite the backlog of pull requests so it sadly takes a while sometimes. anyway ill look at this some time in the coming few days

you (and anyone reading this) can always help by testing open pull requests early and testing their functionality. see if all works as expected, if there are any bugs or if there is any behaviour that you think might be confusing, then leave constructive feedback to the author

for example in this pr it'd be good to test & report if this causes any issues / edge cases with mobile notifications or if those work flawlessly

Vendicated avatar May 15 '24 05:05 Vendicated

please add a readme file

Vendicated avatar May 15 '24 05:05 Vendicated

ok it looks like a lot of people use this plugin to partially solve idling while the window is in the foreground

i'm not sure if it's feasible to globally capture user input even when the window's unfocused

in terms of formatting, i can't access vscode rn so i'll fix it in like 10 hours

i'll add a readme in a moment

waresnew avatar May 15 '24 12:05 waresnew

The way this is currently done has a big problem. The same function that handles setting mobile notifications to true is the function that sets the idle. It is ran using a setInterval as seen here: image

Modifying IDLE_DURATION to MAX_SAFE_INTEGER causes "C" to run on loop non stop. But also, modifying it means you are still making setting mobile notifications depend on the new idle timeout, because it changes how often it does the checking, even though you made the check itself not depend on the new idle timeout

Nuckyz avatar May 16 '24 06:05 Nuckyz

I have applied my suggestion of a better handling for showing the notice, and also better formatting. But the issues I mentioned are still present

Nuckyz avatar May 16 '24 06:05 Nuckyz

oh, i see

edit: it looks like that setInterval is only run when on web discord (I only tested on desktop so ig that's why I didn't notice)

i'm a bit busy rn so i'll add a patch for that in a few days

ty for reviewing

waresnew avatar May 16 '24 13:05 waresnew

ok i just realized that setInterval's delay has to be a 32 bit integer

so MAX_SAFE_INTEGER was making it overflow to 0 :skull:

technically this made it so the setinterval was still being run but this probably caused lag

waresnew avatar May 16 '24 14:05 waresnew

so this still needs work if i'm understanding correctly? marking as draft accordingly

Vendicated avatar May 17 '24 15:05 Vendicated

ok it won't prevent you from being AFK on web installs now

i'm gonna unmark it as draft now

waresnew avatar May 18 '24 14:05 waresnew

Great fix, just these three nitpicks and it should be ready

Nuckyz avatar May 18 '24 22:05 Nuckyz

okk made the changes 👍

waresnew avatar May 18 '24 23:05 waresnew

Thank you for the new plugin!

Nuckyz avatar May 18 '24 23:05 Nuckyz

Thank you for the new plugin!

Hol up! This working now?? @Nuckyz

UglukOrc avatar May 20 '24 07:05 UglukOrc

When it gets released to the main branch, yes

Nuckyz avatar May 20 '24 08:05 Nuckyz

Thank you all for your hard work. I really appreciate everyone's interest in improving the user experience and am glad that this was merged through everyone's availability and persistence.

R00tB33rMan avatar May 22 '24 04:05 R00tB33rMan

Hello The plugin doesn't work anymore :( I remain inactive when I lock my computer (after 0 secs)

Discord_OkDnD5FOFP Discord_YsCYE134lw

DanielVALAT avatar Aug 21 '24 16:08 DanielVALAT

use our support channel instead of necroing old threads.

Vendicated avatar Aug 21 '24 17:08 Vendicated