#! /bin/zsh # # this file: # https://dataswamp.org/~incal/conf/.zsh/ram swap-hibernate () { local ram=${1:-$(awk '/MemTotal/{ print $2 }' /proc/meminfo)} local swap_small=$(( $ram + int(sqrt($ram)) )) local swap_big=$(( $ram * 2 )) echo "RAM: " $ram echo "Swap:" $swap_small "-" $swap_big } alias sahib=swap-hibernate