wm updates

This commit is contained in:
Harald Hope 2023-11-29 20:45:19 -08:00
parent 97be59df7c
commit 2ea369b0d6

102
pinxi
View file

@ -51,7 +51,7 @@ use POSIX qw(ceil uname strftime ttyname);
my $self_name='pinxi';
my $self_version='3.3.31';
my $self_date='2023-11-29';
my $self_patch='20';
my $self_patch='21';
## END INXI INFO ##
my ($b_pledge,@pledges);
@ -29443,62 +29443,62 @@ sub get_env_xprop_misc_data {
sub get_ps_de_data {
eval $start if $b_log;
my ($program,@version_data);
my ($program,@version_data,@wms);
main::set_ps_gui() if !$loaded{'ps-gui'};
if (@ps_gui){
# the sequence here matters, some desktops like icewm, razor, let you set different
# wm, so we want to get the main controlling desktop first
# icewm and any other that permits alternate wm to be used need to go first
# in this list.
# unverfied: 2bwm catwm mcwm penrose snapwm uwm wmfs wmfs2 wingo wmii2
# xfdesktoo is fallback in case not in xprop
my @wms = qw(icewm 2bwm 9wm aewm aewm\+\+ afterstep amiwm antiwm awesome
blackbox bspwm calmwm catwm cde ctwm dawn dusk dwm echinus evilwm
fluxbox hackedbox herbstluftwm instantwm i3 ion3 jbwm jwm
larswm leftwm lwm matchbox-window-manager mcwm mini musca mvwm mwm
nawm notion nscde openbox pekwm penrose qvwm ratpoison
sawfish scrotwm snapwm spectrwm tinywm tvtwm twm uwm
windowlab wmfs wmfs2 wingo wmii2 wmii wmx xmonad yeahwm);
my $matches = join('|',@wms) . $wl_compositors;
# note: use my $psg to avoid bizarre return from program_data to ps_gui write
foreach my $psg (@ps_gui){
# order matters, these have alternate search patterns from default name
# 0: check program; 1: ps_gui search; 2: data; 3: trigger alternate values/version
@wms =(
['WindowMaker','WindowMaker','wmaker',''],
# ['clfswm','clfswm','clfswm',''], # *(sh|c?lisp)?.*clfswm'
['cwm','(openbsd-)?cwm','cwm',''],
# ['flwm','flwm','flwm',''],
['flwm','flwm(_topside)?','flwm',''],
['fvwm-crystal','fvwm.*-crystal','fvwm-crystal','fvwm'],
['fvwm1','fvwm1','fvwm1',''],
['fvwm2','fvwm2','fvwm2',''],
['fvwm3','fvwm3','fvwm3',''],
['fvwm95','fvwm95','fvwm95',''],
['fvwm','fvwm','fvwm',''],
['hyprland','[Hh]yprland','hyprctl',''],
# ['qtile','.*qtile','qtile',''], # *(python.*)?qtile'
# ['stumpwm','stumpwm','stumpwm',''], # '(sh|c?lisp)?.*stumpwm'
);
foreach my $item (@wms){
# no need to use check program with short list of ps_gui
if ($psg =~ /^($matches)$/){
my $item = $1;
($desktop->[0],$desktop->[1]) = main::program_data($item);
if ($extra > 1 && $item eq 'xfdesktop'){
($desktop->[2],$desktop->[3]) = main::program_data('xfdesktop-toolkit',$item,1);
# print "1: $item->[1]\n";
if (grep {/^$item->[1]$/i} @ps_gui){
# print "2: $item->[1]\n";
($desktop->[0],$desktop->[1]) = main::program_data($item->[2],$item->[3]);
if ($extra > 1 && $item->[0] eq 'xfdesktop'){
($desktop->[2],$desktop->[3]) = main::program_data('xfdesktop-toolkit',$item->[0],1);
}
last;
}
}
if (!$desktop->[0]){
# order matters, these have alternate search patterns from default name
# 0: check program; 1: ps_gui search; 2: data; 3: trigger alternate values/version
@wms =(
['WindowMaker','WindowMaker','wmaker',''],
['clfswm','clfswm','clfswm',''], # *(sh|c?lisp)?.*clfswm'
['cwm','(openbsd-)?cwm','cwm',''],
['flwm','flwm','flwm',''],
['flwm','flwm_topside','flwm',''],
['fvwm-crystal','fvwm.*-crystal','fvwm-crystal','fvwm'],
['fvwm1','fvwm1','fvwm1',''],
['fvwm2','fvwm2','fvwm2',''],
['fvwm3','fvwm3','fvwm3',''],
['fvwm','fvwm','fvwm',''],
['fvwm95','fvwm95','fvwm95',''],
['hyprland','hyprland','hyprctl',''],
['qtile','.*qtile','qtile',''], # *(python.*)?qtile'
['stumpwm','stumpwm','stumpwm',''], # '(sh|c?lisp)?.*stumpwm'
);
foreach my $item (@wms){
# the sequence here matters, some desktops like icewm, razor, let you set different
# wm, so we want to get the main controlling desktop first
# icewm and any other that permits alternate wm to be used need to go first
# in this list.
# unverfied: 2bwm catwm mcwm penrose snapwm uwm wmfs wmfs2 wingo wmii2
# xfdesktoo is fallback in case not in xprop
@wms = qw(icewm 2bwm 9wm aewm aewm\+\+ afterstep amiwm antiwm awesome
blackbox bspwm calmwm catwm cde clfswm ctwm dawn dusk dwm echinus evilwm
fluxbox hackedbox herbstluftwm instantwm i3 ion3 jbwm jwm
larswm leftwm lwm matchbox-window-manager mcwm mini musca mvwm mwm
nawm notion nscde openbox pekwm penrose qtile qvwm ratpoison
sawfish scrotwm snapwm spectrwm stumpwm tinywm tvtwm twm uwm
windowlab wmfs wmfs2 wingo wmii2 wmii wmx xmonad yeahwm);
my $matches = join('|',@wms) . $wl_compositors;
# note: use my $psg to avoid bizarre return from program_data to ps_gui write
foreach my $psg (@ps_gui){
# no need to use check program with short list of ps_gui
# print "1: $item->[1]\n";
if (grep {/^$item->[1]$/i} @ps_gui){
# print "2: $item->[1]\n";
($desktop->[0],$desktop->[1]) = main::program_data($item->[2],$item->[3]);
if ($extra > 1 && $item->[0] eq 'xfdesktop'){
($desktop->[2],$desktop->[3]) = main::program_data('xfdesktop-toolkit',$item->[0],1);
if ($psg =~ /^($matches)$/){
my $item = $1;
($desktop->[0],$desktop->[1]) = main::program_data($item);
if ($extra > 1 && $item eq 'xfdesktop'){
($desktop->[2],$desktop->[3]) = main::program_data('xfdesktop-toolkit',$item,1);
}
last;
}
@ -29582,7 +29582,7 @@ sub get_wm_main {
if (!$desktop->[5]){
main::set_ps_gui() if !$loaded{'ps-gui'};
# order matters, see above logic
# due to lisp/python starters, clfswm/stumpwm/qtile will not detect here
# due to lisp/python starters, clfswm/stumpwm/qtile need the starter filters
my @wms = qw(2bwm 9wm aewm aewm\+\+ afterstep amiwm antiwm awesome blackbox
calmwm catwm clfswm compiz ctwm (openbsd-)?cwm fluxbox bspwm budgie-wm
deepin-wm dawn dusk dwm echinus evilwm flwm fvwm-crystal fvwm1 fvwm2 fvwm3
@ -34513,7 +34513,7 @@ sub set_ps_gui {
$wl_compositors = '|' . join('|',qw(asc awc
cage cagebreak cardboard chameleonwm clayland comfc
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
mahogany marina maze motorcar newm nucleus
orbital orbment perceptia phoc pywm qtile river rootston rustland
simulavr skylight smithay sommelier sway swc swvkc
@ -34523,12 +34523,14 @@ sub set_ps_gui {
$matches .= $wl_compositors;
}
$matches = qr/$matches/; # remember qr/../i only added perl 5.014
# 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];
uniq(\@ps_gui) if @ps_gui;
print Dumper \@ps_gui if $dbg[5];
log_data('dump','@ps_gui',\@ps_gui) if $b_log;