Add more options for USB unlocking

This commit is contained in:
Sam A. 2022-10-30 18:46:57 +01:00
parent f76a5e7e9a
commit 14d7ce105a
Signed by: samsapti
GPG key ID: CBBBE7371E81C4EA
2 changed files with 8 additions and 2 deletions

View file

@ -1,3 +1,8 @@
#!/usr/bin/env dash
pkexec --disable-internal-agent usbctl temporary
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

View file

@ -86,6 +86,7 @@
"exec": "usb-status.sh",
"return-type": "json",
"interval": 1,
"on-click": "usb-unlock.sh"
"on-click": "usb-unlock.sh",
"on-click-right": "usb-unlock.sh --permanent"
}
}