Templates

pull/1/head
kalle 2022-04-14 21:26:15 +02:00
parent cfd2ad4fb6
commit b02433c10c
7 changed files with 48 additions and 0 deletions

View File

@ -0,0 +1,6 @@
[Desktop Entry]
Name=Latex document
Comment=A blank latex document
Type=Link
URL=src/Latex document.tex
Icon=text-x-bibtex

View File

@ -0,0 +1,6 @@
[Desktop Entry]
Name=Shell script
Comment=A blank shell script
Type=Link
URL=src/Shell script.sh
Icon=text-x-script

View File

@ -0,0 +1,9 @@
\documentclass{article} % This command is used to set the type of document you are working on such as an article, book, or presenation
\usepackage{geometry} % This package allows the editing of the page layout
\usepackage{amsmath} % This package allows the use of a large range of mathematical formula, commands, and symbols
\usepackage{graphicx} % This package allows the importing of images
\begin{document}
\end{document}

1
Templates/src/Shell script.sh Executable file
View File

@ -0,0 +1 @@
#!/usr/bin/env bash

12
scripts/new Executable file
View File

@ -0,0 +1,12 @@
#!/usr/bin/env bash
TEMPLATE_DIR="$HOME/Templates/src"
src=`ls "$TEMPLATE_DIR" | fzf --preview="$HOME/.dots/scripts/template_preview $TEMPLATE_DIR/{}"`
if [ -n "$src" ]; then
read -p "File name: " name
if [ -n "$name" ]; then
cp "$TEMPLATE_DIR/$src" "$name" -r
fi
fi

8
scripts/template_preview Executable file
View File

@ -0,0 +1,8 @@
#!/usr/bin/env bash
file="$TEMPLATE_DIR/$1"
if [ -d "$file" ]; then
tree -C "$file"
else
bat -pf "$file"
fi

View File

@ -111,3 +111,9 @@ else
mkdir "$HOME/bin"
ln -s $DOTS_DIR/scripts $SCRIPT_DIR
fi
# Templates
TEMPLATE_DIR="$HOME/Templates"
rmdir "$TEMPLATE_DIR"
ln -s "$DOTS_DIR/Templates" "$TEMPLATE_DIR"