From 4924512b211e7056aeb7ba0fe5e6c76b5eb76d38 Mon Sep 17 00:00:00 2001 From: Dawid Potocki Date: Sun, 5 Aug 2018 08:47:41 +0000 Subject: [PATCH 1/2] Add ufetch-ubuntu --- ufetch-ubuntu | 64 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 ufetch-ubuntu diff --git a/ufetch-ubuntu b/ufetch-ubuntu new file mode 100644 index 0000000..c290739 --- /dev/null +++ b/ufetch-ubuntu @@ -0,0 +1,64 @@ +#!/bin/sh +# +# ufetch-ubuntu - tiny system info for ubuntu + +## INFO + +# user is already defined +host="$(hostname)" +os='Ubuntu' +kernel="$(uname -sr)" +uptime="$(uptime -p | sed 's/up //')" +packages="$(dpkg -l | wc -l)" +shell="$(basename ${SHELL})" + +if [ -z "${WM}" ]; then + if [ "${XDG_CURRENT_DESKTOP}" ]; then + envtype='DE:' + WM="${XDG_CURRENT_DESKTOP}" + elif [ "${DESKTOP_SESSION}" ]; then + envtype='DE:' + WM="${DESKTOP_SESSION}" + elif [ -f "${HOME}/.xinitrc" ]; then + envtype='WM:' + WM="$(tail -n 1 "${HOME}/.xinitrc" | cut -d ' ' -f 2)" + fi +else + envtype='WM:' +fi + +## DEFINE COLORS + +# probably don't change these +if [ -x "$(command -v tput)" ]; then + bold="$(tput bold)" + black="$(tput setaf 0)" + red="$(tput setaf 1)" + green="$(tput setaf 2)" + yellow="$(tput setaf 3)" + blue="$(tput setaf 4)" + magenta="$(tput setaf 5)" + cyan="$(tput setaf 6)" + white="$(tput setaf 7)" + reset="$(tput sgr0)" +fi + +# you can change these +lc="${reset}${bold}${yellow}" # labels +nc="${reset}${bold}${yellow}" # user and hostname +ic="${reset}${bold}${white}" # info +c0="${reset}${bold}${yellow}" # first color + +## OUTPUT + +cat < Date: Mon, 6 Aug 2018 20:25:54 -0500 Subject: [PATCH 2/2] Clean up ufetch-ubuntu --- ufetch-ubuntu | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) mode change 100644 => 100755 ufetch-ubuntu diff --git a/ufetch-ubuntu b/ufetch-ubuntu old mode 100644 new mode 100755 index c290739..ac984fd --- a/ufetch-ubuntu +++ b/ufetch-ubuntu @@ -6,7 +6,7 @@ # user is already defined host="$(hostname)" -os='Ubuntu' +os="$(lsb_release -ds)" kernel="$(uname -sr)" uptime="$(uptime -p | sed 's/up //')" packages="$(dpkg -l | wc -l)" @@ -53,12 +53,12 @@ c0="${reset}${bold}${yellow}" # first color cat <