9 Commits
2 changed files with 8 additions and 12 deletions

No files matched your search

+2 -1
View File
@@ -21,8 +21,9 @@ Supported options are:
- `accent` (0-7)
- `info`
- `separator`
- `colourblocks`
For less simple configuration I recommend editing the script, I tried to keep it simple.
For less trivial configuration I recommend editing the script, I tried to keep it simple.
### Known Issues
MacOS, BSD, and Android don't show much info.
+6 -11
View File
@@ -44,7 +44,7 @@ if [ -e /proc/$$/comm ]; then
case $name in
*sh|"${0##*/}") ;; # skip shells
*[Ll]ogin*|*init*|*systemd*) break;; # exit when the top is reached
*[Ll]ogin*|*init|*systemd*) break;; # exit when the top is reached
# anything else can be assumed to be the terminal
# this has the side affect of catching tmux, but tmux
# detaches from the terminal and therefore ignoring that
@@ -54,12 +54,12 @@ if [ -e /proc/$$/comm ]; then
done
## WM/DE
[ ! "$wm" ] &&
[ "$wm" ] ||
# loop over all processes and check the binary name
for i in /proc/*/comm; do
read -r c < "$i"
case $c in
*bar*) ;;
*bar*|*rc) ;;
awesome|xmonad*|qtile|sway|i3|[bfo]*box|*wm*) wm=${c%%-*}; break;;
esac
done
@@ -99,7 +99,7 @@ if [ -e /proc/$$/comm ]; then
# alternate file with slightly different info
# on my laptop it has the device model (instead of 'hp notebook')
# on my desktop it has the extended motherboard model
'System '*|'Default '*)
'System '*|'Default '*|'To Be Filled'*)
read -r model < /sys/devices/virtual/dmi/id/board_name
esac
@@ -111,9 +111,8 @@ if [ -e /proc/$$/comm ]; then
for i in '/var/db/kiss/installed/*' '/var/lib/pacman/local/[0-9a-z]*' \
'/var/lib/dpkg/info/*.list' '/var/db/xbps/.*' '/var/db/pkg/*/*'; do
set -- $i
[ $# -gt 1 ] && break
[ $# -gt 1 ] && pkgs=$# && break
done
pkgs=${###0}
read -r host < /proc/sys/kernel/hostname
elif [ -f /var/run/dmesg.boot ]; then
@@ -157,10 +156,6 @@ elif [ -f /var/run/dmesg.boot ]; then
while read -r line; do
case $line in
# Ignore useless lines at the top
-*|' '*) ;;
*trademark*) ;;
# os version
FreeBSD*)
# If the OS is already set, no need to set it again
@@ -238,7 +233,7 @@ cpu=${cpu% *-Core*}
col() {
printf ' '
for i in 1 2 3 4 5 6; do
printf '\033[9%sm▅▅' "$i"
printf '\033[9%sm%s' "$i" "${colourblocks:-▅▅}"
done
printf '\033[0m\n'
}