This repository was archived by the owner on Dec 27, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig
More file actions
54 lines (49 loc) · 3.35 KB
/
config
File metadata and controls
54 lines (49 loc) · 3.35 KB
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
#### CONFIG
force_distro="slackware" # Configure your distro here
mark_sudoers="false" # Mark sudo users in userlist with *
mark_locked="true" # Mark locked users in userlist in red color
show_userlist="true" # Show list of users
#### COLORS DEFINITION
S_R="$(echo -e "\e[0m")" # Reset all attributes
S_B="$(echo -e "\e[1m")" # Style BOLD
C_R="$(echo -e "\e[31m")" # Color RED
C_LR="$(echo -e "\e[91m")" # Color LIGHT RED
C_G="$(echo -e "\e[32m")" # Color GREEN
C_LG="$(echo -e "\e[92m")" # Color LIGHT GREEN
C_Y="$(echo -e "\e[33m")" # Color YELLOW
C_LY="$(echo -e "\e[93m")" # Color LIGHT YELLOW
C_B="$(echo -e "\e[34m")" # Color BLUE
C_LB="$(echo -e "\e[94m")" # Color LIGHT BLUE
C_M="$(echo -e "\e[35m")" # Color MAGENTA
C_LM="$(echo -e "\e[95m")" # Color LIGHT MAGENTA
C_C="$(echo -e "\e[36m")" # Color CYAN
C_LC="$(echo -e "\e[96m")" # Color LIGHT CYAN
C_N="$(echo -e "\e[90m")" # Color GREY
C_LN="$(echo -e "\e[37m")" # Color LIGHT GREY
C_W="$(echo -e "\e[97m")" # Color WHITE
C_D="$(echo -e "\e[2m")" # Color DIM
#### INFO MESSAGES - not all are available on all systems, you should check and see
# Some of this require systemd or just make sense only if the ttys are spawned ondemand,
# like uptime, used memory, etc, so the defaults are static ones
# and info_wm would work only on Debian / Ubuntu based distros
###############################################################################
info_os="${S_R}${S_B}$(cat /etc/*release | grep PRETTY_NAME | cut -f2 -d\") $(uname -m)"
info_bar="${S_R}${C_D}$(seq -s- 1 $(($(echo "$info_os" | wc -c)-8)) | tr -d "[0-9]")"
info_hostname="${S_R}${S_B}Hostname${S_R}: $(hostname)"
#info_ip="${S_R}${S_B}Local IP${S_R}: $(t=($(ip -c=never route get 8.8.8.8 | head -1 | egrep -o "dev [0-9a-z]+|src [0-9\.]+" | cut -f2 -d" " | sort)); [ ! "$t" ] && echo "network not ready" || echo "${t[0]} (${t[1]})")"
#info_boottime="${S_R}${S_B}Boot time${S_R}: $(systemd-analyze | head -1 | cut -f2 -d=)($(systemd-analyze | head -1 | egrep -o "loader|firmware|kernel|userspace" | sed -z 's/\n\(.\)/+\1/g'))"
#info_lastlog="${S_R}${S_B}Last log${S_R}: $(t=($(last -R | egrep -v 'reboot|shutdown|still' | head -1 | awk '{print $1, $3, $6}' | sed 's/+[0-9]\+:[0-9]\+//' | tr "T" " ")); [ "${t[1]}" = "$(date +%Y-%m-%d)" ] && unset t[1]; t[0]="${t[0]} "; echo "${t[*]}")"
#info_uptime="${S_R}${S_B}Uptime${S_R}: $(uptime -p | sed 's/up //')"
info_kernel="${S_R}${S_B}Kernel${S_R}: $(uname -r)"
info_cpu="${S_R}${S_B}CPU${S_R}: $(cat /proc/cpuinfo | grep "^model name" | cut -f2 -d: | head -1)"
#info_mem_dynamic="${S_R}${S_B}Memory${S_R}: $(free -h | grep "^Mem:" | awk 'BEGIN { OFS=" / " }{ print $3, $2 }') ($(free -h | grep -i swap | awk '{print $2}') swap)"
info_mem="${S_R}${S_B}Memory${S_R}: $(free -h | grep "^Mem:" | awk '{ print $2 }') ($(free -h | grep -i swap | awk '{print $2}') swap)"
info_disk="${S_R}${S_B}Disk${S_R}: $(df -h | grep "/$" | awk 'BEGIN { OFS=" / " }{print $3, $2}')"
#info_wm="${S_R}${S_B}WM${S_R}: $(basename $(update-alternatives --list x-window-manager) | sed 's/^\(.\)/\U\1/')"
info1="$info_os"
info2="$info_bar"
info3="$info_hostname"
info4="$info_kernel"
info5="$info_cpu"
info6="$info_mem"
info7="$info_disk"