refactored ps data.

This commit is contained in:
Harald Hope 2023-12-12 15:03:08 -08:00
parent 7e23475333
commit 963673ace6
2 changed files with 104 additions and 111 deletions

205
pinxi
View file

@ -50,8 +50,8 @@ use POSIX qw(ceil uname strftime ttyname);
## INXI INFO ## ## INXI INFO ##
my $self_name='pinxi'; my $self_name='pinxi';
my $self_version='3.3.31'; my $self_version='3.3.31';
my $self_date='2023-12-10'; my $self_date='2023-12-12';
my $self_patch='24'; my $self_patch='25';
## END INXI INFO ## ## END INXI INFO ##
my ($b_pledge,@pledges); my ($b_pledge,@pledges);
@ -74,7 +74,7 @@ my ($fake_data_dir,$self_path,$user_config_dir,$user_config_file,$user_data_dir)
## Hashes ## Hashes
my (%alerts,%build_prop,%client,%colors,,%cpuinfo_machine,%disks_bsd, my (%alerts,%build_prop,%client,%colors,,%cpuinfo_machine,%disks_bsd,
%dboot,%devices,%dl,%dmmapper,%force,%loaded,%mapper,%program_values,%risc, %dboot,%devices,%dl,%dmmapper,%force,%gui,%loaded,%mapper,%program_values,%risc,
%service_tool,%show,%sysctl,%system_files,%usb,%windows); %service_tool,%show,%sysctl,%system_files,%usb,%windows);
## System Arrays ## System Arrays
@ -107,7 +107,7 @@ my ($b_admin,$b_android,$b_display,$b_irc,$b_root);
## System ## System
my ($bsd_type,$device_vm,$language,$os,$pci_tool) = ('','','','',''); my ($bsd_type,$device_vm,$language,$os,$pci_tool) = ('','','','','');
my ($wan_url,$wl_compositors) = ('',''); my ($wan_url) = ('');
my ($bits_sys,$cpu_arch,$ppid); my ($bits_sys,$cpu_arch,$ppid);
my ($cpu_sleep,$dl_timeout,$limit,$ps_cols,$ps_count) = (0.35,4,10,0,5); my ($cpu_sleep,$dl_timeout,$limit,$ps_cols,$ps_count) = (0.35,4,10,0,5);
my $sensors_cpu_nu = 0; my $sensors_cpu_nu = 0;
@ -4289,6 +4289,7 @@ sub set_program_values {
'cdm' => ['^cdm',0,'0','CDM',0,1,0,'',''], 'cdm' => ['^cdm',0,'0','CDM',0,1,0,'',''],
# might be xlogin, unknown output for -V # might be xlogin, unknown output for -V
'clogin' => ['^clogin',0,'-V','clogin',0,1,0,'',''], # unverified, maybe xlogin 'clogin' => ['^clogin',0,'-V','clogin',0,1,0,'',''], # unverified, maybe xlogin
'elogind' => ['^elogind',0,'0','elogind',0,1,0,'',''],
'emptty' => ['^emptty',0,'0','EMPTTY',0,1,0,'',''], # unverified 'emptty' => ['^emptty',0,'0','EMPTTY',0,1,0,'',''], # unverified
'entrance' => ['^entrance',0,'0','Entrance',0,1,0,'',''], 'entrance' => ['^entrance',0,'0','Entrance',0,1,0,'',''],
'gdm' => ['^gdm',2,'--version','GDM',0,1,0,'',''], 'gdm' => ['^gdm',2,'--version','GDM',0,1,0,'',''],
@ -4306,6 +4307,7 @@ sub set_program_values {
'nodm' => ['^nodm',0,'0','nodm',0,1,0,'',''], 'nodm' => ['^nodm',0,'0','nodm',0,1,0,'',''],
'pcdm' => ['^pcdm',0,'0','PCDM',0,1,0,'',''], 'pcdm' => ['^pcdm',0,'0','PCDM',0,1,0,'',''],
'qingy' => ['^qingy',0,'0','qingy',0,1,0,'',''], # unverified 'qingy' => ['^qingy',0,'0','qingy',0,1,0,'',''], # unverified
'seatd' => ['^seatd',3,'-v','seatd',0,1,0,'',''],
'sddm' => ['^sddm',0,'0','SDDM',0,1,0,'',''], 'sddm' => ['^sddm',0,'0','SDDM',0,1,0,'',''],
'slim' => ['slim version',3,'-v','SLiM',0,1,0,'',''], 'slim' => ['slim version',3,'-v','SLiM',0,1,0,'',''],
'slimski' => ['slimski version',3,'-v','slimski',0,1,0,'',''], # slim fork 'slimski' => ['slimski version',3,'-v','slimski',0,1,0,'',''], # slim fork
@ -6398,7 +6400,7 @@ my $pppid = '';
sub set { sub set {
eval $start if $b_log; eval $start if $b_log;
main::set_ps_aux() if !$loaded{'ps-aux'}; PsData::set_cmd() if !$loaded{'ps-cmd'};
# $b_irc = 1; # for testing, like cli konvi start which shows as tty # $b_irc = 1; # for testing, like cli konvi start which shows as tty
if (!$b_irc){ if (!$b_irc){
# we'll run ShellData::set() for -I, but only then # we'll run ShellData::set() for -I, but only then
@ -19185,7 +19187,7 @@ sub set_compositor_data {
sub get_compositors { sub get_compositors {
eval $start if $b_log; eval $start if $b_log;
my $found = []; my $found = [];
main::set_ps_gui() if !$loaded{'ps-gui'}; PsData::set_gui() if !$loaded{'ps-gui'};
if (@ps_gui){ if (@ps_gui){
# ORDER MATTERS! # ORDER MATTERS!
# notes: compiz: debian package compiz-core; # notes: compiz: debian package compiz-core;
@ -19196,7 +19198,7 @@ sub get_compositors {
push (@compositors,qw(3dwm cosmic-comp dcompmgr gala kmscon push (@compositors,qw(3dwm cosmic-comp dcompmgr gala kmscon
metisse mir moblin monsterwm picom ukwm unagi unity-system-compositor metisse mir moblin monsterwm picom ukwm unagi unity-system-compositor
xcompmgr xfwm4 xfwm5 xfwm)); xcompmgr xfwm4 xfwm5 xfwm));
my $matches = join('|',@compositors) . $wl_compositors; my $matches = join('|',@compositors) . $gui{'wl-comp'};
foreach my $psg (@ps_gui){ foreach my $psg (@ps_gui){
if ($psg =~ /^($matches)$/){ if ($psg =~ /^($matches)$/){
push(@$found,$1); push(@$found,$1);
@ -19602,7 +19604,7 @@ sub component_recursive_data {
} }
## MachineItem ## MachineItem
# Public: get(), is_vm() # public subs: get(); is_vm()
{ {
my $b_vm; my $b_vm;
package MachineItem; package MachineItem;
@ -29067,7 +29069,7 @@ my $desktop = [];
sub get { sub get {
eval $start if $b_log; eval $start if $b_log;
set_desktop_values(); set_desktop_values();
main::set_ps_gui() if !$loaded{'ps-gui'}; PsData::set_gui() if !$loaded{'ps-gui'};
get_kde_trinity_data(); get_kde_trinity_data();
if (!@$desktop){ if (!@$desktop){
get_env_de_data(); get_env_de_data();
@ -29085,7 +29087,7 @@ sub get {
get_ps_de_data(); get_ps_de_data();
} }
if ($extra > 2 && @$desktop){ if ($extra > 2 && @$desktop){
set_info_data(); set_info_data(); # panels, docks, bars, etc
set_screensaver_data(); # and lockers set_screensaver_data(); # and lockers
} }
if ($b_display && !$force{'display'} && $extra > 1){ if ($b_display && !$force{'display'} && $extra > 1){
@ -29475,7 +29477,6 @@ sub get_env_xprop_misc_data {
sub get_ps_de_data { sub get_ps_de_data {
eval $start if $b_log; eval $start if $b_log;
my ($program,@version_data,@wms); my ($program,@version_data,@wms);
main::set_ps_gui() if !$loaded{'ps-gui'};
if (@ps_gui){ if (@ps_gui){
# order matters, these have alternate search patterns from default name # order matters, these have alternate search patterns from default name
# 0: check program; 1: ps_gui search; 2: data; 3: trigger alternate values/version # 0: check program; 1: ps_gui search; 2: data; 3: trigger alternate values/version
@ -29521,7 +29522,7 @@ sub get_ps_de_data {
nawm notion nscde openbox pekwm penrose qtile qvwm ratpoison nawm notion nscde openbox pekwm penrose qtile qvwm ratpoison
sawfish scrotwm snapwm spectrwm stumpwm tinywm tvtwm twm uwm sawfish scrotwm snapwm spectrwm stumpwm tinywm tvtwm twm uwm
windowlab wmfs wmfs2 wingo wmii2 wmii wmx xmonad yeahwm); windowlab wmfs wmfs2 wingo wmii2 wmii wmx xmonad yeahwm);
my $matches = join('|',@wms) . $wl_compositors; my $matches = join('|',@wms) . $gui{'wl-comp'};
# note: use my $psg to avoid bizarre return from program_data to ps_gui write # note: use my $psg to avoid bizarre return from program_data to ps_gui write
foreach my $psg (@ps_gui){ foreach my $psg (@ps_gui){
# no need to use check program with short list of ps_gui # no need to use check program with short list of ps_gui
@ -29611,7 +29612,6 @@ sub get_wm_main {
} }
} }
if (!$desktop->[5]){ if (!$desktop->[5]){
main::set_ps_gui() if !$loaded{'ps-gui'};
# order matters, see above logic # order matters, see above logic
# due to lisp/python starters, clfswm/stumpwm/qtile need the starter filters # due to lisp/python starters, clfswm/stumpwm/qtile need the starter filters
my @wms = qw(2bwm 9wm aewm aewm\+\+ afterstep amiwm antiwm awesome blackbox my @wms = qw(2bwm 9wm aewm aewm\+\+ afterstep amiwm antiwm awesome blackbox
@ -29623,7 +29623,7 @@ sub get_wm_main {
mvwm mwm nawm notion openbox qtile qvwm penrose ratpoison sawfish scrotwm mvwm mwm nawm notion openbox qtile qvwm penrose ratpoison sawfish scrotwm
snapwm spectrwm stumpwm tinywm tvtwm twm ukwm windowlab WindowMaker wingo snapwm spectrwm stumpwm tinywm tvtwm twm ukwm windowlab WindowMaker wingo
wmfs2? wmii2? wmx xfwm[45]? xmonad yeahwm); wmfs2? wmii2? wmx xfwm[45]? xmonad yeahwm);
my $wms = join('|',@wms) . $wl_compositors; my $wms = join('|',@wms) . $gui{'wl-comp'};
foreach my $psg (@ps_gui){ foreach my $psg (@ps_gui){
if ($psg =~ /^($wms)$/){ if ($psg =~ /^($wms)$/){
$working = $1; $working = $1;
@ -29681,63 +29681,36 @@ sub get_wm_version {
sub set_info_data { sub set_info_data {
eval $start if $b_log; eval $start if $b_log;
main::set_ps_gui() if !$loaded{'ps-gui'}; if (@{$gui{'info-active'}}){
my (@data,@info,$item); $desktop->[4] = join(', ', @{$gui{'info-active'}});
my $pattern = 'alltray|awn|awesomebar|bar|bmpanel|bmpanel2|budgie-panel|';
$pattern .= 'cairo-dock|dde-dock|dmenu|dockbarx|docker|docky|dzen|dzen2|';
$pattern .= 'fancybar|fbpanel|fspanel|glx-dock|gnome-panel|hpanel|';
$pattern .= 'i3bar|i3status|i3-status-rs|icewmtray|';
$pattern .= 'kdocker|kicker|';
$pattern .= 'latte|latte-dock|lemonbar|ltpanel|luastatus|lxpanel|lxqt-panel|';
$pattern .= 'matchbox-panel|mate-panel|nwg-bar|nwg-dock|nwg-panel|ourico|';
$pattern .= 'perlpanel|plank|plasma-desktop|plasma-netbook|polybar|pypanel|';
$pattern .= 'razor-panel|razorqt-panel|rootbar|sfwbar|stalonetray|swaybar|';
$pattern .= 'taskbar|tint2|trayer|';
$pattern .= 'ukui-panel|vala-panel|wapanel|waybar|wbar|wharf|wingpanel|witray|';
$pattern .= 'xfce4-panel|xfce5-panel|xmobar|yabar|yambar';
if (@data = grep {/^($pattern)$/} @ps_gui){
# only one entry per type, can be multiple
foreach $item (@data){
if (! grep {$item =~ /$_/} @info){
$item = main::trimmer($item);
$item =~ s/.*\///;
push(@info, (split(/\s+/, $item))[0]);
}
}
}
if (@info){
main::uniq(\@info);
$desktop->[4] = join(', ', @info);
} }
eval $end if $b_log; eval $end if $b_log;
} }
sub set_screensaver_data { sub set_screensaver_data {
eval $start if $b_log; eval $start if $b_log;
my (@installed,@running); # these are running/active
# make sure these are the same as in set_ps_gui() list. if (@{$gui{'tools-active'}}){
my @items = qw(away boinc-screensaver budgie-screensaver cinnamon-screensaver $desktop->[7] = join(',', @{$gui{'tools-active'}});
gnome-screensaver gsd-screensaver-proxy gtklock i3lock kscreenlocker
light-locker lockscreen lxlock mate-screensaver nwg-lock physlock
rss-glx slock swayidle swaylock ukui-screensaver unicode-screensaver
xautolock xfce4-screensaver xlock xlockmore xscreensaver
xsecurelock xss-lock xtrlock);
foreach my $item (@items){
if (grep {$_ eq $item} @ps_gui){
push(@running,$item);
} }
elsif ($b_admin && main::check_program($item)){ # now check if any are available but not running/services
if ($b_admin){
my (@installed,%test);
if ($desktop->[7]){
foreach my $tool (@{$gui{'tools-active'}}){
$test{$tool} = 1;
}
}
foreach my $item (@{$gui{'tools-test'}}){
next if $test{$item};
if (main::check_program($item)){
push(@installed,$item); push(@installed,$item);
} }
} }
if (@running){
main::uniq(\@running);
$desktop->[7] = join(',', @running);
}
if (@installed){ if (@installed){
main::uniq(\@installed);
$desktop->[8] = join(',', @installed); $desktop->[8] = join(',', @installed);
} }
}
eval $end if $b_log; eval $end if $b_log;
} }
@ -30879,9 +30852,9 @@ sub get_display_manager {
# greetd-684.sock if no .run seen. Add Ly in case they add run file/directory. # greetd-684.sock if no .run seen. Add Ly in case they add run file/directory.
# greetd frontends: agreety dlm gtkgreet qtgreet tuigreet wlgreet # greetd frontends: agreety dlm gtkgreet qtgreet tuigreet wlgreet
# mlogin may be mlogind, not verified # mlogin may be mlogind, not verified
my @dms = qw(brzdm cdm clogin emptty entranced gdm gdm3 greetd kdm kdm3 kdmctl my @dms = qw(brzdm cdm clogin elogind emptty entranced
ldm lightdm lxdm ly mdm mlogin nodm pcdm qingy sddm slim slimski tbsm tdm gdm gdm3 greetd kdm kdm3 kdmctl ldm lightdm lxdm ly mdm mlogin nodm
udm wdm xdm xdmctl xenodm xlogin); pcdm qingy sddm seatd slim slimski tbsm tdm udm wdm xdm xdmctl xenodm xlogin);
# these are the only one I know of so far that have version info. xlogin / # these are the only one I know of so far that have version info. xlogin /
# clogin do, -V, brzdm -v, but syntax not verified. # clogin do, -V, brzdm -v, but syntax not verified.
my @dms_version = qw(gdm gdm3 lightdm ly slim); my @dms_version = qw(gdm gdm3 lightdm ly slim);
@ -34443,28 +34416,37 @@ sub sys_data {
} }
} }
sub set_ps_aux { ## PsData
# public subs: set_cmd(); set_gui()
{
package PsData;
sub set_cmd {
eval $start if $b_log; eval $start if $b_log;
my ($header,$ps,@temp); my ($b_busybox,$header,$ps,@temp);
# note: some ps cut off output based on terminal width $loaded{'ps-cmd'} = 1;
# ww sets width unlimited my $args = 'wwaux';
$loaded{'ps-aux'} = 1; my $path = main::check_program('ps');
$ps = grabber("ps wwaux 2>/dev/null",'','strip','ref'); my $link = readlink($path);
if ($link && $link =~ /busybox/i){
$b_busybox = 1;
$args = '';
}
# note: some ps cut output based on terminal width, ww sets width unlimited
# old busybox returns error with args, new busybox ignores auxww
$ps = main::grabber("$path $args 2>/dev/null",'','strip','ref');
if (@$ps){ if (@$ps){
$header = shift @$ps; # get rid of header row $header = shift @$ps; # get rid of header row
# handle busy box, which has 3 columns, regular ps aux has 11 # handle busy box, which has 3 columns, regular ps aux has 11
# avoid deprecated implicit split error in older Perls # avoid deprecated implicit split error in older Perls
@temp = split(/\s+/, $header); @temp = split(/\s+/, $header);
} }
else {
return;
}
$ps_cols = $#temp; # the indexes, not the scalar count $ps_cols = $#temp; # the indexes, not the scalar count
# we want more data from ps busybox # we want more data from ps busybox, to get TinyX screen res
my $cols_use = ($ps_cols < 4) ? 7 : 2; my $cols_use = ($b_busybox) ? 7 : 2;
# not used, $b_busybox_ps was global
# if ($ps_cols < 10){
# my $version = qx(ps --version 2>&1);
# $b_busybox_ps = 1 if $version =~ /busybox/i;
# }
return if !@$ps; # note: mips/openwrt ps has no 'a'
for (@$ps){ for (@$ps){
next if !$_; next if !$_;
next if $self_name eq 'inxi' && /\/$self_name\b/; next if $self_name eq 'inxi' && /\/$self_name\b/;
@ -34483,11 +34465,11 @@ sub set_ps_aux {
} }
} }
# never prints with 5, because ps loaded before option handler # never prints with 5, because ps loaded before option handler
# print 'ps main: ', Dumper \@ps_cmd; # if $dbg[5]; # print 'ps main: ', Data::Dumper::Dumper \@ps_cmd; # if $dbg[5];
eval $end if $b_log; eval $end if $b_log;
} }
sub set_ps_gui { sub set_gui {
eval $start if $b_log; eval $start if $b_log;
$loaded{'ps-gui'} = 1; $loaded{'ps-gui'} = 1;
my ($b_wl,$working,@match,@temp); my ($b_wl,$working,@match,@temp);
@ -34518,30 +34500,29 @@ sub set_ps_gui {
ukwm xfwm[45]?); ukwm xfwm[45]?);
push(@match,@temp); push(@match,@temp);
# startx: /bin/sh /usr/bin/startx # startx: /bin/sh /usr/bin/startx
@temp=qw(ly .*startx xinit); # possible dm values @temp=qw(ly startx xinit); # possible dm values
push(@match,@temp); push(@match,@temp);
} }
# info: NOTE: glx-dock is cairo-dock # info: NOTE: glx-dock is cairo-dock
if ($show{'system'} && $extra > 2){ if ($show{'system'} && $extra > 2){
@temp=qw(alltray awesomebar awn bar bmpanel bmpanel2 budgie-panel process_gui(\@{$gui{'info-active'}},join('|', qw(
cairo-dock dde-dock dmenu dockbarx docker docky dzen dzen2 alltray awesomebar awn bar bmpanel bmpanel2 budgie-panel cairo-dock
fbpanel fspanel glx-dock gnome-panel hpanel i3bar i3-status(-rs)? icewmtray dde-dock dmenu dockbarx docker docky dzen dzen2 fbpanel fspanel
kdocker kicker latte latte-dock lemonbar ltpanel luastatus lxpanel lxqt-panel glx-dock gnome-panel hpanel i3bar i3-status(-rs)? icewmtray kdocker kicker
latte latte-dock lemonbar ltpanel luastatus lxpanel lxqt-panel
matchbox-panel mate-panel nwg-bar nwg-dock nwg-panel ourico matchbox-panel mate-panel nwg-bar nwg-dock nwg-panel ourico
perlpanel plank plasma-desktop plasma-netbook polybar pypanel perlpanel plank plasma-desktop plasma-netbook polybar pypanel
razor-panel razorqt-panel rootbar razor-panel razorqt-panel rootbar sfwbar stalonetray swaybar
sfwbar stalonetray swaybar taskbar tint2 trayer taskbar tint2 trayer ukui-panel vala-panel wapanel waybar wbar wharf
ukui-panel vala-panel wapanel waybar wbar wharf wingpanel witray wingpanel witray xfce[45]?-panel xmobar yambar yabar)));
xfce[45]?-panel xmobar yambar yabar); # Generate tools: screensavers/lockers. Note that many lockers may not be services
push(@match,@temp); @{$gui{'tools-test'}}=qw(away boinc-screensaver budgie-screensaver
# then the screensavers/lockers. Note that many lockers may not be services cinnamon-screensaver gnome-screensaver gsd-screensaver-proxy gtklock i3lock
@temp=qw(away boinc-screensaver budgie-screensaver cinnamon-screensaver kscreenlocker light-locker lockscreen lxlock mate-screensaver nwg-lock
gnome-screensaver gsd-screensaver-proxy gtklock i3lock kscreenlocker physlock rss-glx slock swayidle swaylock ukui-screensaver unicode-screensaver
light-locker lockscreen lxlock mate-screensaver nwg-lock physlock
rss-glx slock swayidle swaylock ukui-screensaver unicode-screensaver
xautolock xfce4-screensaver xlock xlockmore xscreensaver xautolock xfce4-screensaver xlock xlockmore xscreensaver
xsecurelock xss-lock xtrlock); xsecurelock xss-lock xtrlock);
push(@match,@temp); process_gui(\@{$gui{'tools-active'}},join('|',@{$gui{'tools-test'}}));
} }
# compositors (for wayland these are also the server, note). # compositors (for wayland these are also the server, note).
# for wayland always show, so always load these # for wayland always show, so always load these
@ -34553,12 +34534,12 @@ sub set_ps_gui {
push(@match,@temp); push(@match,@temp);
$b_wl = 1; $b_wl = 1;
} }
uniq(\@match); main::uniq(\@match);
my $matches = join('|', @match); my $matches = join('|', @match);
if ($b_wl){ if ($b_wl){
# wayland compositors generally are compositors and wm. # wayland compositors generally are compositors and wm.
# These will be used globally to avoid having to redo it over and over. # These will be used globally to avoid having to redo it over and over.
$wl_compositors = '|' . join('|',qw(asc awc $gui{'wl-comp'} = '|' . join('|',qw(asc awc
cage cagebreak cardboard chameleonwm clayland comfc cage cagebreak cardboard chameleonwm clayland comfc
dwc dwl epd-wm fireplace feathers fenestra glass gamescope greenfield grefson dwc dwl epd-wm fireplace feathers fenestra glass gamescope greenfield grefson
hikari hopalong [Hh]yprland inaban japokwm kiwmi labwc laikawm lipstick liri hikari hopalong [Hh]yprland inaban japokwm kiwmi labwc laikawm lipstick liri
@ -34568,23 +34549,35 @@ sub set_ps_gui {
tabby taiwins tinybox tinywl trinkster velox vimway vivarium tabby taiwins tinybox tinywl trinkster velox vimway vivarium
wavy waybox way-?cooler wayfire wayhouse waymonad westeros westford wavy waybox way-?cooler wayfire wayhouse waymonad westeros westford
weston wio\+? wxr[cd] xuake)); weston wio\+? wxr[cd] xuake));
$matches .= $wl_compositors; $matches .= $gui{'wl-comp'};
} }
$matches = qr/$matches/; # remember qr/../i only added perl 5.014 $matches = qr/$matches/; # remember qr/../i only added perl 5.014
process_gui(\@ps_gui,$matches);
# print "$matches\n"; # print "$matches\n";
foreach (@ps_cmd){
# strip out python/lisp/sh starters
if (/^(\/\S+\/(c?lisp|perl|python|sh)\s+)?(|[\S]*\/)($matches)(\/|\s|$)/){
push(@ps_gui, $4); # deal with duplicates with uniq
}
}
# print Dumper \@ps_gui if $dbg[5]; # print Dumper \@ps_gui if $dbg[5];
uniq(\@ps_gui) if @ps_gui; main::uniq(\@ps_gui) if @ps_gui;
print 'ps_gui: ', Dumper \@ps_gui if $dbg[5]; if ($dbg[5]){
log_data('dump','@ps_gui',\@ps_gui) if $b_log; print 'ps_gui: ', Data::Dumper::Dumper \@ps_gui;
print '%gui: ', Data::Dumper::Dumper \%gui;
}
if ($b_log){
main::log_data('dump','@ps_gui',\@ps_gui);
main::log_data('dump','%gui',\%gui);
}
eval $end if $b_log; eval $end if $b_log;
} }
# args: 0: array ref or scalar to become ref; 1: 1: matches pattern
sub process_gui {
foreach (@ps_cmd){
# strip out python/lisp/*sh starters
if (/^(\/\S+\/(c?lisp|perl|python|[a-z]{0,3}sh)\s+)?(|[\S]*\/)($_[1])(\/|\s|$)/){
push(@{$_[0]}, $4); # deal with duplicates with uniq
}
}
}
}
sub get_self_version { sub get_self_version {
eval $start if $b_log; eval $start if $b_log;
my $patch = $self_patch; my $patch = $self_patch;
@ -36439,7 +36432,7 @@ my ($items,$subs);
sub generate { sub generate {
eval $start if $b_log; eval $start if $b_log;
my ($item,%checks); my ($item,%checks);
main::set_ps_aux() if !$loaded{'ps-aux'}; PsData::set_cmd() if !$loaded{'ps-cmd'};
main::set_sysctl_data() if $use{'sysctl'}; main::set_sysctl_data() if $use{'sysctl'};
main::set_dboot_data() if $bsd_type && !$loaded{'dboot'}; main::set_dboot_data() if $bsd_type && !$loaded{'dboot'};
# note: ps aux loads before logging starts, so create debugger data here # note: ps aux loads before logging starts, so create debugger data here

View file

@ -15,7 +15,7 @@
.\" with this program; if not, write to the Free Software Foundation, Inc., .\" with this program; if not, write to the Free Software Foundation, Inc.,
.\" 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. .\" 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
.\" .\"
.TH INXI 1 "2023\-12\-09" "inxi" "inxi manual" .TH INXI 1 "2023\-12\-12" "inxi" "inxi manual"
.SH NAME .SH NAME
inxi \- Command line system information script for console and IRC inxi \- Command line system information script for console and IRC