diff options
Diffstat (limited to 'config/hypr/UserScripts/WallpaperSelect.sh')
| -rwxr-xr-x | config/hypr/UserScripts/WallpaperSelect.sh | 30 |
1 files changed, 13 insertions, 17 deletions
diff --git a/config/hypr/UserScripts/WallpaperSelect.sh b/config/hypr/UserScripts/WallpaperSelect.sh index d75c2c15..32f9a93b 100755 --- a/config/hypr/UserScripts/WallpaperSelect.sh +++ b/config/hypr/UserScripts/WallpaperSelect.sh @@ -22,9 +22,9 @@ focused_monitor=$(hyprctl monitors -j | jq -r '.[] | select(.focused) | .name') monitor_width=$(hyprctl monitors -j | jq -r --arg mon "$focused_monitor" '.[] | select(.name == $mon) | .width') scale_factor=$(hyprctl monitors -j | jq -r --arg mon "$focused_monitor" '.[] | select(.name == $mon) | .scale') -# Calculate icon size for rofi -icon_size=$(echo "scale=1; ($monitor_width * 14) / ($scale_factor * 100)" | bc) -rofi_override="element-icon{size:${icon_size}px;}" +icon_size=$(echo "scale=1; ($monitor_width * 3) / ($scale_factor * 400)" | bc) + +rofi_override="element-icon{size:${icon_size}%;}" # swww transition config FPS=60 @@ -74,7 +74,6 @@ swww query || swww-daemon --format xrgb main() { choice=$(menu | $rofi_command) - # Trim any potential whitespace or hidden characters choice=$(echo "$choice" | xargs) RANDOM_PIC_NAME=$(echo "$RANDOM_PIC_NAME" | xargs) @@ -94,7 +93,6 @@ main() { exit 0 fi - # Find the index of the selected file pic_index=-1 for i in "${!PICS[@]}"; do filename=$(basename "${PICS[$i]}") @@ -143,16 +141,16 @@ if [[ -n "$choice" ]]; then while read -r line; do if echo "$line" | grep -q "yes"; then - # Check if terminal exists - if ! command -v "$terminal" &>/dev/null; then - notify-send -i "$iDIR/ja.png" "Missing $terminal" "Install $terminal to enable setting of wallpaper background" - exit 1 - fi + # Check if terminal exists + if ! command -v "$terminal" &>/dev/null; then + notify-send -i "$iDIR/ja.png" "Missing $terminal" "Install $terminal to enable setting of wallpaper background" + exit 1 + fi - $terminal -e bash -c "echo 'Enter your password to set wallpaper as SDDM Background'; \ - sudo cp -r $wallpaper_current '$sddm_sequoia/backgrounds/default' && \ - notify-send -i '$iDIR/ja.png' 'SDDM' 'Background SET'" - break + $terminal -e bash -c "echo 'Enter your password to set wallpaper as SDDM Background'; \ + sudo cp -r $wallpaper_current '$sddm_sequoia/backgrounds/default' && \ + notify-send -i '$iDIR/ja.png' 'SDDM' 'Background SET'" + break elif echo "$line" | grep -q "no"; then echo "Wallpaper not set as SDDM background. Exiting." break @@ -160,6 +158,4 @@ if [[ -n "$choice" ]]; then done & fi -fi - - +fi
\ No newline at end of file |
