shellnotes/install.sh

113 lines
4 KiB
Bash
Raw Normal View History

2021-04-03 10:58:06 +02:00
#!usr//bin/env bash
:<<'info'
shellnotes - install.sh
(C) Dimitris Marakomihelakis
Released under the "All rights reserved" category. See the RIGHTS.txt file
in /docs/github/ for its full text.
info
2023-08-20 19:37:24 +02:00
VER_TO_INSTALL=4.0 #This is used when updating, it will be changed in every new update
2021-04-03 10:58:06 +02:00
if [ -e ~/.shellnotes/.shellnotes.sh ]; then
echo "Shellnotes is already installed."
echo "If you want to update, please run 'update.sh'."
2021-04-18 11:51:43 +02:00
cd ~/.shellnotes/util/exec
./ifailed
2021-04-03 10:58:06 +02:00
else
mkdir ~/.shellnotes
mv docs ~/.shellnotes/
mv util ~/.shellnotes/
mv def ~/.shellnotes/
mv logs ~/.shellnotes/
mv ver ~/.shellnotes/
2023-08-20 19:37:24 +02:00
mv sne ~/.shellnotes/
2021-04-03 10:58:06 +02:00
mv image ~/.shellnotes/
mv shellnotes.sh ~/.shellnotes/.shellnotes.sh
mv $0 ~/.shellnotes/
mv set_defaults.sh ~/.shellnotes/
mv bash_update.sh ~/.shellnotes/
mv uninstall.sh ~/.shellnotes/
mv update.sh ~/.shellnotes/
2021-07-06 17:49:45 +02:00
if [ -f ./whatsnew.sh ]; then
mv whatsnew.sh ~/.shellnotes/whatsnew.sh
mv whatsnew.txt ~/.shellnotes/whatsnew.txt
fi
2021-04-22 12:54:24 +02:00
rm -rf .gitignore
rm -rf ./README.md
rm -rf ./SECURITY.md
2021-04-03 10:58:06 +02:00
sudo mkdir /usr/local/man/man1 2>/dev/null
sudo cp ~/.shellnotes/docs/manpages/* /usr/local/man/man1/
sudo gzip -f /usr/local/man/man1/*.1
sudo mandb >/dev/null
2023-08-20 19:37:24 +02:00
sudo apt-get install xclip
2021-07-05 09:50:54 +02:00
2023-08-20 19:37:24 +02:00
sudo apt install python3 -y
sudo apt install python3-pip -y
2021-04-03 10:58:06 +02:00
pip install pathlib
2021-07-05 09:50:54 +02:00
2021-04-03 10:58:06 +02:00
sudo apt update
sudo chmod a+x ~/.shellnotes/util/exec/*
2021-04-18 11:51:43 +02:00
sudo chmod +x ~/.shellnotes/.shellnotes.sh
2023-08-20 19:37:24 +02:00
clear
echo "Installing Shellnotes Note Editor (SnE)..."
echo "DEFAULT_PATH=$HOME" > ~/.shellnotes/sne/.env
#Install dependencies
pip install -r ~/.shellnotes/sne/requirements.txt
sudo apt-get install espeak -y
2021-04-03 10:58:06 +02:00
echo "$VER_TO_INSTALL" > ~/.shellnotes/ver/.shellnotes_version
2021-04-03 10:58:06 +02:00
if [ -n "`$SHELL -c 'echo $ZSH_VERSION'`" ]; then
echo "source ~/.shellnotes/.shellnotes.sh" >> ~/.zshrc
sed -i '1 i\#!/bin/zsh' ~/.shellnotes/.shellnotes.sh
clear
echo "Shellnotes was successfully istalled"
echo "------------------------------------"
echo "Please do 'source ~/.zshrc' and reopen your terminal to start using shellnotes."
echo "have fun taking notes!"
elif [ -n "`$SHELL -c 'echo $BASH_VERSION'`" ]; then
echo "source ~/.shellnotes/.shellnotes.sh" >> ~/.bashrc
sed -i '1 i\#!/bin/bash' ~/.shellnotes/.shellnotes.sh
clear
echo "Shellnotes was successfully istalled"
echo "------------------------------------"
echo "Please do 'source ~/.bashrc' and reopen your terminal to start using shellnotes."
echo "have fun taking notes!"
elif [ -n "`$SHELL -c 'echo $CSH_VERSION'`" ]; then
echo "source ~/.shellnotes/.shellnotes.sh" >> ~/.cshrc
sed -i '1 i\#!/bin/csh' ~/.shellnotes/.shellnotes.sh
clear
echo "Shellnotes was successfully istalled"
echo "------------------------------------"
echo "Please do 'source ~/.cshrc' and reopen your terminal to start using shellnotes."
echo "have fun taking notes!"
elif [ -n "`$SHELL -c 'echo $KSH_VERSION'`" ]; then
echo "source ~/.shellnotes/.shellnotes.sh~/.shellnotes.sh" >> ~/.kshrc
sed -i '1 i\#!/bin/ksh' ~/.shellnotes/.shellnotes.sh
clear
echo "Shellnotes was successfully istalled"
echo "------------------------------------"
echo "Please do 'source ~/.kshrc' and reopen your terminal to start using shellnotes."
echo "have fun taking notes!"
elif [ -n "`$SHELL -c 'echo $FISH_VERSION'`" ]; then
echo "source ~/.shellnotes/.shellnotes.sh" >> ~/.fishrc
sed -i '1 i\#!/bin/fish' ~/.shellnotes/.shellnotes.sh
clear
echo "Shellnotes was successfully istalled"
echo "------------------------------------"
echo "Please do 'source ~/.fishrc' and reopen your terminal to start using shellnotes."
echo "have fun taking notes!"
else
clear
echo "Your shell is not supported by shellnotes."
echo "Installation Failed."
2021-04-18 11:51:43 +02:00
cd ~/.shellnotes/util/exec
./ifailed
2021-04-19 21:20:01 +02:00
cd $DIR
2021-04-03 10:58:06 +02:00
fi
fi
2021-04-19 21:20:01 +02:00
cd $DIR