mirror of
http://github.com/JaeUs3792/dotfiles
synced 2025-12-17 09:13:32 +09:00
scripts : some script added
This commit is contained in:
16
scripts/color_test.sh
Executable file
16
scripts/color_test.sh
Executable file
@ -0,0 +1,16 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# Based on: https://gist.github.com/XVilka/8346728
|
||||||
|
|
||||||
|
awk -v term_cols="${width:-$(tput cols || echo 80)}" 'BEGIN{
|
||||||
|
s="/\\";
|
||||||
|
for (colnum = 0; colnum<term_cols; colnum++) {
|
||||||
|
r = 255-(colnum*255/term_cols);
|
||||||
|
g = (colnum*510/term_cols);
|
||||||
|
b = (colnum*255/term_cols);
|
||||||
|
if (g>255) g = 510-g;
|
||||||
|
printf "\033[48;2;%d;%d;%dm", r,g,b;
|
||||||
|
printf "\033[38;2;%d;%d;%dm", 255-r,255-g,255-b;
|
||||||
|
printf "%s\033[0m", substr(s,colnum%2+1,1);
|
||||||
|
}
|
||||||
|
printf "\n";
|
||||||
|
}'
|
||||||
21
scripts/merge_all_files.sh
Executable file
21
scripts/merge_all_files.sh
Executable file
@ -0,0 +1,21 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
if [ "$#" -ne 3 ]; then
|
||||||
|
echo "Usage : ./merge_all_files.sh [dir] [pattern] [file]"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
|
pushd $1
|
||||||
|
find . -type f -name "*.$2" -exec sh -c 'cat "{}"' >> $3 \;
|
||||||
|
popd
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# files=()
|
||||||
|
# while IFS= read -r -d $'\0'; do
|
||||||
|
# files+=("$REPLY")
|
||||||
|
# done < <(find . -type f -name "*.$1" -print0)
|
||||||
|
|
||||||
|
# echo $files
|
||||||
|
# for file in files; do
|
||||||
|
# echo $file
|
||||||
|
# done
|
||||||
3
scripts/take_screenshot.sh
Executable file
3
scripts/take_screenshot.sh
Executable file
@ -0,0 +1,3 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
scrot -e 'xclip -selection clipboard -t image/png -i $f'
|
||||||
Reference in New Issue
Block a user