diff options
| author | JaKooLit <ejhay.games@gmail.com> | 2025-02-17 14:31:13 +0900 |
|---|---|---|
| committer | JaKooLit <ejhay.games@gmail.com> | 2025-02-17 14:31:13 +0900 |
| commit | 3f18612ee8389cc6a74085dc4af20ec8b789dc98 (patch) | |
| tree | 195549d4d771d589f594a9d2b698582ffb63c262 | |
| parent | 5b76cfdac242b14989621f4dea775951a192f6b6 (diff) | |
updated wlogout logic and quick edit menu
| -rw-r--r-- | README.md | 4 | ||||
| -rw-r--r-- | config/hypr/UserConfigs/WindowRules.conf | 5 | ||||
| -rwxr-xr-x | config/hypr/UserScripts/QuickEdit.sh | 39 | ||||
| -rwxr-xr-x | config/hypr/scripts/Wlogout.sh | 86 | ||||
| -rw-r--r-- | config/rofi/config-edit.rasi | 2 | ||||
| -rwxr-xr-x | copy.sh | 27 |
6 files changed, 96 insertions, 67 deletions
@@ -136,6 +136,10 @@ chmod +x upgrade.sh - check out this page [FAQ](https://github.com/JaKooLit/Hyprland-Dots/wiki/FAQ) and [UNSOLVED ISSUES](https://github.com/JaKooLit/Hyprland-Dots/wiki/Known_Issues) +### ‼️ ⁉️ Debian and Ubuntu Users ATTENTION! +- to update your dots, follow [THIS](https://github.com/JaKooLit/Hyprland-Dots/wiki/Install_&_Update#--debian-and-ubuntu-hyprland-dots-updating-notes-) + + #### 🙋 QUESTIONS ?!?! ⁉️ - FAQ! Yes you can use these dotfiles to other distro! Just ensure to install proper packages first! If it makes you feel better, I use same config on my Gentoo:) - QUICK HINT! Click the HINT! Waybar module (note only available in Waybar default and Simple-L [TOP] layout). Can be launched by Keybind `SUPER H` diff --git a/config/hypr/UserConfigs/WindowRules.conf b/config/hypr/UserConfigs/WindowRules.conf index f2f60899..cc31af26 100644 --- a/config/hypr/UserConfigs/WindowRules.conf +++ b/config/hypr/UserConfigs/WindowRules.conf @@ -130,8 +130,9 @@ windowrulev2 = float, class:^(com.heroicgameslauncher.hgl)$, title:negative:(Her windowrulev2 = float, class:^([Ss]team)$, title:negative:^([Ss]team)$ windowrulev2 = float, class:([Tt]hunar), title:negative:(.*[Tt]hunar.*) #windowrulev2 = float, class:(electron), title:(Add Folder to Workspace) -windowrulev2 = float, initialTitle:(Add Folder to Workspace) -windowrulev2 = size 70% 60%, initialTitle:(Add Folder to Workspace) +windowrulev2 = float, title:^(Add Folder to Workspace)$ +windowrulev2 = size 70% 60%, title:^(Add Folder to Workspace)$ +windowrulev2 = center, title:^(Add Folder to Workspace)$ windowrulev2 = float, initialTitle:(Open Files) windowrulev2 = size 70% 60%, initialTitle:(Open Files) diff --git a/config/hypr/UserScripts/QuickEdit.sh b/config/hypr/UserScripts/QuickEdit.sh index c71fb166..09530881 100755 --- a/config/hypr/UserScripts/QuickEdit.sh +++ b/config/hypr/UserScripts/QuickEdit.sh @@ -10,40 +10,41 @@ tty=kitty configs="$HOME/.config/hypr/configs" UserConfigs="$HOME/.config/hypr/UserConfigs" rofi_theme="~/.config/rofi/config-edit.rasi" +msg=' ⁉️ Choose which config to View or Edit ⁉️' # Function to display the menu options menu() { cat <<EOF -1. View / Edit Env-variables -2. View / Edit Window-Rules -3. View / Edit Startup_Apps -4. View / Edit User-Keybinds -5. View / Edit Monitors -6. View / Edit Laptop-Keybinds -7. View / Edit User-Settings -8. View / Edit Decorations -9. View / Edit Animations -10. View / Edit Workspace-Rules -11. View / Edit Default-Keybinds +1. ENV variables +2. Window Rules +3. Monitors +4. User Keybinds +5. User Settings +6. Startup Apps +7. Decorations +8. Animations +9. Workspace Rules +10. Laptop Keybinds +11. Default Keybinds EOF } # Main function to handle menu selection main() { - choice=$(menu | rofi -i -dmenu -config $rofi_theme | cut -d. -f1) + choice=$(menu | rofi -i -dmenu -config $rofi_theme -mesg "$msg" | cut -d. -f1) # Map choices to corresponding files case $choice in 1) file="$UserConfigs/ENVariables.conf" ;; 2) file="$UserConfigs/WindowRules.conf" ;; - 3) file="$UserConfigs/Startup_Apps.conf" ;; + 3) file="$UserConfigs/Monitors.conf" ;; 4) file="$UserConfigs/UserKeybinds.conf" ;; - 5) file="$UserConfigs/Monitors.conf" ;; - 6) file="$UserConfigs/Laptops.conf" ;; - 7) file="$UserConfigs/UserSettings.conf" ;; - 8) file="$UserConfigs/UserDecorations.conf" ;; - 9) file="$UserConfigs/UserAnimations.conf" ;; - 10) file="$UserConfigs/WorkspaceRules.conf" ;; + 5) file="$UserConfigs/UserSettings.conf" ;; + 6) file="$UserConfigs/Startup_Apps.conf" ;; + 7) file="$UserConfigs/UserDecorations.conf" ;; + 8) file="$UserConfigs/UserAnimations.conf" ;; + 9) file="$UserConfigs/WorkspaceRules.conf" ;; + 10) file="$UserConfigs/Laptops.conf" ;; 11) file="$configs/Keybinds.conf" ;; *) return ;; # Do nothing for invalid choices esac diff --git a/config/hypr/scripts/Wlogout.sh b/config/hypr/scripts/Wlogout.sh index ed3606c5..7659008e 100755 --- a/config/hypr/scripts/Wlogout.sh +++ b/config/hypr/scripts/Wlogout.sh @@ -1,57 +1,55 @@ #!/bin/bash -# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## +# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## # wlogout (Power, Screen Lock, Suspend, etc) -# Set variables for parameters. First numbers corresponts to Monitor Resolution -# i.e 2160 means 2160p -A_2160=700 -B_2160=700 -A_1600=650 -B_1600=650 -A_1440=450 -B_1440=450 -A_1080=350 -B_1080=350 -A_720=50 -B_720=50 +# Parameters for screen resolutions +declare -A resolutions=( + [2160]=450 + [1600]=450 + [1440]=450 + [1080]=350 + [720]=175 +) -# Check if wlogout is already running +# Check if wlogout is already running, if so, kill it 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') +# Detect the current monitor's native resolution and scale +monitor_info=$(hyprctl -j monitors | jq -r '.[] | select(.focused==true)') +# extract some info +resolution=$(echo "$monitor_info" | jq -r '.height') +width=$(echo "$monitor_info" | jq -r '.width') +hypr_scale=$(echo "$monitor_info" | jq -r '.scale') -# Set parameters based on screen resolution and scaling factor +# If hypr_scale >= 1.25 or resolution can't be detected, run wlogout with -b 3 +if [[ -z "$resolution" || ! "$resolution" =~ ^[0-9]+$ || -z "$hypr_scale" || $(awk "BEGIN {exit !($hypr_scale >= 1.25)}") -eq 1 ]]; then + echo "Hypr_scale is greater than or equal to 1.25 or resolution could not be detected, running wlogout with -b 3" + wlogout --protocol layer-shell -b 3 -T 100 -B 100 & + exit 0 +fi + +# Determine the appropriate resolution range and calculate T and B values 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 & + res_key=2160 +elif ((resolution >= 1600)); then + res_key=1600 +elif ((resolution >= 1440)); then + res_key=1440 +elif ((resolution >= 1080)); then + res_key=1080 else - echo "Setting default parameters" - wlogout & + res_key=720 fi + +# Calculate T and B values based on selected resolution and scale +T_val=$(awk "BEGIN {printf \"%.0f\", ${resolutions[$res_key]} * $res_key * $hypr_scale / $resolution}") +B_val=$(awk "BEGIN {printf \"%.0f\", ${resolutions[$res_key]} * $res_key * $hypr_scale / $resolution}") + +# Output the resolution setting for debugging purposes +echo "Setting parameters for resolution >= $res_key" + +# Run wlogout with -b 6 and calculated T/B values +wlogout --protocol layer-shell -b 6 -T $T_val -B $B_val &
\ No newline at end of file diff --git a/config/rofi/config-edit.rasi b/config/rofi/config-edit.rasi index 60d18e34..1902ab35 100644 --- a/config/rofi/config-edit.rasi +++ b/config/rofi/config-edit.rasi @@ -6,7 +6,7 @@ /* ---- Mainbox ---- */ mainbox { children: - [ "inputbar", "listview"]; + [ "inputbar", "message", "listview"]; } @@ -30,7 +30,30 @@ if [[ $EUID -eq 0 ]]; then printf "\n%.0s" {1..2} exit 1 fi - + +# Function to print colorful text +print_color() { + printf "%b%s%b\n" "$1" "$2" "$CLEAR" +} + +# Check if dpkg is installed (use to check if Debian or Ubuntu or based distros) +if command -v dpkg &> /dev/null; then + printf "\n%.0s" {1..1} + print_color $WARNING " + █▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀█ + KOOL DOTS version INCOMPATIBLE + █▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄█ + + Debian / Ubuntu detected. Refer to Hyprland-Dots README + For instruction on how to update your KooL Hyprland Dots + + exiting .... + " + printf "\n%.0s" {1..3} + exit 1 +fi + + printf "\n%.0s" {1..1} echo -e "\e[35m ╦╔═┌─┐┌─┐╦ ╔╦╗┌─┐┌┬┐┌─┐ @@ -143,6 +166,7 @@ You need to set it Manually Setting a wrong Keyboard Layout will cause Hyprland to crash If you are not sure, just type ${YELLOW}us${RESET} +${SKYBLUE}You can change later in ~/.config/hypr/UserConfigs/UserSettings.conf${RESET} ${MAGENTA} NOTE:${RESET} • You can also set more than 2 keyboard layouts @@ -190,6 +214,7 @@ You need to set it Manually Setting a wrong Keyboard Layout will cause Hyprland to crash If you are not sure, just type ${YELLOW}us${RESET} +${SKYBLUE}You can change later in ~/.config/hypr/UserConfigs/UserSettings.conf${RESET} ${MAGENTA} NOTE:${RESET} • You can also set more than 2 keyboard layouts |
