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

9 lines
236 B
Bash
Raw Normal View History

2022-10-28 15:59:55 +00:00
#!/usr/bin/env dash
2022-10-30 17:46:57 +00:00
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