2017-05-09 21:31:02 -07:00
|
|
|
#!/bin/bash
|
|
|
|
|
2017-05-21 20:00:18 -07:00
|
|
|
if [ ! -f /usr/bin/zenity ];then
|
|
|
|
echo "Zenity not installed..."
|
|
|
|
exit 0;
|
|
|
|
fi
|
|
|
|
|
2017-06-11 18:39:03 -07:00
|
|
|
|
2017-05-21 20:00:18 -07:00
|
|
|
distro=$(lsb_release -a | grep -o "VoidLinux")
|
|
|
|
|
2017-06-11 18:39:03 -07:00
|
|
|
auth_prompt_path=$(which pkexec)
|
|
|
|
|
|
|
|
if [ -f ${auth_prompt_path} ];then
|
2017-05-21 20:00:18 -07:00
|
|
|
su_prompt="pkexec"
|
2017-05-21 20:13:55 -07:00
|
|
|
else
|
|
|
|
su_prompt="gksudo"
|
2017-05-21 20:00:18 -07:00
|
|
|
fi
|
2017-05-09 21:31:02 -07:00
|
|
|
|
|
|
|
zenity --question --text "Do you want to trim?"
|
|
|
|
if [[ $? == 1 ]];then
|
|
|
|
exit
|
|
|
|
else
|
|
|
|
|
2017-08-04 22:18:56 -07:00
|
|
|
results=$(${su_prompt} /sbin/fstrim -va)
|
2017-05-09 21:31:02 -07:00
|
|
|
notify-send "${results}"
|
2017-05-21 20:15:37 -07:00
|
|
|
echo "${results}"
|
2017-05-09 21:31:02 -07:00
|
|
|
|
|
|
|
fi
|