mirror of
https://github.com/zoriya/noctalia-shell.git
synced 2026-08-15 18:43:59 +00:00
18 lines
390 B
Bash
Executable File
18 lines
390 B
Bash
Executable File
#!/usr/bin/env -S bash
|
|
|
|
# Check if exectly one argument was provided
|
|
if [ "$#" -ne 1 ]; then
|
|
echo "Error: Battery level not specified" >&2
|
|
echo "Usage: $0 <number>" >&2
|
|
exit 1
|
|
fi
|
|
|
|
# Check if argument is a number
|
|
if ! [[ "$1" =~ ^[0-9]+$ ]]; then
|
|
echo "Error: Battery level must be a number" >&2
|
|
echo "Usage: $0 <number>" >&2
|
|
exit 1
|
|
fi
|
|
|
|
echo "$1" | pkexec tee ~/test
|