jitty-scripts/trb.sh

29 lines
460 B
Bash
Raw Normal View History

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-05-21 20:00:18 -07:00
distro=$(lsb_release -a | grep -o "VoidLinux")
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-05-21 20:00:18 -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