aboutsummaryrefslogtreecommitdiffstats
path: root/config/hypr/UserScripts
diff options
context:
space:
mode:
authorJaKooLit <ejhay.games@gmail.com>2025-02-28 12:28:48 +0900
committerJaKooLit <ejhay.games@gmail.com>2025-02-28 12:28:48 +0900
commit7309da425ba33988f87f5615555a05e3910d603e (patch)
tree186dd2ceaa3c08fab7da79541d86ec692f65bbba /config/hypr/UserScripts
parentdeac723f42919c17e2bedce1ef85c65fbdfa3e10 (diff)
adjusted wallpaper menu scripts to apply some limits
Diffstat (limited to 'config/hypr/UserScripts')
-rwxr-xr-xconfig/hypr/UserScripts/WallpaperSelect.sh15
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
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage