mirror of
https://github.com/keanuplayz/dotfiles.git
synced 2024-08-15 02:33:12 +00:00
[zsh] add a deswapping function for Linux
This commit is contained in:
parent
db7d25f480
commit
0e1f13cc7b
1 changed files with 4 additions and 1 deletions
|
@ -1,6 +1,5 @@
|
||||||
#!/usr/bin/env zsh
|
#!/usr/bin/env zsh
|
||||||
|
|
||||||
|
|
||||||
count() { echo "$#"; }
|
count() { echo "$#"; }
|
||||||
|
|
||||||
bytecount() { wc -c "$@" | numfmt --to=iec-i; }
|
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
|
done; unset format_name format
|
||||||
|
|
||||||
unset date_formats
|
unset date_formats
|
||||||
|
|
||||||
|
if (( _is_linux )) && command_exists swapoff && command_exists swapon; then
|
||||||
|
deswap() { sudo sh -c 'swapoff --all && swapon --all'; }
|
||||||
|
fi
|
||||||
|
|
Loading…
Reference in a new issue