From 48e4428bfa5cb99d4e0a9aab055b24a9f1520d70 Mon Sep 17 00:00:00 2001 From: JaKooLit Date: Thu, 27 Feb 2025 12:05:27 +0900 Subject: added support for other distros on waybar update button. NOTE: untested still on --- config/hypr/scripts/Distro_update.sh | 40 ++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100755 config/hypr/scripts/Distro_update.sh (limited to 'config/hypr/scripts') 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 -- cgit v1.2.3 From 1ef38b49ef2cd2b4e578bc55759906620347c717 Mon Sep 17 00:00:00 2001 From: JaKooLit Date: Thu, 27 Feb 2025 23:10:45 +0900 Subject: returning my old wlogout style :) --- config/hypr/scripts/KeyHints.sh | 1 - config/hypr/scripts/Wlogout.sh | 57 +++++++++++++++++++++++++++++++++++++++-- config/wlogout/style.css | 16 +++++------- 3 files changed, 61 insertions(+), 13 deletions(-) (limited to 'config/hypr/scripts') diff --git a/config/hypr/scripts/KeyHints.sh b/config/hypr/scripts/KeyHints.sh index 973ca6b6..2bab4b38 100755 --- a/config/hypr/scripts/KeyHints.sh +++ b/config/hypr/scripts/KeyHints.sh @@ -67,7 +67,6 @@ GDK_BACKEND=$BACKEND yad \ " CTRL Shift R" "Rofi Themes Menu v2" "Choose Rofi Themes via Theme Selector (modified)" \ " SHIFT G" "Gamemode! All animations OFF or ON" "toggle" \ " ALT E" "Rofi Emoticons" "Emoticon" \ -" ALT V" "Clipboard Manager" "cliphist" \ " H" "Launch this Quick Cheat Sheet" "" \ "" "" "" \ "More tips:" "https://github.com/JaKooLit/Hyprland-Dots/wiki" ""\ \ No newline at end of file diff --git a/config/hypr/scripts/Wlogout.sh b/config/hypr/scripts/Wlogout.sh index 3f83e51f..f552b83d 100755 --- a/config/hypr/scripts/Wlogout.sh +++ b/config/hypr/scripts/Wlogout.sh @@ -1,4 +1,57 @@ #!/bin/bash -# /* ----------- 💫 https://github.com/JaKooLit 💫 -------- */ # +# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## +# wlogout (Power, Screen Lock, Suspend, etc) -wlogout -p layer-shell -b 3 -c 2 \ No newline at end of file +# Set variables for parameters. First numbers corresponts to Monitor Resolution +# i.e 2160 means 2160p +A_2160=600 +B_2160=600 +A_1600=400 +B_1600=400 +A_1440=400 +B_1440=400 +A_1080=200 +B_1080=200 +A_720=50 +B_720=50 + +# Check if wlogout is already running +if pgrep -x "wlogout" > /dev/null; then + pkill -x "wlogout" + exit 0 +fi + +# Detect monitor resolution and scaling factor +resolution=$(hyprctl -j monitors | jq -r '.[] | select(.focused==true) | .height / .scale' | awk -F'.' '{print $1}') +hypr_scale=$(hyprctl -j monitors | jq -r '.[] | select(.focused==true) | .scale') + +# Set parameters based on screen resolution and scaling factor +if ((resolution >= 2160)); then + T_val=$(awk "BEGIN {printf \"%.0f\", $A_2160 * 2160 * $hypr_scale / $resolution}") + B_val=$(awk "BEGIN {printf \"%.0f\", $B_2160 * 2160 * $hypr_scale / $resolution}") + echo "Setting parameters for resolution >= 4k" + wlogout --protocol layer-shell -b 6 -T $T_val -B $B_val & +elif ((resolution >= 1600 && resolution < 2160)); then + T_val=$(awk "BEGIN {printf \"%.0f\", $A_1600 * 1600 * $hypr_scale / $resolution}") + B_val=$(awk "BEGIN {printf \"%.0f\", $B_1600 * 1600 * $hypr_scale / $resolution}") + echo "Setting parameters for resolution >= 2.5k and < 4k" + wlogout --protocol layer-shell -b 6 -T $T_val -B $B_val & +elif ((resolution >= 1440 && resolution < 1600)); then + T_val=$(awk "BEGIN {printf \"%.0f\", $A_1440 * 1440 * $hypr_scale / $resolution}") + B_val=$(awk "BEGIN {printf \"%.0f\", $B_1440 * 1440 * $hypr_scale / $resolution}") + echo "Setting parameters for resolution >= 2k and < 2.5k" + wlogout --protocol layer-shell -b 6 -T $T_val -B $B_val & +elif ((resolution >= 1080 && resolution < 1440)); then + T_val=$(awk "BEGIN {printf \"%.0f\", $A_1080 * 1080 * $hypr_scale / $resolution}") + B_val=$(awk "BEGIN {printf \"%.0f\", $B_1080 * 1080 * $hypr_scale / $resolution}") + echo "Setting parameters for resolution >= 1080p and < 2k" + wlogout --protocol layer-shell -b 6 -T $T_val -B $B_val & +elif ((resolution >= 720 && resolution < 1080)); then + T_val=$(awk "BEGIN {printf \"%.0f\", $A_720 * 720 * $hypr_scale / $resolution}") + B_val=$(awk "BEGIN {printf \"%.0f\", $B_720 * 720 * $hypr_scale / $resolution}") + echo "Setting parameters for resolution >= 720p and < 1080p" + wlogout --protocol layer-shell -b 3 -T $T_val -B $B_val & +else + echo "Setting default parameters" + wlogout & +fi diff --git a/config/wlogout/style.css b/config/wlogout/style.css index b8341e9a..ce227160 100644 --- a/config/wlogout/style.css +++ b/config/wlogout/style.css @@ -5,17 +5,15 @@ @import '../../.config/waybar/wallust/colors-waybar.css'; window { - font-family: "FantasqueSansM Nerd Font Mono Bold"; font-size: 24pt; color: @foreground; /* text */ - background-color: rgba(30, 30, 46, 0.6); + background-color: rgba(30, 30, 46, 0.8); } button { - margin: 20px; background-repeat: no-repeat; background-position: center; - background-size: 30%; + background-size: 20%; background-color: rgba(200, 220, 255, 0); animation: gradient_f 10s ease-in infinite; transition: all 0.3s cubic-bezier(.55, 0.0, .28, 1.682), box-shadow 0.2s ease-in-out, background-color 0.2s ease-in-out; @@ -24,19 +22,17 @@ button { } button:focus { - background-size: 40%; + background-size: 50%; border: 0px; - border-radius: 80px; } button:hover { background-color: transparent; - color: @color11; - background-size: 40%; - margin: -20px; + color: @color13; + background-size: 50%; + margin: 30px; border-radius: 80px; - /*box-shadow: 0 0 30px @color7;*/ } -- cgit v1.2.3 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/UserConfigs/01-UserDefaults.conf | 18 ++++++ config/hypr/UserScripts/Kool_Quick_Settings.sh | 84 ------------------------ config/hypr/configs/Keybinds.conf | 2 + config/hypr/scripts/Kool_Quick_Settings.sh | 88 ++++++++++++++++++++++++++ config/hypr/scripts/RofiSearch.sh | 23 ++++--- copy.sh | 3 +- 6 files changed, 125 insertions(+), 93 deletions(-) create mode 100644 config/hypr/UserConfigs/01-UserDefaults.conf delete mode 100755 config/hypr/UserScripts/Kool_Quick_Settings.sh create mode 100755 config/hypr/scripts/Kool_Quick_Settings.sh (limited to 'config/hypr/scripts') diff --git a/config/hypr/UserConfigs/01-UserDefaults.conf b/config/hypr/UserConfigs/01-UserDefaults.conf new file mode 100644 index 00000000..fcd45b74 --- /dev/null +++ b/config/hypr/UserConfigs/01-UserDefaults.conf @@ -0,0 +1,18 @@ +# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ # + +# This is a file where you put your own default apps, default search Engine etc + +# Set your default editor here +#env = EDITOR,vim #default editor + +# Define preferred text editor for the KooL Quick Settings Menu (SUPER SHIFT E) +$edit=${EDITOR:-nano} + +# Terminal +$term = kitty + +# File Manager +$files = thunar + +# Default Search Engine +$Search_Engine = "https://www.google.com/search?q={}" \ No newline at end of file diff --git a/config/hypr/UserScripts/Kool_Quick_Settings.sh b/config/hypr/UserScripts/Kool_Quick_Settings.sh deleted file mode 100755 index 7b41512e..00000000 --- a/config/hypr/UserScripts/Kool_Quick_Settings.sh +++ /dev/null @@ -1,84 +0,0 @@ -#!/bin/bash -# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## -# Rofi menu for KooL Hyprland Quick 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 </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 - $tty -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/configs/Keybinds.conf b/config/hypr/configs/Keybinds.conf index 4ad8e7ca..9a754929 100644 --- a/config/hypr/configs/Keybinds.conf +++ b/config/hypr/configs/Keybinds.conf @@ -9,6 +9,8 @@ $scriptsDir = $HOME/.config/hypr/scripts $UserConfigs = $HOME/.config/hypr/UserConfigs $UserScripts = $HOME/.config/hypr/UserScripts +bind = $mainMod SHIFT, E, exec, $scriptsDir/Kool_Quick_Settings.sh # Settings Menu KooL Hyprland Settings + bind = CTRL ALT, Delete, exec, hyprctl dispatch exit 0 bind = $mainMod, Q, killactive, #kill bind = $mainMod SHIFT, Q, exec, $scriptsDir/KillActiveProcess.sh # Kill active process 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 diff --git a/copy.sh b/copy.sh index 69641fda..5757f192 100755 --- a/copy.sh +++ b/copy.sh @@ -257,7 +257,7 @@ printf "\n%.0s" {1..1} # Function to modify the ENVariables.conf file update_editor() { local editor=$1 - sed -i "s/#env = EDITOR,.*/env = EDITOR,$editor #default editor/" config/hypr/UserConfigs/ENVariables.conf + sed -i "s/#env = EDITOR,.*/env = EDITOR,$editor #default editor/" config/hypr/UserConfigs/01-UserDefaults.conf echo "${OK} Default editor set to ${MAGENTA}$editor${RESET}." 2>&1 | tee -a "$LOG" } @@ -700,6 +700,7 @@ printf "\n%.0s" {1..1} # Restoring UserConfigs and UserScripts DIRH="hypr" FILES_TO_RESTORE=( + 01-UserDefaults.conf "ENVariables.conf" "LaptopDisplay.conf" "Laptops.conf" -- cgit v1.2.3