diff options
| author | Ja.KooLit <85185940+JaKooLit@users.noreply.github.com> | 2025-03-08 20:01:00 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-03-08 20:01:00 +0900 |
| commit | 58ff6d436f2180c1bb3ea967636d0715258542a4 (patch) | |
| tree | e0c130bf8479dcfedc79059202a9c4449bc54048 /config/hypr/scripts | |
| parent | 8ead68af4e161693f82e5dcd37118d7a2dac24d5 (diff) | |
| parent | a5530ba1c81a482aa8e77db9bf37aa5894d1fa86 (diff) | |
Merge pull request #605 from JaKooLit/development
Development to main
Diffstat (limited to 'config/hypr/scripts')
| -rwxr-xr-x | config/hypr/scripts/Distro_update.sh | 40 | ||||
| -rwxr-xr-x | config/hypr/scripts/Kool_Quick_Settings.sh | 88 | ||||
| -rwxr-xr-x | config/hypr/scripts/RofiSearch.sh | 23 |
3 files changed, 143 insertions, 8 deletions
diff --git a/config/hypr/scripts/Distro_update.sh b/config/hypr/scripts/Distro_update.sh new file mode 100755 index 00000000..c687ba0c --- /dev/null +++ b/config/hypr/scripts/Distro_update.sh @@ -0,0 +1,40 @@ +#!/bin/bash +# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## +# Simple bash script to check and will try to update your system + +# Local Paths +iDIR="$HOME/.config/swaync/images/ja.png" + +# 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." + exit 1 +fi + +# Detect distribution and update accordingly +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.' + else + kitty -T update yay -Syu + notify-send -i $iDIR -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.' +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.' +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.' +else + # Unsupported distro + notify-send -i $iDIR -u critical "Unsupported system" "This script does not support your distribution." + exit 1 +fi diff --git a/config/hypr/scripts/Kool_Quick_Settings.sh b/config/hypr/scripts/Kool_Quick_Settings.sh new file mode 100755 index 00000000..a09bced6 --- /dev/null +++ b/config/hypr/scripts/Kool_Quick_Settings.sh @@ -0,0 +1,88 @@ +#!/bin/bash +# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## +# Rofi menu for KooL Hyprland Quick Settings (SUPER SHIFT E) + +# Modify this config file for default terminal and EDITOR +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" +# ##################################### # + +# variables +configs="$HOME/.config/hypr/configs" +UserConfigs="$HOME/.config/hypr/UserConfigs" +rofi_theme="$HOME/.config/rofi/config-edit.rasi" +msg=' ⁉️ Choose what to do ⁉️' +iDIR="$HOME/.config/swaync/images" +scriptsDir="$HOME/.config/hypr/scripts" +UserScripts="$HOME/.config/hypr/UserScripts" + +# Function to display the menu options without numbers +menu() { + cat <<EOF +view/edit ENV variables +view/edit Window Rules +view/edit User Keybinds +view/edit User Settings +view/edit Startup Apps +view/edit Decorations +view/edit Animations +view/edit Laptop Keybinds +view/edit Default Keybinds +Configure Monitors (nwg-displays) +Configure Workspace Rules (nwg-displays) +Choose Hyprland Animations +Choose Monitor Profiles +Choose Rofi Themes +Search for Keybinds +EOF +} + +# Main function to handle menu selection +main() { + choice=$(menu | rofi -i -dmenu -config $rofi_theme -mesg "$msg") + + # Map choices to corresponding files + case "$choice" in + "view/edit ENV variables") file="$UserConfigs/ENVariables.conf" ;; + "view/edit Window Rules") file="$UserConfigs/WindowRules.conf" ;; + "view/edit User Keybinds") file="$UserConfigs/UserKeybinds.conf" ;; + "view/edit User Settings") file="$UserConfigs/UserSettings.conf" ;; + "view/edit Startup Apps") file="$UserConfigs/Startup_Apps.conf" ;; + "view/edit Decorations") file="$UserConfigs/UserDecorations.conf" ;; + "view/edit Animations") file="$UserConfigs/UserAnimations.conf" ;; + "view/edit Laptop Keybinds") file="$UserConfigs/Laptops.conf" ;; + "view/edit Default Keybinds") file="$configs/Keybinds.conf" ;; + "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" + 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" + exit 1 + fi + nwg-displays ;; + "Choose Hyprland Animations") $scriptsDir/Animations.sh ;; + "Choose Monitor Profiles") $scriptsDir/MonitorProfiles.sh ;; + "Choose Rofi Themes") $scriptsDir/RofiThemeSelector.sh ;; + "Search for Keybinds") $scriptsDir/KeyBinds.sh ;; + *) return ;; # Do nothing for invalid choices + esac + + # Open the selected file in the terminal with the text editor + if [ -n "$file" ]; then + $term -e $edit "$file" + fi +} + +# Check if rofi is already running +if pidof rofi > /dev/null; then + pkill rofi +fi + +main diff --git a/config/hypr/scripts/RofiSearch.sh b/config/hypr/scripts/RofiSearch.sh index e256253a..e4b4f6af 100755 --- a/config/hypr/scripts/RofiSearch.sh +++ b/config/hypr/scripts/RofiSearch.sh @@ -1,18 +1,25 @@ # /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## -# Modified Script for Google Search -# Original Submitted by https://github.com/LeventKaanOguz +# For Searching via web browsers -# Opens rofi in dmenu mod and waits for input. Then pushes the input to the query of the URL. +# Modify this config file for default search engine +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" +# ##################################### # + +# Rofi theme and message rofi_theme="$HOME/.config/rofi/config-search.rasi" -msg='‼️ **note** ‼️ search via default web browser' +msg='‼️ **note** ‼️ search via default web browser' + # Kill Rofi if already running before execution if pgrep -x "rofi" >/dev/null; then pkill rofi - #exit 0 fi -# Open rofi with a dmenu and pass the selected item to xdg-open for Google search -#echo "" | rofi -dmenu -config "$rofi_config" | xargs -I{} xdg-open "https://www.google.com/search?q={}" +# 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 -echo "" | rofi -dmenu -config $rofi_theme -mesg "$msg" | xargs -I{} xdg-open "https://www.google.com/search?q={}" +# Clean up temporary file after sourcing +rm "$tmp_config_file"
\ No newline at end of file |
