Jump to content




Startup Handler

utility

  • You cannot reply to this topic
No replies to this topic

#1 BrunoZockt

  • Members
  • 56 posts
  • LocationGermany

Posted 17 September 2018 - 08:59 PM

Why?
I programmed this small script so that my automatically resuming program (OCM) will only be executed on startup if it has to resume. Otherwise I want whatever the user initially used as startup to be executed.
How do I use it?
You need to install this program as your startup, so make sure that you move any file away from startup if they exist.
To set it up you have access to three functions which you can either type into the terminal or call from another program after loading this as API.
  • getList()
    This function returns the externally saved list of programs that should be resumed or executed as standart. Example:
    {
    "myResumingProgram",
    "myOtherResumingProgram",
    standart = "myOS",
    }
    
  • set(path, position)
    This function adds the program at path to the list. Optionally you can specify the position where to place the program on the list. Give "standart" as position if you want to change the entry "standart" on the list. Returns boolean successful. If used in the terminal it prints "Success!" + updated List when successful, an error message when not.
  • remove(path)
    This function removes the entry path from the list. It can't access "standart" but "startup set ' ' startup" will do the trick. Returns boolean successfull. If used in the terminal prints "Success!" + updated List when successful, error message when not.
When executed (normally on startup or after a reboot) this script looks through the list from 1st to last entry if a file exists at path "database/"..listEntry.."/resume". If true it executes that program so that it can resume. If no entry has corresponding resume files the program under the key "standart" is executed.
Installation
Simply type "pastebin get 19VG8eD6 startup" into the terminal.
If you want a program of yours to set up the Startup Handler by itself have a look at this snippet from my program OCM:
Spoiler
I hope this helps some of you, wether for private use on your computer or to make your programs more independant. I would love to hear some feedback!
Cheers,
Bruno
PS: For moderators: I wasn't sure if this would fit into the subforum "APIs and Utilitys" since it is an executable program and therefore strictly not an API (I think...). If you think so, feel free to move it there.

Edited by BrunoZockt, 02 April 2019 - 09:53 PM.






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users