#!/usr/bin/env bash # /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## # Rofi menu for KooL Hyprland Quick Settings (SUPER SHIFT E) # Updated for UserConfigs/configs separation # 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 show info notification show_info() { notify-send -i "$iDIR/info.png" "Info" "$1" } # Function to toggle Rainbow Borders script availability and refresh UI components toggle_rainbow_borders() { local rainbow_script="$UserScripts/RainbowBorders.sh" local disabled_sh_bak="${rainbow_script}.bak" # RainbowBorders.sh.bak local disabled_bak_sh="$UserScripts/RainbowBorders.bak.sh" # RainbowBorders.bak.sh (created by copy.sh when disabled) local refresh_script="$scriptsDir/Refresh.sh" local status="" # If both disabled variants exist, keep the newer one to avoid ambiguity if [[ -f "$disabled_sh_bak" && -f "$disabled_bak_sh" ]]; then if [[ "$disabled_sh_bak" -nt "$disabled_bak_sh" ]]; then rm -f "$disabled_bak_sh" else rm -f "$disabled_sh_bak" fi fi if [[ -f "$rainbow_script" ]]; then # Currently enabled -> disable to canonical .sh.bak if mv "$rainbow_script" "$disabled_sh_bak"; then status="disabled" if command -v hyprctl &>/dev/null; then hyprctl reload >/dev/null 2>&1 || true fi fi elif [[ -f "$disabled_sh_bak" ]]; then # Disabled (.sh.bak) -> enable if mv "$disabled_sh_bak" "$rainbow_script"; then status="enabled" fi elif [[ -f "$disabled_bak_sh" ]]; then # Disabled (.bak.sh) -> enable (normalize to .sh) if mv "$disabled_bak_sh" "$rainbow_script"; then status="enabled" fi else show_info "RainbowBorders script not found in $UserScripts (checked .sh, .sh.bak, .bak.sh)." return fi # Run refresh if available if [[ -x "$refresh_script" ]]; then "$refresh_script" >/dev/null 2>&1 & fi if [[ -n "$status" ]]; then show_info "Rainbow Borders ${status}." fi } # Function to display the menu options without numbers menu() { cat </dev/null; then 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/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/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/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/error.png" "E-R-R-O-R" "Install qt5ct first" exit 1 fi qt5ct ;; "Choose Hyprland Animations") $scriptsDir/Animations.sh ;; "Choose Monitor Profiles") $scriptsDir/MonitorProfiles.sh ;; "Choose Rofi Themes") $scriptsDir/RofiThemeSelector.sh ;; "Search for Keybinds") $scriptsDir/KeyBinds.sh ;; "Toggle Game Mode") $scriptsDir/GameMode.sh ;; "Switch Dark-Light Theme") $scriptsDir/DarkLight.sh ;; "Toggle Rainbow Borders") toggle_rainbow_borders ;; *) 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