35 lines
981 B
Bash
Executable File
35 lines
981 B
Bash
Executable File
#!/bin/bash
|
|
|
|
if [ $(id -u) != "0" ]
|
|
then
|
|
sudo sh install || echo "Make shure your working directory is the same as the one this file and the source folder is located in."
|
|
exit $?
|
|
fi
|
|
|
|
echo "Checking Ncurses"
|
|
check_ncurses=$(dpkg -l | grep libncurses5-dev | wc -l)
|
|
if [ $check_ncurses -le 0 ]
|
|
then
|
|
echo "\e[91mNcurses is not installed but is required for xLock.\e[0m"
|
|
echo "use 'sudo apt-get install libncurses5-dev libncursesw5-dev' to install it."
|
|
exit
|
|
else
|
|
echo "Ncurses is already installed. Skipping"
|
|
fi
|
|
|
|
echo "Checking g++"
|
|
check_ncurses=$(dpkg -l | grep g++ | wc -l)
|
|
if [ $check_ncurses -le 0 ]
|
|
then
|
|
echo "\e[91mg++ is not installed but is required for xLock.\e[0m"
|
|
echo "use 'sudo apt-get install g++' to install it."
|
|
exit
|
|
else
|
|
echo "g++ is already installed. Skipping"
|
|
fi
|
|
echo "Compiling"
|
|
g++ -o /usr/bin/xlock source/main.cpp source/sha512.cpp -lncurses -std=c++11
|
|
|
|
echo "\033[92mInstallation complete\033[0m"
|
|
echo "Use 'xlock chpw' to set/change your password."
|