diff options
| author | Ja.KooLit <85185940+JaKooLit@users.noreply.github.com> | 2025-02-23 14:46:19 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-02-23 14:46:19 +0900 |
| commit | 91b9177b0ff5d2fac7b99be9a89f8e9f054347fd (patch) | |
| tree | 5b11da646166995b52bb597cf6a92703d1f5a0a2 /config/hypr/UserScripts/Kool_Quick_Settings.sh | |
| parent | 9f5b41c3e230cda406592167fcd0446a5f56821c (diff) | |
| parent | b8ab57be1c8e579e69e5bfd56668815465d71785 (diff) | |
Merge pull request #577 from JaKooLit/development
Development to main Dots version 2.3.12
Diffstat (limited to 'config/hypr/UserScripts/Kool_Quick_Settings.sh')
| -rwxr-xr-x | config/hypr/UserScripts/Kool_Quick_Settings.sh | 84 |
1 files changed, 84 insertions, 0 deletions
diff --git a/config/hypr/UserScripts/Kool_Quick_Settings.sh b/config/hypr/UserScripts/Kool_Quick_Settings.sh new file mode 100755 index 00000000..88e26089 --- /dev/null +++ b/config/hypr/UserScripts/Kool_Quick_Settings.sh @@ -0,0 +1,84 @@ +#!/bin/bash +# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## +# Rofi menu for Quick Edit/View of Settings (SUPER SHIFT E) + +# Define preferred text editor and terminal +edit=${EDITOR:-nano} +tty=kitty + +# 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" "Missing nwg-displays" "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" "Missing nwg-displays" "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 + $tty -e $edit "$file" + fi +} + +# Check if rofi is already running +if pidof rofi > /dev/null; then + pkill rofi +fi + +main |
