Coder Social home page Coder Social logo

autolaunch's Introduction

AutoLaunch Kotlin

AutoLaunch Kotlin

Lightweight Kotlin library to enable auto-launch on system startup.

AutoLaunch Maven Version Badge JVM

📦 Installation

AutoLaunch targets JVM platform.

repositories {
    mavenCentral()
}

dependencies {
    implementation("io.github.vinceglb:auto-launch:0.1.0")
}

🚀 Quick start

// Create an instance of AutoLaunch.
val autoLaunch = AutoLaunch(appPackageName = "com.autolaunch.sample")

// Enable or disable launch at startup.
autoLaunch.enable()
autoLaunch.disable()

// Check if auto launch is enabled.
val isEnabled = autoLaunch.isEnabled()

ℹ️ Note: To test the auto-launch feature, your application must be distributed. With Compose Multiplatform, you can run a distributable package using ./gradlew :runDistributable

📖 Advanced

⚡️ Convenient methods

// Get the app resolved executable path
val appPath = AutoLaunch.resolvedExecutable

// Determine whether the app is distributable
val isDistributable = AutoLaunch.isRunningFromDistributable

🔧 Customizing the application path

By default, your application path is detected automatically. You can customize the application path that will be launched at startup:

  • MacOS: something like /Applications/JetBrains Toolbox.app/Contents/MacOS/jetbrains-toolbox.
  • Windows: the path to the .exe file.
val autoLaunch = AutoLaunch(
    appPackageName = "com.autolaunch.sample",
    appPath = "/path/to/your/app"
)

✨ Behind the scene

Depending on the platform, AutoLaunch uses the following techniques:

  • MacOS: create a plist file in ~/Library/LaunchAgents/ directory.
  • Windows: create a registry key in HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run.
  • Linux: to be implemented 🚧

🌱 Sample project

You can find a sample project in the sample directory. Run the following command to test the auto-launch feature:

:sample:runDistributable

😎 Contribution

Your contributions are welcome 🔥 Here are some features that are missing:

  • Linux support
  • Pass optional arguments to the application

Made with ❤️ by Vince

autolaunch's People

Contributors

dependabot[bot] avatar vinceglb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

cybernetics

autolaunch's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.