summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2021-04-21 17:25:08 -0700
committerSean Whitton <spwhitton@spwhitton.name>2021-04-21 17:25:37 -0700
commit875c5b832eb95a01b5e59ec009a7f76ff4f43e92 (patch)
tree4b6c3dc112ad077f235122331088010dde7dc16a /bin
parent4727e5518dc578db936b5524253c7c4eb9f3023e (diff)
downloaddotfiles-875c5b832eb95a01b5e59ec009a7f76ff4f43e92.tar.gz
update handling of wallpapers for use of Sway
Diffstat (limited to 'bin')
-rwxr-xr-xbin/choose-wallpaper (renamed from bin/i3-wallpaper)10
1 files changed, 7 insertions, 3 deletions
diff --git a/bin/i3-wallpaper b/bin/choose-wallpaper
index 5d5b95a6..648c1a6b 100755
--- a/bin/i3-wallpaper
+++ b/bin/choose-wallpaper
@@ -8,11 +8,13 @@ use lib "$ENV{HOME}/src/dotfiles/perl5";
use Local::Desktop;
use File::Copy;
+my $x11 = $ENV{XDG_SESSION_TYPE} && $ENV{XDG_SESSION_TYPE} eq "x11";
+
# dirs where wallpaper can be found
our @dirs = ("$ENV{HOME}/annex/wallpaper/pro");
if (@ARGV and $ARGV[0] eq "--check-have") {
- ensure_resize_for_current_outputs;
+ ensure_resize_for_current_outputs if $x11;
exit !<"$ENV{HOME}/local/wallpaper??.*">;
}
@@ -26,8 +28,10 @@ if ($ARGV[0] eq "--random") {
unshift @wallpapers, @ARGV;
select_wallpaper_files @wallpapers;
-resize_for_current_outputs;
-system "i3-startup-always"; # feh and also restart i3lock
+if ($x11) {
+ resize_for_current_outputs;
+ system "i3-startup-always"; # feh and also restart i3lock
+}
# now give develacc something
if (-e "$ENV{HOME}/local/develacc") {