diff options
| author | Ja.KooLit <jimmielovejay@gmail.com> | 2024-05-10 10:55:49 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-05-10 10:55:49 +0900 |
| commit | f233063b8a85422d4e2898918d78d5321db882eb (patch) | |
| tree | 30e9177c8361a275709e5053414829f5edbc4bd7 /config/hypr/scripts/WallustSwww.sh | |
| parent | 04a693a9eaf5edac5e7c1d4b5424ef31158c676d (diff) | |
| parent | e6643cb12158f84f056742080f20dd394d5abd9d (diff) | |
Merge pull request #252 from JaKooLit/development-wallust
Merging - Wallust Branch to Development Branch..
Diffstat (limited to 'config/hypr/scripts/WallustSwww.sh')
| -rwxr-xr-x | config/hypr/scripts/WallustSwww.sh | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/config/hypr/scripts/WallustSwww.sh b/config/hypr/scripts/WallustSwww.sh new file mode 100755 index 00000000..2a711028 --- /dev/null +++ b/config/hypr/scripts/WallustSwww.sh @@ -0,0 +1,37 @@ +#!/bin/bash +# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## +# Wallust Colors for current wallpaper + +# Define the path to the swww cache directory +cache_dir="$HOME/.cache/swww/" + +# Get a list of monitor outputs +monitor_outputs=($(ls "$cache_dir")) + +# Initialize a flag to determine if the ln command was executed +ln_success=false + +# Get current focused monitor +current_monitor=$(hyprctl monitors | awk '/^Monitor/{name=$2} /focused: yes/{print name}') +echo $current_monitor +# Construct the full path to the cache file +cache_file="$cache_dir$current_monitor" +echo $cache_file +# Check if the cache file exists for the current monitor output +if [ -f "$cache_file" ]; then + # Get the wallpaper path from the cache file + wallpaper_path=$(cat "$cache_file") + echo $wallpaper_path + # Copy the wallpaper to the location Rofi can access + if ln -sf "$wallpaper_path" "$HOME/.config/rofi/.current_wallpaper"; then + ln_success=true # Set the flag to true upon successful execution + fi +fi + +# Check the flag before executing further commands +if [ "$ln_success" = true ]; then + # execute wallust + echo 'about to execute wallust' + # execute wallust skipping tty and terminal changes + wallust run "$wallpaper_path" -s & +fi |
