#!/usr/bin/env zsh

# Variables
cpu_quota="900%"
user_detect=$(whoami)
command_use="/usr/bin/ffprobe"

# Run previous information
#${command_use} -version | head -2 ; print ""

# Run process with CPU Quota
if [[ "${user_detect}" == "root" ]] ; then
  systemd-run --quiet --scope -p CPUQuota=${cpu_quota} ${command_use} -hide_banner "${@}"
else
  systemd-run --user --quiet --scope -p CPUQuota=${cpu_quota} ${command_use} -hide_banner "${@}"
fi
