-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall_qjournalctl.sh
executable file
·62 lines (56 loc) · 1.83 KB
/
install_qjournalctl.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/bin/bash
#to run this script go into the folder where it is then run: ./install_qjournalctl.sh
#
set -eu
#
cd /home/$USER
#
set -eu
#
folder_name="qjournalctl"
#
if [ -d "/home/$USER/programs_setup/$folder_name" ]; then
cd /home/$USER/
rm -rf /home/$USER/programs_setup/$folder_name
rm -f /home/$USER/.local/share/applications/$folder_name.desktop
echo "removed qjournalctl.."
exit
fi
#
mkdir -p /home/$USER/programs_setup/$folder_name
cd /home/$USER/programs_setup/$folder_name
#
dpkg -l | grep -qw pkg-config || sudo apt-get install pkg-config -y
dpkg -l | grep -qw libssh-dev || sudo apt-get install libssh-dev -y
dpkg -l | grep -qw wget || sudo apt-get install wget -y
dpkg -l | grep -qw libssh-dev || sudo apt-get install libssh-dev -y
#
minnum=1
cpunum=$(expr $(nproc --all) - 1)
echo "number of cpus less one $cpunum"
usenum=1
if (( cpunum > minnum )); then
usenum=$cpunum
echo "using $usenum cpus."
else
echo "using only $usenum cpu."
fi
#
#make -j4 # Compile using 4 threads (change to your number of CPUs)
#make -j$usenum
#
#wget https://www.libssh.org/files/0.9/libssh-0.9.3.tar.xz && tar xf libssh-0.9.3.tar.xz && cd libssh-0.9.3 && mkdir build && cd build && cmake .. && sudo make install && cd ../.. &&
git clone https://github.com/pentix/qjournalctl && cd qjournalctl && ./autogen.sh && make -j$usenum ; ls -lh qjournalctl
mkdir -p $HOME/.local/share/applications
cat << EOF | tee /home/$USER/.local/share/applications/$folder_name.desktop
[Desktop Entry]
Name=QJournalctl
Comment=Graphical User Interface for systemds journalctl
Categories=System;
Exec=/home/xxUserxx/programs_setup/qjournalctl/qjournalctl/qjournalctl
Icon=/home/xxUserxx/programs_setup/qjournalctl/qjournalctl/ui/qjournalctl.png
Terminal=false
Type=Application
EOF
cd /home/$USER/.local/share/applications
sed -i 's/xxUserxx/'$USER'/' $folder_name.desktop