shell

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package shell installs and removes shell hooks that trigger notifications on command completion.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DetectShell added in v0.2.25

func DetectShell() string

DetectShell returns the current shell type: "bash", "zsh", or "powershell". On Windows it defaults to "powershell". On Unix it inspects $SHELL.

func EscapePowerShell

func EscapePowerShell(s string) string

EscapePowerShell doubles single quotes for safe embedding inside PowerShell single-quoted strings.

func Install added in v0.2.25

func Install(shell string, threshold int, notifyPath string) (string, error)

Install appends the shell hook snippet to the shell's config file. Returns an error if the hook is already installed.

func IsInstalled added in v0.2.25

func IsInstalled(shell string) (configPath string, installed bool, err error)

IsInstalled checks whether the shell hook markers are present in the config file.

func ShellConfigPath added in v0.2.25

func ShellConfigPath(shell string) (string, error)

ShellConfigPath returns the config file path for the given shell.

func Snippet added in v0.2.25

func Snippet(shell string, threshold int, notifyPath string) string

Snippet returns the shell hook snippet for the given shell. threshold is the minimum command duration in seconds before notifying. notifyPath is the absolute path to the notify binary.

func Uninstall added in v0.2.25

func Uninstall(shell string) (string, error)

Uninstall removes the marker-delimited shell hook block from the config file.

Types

This section is empty.

Jump to

Keyboard shortcuts

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