mirror of
https://github.com/smxi/inxi.git
synced 2024-11-17 00:31:19 +00:00
-S screensavers
This commit is contained in:
parent
68d605ac83
commit
37748258b7
63
pinxi
63
pinxi
|
@ -51,7 +51,7 @@ use POSIX qw(ceil uname strftime ttyname);
|
||||||
my $self_name='pinxi';
|
my $self_name='pinxi';
|
||||||
my $self_version='3.3.31';
|
my $self_version='3.3.31';
|
||||||
my $self_date='2023-11-21';
|
my $self_date='2023-11-21';
|
||||||
my $self_patch='14';
|
my $self_patch='15';
|
||||||
## END INXI INFO ##
|
## END INXI INFO ##
|
||||||
|
|
||||||
my ($b_pledge,@pledges);
|
my ($b_pledge,@pledges);
|
||||||
|
@ -28999,6 +28999,8 @@ sub set_dboot_data {
|
||||||
# 4: info extra desktop data
|
# 4: info extra desktop data
|
||||||
# 5: wm
|
# 5: wm
|
||||||
# 6: wm version
|
# 6: wm version
|
||||||
|
# 7: screensavers/lockers: running
|
||||||
|
# 8: screensavers/lockers: all not running, installed
|
||||||
{
|
{
|
||||||
package DesktopEnvironment;
|
package DesktopEnvironment;
|
||||||
my ($b_gtk,$b_qt,$b_xprop,$desktop_session,$gdmsession,$kde_session_version,
|
my ($b_gtk,$b_qt,$b_xprop,$desktop_session,$gdmsession,$kde_session_version,
|
||||||
|
@ -29027,6 +29029,7 @@ sub get {
|
||||||
}
|
}
|
||||||
if ($extra > 2 && @$desktop){
|
if ($extra > 2 && @$desktop){
|
||||||
set_info_data();
|
set_info_data();
|
||||||
|
set_screensaver_data(); # and lockers
|
||||||
}
|
}
|
||||||
if ($b_display && !$force{'display'} && $extra > 1){
|
if ($b_display && !$force{'display'} && $extra > 1){
|
||||||
get_wm();
|
get_wm();
|
||||||
|
@ -29034,6 +29037,7 @@ sub get {
|
||||||
set_gtk_data() if $b_gtk && $extra > 1;
|
set_gtk_data() if $b_gtk && $extra > 1;
|
||||||
set_qt_data() if $b_qt && $extra > 1;
|
set_qt_data() if $b_qt && $extra > 1;
|
||||||
main::log_data('dump','@$desktop', $desktop) if $b_log;
|
main::log_data('dump','@$desktop', $desktop) if $b_log;
|
||||||
|
print Data::Dumper::Dumper $desktop if $dbg[59];
|
||||||
# ($b_xprop,$kde_session_version,$xdg_desktop,@data,@xprop) = ();
|
# ($b_xprop,$kde_session_version,$xdg_desktop,@data,@xprop) = ();
|
||||||
eval $end if $b_log;
|
eval $end if $b_log;
|
||||||
return $desktop;
|
return $desktop;
|
||||||
|
@ -29647,6 +29651,34 @@ sub set_info_data {
|
||||||
eval $end if $b_log;
|
eval $end if $b_log;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub set_screensaver_data {
|
||||||
|
eval $start if $b_log;
|
||||||
|
my (@installed,@running);
|
||||||
|
# make sure these are the same as in set_ps_gui() list.
|
||||||
|
my @items = qw(away boinc-screensaver cinnamon-screensaver gnome-screensaver
|
||||||
|
i3lock kscreenlocker light-locker lxlock mate-screensaver nwg-lock
|
||||||
|
lockscreen-manager physlock rss-glx slock 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)){
|
||||||
|
push(@installed,$item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (@running){
|
||||||
|
main::uniq(\@running);
|
||||||
|
$desktop->[7] = join(',', @running);
|
||||||
|
}
|
||||||
|
if (@installed){
|
||||||
|
main::uniq(\@installed);
|
||||||
|
$desktop->[8] = join(',', @installed);
|
||||||
|
}
|
||||||
|
eval $end if $b_log;
|
||||||
|
}
|
||||||
|
|
||||||
sub set_xprop {
|
sub set_xprop {
|
||||||
eval $start if $b_log;
|
eval $start if $b_log;
|
||||||
if (my $program = main::check_program('xprop')){
|
if (my $program = main::check_program('xprop')){
|
||||||
|
@ -34270,13 +34302,13 @@ my $power = {};
|
||||||
# args: 0: $power by ref
|
# args: 0: $power by ref
|
||||||
sub get {
|
sub get {
|
||||||
eval $start if $b_log;
|
eval $start if $b_log;
|
||||||
power_data();
|
sys_data();
|
||||||
eval $end if $b_log;
|
eval $end if $b_log;
|
||||||
return $power;
|
return $power;
|
||||||
}
|
}
|
||||||
|
|
||||||
# note: currently Linux only, if we ever find BSD sources, take another look.
|
# note: currently Linux only, if we ever find BSD sources, take another look.
|
||||||
sub power_data {
|
sub sys_data {
|
||||||
eval $start if $b_log;
|
eval $start if $b_log;
|
||||||
# Some systems also report > 1 wakeup events per wakeup with
|
# Some systems also report > 1 wakeup events per wakeup with
|
||||||
# /sys/power/wakeup_count, thus, we are using /sys/power/suspend_stats/success
|
# /sys/power/wakeup_count, thus, we are using /sys/power/suspend_stats/success
|
||||||
|
@ -34413,6 +34445,13 @@ sub set_ps_gui {
|
||||||
ukui-panel vala-panel wapanel waybar wbar wharf wingpanel witray
|
ukui-panel vala-panel wapanel waybar wbar wharf wingpanel witray
|
||||||
xfce[45]?-panel xmobar yambar yabar);
|
xfce[45]?-panel xmobar yambar yabar);
|
||||||
push(@match,@temp);
|
push(@match,@temp);
|
||||||
|
# then the screensavers/lockers. Note that many lockers may not be services
|
||||||
|
@temp=qw(away boinc-screensaver cinnamon-screensaver gnome-screensaver
|
||||||
|
i3lock kscreenlocker light-locker lxlock mate-screensaver nwg-lock
|
||||||
|
lockscreen-manager physlock rss-glx slock swaylock ukui-screensaver
|
||||||
|
unicode-screensaver xautolock xfce4-screensaver xlock xlockmore xscreensaver
|
||||||
|
xsecurelock xss-lock xtrlock);
|
||||||
|
push(@match,@temp);
|
||||||
}
|
}
|
||||||
# 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
|
||||||
|
@ -36710,7 +36749,8 @@ sub system_item {
|
||||||
my ($index);
|
my ($index);
|
||||||
my $data_name = main::key($prefix++,1,0,'System');
|
my $data_name = main::key($prefix++,1,0,'System');
|
||||||
my ($desktop,$desktop_info,$desktop_key,$dm_key,$toolkit,$wm) = ('','','Desktop','dm','','');
|
my ($desktop,$desktop_info,$desktop_key,$dm_key,$toolkit,$wm) = ('','','Desktop','dm','','');
|
||||||
my (@desktop_data,$cs_curr,$cs_avail,$desktop_version,$tk_version,$wm_version);
|
my (@desktop_data,$cs_curr,$cs_avail,$desktop_version,
|
||||||
|
$screensaver_running,$screensaver_avail,$tk_version,$wm_version);
|
||||||
my $data = {
|
my $data = {
|
||||||
$data_name => [{}],
|
$data_name => [{}],
|
||||||
};
|
};
|
||||||
|
@ -36767,6 +36807,12 @@ sub system_item {
|
||||||
if ($extra > 2 && $desktop_data->[4]){
|
if ($extra > 2 && $desktop_data->[4]){
|
||||||
$desktop_info = $desktop_data->[4];
|
$desktop_info = $desktop_data->[4];
|
||||||
}
|
}
|
||||||
|
if ($extra > 2 && $desktop_data->[7]){
|
||||||
|
$screensaver_running = $desktop_data->[7];
|
||||||
|
}
|
||||||
|
if ($b_admin && $desktop_data->[8]){
|
||||||
|
$screensaver_avail = $desktop_data->[8];
|
||||||
|
}
|
||||||
# don't print the desktop if it's a wm and the same
|
# don't print the desktop if it's a wm and the same
|
||||||
if ($extra > 1 && $desktop_data->[5] &&
|
if ($extra > 1 && $desktop_data->[5] &&
|
||||||
(!$desktop_data->[0] || $desktop_data->[5] =~ /^(deepin.+|gnome[\s_-]shell|budgie.+)$/i ||
|
(!$desktop_data->[0] || $desktop_data->[5] =~ /^(deepin.+|gnome[\s_-]shell|budgie.+)$/i ||
|
||||||
|
@ -36824,6 +36870,15 @@ sub system_item {
|
||||||
$data->{$data_name}[$index]{main::key($num++,0,3,'v')} = $wm_version;
|
$data->{$data_name}[$index]{main::key($num++,0,3,'v')} = $wm_version;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if ($extra > 2){
|
||||||
|
if ($screensaver_running || $screensaver_avail){
|
||||||
|
$screensaver_running ||= '';
|
||||||
|
$data->{$data_name}[$index]{main::key($num++,1,2,'tools')} = $screensaver_running;
|
||||||
|
if ($screensaver_avail){
|
||||||
|
$data->{$data_name}[$index]{main::key($num++,0,3,'avail')} = $screensaver_avail;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
if ($extra > 2 && $b_display && defined $ENV{'XDG_VTNR'}){
|
if ($extra > 2 && $b_display && defined $ENV{'XDG_VTNR'}){
|
||||||
$data->{$data_name}[$index]{main::key($num++,0,2,'vt')} = $ENV{'XDG_VTNR'};
|
$data->{$data_name}[$index]{main::key($num++,0,2,'vt')} = $ENV{'XDG_VTNR'};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue