aboutsummaryrefslogtreecommitdiffstats
path: root/config/hypr/UserScripts
diff options
context:
space:
mode:
authorJa.KooLit <85185940+JaKooLit@users.noreply.github.com>2025-02-19 00:17:45 +0900
committerGitHub <noreply@github.com>2025-02-19 00:17:45 +0900
commit259be5801f64ddcec5bdc7d97512322079c57314 (patch)
tree00a1a8549388f6286027ca3859963102f80a40c2 /config/hypr/UserScripts
parent7ed5afe7c68777c83b99fffae067374d508eb9b9 (diff)
parent6545cbd6f3cc7620f53e5872e018ea8c0b91d9d8 (diff)
Merge pull request #561 from JaKooLit/main
main to development
Diffstat (limited to 'config/hypr/UserScripts')
-rwxr-xr-xconfig/hypr/UserScripts/WallpaperEffects.sh2
-rwxr-xr-xconfig/hypr/UserScripts/WallpaperSelect.sh15
2 files changed, 14 insertions, 3 deletions
diff --git a/config/hypr/UserScripts/WallpaperEffects.sh b/config/hypr/UserScripts/WallpaperEffects.sh
index 2573f5e0..52cd0b4d 100755
--- a/config/hypr/UserScripts/WallpaperEffects.sh
+++ b/config/hypr/UserScripts/WallpaperEffects.sh
@@ -7,7 +7,7 @@ terminal=kitty
wallpaper_current="$HOME/.config/hypr/wallpaper_effects/.wallpaper_current"
wallpaper_output="$HOME/.config/hypr/wallpaper_effects/.wallpaper_modified"
SCRIPTSDIR="$HOME/.config/hypr/scripts"
-focused_monitor=$(hyprctl monitors | awk '/^Monitor/{name=$2} /focused: yes/{print name}')
+focused_monitor=$(hyprctl monitors -j | jq -r '.[] | select(.focused) | .name')
rofi_theme="~/.config/rofi/config-wallpaper-effect.rasi"
# Directory for swaync
diff --git a/config/hypr/UserScripts/WallpaperSelect.sh b/config/hypr/UserScripts/WallpaperSelect.sh
index 86264775..4d0f8320 100755
--- a/config/hypr/UserScripts/WallpaperSelect.sh
+++ b/config/hypr/UserScripts/WallpaperSelect.sh
@@ -8,13 +8,24 @@ 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"
# variables
rofi_theme="~/.config/rofi/config-wallpaper.rasi"
-focused_monitor=$(hyprctl monitors | awk '/^Monitor/{name=$2} /focused: yes/{print name}')
+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')
+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;}"
+
# swww transition config
FPS=60
TYPE="any"
@@ -34,7 +45,7 @@ RANDOM_PIC="${PICS[$((RANDOM % ${#PICS[@]}))]}"
RANDOM_PIC_NAME=". random"
# Rofi command
-rofi_command="rofi -i -show -dmenu -config $rofi_theme"
+rofi_command="rofi -i -show -dmenu -config $rofi_theme -theme-str $rofi_override"
# Sorting Wallpapers
menu() {
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage