diff options
| author | JaKooLit <ejhay.games@gmail.com> | 2025-02-28 12:28:45 +0900 |
|---|---|---|
| committer | JaKooLit <ejhay.games@gmail.com> | 2025-02-28 12:28:45 +0900 |
| commit | 779c34304ab43e6cd07c256897908335d7997da3 (patch) | |
| tree | 062521a0ab05d1065218e205917e75910d8cb279 | |
| parent | de91b9aadfee10c15aaf20b59d409aa1d395133c (diff) | |
adjusted wallpaper menu scripts to apply some limits
| -rwxr-xr-x | config/hypr/UserScripts/WallpaperSelect.sh | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/config/hypr/UserScripts/WallpaperSelect.sh b/config/hypr/UserScripts/WallpaperSelect.sh index ecb44c45..88b06dd6 100755 --- a/config/hypr/UserScripts/WallpaperSelect.sh +++ b/config/hypr/UserScripts/WallpaperSelect.sh @@ -8,8 +8,6 @@ wallDIR="$HOME/Pictures/wallpapers" SCRIPTSDIR="$HOME/.config/hypr/scripts" wallpaper_current="$HOME/.config/hypr/wallpaper_effects/.wallpaper_current" -rofi_override="element-icon{size:${icon_size}px;}" - # Directory for swaync iDIR="$HOME/.config/swaync/images" iDIRi="$HOME/.config/swaync/icons" @@ -18,13 +16,18 @@ iDIRi="$HOME/.config/swaync/icons" rofi_theme="$HOME/.config/rofi/config-wallpaper.rasi" focused_monitor=$(hyprctl monitors -j | jq -r '.[] | select(.focused) | .name') -# Get monitor width and DPI -monitor_width=$(hyprctl monitors -j | jq -r --arg mon "$focused_monitor" '.[] | select(.name == $mon) | .width') +# Monitor details scale_factor=$(hyprctl monitors -j | jq -r --arg mon "$focused_monitor" '.[] | select(.name == $mon) | .scale') +monitor_height=$(hyprctl monitors -j | jq -r --arg mon "$focused_monitor" '.[] | select(.name == $mon) | .height') + +icon_size=$(echo "scale=1; ($monitor_height * 3) / ($scale_factor * 150)" | bc) + +# Apply limit +adjusted_icon_size=$(echo "$icon_size" | awk '{if ($1 < 15) $1 = 20; if ($1 > 25) $1 = 25; print $1}') -icon_size=$(echo "scale=1; ($monitor_width * 3) / ($scale_factor * 400)" | bc) +# Setting the rofi override with the adjusted icon size +rofi_override="element-icon{size:${adjusted_icon_size}%;}" -rofi_override="element-icon{size:${icon_size}%;}" # swww transition config FPS=60 |
