-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Description
Currently we must specify absolute path to the program to start. This is problematic for applications that move like Discord.
Example:
My current discord-timer configs use this for the path: C:\Users\Garre\AppData\Local\Discord\app-1.0.9223\Discord.exe
Once discord updates to 1.0.9224, as it likely will in a few days, this path will no longer point to Discord.exe, and the timer will cease to function until the config is updated.
Solution: We need some way to more generally refer to the executable we want to launch, and/or be able to refer to the start: path and the end: kill target exe separately.
Implementation Ideas
Allow for glob search paths:
A simple solution could be to just allow us to use specify (possibly recursive?) glob paths. If we can do so, TTK can take this path and perform the glob search, and simply/naiively take the first match it finds as the startpath.
Pseudo code:
startpath = glob("path/to/greatgrandparent/**/application-in-shifting-versioned-folder.exe")[0]Note: Naiively taking the first path might not work in every case, but it probably will. And if it can't, then the config glob likely just needs to be refined more...
Split up start actions and end actions
If start actions/end actions are split, then it becomes a work around to use shortcuts/symlinks as the start action. Currently this cannot be done, because the start action path's filename is used as the end: kill target process. If we could instead create a config like:
start:
- path: /path/to/discord.lnk
- ...
timer: ...
end:
- type: kill
process: discord.exe
- ...
...then this would decouple the start app from the process name, which allows finer user-control over what should occur.
Note: Maybe it makes sense to have them coupled as a sane default, but allow the user to decouple if end triggers are specified.
Note: I made a FR issue for this separetly: #2