diff options
| author | Ja.KooLit <85185940+JaKooLit@users.noreply.github.com> | 2025-02-16 11:09:08 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-02-16 11:09:08 +0900 |
| commit | 8acfbb16d5ef45960a13cb9768517d3c418771a6 (patch) | |
| tree | 7b618f6cca7942c3d2876740fca3963092b2da21 /config/hypr/UserScripts | |
| parent | 349f564bf307ad1ed99c87d028fccdecf7c1bdeb (diff) | |
| parent | 0c53ef536ca2f028672004e909daac5473e6110f (diff) | |
Merge pull request #556 from JaKooLit/development
Development to main feat. Rofi Themes
Diffstat (limited to 'config/hypr/UserScripts')
| -rwxr-xr-x | config/hypr/UserScripts/QuickEdit.sh | 3 | ||||
| -rwxr-xr-x | config/hypr/UserScripts/RofiBeats.sh | 14 | ||||
| -rwxr-xr-x | config/hypr/UserScripts/RofiCalc.sh | 4 | ||||
| -rwxr-xr-x | config/hypr/UserScripts/WallpaperEffects.sh | 15 | ||||
| -rwxr-xr-x | config/hypr/UserScripts/WallpaperRandom.sh | 2 | ||||
| -rwxr-xr-x | config/hypr/UserScripts/WallpaperSelect.sh | 5 | ||||
| -rwxr-xr-x | config/hypr/UserScripts/ZshChangeTheme.sh | 8 |
7 files changed, 25 insertions, 26 deletions
diff --git a/config/hypr/UserScripts/QuickEdit.sh b/config/hypr/UserScripts/QuickEdit.sh index e0af9dce..c71fb166 100755 --- a/config/hypr/UserScripts/QuickEdit.sh +++ b/config/hypr/UserScripts/QuickEdit.sh @@ -9,6 +9,7 @@ tty=kitty # Paths to configuration directories configs="$HOME/.config/hypr/configs" UserConfigs="$HOME/.config/hypr/UserConfigs" +rofi_theme="~/.config/rofi/config-edit.rasi" # Function to display the menu options menu() { @@ -29,7 +30,7 @@ EOF # Main function to handle menu selection main() { - choice=$(menu | rofi -i -dmenu -config ~/.config/rofi/config-compact.rasi | cut -d. -f1) + choice=$(menu | rofi -i -dmenu -config $rofi_theme | cut -d. -f1) # Map choices to corresponding files case $choice in diff --git a/config/hypr/UserScripts/RofiBeats.sh b/config/hypr/UserScripts/RofiBeats.sh index 380f6b29..38ff8829 100755 --- a/config/hypr/UserScripts/RofiBeats.sh +++ b/config/hypr/UserScripts/RofiBeats.sh @@ -2,11 +2,11 @@ # /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## # For Rofi Beats to play online Music or Locally save media files -# Directory local music folder +# Variables mDIR="$HOME/Music/" - -# Directory for icons iDIR="$HOME/.config/swaync/icons" +rofi_theme="~/.config/rofi/config-rofi-Beats.rasi" +rofi_theme_1="~/.config/rofi/config-rofi-Beats-menu.rasi" # Online Stations. Edit as required declare -A online_music=( @@ -34,7 +34,7 @@ populate_local_music() { while IFS= read -r file; do local_music+=("$file") filenames+=("$(basename "$file")") - done < <(find "$mDIR" -type f \( -iname "*.mp3" -o -iname "*.flac" -o -iname "*.wav" -o -iname "*.ogg" -o -iname "*.mp4" \)) + done < <(find -L "$mDIR" -type f \( -iname "*.mp3" -o -iname "*.flac" -o -iname "*.wav" -o -iname "*.ogg" -o -iname "*.mp4" \)) } # Function for displaying notifications @@ -47,7 +47,7 @@ play_local_music() { populate_local_music # Prompt the user to select a song - choice=$(printf "%s\n" "${filenames[@]}" | rofi -i -dmenu -config ~/.config/rofi/config-rofi-Beats.rasi) + choice=$(printf "%s\n" "${filenames[@]}" | rofi -i -dmenu -config $rofi_theme) if [ -z "$choice" ]; then exit 1 @@ -77,7 +77,7 @@ shuffle_local_music() { # Main function for playing online music play_online_music() { - choice=$(printf "%s\n" "${!online_music[@]}" | rofi -i -dmenu -config ~/.config/rofi/config-rofi-Beats.rasi) + choice=$(printf "%s\n" "${!online_music[@]}" | rofi -i -dmenu -config $rofi_theme) if [ -z "$choice" ]; then exit 1 @@ -101,7 +101,7 @@ fi # Prompt the user to choose between local and online music -user_choice=$(printf "Play from Online Stations\nPlay from Music Folder\nShuffle Play from Music Folder" | rofi -dmenu -config ~/.config/rofi/config-rofi-Beats-menu.rasi) +user_choice=$(printf "Play from Online Stations\nPlay from Music Folder\nShuffle Play from Music Folder" | rofi -dmenu -config $rofi_theme_1) case "$user_choice" in "Play from Music Folder") diff --git a/config/hypr/UserScripts/RofiCalc.sh b/config/hypr/UserScripts/RofiCalc.sh index cef80b81..4b3b8b69 100755 --- a/config/hypr/UserScripts/RofiCalc.sh +++ b/config/hypr/UserScripts/RofiCalc.sh @@ -3,7 +3,7 @@ # /* Calculator (using qalculate) and rofi */ # /* Submitted by: https://github.com/JosephArmas */ -rofi_config="$HOME/.config/rofi/config-calc.rasi" +rofi_theme="$HOME/.config/rofi/config-calc.rasi" # Kill Rofi if already running before execution if pgrep -x "rofi" >/dev/null; then @@ -15,7 +15,7 @@ fi while true; do result=$( rofi -i -dmenu \ - -config "$rofi_config" \ + -config $rofi_theme \ -mesg "$result = $calc_result" ) diff --git a/config/hypr/UserScripts/WallpaperEffects.sh b/config/hypr/UserScripts/WallpaperEffects.sh index 215fdf6f..2573f5e0 100755 --- a/config/hypr/UserScripts/WallpaperEffects.sh +++ b/config/hypr/UserScripts/WallpaperEffects.sh @@ -8,6 +8,7 @@ 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}') +rofi_theme="~/.config/rofi/config-wallpaper-effect.rasi" # Directory for swaync iDIR="$HOME/.config/swaync/images" @@ -45,9 +46,7 @@ declare -A effects=( # Function to apply no effects no-effects() { swww img -o "$focused_monitor" "$wallpaper_current" $SWWW_PARAMS && - # Wait for swww command to complete wait $! - # Run other commands after swww wallust run "$wallpaper_current" -s && wait $! # Refresh rofi, waybar, wallust palettes @@ -67,7 +66,7 @@ main() { [[ "$effect" != "No Effects" ]] && options+=("$effect") done - choice=$(printf "%s\n" "${options[@]}" | LC_COLLATE=C sort | rofi -dmenu -i -config ~/.config/rofi/config-wallpaper-effect.rasi) + choice=$(printf "%s\n" "${options[@]}" | LC_COLLATE=C sort | rofi -dmenu -i -config $rofi_theme) # Process user choice if [[ -n "$choice" ]]; then @@ -77,16 +76,14 @@ main() { # Apply selected effect notify-send -u normal -i "$iDIR/ja.png" "Applying:" "$choice effects" eval "${effects[$choice]}" - # Wait for effects to be applied + sleep 1 - # Execute swww command after image conversion swww img -o "$focused_monitor" "$wallpaper_output" $SWWW_PARAMS & - # Wait for swww command to complete + sleep 2 - # Wait for other commands to finish + wallust run "$wallpaper_output" -s & - # Wait for other commands to finish - sleep 0.5 + sleep 1 # Refresh rofi, waybar, wallust palettes "${SCRIPTSDIR}/Refresh.sh" notify-send -u low -i "$iDIR/ja.png" "$choice" "effects applied" diff --git a/config/hypr/UserScripts/WallpaperRandom.sh b/config/hypr/UserScripts/WallpaperRandom.sh index 1a5064e7..abaa9b03 100755 --- a/config/hypr/UserScripts/WallpaperRandom.sh +++ b/config/hypr/UserScripts/WallpaperRandom.sh @@ -7,7 +7,7 @@ SCRIPTSDIR="$HOME/.config/hypr/scripts" focused_monitor=$(hyprctl monitors | awk '/^Monitor/{name=$2} /focused: yes/{print name}') -PICS=($(find ${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" \))) +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 19bb145d..86264775 100755 --- a/config/hypr/UserScripts/WallpaperSelect.sh +++ b/config/hypr/UserScripts/WallpaperSelect.sh @@ -13,6 +13,7 @@ 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}') # swww transition config FPS=60 @@ -27,13 +28,13 @@ if pidof swaybg > /dev/null; then fi # Retrieve image files using null delimiter to handle spaces in filenames -mapfile -d '' PICS < <(find "${wallDIR}" -type f \( -iname "*.jpg" -o -iname "*.jpeg" -o -iname "*.pnm" -o -iname "*.tga" -o -iname "*.tiff" -o -iname "*.webp" -o -iname "*.bmp" -o -iname "*.farbfeld" -o -iname "*.png" -o -iname "*.gif" \) -print0) +mapfile -d '' PICS < <(find -L "${wallDIR}" -type f \( -iname "*.jpg" -o -iname "*.jpeg" -o -iname "*.pnm" -o -iname "*.tga" -o -iname "*.tiff" -o -iname "*.webp" -o -iname "*.bmp" -o -iname "*.farbfeld" -o -iname "*.png" -o -iname "*.gif" \) -print0) RANDOM_PIC="${PICS[$((RANDOM % ${#PICS[@]}))]}" RANDOM_PIC_NAME=". random" # Rofi command -rofi_command="rofi -i -show -dmenu -config ~/.config/rofi/config-wallpaper.rasi" +rofi_command="rofi -i -show -dmenu -config $rofi_theme" # Sorting Wallpapers menu() { diff --git a/config/hypr/UserScripts/ZshChangeTheme.sh b/config/hypr/UserScripts/ZshChangeTheme.sh index edfc2ecd..4ff43557 100755 --- a/config/hypr/UserScripts/ZshChangeTheme.sh +++ b/config/hypr/UserScripts/ZshChangeTheme.sh @@ -8,15 +8,16 @@ themes_dir="$HOME/.oh-my-zsh/themes" file_extension=".zsh-theme" -# Directory for swaync +# Variables iDIR="$HOME/.config/swaync/images" +rofi_theme="~/.config/rofi/config-zsh-theme.rasi" -themes_array=($(find "$themes_dir" -type f -name "*$file_extension" -exec basename {} \; | sed -e "s/$file_extension//")) +themes_array=($(find -L "$themes_dir" -type f -name "*$file_extension" -exec basename {} \; | sed -e "s/$file_extension//")) # Add "Random" option to the beginning of the array themes_array=("Random" "${themes_array[@]}") -rofi_command="rofi -i -dmenu -config ~/.config/rofi/config-zsh-theme.rasi" +rofi_command="rofi -i -dmenu -config $rofi_theme" menu() { for theme in "${themes_array[@]}"; do @@ -29,7 +30,6 @@ main() { # if nothing selected, script won't change anything if [ -z "$choice" ]; then - notify-send -u low -i "$iDIR/ja.png" "No theme selected." "No changes made!" exit 0 fi |
