diff options
| author | Ja.KooLit <85185940+JaKooLit@users.noreply.github.com> | 2025-03-24 14:22:56 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-03-24 14:22:56 +0900 |
| commit | a3c975e70db5a914646cd58d58062193d025cb1b (patch) | |
| tree | 733159945f72b385944499dbae5977afc792f300 /config/hypr/scripts | |
| parent | c1f0fc471b082f59aae939c3343312e09320ca36 (diff) | |
| parent | 093e599a3411eaf3db6ebee31b8c91f8bc9e2faf (diff) | |
Merge pull request #645 from JaKooLit/development
Development to main
Diffstat (limited to 'config/hypr/scripts')
| -rwxr-xr-x | config/hypr/scripts/ChangeBlur.sh | 6 | ||||
| -rwxr-xr-x | config/hypr/scripts/Distro_update.sh | 16 | ||||
| -rwxr-xr-x | config/hypr/scripts/Kitty_themes.sh | 45 | ||||
| -rwxr-xr-x | config/hypr/scripts/KooLsDotsUpdate.sh | 16 | ||||
| -rwxr-xr-x | config/hypr/scripts/Kool_Quick_Settings.sh | 12 | ||||
| -rwxr-xr-x | config/hypr/scripts/Refresh.sh | 3 | ||||
| -rwxr-xr-x | config/hypr/scripts/RefreshNoWaybar.sh | 3 | ||||
| -rwxr-xr-x | config/hypr/scripts/RofiSearch.sh | 30 | ||||
| -rwxr-xr-x | config/hypr/scripts/ScreenShot.sh | 14 | ||||
| -rwxr-xr-x | config/hypr/scripts/WaybarScripts.sh | 41 |
10 files changed, 148 insertions, 38 deletions
diff --git a/config/hypr/scripts/ChangeBlur.sh b/config/hypr/scripts/ChangeBlur.sh index 46aaad68..895987a4 100755 --- a/config/hypr/scripts/ChangeBlur.sh +++ b/config/hypr/scripts/ChangeBlur.sh @@ -2,16 +2,16 @@ # /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## # Script for changing blurs on the fly -notif="$HOME/.config/swaync/images/ja.png" +notif="$HOME/.config/swaync/images" STATE=$(hyprctl -j getoption decoration:blur:passes | jq ".int") if [ "${STATE}" == "2" ]; then hyprctl keyword decoration:blur:size 2 hyprctl keyword decoration:blur:passes 1 - notify-send -e -u low -i "$notif" " Less Blur" + notify-send -e -u low -i "$notif/note.png" " Less Blur" else hyprctl keyword decoration:blur:size 5 hyprctl keyword decoration:blur:passes 2 - notify-send -e -u low -i "$notif" " Normal Blur" + notify-send -e -u low -i "$notif/ja.png" " Normal Blur" fi diff --git a/config/hypr/scripts/Distro_update.sh b/config/hypr/scripts/Distro_update.sh index c687ba0c..b0b1446b 100755 --- a/config/hypr/scripts/Distro_update.sh +++ b/config/hypr/scripts/Distro_update.sh @@ -3,11 +3,11 @@ # Simple bash script to check and will try to update your system # Local Paths -iDIR="$HOME/.config/swaync/images/ja.png" +iDIR="$HOME/.config/swaync/images" # Check for required tools (kitty) if ! command -v kitty &> /dev/null; then - notify-send -i $iDIR "Need Kitty:" "Kitty terminal not found. Please install Kitty terminal." + notify-send -i "$iDIR/error.png" "Need Kitty:" "Kitty terminal not found. Please install Kitty terminal." exit 1 fi @@ -16,25 +16,25 @@ if command -v paru &> /dev/null || command -v yay &> /dev/null; then # Arch-based if command -v paru &> /dev/null; then kitty -T update paru -Syu - notify-send -i $iDIR -u low 'Arch-based system' 'has been updated.' + notify-send -i "$iDIR/ja.png" -u low 'Arch-based system' 'has been updated.' else kitty -T update yay -Syu - notify-send -i $iDIR -u low 'Arch-based system' 'has been updated.' + notify-send -i "$iDIR/ja.png" -u low 'Arch-based system' 'has been updated.' fi elif command -v dnf &> /dev/null; then # Fedora-based kitty -T update sudo dnf update --refresh -y - notify-send -i $iDIR -u low 'Fedora system' 'has been updated.' + notify-send -i "$iDIR/ja.png" -u low 'Fedora system' 'has been updated.' elif command -v apt &> /dev/null; then # Debian-based (Debian, Ubuntu, etc.) kitty -T update sudo apt update && sudo apt upgrade -y - notify-send -i $iDIR -u low 'Debian/Ubuntu system' 'has been updated.' + notify-send -i "$iDIR/ja.png" -u low 'Debian/Ubuntu system' 'has been updated.' elif command -v zypper &> /dev/null; then # openSUSE-based kitty -T update sudo zypper dup -y - notify-send -i $iDIR -u low 'openSUSE system' 'has been updated.' + notify-send -i "$iDIR/ja.png" -u low 'openSUSE system' 'has been updated.' else # Unsupported distro - notify-send -i $iDIR -u critical "Unsupported system" "This script does not support your distribution." + notify-send -i "$iDIR/error.png" -u critical "Unsupported system" "This script does not support your distribution." exit 1 fi diff --git a/config/hypr/scripts/Kitty_themes.sh b/config/hypr/scripts/Kitty_themes.sh new file mode 100755 index 00000000..31c19a1d --- /dev/null +++ b/config/hypr/scripts/Kitty_themes.sh @@ -0,0 +1,45 @@ +#!/bin/bash +# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ # +# Kitty Themes Source https://github.com/dexpota/kitty-themes # + +# Define directories and variables +kitty_themes_DiR="$HOME/.config/kitty/kitty-themes" # Kitty Themes Directory +theme_path="$kitty_themes_DiR/$theme.conf" +kitty_config="$HOME/.config/kitty/kitty.conf" +iDIR="$HOME/.config/swaync/images" +rofi_theme="$HOME/.config/rofi/config-kitty-theme.rasi" + +# Check if the Kitty Themes directory exists +if [ ! -d "$kitty_themes_DiR" ]; then + notify-send -i "$iDIR/error.png" "E-R-R-O-R" "Unable to locate Kitty Themes directory. Exiting....." + exit 1 +fi + +# List the kitty-theme files from the themes directory +theme=$(ls "$kitty_themes_DiR"/*.conf | xargs -n 1 basename | sed 's/\.conf$//' | rofi -dmenu -config $rofi_theme) + +# Check if no theme was selected, and exit if empty +if [ -z "$theme" ]; then + notify-send -u low -i "$iDIR/note.png" "No kitty theme" "selected. Exiting....." + exit 1 +fi + +# Uncomment the line that includes the kitty themes if it's commented +if grep -q '#include ./kitty-themes/' "$kitty_config"; then + sed -i "s|#include ./kitty-themes/|include ./kitty-themes/$theme.conf|g" "$kitty_config" + + notify-send -u low -i "$iDIR/ja.png" "$theme" "Kitty Theme Loaded" + + for pid_kitty in $(pidof kitty); do + kill -SIGUSR1 "$pid_kitty" + done +else + # If the line is already uncommented, just add the chosen theme + sed -i "s|include ./kitty-themes/.*|include ./kitty-themes/$theme.conf|g" "$kitty_config" + + notify-send -u low -i "$iDIR/ja.png" "$theme" "Kitty Theme Loaded" + + for pid_kitty in $(pidof kitty); do + kill -SIGUSR1 "$pid_kitty" + done +fi diff --git a/config/hypr/scripts/KooLsDotsUpdate.sh b/config/hypr/scripts/KooLsDotsUpdate.sh index 4996da82..f4b8814a 100755 --- a/config/hypr/scripts/KooLsDotsUpdate.sh +++ b/config/hypr/scripts/KooLsDotsUpdate.sh @@ -4,13 +4,13 @@ # Local Paths local_dir="$HOME/.config/hypr" -iDIR="$HOME/.config/swaync/images/ja.png" +iDIR="$HOME/.config/swaync/images/" local_version=$(ls $local_dir/v* 2>/dev/null | sort -V | tail -n 1 | sed 's/.*v\(.*\)/\1/') KooL_Dots_DIR="$HOME/Hyprland-Dots" # exit if cannot find local version if [ -z "$local_version" ]; then - notify-send -i $iDIR "ERROR "!?!?!!"" "Unable to find KooL's dots version . exiting.... " + notify-send -i "$iDIR/error.png" "ERROR "!?!?!!"" "Unable to find KooL's dots version . exiting.... " exit 1 fi @@ -28,12 +28,12 @@ fi # Comparing local and github versions if [ "$(echo -e "$github_version\n$local_version" | sort -V | head -n 1)" = "$github_version" ]; then - notify-send -i $iDIR "KooL Hyprland:" "No update available" + notify-send -i "$iDIR/note.png" "KooL Hyprland:" "No update available" exit 0 else # update available notify_cmd_base="notify-send -t 10000 -A action1=Update -A action2=NO -h string:x-canonical-private-synchronous:shot-notify" - notify_cmd_shot="${notify_cmd_base} -i $iDIR" + notify_cmd_shot="${notify_cmd_base} -i $iDIR/ja.png" response=$($notify_cmd_shot "KooL Hyprland:" "Update available! Update now?") @@ -41,7 +41,7 @@ else "action1") if [ -d $KooL_Dots_DIR ]; then if ! command -v kitty &> /dev/null; then - notify-send -i $iDIR "Need Kitty:" "Kitty terminal not found. Please install Kitty terminal." + notify-send -i "$iDIR/error.png" "E-R-R-O-R" "Kitty terminal not found. Please install Kitty terminal." exit 1 fi kitty -e bash -c " @@ -49,12 +49,12 @@ else git stash && git pull && ./copy.sh && - notify-send -u critical -i $iDIR 'Update Completed:' 'Kindly log out and relogin to take effect' + notify-send -u critical -i "$iDIR/ja.png" 'Update Completed:' 'Kindly log out and relogin to take effect' " else if ! command -v kitty &> /dev/null; then - notify-send -i $iDIR "Need Kitty:" "Kitty terminal not found. Please install Kitty terminal." + notify-send -i "$iDIR/error.png" "E-R-R-O-R" "Kitty terminal not found. Please install Kitty terminal." exit 1 fi kitty -e bash -c " @@ -62,7 +62,7 @@ else cd $KooL_Dots_DIR && chmod +x copy.sh && ./copy.sh && - notify-send -u critical -i $iDIR 'Update Completed:' 'Kindly log out and relogin to take effect' + notify-send -u critical -i "$iDIR/ja.png" 'Update Completed:' 'Kindly log out and relogin to take effect' " fi ;; diff --git a/config/hypr/scripts/Kool_Quick_Settings.sh b/config/hypr/scripts/Kool_Quick_Settings.sh index cee44c8f..e43749bf 100755 --- a/config/hypr/scripts/Kool_Quick_Settings.sh +++ b/config/hypr/scripts/Kool_Quick_Settings.sh @@ -32,6 +32,7 @@ view/edit Decorations view/edit Animations view/edit Laptop Keybinds view/edit Default Keybinds +Choose Kitty Terminal Theme Configure Monitors (nwg-displays) Configure Workspace Rules (nwg-displays) GTK Settings (nwg-look) @@ -62,33 +63,34 @@ main() { "view/edit Animations") file="$UserConfigs/UserAnimations.conf" ;; "view/edit Laptop Keybinds") file="$UserConfigs/Laptops.conf" ;; "view/edit Default Keybinds") file="$configs/Keybinds.conf" ;; + "Choose Kitty Terminal Theme") $scriptsDir/Kitty_themes.sh ;; "Configure Monitors (nwg-displays)") if ! command -v nwg-displays &>/dev/null; then - notify-send -i "$iDIR/ja.png" "E-R-R-O-R" "Install nwg-displays first" + notify-send -i "$iDIR/error.png" "E-R-R-O-R" "Install nwg-displays first" exit 1 fi nwg-displays ;; "Configure Workspace Rules (nwg-displays)") if ! command -v nwg-displays &>/dev/null; then - notify-send -i "$iDIR/ja.png" "E-R-R-O-R" "Install nwg-displays first" + notify-send -i "$iDIR/error.png" "E-R-R-O-R" "Install nwg-displays first" exit 1 fi nwg-displays ;; "GTK Settings (nwg-look)") if ! command -v nwg-look &>/dev/null; then - notify-send -i "$iDIR/ja.png" "E-R-R-O-R" "Install nwg-look first" + notify-send -i "$iDIR/error.png" "E-R-R-O-R" "Install nwg-look first" exit 1 fi nwg-look ;; "QT Apps Settings (qt6ct)") if ! command -v qt6ct &>/dev/null; then - notify-send -i "$iDIR/ja.png" "E-R-R-O-R" "Install qt6ct first" + notify-send -i "$iDIR/error.png" "E-R-R-O-R" "Install qt6ct first" exit 1 fi qt6ct ;; "QT Apps Settings (qt5ct)") if ! command -v qt5ct &>/dev/null; then - notify-send -i "$iDIR/ja.png" "E-R-R-O-R" "Install qt5ct first" + notify-send -i "$iDIR/error.png" "E-R-R-O-R" "Install qt5ct first" exit 1 fi qt5ct ;; diff --git a/config/hypr/scripts/Refresh.sh b/config/hypr/scripts/Refresh.sh index 3bd22463..2d7887a5 100755 --- a/config/hypr/scripts/Refresh.sh +++ b/config/hypr/scripts/Refresh.sh @@ -24,7 +24,6 @@ done # added since wallust sometimes not applying killall -SIGUSR2 waybar -killall -SIGUSR2 swaync # quit ags & relaunch ags #ags -q && ags & @@ -41,6 +40,8 @@ waybar & # relaunch swaync sleep 0.5 swaync > /dev/null 2>&1 & +# reload swaync +swaync-client --reload-config # Relaunching rainbow borders if the script exists sleep 1 diff --git a/config/hypr/scripts/RefreshNoWaybar.sh b/config/hypr/scripts/RefreshNoWaybar.sh index 85332a32..e5a0835e 100755 --- a/config/hypr/scripts/RefreshNoWaybar.sh +++ b/config/hypr/scripts/RefreshNoWaybar.sh @@ -31,6 +31,9 @@ done # Wallust refresh ${SCRIPTSDIR}/WallustSwww.sh & +# reload swaync +swaync-client --reload-config + # Relaunching rainbow borders if the script exists sleep 1 if file_exists "${UserScripts}/RainbowBorders.sh"; then diff --git a/config/hypr/scripts/RofiSearch.sh b/config/hypr/scripts/RofiSearch.sh index aa20546d..4218bed3 100755 --- a/config/hypr/scripts/RofiSearch.sh +++ b/config/hypr/scripts/RofiSearch.sh @@ -2,13 +2,26 @@ # /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## # For Searching via web browsers -# Modify this config file for default search engine -config_file="$HOME/.config/hypr/UserConfigs/01-UserDefaults.conf" +# Define the path to the config file +config_file=$HOME/.config/hypr/UserConfigs/01-UserDefaults.conf -tmp_config_file=$(mktemp) -sed 's/^\$//g; s/ = /=/g' "$config_file" > "$tmp_config_file" -source "$tmp_config_file" -# ##################################### # +# Check if the config file exists +if [[ ! -f "$config_file" ]]; then + echo "Error: Configuration file not found!" + exit 1 +fi + +# Process the config file in memory, removing the $ and fixing spaces +config_content=$(sed 's/\$//g' "$config_file" | sed 's/ = /=/') + +# Source the modified content directly from the variable +eval "$config_content" + +# Check if $term is set correctly +if [[ -z "$Search_Engine" ]]; then + echo "Error: \$Search_Engine is not set in the configuration file!" + exit 1 +fi # Rofi theme and message rofi_theme="$HOME/.config/rofi/config-search.rasi" @@ -20,7 +33,4 @@ if pgrep -x "rofi" >/dev/null; then fi # Open Rofi and pass the selected query to xdg-open for Google search -echo "" | rofi -dmenu -config "$rofi_theme" -mesg "$msg" | xargs -I{} xdg-open $Search_Engine - -# Clean up temporary file after sourcing -rm "$tmp_config_file"
\ No newline at end of file +echo "" | rofi -dmenu -config "$rofi_theme" -mesg "$msg" | xargs -I{} xdg-open $Search_Engine
\ No newline at end of file diff --git a/config/hypr/scripts/ScreenShot.sh b/config/hypr/scripts/ScreenShot.sh index 852be4b0..90e2dfd2 100755 --- a/config/hypr/scripts/ScreenShot.sh +++ b/config/hypr/scripts/ScreenShot.sh @@ -18,7 +18,7 @@ active_window_path="${dir}/${active_window_file}" notify_cmd_base="notify-send -t 10000 -A action1=Open -A action2=Delete -h string:x-canonical-private-synchronous:shot-notify" notify_cmd_shot="${notify_cmd_base} -i ${iDIR}/picture.png " notify_cmd_shot_win="${notify_cmd_base} -i ${iDIR}/picture.png " -notify_cmd_NOT="notify-send -u low -i ${iDoR}/ja.png " +notify_cmd_NOT="notify-send -u low -i ${iDoR}/note.png " # notify and view screenshot notify_view() { @@ -109,6 +109,8 @@ shotwin() { shotarea() { tmpfile=$(mktemp) grim -g "$(slurp)" - >"$tmpfile" + + # Copy with saving if [[ -s "$tmpfile" ]]; then wl-copy <"$tmpfile" mv "$tmpfile" "$dir/$file" @@ -128,7 +130,13 @@ shotactive() { shotswappy() { tmpfile=$(mktemp) - grim -g "$(slurp)" - >"$tmpfile" && notify_view "swappy" + grim -g "$(slurp)" - >"$tmpfile" + + # Copy without saving + if [[ -s "$tmpfile" ]]; then + wl-copy <"$tmpfile" + notify_view "swappy" + fi } if [[ ! -d "$dir" ]]; then @@ -153,4 +161,4 @@ else echo -e "Available Options : --now --in5 --in10 --win --area --active --swappy" fi -exit 0
\ No newline at end of file +exit 0 diff --git a/config/hypr/scripts/WaybarScripts.sh b/config/hypr/scripts/WaybarScripts.sh new file mode 100755 index 00000000..32b43f02 --- /dev/null +++ b/config/hypr/scripts/WaybarScripts.sh @@ -0,0 +1,41 @@ +#!/bin/bash +# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ # +# This file used on waybar modules sourcing defaults set in $HOME/.config/hypr/UserConfigs/01-UserDefaults.conf + +# Define the path to the config file +config_file=$HOME/.config/hypr/UserConfigs/01-UserDefaults.conf + +# Check if the config file exists +if [[ ! -f "$config_file" ]]; then + echo "Error: Configuration file not found!" + exit 1 +fi + +# Process the config file in memory, removing the $ and fixing spaces +config_content=$(sed 's/\$//g' "$config_file" | sed 's/ = /=/') + +# Source the modified content directly from the variable +eval "$config_content" + +# Check if $term is set correctly +if [[ -z "$term" ]]; then + echo "Error: \$term is not set in the configuration file!" + exit 1 +fi + +# Execute accordingly based on the passed argument +if [[ "$1" == "--btop" ]]; then + $term --title btop sh -c 'btop' +elif [[ "$1" == "--nvtop" ]]; then + $term --title nvtop sh -c 'nvtop' +elif [[ "$1" == "--nmtui" ]]; then + $term nmtui +elif [[ "$1" == "--term" ]]; then + $term & +else + echo "Usage: $0 [--btop | --nvtop | --nmtui | --term]" + echo "--btop : Open btop in a new term" + echo "--nvtop : Open nvtop in a new term" + echo "--nmtui : Open nmtui in a new term" + echo "--term : Launch a term window" +fi |
