25 lines
397 B
Bash
Executable File
25 lines
397 B
Bash
Executable File
#!/bin/bash
|
|
|
|
if [ ! -f /usr/bin/zenity ];then
|
|
echo "Zenity not installed..."
|
|
exit 0;
|
|
fi
|
|
|
|
distro=$(lsb_release -a | grep -o "VoidLinux")
|
|
|
|
if [ $distro = "Solus" ];then
|
|
su_prompt="pkexec"
|
|
else
|
|
su_prompt="gksudo"
|
|
fi
|
|
|
|
zenity --question --text "Do you want to trim?"
|
|
if [[ $? == 1 ]];then
|
|
exit
|
|
else
|
|
|
|
results=$($su_prompt "/sbin/fstrim -va")
|
|
notify-send "${results}"
|
|
|
|
fi
|