commit 230f96a7933f52547b0e24b8c8f958e0501f5ece
parent 83ad0bace25e34528dc1b80c0f82c2750a1ca71a
Author: Jacob R. Edwards <jacobouno@protonmail.com>
Date: Tue, 16 Feb 2021 00:43:44 -0800
Add setbg, A background setting script
With this there is an easy, central, way to set the wallpaper between
sessions. Implicit to this design is the ability to painlessly
switch background setting programs in the future.
Diffstat:
3 files changed, 15 insertions(+), 6 deletions(-)
diff --git a/modules/scripts/.local/bin/setbg b/modules/scripts/.local/bin/setbg
@@ -0,0 +1,13 @@
+#!/bin/sh -e
+# Copyright 2020 Jacob R. Edwards
+# License: GPLv3
+#
+# setbg -- set background
+#
+# Set, and, if given arguments, copy, background image to
+# "$XDG_CONFIG_HOME/wallpaper".
+
+bg="${XDG_CONFIG_HOME:-$HOME/.config}/wallpaper}"
+
+test $# -gt 0 && cp "$@" "$bg"
+xwallpaper --zoom "$bg"
diff --git a/modules/sxiv/.config/sxiv/exec/key-handler b/modules/sxiv/.config/sxiv/exec/key-handler
@@ -8,11 +8,7 @@ ifs = '
fn warn { { printf '%s: ' $pn; printf $* } >[2=1] }
fn err { warn $*; exit 1 }
fn yes { test `{ printf 'n\ny\n' | dmenu } '=' 'y' }
-fn cw {
- f = $XDG_CONFIG_HOME^/wallpaper
- cp -f $1 $f
- bgs -R $f
-}
+fn cw { setbg $* }
buf = `{ cat - }
switch ($1) {
diff --git a/modules/xorg/.xinitrc b/modules/xorg/.xinitrc
@@ -4,10 +4,10 @@ bg() { $* & }
test -f ~/.profile && . ~/.profile
+bg setbg
bg slstatus
bg xbanish
bg xmodmap "$XDG_CONFIG_HOME/xmodmaprc"
bg xrdb -load "$HOME/.Xresources"
bg xset dpms 360 600 960 r rate 250 30 s 0 b 0 0 0
-bg bgs -R "$XDG_CONFIG_HOME/wallpaper"
dwm 1>&2 2>$HOME/.local/var/log/dwm