aboutsummaryrefslogtreecommitdiff
path: root/bin/wallpaper-shuffle
blob: 9f55e0cd60d231afc4a0ad1dd7ae18a601253d89 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/usr/bin/env bash

set -o errexit
set -o nounset
set -o pipefail
if [[ "${TRACE-0}" == "1" ]]; then
    set -o xtrace
fi

OUTPUTS=$(swaymsg -t get_outputs | jq -r '.[] | .name')
export WALLPAPERS="$HOME/wallpapers/low-poly"

main() {
  echo "$OUTPUTS" | xargs -I{} sh -c "swaymsg output {} bg $(find "$WALLPAPERS" -type f | shuf -n 1) fill"
}

main "$@"