From f72311190587d83ce58a525db3b7af1adcb2fc13 Mon Sep 17 00:00:00 2001 From: JaKooLit Date: Sat, 1 Mar 2025 02:43:02 +0900 Subject: Introduction of using a separate file for Default apps, terminals, file managers, search engines... --- config/hypr/scripts/Kool_Quick_Settings.sh | 88 ++++++++++++++++++++++++++++++ config/hypr/scripts/RofiSearch.sh | 23 +++++--- 2 files changed, 103 insertions(+), 8 deletions(-) create mode 100755 config/hypr/scripts/Kool_Quick_Settings.sh (limited to 'config/hypr/scripts') 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 </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 -- cgit v1.2.3