mirror of
https://github.com/The-Repo-Club/DotFiles.git
synced 2024-11-28 18:28:39 -05:00
Update Bfetch Config
Signed-off-by: The-Repo-Club <wayne6324@gmail.com>
This commit is contained in:
parent
79b6a96641
commit
841c11962f
@ -1,3 +1,4 @@
|
|||||||
|
setterm -linewrap off
|
||||||
# See this wiki page for more info:
|
# See this wiki page for more info:
|
||||||
# https://github.com/The-Repo-Club/bfetch/wiki/Customizing-Info
|
# https://github.com/The-Repo-Club/bfetch/wiki/Customizing-Info
|
||||||
|
|
||||||
@ -5,9 +6,7 @@ print_info() {
|
|||||||
info title
|
info title
|
||||||
info underline
|
info underline
|
||||||
info "Uptime " uptime
|
info "Uptime " uptime
|
||||||
|
info " " hwinfo
|
||||||
prin "$(color 1)╔════════════════ $(color 2)Hardware Information $(color 1)════════════════╗"
|
|
||||||
|
|
||||||
info "Host " model
|
info "Host " model
|
||||||
info "CPU " cpu
|
info "CPU " cpu
|
||||||
info "CPU Usage " cpu_usage
|
info "CPU Usage " cpu_usage
|
||||||
@ -15,10 +14,15 @@ print_info() {
|
|||||||
info "Memory " memory
|
info "Memory " memory
|
||||||
info "Resolution " resolution
|
info "Resolution " resolution
|
||||||
info "Disk " disk
|
info "Disk " disk
|
||||||
|
info " " prinfo
|
||||||
prin "$(color 1)╠════════════════ $(color 2)Software Information $(color 1)════════════════╣"
|
info "Keyboard " keyboard
|
||||||
|
info "Mouse " mouse
|
||||||
|
info "Monitor " monitor
|
||||||
|
info "Audio " audio
|
||||||
|
info " " swinfo
|
||||||
info "Distro " distro
|
info "Distro " distro
|
||||||
prin "Init " $init
|
info "Init " init
|
||||||
|
info "Locale " locale # This only works on glibc systems.
|
||||||
info "Kernel " kernel
|
info "Kernel " kernel
|
||||||
info "Packages " packages
|
info "Packages " packages
|
||||||
info "Shell " shell
|
info "Shell " shell
|
||||||
@ -30,17 +34,15 @@ print_info() {
|
|||||||
info "Font " font
|
info "Font " font
|
||||||
info "Terminal " term
|
info "Terminal " term
|
||||||
info "Terminal Font " term_font
|
info "Terminal Font " term_font
|
||||||
prin "$(color 1)╚══════════════════════════════════════════════════════╝"
|
info " " bottom
|
||||||
|
|
||||||
# info "Network " network
|
# info "Network " network
|
||||||
|
|
||||||
# info "GPU Driver " gpu_driver # Linux/macOS only
|
# info "GPU Driver " gpu_driver # Linux/macOS only
|
||||||
# info "Battery " battery
|
# info "Battery " battery
|
||||||
# info "Song " song
|
# info "Song " song
|
||||||
# info "Local IP " local_ip
|
# info "Local IP " local_ip
|
||||||
# info "Public IP " public_ip
|
# info "Public IP " public_ip
|
||||||
# info "Users " users
|
# info "Users " users
|
||||||
# info "Locale " locale # This only works on glibc systems.
|
|
||||||
|
|
||||||
info cols
|
info cols
|
||||||
}
|
}
|
||||||
@ -565,14 +567,14 @@ underline_char="~"
|
|||||||
# Example:
|
# Example:
|
||||||
# separator="->": 'Shell-> bash'
|
# separator="->": 'Shell-> bash'
|
||||||
# separator=" =": 'WM = dwm'
|
# separator=" =": 'WM = dwm'
|
||||||
separator=" » "
|
separator="\a"
|
||||||
|
|
||||||
# Align Text
|
# Align Text
|
||||||
#
|
#
|
||||||
# Default: 'off'
|
# Default: 'off'
|
||||||
# Values: 'left', 'right', 'off'
|
# Values: 'left', 'right', 'off'
|
||||||
# Flag: --align_output
|
# Flag: --align_output
|
||||||
align_output="off"
|
align_output="right"
|
||||||
|
|
||||||
# Color Blocks
|
# Color Blocks
|
||||||
|
|
||||||
@ -872,14 +874,148 @@ background_color=
|
|||||||
stdout="off"
|
stdout="off"
|
||||||
|
|
||||||
# Custom functions
|
# Custom functions
|
||||||
init() {
|
|
||||||
init=$(readlink /sbin/init)
|
|
||||||
init=${init##*/}
|
|
||||||
init=${init%%-*}
|
|
||||||
export init
|
|
||||||
}
|
|
||||||
|
|
||||||
main() {
|
#=== PRINT OUT ================================================================
|
||||||
init
|
# Name: init, hwinfo, swinfo, prinfo and bottom
|
||||||
|
# Description: Prints init, hwinfo, swinfo, prinfo and bottom to bfetch.
|
||||||
|
#==============================================================================
|
||||||
|
#
|
||||||
|
printf -v init "%b" "$(strings /sbin/init | awk 'match($0, /(upstart|systemd|sysvinit|runit)/) { print substr($0, RSTART, RLENGTH); exit; }')"
|
||||||
|
printf -v hwinfo "%b" "$(color 1)╔════════════════$(color 2) Hardware Information $(color 1)═════════════════╗"
|
||||||
|
printf -v swinfo "%b" "$(color 1)╠════════════════$(color 2) Software Information $(color 1)═════════════════╣"
|
||||||
|
printf -v prinfo "%b" "$(color 1)╠═══════════════$(color 2) Peripherals Information $(color 1)═══════════════╣"
|
||||||
|
printf -v bottom "%b" "$(color 1)╚═══════════════════════════════════════════════════════╝"
|
||||||
|
|
||||||
|
#=== FUNCTION =================================================================
|
||||||
|
# Name: get_keyboard
|
||||||
|
# Description: Prints keyboard info to bfetch.
|
||||||
|
#==============================================================================
|
||||||
|
|
||||||
|
get_keyboard () {
|
||||||
|
declare -A AArr
|
||||||
|
DataOut=
|
||||||
|
keyboard="Unknown"
|
||||||
|
if command -v hwinfo &> /dev/null; then
|
||||||
|
while IFS= read -r Line; do
|
||||||
|
if [[ $Line == *"Keyboard"* ]]; then
|
||||||
|
keyboard="${Line%,*}"
|
||||||
|
fi
|
||||||
|
done <<< $( hwinfo --short )
|
||||||
|
fi
|
||||||
|
|
||||||
|
IFS=' ' read -a Arr <<< $keyboard
|
||||||
|
for Val in "${Arr[@]}"; do
|
||||||
|
LCase=${Val,,}
|
||||||
|
[ -z "${AArr[$LCase]}" ] && AArr[$LCase]=$Val && DataOut=$DataOut' '$Val
|
||||||
|
done
|
||||||
|
keyboard="${DataOut:1}"
|
||||||
|
keyboard=${keyboard#"${keyboard%%[![:space:]]*}"}
|
||||||
|
|
||||||
|
if [ -n "$keyboard" ]; then
|
||||||
|
if [ ! "$keyboard" == "Unknown" ]; then
|
||||||
|
printf -v keyboard "%b" "$keyboard"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
main
|
get_keyboard
|
||||||
|
|
||||||
|
#=== FUNCTION =================================================================
|
||||||
|
# Name: get_mouse
|
||||||
|
# Description: Prints mouse info to bfetch.
|
||||||
|
#==============================================================================
|
||||||
|
|
||||||
|
get_mouse () {
|
||||||
|
declare -A AArr
|
||||||
|
DataOut=
|
||||||
|
mouse="Unknown"
|
||||||
|
if command -v hwinfo &> /dev/null; then
|
||||||
|
while IFS= read -r Line; do
|
||||||
|
if [[ $Line == *"Mouse"* ]]; then
|
||||||
|
mouse="${Line%,*}"
|
||||||
|
fi
|
||||||
|
done <<< $( hwinfo --short )
|
||||||
|
fi
|
||||||
|
|
||||||
|
IFS=' ' read -a Arr <<< $mouse
|
||||||
|
for Val in "${Arr[@]}"; do
|
||||||
|
LCase=${Val,,}
|
||||||
|
[ -z "${AArr[$LCase]}" ] && AArr[$LCase]=$Val && DataOut=$DataOut' '$Val
|
||||||
|
done
|
||||||
|
mouse="${DataOut:1}"
|
||||||
|
mouse=${mouse#* }
|
||||||
|
mouse=${mouse#"${mouse%%[![:space:]]*}"}
|
||||||
|
|
||||||
|
if [ -n "$mouse" ]; then
|
||||||
|
if [ ! "$mouse" == "Unknown" ]; then
|
||||||
|
printf -v mouse "%b" "$mouse"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
get_mouse
|
||||||
|
|
||||||
|
#=== FUNCTION =================================================================
|
||||||
|
# Name: get_monitor
|
||||||
|
# Description: Prints monitor info to bfetch.
|
||||||
|
#==============================================================================
|
||||||
|
|
||||||
|
get_monitor () {
|
||||||
|
declare -A AArr
|
||||||
|
DataOut=
|
||||||
|
monitor="Unknown"
|
||||||
|
if command -v hwinfo &> /dev/null; then
|
||||||
|
while IFS= read -r Line; do
|
||||||
|
if [[ ! $Line == "monitor"* ]]; then
|
||||||
|
monitor="${Line%,*}"
|
||||||
|
fi
|
||||||
|
done <<< $( hwinfo --short --monitor )
|
||||||
|
fi
|
||||||
|
|
||||||
|
IFS=' ' read -a Arr <<< $monitor
|
||||||
|
for Val in "${Arr[@]}"; do
|
||||||
|
LCase=${Val,,}
|
||||||
|
[ -z "${AArr[$LCase]}" ] && AArr[$LCase]=$Val && DataOut=$DataOut' '$Val
|
||||||
|
done
|
||||||
|
monitor="${DataOut:1}"
|
||||||
|
monitor=${monitor#"${monitor%%[![:space:]]*}"}
|
||||||
|
|
||||||
|
if [ -n "$monitor" ]; then
|
||||||
|
if [ ! "$monitor" == "Unknown" ]; then
|
||||||
|
printf -v monitor "%b" "$monitor"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
get_monitor
|
||||||
|
|
||||||
|
#=== FUNCTION =================================================================
|
||||||
|
# Name: get_audio
|
||||||
|
# Description: Prints audio info to bfetch.
|
||||||
|
#==============================================================================
|
||||||
|
|
||||||
|
get_audio () {
|
||||||
|
declare -A AArr
|
||||||
|
DataOut=
|
||||||
|
audio="Unknown"
|
||||||
|
if command -v pactl &> /dev/null; then
|
||||||
|
while IFS= read -r Line; do
|
||||||
|
if [[ $Line == *"Server Name"* ]]; then
|
||||||
|
IFS=':' read Type Server <<< "$Line";
|
||||||
|
audio="${Server%,*}"
|
||||||
|
fi
|
||||||
|
done <<< $( pactl info )
|
||||||
|
fi
|
||||||
|
|
||||||
|
IFS=' ' read -a Arr <<< $audio
|
||||||
|
for Val in "${Arr[@]}"; do
|
||||||
|
LCase=${Val,,}
|
||||||
|
[ -z "${AArr[$LCase]}" ] && AArr[$LCase]=$Val && DataOut=$DataOut' '$Val
|
||||||
|
done
|
||||||
|
audio="${DataOut:1}"
|
||||||
|
audio=${audio#"${audio%%[![:space:]]*}"}
|
||||||
|
|
||||||
|
if [ -n "$audio" ]; then
|
||||||
|
if [ ! "$audio" == "Unknown" ]; then
|
||||||
|
printf -v audio "%b" "$audio"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
get_audio
|
||||||
|
Loading…
Reference in New Issue
Block a user