From a11c37353f7e825322fcd3b75a4ab48c55f73874 Mon Sep 17 00:00:00 2001 From: JaKooLit Date: Sat, 1 Feb 2025 00:39:54 +0900 Subject: Moved the animations script in scripts directory. Some Minor tweak on copy.sh. Need to tweak more as its already abit late --- config/hypr/UserScripts/Animations.sh | 35 ----------------------------------- config/hypr/configs/Keybinds.conf | 2 +- config/hypr/scripts/Animations.sh | 35 +++++++++++++++++++++++++++++++++++ copy.sh | 16 ++++++---------- 4 files changed, 42 insertions(+), 46 deletions(-) delete mode 100755 config/hypr/UserScripts/Animations.sh create mode 100755 config/hypr/scripts/Animations.sh diff --git a/config/hypr/UserScripts/Animations.sh b/config/hypr/UserScripts/Animations.sh deleted file mode 100755 index 71368bbe..00000000 --- a/config/hypr/UserScripts/Animations.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash -# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## -# For applying Animations from different users - -# Check if rofi is already running -if pidof rofi > /dev/null; then - pkill rofi -fi - -# Variables -iDIR="$HOME/.config/swaync/images" -SCRIPTSDIR="$HOME/.config/hypr/scripts" -animations_dir="$HOME/.config/hypr/animations" -UserConfigs="$HOME/.config/hypr/UserConfigs" - -# list of animation files -animations_list=$(find "$animations_dir" -maxdepth 1 -type f | sed 's/.*\///' | sed 's/\.conf$//') - -# Rofi Menu -chosen_file=$(echo "$animations_list" | rofi -i -dmenu -config ~/.config/rofi/config-Animations.rasi "Choose animation:") - -# Check if a file was selected -if [[ -n "$chosen_file" ]]; then - # Find the full path of the chosen file - full_path="$animations_dir/$chosen_file.conf" - - cp "$full_path" "$UserConfigs/UserAnimations.conf" - - notify-send -u low -i "$iDIR/ja.png" "$chosen_file" "Animation Loaded" -else - notify-send -u low -i "$iDIR/ja.png" "You chose to" "NOT apply other animations" -fi - -sleep 1 -"$SCRIPTSDIR/RefreshNoWaybar.sh" diff --git a/config/hypr/configs/Keybinds.conf b/config/hypr/configs/Keybinds.conf index feb21707..2ea3bfa3 100644 --- a/config/hypr/configs/Keybinds.conf +++ b/config/hypr/configs/Keybinds.conf @@ -38,7 +38,7 @@ bind = $mainMod SHIFT, W, exec, $UserScripts/WallpaperEffects.sh # Wallpaper Eff bind = CTRL ALT, W, exec, $UserScripts/WallpaperRandom.sh # Random wallpapers bind = $mainMod ALT, O, exec, hyprctl setprop active opaque toggle # disable opacity on active window bind = $mainMod SHIFT, K, exec, $scriptsDir/KeyBinds.sh # search keybinds via rofi -bind = $mainMod SHIFT, A, exec, $UserScripts/Animations.sh #hyprland animations menu +bind = $mainMod SHIFT, A, exec, $scriptsDir/Animations.sh #hyprland animations menu # Waybar / Bar related bind = $mainMod, B, exec, pkill -SIGUSR1 waybar # Toggle hide/show waybar diff --git a/config/hypr/scripts/Animations.sh b/config/hypr/scripts/Animations.sh new file mode 100755 index 00000000..48ac0f85 --- /dev/null +++ b/config/hypr/scripts/Animations.sh @@ -0,0 +1,35 @@ +#!/bin/bash +# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## +# For applying Animations from different users + +# Check if rofi is already running +if pidof rofi > /dev/null; then + pkill rofi +fi + +# Variables +iDIR="$HOME/.config/swaync/images" +SCRIPTSDIR="$HOME/.config/hypr/scripts" +animations_dir="$HOME/.config/hypr/animations" +UserConfigs="$HOME/.config/hypr/UserConfigs" + +# list of animation files +animations_list=$(find "$animations_dir" -maxdepth 1 -type f | sed 's/.*\///' | sed 's/\.conf$//') + +# Rofi Menu +chosen_file=$(echo "$animations_list" | rofi -i -dmenu -config ~/.config/rofi/config-Animations.rasi) + +# Check if a file was selected +if [[ -n "$chosen_file" ]]; then + # Find the full path of the chosen file + full_path="$animations_dir/$chosen_file.conf" + + cp "$full_path" "$UserConfigs/UserAnimations.conf" + + notify-send -u low -i "$iDIR/ja.png" "$chosen_file" "Hyprland Animation Loaded" +else + notify-send -u low -i "$iDIR/ja.png" "You chose NOT" "to apply other Hyprland animations" +fi + +sleep 1 +"$SCRIPTSDIR/RefreshNoWaybar.sh" \ No newline at end of file diff --git a/copy.sh b/copy.sh index 5b387095..3942e23f 100755 --- a/copy.sh +++ b/copy.sh @@ -72,7 +72,7 @@ fi # Proper Polkit for NixOS if hostnamectl | grep -q 'Operating System: NixOS'; then - echo "You Distro is NixOS. Setting up properly." 2>&1 | tee -a "$LOG" || true + echo "NixOS Distro Detected. Setting up properly." 2>&1 | tee -a "$LOG" || true sed -i -E '/^#?exec-once = \$scriptsDir\/Polkit-NixOS\.sh/s/^#//' config/hypr/UserConfigs/Startup_Apps.conf sed -i '/^exec-once = \$scriptsDir\/Polkit\.sh$/ s/^#*/#/' config/hypr/UserConfigs/Startup_Apps.conf fi @@ -86,7 +86,6 @@ fi # activating hyprcursor on env by checking if the directory ~/.icons/Bibata-Modern-Ice/hyprcursors exists if [ -d "$HOME/.icons/Bibata-Modern-Ice/hyprcursors" ]; then - # Define the config file path HYPRCURSOR_ENV_FILE="config/hypr/UserConfigs/ENVariables.conf" sed -i 's/^#env = HYPRCURSOR_THEME,Bibata-Modern-Ice/env = HYPRCURSOR_THEME,Bibata-Modern-Ice/' "$HYPRCURSOR_ENV_FILE" @@ -155,7 +154,6 @@ while true; do case $keyboard_layout in [yY]) - # If the detected layout is correct, update the 'kb_layout =' line in the file awk -v layout="$layout" '/kb_layout/ {$0 = " kb_layout = " layout} 1' config/hypr/UserConfigs/UserSettings.conf > temp.conf mv temp.conf config/hypr/UserConfigs/UserSettings.conf @@ -186,8 +184,7 @@ NOTE: printf "\n%.0s" {1..1} read -p "${CAT} - Please enter the correct keyboard layout: " new_layout - - # Update the 'kb_layout =' line with the correct layout in the file + awk -v new_layout="$new_layout" '/kb_layout/ {$0 = " kb_layout = " new_layout} 1' config/hypr/UserConfigs/UserSettings.conf > temp.conf mv temp.conf config/hypr/UserConfigs/UserSettings.conf echo "${OK} kb_layout $new_layout configured in settings." 2>&1 | tee -a "$LOG" @@ -284,7 +281,7 @@ if [ "$resolution" == "< 1440p" ]; then sed -i 's/font_size 16.0/font_size 12.0/' config/kitty/kitty.conf # hyprlock matters - mv config/hypr/hyprlock.conf config/hypr/hyprlock-2k.conf + mv config/hypr/hyprlock.conf config/hypr/hyprlock-2k.conf && mv config/hypr/hyprlock-1080p.conf config/hypr/hyprlock.conf elif [ "$resolution" == "≥ 1440p" ]; then @@ -295,16 +292,15 @@ printf "\n" # Ask whether to change to 12hr format while true; do - echo -e "$MAGENTA By default, configs are in 24H format." - read -p "$CAT Do you want to change to 12H format (AM/PM)? (y/n): " answer + echo -e "$MAGENTA By default, KooL's Dots are configured in 24H clock format." + read -p "$CAT Do you want to change to 12H format or AM/PM format? (y/n): " answer # Convert the answer to lowercase for comparison answer=$(echo "$answer" | tr '[:upper:]' '[:lower:]') # Check if the answer is valid if [[ "$answer" == "y" ]]; then - # Modify waybar config if 12hr is selected - + # Modify waybar clock modules if 12hr is selected # Clock 1 sed -i 's#^\(\s*\)//\("format": " {:%I:%M %p}",\) #\1\2 #g' config/waybar/Modules 2>&1 | tee -a "$LOG" sed -i 's#^\(\s*\)\("format": " {:%H:%M:%S}",\) #\1//\2#g' config/waybar/Modules 2>&1 | tee -a "$LOG" -- cgit v1.2.3