Skip to content

wreedb/udlaunch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

What is UDLaunch?

UDLaunch is a tool for launching multiple programs from a single command with settings you define in a configuration file.

What is it good for?

It is great for launching user-level daemons when you log in to your computer Some examples could be a program that sets your wallpaper, a status bar, a desktop notification program, a polkit service or a session manager, but it can run whatever you need it to.

Features

UDLaunch allows you to configure:

  • Command-line arguments passed to each program
  • If the program should be killed/restarted when UDLaunch is invoked
  • Any environment variables that need to be set or unset for your program to run properly
  • Multiple groups of programs that can be run separately
  • Absolute paths to the executables, such as programs that are not in your path

Building

The only dependency needed to build UDLaunch is the V compiler. Once you have that, you can follow these steps:

git clone https://github.com/wreedb/udlaunch; cd udlaunch
v . -prod # for a release build
v .       # for a debug build

Run-time dependencies

The following software is needed at run-time, however it is highly unlikely that you do not have these already.

  • procps: needed for the pgrep command
  • util-linux: needed for the kill command

Once built, you can copy the binary to your ~/.local/bin directory, or anywhere in your PATH. Then you can copy the example configuration file into your ~/.config under a directory called udlaunch, or write one from scratch using the example as a reference for the syntax. The configuration is written in TOML format, and their website has excellent documentation for the specification.

Configuring

Each entry in the configuration may have these fields

fieldrequiredtypedefault
nametruestringN/A, required
restartfalsebooleanfalse
argsfalse[string][ ]
setenvsfalse{string=string}{ }
unsetenvsfalse[string][ ]
restartfalsestringinferred

NOTE

  • Types displayed in the format [type] refer to a list of the type specified, separated by commas.
  • Types displayed in the format {type=type} refer to a mapping of type = type, see the examples section for examples.
  • The inferred default value of the path field is done by UDLaunch, it will try to find the executable in your PATH

Examples

Here are some examples for the configuration, using Mako, XFSettingsd and Waybar

[default]
[default.xfsettingsd]
name = "xfsettingsd"
args = ["--disable-wm-check", "--daemon"]
unsetenvs = ["WAYLAND_DISPLAY"]
path = "/usr/bin/xfsettingsd"

[default.mako]
name = "mako"
restart = true
setenvs = { "VAR_1" = "hello", "VAR_2" = "0" }

[default.waybar]
name = "waybar"
args = ["--log-level=critical"]

License and contact information

The included license is the BSD-2-Clause license. You can contact me by email at [email protected]