diff options
Diffstat (limited to 'config/hypr/UserScripts')
| -rwxr-xr-x | config/hypr/UserScripts/00-Readme | 7 | ||||
| -rwxr-xr-x | config/hypr/UserScripts/RainbowBorders-low-cpu.sh | 6 | ||||
| -rwxr-xr-x | config/hypr/UserScripts/RainbowBorders.bak.sh | 7 | ||||
| -rwxr-xr-x | config/hypr/UserScripts/RofiBeats.sh | 7 | ||||
| -rwxr-xr-x | config/hypr/UserScripts/RofiCalc.sh | 7 | ||||
| -rwxr-xr-x | config/hypr/UserScripts/Tak0-Autodispatch.sh | 6 | ||||
| -rwxr-xr-x | config/hypr/UserScripts/WallpaperAutoChange.sh | 14 | ||||
| -rwxr-xr-x | config/hypr/UserScripts/WallpaperEffects.sh | 24 | ||||
| -rwxr-xr-x | config/hypr/UserScripts/WallpaperRandom.sh | 25 | ||||
| -rwxr-xr-x | config/hypr/UserScripts/WallpaperSelect.sh | 86 | ||||
| -rwxr-xr-x | config/hypr/UserScripts/Weather.py | 7 | ||||
| -rwxr-xr-x | config/hypr/UserScripts/Weather.sh | 7 | ||||
| -rwxr-xr-x | config/hypr/UserScripts/WeatherWrap.sh | 7 | ||||
| -rwxr-xr-x | config/hypr/UserScripts/ZshChangeTheme.sh | 7 |
14 files changed, 177 insertions, 40 deletions
diff --git a/config/hypr/UserScripts/00-Readme b/config/hypr/UserScripts/00-Readme index 54d7fff2..259fc9d9 100755 --- a/config/hypr/UserScripts/00-Readme +++ b/config/hypr/UserScripts/00-Readme @@ -1,4 +1,9 @@ -# /* ---- π« https://github.com/LinuxBeginnings π« ---- */ # +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== # Place your new scripts here. # If you need to edit a script from main script (~/.config/hypr/scripts), copy it on this directory, and edit. diff --git a/config/hypr/UserScripts/RainbowBorders-low-cpu.sh b/config/hypr/UserScripts/RainbowBorders-low-cpu.sh index bc0ab9ef..a8de4c89 100755 --- a/config/hypr/UserScripts/RainbowBorders-low-cpu.sh +++ b/config/hypr/UserScripts/RainbowBorders-low-cpu.sh @@ -1,4 +1,10 @@ #!/usr/bin/env bash +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== # RainbowBorders-low-cpu.sh β low-overhead animated rainbow border for Hyprland # # Goal diff --git a/config/hypr/UserScripts/RainbowBorders.bak.sh b/config/hypr/UserScripts/RainbowBorders.bak.sh index 49de9ea7..87f13c34 100755 --- a/config/hypr/UserScripts/RainbowBorders.bak.sh +++ b/config/hypr/UserScripts/RainbowBorders.bak.sh @@ -1,5 +1,10 @@ #!/usr/bin/env bash -# /* ---- π« https://github.com/LinuxBeginnings π« ---- */ ## +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== # Smooth border cycling effect using Wallust palette or full rainbow # Possible values: "wallust_random", "rainbow", "gradient_flow" diff --git a/config/hypr/UserScripts/RofiBeats.sh b/config/hypr/UserScripts/RofiBeats.sh index 6effb12a..060ec33e 100755 --- a/config/hypr/UserScripts/RofiBeats.sh +++ b/config/hypr/UserScripts/RofiBeats.sh @@ -1,5 +1,10 @@ #!/usr/bin/env bash -# /* ---- π« https://github.com/LinuxBeginnings π« ---- */ ## +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== # RofiBeats - unified, dynamic UI (add, remove, manage, play) mDIR="$HOME/Music/" diff --git a/config/hypr/UserScripts/RofiCalc.sh b/config/hypr/UserScripts/RofiCalc.sh index 116fc6cc..40a7ca3f 100755 --- a/config/hypr/UserScripts/RofiCalc.sh +++ b/config/hypr/UserScripts/RofiCalc.sh @@ -1,5 +1,10 @@ #!/usr/bin/env bash -# /* ---- π« https://github.com/LinuxBeginnings π« ---- */ +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== # /* Calculator (using qalculate) and rofi */ # /* Submitted by: https://github.com/JosephArmas */ diff --git a/config/hypr/UserScripts/Tak0-Autodispatch.sh b/config/hypr/UserScripts/Tak0-Autodispatch.sh index 48c22515..b0607e13 100755 --- a/config/hypr/UserScripts/Tak0-Autodispatch.sh +++ b/config/hypr/UserScripts/Tak0-Autodispatch.sh @@ -1,4 +1,10 @@ #!/usr/bin/env bash +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== # USAGE: # 1) Run from terminal: # ./dispatch.sh <application_command> <target_workspace_number> diff --git a/config/hypr/UserScripts/WallpaperAutoChange.sh b/config/hypr/UserScripts/WallpaperAutoChange.sh index 9643c7e9..aa6cf89e 100755 --- a/config/hypr/UserScripts/WallpaperAutoChange.sh +++ b/config/hypr/UserScripts/WallpaperAutoChange.sh @@ -1,5 +1,10 @@ #!/usr/bin/env bash -# /* ---- π« https://github.com/LinuxBeginnings π« ---- */ ## +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== # source https://wiki.archlinux.org/title/Hyprland#Using_a_script_to_change_wallpaper_every_X_minutes # This script will randomly go through the files of a directory, setting it @@ -10,6 +15,11 @@ wallust_refresh=$HOME/.config/hypr/scripts/RefreshNoWaybar.sh focused_monitor=$(hyprctl monitors | awk '/^Monitor/{name=$2} /focused: yes/{print name}') +if command -v awww >/dev/null 2>&1; then + WWW="awww" +else + WWW="swww" +fi if [[ $# -lt 1 ]] || [[ ! -d $1 ]]; then echo "Usage: @@ -31,7 +41,7 @@ while true; do done \ | sort -n | cut -d':' -f2- \ | while read -r img; do - swww img -o $focused_monitor "$img" + $WWW img -o $focused_monitor "$img" # Regenerate colors from the exact image path to avoid cache races $HOME/.config/hypr/scripts/WallustSwww.sh "$img" # Refresh UI components that depend on wallust output diff --git a/config/hypr/UserScripts/WallpaperEffects.sh b/config/hypr/UserScripts/WallpaperEffects.sh index caca56e1..57db3532 100755 --- a/config/hypr/UserScripts/WallpaperEffects.sh +++ b/config/hypr/UserScripts/WallpaperEffects.sh @@ -1,5 +1,10 @@ #!/usr/bin/env bash -# /* ---- π« https://github.com/LinuxBeginnings π« ---- */ # +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== # Wallpaper Effects using ImageMagick (SUPER SHIFT W) # Variables @@ -9,17 +14,26 @@ wallpaper_output="$HOME/.config/hypr/wallpaper_effects/.wallpaper_modified" SCRIPTSDIR="$HOME/.config/hypr/scripts" focused_monitor=$(hyprctl monitors -j | jq -r '.[] | select(.focused) | .name') rofi_theme="$HOME/.config/rofi/config-wallpaper-effect.rasi" +if command -v awww >/dev/null 2>&1; then + WWW="awww" +else + WWW="swww" +fi # Directory for swaync iDIR="$HOME/.config/swaync/images" iDIRi="$HOME/.config/swaync/icons" -# swww transition config +# swww transition config (only when using swww) FPS=60 TYPE="wipe" DURATION=2 BEZIER=".43,1.19,1,.4" -SWWW_PARAMS="--transition-fps $FPS --transition-type $TYPE --transition-duration $DURATION --transition-bezier $BEZIER" +if [[ "$WWW" == "swww" ]]; then + SWWW_PARAMS="--transition-fps $FPS --transition-type $TYPE --transition-duration $DURATION --transition-bezier $BEZIER" +else + SWWW_PARAMS="" +fi # Define ImageMagick effects declare -A effects=( @@ -45,7 +59,7 @@ declare -A effects=( # Function to apply no effects no-effects() { - swww img -o "$focused_monitor" "$wallpaper_current" $SWWW_PARAMS && + $WWW img -o "$focused_monitor" "$wallpaper_current" $SWWW_PARAMS && wait $! wallust run "$wallpaper_current" -s && wait $! @@ -83,7 +97,7 @@ main() { done sleep 1 - swww img -o "$focused_monitor" "$wallpaper_output" $SWWW_PARAMS & + $WWW img -o "$focused_monitor" "$wallpaper_output" $SWWW_PARAMS & sleep 2 diff --git a/config/hypr/UserScripts/WallpaperRandom.sh b/config/hypr/UserScripts/WallpaperRandom.sh index a9908e19..db8251f2 100755 --- a/config/hypr/UserScripts/WallpaperRandom.sh +++ b/config/hypr/UserScripts/WallpaperRandom.sh @@ -1,10 +1,17 @@ #!/usr/bin/env bash -# /* ---- π« https://github.com/LinuxBeginnings π« ---- */ ## +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== # Script for Random Wallpaper ( CTRL ALT W) PICTURES_DIR="$(xdg-user-dir PICTURES 2>/dev/null || echo "$HOME/Pictures")" wallDIR="$PICTURES_DIR/wallpapers" SCRIPTSDIR="$HOME/.config/hypr/scripts" +# shellcheck source=/dev/null +. "$SCRIPTSDIR/WallpaperCmd.sh" focused_monitor=$(hyprctl monitors -j | jq -r '.[] | select(.focused) | .name') @@ -12,18 +19,24 @@ PICS=($(find -L "${wallDIR}" -type f \( -name "*.jpg" -o -name "*.jpeg" -o -name RANDOMPICS=${PICS[ $RANDOM % ${#PICS[@]} ]} -# Transition config +# Transition config (only when using swww) FPS=30 TYPE="random" DURATION=1 BEZIER=".43,1.19,1,.4" -SWWW_PARAMS="--transition-fps $FPS --transition-type $TYPE --transition-duration $DURATION --transition-bezier $BEZIER" +if [[ "$WWW_CMD" == "swww" ]]; then + SWWW_PARAMS="--transition-fps $FPS --transition-type $TYPE --transition-duration $DURATION --transition-bezier $BEZIER" +else + SWWW_PARAMS="" +fi +if ! "$WWW_CMD" query >/dev/null 2>&1; then + "$WWW_DAEMON" "${WWW_DAEMON_ARGS[@]}" & +fi - -swww query || swww-daemon --format xrgb && swww img -o $focused_monitor ${RANDOMPICS} $SWWW_PARAMS +"$WWW_CMD" img -o "$focused_monitor" "$RANDOMPICS" $SWWW_PARAMS wait $! -"$SCRIPTSDIR/WallustSwww.sh" && +"$SCRIPTSDIR/WallustSwww.sh" "$RANDOMPICS" && wait $! sleep 2 diff --git a/config/hypr/UserScripts/WallpaperSelect.sh b/config/hypr/UserScripts/WallpaperSelect.sh index ed0b2846..9dafdf57 100755 --- a/config/hypr/UserScripts/WallpaperSelect.sh +++ b/config/hypr/UserScripts/WallpaperSelect.sh @@ -1,5 +1,10 @@ #!/usr/bin/env bash -# /* ---- π« https://github.com/LinuxBeginnings π« ---- */ +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== # This script for selecting wallpapers (SUPER W) # WALLPAPERS PATH @@ -7,18 +12,25 @@ terminal=kitty PICTURES_DIR="$(xdg-user-dir PICTURES 2>/dev/null || echo "$HOME/Pictures")" wallDIR="$PICTURES_DIR/wallpapers" SCRIPTSDIR="$HOME/.config/hypr/scripts" +# shellcheck source=/dev/null +. "$SCRIPTSDIR/WallpaperCmd.sh" wallpaper_current="$HOME/.config/hypr/wallpaper_effects/.wallpaper_current" +wallpaper_link="$HOME/.config/rofi/.current_wallpaper" # Directory for swaync iDIR="$HOME/.config/swaync/images" iDIRi="$HOME/.config/swaync/icons" -# swww transition config +# swww transition config (only when using swww) FPS=60 TYPE="any" DURATION=2 BEZIER=".43,1.19,1,.4" -SWWW_PARAMS="--transition-fps $FPS --transition-type $TYPE --transition-duration $DURATION --transition-bezier $BEZIER" +if [[ "$WWW_CMD" == "swww" ]]; then + SWWW_PARAMS="--transition-fps $FPS --transition-type $TYPE --transition-duration $DURATION --transition-bezier $BEZIER" +else + SWWW_PARAMS="" +fi # Check if package bc exists if ! command -v bc &>/dev/null; then @@ -46,7 +58,7 @@ rofi_override="element-icon{size:${adjusted_icon_size}%;}" # Kill existing wallpaper daemons for video kill_wallpaper_for_video() { - swww kill 2>/dev/null + "$WWW_CMD" kill 2>/dev/null pkill mpvpaper 2>/dev/null pkill swaybg 2>/dev/null pkill hyprpaper 2>/dev/null @@ -66,7 +78,19 @@ mapfile -d '' PICS < <(find -L "${wallDIR}" -type f \( \ -iname "*.mp4" -o -iname "*.mkv" -o -iname "*.mov" -o -iname "*.webm" \) -print0) RANDOM_PIC="${PICS[$((RANDOM % ${#PICS[@]}))]}" -RANDOM_PIC_NAME=". random" +RANDOM_PIC_NAME="$(basename "$RANDOM_PIC")" + +CURRENT_MON_PIC_PATH=$("$WWW_CMD" query 2>/dev/null | grep "$focused_monitor" | awk '{print $NF}') +if [[ -z "$CURRENT_MON_PIC_PATH" ]]; then + if [[ -L "$wallpaper_link" ]]; then + CURRENT_MON_PIC_PATH="$(readlink -f "$wallpaper_link")" + elif [[ -f "$wallpaper_link" ]]; then + CURRENT_MON_PIC_PATH="$wallpaper_link" + elif [[ -f "$wallpaper_current" ]]; then + CURRENT_MON_PIC_PATH="$wallpaper_current" + fi +fi +CURRENT_MON_PIC_NAME=$(basename "$CURRENT_MON_PIC_PATH") # Rofi command rofi_command="rofi -i -show -dmenu -config $rofi_theme -theme-str $rofi_override" @@ -75,7 +99,10 @@ rofi_command="rofi -i -show -dmenu -config $rofi_theme -theme-str $rofi_override menu() { IFS=$'\n' sorted_options=($(sort <<<"${PICS[*]}")) - printf "%s\x00icon\x1f%s\n" "$RANDOM_PIC_NAME" "$RANDOM_PIC" + printf "%s\x00icon\x1f%s\n" "Random: $RANDOM_PIC_NAME" "$RANDOM_PIC" + if [[ -n "$CURRENT_MON_PIC_PATH" ]]; then + printf "%s\x00icon\x1f%s\n" "Current: $CURRENT_MON_PIC_NAME" "$CURRENT_MON_PIC_PATH" + fi for pic_path in "${sorted_options[@]}"; do pic_name=$(basename "$pic_path") @@ -107,6 +134,7 @@ modify_startup_config() { # Check if it's a live wallpaper (video) if [[ "$selected_file" =~ \.(mp4|mkv|mov|webm)$ ]]; then # For video wallpapers: + sed -i '/^\s*exec-once\s*=\s*\$scriptsDir\/WallpaperDaemon\.sh\s*$/s/^/\#/' "$startup_config" sed -i '/^\s*exec-once\s*=\s*swww-daemon\s*--format\s*xrgb\s*$/s/^/\#/' "$startup_config" sed -i '/^\s*#\s*exec-once\s*=\s*mpvpaper\s*.*$/s/^#\s*//;' "$startup_config" @@ -117,6 +145,7 @@ modify_startup_config() { echo "Configured for live wallpaper (video)." else # For image wallpapers: + sed -i '/^\s*#\s*exec-once\s*=\s*\$scriptsDir\/WallpaperDaemon\.sh\s*$/s/^\s*#\s*//;' "$startup_config" sed -i '/^\s*#\s*exec-once\s*=\s*swww-daemon\s*--format\s*xrgb\s*$/s/^\s*#\s*//;' "$startup_config" sed -i '/^\s*exec-once\s*=\s*mpvpaper\s*.*$/s/^/\#/' "$startup_config" @@ -131,12 +160,20 @@ apply_image_wallpaper() { kill_wallpaper_for_image - if ! pgrep -x "swww-daemon" >/dev/null; then - echo "Starting swww-daemon..." - swww-daemon --format xrgb & + if ! pgrep -x "$WWW_DAEMON" >/dev/null; then + echo "Starting $WWW_DAEMON..." + "$WWW_DAEMON" "${WWW_DAEMON_ARGS[@]}" & fi - - swww img -o "$focused_monitor" "$image_path" $SWWW_PARAMS + # Wait for daemon to be ready before applying + for _ in {1..20}; do + "$WWW_CMD" query >/dev/null 2>&1 && break + sleep 0.1 + done + "$WWW_CMD" img -o "$focused_monitor" "$image_path" $SWWW_PARAMS || { + sleep 0.2 + "$WWW_CMD" img -o "$focused_monitor" "$image_path" $SWWW_PARAMS + } + "$WWW_CMD" img -o "$focused_monitor" "$image_path" $SWWW_PARAMS # Run additional scripts (pass the image path to avoid cache race conditions) "$SCRIPTSDIR/WallustSwww.sh" "$image_path" @@ -165,21 +202,32 @@ main() { choice=$(menu | $rofi_command) choice=$(echo "$choice" | xargs) RANDOM_PIC_NAME=$(echo "$RANDOM_PIC_NAME" | xargs) + raw_choice="$choice" + choice="${choice#Random: }" + choice="${choice#Current: }" if [[ -z "$choice" ]]; then echo "No choice selected. Exiting." exit 0 fi - # Handle random selection correctly - if [[ "$choice" == "$RANDOM_PIC_NAME" ]]; then - choice=$(basename "$RANDOM_PIC") - fi - - choice_basename=$(basename "$choice" | sed 's/\(.*\)\.[^.]*$/\1/') + # Resolve selection directly when using Random/Current entries + if [[ "$raw_choice" == Random:\ * ]]; then + selected_file="$RANDOM_PIC" + elif [[ "$raw_choice" == Current:\ * && -n "$CURRENT_MON_PIC_PATH" ]]; then + selected_file="$CURRENT_MON_PIC_PATH" + elif [[ -f "$choice" ]]; then + selected_file="$choice" + else + # Handle random selection by name when needed + if [[ "$choice" == "$RANDOM_PIC_NAME" ]]; then + choice=$(basename "$RANDOM_PIC") + fi + choice_basename=$(basename "$choice" | sed 's/\(.*\)\.[^.]*$/\1/') - # Search for the selected file in the wallpapers directory, including subdirectories - selected_file=$(find "$wallDIR" -iname "$choice_basename.*" -print -quit) + # Search for the selected file in the wallpapers directory, including subdirectories + selected_file=$(find "$wallDIR" -iname "$choice_basename.*" -print -quit) + fi if [[ -z "$selected_file" ]]; then echo "File not found. Selected choice: $choice" diff --git a/config/hypr/UserScripts/Weather.py b/config/hypr/UserScripts/Weather.py index e7a0fe01..6905e0e1 100755 --- a/config/hypr/UserScripts/Weather.py +++ b/config/hypr/UserScripts/Weather.py @@ -1,5 +1,10 @@ #!/usr/bin/env python3 -# /* ---- π« https://github.com/LinuxBeginnings π« ---- */ # +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== # Rewritten to use Open-Meteo APIs (worldwide, no API key) for robust weather data. # Outputs Waybar-compatible JSON and a simple text cache. diff --git a/config/hypr/UserScripts/Weather.sh b/config/hypr/UserScripts/Weather.sh index c01a4e12..c6683e07 100755 --- a/config/hypr/UserScripts/Weather.sh +++ b/config/hypr/UserScripts/Weather.sh @@ -1,5 +1,10 @@ #!/usr/bin/env bash -# /* ---- π« https://github.com/LinuxBeginnings π« ---- */ ## +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== # weather info from wttr. https://github.com/chubin/wttr.in # Remember to add city # Function to get current city from IP address with fallback diff --git a/config/hypr/UserScripts/WeatherWrap.sh b/config/hypr/UserScripts/WeatherWrap.sh index 5e8b4733..1e15e4a6 100755 --- a/config/hypr/UserScripts/WeatherWrap.sh +++ b/config/hypr/UserScripts/WeatherWrap.sh @@ -1,5 +1,10 @@ #!/usr/bin/env bash -# /* ---- π« https://github.com/LinuxBeginnings π« ---- */ ## +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== # Weather entrypoint: prefer Python (OpenβMeteo), fallback to legacy Bash (wttr.in) SCRIPT_DIR="$(dirname "$0")" diff --git a/config/hypr/UserScripts/ZshChangeTheme.sh b/config/hypr/UserScripts/ZshChangeTheme.sh index 3e2f077a..94c1b448 100755 --- a/config/hypr/UserScripts/ZshChangeTheme.sh +++ b/config/hypr/UserScripts/ZshChangeTheme.sh @@ -1,5 +1,10 @@ #!/usr/bin/env bash -# /* ---- π« https://github.com/LinuxBeginnings π« ---- */ ## +# ================================================== +# KoolDots (2026) +# Project URL: https://github.com/LinuxBeginnings +# License: GNU GPLv3 +# SPDX-License-Identifier: GPL-3.0-or-later +# ================================================== # Script for Oh my ZSH theme ( CTRL SHIFT O) # preview of theme can be view here: https://github.com/ohmyzsh/ohmyzsh/wiki/Themes |
