aboutsummaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
authorJa.KooLit <jimmielovejay@gmail.com>2024-01-31 13:39:12 +0900
committerGitHub <noreply@github.com>2024-01-31 13:39:12 +0900
commit343f8d8184ee8568593c3b5271355bcf4c5470eb (patch)
treeb231bd5bcc8c5bd6898a71fb58e17f6b03824776 /config
parent24d2811134f929f150f11b026252b833617612de (diff)
parentf7fd59389c265a8ca8ce0e7f8ef240fdcc41abd4 (diff)
Merge pull request #145 from xdonu2x/PywalSwww_multiMonitor
Bug: Pywal_Swww on multi monitor
Diffstat (limited to 'config')
-rwxr-xr-xconfig/hypr/scripts/PywalSwww.sh34
1 files changed, 16 insertions, 18 deletions
diff --git a/config/hypr/scripts/PywalSwww.sh b/config/hypr/scripts/PywalSwww.sh
index 0cbadaf4..4ed7448f 100755
--- a/config/hypr/scripts/PywalSwww.sh
+++ b/config/hypr/scripts/PywalSwww.sh
@@ -11,30 +11,28 @@ monitor_outputs=($(ls "$cache_dir"))
# Initialize a flag to determine if the ln command was executed
ln_success=false
-# Loop through monitor outputs
-for output in "${monitor_outputs[@]}"; do
- # Construct the full path to the cache file
- cache_file="$cache_dir$output"
-
- # 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")
-
- # 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
-
- break # Exit the loop after processing the first found monitor output
+# Get first valid monitor
+current_monitor=$(hyprctl -j monitors | jq -r '.[0].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
-done
+fi
# Check the flag before executing further commands
if [ "$ln_success" = true ]; then
# execute pywal
# wal -i "$wallpaper_path"
-
+ echo 'about to execute wal'
# execute pywal skipping tty and terminal changes
wal -i "$wallpaper_path" -s -t &
fi
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage