my-env/install/kde-file-templates

119 lines
2.3 KiB
Plaintext
Raw Normal View History

2022-08-19 13:25:46 +00:00
#!/bin/bash
##makedesc: Install file templates (KDE)
echo
echo "==============================================="
echo "Installing file templates (KDE)..."
echo "==============================================="
echo
TPL_DIR="$HOME/.local/share/templates"
TPL_SRC="$TPL_DIR/.source"
[ ! -d "$TPL_SRC" ] && mkdir -p "$TPL_SRC"
echo "- Markdown" ####################################################
cat <<EOF > "$TPL_SRC/template.md"
# Title
EOF
cat << EOF > "$TPL_DIR/md.desktop"
[Desktop Entry]
Name=Документ Markdown
Icon=text-markdown
Type=Link
URL=.source/template.md
EOF
echo "- PHP" ####################################################
cat <<EOF > "$TPL_SRC/template.php"
<?php
declare(strict_types=1);
ini_set('error_reporting', E_ALL);
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
ini_set('log_errors', 1);
EOF
cat << EOF > "$TPL_DIR/php.desktop"
[Desktop Entry]
Name=PHP-скрипт
Icon=application-x-php
Type=Link
URL=.source/template.php
EOF
echo "- Shell" ####################################################
cat <<EOF > "$TPL_SRC/template.sh"
#!/bin/bash
EOF
cat << EOF > "$TPL_DIR/sh.desktop"
[Desktop Entry]
Name=Bash-скрипт
Icon=terminal
Type=Link
URL=.source/template.sh
EOF
echo "- Go" ####################################################
cat <<EOF > "$TPL_SRC/template.go"
package main
import "fmt"
func main() {
fmt.Println("hello world")
}
EOF
cat << EOF > "$TPL_DIR/go.desktop"
[Desktop Entry]
Name=Golang файл
Type=Link
URL=.source/template.go
EOF
echo "- Dockerfile" ####################################################
cat <<EOF > "$TPL_SRC/Dockerfile"
# https://habr.com/ru/company/ruvds/blog/439980/
# https://docs.docker.com/develop/develop-images/dockerfile_best-practices/
FROM ubuntu:latest
EOF
cat << EOF > "$TPL_DIR/dockerfile.desktop"
[Desktop Entry]
Name=Dockerfile
Type=Link
URL=.source/Dockerfile.go
EOF
echo "- docker-compose" ####################################################
cat <<EOF > "$TPL_SRC/docker-compose.yml"
# https://docs.docker.com/compose/gettingstarted/
# https://docs.docker.com/compose/compose-file/compose-file-v3/
version: "3.9"
services:
EOF
cat << EOF > "$TPL_DIR/docker-compose.desktop"
[Desktop Entry]
Name=docker-compose
Type=Link
URL=.source/docker-compose.yml
EOF
2022-08-19 13:25:46 +00:00
echo
echo "Finish! You can find them here:"
echo -e "\t$TPL_DIR"
echo