appdetect

package
v0.2.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 10, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package appdetect provides utilities for detecting installed applications across different installation methods (native, Flatpak, AppImage, etc.).

This package is part of the public tinct API and can be used by both internal components and external plugins to check for application presence before generating configuration files.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetInstallationType

func GetInstallationType(binaries, directories []string) string

GetInstallationType returns a string indicating how the application is installed. Returns "native", "flatpak", "appimage", "directory", or "" if not found.

Parameters:

  • binaries: List of binary names to check
  • directories: List of directories to check

Examples:

GetInstallationType([]string{"ptyxis"}, nil)           // Check only for binary
GetInstallationType(nil, []string{"/path/to/config"})  // Check only for directory

func IsPresentAll

func IsPresentAll(binaries, directories []string) bool

IsPresentAll checks if ALL specified binaries AND directories exist. This is useful for checking if all required components are present.

Parameters:

  • binaries: List of binary names to check (can be nil or empty)
  • directories: List of directories to check (can be nil or empty)

Returns true only if ALL non-empty binaries AND directories are found. Empty string entries in slices are ignored.

Examples:

IsPresentAll([]string{"kitty", "kitten"}, nil)                  // Require both binaries
IsPresentAll(nil, []string{"~/.config/hypr"})                   // Require config dir
IsPresentAll([]string{"ptyxis"}, []string{"~/.local/share/org.gnome.Ptyxis/"}) // Require both

func IsPresentAny

func IsPresentAny(binaries, directories []string) bool

IsPresentAny checks if ANY of the specified binaries OR directories exist. This is useful for checking if at least one of several optional components is present.

Parameters:

  • binaries: List of binary names to check (can be nil or empty)
  • directories: List of directories to check (can be nil or empty)

Returns true if at least one binary OR directory is found. Empty string entries in slices are ignored.

Examples:

IsPresentAny([]string{"ptyxis", "kgx"}, nil)                   // Check for either binary
IsPresentAny(nil, []string{"~/.config/hypr", "~/.config/i3"}) // Check for either config
IsPresentAny([]string{"kitty"}, []string{"~/.config/kitty"})  // Check for binary OR config

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL