Fix merge conflicts

This commit is contained in:
John Mertz 2023-01-07 13:32:14 -05:00
parent 823fa0e360
commit 00eef39441
Signed by: jpm
GPG Key ID: E9C5EA2D867501AB
6 changed files with 0 additions and 139 deletions

View File

@ -53,10 +53,7 @@ elif [ $1 == "fade" ]; then
elif [ $1 == "unfade" ]; then
if [ -e $HOME/.spool/sway-hidden ]; then
kill -USR2 `cat $HOME/.spool/sway-transparency`
<<<<<<< Updated upstream
=======
/home/jpm/scripts/sway/displays.pl -w
>>>>>>> Stashed changes
fi
elif [ $1 == "dim" ]; then
echo $($HOME/scripts/thinkpad/blc.pl %) > $BLFILE

View File

@ -32,17 +32,10 @@ elif [ "$res" == "↹ Restart i3" ]; then
i3 restart
elif [ "$res" == "↻ Reload Sway" ]; then
sway reload
<<<<<<< Updated upstream
/home/jpm/scripts/sway/displays.pl
elif [ "$res" == "↻ Reload Waybar" ]; then
# Need to integrate with sway/displays.pl for alternative outputs
/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
rm $SSH_AUTH_SOCK
sudo systemctl reboot -i

View File

@ -32,15 +32,6 @@ 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
in my sway/displays.pl script. If no outputs are provided, all available that
are currently enabled will be set.\n
<<<<<<< Updated upstream
--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
=======
--path=<path> Path to wallpaper directory.
-p <path> Default: $ENV{HOME}/wallpapers\n
--daemon=N Configures the wallpaper to be periodically rotated for all
@ -48,18 +39,12 @@ are currently enabled will be set.\n
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,
-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).
--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.
--help This menu
=======
-r N N indicates the directory depth, unlimited if no N is provided.
--help This menu
>>>>>>> Stashed changes
-h\n
You can send SIGUSR1 to force the daemon to reload immediately. Rotation timer
will be reset.\n");
@ -69,14 +54,6 @@ will be reset.\n");
sub new
{
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;
$args{ipc} = AnyEvent::Sway->new();
@ -88,15 +65,9 @@ sub new
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})) {
@ -153,7 +124,6 @@ $SIG{KILL} = sub {
exit(0);
};
>>>>>>> Stashed changes
# simply returns the array of hashes provided by swaymsg
sub get_outputs
{
@ -239,17 +209,10 @@ sub choose_image
if (-d $_) {
$self->do_log("LOG_DEBUG", "Ignoring sub-directory $_");
next;
<<<<<<< Updated upstream
}
if ($_ =~ m/\.(png|jpg)$/) {
push(@i,$_);
}
=======
}
if ($_ =~ m/\.(png|jpg)$/) {
push(@i,$_);
}
>>>>>>> Stashed changes
}
return $i[rand(scalar(@i))] || return undef;
@ -318,21 +281,12 @@ sub do_log
# Journald is borked. Just don't bother logging
return 0;
if ($self->{daemon}) {
<<<<<<< Updated upstream
#use Log::Journald qw(send);
#send(
#PRIORITY => ERROR->{$level},
#MESSAGE => $msg,
#PERL_PACKAGE => 'Sway Wallpapers'
#) || 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) {
$msg = '(FATAL) ' . $msg;
exit(1);
@ -354,10 +308,6 @@ sub run
$self->do_log("LOG_DEBUG", "Fetching outputs from IPC");
$self->{outputs} = $self->get_outputs();
# Local copy of targets so that it will re-check active every time
<<<<<<< Updated upstream
print "Changing $_\n" foreach(@{$self->{targets}});
=======
>>>>>>> Stashed changes
my @t = @{$self->{targets}} if (scalar(@{$self->{targets}}));
$self->do_log("LOG_DEBUG", "Removing inactive ouputs");
my $active = $self->get_active();
@ -368,10 +318,6 @@ sub run
}
$self->do_log("LOG_DEBUG", "Looping desired ouputs");
foreach my $target (@t) {
<<<<<<< Updated upstream
print $target."\n";
=======
>>>>>>> Stashed changes
$self->do_log("LOG_DEBUG", "Ensuring that desired output is active");
unless (defined($active->{$target})) {
$self->do_log('LOG_DEBUG', "Target $target is not an active output");
@ -475,55 +421,6 @@ while (my $arg = shift(@ARGV)) {
die "Redundant argument '$arg'. Recursive search already set.\n" unless ($recursive == 0);
if (scalar(@ARGV) && $ARGV[0] =~ m/^\d+$/) {
$recursive = shift(@ARGV);
<<<<<<< Updated upstream
} else {
$recursive = -1;
}
} elsif ($arg =~ m/^-/) {
die "Unrecognized argument: $arg\n";
} else {
print "Adding $arg to targets\n";
push(@targets,$arg);
print "Setting $_\n" foreach(@targets);
$wp->{targets} = \@targets || undef;
print "Set $_\n" foreach(@{$wp->{targets}});
}
}
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);
=======
} else {
$recursive = -1;
}
@ -531,7 +428,6 @@ if (-e $wp->{pidfile}) {
die "Unrecognized argument: $arg\n";
} else {
push(@targets,$arg);
>>>>>>> Stashed changes
}
}

View File

@ -15,20 +15,6 @@ sub usage()
{
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
<<<<<<< Updated upstream
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
=======
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
@ -41,7 +27,6 @@ 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
-d N opacity. Default: 20\n
--help This menu
>>>>>>> Stashed changes
-h\n");
exit(0);
}

View File

@ -23,15 +23,9 @@ elif [ "$1" == 'upgrade' ]; then
COUNT=`apt list --upgradable 2> /dev/null | wc -l`
let COUNT--
echo $COUNT > /home/jpm/.spool/apt-upgradeable
<<<<<<< Updated upstream
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
=======
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
sudo apt update >/dev/null 2>/dev/null
COUNT=`apt list --upgradable 2> /dev/null | wc -l`

View File

@ -6,11 +6,7 @@ swaymsg -t get_tree |
sed -e 's/^\(.*\) [—-] .*$/\1/'|
sed -e 's/^\([0-9]*\)\t*\(.*\)/\2 \1/' |
wofi -s $HOME/.dotfiles/wofi/style.css -c \
<<<<<<< Updated upstream
$HOME/.dotfiles/wofi/sidebar -d | {
=======
$HOME/.dotfiles/wofi/sidebar -d | {
>>>>>>> Stashed changes
read -r
id=`echo $REPLY | rev | cut -d' ' -f1 | rev`
swaymsg "[con_id=$id]" focus