mirror of https://framagit.org/kyodev/kyopages.git
getInfo 3.19.0
This commit is contained in:
parent
22c93246b4
commit
673528e0f7
284
scripts/getInfo
284
scripts/getInfo
|
@ -1,7 +1,7 @@
|
|||
#!/bin/bash
|
||||
|
||||
version=3.18.3
|
||||
date="14/02/2018"
|
||||
version=3.19.0
|
||||
date="19/02/2018"
|
||||
projet="simpledeb"
|
||||
contact="IRC freenode.net ##sdeb ou https://framagit.org/kyodev/kyopages/issues/"
|
||||
script="getInfo"
|
||||
|
@ -251,6 +251,23 @@ f__sudo(){ # 26/01/2018
|
|||
done
|
||||
}
|
||||
|
||||
# $1=left|right|all si erreur option: all, $2 variable à trimer
|
||||
f__trim(){
|
||||
local tr="$1" display
|
||||
|
||||
if [[ ! "$tr" =~ left|right|all ]]; then
|
||||
echo "${RED}apple trim incorrect$STD"
|
||||
return 1
|
||||
fi
|
||||
while read -r ; do
|
||||
REPLY=${REPLY// }
|
||||
[[ "$tr" =~ left|all ]] && REPLY=${REPLY## }
|
||||
[[ "$tr" =~ right|all ]] && REPLY=${REPLY%% }
|
||||
display+="$REPLY"$'\n'
|
||||
done <<< "$2"
|
||||
echo "$display"
|
||||
}
|
||||
|
||||
# $1=nombre à convertir en ko, affiche ko ou Mo ou Go
|
||||
f__unit_human(){ # 26/01/2018
|
||||
echo -n "$( awk ' {
|
||||
|
@ -399,13 +416,13 @@ f_affichage(){ # 24/01/2018
|
|||
# un test si variable $2 est vide est fait sauf ':vide'
|
||||
# un test si variable $2 contient 'nofile' (non trouvé par f_grep_file)
|
||||
# f_dspl "variable" "type" "titre" "commentaire"
|
||||
f_dspl(){ # 14/12/2017
|
||||
f_dspl(){ # 15/02/2018
|
||||
local display='' toDisplay
|
||||
|
||||
[ "$text" ] && echo -en "$text" >> "$file_output" # flush, avant fonction, de $text parent
|
||||
unset text
|
||||
|
||||
[[ "$2" || "$1" =~ :vide ]] || return 0 # test si contenu dans $2
|
||||
[[ "$2" || "$1" =~ :vide ]] || return 0 # test si contenu dans $2 ou option :vide, sinon retour
|
||||
toDisplay="$2"
|
||||
[ "$toDisplay" ] || toDisplay="vide" # cas si :vide
|
||||
# traitement ligne de titre
|
||||
|
@ -418,7 +435,7 @@ f_dspl(){ # 14/12/2017
|
|||
# traitement contenu
|
||||
if [ "$toDisplay" == "nofile" ]; then # nofile renvoyé par f_grep
|
||||
display+="\n* fichier $2 non trouvé \n"
|
||||
elif [[ "$1" =~ :text || "$toDisplay" == "vide" ]]; then
|
||||
elif [[ "$1" =~ :text ]]; then
|
||||
display+="\n* $toDisplay \n"
|
||||
else
|
||||
display+='``` \n'
|
||||
|
@ -880,7 +897,7 @@ fi_conf(){ # 09/02/2018
|
|||
f_dspl cmd "$confs" "grep -Ersv '^#|^$' <fichiers désirés>"
|
||||
}
|
||||
|
||||
fi_cpu(){ # 28/01/2018
|
||||
fi_cpu(){ # 15/02/2018
|
||||
local cpu_flags text iflag qte_flags text_flags="" pluriel
|
||||
local alert_microcode
|
||||
|
||||
|
@ -908,7 +925,7 @@ fi_cpu(){ # 28/01/2018
|
|||
###
|
||||
f_prnt tit2 "processeur"$pluriel
|
||||
f_dspl cmd "$fg_cpu" "lscpu" # affichage proc
|
||||
f_dspl var "$fg_uarch" "µarchitecture processeur"
|
||||
f_dspl var "$fg_uarch" "µ architecture processeur"
|
||||
f_dspl_alrt "$alert_microcode" "info"
|
||||
f_prnt 1 "$fg_ucode" '[[ -z "$alert_microcode" && "$fg_ucode" ]]'
|
||||
f_prnt
|
||||
|
@ -1654,7 +1671,7 @@ fi_packagers(){ # 23/11/2017
|
|||
fi
|
||||
}
|
||||
|
||||
fi_pkg_apt(){ # 02/02/2018
|
||||
fi_pkg_apt(){ # 15/02/2018
|
||||
local dateMaj nb_packages ifile info_update text pluriel
|
||||
local sources cmt_sources cmd_sources result
|
||||
local apt_v apt_version apt_prefs cmt_apt_prefs cmd_apt_prefs alert_non_pref
|
||||
|
@ -1667,6 +1684,7 @@ fi_pkg_apt(){ # 02/02/2018
|
|||
local non_ii qte_non_ii cmt_non_ii cmd_non_ii etat ligne stck_etat
|
||||
local deborphan qte_deborphan cmt_deborphan cmd_deborphan
|
||||
local holded qte_holded cmt_holded cmd_holded
|
||||
local pinned qte_pinned cmd_pinned cmt_pinned
|
||||
local metaPkg cmd_metaPkg cmt_metaPkg kernel cmd_kernel cmt_kernel
|
||||
local alert_https alert_httpsPossible alert_non_list alert_httpredir alert_upgrade alert_full_upgrade
|
||||
local alert_apt alert_remove alert_autoclean alert_clean alert_non_ii alert_deborphan
|
||||
|
@ -1884,7 +1902,7 @@ fi_pkg_apt(){ # 02/02/2018
|
|||
alert_deborphan+="s'installer en cascade"
|
||||
fi
|
||||
fi
|
||||
# paquets figés
|
||||
# paquets figés (hold)
|
||||
holded=$( apt-mark showhold )
|
||||
qte_holded=$( f__wcv "-l" "$holded" )
|
||||
[ "$holded" ] && holded=$( sort <<< $holded | tr '\n' ' ' )
|
||||
|
@ -1892,6 +1910,12 @@ fi_pkg_apt(){ # 02/02/2018
|
|||
cmt_holded="$qte_holded paquet"$pluriel" figé"$pluriel
|
||||
[ "$qte_holded" -eq 0 ] && cmt_holded=${cmt_holded/0 /aucun }
|
||||
cmd_holded="apt-mark showhold"
|
||||
# paquets épinglés (pinning)
|
||||
pinned=$( f__trim all "$( apt-cache policy | grep '\->' )" )
|
||||
qte_pinned=$( f__wcv "-l" "$pinned" )
|
||||
[ "$qte_pinned" -gt 1 ] && pluriel="s" || unset pluriel
|
||||
cmd_pinned="apt-cache policy | grep '\->'"
|
||||
cmt_pinned="résultat effectif épinglage paquet"$pluriel
|
||||
# kernel
|
||||
# metaPkg=$( dpkg -l | grep -i -E 'linux-(image|headers)-([0-9]{3}|amd)' )
|
||||
metaPkg=$( $c_awk '
|
||||
|
@ -1939,6 +1963,7 @@ fi_pkg_apt(){ # 02/02/2018
|
|||
f_dspl_alrt "$alert_deborphan" "info"
|
||||
fi
|
||||
f_dspl cmd:vide "$holded" "$cmd_holded" "$cmt_holded"
|
||||
f_dspl cmd:vide "$pinned" "$cmd_pinned" "$cmt_pinned"
|
||||
f_dspl cmd "$metaPkg" "$cmd_metaPkg" "$cmt_metaPkg"
|
||||
f_dspl cmd "$kernel" "$cmd_kernel" "$cmt_kernel"
|
||||
}
|
||||
|
@ -2027,7 +2052,7 @@ fi_pkg_x(){ # 1/12/2017
|
|||
f_dspl var "$alert_pkg_todo" "aide souhaitée"
|
||||
}
|
||||
|
||||
fi_reseau(){ # 09/02/2018 ( configuration )
|
||||
fi_reseau(){ # 19/02/2018 ( configuration )
|
||||
local ip4 gw4 ip4_p ip6 gw6 ip_a route netplan interfaces resolv iwconfig canal_wifi text pluriel
|
||||
local imgr netmgrinst netmgrrun ipa adr_temp slaac slaac_mac
|
||||
local alert_ifconfig alert_slaac
|
||||
|
@ -2070,12 +2095,13 @@ fi_reseau(){ # 09/02/2018 ( configuration )
|
|||
if [ -e "${netmgr[$imgr]}" ]; then
|
||||
netmgrinst+="$imgr "
|
||||
fi
|
||||
if [ $( ps -ef | grep -c ${netmgr[$imgr]} ) -ge 2 ]; then
|
||||
netmgrrun+=$( ps -ef | grep -om1 "${netmgr[$imgr]}"".*$" )$'\n'
|
||||
if grep -iq "$imgr" <<< $( ps -e ) ; then
|
||||
netmgrrun+="$imgr "
|
||||
fi
|
||||
done
|
||||
netmgrinst=${netmgrinst% } # suppression dernier espace
|
||||
netmgrrun=${netmgrrun%[[:cntrl:]]} # suppression dernier $'\n'
|
||||
netmgrrun=${netmgrrun% } # suppression dernier espace
|
||||
[ "$netmgrinst" == "$netmgrrun" ] && unset netmgrinst
|
||||
# alertes
|
||||
if [ $( f__which ifconfig ) ] ; then
|
||||
alert_ifconfig="ifconfig [net-tools](https://github.com/giftnuss/net-tools) est un projet abandonné "
|
||||
|
@ -2144,7 +2170,7 @@ fi_reseau(){ # 09/02/2018 ( configuration )
|
|||
f_prnt 1 "la configuration ssid utilisée peut être connue (si NetworkManager installé) avec \n \`$DIRNAME""getInfo --ssid\`"
|
||||
f_prnt
|
||||
# network manager
|
||||
f_prnt 1 "gestionnaire de réseau" '[ "$netmgrinst" ]'
|
||||
f_prnt 1 "gestionnaire de réseau" '[ "$netmgrrun" ]'
|
||||
[ "$(wc -w <<< $netmgrinst)" -gt 1 ] && pluriel="s" || unset pluriel
|
||||
f_prnt 2 "installé"$pluriel": **$netmgrinst**" '[ "$netmgrinst" ]'
|
||||
f_prnt 2 "en fonctionnement: **$netmgrrun**" '[ "$netmgrrun" ]'
|
||||
|
@ -2357,6 +2383,7 @@ fi_system(){ # 13/02/2018
|
|||
[ "$fg_nb_batt" -gt "1" ] && pluriel="s" || unset pluriel
|
||||
f_prnt l2 "$fg_nb_batt batterie"$pluriel" présente"$pluriel":" '[ "$fg_batt" ]'
|
||||
f_prnt l3 "$enum_batt" '[ "$fg_batt" ]'
|
||||
unset fe_touchpad
|
||||
[ "$fe_nb_touchpad" -gt "1" ] && pluriel="s" || unset pluriel
|
||||
f_prnt l2 "$fe_nb_touchpad pavé"$pluriel" tactile"$pluriel":" '[ "fe_touchpad" ]'
|
||||
f_prnt l3 "$fe_touchpad" '[ "fe_touchpad" ]'
|
||||
|
@ -2443,13 +2470,14 @@ fi_system_analyse(){ # 26/01/2018
|
|||
}
|
||||
|
||||
# [$1=silent], assigne $fe_touchpad, fe_nb_touchpad
|
||||
fi_touchpad(){ # 14/02/2018
|
||||
fi_touchpad(){ # 19/02/2018
|
||||
local device cmd_device toScrut xfile file_logs type type_pt pilote cmd_pilote cmt_pilote info_driver
|
||||
|
||||
x_touchpad=1
|
||||
unset fe_touchpad
|
||||
fe_nb_touchpad=0
|
||||
|
||||
device=$( grep -Ei -B1 -A8 'touchpad|trackpoint|synaptics|alps|etps|elan' /proc/bus/input/devices ) || return 0
|
||||
unset fe_touchpad
|
||||
while read -r; do
|
||||
REPLY=${REPLY#*Name=\"} # suppression début
|
||||
REPLY=${REPLY%\"} # suppression fin
|
||||
|
@ -2478,7 +2506,6 @@ fi_touchpad(){ # 14/02/2018
|
|||
fe_touchpad+="$type_pt"
|
||||
fi
|
||||
fe_nb_touchpad=$( f__wcv -l "$fe_touchpad" )
|
||||
|
||||
[[ "$1" == "silent" ]] && return 0
|
||||
###
|
||||
if [ "$ENV_DEBIAN" ]; then
|
||||
|
@ -2704,7 +2731,7 @@ figet_batt(){ # 13/02/2018
|
|||
}
|
||||
|
||||
# assigne $fg_cpu (description cpu), fg_nb_threads, $fg_cpu_arch, $fg_uarch, $fg_vendor=AMD|Intel, $fg_nb_cpu
|
||||
figet_cpu(){ # 26/01/2018
|
||||
figet_cpu(){ # 15/02/2018
|
||||
local cpuinfo speedNom speedMax speedMin speedCpu descrCpu cpu1 cpu2 cpu3
|
||||
|
||||
x_cpu=1
|
||||
|
@ -2746,15 +2773,13 @@ figet_cpu(){ # 26/01/2018
|
|||
# traitement fg_cpu
|
||||
cpu1=$(
|
||||
$c_awk -v "speedCpu=$speedCpu" -F ':|@' '
|
||||
/^model name/ {
|
||||
gsub(/^ | $|\(R\)|\(TM\)|\(r\)|\(tm\)|CPU| width/,"",$2); gsub(/ /," ",$2)
|
||||
cpu=$2 }
|
||||
/^model name/ { gsub(/\(R\)|\(TM\)|\(r\)|\(tm\)|CPU| width/,"",$2); cpu=$2 }
|
||||
/^physical id/ { if ($2+1 != nbCpu) nbCpu=$2+1 }
|
||||
/cpu cores/ { procCore=sprintf("%d",$2); if (procCore>1) pllc="s" }
|
||||
/siblings/ { procThread=sprintf("%d",$2); if (procThread>1) pllt="s" }
|
||||
/microcode/ { sub(/^ /,"",$2); microCode=$2 }
|
||||
END {
|
||||
printf nbCpu" x "cpu " (" procCore "core" pllc ", " procThread "thread" pllt;
|
||||
printf nbCpu " x " cpu " (" procCore "core" pllc ", " procThread "thread" pllt;
|
||||
print ") {" speedCpu "} microcode:" microCode
|
||||
}' <<< "$cpuinfo "
|
||||
)
|
||||
|
@ -3181,7 +3206,7 @@ figet_cpu_uarch(){ # 14/11/2017
|
|||
}
|
||||
|
||||
# assigne $fg_de, $fg_de_panel
|
||||
figet_de(){ # 14/02/2018 # thanks neofetch
|
||||
figet_de(){ # 15/02/2018 # thanks neofetch
|
||||
local de="n/a" ps
|
||||
|
||||
x_de=1
|
||||
|
@ -3215,6 +3240,11 @@ figet_de(){ # 14/02/2018 # thanks neofetch
|
|||
fi
|
||||
fg_de=${de,,} # minuscule
|
||||
fg_de=${fg_de^} # caractère 1 en majuscule
|
||||
|
||||
#~ if [[ "$XDG_CURRENT_DESKTOP" =~ Unity ]]; then de="Unity"
|
||||
#~ elif [[ "$XDG_CURRENT_DESKTOP" =~ Budgie ]]; then de="Budgie"
|
||||
#~ elif [[ "$XDG_CURRENT_DESKTOP" =~ LXQt ]]; then de='LXQt'
|
||||
|
||||
###
|
||||
# panel
|
||||
ps=$( ps -A )
|
||||
|
@ -3345,18 +3375,15 @@ figet_distrib(){ # 14/12/2017
|
|||
}
|
||||
|
||||
# display manager, assigne $fg_dm (liste éventuelle) ou 'n/a'
|
||||
figet_dm(){ # 13/02/2018
|
||||
figet_dm(){ # 19/02/2018
|
||||
local dm_list="cdm entranced gdm3 gdm qingy kdm ldm lightdm lxdm mdm nodm orthos sddm slim startx tint2 wdm xdm"
|
||||
local idm ps systemctl x11
|
||||
local idm systemctl x11
|
||||
|
||||
x_dm=1
|
||||
fg_dm=""
|
||||
ps=$(ps -ef) # plus joli pour cmde manuelle: ps=$(ps -auxf)
|
||||
ps=${ps,,} # tout en minuscules
|
||||
for idm in $dm_list; do
|
||||
if ps -ef | grep -m1 '$idm' | grep -v 'grep'; then
|
||||
#~ if [ "$( grep -iq "bin/$idm$" <<< "$ps" )" -ge 2 ]; then
|
||||
#~ if [ "${ps/*"$idm"*/test}" == "test" ]; then # pb: doublon gdm/gdm3 (speed? grepless)
|
||||
if grep -iq "$idm" <<< $(ps -e) ; then
|
||||
# if [ "${ps/*"$idm"*/test}" == "test" ]; then # pb: doublon gdm/gdm3 (speed? grepless)
|
||||
fg_dm+="${idm^} "
|
||||
elif [[ -e "/var/run/${idm}.pid" || -e "/run/${idm}.pid" || -d "/var/run/$idm/" || -d "/run/$idm/" ]]; then
|
||||
fg_dm+="${idm^} "
|
||||
|
@ -3994,126 +4021,129 @@ figet_ucode(){ # 14/12/2017
|
|||
fi
|
||||
}
|
||||
|
||||
# assigne $fg_wm (compositor, pas en variable publique, pas fiabilisé)
|
||||
figet_wm(){ # 13/02/2018 base départ neofetch
|
||||
local id wm_brut compositor
|
||||
# assigne $fg_wm, contient 'n/a' ou égal 'non trouvé' ou WM
|
||||
figet_wm(){ # 19/02/2018 base départ neofetch
|
||||
local id xprop_id wm xprop_root ps_e compositor
|
||||
|
||||
x_wm=1
|
||||
|
||||
# 3Dwm abandonné
|
||||
|
||||
fg_wm="n/a"
|
||||
[ $( f__which xprop ) ] || fg_wm+=":xprop absent" # ! pas de xprop, pas de wm?!
|
||||
[ $( f__which xprop ) ] || fg_wm+=":xprop absent" # pas de xprop, pas de wm?!
|
||||
[ "$ENV_DISPLAY" ] && fg_wm+=":no Display"
|
||||
[ "$ENV_SSH" ] && fg_wm+=":ssh"
|
||||
[[ "$wayland" && "$EUID" -eq 0 ]] && fg_wm+=":wayland root"
|
||||
[[ "$fg_wm" =~ : ]] && return 0 # retourne n/a ...
|
||||
##
|
||||
id=$( xprop -root -notype _NET_SUPPORTING_WM_CHECK 2>/dev/null ) # = xprop -root 2>/dev/null | grep '^_NET_SUPPORTING_WM_CHECK.*id'
|
||||
|
||||
## WM
|
||||
id=$( xprop -root -notype _NET_SUPPORTING_WM_CHECK 2>/dev/null )
|
||||
id=${id##* } # suppression plus grande chaîne au début jusqu"à ' '
|
||||
wm_brut=$( xprop -id "$id" -notype -len 100 2>/dev/null ) # xprop -id "$id" -notype _NET_WM_NAME
|
||||
wm_brut=${wm_brut,,} # minuscules
|
||||
fg_wm=${wm_brut/*_net_wm_name = } # suppression jusqu'à 'name = '
|
||||
fg_wm=${fg_wm/\"} # suppression premier"
|
||||
fg_wm=${fg_wm/\"*} # suppression 2e " avec éventuels caractères suivants
|
||||
# Fallback for Wayland wms (sway)
|
||||
[[ "$fg_wm" == "xwlc" ]] && fg_wm=$( ps -e | grep -m1 -Eo 'sway|orbment|velox|orbital' )
|
||||
if [ -z "$fg_wm" ]; then
|
||||
fg_wm=$( figet_wm_annexe )
|
||||
fi
|
||||
fg_wm=${fg_wm^} # 1er caractère en majuscule
|
||||
xprop_id=$( xprop -id "$id" -notype 2>/dev/null ) # xprop -id "$id" -notype _NET_WM_NAME
|
||||
xprop_id=${xprop_id,,} # minuscules
|
||||
wm=${xprop_id/*_net_wm_name = } # suppression jusqu'à 'name = '
|
||||
wm=${wm/\"} # suppression premier "
|
||||
wm=${wm/\"*} # suppression 2e " avec éventuels caractères suivants
|
||||
wm=${wm,,} # tout en minuscule
|
||||
|
||||
compositor=$( figet_compositor )
|
||||
[ "${compositor,,}" == "${fg_wm,,}" ] && unset compositor
|
||||
#final
|
||||
fg_wm="$fg_wm $compositor"
|
||||
}
|
||||
if [ -z "$wm" ]; then
|
||||
xprop_root=$( xprop -root 2>/dev/null )
|
||||
xprop_root=${xprop_root,,} # tout en minuscule
|
||||
ps_e=$( ps -e )
|
||||
ps_e=${ps_e,,} # tout en minuscule
|
||||
if [[ -z ${xprop_root/*blackbox_pid*/} ]]; then
|
||||
if [[ -z ${ps_e/*fluxbox*/} ]]; then
|
||||
wm='fluxbox'
|
||||
else
|
||||
wm='blackbox'
|
||||
fi
|
||||
elif [[ -z ${xprop_root/*enlightenment*/} ]]; then wm="enlightenment"
|
||||
elif [[ -z ${xprop_root/*herbstluftwm*/} ]]; then wm="herbstluftwm"
|
||||
elif [[ -z ${xprop_root/*icewm*/} ]]; then wm="iceWm"
|
||||
elif [[ -z ${xprop_root/*openbox_pid*/} ]]; then wm="openbox"
|
||||
elif [[ -z ${xprop_root/*windowmaker*/} ]]; then wm="windowmaker"
|
||||
|
||||
# complément (temporaire?) à figet_wm
|
||||
figet_wm_annexe(){ # 13/02/2018
|
||||
local de wm xprop psef
|
||||
elif [[ -z ${ps_e/*afterstep*/} ]]; then wm='afterstep'
|
||||
elif [[ -z ${ps_e/*awesome*/} ]]; then wm='awesome'
|
||||
elif [[ -z ${ps_e/*fvwm*/} ]]; then wm='fvwm'
|
||||
elif [[ -z ${ps_e/*fvwm-crystal*/} ]]; then wm='fvwm-Crystal'
|
||||
elif [[ -z ${ps_e/*pekwm*/} ]]; then wm='pekwm'
|
||||
elif [[ -z ${ps_e/*sawfish*/} ]]; then wm='sawfish'
|
||||
elif [[ -z ${ps_e/*scrotwm*/} ]]; then wm='scrotwm'
|
||||
elif [[ -z ${ps_e/*spectrwm*/} ]]; then wm='spectrwm'
|
||||
elif [[ -z ${ps_e/*xfwm4*/} ]]; then wm='xfwm4'
|
||||
elif [[ -z ${ps_e/*wmii*/} ]]; then wm='wmii'
|
||||
elif [[ -z ${ps_e/*wmii2*/} ]]; then wm='wmii2'
|
||||
|
||||
#~ if [[ "$XDG_CURRENT_DESKTOP" =~ Unity ]]; then de="Unity"
|
||||
#~ elif [[ "$XDG_CURRENT_DESKTOP" =~ Budgie ]]; then de="Budgie"
|
||||
#~ elif [[ "$XDG_CURRENT_DESKTOP" =~ LXQt ]]; then de='LXQt'
|
||||
#~ fi
|
||||
elif [[ -z ${ps_e/*smithay*/} ]]; then wm='smithay' # aveugle
|
||||
if [[ "$wm" == +(*wlc|swc|waysome) ]]; then
|
||||
wm=$( grep -Eo 'sway|orbment|velox|orbital|waysome|loliwm|Way-Cooler|fireplace' <<< "$ps_e" )
|
||||
fi
|
||||
|
||||
[ -z "$DISPLAY" ] && DISPLAY=":0"
|
||||
xprop=$( xprop -root -display $DISPLAY )
|
||||
psef=$( ps -ef )
|
||||
if [[ -z ${xprop/*blackbox_pid*/} ]]; then
|
||||
if [[ -z ${psef/*fluxbox*/} ]]; then wm='Fluxbox'; else wm='Blackbox'; fi
|
||||
elif [[ -z ${xprop/*openbox_pid*/} ]]; then wm="Openbox"
|
||||
elif [[ -z ${xprop/*icewm*/} ]]; then wm="IceWM"
|
||||
elif [[ -z ${xprop/*enlightenment*/} ]]; then wm="Enlightenment"
|
||||
elif [[ -z ${xprop/*windowmaker*/} ]]; then wm="WindowMaker"
|
||||
elif [[ -z ${xprop/*herbstluftwm*/} ]]; then wm="herbstluftwm"
|
||||
|
||||
elif [[ -z ${psef/*fvwm-crystal*/} ]]; then wm='FVWM-Crystal'
|
||||
elif [[ -z ${psef/*fvwm*/} ]]; then wm='FVWM'
|
||||
elif [[ -z ${psef/*pekwm*/} ]]; then wm='pekwm'
|
||||
elif [[ -z ${psef/*awesome*/} ]]; then wm='Awesome'
|
||||
elif [[ -z ${psef/*scrotwm*/} ]]; then wm='Scrotwm'
|
||||
elif [[ -z ${psef/*spectrwm*/} ]]; then wm='Spectrwm'
|
||||
elif [[ -z ${psef/*wmii2*/} ]]; then wm='wmii2'
|
||||
elif [[ -z ${psef/*wmii*/} ]]; then wm='wmii'
|
||||
elif [[ -z ${psef/*sawfish*/} ]]; then wm='Sawfish'
|
||||
elif [[ -z ${psef/*afterstep*/} ]]; then wm='AfterStep'
|
||||
|
||||
elif grep -q "/i3_" <<< "$xprop"; then wm="i3"
|
||||
elif grep -q "/_wm2" <<< "$xprop"; then wm="WM2"
|
||||
elif grep -q "/jwm" <<< "$psef"; then wm='JWM'
|
||||
elif grep -q "/twm" <<< "$psef"; then wm='Twm'
|
||||
elif grep -q "/dwm" <<< "$psef"; then wm='dwm'
|
||||
elif grep -q "/i3_" <<< "$xprop_root"; then wm="i3"
|
||||
elif grep -q "/_wm2" <<< "$xprop_root"; then wm="wm2"
|
||||
elif grep -q "/dwm" <<< "$ps_e"; then wm='dwm'
|
||||
elif grep -q "/jwm" <<< "$ps_e"; then wm='jwm'
|
||||
elif grep -q "/twm" <<< "$ps_e"; then wm='twm'
|
||||
fi
|
||||
fi
|
||||
|
||||
[ "$wm" ] && echo "$wm"
|
||||
}
|
||||
|
||||
# assigne ? ( pas en variable publique, pas fiabilisé), appel dans figet_wm
|
||||
figet_compositor(){ # 13/02/2018
|
||||
local compositor
|
||||
|
||||
# Compositor, dev en cours, essai version
|
||||
if [[ "$wm_brut" =~ marco_version ]]; then # Mate, ok
|
||||
compositor=${wm_brut/*_marco_version = } # suppression jusqu'à ...
|
||||
## Compositor
|
||||
if [[ "$xprop_id" =~ marco_version ]]; then # Mate, ok
|
||||
compositor=${xprop_id/*_marco_version = } # suppression jusqu'à ...
|
||||
compositor=${compositor/\"} # suppression premier"
|
||||
compositor=${compositor/\"*} # suppression 2e " avec éventuels caractères suivants
|
||||
compositor="Marco v$compositor"
|
||||
fg_wm=${fg_wm/ (marco)} # suppression (marco) dans wm
|
||||
wm=${wm/ (marco)} # suppression (marco) dans wm
|
||||
fi
|
||||
if [[ "$wm_brut" =~ mutter_version ]]; then
|
||||
compositor=${wm_brut/*_mutter_version = } # suppression jusqu'à ...
|
||||
if [[ "$xprop_id" =~ mutter_version ]]; then
|
||||
compositor=${xprop_id/*_mutter_version = } # suppression jusqu'à ...
|
||||
compositor=${compositor/\"} # suppression premier"
|
||||
compositor=${compositor/\"*} # suppression 2e " avec éventuels caractères suivants
|
||||
compositor="Mutter v$compositor"
|
||||
fi
|
||||
if [[ "$wm_brut" =~ muffin_version ]]; then # cinnamon, ok
|
||||
compositor=${wm_brut/*muffin_version = } # suppression jusqu'à ...
|
||||
if [[ "$xprop_id" =~ muffin_version ]]; then # cinnamon, ok
|
||||
compositor=${xprop_id/*muffin_version = } # suppression jusqu'à ...
|
||||
compositor=${compositor/\"} # suppression premier"
|
||||
compositor=${compositor/\"*} # suppression 2e " avec éventuels caractères suivants
|
||||
compositor="Muffin v$compositor"
|
||||
fg_wm=${fg_wm/ (muffin)} # suppression (muffin) dans wm
|
||||
wm=${wm/ (muffin)} # suppression (muffin) dans wm
|
||||
fi
|
||||
if [[ "$wm" == kwin ]]; then
|
||||
compositor=$( kwin --version )
|
||||
compositor=${compositor/kwin } # suppression kwin, conservation n° version
|
||||
fi
|
||||
if [[ "$wm" =~ sway ]]; then
|
||||
compositor+=$( sway -v )
|
||||
fi
|
||||
# Gnome2, Metacity
|
||||
# XFCE, rien pour Xfwm4
|
||||
|
||||
# en aveugle, pour test et adaptations futures
|
||||
[[ "$wm_brut" =~ compiz ]] && compositor+='compiz'
|
||||
[[ "$wm_brut" =~ compton ]] && compositor+='compton'
|
||||
[[ "$wm_brut" =~ dwc ]] && compositor+='dwc'
|
||||
[[ "$wm_brut" =~ fireplace ]] && compositor+='fireplace'
|
||||
[[ "$wm_brut" =~ gnome-shell ]] && compositor+='gnome-shell'
|
||||
[[ "$wm_brut" =~ grefson ]] && compositor+='grefson'
|
||||
[[ "$wm_brut" =~ kmscon ]] && compositor+='kmscon'
|
||||
[[ "$wm_brut" =~ kwin ]] && compositor+='kwin'
|
||||
[[ "$wm_brut" =~ moblin ]] && compositor+='moblin'
|
||||
[[ "$wm_brut" =~ rustland ]] && compositor+='rustland'
|
||||
[[ "$wm_brut" =~ sway ]] && compositor+='sway'
|
||||
[[ "$wm_brut" =~ swc ]] && compositor+='swc'
|
||||
[[ "$wm_brut" =~ wayhouse ]] && compositor+='wayhouse'
|
||||
[[ "$wm_brut" =~ westford ]] && compositor+='westford'
|
||||
[[ "$wm_brut" =~ weston ]] && compositor+='weston'
|
||||
if [ -z "$compositor" ]; then
|
||||
# en aveugle, pour test et adaptations futures
|
||||
[[ "$xprop_id" =~ compiz ]] && compositor+='compiz'
|
||||
[[ "$xprop_id" =~ compton ]] && compositor+='compton'
|
||||
[[ "$xprop_id" =~ dwc ]] && compositor+='dwc'
|
||||
[[ "$xprop_id" =~ fireplace ]] && compositor+='fireplace'
|
||||
[[ "$xprop_id" =~ gnome-shell ]] && compositor+='gnome-shell'
|
||||
[[ "$xprop_id" =~ grefson ]] && compositor+='grefson'
|
||||
[[ "$xprop_id" =~ kmscon ]] && compositor+='kmscon'
|
||||
[[ "$xprop_id" =~ kwin ]] && compositor+='kwin'
|
||||
[[ "$xprop_id" =~ moblin ]] && compositor+='moblin'
|
||||
[[ "$xprop_id" =~ rustland ]] && compositor+='rustland'
|
||||
[[ "$xprop_id" =~ sway ]] && compositor+='sway'
|
||||
[[ "$xprop_id" =~ swc ]] && compositor+='swc'
|
||||
[[ "$xprop_id" =~ wayhouse ]] && compositor+='wayhouse'
|
||||
[[ "$xprop_id" =~ westford ]] && compositor+='westford'
|
||||
[[ "$xprop_id" =~ weston ]] && compositor+='weston'
|
||||
fi
|
||||
|
||||
echo ${compositor^} # caractère 1 en majuscule
|
||||
[ "${compositor^}" == "${wm^}" ] && unset compositor
|
||||
wm=${wm^} # 1er caractère en majuscule
|
||||
compositor=${compositor^} # 1er caractère en majuscule
|
||||
fg_wm="$wm $compositor"
|
||||
|
||||
if [ -z "${fg_wm^}" ]; then
|
||||
fg_wm="non trouvé"
|
||||
fi
|
||||
}
|
||||
|
||||
# aiguillage export paste
|
||||
|
@ -4306,7 +4336,7 @@ fscript_update(){ # 26/01/2018
|
|||
rm -rf "$dirTemp/"
|
||||
}
|
||||
|
||||
prg_init(){ # 09/02/2018
|
||||
prg_init(){ # 19/02/2018
|
||||
|
||||
PATH='/usr/sbin:/usr/bin:/sbin:/bin'
|
||||
TERM=xterm
|
||||
|
@ -4346,7 +4376,7 @@ prg_init(){ # 09/02/2018
|
|||
[ "$OS" != "linux" ] && f__error "Linux requis"
|
||||
|
||||
# recherche wayland
|
||||
[ "$(ps -ef | grep -c 'wayland')" -gt 1 ] && wayland="wayland"
|
||||
grep -iq 'wayland' <<< $( ps -e ) && wayland="wayland"
|
||||
[ "$WAYLAND_DISPLAY" ] && wayland="wayland"
|
||||
|
||||
# test SSH
|
||||
|
@ -4373,9 +4403,9 @@ if type -p "mawk" &>/dev/null; then
|
|||
elif type -p "$c_awk" &>/dev/null; then
|
||||
c_awk="gawk"
|
||||
fi
|
||||
# essai évitement awk à la voidlinux
|
||||
if ! awk -F ' ' &>/dev/null; then
|
||||
#~ f__error "awk en place va poser problèmes." "Pour participer au débuggage, vous pouvez contacter:" "$contact"
|
||||
# essai évitement awk à la voidlinux (souci avec awk -F ou -F ' | ')
|
||||
if ! echo 'abc=123' | mawk -F '=|:' {} &>/dev/null; then
|
||||
f__error "awk en place va poser problème." "Pour participer au débuggage, vous pouvez contacter:" "$contact"
|
||||
:
|
||||
fi
|
||||
|
||||
|
@ -4527,7 +4557,7 @@ for j in $options; do # deuxième passe options, actions
|
|||
# fi_reseau fi_nm
|
||||
# fi_system_analyse fi_log_xorg fi_journal
|
||||
# fi_bluez # long
|
||||
fi_reseau
|
||||
fi_system
|
||||
echo; f_prnt_md "$file_output"
|
||||
;; # test
|
||||
-c* | all )
|
||||
|
|
|
@ -1,6 +1,16 @@
|
|||
# changelog getInfo
|
||||
|
||||
|
||||
## getInfo 3.19.0 19/02/2018
|
||||
|
||||
* plus: fi_pkg_apt, paquets épinglés par pinning, résultat effectif
|
||||
* révision: général, ps -ef
|
||||
* révision: fi_reseau, manager de réseau
|
||||
* révision: mineur, figet_cpu, affichage nom cpu
|
||||
* révision: figet_compositor, figet_wm
|
||||
* fix: f_dspl, affichage si vide
|
||||
* fix: fi_touchpad, qte numérique sur zéro touchpad
|
||||
|
||||
## getInfo 3.18.3 14/02/2018
|
||||
|
||||
* plus: figet_de, ajout panels
|
||||
|
|
Loading…
Reference in New Issue