trb.sh: added support for gksudo
This commit is contained in:
parent
280a2ca3e6
commit
3b097993b2
15
trb.sh
15
trb.sh
@ -1,13 +1,24 @@
|
||||
#!/bin/bash
|
||||
|
||||
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
|
||||
|
||||
|
||||
zenity --question --text "Do you want to trim?"
|
||||
if [[ $? == 1 ]];then
|
||||
exit
|
||||
else
|
||||
|
||||
results=$(pkexec /sbin/fstrim -va)
|
||||
results=$($su_prompt "/sbin/fstrim -va")
|
||||
notify-send "${results}"
|
||||
|
||||
fi
|
||||
|
Loading…
x
Reference in New Issue
Block a user