1 Commits

Author SHA1 Message Date
Benjamin Chausse
b4be02f3a8
Add monchange patch
Allows one to call a script whenever the monitor configuration changes
(connect/disconnect). As an example, one might want to update the
wallpapers on each display. Here is a script that could be called by
`monchange` in the `config.h` to achieve this:

```
wallDir="${XDG_CONFIG_HOME:-$HOME}/wallpapers"

displays="$(wlr-randr --json | jq -r '.[] | select(.enabled) | .name')"
echo "$displays"

setDisplay() {
	case $(ls $wallDir) in
	*"$1"*)
		wall=$(ls $wallDir | grep "$1" | head -n 1)
		;;
	*)
		wall=$(ls $wallDir | grep "default" | head -n 1)
		;;
	esac
  swaybg --output $1 -m fill --image $wallDir/$wall &
}

killall swaybg > /dev/null 2>&1
for display in $displays; do
	setDisplay $display
done
```
2024-08-10 14:10:57 -04:00