This commit is contained in:
Mariano Z. 2025-04-21 12:07:24 -03:00
commit b4cdb80b5c
Signed by: marianozunino
GPG key ID: 4C73BAD25156DACE
137 changed files with 6383 additions and 0 deletions

35
bin/.bin/randwall Executable file
View file

@ -0,0 +1,35 @@
#!/bin/bash
# Kill any existing swaybg or feh instances
pkill swaybg
pkill feh
# Function to set wallpaper using swaybg on Sway
set_wallpaper_sway() {
swaymsg -t get_outputs -r | jq -r ".[].name" | parallel 'swaybg -o {} -i $(find ~/Pictures/* -type f | shuf -n 1) &'
}
# Function to set wallpaper using swaybg on Hyprland
set_wallpaper_hyprland() {
hyprctl monitors -j | jq -r ".[].name" | parallel 'swaybg -o {} -i $(find ~/Pictures/* -type f | shuf -n 1) &'
}
# Function to set wallpaper using feh on i3
set_wallpaper_i3() {
# Count number of connected monitors
monitor_count=$(xrandr --query | grep " connected" | wc -l)
# Get random wallpapers equal to monitor count
readarray -t wallpapers < <(find ~/Pictures/* -type f | shuf -n "$monitor_count")
# Construct the feh command with multiple --bg-fill arguments
cmd="feh"
for wallpaper in "${wallpapers[@]}"; do
cmd+=" --bg-fill '$wallpaper'"
done
# Execute the command
eval "$cmd"
}
set_wallpaper_sway