add new scripts
This commit is contained in:
1
display-4k.sh
Normal file
1
display-4k.sh
Normal file
@@ -0,0 +1 @@
|
|||||||
|
xrandr --output HDMI-A-0 --mode 3840x2160 --scale 0.7
|
||||||
17
find_file_containing
Executable file
17
find_file_containing
Executable file
@@ -0,0 +1,17 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
echo "cmd filetype searchtearm"
|
||||||
|
echo "example:"
|
||||||
|
echo "find_file_containing *.ts* setToast"
|
||||||
|
files=$(find ./ -iname "$1")
|
||||||
|
for file in $files; do
|
||||||
|
res=$(cat $file | grep -B 2 -A 3 $2)
|
||||||
|
if [ -n "$res" ]; then
|
||||||
|
echo -e "\e[31m"
|
||||||
|
echo $file
|
||||||
|
echo -e "\e[0m"
|
||||||
|
echo $res
|
||||||
|
fi
|
||||||
|
unset res
|
||||||
|
done
|
||||||
|
echo $1 $2
|
||||||
20
open_recursive.sh
Normal file
20
open_recursive.sh
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
#! /bin/bash
|
||||||
|
|
||||||
|
function open_recursive {
|
||||||
|
PATH1=$1
|
||||||
|
FLAG1=$2
|
||||||
|
ARG1=$3
|
||||||
|
|
||||||
|
if [ -z "$PATH1 " ];then
|
||||||
|
echo "Path must not be empty"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ $FLAG1 == "-f" ] ; then
|
||||||
|
nvim -p $(find $PATH1 -type f -name "*$ARG1")
|
||||||
|
else
|
||||||
|
echo no option given
|
||||||
|
echo "open_recursice PATH -[f] [filetype]"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
open_recursice
|
||||||
Reference in New Issue
Block a user