jitty-scripts/trb.sh

25 lines
401 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
distro=$(lsb_release -a | grep -o "VoidLinux")
if [ $distro = "VoidLinux" ];then
su_prompt="gksudo"
else
su_prompt="pkexec"
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}"
fi