26 lines
478 B
Bash
Executable File
26 lines
478 B
Bash
Executable File
#!/bin/bash
|
|
|
|
if [ ! -f /usr/bin/zenity ];then
|
|
echo "Zenity not installed..."
|
|
exit 0;
|
|
fi
|
|
|
|
|
|
if ! command -v pkexec >/dev/null 2>&1;then
|
|
echo "pkexec not installed (install polkit)..."
|
|
exit 1
|
|
fi
|
|
su_prompt="pkexec"
|
|
|
|
zenity --question --text "Do you want to trim?"
|
|
if [[ $? == 1 ]];then
|
|
exit
|
|
else
|
|
notify-send -a "FS-Trim" "Trimming..."
|
|
echo "Trimming..."
|
|
results=$(${su_prompt} /sbin/fstrim -va)
|
|
notify-send "${results}"
|
|
echo "${results}"
|
|
|
|
fi
|