Fix swaylock-bg, now a bash script

- reference jq from pkgs
- shellcheck fixes
This commit is contained in:
teutat3s 2022-09-01 14:37:14 +02:00
parent b7ba1b7ba9
commit d563b1d469
Signed by: teutat3s
GPG key ID: 4FA1D3FA524F22C1

View file

@ -3,18 +3,17 @@ self: with self; ''
# swaylock # swaylock
# Make sure we aren't running twice # Make sure we aren't running twice
RUNNING=$(ps -A | grep swaylock | wc -l) RUNNING=$(${procps}/bin/pgrep -c ${swaylock}/bin/swaylock)
if [ $RUNNING -ne 0 ]; then if [ "$RUNNING" -ne 0 ]; then
exit 0 exit 0
fi fi
IMAGE=$XDG_CONFIG_HOME/wallpaper.jpg IMAGE="$XDG_CONFIG_HOME/wallpaper.jpg"
LOCKARGS="" LOCKARGS=""
for OUTPUT in `${sway}/bin/swaymsg -t get_outputs | jq -r '.[].name'` for OUTPUT in $(${sway}/bin/swaymsg -t get_outputs | ${jq}/bin/jq -r '.[].name')
do do
LOCKARGS="''${LOCKARGS} --image ''${OUTPUT}:''${IMAGE}" LOCKARGS="''${LOCKARGS} --image ''${OUTPUT}:''${IMAGE}"
IMAGES="''${IMAGES} ''${IMAGE}"
done done
exec ${swaylock}/bin/swaylock $LOCKARGS exec ${swaylock}/bin/swaylock $LOCKARGS
'' ''