Added new distro Astra Linux

* Added support Fly DE
* Improvment detected host model
HP ProDesk 490 G3 MT Business PC - bette than - HP 805F
ASUSTeK COMPUTER INC. X201EP - better than X201EP
This commit is contained in:
Mike Voznesensky 2023-04-17 11:17:11 +03:00
parent ccd5d9f526
commit 088e0d484b

109
neofetch
View file

@ -28,7 +28,7 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE. # SOFTWARE.
version=7.1.0 version=7.1.1
# Fallback to a value of '5' for shells which support bash # Fallback to a value of '5' for shells which support bash
# but do not set the 'BASH_' shell variables (osh). # but do not set the 'BASH_' shell variables (osh).
@ -999,6 +999,20 @@ get_distro() {
*) distro="OS Elbrus $(< /etc/mcst_version)" *) distro="OS Elbrus $(< /etc/mcst_version)"
esac esac
elif [[ -f /etc/astra_version ]]; then
distro="Astra Linux"
distro_version="$(cat /etc/astra_version \
| sed -nr 's/^[^0-9]*(([0-9]+\.)*[0-9]+).*/\1/p')"
if [[ $distro_version == "2.12"* ]]; then
distro_codename="ALCE"
else
distro_codename="ALSE"
fi
case $distro_shorthand in
on|tiny) distro=${distro} ;;
*) distro="${distro} ${distro_version} ${distro_codename}"
esac
elif type -p pveversion >/dev/null; then elif type -p pveversion >/dev/null; then
case $distro_shorthand in case $distro_shorthand in
on|tiny) distro="Proxmox VE" ;; on|tiny) distro="Proxmox VE" ;;
@ -1153,8 +1167,8 @@ get_distro() {
10.14*) codename="macOS Mojave" ;; 10.14*) codename="macOS Mojave" ;;
10.15*) codename="macOS Catalina" ;; 10.15*) codename="macOS Catalina" ;;
10.16*) codename="macOS Big Sur" ;; 10.16*) codename="macOS Big Sur" ;;
11.*) codename="macOS Big Sur" ;; 11.*) codename="macOS Big Sur" ;;
12.*) codename="macOS Monterey" ;; 12.*) codename="macOS Monterey" ;;
*) codename=macOS ;; *) codename=macOS ;;
esac esac
@ -1238,6 +1252,16 @@ get_model() {
if [[ -d /system/app/ && -d /system/priv-app ]]; then if [[ -d /system/app/ && -d /system/priv-app ]]; then
model="$(getprop ro.product.brand) $(getprop ro.product.model)" model="$(getprop ro.product.brand) $(getprop ro.product.model)"
elif [[ -f /sys/devices/virtual/dmi/id/product_name &&
-f /sys/devices/virtual/dmi/id/board_vendor ]]; then
product_name=$(< /sys/devices/virtual/dmi/id/product_name)
board_vendor=$(< /sys/devices/virtual/dmi/id/board_vendor)
if [[ $product_name == *"$board_vendor"* ]]; then
model=$product_name
else
model="$board_vendor $product_name"
fi
elif [[ -f /sys/devices/virtual/dmi/id/board_vendor || elif [[ -f /sys/devices/virtual/dmi/id/board_vendor ||
-f /sys/devices/virtual/dmi/id/board_name ]]; then -f /sys/devices/virtual/dmi/id/board_name ]]; then
model=$(< /sys/devices/virtual/dmi/id/board_vendor) model=$(< /sys/devices/virtual/dmi/id/board_vendor)
@ -1811,6 +1835,10 @@ get_de() {
if [[ $DESKTOP_SESSION == *regolith ]]; then if [[ $DESKTOP_SESSION == *regolith ]]; then
de=Regolith de=Regolith
# Added support Fly for Astra Linux
elif [[ $DESKTOP_SESSION == fly ]]; then
de=Fly
elif [[ $XDG_CURRENT_DESKTOP ]]; then elif [[ $XDG_CURRENT_DESKTOP ]]; then
de=${XDG_CURRENT_DESKTOP/X\-} de=${XDG_CURRENT_DESKTOP/X\-}
de=${de/Budgie:GNOME/Budgie} de=${de/Budgie:GNOME/Budgie}
@ -2181,6 +2209,16 @@ get_wm_theme() {
wm_theme=${wm_theme##*\\} wm_theme=${wm_theme##*\\}
wm_theme=${wm_theme%.*} wm_theme=${wm_theme%.*}
;; ;;
fly-wm)
fly_config_file
if grep -q 'DecorTheme' "${fly_config_file}" 2>/dev/null; then
wm_theme=$(awk -F'=' '/^DecorTheme/{print $2}' "${fly_config_file}")
fi
if [ -z "$wm_theme" ] || [ "$wm_theme" = "Not Found" ]; then
wm_theme=Default
fi
;;
esac esac
wm_theme=$(trim_quotes "$wm_theme") wm_theme=$(trim_quotes "$wm_theme")
@ -3179,6 +3217,28 @@ get_style() {
type -p xfconf-query >/dev/null && \ type -p xfconf-query >/dev/null && \
gtk2_theme="$(xfconf-query -c xsettings -p "$xfconf")" gtk2_theme="$(xfconf-query -c xsettings -p "$xfconf")"
;; ;;
"Fly")
fly_config_file
if [[ $fly == "ColorScheme" ]]; then
fly_theme=$(
basename $(
awk -F '=' '/^'"${fly}"'/{print $2}' "${HOME}/.fly/paletterc"
)
)
if [[ $wm_theme == "Default" && $fly_theme != *"FlyDefault"* ]]; then
fly_theme=$(awk -F '=' '/^'"${fly}"'/{print $2}'\
"${HOME}/.config/fly-admin-themerc")
fi
elif [[ $fly == "IconTheme" ]]; then
fly_theme=$(awk -F '=' '/^'"${fly}"'/{print $2}' "${fly_config_file}")
elif [[ $fly == "DefaultFont" ]]; then
fly_theme=$(awk -F'=' '/^'"${fly}"'/\
{gsub(/"/, "", $2); \
sub(/-.*/, "", $2); \
print $2}' "${fly_config_file}")
fi
fly_theme+=" [$de], "
;;
esac esac
# Check for general GTK2 Theme. # Check for general GTK2 Theme.
@ -3245,7 +3305,7 @@ get_style() {
fi fi
# Final string. # Final string.
theme="${kde_theme}${gtk2_theme}${gtk3_theme}" theme="${fly_theme}${kde_theme}${gtk2_theme}${gtk3_theme}"
theme="${theme%, }" theme="${theme%, }"
# Make the output shorter by removing "[GTKX]" from the string. # Make the output shorter by removing "[GTKX]" from the string.
@ -3254,6 +3314,7 @@ get_style() {
theme="${theme/ '[GTK2/3]'}" theme="${theme/ '[GTK2/3]'}"
theme="${theme/ '[KDE]'}" theme="${theme/ '[KDE]'}"
theme="${theme/ '[Plasma]'}" theme="${theme/ '[Plasma]'}"
theme="${theme/ '[Fly]'}"
fi fi
fi fi
} }
@ -3264,6 +3325,7 @@ get_theme() {
gconf="gtk_theme" gconf="gtk_theme"
xfconf="/Net/ThemeName" xfconf="/Net/ThemeName"
kde="Name" kde="Name"
fly="ColorScheme"
get_style get_style
} }
@ -3274,6 +3336,7 @@ get_icons() {
gconf="icon_theme" gconf="icon_theme"
xfconf="/Net/IconThemeName" xfconf="/Net/IconThemeName"
kde="Theme" kde="Theme"
fly="IconTheme"
get_style get_style
icons="$theme" icons="$theme"
@ -3285,6 +3348,7 @@ get_font() {
gconf="font_theme" gconf="font_theme"
xfconf="/Gtk/FontName" xfconf="/Gtk/FontName"
kde="font" kde="font"
fly="DefaultFont"
get_style get_style
font="$theme" font="$theme"
@ -4854,6 +4918,11 @@ kde_config_dir() {
kde_config_dir="${kde_config_dir/$'/:'*}" kde_config_dir="${kde_config_dir/$'/:'*}"
} }
fly_config_file() {
# Return main path the fly config file
fly_config_file=${HOME}/.fly/theme/current.themerc
}
term_padding() { term_padding() {
# Get terminal padding to properly align cursor. # Get terminal padding to properly align cursor.
[[ -z "$term" ]] && get_term [[ -z "$term" ]] && get_term
@ -10237,6 +10306,38 @@ RO ROSA ROS ROSAROSAR ROSARO RO
EOF EOF
;; ;;
"Astra Linux"*)
if [[ $ascii_distro == *"ALCE"* ]]; then
set_colors 160 231
else
set_colors 32 231
fi
read -rd '' ascii_data <<'EOF'
${c1} AA
${c1} AaaA
${c1} Aa${c2}/\\${c1}aA
${c1} Aa${c2}/${c1}aa${c2}\\${c1}aA
${c1} Aa${c2}/${c1}aAAa${c2}\\${c1}aA
${c1} aA${c2}/${c1}aaAAaa${c2}\\${c1}Aa
${c1} aA${c2}/${c1}aaAAAAaa${c2}\\${c1}Aa
${c1} aaaaaaAAAAa${c2}/${c1}aaAAAAAAaa${c2}\\${c1}aAAAAaaaaa
${c1} aAAa${c2}-----${c1}aaaaaAAAAAAAAAAaaaaa${c2}-----${c1}aAAa
${c1} aAA${c2}\ ${c1}aAAAAAAAAAAAAAAAAAAAAAAa${c2} /${c1}AAa
${c1} aAa${c2}\\${c1}aAAA${c2}\\${c1}AAAA${c2}\\${c1}AAAA${c2}\\${c1}AAA${c2}\\${c1}AAa${c2}/${c1}aAa
${c1} aAa${c2}\\${c1}aA${c2}\\\\${c1}AAA${c2}\\\\${c1}AAA${c2}\\\\${c1}AA${c2}\\\\/${c1}aAa
${c1} aAA${c2}\\${c1}aA${c2}\\\\${c1}AAA${c2}\\\\${c1}AAA${c2}\\\\${c1}Aa${c2}/${c1}AAa
${c1} aA${c2}\\${c1}aA${c2}\\\\${c1}AAA${c2}\\\\${c1}AAA${c2}\\\\/${c1}Aa
${c1} aA${c2}/${c1}AA${c2}\\\\\\${c1}AA${c2}\\\\\\${c1}AA${c2}\\\\\\${c1}Aa
${c1} aA${c2}/\\${c1}AAa${c2}\\\\\\${c1}Aa${c2}\\\\\\${c1}Aa${c2}\\\\\\${c1}Aa
${c1} aA${c2}/\\\\${c1}AAa${c2}\\\\/\\${c1}a${c2}\\\\\\${c1}Aa${c2}\\\\${c1}Aa
${c1} aA${c2}/${c1}a${c2}\\\\\\${c1}Aa${c2}\\/${c1}AA${c2}\\\\\\\\\\${c1}Aa${c2}\\\\${c1}Aa
${c1} aA${c2}/${c1}aA${c2}\\\\/${c1}aAa aAa${c2}\\\\\\${c1}Aa${c2}\\${c1}Aa
${c1} aA${c2}/\\${c1}A${c2}\\/${c1}Aa aA${c2}\\\\${c1}A${c2}\\\\${c1}Aa
${c1} A${c2}|/${c1}aaAa aAaa${c2}\\|${c1}A
${c1} aAaa aaAa
EOF
;;
"sabotage"*) "sabotage"*)
set_colors 4 7 1 set_colors 4 7 1
read -rd '' ascii_data <<'EOF' read -rd '' ascii_data <<'EOF'