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
# Make sure we aren't running twice
RUNNING=$(ps -A | grep swaylock | wc -l)
if [ $RUNNING -ne 0 ]; then
RUNNING=$(${procps}/bin/pgrep -c ${swaylock}/bin/swaylock)
if [ "$RUNNING" -ne 0 ]; then
exit 0
fi
IMAGE=$XDG_CONFIG_HOME/wallpaper.jpg
IMAGE="$XDG_CONFIG_HOME/wallpaper.jpg"
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
LOCKARGS="''${LOCKARGS} --image ''${OUTPUT}:''${IMAGE}"
IMAGES="''${IMAGES} ''${IMAGE}"
done
exec ${swaylock}/bin/swaylock $LOCKARGS
''