ts4
This commit is contained in:
parent
6d33d9446f
commit
6cbadb5d5d
|
@ -53,6 +53,10 @@ elif [ $1 == "fade" ]; then
|
||||||
elif [ $1 == "unfade" ]; then
|
elif [ $1 == "unfade" ]; then
|
||||||
if [ -e $HOME/.spool/sway-hidden ]; then
|
if [ -e $HOME/.spool/sway-hidden ]; then
|
||||||
kill -USR2 `cat $HOME/.spool/sway-transparency`
|
kill -USR2 `cat $HOME/.spool/sway-transparency`
|
||||||
|
<<<<<<< Updated upstream
|
||||||
|
=======
|
||||||
|
/home/jpm/scripts/sway/displays.pl -w
|
||||||
|
>>>>>>> Stashed changes
|
||||||
fi
|
fi
|
||||||
elif [ $1 == "dim" ]; then
|
elif [ $1 == "dim" ]; then
|
||||||
echo $($HOME/scripts/thinkpad/blc.pl %) > $BLFILE
|
echo $($HOME/scripts/thinkpad/blc.pl %) > $BLFILE
|
||||||
|
|
|
@ -32,10 +32,17 @@ elif [ "$res" == "↹ Restart i3" ]; then
|
||||||
i3 restart
|
i3 restart
|
||||||
elif [ "$res" == "↻ Reload Sway" ]; then
|
elif [ "$res" == "↻ Reload Sway" ]; then
|
||||||
sway reload
|
sway reload
|
||||||
|
<<<<<<< Updated upstream
|
||||||
/home/jpm/scripts/sway/displays.pl
|
/home/jpm/scripts/sway/displays.pl
|
||||||
elif [ "$res" == "↻ Reload Waybar" ]; then
|
elif [ "$res" == "↻ Reload Waybar" ]; then
|
||||||
# Need to integrate with sway/displays.pl for alternative outputs
|
# Need to integrate with sway/displays.pl for alternative outputs
|
||||||
/home/jpm/scripts/sway/displays.pl -w
|
/home/jpm/scripts/sway/displays.pl -w
|
||||||
|
=======
|
||||||
|
/home/jpm/scripts/distrobox/debian12/displays.sh
|
||||||
|
elif [ "$res" == "↻ Reload Waybar" ]; then
|
||||||
|
# Need to integrate with sway/displays.pl for alternative outputs
|
||||||
|
/home/jpm/scripts/distrobox/debian12/displays.sh -w
|
||||||
|
>>>>>>> Stashed changes
|
||||||
elif [ "$res" == "🡙 Reboot" ]; then
|
elif [ "$res" == "🡙 Reboot" ]; then
|
||||||
rm $SSH_AUTH_SOCK
|
rm $SSH_AUTH_SOCK
|
||||||
sudo systemctl reboot -i
|
sudo systemctl reboot -i
|
||||||
|
|
|
@ -20,7 +20,7 @@ export FLATPAK_IDE_LOG_LEVEL="0"
|
||||||
export "$( gnome-keyring-daemon --start )"
|
export "$( gnome-keyring-daemon --start )"
|
||||||
|
|
||||||
#WLR_RENDERER=vulkan sway --debug 2>> $HOME/.swaylog >> $HOME/.swaylog
|
#WLR_RENDERER=vulkan sway --debug 2>> $HOME/.swaylog >> $HOME/.swaylog
|
||||||
WLR_RENDERER=gles2 sway --debug 2>> $HOME/.swaylog >> $HOME/.swaylog; export SWAYSOCK=`sway --get-socketpath`
|
WLR_RENDERER=gles2 sway --debug 2>> $HOME/.swaylog >> $HOME/.swaylog
|
||||||
#WLR_RENDERER=vulkan sway --debug 2>> $HOME/.swaylog >> $HOME/.swaylog
|
#WLR_RENDERER=vulkan sway --debug 2>> $HOME/.swaylog >> $HOME/.swaylog
|
||||||
#WLR_RENDERER=gles2 $HOME/build/sway/build/sway/sway --debug 2>> $HOME/.swaylog >> $HOME/.swaylog
|
#WLR_RENDERER=gles2 $HOME/build/sway/build/sway/sway --debug 2>> $HOME/.swaylog >> $HOME/.swaylog
|
||||||
export SWAYSOCK=`sway --get-socketpath`
|
export SWAYSOCK=`sway --get-socketpath`
|
||||||
|
|
|
@ -32,6 +32,7 @@ Sets a wallpaper by cropping an appropriate sized section of a larger image.\n
|
||||||
All arguments other than the below are assumed to be output names, as defined
|
All arguments other than the below are assumed to be output names, as defined
|
||||||
in my sway/displays.pl script. If no outputs are provided, all available that
|
in my sway/displays.pl script. If no outputs are provided, all available that
|
||||||
are currently enabled will be set.\n
|
are currently enabled will be set.\n
|
||||||
|
<<<<<<< Updated upstream
|
||||||
--path=<path> Path to wallpaper directory.
|
--path=<path> Path to wallpaper directory.
|
||||||
-p <path> Default: $ENV{HOME}/wallpapers\n
|
-p <path> Default: $ENV{HOME}/wallpapers\n
|
||||||
--daemon=N Configures the wallpaper to be periodically rotated for all
|
--daemon=N Configures the wallpaper to be periodically rotated for all
|
||||||
|
@ -39,12 +40,26 @@ are currently enabled will be set.\n
|
||||||
each rotation, if provided (default: 300).\n
|
each rotation, if provided (default: 300).\n
|
||||||
--nocrop Don't crop a selection from the image. Instead, pass the whole
|
--nocrop Don't crop a selection from the image. Instead, pass the whole
|
||||||
-n image to swaybg and let it handle the scaling\n
|
-n image to swaybg and let it handle the scaling\n
|
||||||
|
=======
|
||||||
|
--path=<path> Path to wallpaper directory.
|
||||||
|
-p <path> Default: $ENV{HOME}/wallpapers\n
|
||||||
|
--daemon=N Configures the wallpaper to be periodically rotated for all
|
||||||
|
-d N of the given outputs. N indicates the number of seconds between
|
||||||
|
each rotation, if provided (default: 300).\n
|
||||||
|
--nocrop Don't crop a selection from the image. Instead, pass the whole
|
||||||
|
-n image to swaybg and let it handle the scaling\n
|
||||||
|
>>>>>>> Stashed changes
|
||||||
--verbose=N Define minimum log level. Counting from 1: LOG_DEBUG, LOG_INFO,
|
--verbose=N Define minimum log level. Counting from 1: LOG_DEBUG, LOG_INFO,
|
||||||
-v N LOG_NOTICE, LOG_WARNING, LOG_ERR, LOG_CRIT, LOG_ALERT, LOG_EMERG
|
-v N LOG_NOTICE, LOG_WARNING, LOG_ERR, LOG_CRIT, LOG_ALERT, LOG_EMERG
|
||||||
Default: 5; If provided without a value for N then all (1).
|
Default: 5; If provided without a value for N then all (1).
|
||||||
--recursive=N Enumerate images recursively through directories in the path.
|
--recursive=N Enumerate images recursively through directories in the path.
|
||||||
|
<<<<<<< Updated upstream
|
||||||
-r N N indicates the directory depth, unlimited if no N is provided.
|
-r N N indicates the directory depth, unlimited if no N is provided.
|
||||||
--help This menu
|
--help This menu
|
||||||
|
=======
|
||||||
|
-r N N indicates the directory depth, unlimited if no N is provided.
|
||||||
|
--help This menu
|
||||||
|
>>>>>>> Stashed changes
|
||||||
-h\n
|
-h\n
|
||||||
You can send SIGUSR1 to force the daemon to reload immediately. Rotation timer
|
You can send SIGUSR1 to force the daemon to reload immediately. Rotation timer
|
||||||
will be reset.\n");
|
will be reset.\n");
|
||||||
|
@ -54,6 +69,14 @@ will be reset.\n");
|
||||||
sub new
|
sub new
|
||||||
{
|
{
|
||||||
my ($class, %args) = @_;
|
my ($class, %args) = @_;
|
||||||
|
<<<<<<< Updated upstream
|
||||||
|
|
||||||
|
use AnyEvent::Sway;
|
||||||
|
$args{ipc} = AnyEvent::Sway->new();
|
||||||
|
use Image::Magick;
|
||||||
|
$args{im} = Image::Magick->new();
|
||||||
|
$args{error} = ();
|
||||||
|
=======
|
||||||
|
|
||||||
use AnyEvent::Sway;
|
use AnyEvent::Sway;
|
||||||
$args{ipc} = AnyEvent::Sway->new();
|
$args{ipc} = AnyEvent::Sway->new();
|
||||||
|
@ -65,7 +88,72 @@ sub new
|
||||||
|
|
||||||
return bless { %args };
|
return bless { %args };
|
||||||
}
|
}
|
||||||
|
>>>>>>> Stashed changes
|
||||||
|
|
||||||
|
$args{pidfile} = "/tmp/$ENV{USER}-wallpaper.pid";
|
||||||
|
|
||||||
|
<<<<<<< Updated upstream
|
||||||
|
return bless { %args };
|
||||||
|
}
|
||||||
|
|
||||||
|
=======
|
||||||
|
if (-e $wp->{pidfile}) {
|
||||||
|
if (-r $wp->{pidfile}) {
|
||||||
|
if (open(my $fh, '<', $wp->{pidfile})) {
|
||||||
|
my $pid = <$fh>;
|
||||||
|
chomp($pid);
|
||||||
|
use Proc::ProcessTable;
|
||||||
|
my $pt = Proc::ProcessTable->new();
|
||||||
|
foreach my $p ( @{ $pt->table() } ) {
|
||||||
|
if ($p->{pid} eq $pid) {
|
||||||
|
my $name = $0;
|
||||||
|
$name =~ s/$ENV{PWD}//;
|
||||||
|
if ($p->{'cmndline'} =~ m#$name#) {
|
||||||
|
$wp->do_log("LOG_CRIT", "Another process is already running with PID: $pid (running and listed in $wp->{pidfile})");
|
||||||
|
# Die locally because do_log will remove pidfile that this iteration does not belong to
|
||||||
|
exit(1);
|
||||||
|
} else {
|
||||||
|
$wp->do_log("LOG_CRIT", "Found matching $pid with different cmdline: $p->{cmndline} (not $0)",1);
|
||||||
|
# PID in pidfile doesn't look like it is another wallpaper
|
||||||
|
unlink($wp->{pidfile});
|
||||||
|
last;
|
||||||
|
}
|
||||||
|
return $p->{'pid'};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$wp->do_log("LOG_CRIT", "Pidfile $wp->{pidfile} exists, but cannot be opened. Assuming it is running already.");
|
||||||
|
# Die locally because do_log will remove pidfile that this iteration does not belong to
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$wp->do_log("LOG_CRIT", "Pidfile $wp->{pidfile} exists, but is not readable. Assuming it is running already.");
|
||||||
|
# Die locally because do_log will remove pidfile that this iteration does not belong to
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# SIGUSR reset the timer, force immediate reload, continue looping
|
||||||
|
$SIG{USR1} = sub {
|
||||||
|
alarm 0;
|
||||||
|
$wp->do_log("LOG_INFO", "Reloading due to SIGUSR1");
|
||||||
|
};
|
||||||
|
|
||||||
|
# SIGTERM reset the timer, clean pid, and allow for the main loop to finish run
|
||||||
|
$SIG{TERM} = sub {
|
||||||
|
$wp->do_log("LOG_INFO", "Going down clean due to SIGTERM");
|
||||||
|
clean($wp);
|
||||||
|
$wp->{daemon} = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
# SIGKILL clean pid then exit immediately
|
||||||
|
$SIG{KILL} = sub {
|
||||||
|
$wp->do_log("LOG_INFO", "Hard kill with SIGKILL, attempting to remove pidfile");
|
||||||
|
clean($wp);
|
||||||
|
exit(0);
|
||||||
|
};
|
||||||
|
|
||||||
|
>>>>>>> Stashed changes
|
||||||
# simply returns the array of hashes provided by swaymsg
|
# simply returns the array of hashes provided by swaymsg
|
||||||
sub get_outputs
|
sub get_outputs
|
||||||
{
|
{
|
||||||
|
@ -151,10 +239,17 @@ sub choose_image
|
||||||
if (-d $_) {
|
if (-d $_) {
|
||||||
$self->do_log("LOG_DEBUG", "Ignoring sub-directory $_");
|
$self->do_log("LOG_DEBUG", "Ignoring sub-directory $_");
|
||||||
next;
|
next;
|
||||||
|
<<<<<<< Updated upstream
|
||||||
}
|
}
|
||||||
if ($_ =~ m/\.(png|jpg)$/) {
|
if ($_ =~ m/\.(png|jpg)$/) {
|
||||||
push(@i,$_);
|
push(@i,$_);
|
||||||
}
|
}
|
||||||
|
=======
|
||||||
|
}
|
||||||
|
if ($_ =~ m/\.(png|jpg)$/) {
|
||||||
|
push(@i,$_);
|
||||||
|
}
|
||||||
|
>>>>>>> Stashed changes
|
||||||
}
|
}
|
||||||
|
|
||||||
return $i[rand(scalar(@i))] || return undef;
|
return $i[rand(scalar(@i))] || return undef;
|
||||||
|
@ -223,12 +318,21 @@ sub do_log
|
||||||
# Journald is borked. Just don't bother logging
|
# Journald is borked. Just don't bother logging
|
||||||
return 0;
|
return 0;
|
||||||
if ($self->{daemon}) {
|
if ($self->{daemon}) {
|
||||||
|
<<<<<<< Updated upstream
|
||||||
#use Log::Journald qw(send);
|
#use Log::Journald qw(send);
|
||||||
#send(
|
#send(
|
||||||
#PRIORITY => ERROR->{$level},
|
#PRIORITY => ERROR->{$level},
|
||||||
#MESSAGE => $msg,
|
#MESSAGE => $msg,
|
||||||
#PERL_PACKAGE => 'Sway Wallpapers'
|
#PERL_PACKAGE => 'Sway Wallpapers'
|
||||||
#) || warn "Could not send log ($level $msg): $!";
|
#) || warn "Could not send log ($level $msg): $!";
|
||||||
|
=======
|
||||||
|
use Log::Journald qw(send);
|
||||||
|
send(
|
||||||
|
PRIORITY => ERROR->{$level},
|
||||||
|
MESSAGE => $msg,
|
||||||
|
PERL_PACKAGE => 'Sway Wallpapers'
|
||||||
|
) || warn "Could not send log ($level $msg): $!";
|
||||||
|
>>>>>>> Stashed changes
|
||||||
if ($die) {
|
if ($die) {
|
||||||
$msg = '(FATAL) ' . $msg;
|
$msg = '(FATAL) ' . $msg;
|
||||||
exit(1);
|
exit(1);
|
||||||
|
@ -250,7 +354,10 @@ sub run
|
||||||
$self->do_log("LOG_DEBUG", "Fetching outputs from IPC");
|
$self->do_log("LOG_DEBUG", "Fetching outputs from IPC");
|
||||||
$self->{outputs} = $self->get_outputs();
|
$self->{outputs} = $self->get_outputs();
|
||||||
# Local copy of targets so that it will re-check active every time
|
# Local copy of targets so that it will re-check active every time
|
||||||
|
<<<<<<< Updated upstream
|
||||||
print "Changing $_\n" foreach(@{$self->{targets}});
|
print "Changing $_\n" foreach(@{$self->{targets}});
|
||||||
|
=======
|
||||||
|
>>>>>>> Stashed changes
|
||||||
my @t = @{$self->{targets}} if (scalar(@{$self->{targets}}));
|
my @t = @{$self->{targets}} if (scalar(@{$self->{targets}}));
|
||||||
$self->do_log("LOG_DEBUG", "Removing inactive ouputs");
|
$self->do_log("LOG_DEBUG", "Removing inactive ouputs");
|
||||||
my $active = $self->get_active();
|
my $active = $self->get_active();
|
||||||
|
@ -261,7 +368,10 @@ sub run
|
||||||
}
|
}
|
||||||
$self->do_log("LOG_DEBUG", "Looping desired ouputs");
|
$self->do_log("LOG_DEBUG", "Looping desired ouputs");
|
||||||
foreach my $target (@t) {
|
foreach my $target (@t) {
|
||||||
|
<<<<<<< Updated upstream
|
||||||
print $target."\n";
|
print $target."\n";
|
||||||
|
=======
|
||||||
|
>>>>>>> Stashed changes
|
||||||
$self->do_log("LOG_DEBUG", "Ensuring that desired output is active");
|
$self->do_log("LOG_DEBUG", "Ensuring that desired output is active");
|
||||||
unless (defined($active->{$target})) {
|
unless (defined($active->{$target})) {
|
||||||
$self->do_log('LOG_DEBUG', "Target $target is not an active output");
|
$self->do_log('LOG_DEBUG', "Target $target is not an active output");
|
||||||
|
@ -365,6 +475,7 @@ while (my $arg = shift(@ARGV)) {
|
||||||
die "Redundant argument '$arg'. Recursive search already set.\n" unless ($recursive == 0);
|
die "Redundant argument '$arg'. Recursive search already set.\n" unless ($recursive == 0);
|
||||||
if (scalar(@ARGV) && $ARGV[0] =~ m/^\d+$/) {
|
if (scalar(@ARGV) && $ARGV[0] =~ m/^\d+$/) {
|
||||||
$recursive = shift(@ARGV);
|
$recursive = shift(@ARGV);
|
||||||
|
<<<<<<< Updated upstream
|
||||||
} else {
|
} else {
|
||||||
$recursive = -1;
|
$recursive = -1;
|
||||||
}
|
}
|
||||||
|
@ -412,6 +523,15 @@ if (-e $wp->{pidfile}) {
|
||||||
$wp->do_log("LOG_CRIT", "Pidfile $wp->{pidfile} exists, but is not readable. Assuming it is running already.");
|
$wp->do_log("LOG_CRIT", "Pidfile $wp->{pidfile} exists, but is not readable. Assuming it is running already.");
|
||||||
# Die locally because do_log will remove pidfile that this iteration does not belong to
|
# Die locally because do_log will remove pidfile that this iteration does not belong to
|
||||||
exit(1);
|
exit(1);
|
||||||
|
=======
|
||||||
|
} else {
|
||||||
|
$recursive = -1;
|
||||||
|
}
|
||||||
|
} elsif ($arg =~ m/^-/) {
|
||||||
|
die "Unrecognized argument: $arg\n";
|
||||||
|
} else {
|
||||||
|
push(@targets,$arg);
|
||||||
|
>>>>>>> Stashed changes
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,6 +15,7 @@ sub usage()
|
||||||
{
|
{
|
||||||
print("$0 [value] [-p|--plus] [-m|--minus] [-a x|--attribute=x] [-d N|--delay=N]
|
print("$0 [value] [-p|--plus] [-m|--minus] [-a x|--attribute=x] [-d N|--delay=N]
|
||||||
Fade the opacity of one or more windows via the Sway IPC interface.\n
|
Fade the opacity of one or more windows via the Sway IPC interface.\n
|
||||||
|
<<<<<<< Updated upstream
|
||||||
value The target opacity or offset between 0 (full transparency) and 1
|
value The target opacity or offset between 0 (full transparency) and 1
|
||||||
(fully opaque). Change will be made in increments of 0.01 with a
|
(fully opaque). Change will be made in increments of 0.01 with a
|
||||||
delay between each.\n
|
delay between each.\n
|
||||||
|
@ -27,6 +28,20 @@ value The target opacity or offset between 0 (full transparency) and 1
|
||||||
--delay=N Change the delay in ms between each percentage point change in
|
--delay=N Change the delay in ms between each percentage point change in
|
||||||
-d N opacity. Default: 20\n
|
-d N opacity. Default: 20\n
|
||||||
--help This menu
|
--help This menu
|
||||||
|
=======
|
||||||
|
value The target opacity or offset between 0 (full transparency) and 1
|
||||||
|
(fully opaque). Change will be made in increments of 0.01 with a
|
||||||
|
delay between each.\n
|
||||||
|
--attribute=x Attribute of window(s) to fade.
|
||||||
|
-a x Default: [title="*"]\n
|
||||||
|
--plus Increases opacity by increment instead of setting it directly
|
||||||
|
-p to that increment.\n
|
||||||
|
--minus Decreases opacity by increment instead of setting it directly
|
||||||
|
-m to that increment.\n
|
||||||
|
--delay=N Change the delay in ms between each percentage point change in
|
||||||
|
-d N opacity. Default: 20\n
|
||||||
|
--help This menu
|
||||||
|
>>>>>>> Stashed changes
|
||||||
-h\n");
|
-h\n");
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,7 +47,10 @@ foreach (@devices) {
|
||||||
close $t;
|
close $t;
|
||||||
$output .= '"Type":"' . $type . '"';
|
$output .= '"Type":"' . $type . '"';
|
||||||
if ($name =~ /BAT[0-9]+/) {
|
if ($name =~ /BAT[0-9]+/) {
|
||||||
|
<<<<<<< Updated upstream
|
||||||
$nobat = 0;
|
$nobat = 0;
|
||||||
|
=======
|
||||||
|
>>>>>>> Stashed changes
|
||||||
open(my $s,'<',"$_/status");
|
open(my $s,'<',"$_/status");
|
||||||
my $status = <$s>;
|
my $status = <$s>;
|
||||||
chomp $status;
|
chomp $status;
|
||||||
|
@ -85,10 +88,13 @@ foreach (@devices) {
|
||||||
. '"';
|
. '"';
|
||||||
}
|
}
|
||||||
$output .= "},";
|
$output .= "},";
|
||||||
|
<<<<<<< Updated upstream
|
||||||
}
|
}
|
||||||
unless ($nobat) {
|
unless ($nobat) {
|
||||||
print('{"AC":{"Type":"AC","Status":"Plugged-In"}}');
|
print('{"AC":{"Type":"AC","Status":"Plugged-In"}}');
|
||||||
exit();
|
exit();
|
||||||
|
=======
|
||||||
|
>>>>>>> Stashed changes
|
||||||
}
|
}
|
||||||
|
|
||||||
$battery_total{'percentage'} = sprintf("%0d",
|
$battery_total{'percentage'} = sprintf("%0d",
|
||||||
|
@ -109,6 +115,7 @@ if ($bar) {
|
||||||
my $class = 'discharging';
|
my $class = 'discharging';
|
||||||
$output = '';
|
$output = '';
|
||||||
if ($powref->{AC}->{Status} eq "Plugged-In") {
|
if ($powref->{AC}->{Status} eq "Plugged-In") {
|
||||||
|
<<<<<<< Updated upstream
|
||||||
$class = 'charging';
|
$class = 'charging';
|
||||||
$output .= "";
|
$output .= "";
|
||||||
} elsif ($powref->{Total}->{Percentage} <= 10) {
|
} elsif ($powref->{Total}->{Percentage} <= 10) {
|
||||||
|
@ -116,6 +123,15 @@ if ($bar) {
|
||||||
$output .= "";
|
$output .= "";
|
||||||
} elsif ($powref->{Total}->{Percentage} <= 35) {
|
} elsif ($powref->{Total}->{Percentage} <= 35) {
|
||||||
$class = 'low';
|
$class = 'low';
|
||||||
|
=======
|
||||||
|
$class = 'charging';
|
||||||
|
$output .= "";
|
||||||
|
} elsif ($powref->{Total}->{Percentage} <= 10) {
|
||||||
|
$class = 'critical';
|
||||||
|
$output .= "";
|
||||||
|
} elsif ($powref->{Total}->{Percentage} <= 35) {
|
||||||
|
$class = 'low';
|
||||||
|
>>>>>>> Stashed changes
|
||||||
$output .= "";
|
$output .= "";
|
||||||
} elsif ($powref->{Total}->{Percentage} <= 60) {
|
} elsif ($powref->{Total}->{Percentage} <= 60) {
|
||||||
$output .= "";
|
$output .= "";
|
||||||
|
@ -138,11 +154,19 @@ if ($bar) {
|
||||||
my $total = '';
|
my $total = '';
|
||||||
$output = "Device Status Percentage\n";
|
$output = "Device Status Percentage\n";
|
||||||
foreach my $device (keys %{$powref}) {
|
foreach my $device (keys %{$powref}) {
|
||||||
|
<<<<<<< Updated upstream
|
||||||
my $status;
|
my $status;
|
||||||
if ($powref->{$device}->{Status} eq "Plugged-In") {
|
if ($powref->{$device}->{Status} eq "Plugged-In") {
|
||||||
$status = "";
|
$status = "";
|
||||||
} elsif (!defined($powref->{$device}->{Percentage}) || $powref->{$device}->{Percentage} == 0) {
|
} elsif (!defined($powref->{$device}->{Percentage}) || $powref->{$device}->{Percentage} == 0) {
|
||||||
$status = " ";
|
$status = " ";
|
||||||
|
=======
|
||||||
|
my $status;
|
||||||
|
if ($powref->{$device}->{Status} eq "Plugged-In") {
|
||||||
|
$status = "";
|
||||||
|
} elsif (!defined($powref->{$device}->{Percentage}) || $powref->{$device}->{Percentage} == 0) {
|
||||||
|
$status = " ";
|
||||||
|
>>>>>>> Stashed changes
|
||||||
} elsif ($powref->{$device}->{Percentage} <= 10) {
|
} elsif ($powref->{$device}->{Percentage} <= 10) {
|
||||||
$status = " " . $powref->{$device}->{'Percentage'} . "%";
|
$status = " " . $powref->{$device}->{'Percentage'} . "%";
|
||||||
} elsif ($powref->{$device}->{Percentage} <= 35) {
|
} elsif ($powref->{$device}->{Percentage} <= 35) {
|
||||||
|
@ -151,6 +175,7 @@ if ($bar) {
|
||||||
$status = " " . $powref->{$device}->{'Percentage'} . "%";
|
$status = " " . $powref->{$device}->{'Percentage'} . "%";
|
||||||
} elsif ($powref->{$device}->{Percentage} <= 85) {
|
} elsif ($powref->{$device}->{Percentage} <= 85) {
|
||||||
$status = " " . $powref->{$device}->{'Percentage'} . "%";
|
$status = " " . $powref->{$device}->{'Percentage'} . "%";
|
||||||
|
<<<<<<< Updated upstream
|
||||||
} else {
|
} else {
|
||||||
$status = " " . $powref->{$device}->{'Percentage'} . "%";
|
$status = " " . $powref->{$device}->{'Percentage'} . "%";
|
||||||
}
|
}
|
||||||
|
@ -166,6 +191,23 @@ if ($bar) {
|
||||||
}
|
}
|
||||||
$output .= sprintf("%-24s %-12s %-12s\n", $name, $powref->{$device}->{Status}, $status);
|
$output .= sprintf("%-24s %-12s %-12s\n", $name, $powref->{$device}->{Status}, $status);
|
||||||
}
|
}
|
||||||
|
=======
|
||||||
|
} else {
|
||||||
|
$status = " " . $powref->{$device}->{'Percentage'} . "%";
|
||||||
|
}
|
||||||
|
if ($device eq 'Total') {
|
||||||
|
$total .= sprintf("%-24s %-12s", $device, $status);
|
||||||
|
} else {
|
||||||
|
#$output .= sprintf("%".length($powref->{$device->{'Type'}})."s (%".length($powref->{$device->{'Type'}})."s): %3d\%\n", $device, $device->{'Type'}, $device->{'Percentage'});
|
||||||
|
my $name = ' ('.$powref->{$device}->{'Type'}.')';
|
||||||
|
if ((length($device)+length($name)) >= 24) {
|
||||||
|
$name = substr($device, 0, (21-length($name))) . '...' . $name;
|
||||||
|
} else {
|
||||||
|
$name = substr(($device.$name), 0, 24);
|
||||||
|
}
|
||||||
|
$output .= sprintf("%-24s %-12s %-12s\n", $name, $powref->{$device}->{Status}, $status);
|
||||||
|
}
|
||||||
|
>>>>>>> Stashed changes
|
||||||
}
|
}
|
||||||
$output .= $total;
|
$output .= $total;
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,9 +23,15 @@ elif [ "$1" == 'upgrade' ]; then
|
||||||
COUNT=`apt list --upgradable 2> /dev/null | wc -l`
|
COUNT=`apt list --upgradable 2> /dev/null | wc -l`
|
||||||
let COUNT--
|
let COUNT--
|
||||||
echo $COUNT > /home/jpm/.spool/apt-upgradeable
|
echo $COUNT > /home/jpm/.spool/apt-upgradeable
|
||||||
|
<<<<<<< Updated upstream
|
||||||
if [ -e /var/run/reboot-required ]; then
|
if [ -e /var/run/reboot-required ]; then
|
||||||
grep -B1 -A4 upgrade /var/log/apt/history.log | tail -n 6 | swaynag --config=${HOME}/.dotfiles/sway/swaynag --edge=bottom --message="New packages require restart" --button="Restart Now" "sudo systemctl reboot" --dismiss-button="Later" --detailed-message --detailed-button "Show/Hide Upgrade Details"
|
grep -B1 -A4 upgrade /var/log/apt/history.log | tail -n 6 | swaynag --config=${HOME}/.dotfiles/sway/swaynag --edge=bottom --message="New packages require restart" --button="Restart Now" "sudo systemctl reboot" --dismiss-button="Later" --detailed-message --detailed-button "Show/Hide Upgrade Details"
|
||||||
fi
|
fi
|
||||||
|
=======
|
||||||
|
if [ -e /var/run/reboot-required ]; then
|
||||||
|
grep -B1 -A4 upgrade /var/log/apt/history.log | tail -n 6 | swaynag --config=${HOME}/.dotfiles/sway/swaynag --edge=bottom --message="New packages require restart" --button="Restart Now" "sudo systemctl reboot" --dismiss-button="Later" --detailed-message --detailed-button "Show/Hide Upgrade Details"
|
||||||
|
fi
|
||||||
|
>>>>>>> Stashed changes
|
||||||
elif [ "$1" == 'update' ]; then
|
elif [ "$1" == 'update' ]; then
|
||||||
sudo apt update >/dev/null 2>/dev/null
|
sudo apt update >/dev/null 2>/dev/null
|
||||||
COUNT=`apt list --upgradable 2> /dev/null | wc -l`
|
COUNT=`apt list --upgradable 2> /dev/null | wc -l`
|
||||||
|
|
|
@ -6,7 +6,11 @@ swaymsg -t get_tree |
|
||||||
sed -e 's/^\(.*\) [—-] .*$/\1/'|
|
sed -e 's/^\(.*\) [—-] .*$/\1/'|
|
||||||
sed -e 's/^\([0-9]*\)\t*\(.*\)/\2 \1/' |
|
sed -e 's/^\([0-9]*\)\t*\(.*\)/\2 \1/' |
|
||||||
wofi -s $HOME/.dotfiles/wofi/style.css -c \
|
wofi -s $HOME/.dotfiles/wofi/style.css -c \
|
||||||
|
<<<<<<< Updated upstream
|
||||||
$HOME/.dotfiles/wofi/sidebar -d | {
|
$HOME/.dotfiles/wofi/sidebar -d | {
|
||||||
|
=======
|
||||||
|
$HOME/.dotfiles/wofi/sidebar -d | {
|
||||||
|
>>>>>>> Stashed changes
|
||||||
read -r
|
read -r
|
||||||
id=`echo $REPLY | rev | cut -d' ' -f1 | rev`
|
id=`echo $REPLY | rev | cut -d' ' -f1 | rev`
|
||||||
swaymsg "[con_id=$id]" focus
|
swaymsg "[con_id=$id]" focus
|
||||||
|
|
Loading…
Reference in New Issue