File templates (KDE)

This commit is contained in:
Anthony Axenov 2022-08-19 21:25:46 +08:00
parent 43f6c8c9e9
commit 355953dc35
Signed by: anthony
GPG Key ID: EA9EC32FF7CCD4EC
2 changed files with 89 additions and 1 deletions

View File

@ -1,4 +1,4 @@
# Autogenerated at 19.08.2022 20:58 using ./gen-makefile # Autogenerated at 19.08.2022 21:20 using ./gen-makefile
##composer: [PACK] php + composer ##composer: [PACK] php + composer
composer: php composer-clean composer: php composer-clean
@ -46,6 +46,10 @@ droidcam:
droidcam-obs: droidcam-obs:
@./install/droidcam-obs @./install/droidcam-obs
##file-templates-kde: Install file templates (KDE)
file-templates-kde:
@./install/file-templates-kde
##flameshot-build: [TODO] Build flameshot from src (latest) ##flameshot-build: [TODO] Build flameshot from src (latest)
flameshot-build: flameshot-build:
@./install/flameshot-build @./install/flameshot-build

84
install/file-templates-kde Executable file
View File

@ -0,0 +1,84 @@
#!/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
echo "Finish! You can find them here:"
echo -e "\t$TPL_DIR"
echo