aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Guzman <55927935+brockar@users.noreply.github.com>2025-02-19 01:59:09 -0300
committerGitHub <noreply@github.com>2025-02-19 01:59:09 -0300
commitd9e50a7a5a80028aabe07570c3432a98c22fc92b (patch)
tree928479da301647565d3de66174aaaaaf4719d513
parentaafa54509ccaee47a851011dc56996b29892eda4 (diff)
parent50d1dd1508c398ae19a93c8d621f3e7f6d81603b (diff)
Merge branch 'JaKooLit:main' into main
-rwxr-xr-xconfig/hypr/UserScripts/WallpaperEffects.sh52
-rwxr-xr-xconfig/hypr/UserScripts/WallpaperRandom.sh2
-rwxr-xr-xconfig/hypr/UserScripts/WallpaperSelect.sh50
3 files changed, 60 insertions, 44 deletions
diff --git a/config/hypr/UserScripts/WallpaperEffects.sh b/config/hypr/UserScripts/WallpaperEffects.sh
index 52cd0b4d..dea97921 100755
--- a/config/hypr/UserScripts/WallpaperEffects.sh
+++ b/config/hypr/UserScripts/WallpaperEffects.sh
@@ -103,26 +103,34 @@ main
sleep 1
# Check if user selected a wallpaper
if [[ -n "$choice" ]]; then
- sddm_sequoia="/usr/share/sddm/themes/sequoia_2"
- if [ -d "$sddm_sequoia" ]; then
- notify-send -i "$iDIR/ja.png" "Set wallpaper" "as SDDM background?" \
- -t 10000 \
- -A "yes=Yes" \
- -A "no=No" \
- -h string:x-canonical-private-synchronous:wallpaper-notify
+ sddm_sequoia="/usr/share/sddm/themes/sequoia_2"
+ if [ -d "$sddm_sequoia" ]; then
+ notify-send -i "$iDIR/ja.png" "Set wallpaper" "as SDDM background?" \
+ -t 10000 \
+ -A "yes=Yes" \
+ -A "no=No" \
+ -h string:x-canonical-private-synchronous:wallpaper-notify
- # Wait for user input using dbus-monitor
- dbus-monitor "interface='org.freedesktop.Notifications',member='ActionInvoked'" |
- while read -r line; do
- if echo "$line" | grep -q "yes"; then
- $terminal -e bash -c "echo 'Enter your password to set wallpaper as SDDM Background'; \
- sudo cp -r $wallpaper_output '$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
- fi
- done &
- fi
-fi
+ # Wait for user input using dbus-monitor
+ dbus-monitor "interface='org.freedesktop.Notifications',member='ActionInvoked'" |
+ 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
+
+ $terminal -e bash -c "echo 'Enter your password to set wallpaper as SDDM Background'; \
+ sudo cp -r $wallpaper_output '$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
+ fi
+
+ done &
+ fi
+fi \ No newline at end of file
diff --git a/config/hypr/UserScripts/WallpaperRandom.sh b/config/hypr/UserScripts/WallpaperRandom.sh
index abaa9b03..79396508 100755
--- a/config/hypr/UserScripts/WallpaperRandom.sh
+++ b/config/hypr/UserScripts/WallpaperRandom.sh
@@ -5,7 +5,7 @@
wallDIR="$HOME/Pictures/wallpapers"
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')
PICS=($(find -L ${wallDIR} -type f \( -name "*.jpg" -o -name "*.jpeg" -o -name "*.png" -o -name "*.pnm" -o -name "*.tga" -o -name "*.tiff" -o -name "*.webp" -o -name "*.bmp" -o -name "*.farbfeld" -o -name "*.gif" \)))
RANDOMPICS=${PICS[ $RANDOM % ${#PICS[@]} ]}
diff --git a/config/hypr/UserScripts/WallpaperSelect.sh b/config/hypr/UserScripts/WallpaperSelect.sh
index 4d0f8320..d75c2c15 100755
--- a/config/hypr/UserScripts/WallpaperSelect.sh
+++ b/config/hypr/UserScripts/WallpaperSelect.sh
@@ -130,28 +130,36 @@ sleep 2
sleep 1
# Check if user selected a wallpaper
if [[ -n "$choice" ]]; then
- sddm_sequoia="/usr/share/sddm/themes/sequoia_2"
- if [ -d "$sddm_sequoia" ]; then
- notify-send -i "$iDIR/ja.png" "Set wallpaper" "as SDDM background?" \
- -t 10000 \
- -A "yes=Yes" \
- -A "no=No" \
- -h string:x-canonical-private-synchronous:wallpaper-notify
+ sddm_sequoia="/usr/share/sddm/themes/sequoia_2"
+ if [ -d "$sddm_sequoia" ]; then
+ notify-send -i "$iDIR/ja.png" "Set wallpaper" "as SDDM background?" \
+ -t 10000 \
+ -A "yes=Yes" \
+ -A "no=No" \
+ -h string:x-canonical-private-synchronous:wallpaper-notify
- # Wait for user input using dbus-monitor
- dbus-monitor "interface='org.freedesktop.Notifications',member='ActionInvoked'" |
- while read -r line; do
- if echo "$line" | grep -q "yes"; then
- $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
- fi
- done &
- fi
+ # Wait for user input using dbus-monitor
+ dbus-monitor "interface='org.freedesktop.Notifications',member='ActionInvoked'" |
+ 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
+
+ $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
+ fi
+
+ done &
+ fi
fi
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage