[zsh] add a deswapping function for Linux

This commit is contained in:
Dmytro Meleshko 2020-10-04 19:26:44 +03:00
parent db7d25f480
commit 0e1f13cc7b
1 changed files with 4 additions and 1 deletions

View File

@ -1,6 +1,5 @@
#!/usr/bin/env zsh
count() { echo "$#"; }
bytecount() { wc -c "$@" | numfmt --to=iec-i; }
@ -91,3 +90,7 @@ for format_name format in "${(kv)date_formats[@]}"; do
done; unset format_name format
unset date_formats
if (( _is_linux )) && command_exists swapoff && command_exists swapon; then
deswap() { sudo sh -c 'swapoff --all && swapon --all'; }
fi