new wayland system
This commit is contained in:
45
Tools/confirm.sh
Executable file
45
Tools/confirm.sh
Executable file
@@ -0,0 +1,45 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
dir="~/.config/polybar/floating/scripts/rofi"
|
||||
|
||||
confirm_exit() {
|
||||
rofi -dmenu\
|
||||
-i\
|
||||
-no-fixed-num-lines\
|
||||
-p "Are You Sure? : "\
|
||||
-theme $dir/confirm.rasi
|
||||
}
|
||||
|
||||
msg() {
|
||||
rofi -theme "$dir/message.rasi" -e "Available Options - yes / y / no / n"
|
||||
}
|
||||
|
||||
if test $# == 0; then
|
||||
echo "./confirm logout|suspend|poweroff|reboot "
|
||||
exit
|
||||
fi
|
||||
|
||||
ans=$(confirm_exit &)
|
||||
if [[ $ans == "yes" || $ans == "YES" || $ans == "y" || $ans == "Y" ]]; then
|
||||
case $1 in
|
||||
"poweroff")
|
||||
poweroff
|
||||
;;
|
||||
"suspend")
|
||||
systemctl suspend
|
||||
;;
|
||||
"reboot")
|
||||
reboot
|
||||
;;
|
||||
"logout")
|
||||
i3-msg exit
|
||||
;;
|
||||
default)
|
||||
echo "./confirm lock|suspend|poweroff|reboot "
|
||||
;;
|
||||
esac
|
||||
elif [[ $ans == "no" || $ans == "NO" || $ans == "n" || $ans == "N" ]]; then
|
||||
exit 0
|
||||
else
|
||||
msg
|
||||
fi
|
||||
11
Tools/free_ram.sh
Normal file
11
Tools/free_ram.sh
Normal file
@@ -0,0 +1,11 @@
|
||||
#!/bin/bash
|
||||
# Display the top applications of memory usage
|
||||
# http://www.cyberciti.biz/faq/linux-check-memory-usage/#comment-51021
|
||||
|
||||
while read command percent rss; do
|
||||
if [[ "${command}" != "COMMAND" ]]; then
|
||||
rss="$(bc <<< "scale=2;${rss}/1024")"
|
||||
fi
|
||||
printf " %-26s%-8s%s\n" "${command}" "${percent}" "${rss} MB" \
|
||||
| sed 's/COMMAND/PROGRAM/' | sed 's/RSS MB/#MEM/'
|
||||
done < <(ps -A --sort -rss -o comm,pmem,rss | head -n 20)
|
||||
Reference in New Issue
Block a user