Skip to content

Instantly share code, notes, and snippets.

@iacchus
iacchus / run-toggle.sh
Created June 23, 2022 04:31
Shell script that toggles a program on/off
#!/usr/bin/env zsh
# USAGE:
# $ chmod + x run-toggle.sh
# ./run-toggle.sh <program binary path>
export FULL_COMMAND=${@:1}
export PROGRAM_NAME=$1
export PROGRAM_PID=$(pgrep -u $USER -x $PROGRAM_NAME)