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