Adds resize command to fish functions
This commit is contained in:
parent
83240184be
commit
2a2246795a
4 changed files with 23 additions and 18 deletions
|
|
@ -21,4 +21,11 @@
|
|||
];
|
||||
|
||||
programs.home-manager.enable = true;
|
||||
|
||||
# User Packages
|
||||
home.packages = with pkgs; [
|
||||
aider-chat
|
||||
fortune
|
||||
neofetch
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,6 +22,21 @@
|
|||
'';
|
||||
fish_greeting = "fortune -a";
|
||||
ng = "nvim -c \"Neogit\"";
|
||||
resize_images = ''
|
||||
if not command -q convert
|
||||
echo "Error: ImageMagick is not installed. Please install it first."
|
||||
return 1
|
||||
|
||||
for img in (find . -type f -name "*.JPG")
|
||||
set original_size (stat -f %z "$img")
|
||||
convert "$img" -resize 40% "$img"
|
||||
set new_size (stat -f %z "$img")
|
||||
echo "Processed $img"
|
||||
echo "Original size: $original_size bytes"
|
||||
echo "New size: $new_size bytes"
|
||||
echo "---"
|
||||
end
|
||||
'';
|
||||
};
|
||||
|
||||
interactiveShellInit = ''
|
||||
|
|
|
|||
|
|
@ -1,16 +0,0 @@
|
|||
function resize_images --description "Resize all JPG images in current directory and subdirectories to 40% of original size"
|
||||
if not command -q convert
|
||||
echo "Error: ImageMagick is not installed. Please install it first."
|
||||
return 1
|
||||
end
|
||||
|
||||
for img in (find . -type f -name "*.JPG")
|
||||
set original_size (stat -f %z "$img")
|
||||
convert "$img" -resize 40% "$img"
|
||||
set new_size (stat -f %z "$img")
|
||||
echo "Processed $img"
|
||||
echo "Original size: $original_size bytes"
|
||||
echo "New size: $new_size bytes"
|
||||
echo "---"
|
||||
end
|
||||
end
|
||||
|
|
@ -32,8 +32,6 @@
|
|||
fd
|
||||
sd
|
||||
bat
|
||||
fortune
|
||||
neofetch
|
||||
neovim
|
||||
just
|
||||
tldr
|
||||
|
|
@ -66,6 +64,7 @@
|
|||
"typst"
|
||||
"rsync"
|
||||
"fnm"
|
||||
"imagemagick"
|
||||
];
|
||||
|
||||
casks = [
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue