dotfiles/scripts/.local/bin/usb-unlock.sh

9 lines
236 B
Bash
Executable file

#!/usr/bin/env dash
if usbctl check; then
MODE="$([ "$1" = "--permanent" ] && printf "unprotect" || printf "temporary")"
pkexec --disable-internal-agent usbctl "$MODE"
else
pkexec --disable-internal-agent usbctl protect
fi