Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions share/dotfiles/.config/hypr/conf/autostart.conf
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ exec-once = ~/.config/hypr/scripts/xdg.sh
# Load Wallpaper
exec-once = ~/.config/hypr/scripts/wallpaper-restore.sh

# Listen wallpaper changes
exec=once = nohup sh ~/.config/hypr/conf/autostart.conf &

# Start Polkit
exec-once=/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1

Expand Down
6 changes: 6 additions & 0 deletions share/dotfiles/.config/hypr/conf/monitors/1600x900.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# -----------------------------------------------------
# Monitor Setup
# name: "1600x900"
# -----------------------------------------------------

monitor=,1600x900,auto,1
25 changes: 25 additions & 0 deletions share/dotfiles/.config/ml4w/scripts/listen_wallpaper_change.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash

CURRENT_WALLPAPER_PATH=$HOME/hyprland-setup/dotfiles/dot_config/ml4w/cache/current_wallpaper
CONFIG_FILE=$HOME/hyprland-setup/dotfiles/dot_config/waypaper/config.ini
LAST_WALLPAPER=""

get_current_wallpaper() {
grep -oP '^wallpaper\s*=\s*\K.*' "$CONFIG_FILE"
}

LAST_WALLPAPER=$(get_current_wallpaper)

inotifywait -m -e modify "$CONFIG_FILE" | while read -r path event file; do
CURRENT_WALLPAPER=$(get_current_wallpaper)

if [[ "$CURRENT_WALLPAPER" != "$LAST_WALLPAPER" ]]; then
LAST_WALLPAPER=$CURRENT_WALLPAPER
echo "El wallpaper ha cambiado: $CURRENT_WALLPAPER"
rm $CURRENT_WALLPAPER_PATH || true
touch $CURRENT_WALLPAPER_PATH || true
echo "$LAST_WALLPAPER" >> $CURRENT_WALLPAPER_PATH
sed -i "s|~|$HOME|g" "$CURRENT_WALLPAPER_PATH"
fi
sleep 0.01
done