From f4c4550e327d9090c82a735d39d104d0bedb602d Mon Sep 17 00:00:00 2001 From: Benjamin Chausse Date: Sun, 30 Mar 2025 01:00:51 -0400 Subject: Loads of laptop shit --- .local/bin/makewall.bak | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100755 .local/bin/makewall.bak (limited to '.local/bin/makewall.bak') diff --git a/.local/bin/makewall.bak b/.local/bin/makewall.bak new file mode 100755 index 0000000..b098dff --- /dev/null +++ b/.local/bin/makewall.bak @@ -0,0 +1,30 @@ +#!/bin/sh + +wallDir="${XDG_CONFIG_HOME:-$HOME}/wallpapers" + +# Acquire the list of connected displays +displays="$(wlr-randr --json | jq -r '.[] | select(.enabled) | .name')" +echo "$displays" + +# If there is a wallpaper with a filename matching the display +# name, set it as the wallpaper for that display. +# ex: DP-1.jpg and DP-1.png are both valid filenames +# Otherwise, set the wallpaper to the default wallpaper +# (default.png or default.jpg) +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 & +} + +# Set the wallpaper for each display +killall swaybg >/dev/null 2>&1 +for display in $displays; do + setDisplay $display +done -- cgit v1.2.3