aboutsummaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
authorJaKooLit <ejhay.games@gmail.com>2025-02-18 23:02:05 +0900
committerJaKooLit <ejhay.games@gmail.com>2025-02-18 23:02:05 +0900
commit5678aa496a365804f53cc096c3fbb382dea2083a (patch)
tree5662c3e6209d178d246268d9f7740e11446aff6b /config
parentfe977af9d009e4dddbd236e5871d158a96197871 (diff)
minor update on wallpaper menu to have dynamically icon size depending on monitor sizes. Idea from @Abhra00
Diffstat (limited to 'config')
-rwxr-xr-xconfig/hypr/UserScripts/WallpaperEffects.sh6
-rwxr-xr-xconfig/hypr/UserScripts/WallpaperSelect.sh19
-rw-r--r--config/rofi/config-wallpaper.rasi19
-rw-r--r--config/rofi/config.rasi11
4 files changed, 33 insertions, 22 deletions
diff --git a/config/hypr/UserScripts/WallpaperEffects.sh b/config/hypr/UserScripts/WallpaperEffects.sh
index 2573f5e0..06c1d3ff 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
@@ -15,9 +15,9 @@ iDIR="$HOME/.config/swaync/images"
iDIRi="$HOME/.config/swaync/icons"
# swww transition config
-FPS=60
+FPS=30
TYPE="wipe"
-DURATION=2
+DURATION=1
BEZIER=".43,1.19,1,.4"
SWWW_PARAMS="--transition-fps $FPS --transition-type $TYPE --transition-duration $DURATION"
diff --git a/config/hypr/UserScripts/WallpaperSelect.sh b/config/hypr/UserScripts/WallpaperSelect.sh
index 86264775..a53b88d7 100755
--- a/config/hypr/UserScripts/WallpaperSelect.sh
+++ b/config/hypr/UserScripts/WallpaperSelect.sh
@@ -8,17 +8,28 @@ 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
+FPS=30
TYPE="any"
-DURATION=2
+DURATION=1
BEZIER=".43,1.19,1,.4"
SWWW_PARAMS="--transition-fps $FPS --transition-type $TYPE --transition-duration $DURATION"
@@ -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() {
diff --git a/config/rofi/config-wallpaper.rasi b/config/rofi/config-wallpaper.rasi
index eab47606..ca2789d8 100644
--- a/config/rofi/config-wallpaper.rasi
+++ b/config/rofi/config-wallpaper.rasi
@@ -21,26 +21,35 @@ mainbox {
entry {
expand: true;
placeholder: " 🎞️ Search / Choose Wallpaper";
- horizontal-align: 0.0;
+ horizontal-align: 0.5;
}
/* ---- Listview ---- */
listview {
- columns: 5;
- lines: 3;
+ columns: 4;
+ lines: 2;
+ spacing: 10px;
+ padding: 10px;
flow: horizontal;
+ fixed-width: false;
+ fixed-height: true;
}
/* ---- Element ---- */
element {
orientation: vertical;
+ border-radius: 12px;
+ spacing: 20px;
+ padding: 6px;
}
element-icon {
- size: 10%;
+ vertical-align: 0.5;
}
element-text {
- vertical-align: 0.5;
+ vertical-align: 1.0;
horizontal-align: 0.5;
+ padding: 0px;
+ margin: 0px;
}
diff --git a/config/rofi/config.rasi b/config/rofi/config.rasi
index 5769b508..b52ef00e 100644
--- a/config/rofi/config.rasi
+++ b/config/rofi/config.rasi
@@ -21,13 +21,4 @@ configuration {
/* note: Element-text font and size, edit configs in ~/.config/rofi/themes/ */
-//@theme "~/.config/rofi/themes/KooL_style-2-Dark.rasi"
-//@theme "~/.config/rofi/themes/KooL_style-1.rasi"
-//@theme "~/.config/rofi/themes/KooL_LonerOrZ.rasi"
-//@theme "~/.config/rofi/themes/KooL_style-1.rasi"
-//@theme "~/.config/rofi/themes/KooL_style-10-Fancy-v2.rasi"
-//@theme "~/.config/rofi/themes/KooL_style-10-Fancy.rasi"
-//@theme "~/.config/rofi/themes/KooL_style-11-Win11-list-dark.rasi"
-//@theme "~/.config/rofi/themes/KooL_style-2-Dark.rasi"
-//@theme "~/.config/rofi/themes/KooL_style-12-TOP-Docu.rasi"
-@theme "~/.config/rofi/themes/KooL_style-4.rasi"
+@theme "~/.config/rofi/themes/KooL_style-2-Dark.rasi"
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage