Skip to content

A tiny, cross-platform library for automatically launching any application or executable at startup.

License

Notifications You must be signed in to change notification settings

Revxrsal/autostart4j

Repository files navigation

JitPack License: MIT Java CI with Gradle Discord

autostart4j

A tiny, cross-platform library for automatically launching any application or executable at startup.

Supports Windows, macOS, and Linux.

This library is a direct port of node-auto-launch, written in CoffeeScript.

Add to your project

pom.xml

<!-- Add JitPack repository -->
<repository>
    <id>jitpack.io</id>
    <url>https://jitpack.io</url>
</repository>

<!-- Add the dependency -->
<dependency>
    <groupId>com.github.Revxrsal</groupId>
    <artifactId>autostart4j</artifactId>
    <version>(version)</version>
</dependency>

Latest version: JitPack

build.gradle

repositories {
    maven { url = "https://jitpack.io" }
}

dependencies {
    implementation("com.github.Revxrsal:autostart4j:(version)")
}

Latest version: JitPack

build.gradle.kts

repositories {
    maven(url = "https://jitpack.io")
}

dependencies {
    implementation("com.github.Revxrsal:autostart4j:(version)")
}

Latest version: JitPack

Usage

AutoLaunch autoLaunch = AutoLaunch.builder()
        .appName("Everything")
        .appFile(new File("C:/Program Files/Everything/Everything.exe"))
        
        // macOS respects the options '--minimized' and '--hidden'.
        .args("--minimized")
        
        // For MacOS: This will use the launch agent instead of AppleScript
        .useLaunchAgent()
        .build();

// To enable:
autoLaunch.enable();

// To disable:
autoLaunch.disable();

// To toggle:
autoLaunch.toggle();

// Check if it is enabled:
boolean enabled = autoLaunch.isEnabled();

About

A tiny, cross-platform library for automatically launching any application or executable at startup.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages