From 3387c72487145fe38859a78c42f9bedd3b01b6d4 Mon Sep 17 00:00:00 2001 From: Mike Voznesensky Date: Thu, 6 Apr 2023 20:38:46 +0300 Subject: [PATCH 1/4] Replaces tabs on whitespace in column --- screenfetch-dev | 60 ++++++++++++++++++++++++------------------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/screenfetch-dev b/screenfetch-dev index 03839b89..e0869d8c 100755 --- a/screenfetch-dev +++ b/screenfetch-dev @@ -151,7 +151,7 @@ ubuntu_codenames=( '(Breezy Badger)' # 5.10 'LTS (Dapper Drake)' # 6.06 '(Edgy Eft)' # 6.10 - '(Feisty Fawn)' # 7.04 + '(Feisty Fawn)' # 7.04 '(Gutsy Gibbon)' # 7.10 'LTS (Hardy Heron)' # 8.04 '(Intrepid Ibex)' # 8.10 @@ -170,13 +170,13 @@ ubuntu_codenames=( '(Vivid Vervet)' # 15.04 '(Wily Werewolf)' # 15.10 'LTS (Xenial Xerus)' # 16.04 - '(Yakkety Yak)' # 16.10 - '(Zesty Zapus)' # 17.04 + '(Yakkety Yak)' # 16.10 + '(Zesty Zapus)' # 17.04 '(Artful Aardvark)' # 17.10 'LTS (Bionic Beaver)' # 18.04 '(Cosmic Cuttlefish)' # 18.10 - '(Disco Dingo)' # 19.04 - '(Eoan Ermine)' # 19.10 + '(Disco Dingo)' # 19.04 + '(Eoan Ermine)' # 19.10 'LTS (Focal Fossa)' # 20.04 '(Groovy Gorilla)' # 20.10 '(Hirsute Hippo)' # 21.04 @@ -268,30 +268,30 @@ getColor () { fi case "${tmp_color}" in # Standards - 'black') color_ret='\033[0m\033[30m';; - 'red') color_ret='\033[0m\033[31m';; - 'green') color_ret='\033[0m\033[32m';; - 'brown') color_ret='\033[0m\033[33m';; - 'blue') color_ret='\033[0m\033[34m';; - 'purple') color_ret='\033[0m\033[35m';; - 'cyan') color_ret='\033[0m\033[36m';; - 'yellow') color_ret='\033[0m\033[1;33m';; - 'white') color_ret='\033[0m\033[1;37m';; + 'black') color_ret='\033[0m\033[30m';; + 'red') color_ret='\033[0m\033[31m';; + 'green') color_ret='\033[0m\033[32m';; + 'brown') color_ret='\033[0m\033[33m';; + 'blue') color_ret='\033[0m\033[34m';; + 'purple') color_ret='\033[0m\033[35m';; + 'cyan') color_ret='\033[0m\033[36m';; + 'yellow') color_ret='\033[0m\033[1;33m';; + 'white') color_ret='\033[0m\033[1;37m';; # Bolds - 'dark grey'|'dark gray') color_ret='\033[0m\033[1;30m';; - 'light red') color_ret='\033[0m\033[1;31m';; - 'light green') color_ret='\033[0m\033[1;32m';; - 'light blue') color_ret='\033[0m\033[1;34m';; - 'light purple') color_ret='\033[0m\033[1;35m';; - 'light cyan') color_ret='\033[0m\033[1;36m';; - 'light grey'|'light gray') color_ret='\033[0m\033[37m';; + 'dark grey'|'dark gray') color_ret='\033[0m\033[1;30m';; + 'light red') color_ret='\033[0m\033[1;31m';; + 'light green') color_ret='\033[0m\033[1;32m';; + 'light blue') color_ret='\033[0m\033[1;34m';; + 'light purple') color_ret='\033[0m\033[1;35m';; + 'light cyan') color_ret='\033[0m\033[1;36m';; + 'light grey'|'light gray') color_ret='\033[0m\033[37m';; # Some 256 colors - 'orange') color_ret="$(colorize '202')";; #DarkOrange - 'light orange') color_ret="$(colorize '214')";; #Orange1 + 'orange') color_ret="$(colorize '202')";; #DarkOrange + 'light orange') color_ret="$(colorize '214')";; #Orange1 # HaikuOS - 'black_haiku') color_ret="$(colorize '7')";; + 'black_haiku') color_ret="$(colorize '7')";; #ROSA color - 'rosa_blue') color_ret='\033[01;38;05;25m';; + 'rosa_blue') color_ret='\033[01;38;05;25m';; # ArcoLinux 'arco_blue') color_ret='\033[1;38;05;111m';; esac @@ -360,7 +360,7 @@ detectColors () { supported_distros="ALDOS, Alpine Linux, Alter Linux, Amazon Linux, Antergos, Arch Linux (Old and Current Logos), Arch Linux 32, ArcoLinux, Artix Linux, \ blackPanther OS, BLAG, BunsenLabs, CentOS, Chakra, Chapeau, Chrome OS, Chromium OS, CrunchBang, CRUX, \ -Debian, Deepin, DesaOS,Devuan, Dragora, DraugerOS, elementary OS, EuroLinux, Evolve OS, Sulin, Exherbo, Fedora(Old and Current Logos), Frugalware, Fuduntu, Funtoo, \ +Debian, Astra Linux, Deepin, DesaOS,Devuan, Dragora, DraugerOS, elementary OS, EuroLinux, Evolve OS, Sulin, Exherbo, Fedora(Old and Current Logos), Frugalware, Fuduntu, Funtoo, \ Fux, Gentoo, gNewSense, Guix System, Hyperbola GNU/Linux-libre, januslinux, Jiyuu Linux, Kali Linux, KaOS, KDE neon, Kogaion, Korora, \ LinuxDeepin, Linux Mint, LMDE, Logos, Mageia, Mandriva/Mandrake, Manjaro, Mer, Netrunner, NixOS, OBRevenge, openSUSE, \ OS Elbrus, Oracle Linux, Parabola GNU/Linux-libre, Pardus, Parrot Security, PCLinuxOS, PeppermintOS, Proxmox VE, PureOS, Qubes OS, \ @@ -643,10 +643,10 @@ detectdistro () { distro="Debian" fi ;; - "DraugerOS") - distro = "DraugerOS" - fake_distro="${distro}" - ;; + "DraugerOS") + distro="DraugerOS" + fake_distro="${distro}" + ;; "elementary"|"elementary OS") distro="elementary OS" ;; From 5838676c5cd22d9648d8c8419a8a652e75cc41fa Mon Sep 17 00:00:00 2001 From: Mike Voznesensky Date: Mon, 10 Apr 2023 09:02:58 +0300 Subject: [PATCH 2/4] Added new distro Astra Linux --- screenfetch-dev | 82 ++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 74 insertions(+), 8 deletions(-) diff --git a/screenfetch-dev b/screenfetch-dev index e0869d8c..a663586b 100755 --- a/screenfetch-dev +++ b/screenfetch-dev @@ -33,7 +33,7 @@ #LC_ALL=C -scriptVersion="3.9.1" +scriptVersion="3.9.2" ###################### # Settings for fetcher @@ -141,6 +141,7 @@ wmnames=( 'deepin-wm' 'sway' 'mwm' + 'fly-wm' ) # Array with full Ubuntu release codenames, used so that the script will display @@ -290,8 +291,10 @@ getColor () { 'light orange') color_ret="$(colorize '214')";; #Orange1 # HaikuOS 'black_haiku') color_ret="$(colorize '7')";; - #ROSA color + # ROSA color 'rosa_blue') color_ret='\033[01;38;05;25m';; + # Astra Linux + 'astra_blue') color_ret='\033[01;38;05;32m';; # ArcoLinux 'arco_blue') color_ret='\033[1;38;05;111m';; esac @@ -369,12 +372,12 @@ SparkyLinux, SteamOS, SUSE Linux Enterprise, SwagArch, TeArch, TinyCore, Trisque supported_other="Dragonfly/Free/Open/Net BSD, Haiku, macOS, Windows+Cygwin and Windows+MSYS2." -supported_dms="KDE, GNOME, Unity, Xfce, LXDE, Cinnamon, MATE, Deepin, CDE, RazorQt and Trinity." +supported_dms="KDE, GNOME, Unity, Xfce, LXDE, Cinnamon, MATE, Deepin, CDE, RazorQt and Trinity, Fly." supported_wms="2bwm, 9wm, Awesome, Beryl, Blackbox, Cinnamon, chromeos-wm, Compiz, deepin-wm, \ dminiwm, dwm, dtwm, E16, E17, echinus, Emerald, FluxBox, FLWM, FVWM, herbstluftwm, howm, IceWM, KWin, \ Metacity, monsterwm, Musca, Gala, Mutter, Muffin, Notion, OpenBox, PekWM, Ratpoison, Sawfish, ScrotWM, SpectrWM, \ -StumpWM, subtle, sway, TWin, WindowMaker, WMFS, wmii, Xfwm4, XMonad and i3." +StumpWM, subtle, sway, TWin, WindowMaker, WMFS, wmii, Xfwm4, XMonad and i3, fly-wm." displayHelp () { echo "${underline}Usage${c0}:" @@ -643,6 +646,11 @@ detectdistro () { distro="Debian" fi ;; + "AstraLinux") + distro="Astra Linux" + distro_release=$(cat /etc/astra_version) + distro_codename="n/a" + ;; "DraugerOS") distro="DraugerOS" fake_distro="${distro}" @@ -1200,6 +1208,7 @@ detectdistro () { crux) distro="CRUX" ;; cygwin) distro="Cygwin" ;; debian) distro="Debian" ;; + astralinux | astra | 'astra linux') distro="Astra Linux" ;; devuan) distro="Devuan" ;; deepin) distro="Deepin" ;; uos) distro="Uos" ;; @@ -1392,7 +1401,7 @@ detectpkgs () { pkgs=$(pacman-g2 -Q | wc -l) ;; 'Debian'|'Ubuntu'|'Mint'|'Fuduntu'|'KDE neon'|'Devuan'|'OS Elbrus'|'Raspbian'|'LMDE'|'CrunchBang'|'Peppermint'| \ 'LinuxDeepin'|'Deepin'|'Kali Linux'|'Trisquel'|'elementary OS'|'gNewSense'|'BunsenLabs'|'SteamOS'|'Parrot Security'| \ - 'GrombyangOS'|'DesaOS'|'Zorin OS'|'Proxmox VE'|'PureOS'|'DraugerOS') + 'GrombyangOS'|'DesaOS'|'Zorin OS'|'Proxmox VE'|'PureOS'|'DraugerOS'|'Astra Linux') pkgs=$(dpkg -l | grep -c '^i') ;; 'Slackware') pkgs=$(ls -1 /var/log/packages | wc -l) ;; @@ -2019,6 +2028,10 @@ detectde () { de = "Xfce5" exit } + else if ($0 ~ /^FLY_SESSION/) { + de = "Fly" + exit + } } END { print de }') @@ -2336,6 +2349,7 @@ detectwm () { 'wmii') WM="wmii";; 'xfwm4') WM="Xfwm4";; 'xmonad.*') WM="XMonad";; + 'fly-wm') WM="fly-wm";; esac fi if [[ ${WM} != "Not Found" ]]; then @@ -2421,6 +2435,7 @@ detectwm () { 'wmii') WM="wmii";; 'xfwm4') WM="Xfwm4";; 'xmonad') WM="XMonad";; + 'fly-wm') WM="fly-wm";; esac fi verboseOut "Finding window manager...found as '$WM'" @@ -2649,7 +2664,16 @@ detectwmtheme () { if [ -f "${XDG_CONFIG_HOME:-${HOME}/.config}/xfce4/xfconf/xfce-perchannel-xml/xfwm4.xml" ]; then Win_theme="$(xfconf-query -c xfwm4 -p /general/theme)" fi - ;; + ;; + 'fly-wm') + config_fly="${HOME}/.fly/theme/current.themerc" + if grep -q 'DecorTheme' "${config_fly}" 2>/dev/null; then + Win_theme=$(awk -F'=' '/^DecorTheme/{print $2}' "${config_fly}") + fi + if [ -z "$Win_theme" ] || [ "$Win_theme" = "Not Found" ]; then + Win_theme="Default" + fi + ;; esac fi verboseOut "Finding window manager theme...found as '$Win_theme'" @@ -2847,7 +2871,16 @@ detectgtk () { if grep -q 'FontName' "${config_home}${lxdeconf}" 2>/dev/null; then gtkFont=$(awk -F'=' '/sGtk\/FontName/ {print $2}' "${config_home}${lxdeconf}") fi - ;; + ;; + 'Fly'*) + config_fly="${HOME}/.fly/theme/current.themerc" + if grep -q 'IconTheme' "${config_fly}" 2>/dev/null; then + gtkIcons=$(awk -F'=' '/^IconTheme/{print $2}' "${config_fly}") + fi + if grep -q 'DefaultFont' "${config_fly}" 2>/dev/null; then + gtkFont=$(awk -F'=' '/^DefaultFont/{gsub(/"/, "", $2); sub(/-.*/, "", $2); print $2}' "${config_fly}") + fi + ;; # /home/me/.config/rox.sourceforge.net/ROX-Session/Settings.xml @@ -4279,6 +4312,39 @@ asciiText () { "${c1} ROSAROSAROSAROSAR %s") ;; + "Astra Linux") + if [[ "$no_color" != "1" ]]; then + c1=$(getColor 'astra_blue') + c2=$(getColor 'white') + fi + if [ -n "${my_lcolor}" ]; then c1="${my_lcolor}"; c2="${my_color}"; fi + startline="3" + logowidth="40" + fulloutput=( +"${c1} AA " +"${c1} AaaA " +"${c1} Aa${c2}/\\\\${c1}aA " +"${c1} Aa${c2}/${c1}aa${c2}\\\\${c1}aA %s" +"${c1} Aa${c2}/${c1}aAAa${c2}\\\\${c1}aA %s" +"${c1} aA${c2}/${c1}aaAAaa${c2}\\\\${c1}Aa %s" +"${c1} aA${c2}/${c1}aaAAAAaa${c2}\\\\${c1}Aa %s" +"${c1} aaaaaaAAAAa${c2}/${c1}aaAAAAAAaa${c2}\\\\${c1}aAAAAaaaaa %s" +"${c1} aAAa${c2}-----${c1}aaaaaAAAAAAAAAAaaaaa${c2}-----${c1}aAAa %s" +"${c1} aAA${c2}\ ${c1}aAAAAAAAAAAAAAAAAAAAAAAa${c2} /${c1}AAa %s" +"${c1} aAa${c2}\\\\${c1}aAAA${c2}\\\\${c1}AAAA${c2}\\\\${c1}AAAA${c2}\\\\${c1}AAA${c2}\\\\${c1}AAa${c2}/${c1}aAa %s" +"${c1} aAa${c2}\\\\${c1}aA${c2}\\\\\\\\${c1}AAA${c2}\\\\\\\\${c1}AAA${c2}\\\\\\\\${c1}AA${c2}\\\\\\\\/${c1}aAa %s" +"${c1} aAA${c2}\\\\${c1}aA${c2}\\\\\\\\${c1}AAA${c2}\\\\\\\\${c1}AAA${c2}\\\\\\\\${c1}Aa${c2}/${c1}AAa %s" +"${c1} aA${c2}\\\\${c1}aA${c2}\\\\\\\\${c1}AAA${c2}\\\\\\\\${c1}AAA${c2}\\\\\\\\/${c1}Aa %s" +"${c1} aA${c2}/${c1}AA${c2}\\\\\\\\\\\\${c1}AA${c2}\\\\\\\\\\\\${c1}AA${c2}\\\\\\\\\\\\${c1}Aa %s" +"${c1} aA${c2}/\\\\${c1}AAa${c2}\\\\\\\\\\\\${c1}Aa${c2}\\\\\\\\\\\\${c1}Aa${c2}\\\\\\\\\\\\${c1}Aa %s" +"${c1} aA${c2}/\\\\\\\\${c1}AAa${c2}\\\\\\\\/\\\\${c1}a${c2}\\\\\\\\\\\\${c1}Aa${c2}\\\\\\\\${c1}Aa %s" +"${c1} aA${c2}/${c1}a${c2}\\\\\\\\\\\\${c1}Aa${c2}\\\\/${c1}AA${c2}\\\\\\\\\\\\\\\\\\\\${c1}Aa${c2}\\\\\\\\${c1}Aa %s" +"${c1} aA${c2}/${c1}aA${c2}\\\\\\\\/${c1}aAa aAa${c2}\\\\\\\\\\\\${c1}Aa${c2}\\\\${c1}Aa %s" +"${c1} aA${c2}/\\\\${c1}A${c2}\\\\/${c1}Aa aA${c2}\\\\\\\\${c1}A${c2}\\\\\\\\${c1}Aa %s" +"${c1} A${c2}|/${c1}aaAa aAaa${c2}\\\\|${c1}A %s" +"${c1} aAaa aaAa %s") + ;; + "Red Hat Enterprise Linux") if [[ "$no_color" != "1" ]]; then c1=$(getColor 'light red') # Light Red @@ -6294,7 +6360,7 @@ infoDisplay () { "SparkyLinux"|"OBRevenge"|"Source Mage GNU/Linux") labelcolor=$(getColor 'light red') ;; - "ROSA"|"januslinux") + "ROSA"|"Astra Linux"|"januslinux") labelcolor=$(getColor 'white') ;; "CrunchBang"|"Viperr"|"elementary"*) From 5f54a699ff56fdd92eb67fa44617f581ecf4749b Mon Sep 17 00:00:00 2001 From: Mike Voznesensky Date: Mon, 10 Apr 2023 11:19:57 +0300 Subject: [PATCH 3/4] Refactoring * removed empy or extra lines * replaced wrong tabs indention * replaced tabs indention on whitespaces on color section, lists data --- screenfetch-dev | 385 ++++++++++++++++++++++++------------------------ 1 file changed, 192 insertions(+), 193 deletions(-) diff --git a/screenfetch-dev b/screenfetch-dev index a663586b..37fe39e3 100755 --- a/screenfetch-dev +++ b/screenfetch-dev @@ -45,38 +45,38 @@ scriptVersion="3.9.2" # This sets the information to be displayed. Available: distro, Kernel, DE, WM, Win_theme, Theme, Icons, Font, Background, ASCII. # To get just the information, and not a text-art logo, you would take "ASCII" out of the below variable. valid_display=( - 'distro' - 'host' - 'kernel' - 'uptime' - 'pkgs' - 'shell' - 'res' - 'de' - 'wm' - 'wmtheme' - 'gtk' - 'disk' - 'cpu' - 'gpu' - 'mem' + 'distro' + 'host' + 'kernel' + 'uptime' + 'pkgs' + 'shell' + 'res' + 'de' + 'wm' + 'wmtheme' + 'gtk' + 'disk' + 'cpu' + 'gpu' + 'mem' ) display=( - 'distro' - 'host' - 'kernel' - 'uptime' - 'pkgs' - 'shell' - 'res' - 'de' - 'wm' - 'wmtheme' - 'gtk' - 'cpu' - 'disk' - 'gpu' - 'mem' + 'distro' + 'host' + 'kernel' + 'uptime' + 'pkgs' + 'shell' + 'res' + 'de' + 'wm' + 'wmtheme' + 'gtk' + 'cpu' + 'disk' + 'gpu' + 'mem' ) # Display Type: ASCII or Text display_type="ASCII" @@ -92,95 +92,95 @@ display_logo="no" # Order matters! # Removed WM's: compiz wmnames=( - 'fluxbox' - 'openbox' - 'blackbox' - 'xfwm4' - 'metacity' - 'kwin' - 'twin' - 'icewm' - 'pekwm' - 'flwm' - 'flwm_topside' - 'fvwm' - 'dwm' - 'awesome' - 'wmaker' - 'stumpwm' - 'musca' - 'xmonad.*' - 'i3' - 'ratpoison' - 'scrotwm' - 'spectrwm' - 'wmfs' - 'wmii' - 'beryl' - 'subtle' - 'e16' - 'enlightenment' - 'sawfish' - 'emerald' - 'monsterwm' - 'dminiwm' - 'compiz' - 'Finder' - 'herbstluftwm' - 'howm' - 'notion' - 'bspwm' - 'cinnamon' - '2bwm' - 'echinus' - 'swm' - 'budgie-wm' - 'dtwm' - '9wm' - 'chromeos-wm' - 'deepin-wm' - 'sway' - 'mwm' - 'fly-wm' + 'fluxbox' + 'openbox' + 'blackbox' + 'xfwm4' + 'metacity' + 'kwin' + 'twin' + 'icewm' + 'pekwm' + 'flwm' + 'flwm_topside' + 'fvwm' + 'dwm' + 'awesome' + 'wmaker' + 'stumpwm' + 'musca' + 'xmonad.*' + 'i3' + 'ratpoison' + 'scrotwm' + 'spectrwm' + 'wmfs' + 'wmii' + 'beryl' + 'subtle' + 'e16' + 'enlightenment' + 'sawfish' + 'emerald' + 'monsterwm' + 'dminiwm' + 'compiz' + 'Finder' + 'herbstluftwm' + 'howm' + 'notion' + 'bspwm' + 'cinnamon' + '2bwm' + 'echinus' + 'swm' + 'budgie-wm' + 'dtwm' + '9wm' + 'chromeos-wm' + 'deepin-wm' + 'sway' + 'mwm' + 'fly-wm' ) # Array with full Ubuntu release codenames, used so that the script will display # i.e. "Ubuntu 18.04 LTS (Bionic Beaver)" instead of "Ubuntu 18.04 bionic" ubuntu_codenames=( - '(Warty Warthog)' # 4.10 - '(Hoary Hedgehog)' # 5.04 - '(Breezy Badger)' # 5.10 - 'LTS (Dapper Drake)' # 6.06 - '(Edgy Eft)' # 6.10 - '(Feisty Fawn)' # 7.04 - '(Gutsy Gibbon)' # 7.10 - 'LTS (Hardy Heron)' # 8.04 - '(Intrepid Ibex)' # 8.10 - '(Jaunty Jackalope)' # 9.04 - '(Karmic Koala)' # 9.10 - 'LTS (Lucid Lynx)' # 10.04 - '(Maverick Meerkat)' # 10.10 - '(Natty Narwhal)' # 11.04 - '(Oneiric Ocelot)' # 11.10 - 'LTS (Precise Pangolin)' # 12.04 - '(Quantal Quetzal)' # 12.10 - '(Raring Ringtail)' # 13.04 - '(Saucy Salamander)' # 13.10 - 'LTS (Trusty Tahr)' # 14.04 - '(Utopic Unicorn)' # 14.10 - '(Vivid Vervet)' # 15.04 - '(Wily Werewolf)' # 15.10 - 'LTS (Xenial Xerus)' # 16.04 - '(Yakkety Yak)' # 16.10 - '(Zesty Zapus)' # 17.04 - '(Artful Aardvark)' # 17.10 - 'LTS (Bionic Beaver)' # 18.04 - '(Cosmic Cuttlefish)' # 18.10 - '(Disco Dingo)' # 19.04 - '(Eoan Ermine)' # 19.10 - 'LTS (Focal Fossa)' # 20.04 - '(Groovy Gorilla)' # 20.10 - '(Hirsute Hippo)' # 21.04 + '(Warty Warthog)' # 4.10 + '(Hoary Hedgehog)' # 5.04 + '(Breezy Badger)' # 5.10 + 'LTS (Dapper Drake)' # 6.06 + '(Edgy Eft)' # 6.10 + '(Feisty Fawn)' # 7.04 + '(Gutsy Gibbon)' # 7.10 + 'LTS (Hardy Heron)' # 8.04 + '(Intrepid Ibex)' # 8.10 + '(Jaunty Jackalope)' # 9.04 + '(Karmic Koala)' # 9.10 + 'LTS (Lucid Lynx)' # 10.04 + '(Maverick Meerkat)' # 10.10 + '(Natty Narwhal)' # 11.04 + '(Oneiric Ocelot)' # 11.10 + 'LTS (Precise Pangolin)' # 12.04 + '(Quantal Quetzal)' # 12.10 + '(Raring Ringtail)' # 13.04 + '(Saucy Salamander)' # 13.10 + 'LTS (Trusty Tahr)' # 14.04 + '(Utopic Unicorn)' # 14.10 + '(Vivid Vervet)' # 15.04 + '(Wily Werewolf)' # 15.10 + 'LTS (Xenial Xerus)' # 16.04 + '(Yakkety Yak)' # 16.10 + '(Zesty Zapus)' # 17.04 + '(Artful Aardvark)' # 17.10 + 'LTS (Bionic Beaver)' # 18.04 + '(Cosmic Cuttlefish)' # 18.10 + '(Disco Dingo)' # 19.04 + '(Eoan Ermine)' # 19.10 + 'LTS (Focal Fossa)' # 20.04 + '(Groovy Gorilla)' # 20.10 + '(Hirsute Hippo)' # 21.04 ) # Screenshot Settings @@ -253,68 +253,68 @@ gtk_2line="no" # Static Color Definitions colorize () { - printf $'\033[0m\033[38;5;%sm' "$1" + printf $'\033[0m\033[38;5;%sm' "$1" } getColor () { - local tmp_color="" - if [[ -n "$1" ]]; then - if [[ ${BASH_VERSINFO[0]} -ge 4 ]]; then - if [[ ${BASH_VERSINFO[0]} -eq 4 && ${BASH_VERSINFO[1]} -gt 1 ]] || [[ ${BASH_VERSINFO[0]} -gt 4 ]]; then - tmp_color=${1,,} - else - tmp_color="$(tr '[:upper:]' '[:lower:]' <<< "${1}")" - fi - else - tmp_color="$(tr '[:upper:]' '[:lower:]' <<< "${1}")" - fi - case "${tmp_color}" in - # Standards - 'black') color_ret='\033[0m\033[30m';; - 'red') color_ret='\033[0m\033[31m';; - 'green') color_ret='\033[0m\033[32m';; - 'brown') color_ret='\033[0m\033[33m';; - 'blue') color_ret='\033[0m\033[34m';; - 'purple') color_ret='\033[0m\033[35m';; - 'cyan') color_ret='\033[0m\033[36m';; - 'yellow') color_ret='\033[0m\033[1;33m';; - 'white') color_ret='\033[0m\033[1;37m';; - # Bolds - 'dark grey'|'dark gray') color_ret='\033[0m\033[1;30m';; - 'light red') color_ret='\033[0m\033[1;31m';; - 'light green') color_ret='\033[0m\033[1;32m';; - 'light blue') color_ret='\033[0m\033[1;34m';; - 'light purple') color_ret='\033[0m\033[1;35m';; - 'light cyan') color_ret='\033[0m\033[1;36m';; - 'light grey'|'light gray') color_ret='\033[0m\033[37m';; - # Some 256 colors - 'orange') color_ret="$(colorize '202')";; #DarkOrange - 'light orange') color_ret="$(colorize '214')";; #Orange1 - # HaikuOS - 'black_haiku') color_ret="$(colorize '7')";; - # ROSA color - 'rosa_blue') color_ret='\033[01;38;05;25m';; - # Astra Linux - 'astra_blue') color_ret='\033[01;38;05;32m';; - # ArcoLinux - 'arco_blue') color_ret='\033[1;38;05;111m';; - esac - [[ -n "${color_ret}" ]] && echo "${color_ret}" - fi + local tmp_color="" + if [[ -n "$1" ]]; then + if [[ ${BASH_VERSINFO[0]} -ge 4 ]]; then + if [[ ${BASH_VERSINFO[0]} -eq 4 && ${BASH_VERSINFO[1]} -gt 1 ]] || [[ ${BASH_VERSINFO[0]} -gt 4 ]]; then + tmp_color=${1,,} + else + tmp_color="$(tr '[:upper:]' '[:lower:]' <<< "${1}")" + fi + else + tmp_color="$(tr '[:upper:]' '[:lower:]' <<< "${1}")" + fi + case "${tmp_color}" in + # Standards + 'black') color_ret="${c0}\033[30m";; + 'red') color_ret="${c0}\033[31m";; + 'green') color_ret="${c0}\033[32m";; + 'brown') color_ret="${c0}\033[33m";; + 'blue') color_ret="${c0}\033[34m";; + 'purple') color_ret="${c0}\033[35m";; + 'cyan') color_ret="${c0}\033[36m";; + 'yellow') color_ret="${c0}\033[1;33m";; + 'white') color_ret="${c0}\033[1;37m";; + # Bolds + 'dark grey'|'dark gray') color_ret="${c0}\033[1;30m";; + 'light red') color_ret="${c0}\033[1;31m";; + 'light green') color_ret="${c0}\033[1;32m";; + 'light blue') color_ret="${c0}\033[1;34m";; + 'light purple') color_ret="${c0}\033[1;35m";; + 'light cyan') color_ret="${c0}\033[1;36m";; + 'light grey'|'light gray') color_ret="${c0}\033[37m";; + # Some 256 colors + 'orange') color_ret="$(colorize '202')";; #DarkOrange + 'light orange') color_ret="$(colorize '214')";; #Orange1 + # HaikuOS + 'black_haiku') color_ret="$(colorize '7')";; + # ROSA color + 'rosa_blue') color_ret='\033[1;38;05;25m';; + # Astra Linux + 'astra_blue') color_ret='\033[1;38;05;32m';; + # ArcoLinux + 'arco_blue') color_ret='\033[1;38;05;111m';; + esac + [[ -n "${color_ret}" ]] && echo "${color_ret}" + fi } verboseOut () { - if [[ "$verbosity" -eq "1" ]]; then - printf '\033[1;31m:: \033[0m%s\n' "$1" - fi + if [[ "$verbosity" -eq "1" ]]; then + printf '\033[1;31m:: \033[0m%s\n' "$1" + fi } errorOut () { - printf '\033[1;37m[[ \033[1;31m! \033[1;37m]] \033[0m%s\n' "$1" + printf '\033[1;37m[[ \033[1;31m! \033[1;37m]] \033[0m%s\n' "$1" } stderrOut () { - while IFS='' read -r line; do - printf '\033[1;37m[[ \033[1;31m! \033[1;37m]] \033[0m%s\n' "$line" - done + while IFS='' read -r line; do + printf '\033[1;37m[[ \033[1;31m! \033[1;37m]] \033[0m%s\n' "$line" + done } @@ -697,9 +697,9 @@ detectdistro () { fi case $ACCEPT_KEYWORDS in - [a-z]*) distro_release=stable ;; - ~*) distro_release=testing ;; - '**') distro_release=experimental ;; #experimental usually includes git-versions. + [a-z]*) distro_release=stable ;; + ~*) distro_release=testing ;; + '**') distro_release=experimental ;; #experimental usually includes git-versions. esac ;; "Hyperbola GNU/Linux-libre"|"Hyperbola") @@ -823,7 +823,7 @@ detectdistro () { "Sparky"|"SparkyLinux") distro="SparkyLinux" ;; - "TeArch"|"TeArchLinux"|"") + "TeArch"|"TeArchLinux"|"") distro="TeArch" ;; "Ubuntu") @@ -1245,7 +1245,7 @@ detectdistro () { logos) distro="Logos" ;; lunar|lunar*linux) distro="Lunar Linux";; mac*os*x|os*x) distro="Mac OS X" ;; - macos) distro="macOS" ;; + macos) distro="macOS" ;; manjaro) distro="Manjaro" ;; mageia) distro="Mageia" ;; mandrake) distro="Mandrake" ;; @@ -1285,7 +1285,7 @@ detectdistro () { steam|steam*os) distro="SteamOS" ;; suse*linux*enterprise) distro="SUSE Linux Enterprise" ;; swagarch) distro="SwagArch" ;; - tearch*) distro="TeArch" ;; + tearch*) distro="TeArch" ;; tinycore|tinycore*linux) distro="TinyCore" ;; trisquel) distro="Trisquel";; grombyangos) distro="GrombyangOS" ;; @@ -3563,7 +3563,6 @@ asciiText () { "${c1} _dZ\"\"4a -- %s" "${c1} 3Wmaam#; %s" "${c1} -9###Z! %s") - ;; "Devuan") @@ -3862,7 +3861,7 @@ asciiText () { "${c2} :---------------------:// %s" "${c2} %s") ;; - + "Fedora") if [[ "$no_color" != "1" ]]; then c1=$(getColor 'light blue') # Light Blue @@ -3893,7 +3892,7 @@ asciiText () { "${c1} '::cccccccccccccc::;,. %s" "${c1} %s") ;; - + "Fux") if [[ "$no_color" != "1" ]]; then c1=$(getColor 'white') # White @@ -4439,7 +4438,7 @@ asciiText () { "${c2} PPPPPPPPPPPPPP %s") ;; -"Grombyang"|"GrombyangOS") + "Grombyang"|"GrombyangOS") if [[ "$no_color" != "1" ]]; then c1=$(getColor 'light blue') c2=$(getColor 'light green') @@ -4555,7 +4554,7 @@ asciiText () { "${c1} _#e^ ]+ %s" "${c1} ^ ^ %s" "${c1} %s") - ;; + ;; "Parabola GNU/Linux-libre") if [[ "$no_color" != "1" ]]; then @@ -5121,7 +5120,7 @@ asciiText () { "${c1} eeeee eeeee %s" "${c1} eeeeeee eeeeeee %s" "${c1} eeeeeeeeeeeeeeeee %s") - ;; + ;; "Android") if [[ "$no_color" != "1" ]]; then @@ -5471,7 +5470,8 @@ asciiText () { "${c1} 7777+${c2}???? %s" "${c1} 77++?${c2}??$ %s" "${c1} N?+???${c2}? %s") - ;; + ;; + "BunsenLabs") if [[ "$no_color" != "1" ]]; then c1=$(getColor 'blue') @@ -5837,7 +5837,6 @@ asciiText () { "${c1} %s") ;; - "OBRevenge") if [[ "$no_color" != "1" ]]; then c1=$(getColor 'red') # White @@ -6006,14 +6005,14 @@ asciiText () { " %s") ;; - "DraugerOS") - if [[ "$no_color" != "1" ]]; then - c1=$(getColor 'red') # red - fi - if [ -n "${my_lcolor}" ]; then c1="${my_lcolor}"; fi - startline="0" - logowidth="52" - fulloutput=( + "DraugerOS") + if [[ "$no_color" != "1" ]]; then + c1=$(getColor 'red') # red + fi + if [ -n "${my_lcolor}" ]; then c1="${my_lcolor}"; fi + startline="0" + logowidth="52" + fulloutput=( "${c1} %s" "${c1} & & %s" "${c1} %( (# %s" @@ -6058,6 +6057,7 @@ asciiText () { "${c1} \|______________| %s" " %s") ;; + "EndeavourOS") if [[ "$no_color" != "1" ]]; then c1=$(getColor 'yellow') @@ -6084,9 +6084,10 @@ asciiText () { "${c5} +++++++${c3}7777777777777777${c5}++++++ %s" "${c5} +++++++++++++++++++++++++++++ %s" "${c5} +++++++++++++++++++++++++++ %s" -" %s" -) ;; - "TeArch") +" %s") + ;; + + "TeArch") if [[ "$no_color" != "0" ]]; then c1=$(getColor 'blue') # white fi @@ -6119,8 +6120,6 @@ asciiText () { " %s") ;; - - *) if [[ "${kernel}" =~ "Linux" ]]; then if [[ "$no_color" != "1" ]]; then From 64a6bdad66ad671518fe5a371e5429ef559097bb Mon Sep 17 00:00:00 2001 From: Mike Voznesensky Date: Tue, 11 Apr 2023 01:29:23 +0300 Subject: [PATCH 4/4] Added support old release Astra Linux Common Edition --- screenfetch-dev | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/screenfetch-dev b/screenfetch-dev index 37fe39e3..34a81d91 100755 --- a/screenfetch-dev +++ b/screenfetch-dev @@ -646,10 +646,14 @@ detectdistro () { distro="Debian" fi ;; - "AstraLinux") + "AstraLinux"|"AstraLinuxCE") distro="Astra Linux" - distro_release=$(cat /etc/astra_version) - distro_codename="n/a" + distro_release="$(cat /etc/astra_version | sed -nr 's/^[^0-9]*(([0-9]+\.)*[0-9]+).*/\1/p')" + if [[ $distro_release == "2.12"* ]]; then + distro_codename="ALCE" + else + distro_codename="ALSE" + fi ;; "DraugerOS") distro="DraugerOS" @@ -4313,8 +4317,12 @@ asciiText () { "Astra Linux") if [[ "$no_color" != "1" ]]; then - c1=$(getColor 'astra_blue') - c2=$(getColor 'white') + if [ $distro_codename == "ALCE" ]; then + c1=$(getColor 'light red') + else + c1=$(getColor 'astra_blue') + fi + c2=$(getColor 'white') fi if [ -n "${my_lcolor}" ]; then c1="${my_lcolor}"; c2="${my_color}"; fi startline="3"