Share Your Desktop [2025]

Here you are :slight_smile: for FF, the other fetch script:

#!/bin/bash
#
# displays info about wm, font, gtk theme
# from z3bra's blog, modified for *deb by fog
#

c00=$'\e[0;30m'
c01=$'\e[0;31m'
c02=$'\e[0;32m'
c03=$'\e[0;33m'
c04=$'\e[0;34m'
c05=$'\e[0;35m'
c06=$'\e[0;36m'
c07=$'\e[0;37m'
c08=$'\e[1;30m'
c09=$'\e[1;31m'
c10=$'\e[1;32m'
c11=$'\e[1;33m'
c12=$'\e[1;34m'
c13=$'\e[1;35m'
c14=$'\e[1;36m'
c15=$'\e[1;37m'

f0=$'\e[0;32m'
f1=$'\e[0;36m'
f2=$'\e[1;35m'

kernel=$(uname -r | cut -d "-" -f1-4)
#system=$(sed 's/\s*[\(\\]\+.*$//' /etc/issue)
system=$(cat /etc/*-release | grep -i name | cut -d'=' -f2| sed -n 2p)
system=$(lsb_release -is)
#resolution="$(xwininfo -root | grep geometry | awk '{print $2}' | cut -d + -f1)"
resolution="$(cat /sys/class/drm/card1-eDP-1/modes | awk 'NR==1{print $1; exit}')"
if [[ -n $DISPLAY ]]; then
    WM=$(xprop -root _NET_SUPPORTING_WM_CHECK)
    wmname=$(xprop -id ${WM//* } _NET_WM_NAME | sed -re 's/.*= "(.*)"/\1/')
     fon=$(xrdb -query | sed -n 's/^xterm.*\*faceName:\s*//p')
    if [[ $fon =~ "xft" ]]; then
         termfn=$(echo $fon | awk -F ':' '{print $2}')
    else
         termfn=$(echo $fon | sed -re 's/^-\w+-(\w+)-.*/\1/')
     fi
    #termfn=$(xrdb -query | sed -n 's/^xterm.*\*faceName:\s*//p')
    #systfn with size
    #systfn=`sed -n 's/^.*font.*"\(.*\)".*$/\1/p' ~/.gtkrc-2.0` 
    #systfn without size
    systfn=`sed -n 's/^.*font.*"\(.*\)".*$/\1/p' ~/.gtkrc-2.0`
    gtktheme=`sed -n 's/^.*gtk-theme.*"\(.*\)".*$/\1/p' ~/.gtkrc-2.0`
    icons=`sed -n 's/^.*icon.*"\(.*\)".*$/\1/p' ~/.gtkrc-2.0`
    #term=kitty
else
    wmname="none"
    termfn="none"
    systfn="none"
fi
while [ ! "$term" ]; do
	while IFS=':	' read -r key val; do
		case $key in
			PPid) ppid=$val; break;;
		esac
	done < "/proc/${ppid:-$PPID}/status"

	read -r name < "/proc/$ppid/comm"
	case $name in
		*sh) ;;
		"${0##*/}") ;;
		*[Ll]ogin*|*init*) term=linux;;
		*) term="$name";;
	esac
done

pkgnum=`pacman -Q|wc -l`
#birthd="$(uptime -p | sed 's/up //')"
birthd=`sed -n '1s/^\[\([0-9-]*\).*$/\1/p' /var/log/pacman.log | tr - .`
tput clear
cat << EOF

    ${c00}██  | ${f1}OS ${f0}........... $f2$system
    ${c08}  ██| ${f1}name ${f0}......... $f2$HOSTNAME
    ${c01}██  | ${f1}birthday${f0}...... $f2$birthd
    ${c09}  ██| ${f1}packages ${f0}..... $f2$pkgnum
    ${c02}██  |
    ${c10}  ██| ${f1}kernel ${f0}....... $f2$kernel
    ${c03}██  | ${f1}wmanager ${f0}..... $f2$wmname
    ${c11}  ██| ${f1}shell ${f0}........ $f2$(basename $SHELL)
    ${c04}██  |
    ${c12}  ██| ${f1}terminal ${f0}..... $f2$term
    ${c05}██  | ${f1}term font ${f0}.... $f2$termfn
    ${c13}  ██| ${f1}system font ${f0}.. $f2$systfn
    ${c06}██  |
    ${c14}  ██| ${f1}gtk theme ${f0}.... $f2$gtktheme
    ${c07}██  | ${f1}icon theme ${f0}... $f2$icons
    ${c15}  ██| ${f1}resolution ${f0}... $f2$resolution


EOF