From 00eef394419a3ff5daa722e3edc9db0e682e9986 Mon Sep 17 00:00:00 2001 From: John Mertz Date: Sat, 7 Jan 2023 13:32:14 -0500 Subject: [PATCH] Fix merge conflicts --- sway/idle.sh | 3 -- sway/power-menu.sh | 7 --- sway/wallpaper.pl | 104 ---------------------------------------- sway/window-fade.pl | 15 ------ waybar/waybar-debian.sh | 6 --- wofi/wofi-alt-tab.sh | 4 -- 6 files changed, 139 deletions(-) diff --git a/sway/idle.sh b/sway/idle.sh index f4c88eb..5f25f48 100755 --- a/sway/idle.sh +++ b/sway/idle.sh @@ -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 diff --git a/sway/power-menu.sh b/sway/power-menu.sh index 21f6739..b7c8c89 100755 --- a/sway/power-menu.sh +++ b/sway/power-menu.sh @@ -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 diff --git a/sway/wallpaper.pl b/sway/wallpaper.pl index 8baa926..034c404 100755 --- a/sway/wallpaper.pl +++ b/sway/wallpaper.pl @@ -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 to wallpaper directory. --p 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 to wallpaper directory. -p 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 } } diff --git a/sway/window-fade.pl b/sway/window-fade.pl index d64ade1..e05906c 100755 --- a/sway/window-fade.pl +++ b/sway/window-fade.pl @@ -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); } diff --git a/waybar/waybar-debian.sh b/waybar/waybar-debian.sh index 91bdbb3..a9fd08e 100755 --- a/waybar/waybar-debian.sh +++ b/waybar/waybar-debian.sh @@ -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` diff --git a/wofi/wofi-alt-tab.sh b/wofi/wofi-alt-tab.sh index f8ccb96..7b34d0e 100755 --- a/wofi/wofi-alt-tab.sh +++ b/wofi/wofi-alt-tab.sh @@ -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