feat: utils

This commit is contained in:
Jozef Steinhübl 2024-12-23 11:35:33 +01:00
parent abf7f7eec2
commit de9af63f49
No known key found for this signature in database
GPG key ID: E6BC90C91973B08F
3 changed files with 15 additions and 1 deletions

3
.local/bin/biggest_files Executable file
View file

@ -0,0 +1,3 @@
#!/bin/bash
echo -e "Size\tPath" && du -ah . 2>/dev/null | sort -rh | head -n 20

11
.local/bin/memory Executable file
View file

@ -0,0 +1,11 @@
#!/bin/bash
program=$1
while true
do
ps -eo size,pid,user,command --sort -size | \
awk '{ hr=$1/1024 ; printf("%13.2f Mb ",hr) } { for ( x=4 ; x<=NF ; x++ ) { printf("%s ",$x) } print "" }' |\
cut -d "" -f2 | cut -d "-" -f1 | grep "$program" | \
awk '{print $0; sum+=$1} END {print "Total: " sum " Mb"}'
sleep 0.3
done

2
goog
View file

@ -11,7 +11,7 @@ stuff: list[str] = [
*expand("~/.config/{fish,kitty,nvim,pipewire,sway,swaylock,waybar,xdg-desktop-portal,zed}/**"),
*expand("~/.config/vesktop/{settings,themes}/**"),
"~/.icons/**",
*expand("~/.local/bin/{yarn}"),
*expand("~/.local/bin/{yarn,memory,biggest_files}"),
]
options, _ = getopt(sys.argv[1:], "ds", ["dump", "sync"])