Updated Makefile, README.md and fetch_script_functions.sh

This commit is contained in:
CapCreeperGR 2024-05-06 15:32:55 +03:00
parent 24bc0b6f16
commit c40c3ce423
3 changed files with 22 additions and 16 deletions

View File

@ -14,9 +14,9 @@ build:
install: build/stormfetch config/
mkdir -p $(DESTDIR)$(BINDIR)
mkdir -p $(DESTDIR)$(SYSCONFDIR)"/stormfetch/"
cp build/stormfetch $(DESTDIR)$(BINDIR)"/stormfetch"
cp -r config/. $(DESTDIR)$(SYSCONFDIR)"/stormfetch/"
mkdir -p $(DESTDIR)$(SYSCONFDIR)/stormfetch/
cp build/stormfetch $(DESTDIR)$(BINDIR)/stormfetch
cp -r config/. $(DESTDIR)$(SYSCONFDIR)/stormfetch/
clean:
rm -r build/

View File

@ -16,5 +16,5 @@ make
```
- Run the following command to install stormfetch into your system. You may also append a DESTDIR variable at the end of this line if you wish to install in a different location
```
make install prefix=/usr
make install PREFIX=/usr SYSCONFDIR=/etc
```

View File

@ -15,46 +15,52 @@ get_shell() {
echo "Unknown"
;;
sh|ash|dash|es)
echo ${SHELL##*/} $(${SHELL##*/} --version)
echo "${SHELL##*/} $(${SHELL##*/} --version)"
;;
bash)
echo "${SHELL##*/} $(${SHELL##*/} -c "echo "'$BASH_VERSION')"
;;
*)
SHELL_NAME=${SHELL##*/}
SHELL_VERSION="$($SHELL --version)"
SHELL_VERSION=$(echo $SHELL_VERSION | sed 's/,//g')
SHELL_VERSION=$(echo $SHELL_VERSION | sed 's/ //g')
SHELL_VERSION=$(echo $SHELL_VERSION | sed 's/version//g')
SHELL_VERSION=$(echo $SHELL_VERSION | sed "s/${SHELL_NAME}//g")
echo $SHELL_NAME $SHELL_VERSION
SHELL_VERSION=$(SHELL_VERSION//,//)
SHELL_VERSION=$(SHELL_VERSION// //)
SHELL_VERSION=$(SHELL_VERSION//VERSION//)
SHELL_VERSION=$(SHELL_VERSION//"$SHELL_NAME"//)
echo "$SHELL_NAME $SHELL_VERSION"
unset SHELL_NAME
unset SHELL_VERSION
;;
esac
}
get_cpu_name() {
echo $(grep -m1 "model name" /proc/cpuinfo | cut -d: -f2 | xargs)
grep -m1 "model name" /proc/cpuinfo | cut -d: -f2 | xargs
}
get_total_mem() {
echo $(free --mebi -t | grep 'Total' | tr -s ' ' | cut -d" " -f2)
free --mebi -t | grep 'Total' | tr -s ' ' | cut -d" " -f2
}
get_free_mem() {
echo $(free --mebi -t | grep 'Total' | tr -s ' ' | cut -d" " -f3)
free --mebi -t | grep 'Total' | tr -s ' ' | cut -d" " -f3
}
get_used_mem() {
echo $(free --mebi -t | grep 'Total' | tr -s ' ' | cut -d" " -f4)
free --mebi -t | grep 'Total' | tr -s ' ' | cut -d" " -f4
}
get_de_wm() {
if [[ $DESKTOP_SESSION == "plasma" ]]; then
echo "KDE Plasma $(plasmashell --version | sed 's/plasmashell //g')"
else
echo $DESKTOP_SESSION
echo "$DESKTOP_SESSION"
fi
}
get_screen_resolution() {
if xhost >& /dev/null ; then echo $(xdpyinfo | grep dimensions | tr -s ' ' | cut -d " " -f3)
if xhost >& /dev/null ;then
xdpyinfo | grep dimensions | tr -s ' ' | cut -d " " -f3
fi
}