Skip to content

Instantly share code, notes, and snippets.

@thomaswitt
Last active December 7, 2023 08:13
Show Gist options
  • Select an option

  • Save thomaswitt/c5efaa6635356edfa0b204f05b260893 to your computer and use it in GitHub Desktop.

Select an option

Save thomaswitt/c5efaa6635356edfa0b204f05b260893 to your computer and use it in GitHub Desktop.

Revisions

  1. thomaswitt revised this gist Dec 7, 2023. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion remove_unwanted_macos_agents.bash
    Original file line number Diff line number Diff line change
    @@ -7,7 +7,7 @@ process_agents() {
    shopt -s nullglob
    for plist in "$directory"/{LaunchAgents,LaunchDaemons,PrivilegedHelperTools}/*; do
    if ! echo "$plist" | egrep -q "$pattern"; then
    if [[ $directory = /* ]]; then
    if [[ $directory = /Library* ]]; then
    echo "sudo launchctl unload -w \"$plist\""
    echo -e "sudo rm -f \"$plist\"\n"
    else
  2. thomaswitt revised this gist Nov 23, 2023. 1 changed file with 0 additions and 6 deletions.
    6 changes: 0 additions & 6 deletions remove_unwanted_macos_agents.bash
    Original file line number Diff line number Diff line change
    @@ -20,20 +20,14 @@ process_agents() {

    global_agents=(
    at.obdev.littlesnitch # Little Snitch
    com.adobe # Adobe
    com.audinate.dante # Dante Audio
    com.docker # Docker
    com.haystacksoftware # ARQ Backup
    com.native-instruments # Native Instruments
    com.wacom # Wacom Tablet
    )
    process_agents "/Library" "${global_agents[@]}"

    local_agents=(
    com.DigiDNA.iMazing # iMazing Backup
    com.docker # Docker
    com.loupedeck.loupedeck2 # Loupedeck
    jp.plentycom.boa.SteerMouse # SteerMouse
    )
    process_agents "$HOME/Library" "${local_agents[@]}"

  3. thomaswitt created this gist Nov 23, 2023.
    40 changes: 40 additions & 0 deletions remove_unwanted_macos_agents.bash
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,40 @@
    # Remove unwanted helpers
    process_agents() {
    local directory=$1
    shift
    local agents=("$@")
    local pattern=$(IFS=\|; echo "${agents[*]}")
    shopt -s nullglob
    for plist in "$directory"/{LaunchAgents,LaunchDaemons,PrivilegedHelperTools}/*; do
    if ! echo "$plist" | egrep -q "$pattern"; then
    if [[ $directory = /* ]]; then
    echo "sudo launchctl unload -w \"$plist\""
    echo -e "sudo rm -f \"$plist\"\n"
    else
    echo "launchctl unload -w \"$plist\""
    echo -e "rm -f \"$plist\"\n"
    fi
    fi
    done
    }

    global_agents=(
    at.obdev.littlesnitch # Little Snitch
    com.adobe # Adobe
    com.audinate.dante # Dante Audio
    com.docker # Docker
    com.haystacksoftware # ARQ Backup
    com.native-instruments # Native Instruments
    com.wacom # Wacom Tablet
    )
    process_agents "/Library" "${global_agents[@]}"

    local_agents=(
    com.DigiDNA.iMazing # iMazing Backup
    com.docker # Docker
    com.loupedeck.loupedeck2 # Loupedeck
    jp.plentycom.boa.SteerMouse # SteerMouse
    )
    process_agents "$HOME/Library" "${local_agents[@]}"

    alias show_background_tasks='sudo sfltool dumpbtm|egrep "^\W+(#\d+|Disposition:|Identifier:)"|cut -c -80'