aboutsummaryrefslogtreecommitdiffstats
path: root/config/hypr/UserScripts/WallpaperSelect.sh
diff options
context:
space:
mode:
authorJa.KooLit <85185940+JaKooLit@users.noreply.github.com>2025-02-23 14:46:19 +0900
committerGitHub <noreply@github.com>2025-02-23 14:46:19 +0900
commit91b9177b0ff5d2fac7b99be9a89f8e9f054347fd (patch)
tree5b11da646166995b52bb597cf6a92703d1f5a0a2 /config/hypr/UserScripts/WallpaperSelect.sh
parent9f5b41c3e230cda406592167fcd0446a5f56821c (diff)
parentb8ab57be1c8e579e69e5bfd56668815465d71785 (diff)
Merge pull request #577 from JaKooLit/development
Development to main Dots version 2.3.12
Diffstat (limited to 'config/hypr/UserScripts/WallpaperSelect.sh')
-rwxr-xr-xconfig/hypr/UserScripts/WallpaperSelect.sh34
1 files changed, 15 insertions, 19 deletions
diff --git a/config/hypr/UserScripts/WallpaperSelect.sh b/config/hypr/UserScripts/WallpaperSelect.sh
index d75c2c15..78bf8d2f 100755
--- a/config/hypr/UserScripts/WallpaperSelect.sh
+++ b/config/hypr/UserScripts/WallpaperSelect.sh
@@ -15,23 +15,23 @@ iDIR="$HOME/.config/swaync/images"
iDIRi="$HOME/.config/swaync/icons"
# variables
-rofi_theme="~/.config/rofi/config-wallpaper.rasi"
+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')
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
TYPE="any"
DURATION=2
BEZIER=".43,1.19,1,.4"
-SWWW_PARAMS="--transition-fps $FPS --transition-type $TYPE --transition-duration $DURATION"
+SWWW_PARAMS="--transition-fps $FPS --transition-type $TYPE --transition-duration $DURATION --transition-bezier $BEZIER"
# Check if swaybg is running
if pidof swaybg > /dev/null; then
@@ -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
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage