[PR] dylanaraps/neofetch#2313 from RastaDill - Added new distro Astra Linux

Upstream PR: https://github.com/dylanaraps/neofetch/pull/2313
Thanks to @RastaDill

Co-authored-by: Mike Voznesensky <mixask8@mail.ru>
This commit is contained in:
Azalea Gui 2023-04-18 03:32:48 -04:00
commit 9605e4036f

View file

@ -1100,6 +1100,20 @@ get_distro() {
on|tiny) distro="LindowsOS" ;; on|tiny) distro="LindowsOS" ;;
*) distro="$(awk '/Version/ {print $2,$3}' /etc/lindowsos-version)" *) distro="$(awk '/Version/ {print $2,$3}' /etc/lindowsos-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
@ -2244,6 +2258,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}
@ -2637,6 +2655,16 @@ get_wm_theme() {
wm_theme=$(leftwm-theme status | grep "Your current theme" | sed -e 's/Your current theme is //g' -e 's/\,.*$//g') wm_theme=$(leftwm-theme status | grep "Your current theme" | sed -e 's/Your current theme is //g' -e 's/\,.*$//g')
fi fi
;; ;;
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")
@ -3900,6 +3928,28 @@ get_style() {
shopt -u nullglob shopt -u nullglob
;; ;;
"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.
@ -4029,6 +4079,7 @@ get_style() {
} }
theme='' theme=''
local cur_theme='' local cur_theme=''
append_theme "$fly_theme" 'Fly'
append_theme "$qt_theme" 'Qt' append_theme "$qt_theme" 'Qt'
append_theme "$gtk2_theme" 'GTK2' append_theme "$gtk2_theme" 'GTK2'
append_theme "$gtk3_theme" 'GTK3' append_theme "$gtk3_theme" 'GTK3'
@ -4056,7 +4107,7 @@ get_theme() {
kde="widgetStyle" kde="widgetStyle"
lxqt="style" lxqt="style"
qt5ct="style=" # There is a property called 'stylesheets'. qt5ct="style=" # There is a property called 'stylesheets'.
fly="ColorScheme"
get_style get_style
} }
@ -4069,7 +4120,7 @@ get_icons() {
kde="Theme" kde="Theme"
lxqt="icon_theme" lxqt="icon_theme"
qt5ct="icon_theme" qt5ct="icon_theme"
fly="IconTheme"
get_style get_style
icons="$theme" icons="$theme"
@ -4083,6 +4134,7 @@ get_font() {
kde="font" kde="font"
lxqt="font" lxqt="font"
qt5ct="general" qt5ct="general"
fly="DefaultFont"
get_style get_style
font="$theme" font="$theme"
@ -5805,6 +5857,11 @@ tde_config_dir() {
tde_config_dir="${tde_config_dir/$'/:'*}" tde_config_dir="${tde_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
@ -12431,6 +12488,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'