From f4a9ba41e25b4e40b6b7154aa7f48e9fbeb0b859 Mon Sep 17 00:00:00 2001 From: Don Williams Date: Sat, 18 Oct 2025 22:59:07 -0400 Subject: disabled workspace rules adj dropdown term size Added nm-tray startup for ubuntu users On branch development Your branch is up to date with 'origin/development'. Changes to be committed: modified: config/hypr/UserConfigs/Startup_Apps.conf modified: config/hypr/UserConfigs/WindowRules.conf modified: config/hypr/scripts/Dropterminal.sh --- config/hypr/scripts/Dropterminal.sh | 590 ++++++++++++++++++------------------ 1 file changed, 295 insertions(+), 295 deletions(-) (limited to 'config/hypr/scripts') diff --git a/config/hypr/scripts/Dropterminal.sh b/config/hypr/scripts/Dropterminal.sh index 4833545c..1c17fbb4 100755 --- a/config/hypr/scripts/Dropterminal.sh +++ b/config/hypr/scripts/Dropterminal.sh @@ -3,7 +3,7 @@ # # Made and brought to by Kiran George # /* -- ✨ https://github.com/SherLock707 ✨ -- */ ## -# Dropdown Terminal +# Dropdown Terminal # Usage: ./Dropdown.sh [-d] # Example: ./Dropdown.sh foot # ./Dropdown.sh -d foot (with debug output) @@ -15,186 +15,186 @@ SPECIAL_WS="special:scratchpad" ADDR_FILE="/tmp/dropdown_terminal_addr" # Dropdown size and position configuration (percentages) -WIDTH_PERCENT=50 # Width as percentage of screen width -HEIGHT_PERCENT=50 # Height as percentage of screen height -Y_PERCENT=5 # Y position as percentage from top (X is auto-centered) +WIDTH_PERCENT=65 # Width as percentage of screen width +HEIGHT_PERCENT=65 # Height as percentage of screen height +Y_PERCENT=10 # Y position as percentage from top (X is auto-centered) # Animation settings -ANIMATION_DURATION=100 # milliseconds +ANIMATION_DURATION=100 # milliseconds SLIDE_STEPS=5 -SLIDE_DELAY=5 # milliseconds between steps +SLIDE_DELAY=5 # milliseconds between steps # Parse arguments if [ "$1" = "-d" ]; then - DEBUG=true - shift + DEBUG=true + shift fi TERMINAL_CMD="$1" # Debug echo function debug_echo() { - if [ "$DEBUG" = true ]; then - echo "$@" - fi + if [ "$DEBUG" = true ]; then + echo "$@" + fi } # Validate input if [ -z "$TERMINAL_CMD" ]; then - echo "Missing terminal command. Usage: $0 [-d] " - echo "Examples:" - echo " $0 foot" - echo " $0 -d foot (with debug output)" - echo " $0 'kitty -e zsh'" - echo " $0 'alacritty --working-directory /home/user'" - echo "" - echo "Edit the script to modify size and position:" - echo " WIDTH_PERCENT - Width as percentage of screen (default: 50)" - echo " HEIGHT_PERCENT - Height as percentage of screen (default: 50)" - echo " Y_PERCENT - Y position from top as percentage (default: 5)" - echo " Note: X position is automatically centered" - exit 1 + echo "Missing terminal command. Usage: $0 [-d] " + echo "Examples:" + echo " $0 foot" + echo " $0 -d foot (with debug output)" + echo " $0 'kitty -e zsh'" + echo " $0 'alacritty --working-directory /home/user'" + echo "" + echo "Edit the script to modify size and position:" + echo " WIDTH_PERCENT - Width as percentage of screen (default: 50)" + echo " HEIGHT_PERCENT - Height as percentage of screen (default: 50)" + echo " Y_PERCENT - Y position from top as percentage (default: 5)" + echo " Note: X position is automatically centered" + exit 1 fi # Function to get window geometry get_window_geometry() { - local addr="$1" - hyprctl clients -j | jq -r --arg ADDR "$addr" '.[] | select(.address == $ADDR) | "\(.at[0]) \(.at[1]) \(.size[0]) \(.size[1])"' + local addr="$1" + hyprctl clients -j | jq -r --arg ADDR "$addr" '.[] | select(.address == $ADDR) | "\(.at[0]) \(.at[1]) \(.size[0]) \(.size[1])"' } # Function to animate window slide down (show) animate_slide_down() { - local addr="$1" - local target_x="$2" - local target_y="$3" - local width="$4" - local height="$5" - - debug_echo "Animating slide down for window $addr to position $target_x,$target_y" - - # Start position (above screen) - local start_y=$((target_y - height - 50)) - - # Calculate step size - local step_y=$(((target_y - start_y) / SLIDE_STEPS)) - - # Move window to start position instantly (off-screen) - hyprctl dispatch movewindowpixel "exact $target_x $start_y,address:$addr" >/dev/null 2>&1 - sleep 0.05 - - # Animate slide down - for i in $(seq 1 $SLIDE_STEPS); do - local current_y=$((start_y + (step_y * i))) - hyprctl dispatch movewindowpixel "exact $target_x $current_y,address:$addr" >/dev/null 2>&1 - sleep 0.03 - done - - # Ensure final position is exact - hyprctl dispatch movewindowpixel "exact $target_x $target_y,address:$addr" >/dev/null 2>&1 + local addr="$1" + local target_x="$2" + local target_y="$3" + local width="$4" + local height="$5" + + debug_echo "Animating slide down for window $addr to position $target_x,$target_y" + + # Start position (above screen) + local start_y=$((target_y - height - 50)) + + # Calculate step size + local step_y=$(((target_y - start_y) / SLIDE_STEPS)) + + # Move window to start position instantly (off-screen) + hyprctl dispatch movewindowpixel "exact $target_x $start_y,address:$addr" >/dev/null 2>&1 + sleep 0.05 + + # Animate slide down + for i in $(seq 1 $SLIDE_STEPS); do + local current_y=$((start_y + (step_y * i))) + hyprctl dispatch movewindowpixel "exact $target_x $current_y,address:$addr" >/dev/null 2>&1 + sleep 0.03 + done + + # Ensure final position is exact + hyprctl dispatch movewindowpixel "exact $target_x $target_y,address:$addr" >/dev/null 2>&1 } # Function to animate window slide up (hide) animate_slide_up() { - local addr="$1" - local start_x="$2" - local start_y="$3" - local width="$4" - local height="$5" - - debug_echo "Animating slide up for window $addr from position $start_x,$start_y" - - # End position (above screen) - local end_y=$((start_y - height - 50)) - - # Calculate step size - local step_y=$(((start_y - end_y) / SLIDE_STEPS)) - - # Animate slide up - for i in $(seq 1 $SLIDE_STEPS); do - local current_y=$((start_y - (step_y * i))) - hyprctl dispatch movewindowpixel "exact $start_x $current_y,address:$addr" >/dev/null 2>&1 - sleep 0.03 - done - - debug_echo "Slide up animation completed" + local addr="$1" + local start_x="$2" + local start_y="$3" + local width="$4" + local height="$5" + + debug_echo "Animating slide up for window $addr from position $start_x,$start_y" + + # End position (above screen) + local end_y=$((start_y - height - 50)) + + # Calculate step size + local step_y=$(((start_y - end_y) / SLIDE_STEPS)) + + # Animate slide up + for i in $(seq 1 $SLIDE_STEPS); do + local current_y=$((start_y - (step_y * i))) + hyprctl dispatch movewindowpixel "exact $start_x $current_y,address:$addr" >/dev/null 2>&1 + sleep 0.03 + done + + debug_echo "Slide up animation completed" } # Function to get monitor info including scale and name of focused monitor get_monitor_info() { - local monitor_data=$(hyprctl monitors -j | jq -r '.[] | select(.focused == true) | "\(.x) \(.y) \(.width) \(.height) \(.scale) \(.name)"') - if [ -z "$monitor_data" ] || [[ "$monitor_data" =~ ^null ]]; then - debug_echo "Error: Could not get focused monitor information" - return 1 - fi - echo "$monitor_data" + local monitor_data=$(hyprctl monitors -j | jq -r '.[] | select(.focused == true) | "\(.x) \(.y) \(.width) \(.height) \(.scale) \(.name)"') + if [ -z "$monitor_data" ] || [[ "$monitor_data" =~ ^null ]]; then + debug_echo "Error: Could not get focused monitor information" + return 1 + fi + echo "$monitor_data" } # Function to calculate dropdown position with proper scaling and centering calculate_dropdown_position() { - local monitor_info=$(get_monitor_info) - - if [ $? -ne 0 ] || [ -z "$monitor_info" ]; then - debug_echo "Error: Failed to get monitor info, using fallback values" - echo "100 100 800 600 fallback-monitor" - return 1 - fi - - local mon_x=$(echo $monitor_info | cut -d' ' -f1) - local mon_y=$(echo $monitor_info | cut -d' ' -f2) - local mon_width=$(echo $monitor_info | cut -d' ' -f3) - local mon_height=$(echo $monitor_info | cut -d' ' -f4) - local mon_scale=$(echo $monitor_info | cut -d' ' -f5) - local mon_name=$(echo $monitor_info | cut -d' ' -f6) - - debug_echo "Monitor info: x=$mon_x, y=$mon_y, width=$mon_width, height=$mon_height, scale=$mon_scale" - - # Validate scale value and provide fallback - if [ -z "$mon_scale" ] || [ "$mon_scale" = "null" ] || [ "$mon_scale" = "0" ]; then - debug_echo "Invalid scale value, using 1.0 as fallback" - mon_scale="1.0" - fi - - # Calculate logical dimensions by dividing physical dimensions by scale - local logical_width logical_height - if command -v bc >/dev/null 2>&1; then - # Use bc for precise floating point calculation - logical_width=$(echo "scale=0; $mon_width / $mon_scale" | bc | cut -d'.' -f1) - logical_height=$(echo "scale=0; $mon_height / $mon_scale" | bc | cut -d'.' -f1) - else - # Fallback to integer math (multiply by 100 for precision, then divide) - local scale_int=$(echo "$mon_scale" | sed 's/\.//' | sed 's/^0*//') - if [ -z "$scale_int" ]; then scale_int=100; fi - - logical_width=$(((mon_width * 100) / scale_int)) - logical_height=$(((mon_height * 100) / scale_int)) - fi - - # Ensure we have valid integer values - if ! [[ "$logical_width" =~ ^-?[0-9]+$ ]]; then logical_width=$mon_width; fi - if ! [[ "$logical_height" =~ ^-?[0-9]+$ ]]; then logical_height=$mon_height; fi - - debug_echo "Physical resolution: ${mon_width}x${mon_height}" - debug_echo "Logical resolution: ${logical_width}x${logical_height} (physical Γ· scale)" - - # Calculate window dimensions based on LOGICAL space percentages - local width=$((logical_width * WIDTH_PERCENT / 100)) - local height=$((logical_height * HEIGHT_PERCENT / 100)) - - # Calculate Y position from top based on percentage of LOGICAL height - local y_offset=$((logical_height * Y_PERCENT / 100)) - - # Calculate centered X position in LOGICAL space - local x_offset=$(((logical_width - width) / 2)) - - # Apply monitor offset to get final positions in logical coordinates - local final_x=$((mon_x + x_offset)) - local final_y=$((mon_y + y_offset)) - - debug_echo "Window size: ${width}x${height} (logical pixels)" - debug_echo "Final position: x=$final_x, y=$final_y (logical coordinates)" - debug_echo "Hyprland will scale these to physical coordinates automatically" - - echo "$final_x $final_y $width $height $mon_name" + local monitor_info=$(get_monitor_info) + + if [ $? -ne 0 ] || [ -z "$monitor_info" ]; then + debug_echo "Error: Failed to get monitor info, using fallback values" + echo "100 100 800 600 fallback-monitor" + return 1 + fi + + local mon_x=$(echo $monitor_info | cut -d' ' -f1) + local mon_y=$(echo $monitor_info | cut -d' ' -f2) + local mon_width=$(echo $monitor_info | cut -d' ' -f3) + local mon_height=$(echo $monitor_info | cut -d' ' -f4) + local mon_scale=$(echo $monitor_info | cut -d' ' -f5) + local mon_name=$(echo $monitor_info | cut -d' ' -f6) + + debug_echo "Monitor info: x=$mon_x, y=$mon_y, width=$mon_width, height=$mon_height, scale=$mon_scale" + + # Validate scale value and provide fallback + if [ -z "$mon_scale" ] || [ "$mon_scale" = "null" ] || [ "$mon_scale" = "0" ]; then + debug_echo "Invalid scale value, using 1.0 as fallback" + mon_scale="1.0" + fi + + # Calculate logical dimensions by dividing physical dimensions by scale + local logical_width logical_height + if command -v bc >/dev/null 2>&1; then + # Use bc for precise floating point calculation + logical_width=$(echo "scale=0; $mon_width / $mon_scale" | bc | cut -d'.' -f1) + logical_height=$(echo "scale=0; $mon_height / $mon_scale" | bc | cut -d'.' -f1) + else + # Fallback to integer math (multiply by 100 for precision, then divide) + local scale_int=$(echo "$mon_scale" | sed 's/\.//' | sed 's/^0*//') + if [ -z "$scale_int" ]; then scale_int=100; fi + + logical_width=$(((mon_width * 100) / scale_int)) + logical_height=$(((mon_height * 100) / scale_int)) + fi + + # Ensure we have valid integer values + if ! [[ "$logical_width" =~ ^-?[0-9]+$ ]]; then logical_width=$mon_width; fi + if ! [[ "$logical_height" =~ ^-?[0-9]+$ ]]; then logical_height=$mon_height; fi + + debug_echo "Physical resolution: ${mon_width}x${mon_height}" + debug_echo "Logical resolution: ${logical_width}x${logical_height} (physical Γ· scale)" + + # Calculate window dimensions based on LOGICAL space percentages + local width=$((logical_width * WIDTH_PERCENT / 100)) + local height=$((logical_height * HEIGHT_PERCENT / 100)) + + # Calculate Y position from top based on percentage of LOGICAL height + local y_offset=$((logical_height * Y_PERCENT / 100)) + + # Calculate centered X position in LOGICAL space + local x_offset=$(((logical_width - width) / 2)) + + # Apply monitor offset to get final positions in logical coordinates + local final_x=$((mon_x + x_offset)) + local final_y=$((mon_y + y_offset)) + + debug_echo "Window size: ${width}x${height} (logical pixels)" + debug_echo "Final position: x=$final_x, y=$final_y (logical coordinates)" + debug_echo "Hyprland will scale these to physical coordinates automatically" + + echo "$final_x $final_y $width $height $mon_name" } # Get the current workspace @@ -202,179 +202,179 @@ CURRENT_WS=$(hyprctl activeworkspace -j | jq -r '.id') # Function to get stored terminal address get_terminal_address() { - if [ -f "$ADDR_FILE" ] && [ -s "$ADDR_FILE" ]; then - cut -d' ' -f1 "$ADDR_FILE" - fi + if [ -f "$ADDR_FILE" ] && [ -s "$ADDR_FILE" ]; then + cut -d' ' -f1 "$ADDR_FILE" + fi } # Function to get stored monitor name get_terminal_monitor() { - if [ -f "$ADDR_FILE" ] && [ -s "$ADDR_FILE" ]; then - cut -d' ' -f2- "$ADDR_FILE" - fi + if [ -f "$ADDR_FILE" ] && [ -s "$ADDR_FILE" ]; then + cut -d' ' -f2- "$ADDR_FILE" + fi } # Function to check if terminal exists terminal_exists() { - local addr=$(get_terminal_address) - if [ -n "$addr" ]; then - hyprctl clients -j | jq -e --arg ADDR "$addr" 'any(.[]; .address == $ADDR)' >/dev/null 2>&1 - else - return 1 - fi + local addr=$(get_terminal_address) + if [ -n "$addr" ]; then + hyprctl clients -j | jq -e --arg ADDR "$addr" 'any(.[]; .address == $ADDR)' >/dev/null 2>&1 + else + return 1 + fi } # Function to check if terminal is in special workspace terminal_in_special() { - local addr=$(get_terminal_address) - if [ -n "$addr" ]; then - hyprctl clients -j | jq -e --arg ADDR "$addr" 'any(.[]; .address == $ADDR and .workspace.name == "special:scratchpad")' >/dev/null 2>&1 - else - return 1 - fi + local addr=$(get_terminal_address) + if [ -n "$addr" ]; then + hyprctl clients -j | jq -e --arg ADDR "$addr" 'any(.[]; .address == $ADDR and .workspace.name == "special:scratchpad")' >/dev/null 2>&1 + else + return 1 + fi } # Function to spawn terminal and capture its address spawn_terminal() { - debug_echo "Creating new dropdown terminal with command: $TERMINAL_CMD" - - # Calculate dropdown position for later use - local pos_info=$(calculate_dropdown_position) - if [ $? -ne 0 ]; then - debug_echo "Warning: Using fallback positioning" - fi - - local target_x=$(echo $pos_info | cut -d' ' -f1) - local target_y=$(echo $pos_info | cut -d' ' -f2) - local width=$(echo $pos_info | cut -d' ' -f3) - local height=$(echo $pos_info | cut -d' ' -f4) - local monitor_name=$(echo $pos_info | cut -d' ' -f5) - - debug_echo "Target position: ${target_x},${target_y}, size: ${width}x${height}" - - # Get window count before spawning - local windows_before=$(hyprctl clients -j) - local count_before=$(echo "$windows_before" | jq 'length') - - # Launch terminal directly in special workspace to avoid visible spawn - hyprctl dispatch exec "[float; size $width $height; workspace special:scratchpad silent] $TERMINAL_CMD" - - # Wait for window to appear - sleep 0.1 - - # Get windows after spawning - local windows_after=$(hyprctl clients -j) - local count_after=$(echo "$windows_after" | jq 'length') - - local new_addr="" - - if [ "$count_after" -gt "$count_before" ]; then - # Find the new window by comparing before/after lists - new_addr=$(comm -13 \ - <(echo "$windows_before" | jq -r '.[].address' | sort) \ - <(echo "$windows_after" | jq -r '.[].address' | sort) \ - | head -1) - fi - - # Fallback: try to find by the most recently mapped window - if [ -z "$new_addr" ] || [ "$new_addr" = "null" ]; then - new_addr=$(hyprctl clients -j | jq -r 'sort_by(.focusHistoryID) | .[-1] | .address') - fi - - if [ -n "$new_addr" ] && [ "$new_addr" != "null" ]; then - # Store the address and monitor name - echo "$new_addr $monitor_name" > "$ADDR_FILE" - debug_echo "Terminal created with address: $new_addr in special workspace on monitor $monitor_name" - - # Small delay to ensure it's properly in special workspace - sleep 0.2 - - # Now bring it back with the same animation as subsequent shows - # Use movetoworkspacesilent to avoid affecting workspace history - hyprctl dispatch movetoworkspacesilent "$CURRENT_WS,address:$new_addr" - hyprctl dispatch pin "address:$new_addr" - animate_slide_down "$new_addr" "$target_x" "$target_y" "$width" "$height" - - return 0 - fi - - debug_echo "Failed to get terminal address" - return 1 + debug_echo "Creating new dropdown terminal with command: $TERMINAL_CMD" + + # Calculate dropdown position for later use + local pos_info=$(calculate_dropdown_position) + if [ $? -ne 0 ]; then + debug_echo "Warning: Using fallback positioning" + fi + + local target_x=$(echo $pos_info | cut -d' ' -f1) + local target_y=$(echo $pos_info | cut -d' ' -f2) + local width=$(echo $pos_info | cut -d' ' -f3) + local height=$(echo $pos_info | cut -d' ' -f4) + local monitor_name=$(echo $pos_info | cut -d' ' -f5) + + debug_echo "Target position: ${target_x},${target_y}, size: ${width}x${height}" + + # Get window count before spawning + local windows_before=$(hyprctl clients -j) + local count_before=$(echo "$windows_before" | jq 'length') + + # Launch terminal directly in special workspace to avoid visible spawn + hyprctl dispatch exec "[float; size $width $height; workspace special:scratchpad silent] $TERMINAL_CMD" + + # Wait for window to appear + sleep 0.1 + + # Get windows after spawning + local windows_after=$(hyprctl clients -j) + local count_after=$(echo "$windows_after" | jq 'length') + + local new_addr="" + + if [ "$count_after" -gt "$count_before" ]; then + # Find the new window by comparing before/after lists + new_addr=$(comm -13 \ + <(echo "$windows_before" | jq -r '.[].address' | sort) \ + <(echo "$windows_after" | jq -r '.[].address' | sort) | + head -1) + fi + + # Fallback: try to find by the most recently mapped window + if [ -z "$new_addr" ] || [ "$new_addr" = "null" ]; then + new_addr=$(hyprctl clients -j | jq -r 'sort_by(.focusHistoryID) | .[-1] | .address') + fi + + if [ -n "$new_addr" ] && [ "$new_addr" != "null" ]; then + # Store the address and monitor name + echo "$new_addr $monitor_name" >"$ADDR_FILE" + debug_echo "Terminal created with address: $new_addr in special workspace on monitor $monitor_name" + + # Small delay to ensure it's properly in special workspace + sleep 0.2 + + # Now bring it back with the same animation as subsequent shows + # Use movetoworkspacesilent to avoid affecting workspace history + hyprctl dispatch movetoworkspacesilent "$CURRENT_WS,address:$new_addr" + hyprctl dispatch pin "address:$new_addr" + animate_slide_down "$new_addr" "$target_x" "$target_y" "$width" "$height" + + return 0 + fi + + debug_echo "Failed to get terminal address" + return 1 } # Main logic if terminal_exists; then - TERMINAL_ADDR=$(get_terminal_address) - debug_echo "Found existing terminal: $TERMINAL_ADDR" - focused_monitor=$(get_monitor_info | awk '{print $6}') - dropdown_monitor=$(get_terminal_monitor) - if [ "$focused_monitor" != "$dropdown_monitor" ]; then - debug_echo "Monitor focus changed: moving dropdown to $focused_monitor" - # Calculate new position for focused monitor - pos_info=$(calculate_dropdown_position) - target_x=$(echo $pos_info | cut -d' ' -f1) - target_y=$(echo $pos_info | cut -d' ' -f2) - width=$(echo $pos_info | cut -d' ' -f3) - height=$(echo $pos_info | cut -d' ' -f4) - monitor_name=$(echo $pos_info | cut -d' ' -f5) - # Move and resize window - hyprctl dispatch movewindowpixel "exact $target_x $target_y,address:$TERMINAL_ADDR" - hyprctl dispatch resizewindowpixel "exact $width $height,address:$TERMINAL_ADDR" - # Update ADDR_FILE - echo "$TERMINAL_ADDR $monitor_name" > "$ADDR_FILE" - fi + TERMINAL_ADDR=$(get_terminal_address) + debug_echo "Found existing terminal: $TERMINAL_ADDR" + focused_monitor=$(get_monitor_info | awk '{print $6}') + dropdown_monitor=$(get_terminal_monitor) + if [ "$focused_monitor" != "$dropdown_monitor" ]; then + debug_echo "Monitor focus changed: moving dropdown to $focused_monitor" + # Calculate new position for focused monitor + pos_info=$(calculate_dropdown_position) + target_x=$(echo $pos_info | cut -d' ' -f1) + target_y=$(echo $pos_info | cut -d' ' -f2) + width=$(echo $pos_info | cut -d' ' -f3) + height=$(echo $pos_info | cut -d' ' -f4) + monitor_name=$(echo $pos_info | cut -d' ' -f5) + # Move and resize window + hyprctl dispatch movewindowpixel "exact $target_x $target_y,address:$TERMINAL_ADDR" + hyprctl dispatch resizewindowpixel "exact $width $height,address:$TERMINAL_ADDR" + # Update ADDR_FILE + echo "$TERMINAL_ADDR $monitor_name" >"$ADDR_FILE" + fi - if terminal_in_special; then - debug_echo "Bringing terminal from scratchpad with slide down animation" - - # Calculate target position - pos_info=$(calculate_dropdown_position) - target_x=$(echo $pos_info | cut -d' ' -f1) - target_y=$(echo $pos_info | cut -d' ' -f2) - width=$(echo $pos_info | cut -d' ' -f3) - height=$(echo $pos_info | cut -d' ' -f4) - - # Use movetoworkspacesilent to avoid affecting workspace history - hyprctl dispatch movetoworkspacesilent "$CURRENT_WS,address:$TERMINAL_ADDR" - hyprctl dispatch pin "address:$TERMINAL_ADDR" - - # Set size and animate slide down - hyprctl dispatch resizewindowpixel "exact $width $height,address:$TERMINAL_ADDR" - animate_slide_down "$TERMINAL_ADDR" "$target_x" "$target_y" "$width" "$height" - - hyprctl dispatch focuswindow "address:$TERMINAL_ADDR" + if terminal_in_special; then + debug_echo "Bringing terminal from scratchpad with slide down animation" + + # Calculate target position + pos_info=$(calculate_dropdown_position) + target_x=$(echo $pos_info | cut -d' ' -f1) + target_y=$(echo $pos_info | cut -d' ' -f2) + width=$(echo $pos_info | cut -d' ' -f3) + height=$(echo $pos_info | cut -d' ' -f4) + + # Use movetoworkspacesilent to avoid affecting workspace history + hyprctl dispatch movetoworkspacesilent "$CURRENT_WS,address:$TERMINAL_ADDR" + hyprctl dispatch pin "address:$TERMINAL_ADDR" + + # Set size and animate slide down + hyprctl dispatch resizewindowpixel "exact $width $height,address:$TERMINAL_ADDR" + animate_slide_down "$TERMINAL_ADDR" "$target_x" "$target_y" "$width" "$height" + + hyprctl dispatch focuswindow "address:$TERMINAL_ADDR" + else + debug_echo "Hiding terminal to scratchpad with slide up animation" + + # Get current geometry for animation + geometry=$(get_window_geometry "$TERMINAL_ADDR") + if [ -n "$geometry" ]; then + curr_x=$(echo $geometry | cut -d' ' -f1) + curr_y=$(echo $geometry | cut -d' ' -f2) + curr_width=$(echo $geometry | cut -d' ' -f3) + curr_height=$(echo $geometry | cut -d' ' -f4) + + debug_echo "Current geometry: ${curr_x},${curr_y} ${curr_width}x${curr_height}" + + # Animate slide up first + animate_slide_up "$TERMINAL_ADDR" "$curr_x" "$curr_y" "$curr_width" "$curr_height" + + # Small delay then move to special workspace and unpin + sleep 0.1 + hyprctl dispatch pin "address:$TERMINAL_ADDR" # Unpin (toggle) + hyprctl dispatch movetoworkspacesilent "$SPECIAL_WS,address:$TERMINAL_ADDR" else - debug_echo "Hiding terminal to scratchpad with slide up animation" - - # Get current geometry for animation - geometry=$(get_window_geometry "$TERMINAL_ADDR") - if [ -n "$geometry" ]; then - curr_x=$(echo $geometry | cut -d' ' -f1) - curr_y=$(echo $geometry | cut -d' ' -f2) - curr_width=$(echo $geometry | cut -d' ' -f3) - curr_height=$(echo $geometry | cut -d' ' -f4) - - debug_echo "Current geometry: ${curr_x},${curr_y} ${curr_width}x${curr_height}" - - # Animate slide up first - animate_slide_up "$TERMINAL_ADDR" "$curr_x" "$curr_y" "$curr_width" "$curr_height" - - # Small delay then move to special workspace and unpin - sleep 0.1 - hyprctl dispatch pin "address:$TERMINAL_ADDR" # Unpin (toggle) - hyprctl dispatch movetoworkspacesilent "$SPECIAL_WS,address:$TERMINAL_ADDR" - else - debug_echo "Could not get window geometry, moving to scratchpad without animation" - hyprctl dispatch pin "address:$TERMINAL_ADDR" - hyprctl dispatch movetoworkspacesilent "$SPECIAL_WS,address:$TERMINAL_ADDR" - fi + debug_echo "Could not get window geometry, moving to scratchpad without animation" + hyprctl dispatch pin "address:$TERMINAL_ADDR" + hyprctl dispatch movetoworkspacesilent "$SPECIAL_WS,address:$TERMINAL_ADDR" fi + fi else - debug_echo "No existing terminal found, creating new one" - if spawn_terminal; then - TERMINAL_ADDR=$(get_terminal_address) - if [ -n "$TERMINAL_ADDR" ]; then - hyprctl dispatch focuswindow "address:$TERMINAL_ADDR" - fi + debug_echo "No existing terminal found, creating new one" + if spawn_terminal; then + TERMINAL_ADDR=$(get_terminal_address) + if [ -n "$TERMINAL_ADDR" ]; then + hyprctl dispatch focuswindow "address:$TERMINAL_ADDR" fi + fi fi -- cgit v1.2.3 From 1195ecd49921dc4e243454450440de24f5ab4d76 Mon Sep 17 00:00:00 2001 From: Don Williams Date: Mon, 20 Oct 2025 14:23:03 -0400 Subject: Waybar: fix rofi selection marker stripping; prevent embedding πŸ‘‰ in symlink names MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Problem: reselecting the current style/layout left the 'πŸ‘‰ ' prefix in the choice, so the symlink target included it (e.g., style.css -> .../πŸ‘‰ [0 VERTICAL] [Catpuccin] Mocha.css). Cause: options are annotated as "πŸ‘‰ ${name}", but the code used: choice=${choice# $MARKER} (matches ' πŸ‘‰'), not the actual prefix 'πŸ‘‰ '. Fix: use choice=${choice#"$MARKER "} in WaybarStyles.sh and WaybarLayout.sh. Result: selecting the same item no longer pollutes the symlink target. --- config/hypr/scripts/WaybarLayout.sh | 2 +- config/hypr/scripts/WaybarStyles.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'config/hypr/scripts') diff --git a/config/hypr/scripts/WaybarLayout.sh b/config/hypr/scripts/WaybarLayout.sh index b4d9c493..f65c9c00 100755 --- a/config/hypr/scripts/WaybarLayout.sh +++ b/config/hypr/scripts/WaybarLayout.sh @@ -50,7 +50,7 @@ main() { [[ -z "$choice" ]] && { echo "No option selected. Exiting."; exit 0; } # Strip marker before applying - choice=${choice# $MARKER} + choice=${choice#"$MARKER "} case "$choice" in "no panel") diff --git a/config/hypr/scripts/WaybarStyles.sh b/config/hypr/scripts/WaybarStyles.sh index a439f8eb..15767c2a 100755 --- a/config/hypr/scripts/WaybarStyles.sh +++ b/config/hypr/scripts/WaybarStyles.sh @@ -51,7 +51,7 @@ main() { [[ -z "$choice" ]] && { echo "No option selected. Exiting."; exit 0; } # remove annotation and apply - choice=${choice# $MARKER} + choice=${choice#"$MARKER "} apply_style "$choice" } -- cgit v1.2.3 From 05ca56247aae6cbc4e36cbf8bb8b39507d26dd64 Mon Sep 17 00:00:00 2001 From: prabinpanta0 Date: Tue, 28 Oct 2025 16:38:45 +0545 Subject: chore(lock): prime weather cache before locking session - Call weatherWrap.sh synchronously, then loginctl lock-session - Ensures lockscreen/waybar can read an up-to-date ~/.cache/.weather_cache --- config/hypr/scripts/LockScreen.sh | 3 +++ 1 file changed, 3 insertions(+) (limited to 'config/hypr/scripts') diff --git a/config/hypr/scripts/LockScreen.sh b/config/hypr/scripts/LockScreen.sh index 5e799181..17239406 100755 --- a/config/hypr/scripts/LockScreen.sh +++ b/config/hypr/scripts/LockScreen.sh @@ -4,4 +4,7 @@ # For Hyprlock #pidof hyprlock || hyprlock -q +# Ensure weather cache is up-to-date before locking (Waybar/lockscreen readers) +bash "$HOME/.secret/Hyprland-Dots/config/hypr/UserScripts/weatherWrap.sh" >/dev/null 2>&1 + loginctl lock-session \ No newline at end of file -- cgit v1.2.3 From 2c1ce157c97ae690e1dfb8087a3bfa808ac57c18 Mon Sep 17 00:00:00 2001 From: brockar Date: Tue, 28 Oct 2025 18:08:12 -0300 Subject: weatherWrap.sh -> WeatherWrap.sh --- config/hypr/UserConfigs/Startup_Apps.conf | 2 +- config/hypr/UserScripts/WeatherWrap.sh | 33 +++++++++++++++++++++++++++++++ config/hypr/UserScripts/weatherWrap.sh | 33 ------------------------------- config/hypr/scripts/LockScreen.sh | 7 ++++--- 4 files changed, 38 insertions(+), 37 deletions(-) create mode 100755 config/hypr/UserScripts/WeatherWrap.sh delete mode 100755 config/hypr/UserScripts/weatherWrap.sh (limited to 'config/hypr/scripts') diff --git a/config/hypr/UserConfigs/Startup_Apps.conf b/config/hypr/UserConfigs/Startup_Apps.conf index c40d0b0a..2f5c7ae7 100644 --- a/config/hypr/UserConfigs/Startup_Apps.conf +++ b/config/hypr/UserConfigs/Startup_Apps.conf @@ -48,7 +48,7 @@ exec-once = $UserScripts/RainbowBorders.sh exec-once = hypridle # Weather script to populate cache on startup -exec-once = $UserScripts/weatherWrap.sh +exec-once = $UserScripts/WeatherWrap.sh # Here are list of features available but disabled by default diff --git a/config/hypr/UserScripts/WeatherWrap.sh b/config/hypr/UserScripts/WeatherWrap.sh new file mode 100755 index 00000000..4c9a16dc --- /dev/null +++ b/config/hypr/UserScripts/WeatherWrap.sh @@ -0,0 +1,33 @@ +#!/bin/bash +# /* ---- πŸ’« https://github.com/JaKooLit πŸ’« ---- */ ## +# Weather entrypoint: prefer Python (Open‑Meteo), fallback to legacy Bash (wttr.in) + +SCRIPT_DIR="$(dirname "$0")" +PY_SCRIPT="$SCRIPT_DIR/Weather.py" +BASH_FALLBACK="$SCRIPT_DIR/Weather.sh" + +run_fallback() { + if [ -f "$BASH_FALLBACK" ]; then + # Invoke via bash to avoid requiring +x and ensure consistent shell + bash "$BASH_FALLBACK" "$@" + return $? + else + echo "Weather fallback not found: $BASH_FALLBACK" >&2 + return 127 + fi +} + +if command -v python3 >/dev/null 2>&1; then + python3 "$PY_SCRIPT" "$@" + exit_code=$? + if [ "$exit_code" -eq 0 ]; then + exit 0 + fi + echo "Weather.py failed with code $exit_code β€” falling back to Weather.sh" >&2 + run_fallback "$@" + exit $? +else + echo "python3 not found in PATH β€” falling back to Weather.sh" >&2 + run_fallback "$@" + exit $? +fi \ No newline at end of file diff --git a/config/hypr/UserScripts/weatherWrap.sh b/config/hypr/UserScripts/weatherWrap.sh deleted file mode 100755 index 4c9a16dc..00000000 --- a/config/hypr/UserScripts/weatherWrap.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/bash -# /* ---- πŸ’« https://github.com/JaKooLit πŸ’« ---- */ ## -# Weather entrypoint: prefer Python (Open‑Meteo), fallback to legacy Bash (wttr.in) - -SCRIPT_DIR="$(dirname "$0")" -PY_SCRIPT="$SCRIPT_DIR/Weather.py" -BASH_FALLBACK="$SCRIPT_DIR/Weather.sh" - -run_fallback() { - if [ -f "$BASH_FALLBACK" ]; then - # Invoke via bash to avoid requiring +x and ensure consistent shell - bash "$BASH_FALLBACK" "$@" - return $? - else - echo "Weather fallback not found: $BASH_FALLBACK" >&2 - return 127 - fi -} - -if command -v python3 >/dev/null 2>&1; then - python3 "$PY_SCRIPT" "$@" - exit_code=$? - if [ "$exit_code" -eq 0 ]; then - exit 0 - fi - echo "Weather.py failed with code $exit_code β€” falling back to Weather.sh" >&2 - run_fallback "$@" - exit $? -else - echo "python3 not found in PATH β€” falling back to Weather.sh" >&2 - run_fallback "$@" - exit $? -fi \ No newline at end of file diff --git a/config/hypr/scripts/LockScreen.sh b/config/hypr/scripts/LockScreen.sh index 17239406..e61490cd 100755 --- a/config/hypr/scripts/LockScreen.sh +++ b/config/hypr/scripts/LockScreen.sh @@ -2,9 +2,10 @@ # /* ---- πŸ’« https://github.com/JaKooLit πŸ’« ---- */ ## # For Hyprlock -#pidof hyprlock || hyprlock -q +#pidof hyprlock || hyprlock -q # Ensure weather cache is up-to-date before locking (Waybar/lockscreen readers) -bash "$HOME/.secret/Hyprland-Dots/config/hypr/UserScripts/weatherWrap.sh" >/dev/null 2>&1 +bash "$HOME/.config/hypr/UserScripts/WeatherWrap.sh" >/dev/null 2>&1 + +loginctl lock-session -loginctl lock-session \ No newline at end of file -- cgit v1.2.3 From 758b466c5f2030188d46511b20ad39c6d8b46a0d Mon Sep 17 00:00:00 2001 From: Don Williams Date: Tue, 28 Oct 2025 17:30:59 -0400 Subject: Changed /usr/bin/bash to /usr/bin/env bash On branch development Your branch is up to date with 'origin/development'. Changes to be committed: modified: Distro-Hyprland.sh modified: config/hypr/UserScripts/RainbowBorders.sh modified: config/hypr/UserScripts/RofiBeats.sh modified: config/hypr/UserScripts/RofiCalc.sh modified: config/hypr/UserScripts/Tak0-Autodispatch.sh modified: config/hypr/UserScripts/WallpaperAutoChange.sh modified: config/hypr/UserScripts/WallpaperEffects.sh modified: config/hypr/UserScripts/WallpaperRandom.sh modified: config/hypr/UserScripts/WallpaperSelect.sh modified: config/hypr/UserScripts/Weather.sh modified: config/hypr/UserScripts/WeatherWrap.sh modified: config/hypr/UserScripts/ZshChangeTheme.sh new file: config/hypr/configs/Startup_Apps.conf new file: config/hypr/configs/WindowRules.conf modified: config/hypr/hyprland.conf modified: config/hypr/initial-boot.sh modified: config/hypr/scripts/AirplaneMode.sh modified: config/hypr/scripts/Animations.sh modified: config/hypr/scripts/Battery.sh modified: config/hypr/scripts/Brightness.sh modified: config/hypr/scripts/BrightnessKbd.sh modified: config/hypr/scripts/ChangeBlur.sh modified: config/hypr/scripts/ChangeLayout.sh modified: config/hypr/scripts/ClipManager.sh new file: config/hypr/scripts/ComposeHyprConfigs.sh modified: config/hypr/scripts/DarkLight.sh modified: config/hypr/scripts/Distro_update.sh modified: config/hypr/scripts/Dropterminal.sh modified: config/hypr/scripts/GameMode.sh modified: config/hypr/scripts/Hypridle.sh modified: config/hypr/scripts/KeyBinds.sh modified: config/hypr/scripts/KeyHints.sh modified: config/hypr/scripts/KillActiveProcess.sh modified: config/hypr/scripts/Kitty_themes.sh modified: config/hypr/scripts/KooLsDotsUpdate.sh modified: config/hypr/scripts/Kool_Quick_Settings.sh modified: config/hypr/scripts/LockScreen.sh modified: config/hypr/scripts/MediaCtrl.sh modified: config/hypr/scripts/MonitorProfiles.sh modified: config/hypr/scripts/Polkit-NixOS.sh modified: config/hypr/scripts/Polkit.sh modified: config/hypr/scripts/PortalHyprland.sh modified: config/hypr/scripts/Refresh.sh modified: config/hypr/scripts/RefreshNoWaybar.sh modified: config/hypr/scripts/RofiEmoji.sh modified: config/hypr/scripts/RofiSearch.sh modified: config/hypr/scripts/RofiThemeSelector-modified.sh modified: config/hypr/scripts/RofiThemeSelector.sh modified: config/hypr/scripts/ScreenShot.sh modified: config/hypr/scripts/Sounds.sh modified: config/hypr/scripts/SwitchKeyboardLayout.sh modified: config/hypr/scripts/Tak0-Autodispatch.sh modified: config/hypr/scripts/TouchPad.sh modified: config/hypr/scripts/Volume.sh modified: config/hypr/scripts/WallustSwww.sh modified: config/hypr/scripts/WaybarLayout.sh modified: config/hypr/scripts/WaybarScripts.sh modified: config/hypr/scripts/WaybarStyles.sh modified: config/hypr/scripts/Wlogout.sh modified: config/hypr/scripts/sddm_wallpaper.sh modified: copy.sh modified: release.sh modified: upgrade.sh --- Distro-Hyprland.sh | 2 +- config/hypr/UserScripts/RainbowBorders.sh | 2 +- config/hypr/UserScripts/RofiBeats.sh | 2 +- config/hypr/UserScripts/RofiCalc.sh | 2 +- config/hypr/UserScripts/Tak0-Autodispatch.sh | 2 +- config/hypr/UserScripts/WallpaperAutoChange.sh | 2 +- config/hypr/UserScripts/WallpaperEffects.sh | 2 +- config/hypr/UserScripts/WallpaperRandom.sh | 2 +- config/hypr/UserScripts/WallpaperSelect.sh | 2 +- config/hypr/UserScripts/Weather.sh | 2 +- config/hypr/UserScripts/WeatherWrap.sh | 2 +- config/hypr/UserScripts/ZshChangeTheme.sh | 2 +- config/hypr/configs/Startup_Apps.conf | 58 ++++++ config/hypr/configs/WindowRules.conf | 235 ++++++++++++++++++++++ config/hypr/hyprland.conf | 4 +- config/hypr/initial-boot.sh | 2 +- config/hypr/scripts/AirplaneMode.sh | 2 +- config/hypr/scripts/Animations.sh | 2 +- config/hypr/scripts/Battery.sh | 2 +- config/hypr/scripts/Brightness.sh | 2 +- config/hypr/scripts/BrightnessKbd.sh | 2 +- config/hypr/scripts/ChangeBlur.sh | 2 +- config/hypr/scripts/ChangeLayout.sh | 2 +- config/hypr/scripts/ClipManager.sh | 2 +- config/hypr/scripts/ComposeHyprConfigs.sh | 109 ++++++++++ config/hypr/scripts/DarkLight.sh | 2 +- config/hypr/scripts/Distro_update.sh | 2 +- config/hypr/scripts/Dropterminal.sh | 2 +- config/hypr/scripts/GameMode.sh | 2 +- config/hypr/scripts/Hypridle.sh | 2 +- config/hypr/scripts/KeyBinds.sh | 2 +- config/hypr/scripts/KeyHints.sh | 2 +- config/hypr/scripts/KillActiveProcess.sh | 2 +- config/hypr/scripts/Kitty_themes.sh | 2 +- config/hypr/scripts/KooLsDotsUpdate.sh | 2 +- config/hypr/scripts/Kool_Quick_Settings.sh | 2 +- config/hypr/scripts/LockScreen.sh | 2 +- config/hypr/scripts/MediaCtrl.sh | 2 +- config/hypr/scripts/MonitorProfiles.sh | 2 +- config/hypr/scripts/Polkit-NixOS.sh | 2 +- config/hypr/scripts/Polkit.sh | 2 +- config/hypr/scripts/PortalHyprland.sh | 2 +- config/hypr/scripts/Refresh.sh | 2 +- config/hypr/scripts/RefreshNoWaybar.sh | 2 +- config/hypr/scripts/RofiEmoji.sh | 2 +- config/hypr/scripts/RofiSearch.sh | 2 +- config/hypr/scripts/RofiThemeSelector-modified.sh | 2 +- config/hypr/scripts/RofiThemeSelector.sh | 2 +- config/hypr/scripts/ScreenShot.sh | 2 +- config/hypr/scripts/Sounds.sh | 2 +- config/hypr/scripts/SwitchKeyboardLayout.sh | 2 +- config/hypr/scripts/Tak0-Autodispatch.sh | 2 +- config/hypr/scripts/TouchPad.sh | 2 +- config/hypr/scripts/Volume.sh | 2 +- config/hypr/scripts/WallustSwww.sh | 2 +- config/hypr/scripts/WaybarLayout.sh | 2 +- config/hypr/scripts/WaybarScripts.sh | 2 +- config/hypr/scripts/WaybarStyles.sh | 2 +- config/hypr/scripts/Wlogout.sh | 2 +- config/hypr/scripts/sddm_wallpaper.sh | 2 +- copy.sh | 84 +++++++- release.sh | 2 +- upgrade.sh | 9 +- 63 files changed, 544 insertions(+), 69 deletions(-) create mode 100644 config/hypr/configs/Startup_Apps.conf create mode 100644 config/hypr/configs/WindowRules.conf create mode 100644 config/hypr/scripts/ComposeHyprConfigs.sh (limited to 'config/hypr/scripts') diff --git a/Distro-Hyprland.sh b/Distro-Hyprland.sh index ff88325f..99a1fc34 100755 --- a/Distro-Hyprland.sh +++ b/Distro-Hyprland.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # https://github.com/JaKooLit # Script design to clone the Distro-Hyprland install scripts diff --git a/config/hypr/UserScripts/RainbowBorders.sh b/config/hypr/UserScripts/RainbowBorders.sh index cc1419fb..0a7fd721 100755 --- a/config/hypr/UserScripts/RainbowBorders.sh +++ b/config/hypr/UserScripts/RainbowBorders.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # /* ---- πŸ’« https://github.com/JaKooLit πŸ’« ---- */ ## # for rainbow borders animation diff --git a/config/hypr/UserScripts/RofiBeats.sh b/config/hypr/UserScripts/RofiBeats.sh index 1cddce09..ca566019 100755 --- a/config/hypr/UserScripts/RofiBeats.sh +++ b/config/hypr/UserScripts/RofiBeats.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # /* ---- πŸ’« https://github.com/JaKooLit πŸ’« ---- */ ## # For Rofi Beats to play online Music or Locally saved media files diff --git a/config/hypr/UserScripts/RofiCalc.sh b/config/hypr/UserScripts/RofiCalc.sh index 4b3b8b69..b72d5f3e 100755 --- a/config/hypr/UserScripts/RofiCalc.sh +++ b/config/hypr/UserScripts/RofiCalc.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # /* ---- πŸ’« https://github.com/JaKooLit πŸ’« ---- */ # /* Calculator (using qalculate) and rofi */ # /* Submitted by: https://github.com/JosephArmas */ diff --git a/config/hypr/UserScripts/Tak0-Autodispatch.sh b/config/hypr/UserScripts/Tak0-Autodispatch.sh index a1f72129..114a3e8e 100755 --- a/config/hypr/UserScripts/Tak0-Autodispatch.sh +++ b/config/hypr/UserScripts/Tak0-Autodispatch.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # USAGE / Π†ΠΠ‘Π’Π Π£ΠšΠ¦Π†Π―: # 1) Run from terminal: # ./dispatch.sh diff --git a/config/hypr/UserScripts/WallpaperAutoChange.sh b/config/hypr/UserScripts/WallpaperAutoChange.sh index a6d2cedd..6d8e8735 100755 --- a/config/hypr/UserScripts/WallpaperAutoChange.sh +++ b/config/hypr/UserScripts/WallpaperAutoChange.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # /* ---- πŸ’« https://github.com/JaKooLit πŸ’« ---- */ ## # source https://wiki.archlinux.org/title/Hyprland#Using_a_script_to_change_wallpaper_every_X_minutes diff --git a/config/hypr/UserScripts/WallpaperEffects.sh b/config/hypr/UserScripts/WallpaperEffects.sh index ac8fc0e8..89577efa 100755 --- a/config/hypr/UserScripts/WallpaperEffects.sh +++ b/config/hypr/UserScripts/WallpaperEffects.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # /* ---- πŸ’« https://github.com/JaKooLit πŸ’« ---- */ # # Wallpaper Effects using ImageMagick (SUPER SHIFT W) diff --git a/config/hypr/UserScripts/WallpaperRandom.sh b/config/hypr/UserScripts/WallpaperRandom.sh index 79396508..654d4bd3 100755 --- a/config/hypr/UserScripts/WallpaperRandom.sh +++ b/config/hypr/UserScripts/WallpaperRandom.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # /* ---- πŸ’« https://github.com/JaKooLit πŸ’« ---- */ ## # Script for Random Wallpaper ( CTRL ALT W) diff --git a/config/hypr/UserScripts/WallpaperSelect.sh b/config/hypr/UserScripts/WallpaperSelect.sh index 466832ba..9e51125f 100755 --- a/config/hypr/UserScripts/WallpaperSelect.sh +++ b/config/hypr/UserScripts/WallpaperSelect.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # /* ---- πŸ’« https://github.com/JaKooLit πŸ’« ---- */ # This script for selecting wallpapers (SUPER W) diff --git a/config/hypr/UserScripts/Weather.sh b/config/hypr/UserScripts/Weather.sh index b69662e6..ac9abc13 100755 --- a/config/hypr/UserScripts/Weather.sh +++ b/config/hypr/UserScripts/Weather.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # /* ---- πŸ’« https://github.com/JaKooLit πŸ’« ---- */ ## # weather info from wttr. https://github.com/chubin/wttr.in # Remember to add city diff --git a/config/hypr/UserScripts/WeatherWrap.sh b/config/hypr/UserScripts/WeatherWrap.sh index 4c9a16dc..10c125dc 100755 --- a/config/hypr/UserScripts/WeatherWrap.sh +++ b/config/hypr/UserScripts/WeatherWrap.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # /* ---- πŸ’« https://github.com/JaKooLit πŸ’« ---- */ ## # Weather entrypoint: prefer Python (Open‑Meteo), fallback to legacy Bash (wttr.in) diff --git a/config/hypr/UserScripts/ZshChangeTheme.sh b/config/hypr/UserScripts/ZshChangeTheme.sh index cffaf5cb..690f0f13 100755 --- a/config/hypr/UserScripts/ZshChangeTheme.sh +++ b/config/hypr/UserScripts/ZshChangeTheme.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # /* ---- πŸ’« https://github.com/JaKooLit πŸ’« ---- */ ## # Script for Oh my ZSH theme ( CTRL SHIFT O) diff --git a/config/hypr/configs/Startup_Apps.conf b/config/hypr/configs/Startup_Apps.conf new file mode 100644 index 00000000..d952e65b --- /dev/null +++ b/config/hypr/configs/Startup_Apps.conf @@ -0,0 +1,58 @@ +# /* ---- πŸ’« https://github.com/JaKooLit πŸ’« ---- */ # +# Commands and Apps to be executed at launch (vendor defaults) + +$scriptsDir = $HOME/.config/hypr/scripts +$UserScripts = $HOME/.config/hypr/UserScripts + +$wallDIR=$HOME/Pictures/wallpapers +$lock = $scriptsDir/LockScreen.sh +$SwwwRandom = $UserScripts/WallpaperAutoChange.sh +$livewallpaper="" + +# wallpaper stuff +exec-once = swww-daemon --format xrgb +#exec-once = mpvpaper '*' -o "load-scripts=no no-audio --loop" $livewallpaper + +# wallpaper random +#exec-once = $SwwwRandom $wallDIR # random wallpaper switcher every 30 minutes + +# Startup +exec-once = dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP +exec-once = systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP + +# Initialize Drop Down terminal - See Bug#810 https://github.com/JaKooLit/Hyprland-Dots/issues/810#issuecomment-3351947644 +exec-once = $HOME/.config/hypr/scripts/Dropterminal.sh kitty & + + +# Polkit (Polkit Gnome / KDE) +exec-once = $scriptsDir/Polkit.sh + +# starup apps +exec-once = nm-applet --indicator +exec-once = nm-tray # For ubuntu +exec-once = swaync +#exec-once = ags +#exec-once = blueman-applet +#exec-once = rog-control-center +exec-once = waybar +exec-once = qs # quickshell AGS Desktop Overview alternative + +#clipboard manager +exec-once = wl-paste --type text --watch cliphist store +exec-once = wl-paste --type image --watch cliphist store + +# Rainbow borders +exec-once = $UserScripts/RainbowBorders.sh + +# Starting hypridle to start hyprlock +exec-once = hypridle + + +# Here are list of features available but disabled by default +# exec-once = swww-daemon --format xrgb && swww img $HOME/Pictures/wallpapers/mecha-nostalgia.png # persistent wallpaper + +#gnome polkit for nixos +#exec-once = $scriptsDir/Polkit-NixOS.sh + +# xdg-desktop-portal-hyprland (should be auto starting. However, you can force to start) +#exec-once = $scriptsDir/PortalHyprland.sh \ No newline at end of file diff --git a/config/hypr/configs/WindowRules.conf b/config/hypr/configs/WindowRules.conf new file mode 100644 index 00000000..f02c5d29 --- /dev/null +++ b/config/hypr/configs/WindowRules.conf @@ -0,0 +1,235 @@ +# /* ---- πŸ’« https://github.com/JaKooLit πŸ’« ---- */ # +# Vendor defaults for window rules and layerrules +# See https://wiki.hyprland.org/Configuring/Window-Rules/ for more + +# NOTES: This is only for Hyprland > 0.48 + +# note for ja: This should NOT be implemented on Debian and Ubuntu + +# windowrule - tags - add apps under appropriate tag to use the same settings +# browser tags +windowrule = tag +browser, class:^([Ff]irefox|org.mozilla.firefox|[Ff]irefox-esr|[Ff]irefox-bin)$ +windowrule = tag +browser, class:^([Gg]oogle-chrome(-beta|-dev|-unstable)?)$ +windowrule = tag +browser, class:^(chrome-.+-Default)$ # Chrome PWAs +windowrule = tag +browser, class:^([Cc]hromium)$ +windowrule = tag +browser, class:^([Mm]icrosoft-edge(-stable|-beta|-dev|-unstable))$ +windowrule = tag +browser, class:^(Brave-browser(-beta|-dev|-unstable)?)$ +windowrule = tag +browser, class:^([Tt]horium-browser|[Cc]achy-browser)$ +windowrule = tag +browser, class:^(zen-alpha|zen)$ + +# notif tags +windowrule = tag +notif, class:^(swaync-control-center|swaync-notification-window|swaync-client|class)$ + +# KooL settings tag +windowrule = tag +KooL_Cheat, title:^(KooL Quick Cheat Sheet)$ +windowrule = tag +KooL_Settings, title:^(KooL Hyprland Settings)$ +windowrule = tag +KooL-Settings, class:^(nwg-displays|nwg-look)$ + +# terminal tags +windowrule = tag +terminal, class:^(Alacritty|kitty|kitty-dropterm)$ + +# email tags +windowrule = tag +email, class:^([Tt]hunderbird|org.gnome.Evolution)$ +windowrule = tag +email, class:^(eu.betterbird.Betterbird)$ + +# project tags +windowrule = tag +projects, class:^(codium|codium-url-handler|VSCodium)$ +windowrule = tag +projects, class:^(VSCode|code-url-handler)$ +windowrule = tag +projects, class:^(jetbrains-.+)$ # JetBrains IDEs + +# screenshare tags +windowrule = tag +screenshare, class:^(com.obsproject.Studio)$ + +# IM tags +windowrule = tag +im, class:^([Dd]iscord|[Ww]ebCord|[Vv]esktop)$ +windowrule = tag +im, class:^([Ff]erdium)$ +windowrule = tag +im, class:^([Ww]hatsapp-for-linux)$ +windowrule = tag +im, class:^(ZapZap|com.rtosta.zapzap)$ +windowrule = tag +im, class:^(org.telegram.desktop|io.github.tdesktop_x64.TDesktop)$ +windowrule = tag +im, class:^(teams-for-linux)$ +windowrule = tag +im, class:^(im.riot.Riot|Element)$ # Element Matrix client + +# game tags +windowrule = tag +games, class:^(gamescope)$ +windowrule = tag +games, class:^(steam_app_\d+)$ + +# gamestore tags +windowrule = tag +gamestore, class:^([Ss]team)$ +windowrule = tag +gamestore, title:^([Ll]utris)$ +windowrule = tag +gamestore, class:^(com.heroicgameslauncher.hgl)$ + +# file-manager tags +windowrule = tag +file-manager, class:^([Tt]hunar|org.gnome.Nautilus|[Pp]cmanfm-qt)$ +windowrule = tag +file-manager, class:^(app.drey.Warp)$ + +# wallpaper tags +windowrule = tag +wallpaper, class:^([Ww]aytrogen)$ + +# multimedia tags +windowrule = tag +multimedia, class:^([Aa]udacious)$ + +# multimedia-video tags +windowrule = tag +multimedia_video, class:^([Mm]pv|vlc)$ + +# settings tags +windowrule = tag +settings, title:^(ROG Control)$ +windowrule = tag +settings, class:^(wihotspot(-gui)?)$ # wifi hotspot +windowrule = tag +settings, class:^([Bb]aobab|org.gnome.[Bb]aobab)$ # Disk usage analyzer +windowrule = tag +settings, class:^(gnome-disks|wihotspot(-gui)?)$ +windowrule = tag +settings, title:(Kvantum Manager) +windowrule = tag +settings, class:^(file-roller|org.gnome.FileRoller)$ # archive manager +windowrule = tag +settings, class:^(nm-applet|nm-connection-editor|blueman-manager)$ +windowrule = tag +settings, class:^(pavucontrol|org.pulseaudio.pavucontrol|com.saivert.pwvucontrol)$ +windowrule = tag +settings, class:^(qt5ct|qt6ct|[Yy]ad)$ +windowrule = tag +settings, class:(xdg-desktop-portal-gtk) +windowrule = tag +settings, class:^(org.kde.polkit-kde-authentication-agent-1)$ +windowrule = tag +settings, class:^([Rr]ofi)$ + +# viewer tags +windowrule = tag +viewer, class:^(gnome-system-monitor|org.gnome.SystemMonitor|io.missioncenter.MissionCenter)$ # system monitor +windowrule = tag +viewer, class:^(evince)$ # document viewer +windowrule = tag +viewer, class:^(eog|org.gnome.Loupe)$ # image viewer + +# Some special override rules +windowrule = noblur, tag:multimedia_video* +windowrule = opacity 1.0, tag:multimedia_video* + +# POSITION +# windowrule = center,floating:1 # warning, it cause even the menu to float and center. +windowrule = center, tag:KooL_Cheat* +windowrule = center, class:([Tt]hunar), title:negative:(.*[Tt]hunar.*) +windowrule = center, title:^(ROG Control)$ +windowrule = center, tag:KooL-Settings* +windowrule = center, title:^(Keybindings)$ +windowrule = center, class:^(pavucontrol|org.pulseaudio.pavucontrol|com.saivert.pwvucontrol)$ +windowrule = center, class:^([Ww]hatsapp-for-linux|ZapZap|com.rtosta.zapzap)$ +windowrule = center, class:^([Ff]erdium)$ +windowrule = move 72% 7%,title:^(Picture-in-Picture)$ +#windowrule = move 72% 7%,title:^(Firefox)$ + +# windowrule to avoid idle for fullscreen apps +#windowrule = idleinhibit fullscreen, class:^(*)$ +#windowrule = idleinhibit fullscreen, title:^(*)$ +windowrule = idleinhibit fullscreen, fullscreen:1 + +# windowrule move to workspace +#windowrule = workspace 1, tag:email* +#windowrule = workspace 2, tag:browser* +#windowrule = workspace 3, class:^([Tt]hunar)$ +#windowrule = workspace 3, tag:projects* +#windowrule = workspace 5, tag:gamestore* +#windowrule = workspace 7, tag:im* +#windowrule = workspace 8, tag:games* + +# windowrule move to workspace (silent) +#windowrule = workspace 4 silent, tag:screenshare* +#windowrule = workspace 6 silent, class:^(virt-manager)$ +#windowrule = workspace 6 silent, class:^(.virt-manager-wrapped)$ +#windowrule = workspace 9 silent, tag:multimedia* +# +# FLOAT +windowrule = float, tag:KooL_Cheat* +windowrule = float, tag:wallpaper* +windowrule = float, tag:settings* +windowrule = float, tag:viewer* +windowrule = float, tag:KooL-Settings* +windowrule = float, class:([Zz]oom|onedriver|onedriver-launcher)$ +windowrule = float, class:(org.gnome.Calculator), title:(Calculator) +windowrule = float, class:^(mpv|com.github.rafostar.Clapper)$ +windowrule = float, class:^([Qq]alculate-gtk)$ +#windowrule = float, class:^([Ww]hatsapp-for-linux|ZapZap|com.rtosta.zapzap)$ +windowrule = float, class:^([Ff]erdium)$ +windowrule = float, title:^(Picture-in-Picture)$ +#windowrule = float, title:^(Firefox)$ + +# windowrule - ######### float popups and dialogue ####### +windowrule = float, title:^(Authentication Required)$ +windowrule = center, title:^(Authentication Required)$ +windowrule = float, class:(codium|codium-url-handler|VSCodium), title:negative:(.*codium.*|.*VSCodium.*) +windowrule = float, class:^(com.heroicgameslauncher.hgl)$, title:negative:(Heroic Games Launcher) +windowrule = float, class:^([Ss]team)$, title:negative:^([Ss]team)$ +windowrule = float, class:([Tt]hunar), title:negative:(.*[Tt]hunar.*) + +windowrule = float, title:^(Add Folder to Workspace)$ +windowrule = size 70% 60%, title:^(Add Folder to Workspace)$ +windowrule = center, title:^(Add Folder to Workspace)$ + +windowrule = float, title:^(Save As)$ +windowrule = size 70% 60%, title:^(Save As)$ +windowrule = center, title:^(Save As)$ + +windowrule = float, initialTitle:(Open Files) +windowrule = size 70% 60%, initialTitle:(Open Files) + +windowrule = float, title:^(SDDM Background)$ #KooL's Dots YAD for setting SDDM background +windowrule = center, title:^(SDDM Background)$ #KooL's Dots YAD for setting SDDM background +windowrule = size 16% 12%, title:^(SDDM Background)$ #KooL's Dots YAD for setting SDDM background +# END of float popups and dialogue ####### + +# OPACITY +windowrule = opacity 0.99 0.8, tag:browser* +windowrule = opacity 0.9 0.8, tag:projects* +windowrule = opacity 0.94 0.86, tag:im* +windowrule = opacity 0.94 0.86, tag:multimedia* +windowrule = opacity 0.9 0.8, tag:file-manager* +windowrule = opacity 0.9 0.7, tag:terminal* +windowrule = opacity 0.8 0.7, tag:settings* +windowrule = opacity 0.82 0.75, tag:viewer* +windowrule = opacity 0.9 0.7, tag:wallpaper* +windowrule = opacity 0.8 0.7, class:^(gedit|org.gnome.TextEditor|mousepad)$ +windowrule = opacity 0.9 0.8, class:^(deluge)$ +windowrule = opacity 0.9 0.8, class:^(seahorse)$ # gnome-keyring gui +windowrule = opacity 0.95 0.75, title:^(Picture-in-Picture)$ +windowrule = opacity 0.9,class:^(code)$ + +# SIZE +windowrule = size 65% 90%, tag:KooL_Cheat* +windowrule = size 70% 70%, tag:wallpaper* +windowrule = size 70% 70%, tag:settings* +windowrule = size 60% 70%, class:^([Ww]hatsapp-for-linux|ZapZap|com.rtosta.zapzap)$ +windowrule = size 60% 70%, class:^([Ff]erdium)$ + +#windowrule = size 25% 25%, title:^(Picture-in-Picture)$ +#windowrule = size 25% 25%, title:^(Firefox)$ + +# PINNING +windowrule = pin, title:^(Picture-in-Picture)$ +#windowrule = pin,title:^(Firefox)$ + +# windowrule - extras +windowrule = keepaspectratio, title:^(Picture-in-Picture)$ + +# BLUR & FULLSCREEN +windowrule = noblur, tag:games* +windowrule = fullscreen, tag:games* + + +#This not gonna take the focus to the window that appears when hovering over some of the parts of the IntelliJ Products +windowrule = noinitialfocus, class:^(jetbrains-*) +windowrule = noinitialfocus, title:^(wind.*)$ + +#This will gonna make the VS Code bluer like other apps +windowrule = opacity 0.8,class:^(code)$ + +#windowrule = bordercolor rgb(EE4B55) rgb(880808), fullscreen:1 +#windowrule = bordercolor rgb(282737) rgb(1E1D2D), floating:1 +#windowrule = opacity 0.8 0.8, pinned:1 + +# LAYER RULES +layerrule = blur, rofi +layerrule = ignorezero, rofi +layerrule = blur, notifications +layerrule = ignorezero, notifications +layerrule = blur, quickshell:overview +layerrule = ignorezero, quickshell:overview +layerrule = ignorealpha 0.5, quickshell:overview + +#layerrule = ignorealpha 0.5, tag:notif* + +#layerrule = ignorezero, class:^([Rr]ofi)$ +#layerrule = blur, class:^([Rr]ofi)$ +#layerrule = unset,class:^([Rr]ofi)$ +#layerrule = ignorezero, + +#layerrule = ignorezero, overview +#layerrule = blur, overview \ No newline at end of file diff --git a/config/hypr/hyprland.conf b/config/hypr/hyprland.conf index 71f243e7..cd9fed2d 100644 --- a/config/hypr/hyprland.conf +++ b/config/hypr/hyprland.conf @@ -15,7 +15,9 @@ source=$configs/Keybinds.conf # Pre-configured keybinds # ## This is where you want to start tinkering $UserConfigs = $HOME/.config/hypr/UserConfigs # User Configs directory path -source= $UserConfigs/Startup_Apps.conf # put your start-up packages on this file +# Generated merges (vendor + user overlay with dedupe/disable) +source= $HOME/.config/hypr/generated/Startup_Apps.conf +source= $HOME/.config/hypr/generated/WindowRules.conf source= $UserConfigs/ENVariables.conf # Environment variables to load diff --git a/config/hypr/initial-boot.sh b/config/hypr/initial-boot.sh index 5b49cb6d..1313f104 100755 --- a/config/hypr/initial-boot.sh +++ b/config/hypr/initial-boot.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # /* ---- πŸ’« https://github.com/JaKooLit πŸ’« ---- */ # # A bash script designed to run only once dotfiles installed diff --git a/config/hypr/scripts/AirplaneMode.sh b/config/hypr/scripts/AirplaneMode.sh index 4379935d..548b9d6b 100755 --- a/config/hypr/scripts/AirplaneMode.sh +++ b/config/hypr/scripts/AirplaneMode.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # /* ---- πŸ’« https://github.com/JaKooLit πŸ’« ---- */ ## # Airplane Mode. Turning on or off all wifi using rfkill. diff --git a/config/hypr/scripts/Animations.sh b/config/hypr/scripts/Animations.sh index 477e5cd3..4bbe050f 100755 --- a/config/hypr/scripts/Animations.sh +++ b/config/hypr/scripts/Animations.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # /* ---- πŸ’« https://github.com/JaKooLit πŸ’« ---- */ ## # For applying Animations from different users diff --git a/config/hypr/scripts/Battery.sh b/config/hypr/scripts/Battery.sh index d7830058..2baed6ca 100644 --- a/config/hypr/scripts/Battery.sh +++ b/config/hypr/scripts/Battery.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash for i in {0..3}; do if [ -f /sys/class/power_supply/BAT$i/capacity ]; then diff --git a/config/hypr/scripts/Brightness.sh b/config/hypr/scripts/Brightness.sh index 63fd02f3..ce443ef2 100755 --- a/config/hypr/scripts/Brightness.sh +++ b/config/hypr/scripts/Brightness.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # /* ---- πŸ’« https://github.com/JaKooLit πŸ’« ---- */ ## # Script for Monitor backlights (if supported) using brightnessctl diff --git a/config/hypr/scripts/BrightnessKbd.sh b/config/hypr/scripts/BrightnessKbd.sh index 24737b73..93e09d86 100755 --- a/config/hypr/scripts/BrightnessKbd.sh +++ b/config/hypr/scripts/BrightnessKbd.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # /* ---- πŸ’« https://github.com/JaKooLit πŸ’« ---- */ ## # Script for keyboard backlights (if supported) using brightnessctl diff --git a/config/hypr/scripts/ChangeBlur.sh b/config/hypr/scripts/ChangeBlur.sh index 895987a4..0060285b 100755 --- a/config/hypr/scripts/ChangeBlur.sh +++ b/config/hypr/scripts/ChangeBlur.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # /* ---- πŸ’« https://github.com/JaKooLit πŸ’« ---- */ ## # Script for changing blurs on the fly diff --git a/config/hypr/scripts/ChangeLayout.sh b/config/hypr/scripts/ChangeLayout.sh index b083fcdc..78428188 100755 --- a/config/hypr/scripts/ChangeLayout.sh +++ b/config/hypr/scripts/ChangeLayout.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # /* ---- πŸ’« https://github.com/JaKooLit πŸ’« ---- */ ## # for changing Hyprland Layouts (Master or Dwindle) on the fly diff --git a/config/hypr/scripts/ClipManager.sh b/config/hypr/scripts/ClipManager.sh index 9937b6f4..3ba5d91a 100755 --- a/config/hypr/scripts/ClipManager.sh +++ b/config/hypr/scripts/ClipManager.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # /* ---- πŸ’« https://github.com/JaKooLit πŸ’« ---- */ ## # Clipboard Manager. This script uses cliphist, rofi, and wl-copy. diff --git a/config/hypr/scripts/ComposeHyprConfigs.sh b/config/hypr/scripts/ComposeHyprConfigs.sh new file mode 100644 index 00000000..55bc3c5c --- /dev/null +++ b/config/hypr/scripts/ComposeHyprConfigs.sh @@ -0,0 +1,109 @@ +#!/usr/bin/env bash +# Compose merged Hyprland configs for Startup_Apps and WindowRules +set -euo pipefail + +BASE_DIR="$HOME/.config/hypr" +BASE_CFG_DIR="$BASE_DIR/configs" +USER_DIR="$BASE_DIR/UserConfigs" +GEN_DIR="$BASE_DIR/generated" + +mkdir -p "$GEN_DIR" + +log() { printf "[compose] %s\n" "$*"; } + +# Trim leading/trailing whitespace +trim() { sed -E 's/^\s+//;s/\s+$//'; } + +# Normalize spaces in a directive line +normalize() { awk '{$1=$1;print}'; } + +# Build merged Startup_Apps.conf +compose_startup_apps() { + local base_file="$BASE_CFG_DIR/Startup_Apps.conf" + local user_file="$USER_DIR/Startup_Apps.conf" + local disable_file="$USER_DIR/Startup_Apps.disable" + local out_file="$GEN_DIR/Startup_Apps.conf" + + : >"$out_file" + + # Header and variable lines come from base + if [[ -f "$base_file" ]]; then + # Copy all non exec-once lines (comments, blanks, variables, etc.) + grep -Ev '^\s*exec-once\s*=' "$base_file" || true >>"$out_file" + fi + + # Collect exec-once commands (the right side of '=') + declare -A cmds=() + + if [[ -f "$base_file" ]]; then + while IFS= read -r line; do + [[ "$line" =~ ^\s*exec-once\s*= ]] || continue + cmd="${line#*=}" + cmd="$(echo "$cmd" | trim)" + cmds["$cmd"]=1 + done <"$base_file" + fi + + if [[ -f "$user_file" ]]; then + while IFS= read -r line; do + [[ "$line" =~ ^\s*exec-once\s*= ]] || continue + cmd="${line#*=}" + cmd="$(echo "$cmd" | trim)" + cmds["$cmd"]=1 + done <"$user_file" + fi + + # Apply disables (exact match of command string) + if [[ -f "$disable_file" ]]; then + while IFS= read -r d; do + d="$(echo "$d" | trim)" + [[ -z "$d" || "$d" =~ ^# ]] && continue + unset 'cmds[$d]' + done <"$disable_file" + fi + + # Emit combined exec-once (stable sort) + for k in "${!cmds[@]}"; do echo "$k"; done | sort -u | while IFS= read -r cmd; do + [[ -z "$cmd" ]] && continue + printf "exec-once = %s\n" "$cmd" >>"$out_file" + done + + log "Wrote $out_file" +} + +# Build merged WindowRules.conf +compose_window_rules() { + local base_file="$BASE_CFG_DIR/WindowRules.conf" + local user_file="$USER_DIR/WindowRules.conf" + local disable_file="$USER_DIR/WindowRules.disable" + local out_file="$GEN_DIR/WindowRules.conf" + + : >"$out_file" + echo "# Generated merged WindowRules" >>"$out_file" + + declare -A rules=() + add_rules() { + local f="$1" + [[ -f "$f" ]] || return 0 + grep -E '^(windowrule|layerrule)\s*=' "$f" | trim | while IFS= read -r r; do + rules["$r"]=1 + done + } + + add_rules "$base_file" + add_rules "$user_file" + + if [[ -f "$disable_file" ]]; then + while IFS= read -r d; do + d="$(echo "$d" | trim)" + [[ -z "$d" || "$d" =~ ^# ]] && continue + unset 'rules[$d]' + done <"$disable_file" + fi + + for r in "${!rules[@]}"; do echo "$r"; done | sort -u >>"$out_file" + log "Wrote $out_file" +} + +compose_startup_apps +compose_window_rules \ No newline at end of file diff --git a/config/hypr/scripts/DarkLight.sh b/config/hypr/scripts/DarkLight.sh index 1bc1602f..e473efb2 100755 --- a/config/hypr/scripts/DarkLight.sh +++ b/config/hypr/scripts/DarkLight.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash ## /* ---- πŸ’« https://github.com/JaKooLit πŸ’« ---- */ ## # For Dark and Light switching # Note: Scripts are looking for keywords Light or Dark except for wallpapers as the are in a separate directories diff --git a/config/hypr/scripts/Distro_update.sh b/config/hypr/scripts/Distro_update.sh index b0b1446b..2b3376e3 100755 --- a/config/hypr/scripts/Distro_update.sh +++ b/config/hypr/scripts/Distro_update.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # /* ---- πŸ’« https://github.com/JaKooLit πŸ’« ---- */ ## # Simple bash script to check and will try to update your system diff --git a/config/hypr/scripts/Dropterminal.sh b/config/hypr/scripts/Dropterminal.sh index 1c17fbb4..9b2eeecb 100755 --- a/config/hypr/scripts/Dropterminal.sh +++ b/config/hypr/scripts/Dropterminal.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # /* ---- πŸ’« https://github.com/JaKooLit πŸ’« ---- */ ## # # Made and brought to by Kiran George diff --git a/config/hypr/scripts/GameMode.sh b/config/hypr/scripts/GameMode.sh index 7a39da3d..ec1e541e 100755 --- a/config/hypr/scripts/GameMode.sh +++ b/config/hypr/scripts/GameMode.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # /* ---- πŸ’« https://github.com/JaKooLit πŸ’« ---- */ ## # Game Mode. Turning off all animations diff --git a/config/hypr/scripts/Hypridle.sh b/config/hypr/scripts/Hypridle.sh index 56176716..6acff434 100755 --- a/config/hypr/scripts/Hypridle.sh +++ b/config/hypr/scripts/Hypridle.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # /* ---- πŸ’« https://github.com/JaKooLit πŸ’« ---- */ ## # This is for custom version of waybar idle_inhibitor which activates / deactivates hypridle instead diff --git a/config/hypr/scripts/KeyBinds.sh b/config/hypr/scripts/KeyBinds.sh index 9c6b5ab7..3a19390f 100755 --- a/config/hypr/scripts/KeyBinds.sh +++ b/config/hypr/scripts/KeyBinds.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # /* ---- πŸ’« https://github.com/JaKooLit πŸ’« ---- */ ## # searchable enabled keybinds using rofi diff --git a/config/hypr/scripts/KeyHints.sh b/config/hypr/scripts/KeyHints.sh index 7917ae3a..8a478039 100755 --- a/config/hypr/scripts/KeyHints.sh +++ b/config/hypr/scripts/KeyHints.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # /* ---- πŸ’« https://github.com/JaKooLit πŸ’« ---- */ ## # GDK BACKEND. Change to either wayland or x11 if having issues diff --git a/config/hypr/scripts/KillActiveProcess.sh b/config/hypr/scripts/KillActiveProcess.sh index bee146d7..2bc108f2 100755 --- a/config/hypr/scripts/KillActiveProcess.sh +++ b/config/hypr/scripts/KillActiveProcess.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # /* ---- πŸ’« https://github.com/JaKooLit πŸ’« ---- */ ## # Copied from Discord post. Thanks to @Zorg diff --git a/config/hypr/scripts/Kitty_themes.sh b/config/hypr/scripts/Kitty_themes.sh index 48bfa99f..55da7e44 100755 --- a/config/hypr/scripts/Kitty_themes.sh +++ b/config/hypr/scripts/Kitty_themes.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # /* ---- πŸ’« https://github.com/JaKooLit πŸ’« ---- */Β  # # Kitty Themes Source https://github.com/dexpota/kitty-themes # diff --git a/config/hypr/scripts/KooLsDotsUpdate.sh b/config/hypr/scripts/KooLsDotsUpdate.sh index f4b8814a..51277ab1 100755 --- a/config/hypr/scripts/KooLsDotsUpdate.sh +++ b/config/hypr/scripts/KooLsDotsUpdate.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # /* ---- πŸ’« https://github.com/JaKooLit πŸ’« ---- */ ## # simple bash script to check if update is available by comparing local version and github version diff --git a/config/hypr/scripts/Kool_Quick_Settings.sh b/config/hypr/scripts/Kool_Quick_Settings.sh index e43749bf..79ddc163 100755 --- a/config/hypr/scripts/Kool_Quick_Settings.sh +++ b/config/hypr/scripts/Kool_Quick_Settings.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # /* ---- πŸ’« https://github.com/JaKooLit πŸ’« ---- */ ## # Rofi menu for KooL Hyprland Quick Settings (SUPER SHIFT E) diff --git a/config/hypr/scripts/LockScreen.sh b/config/hypr/scripts/LockScreen.sh index e61490cd..d58f5c21 100755 --- a/config/hypr/scripts/LockScreen.sh +++ b/config/hypr/scripts/LockScreen.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # /* ---- πŸ’« https://github.com/JaKooLit πŸ’« ---- */ ## # For Hyprlock diff --git a/config/hypr/scripts/MediaCtrl.sh b/config/hypr/scripts/MediaCtrl.sh index 000c3ade..9dc3571d 100755 --- a/config/hypr/scripts/MediaCtrl.sh +++ b/config/hypr/scripts/MediaCtrl.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # /* ---- πŸ’« https://github.com/JaKooLit πŸ’« ---- */ ## # Playerctl diff --git a/config/hypr/scripts/MonitorProfiles.sh b/config/hypr/scripts/MonitorProfiles.sh index 67316c09..1176a46a 100755 --- a/config/hypr/scripts/MonitorProfiles.sh +++ b/config/hypr/scripts/MonitorProfiles.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # /* ---- πŸ’« https://github.com/JaKooLit πŸ’« ---- */ ## # For applying Pre-configured Monitor Profiles diff --git a/config/hypr/scripts/Polkit-NixOS.sh b/config/hypr/scripts/Polkit-NixOS.sh index 51675eff..28642d19 100755 --- a/config/hypr/scripts/Polkit-NixOS.sh +++ b/config/hypr/scripts/Polkit-NixOS.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # /* ---- πŸ’« https://github.com/JaKooLit πŸ’« ---- */ ## # For NixOS starting of polkit-gnome. Dec 2023, the settings stated in NixOS wiki does not work so have to manual start it diff --git a/config/hypr/scripts/Polkit.sh b/config/hypr/scripts/Polkit.sh index dcea7653..1af8fd1b 100755 --- a/config/hypr/scripts/Polkit.sh +++ b/config/hypr/scripts/Polkit.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # /* ---- πŸ’« https://github.com/JaKooLit πŸ’« ---- */ ## # This script starts the first available Polkit agent from a list of possible locations diff --git a/config/hypr/scripts/PortalHyprland.sh b/config/hypr/scripts/PortalHyprland.sh index 9bdf4b8c..21cb7db4 100755 --- a/config/hypr/scripts/PortalHyprland.sh +++ b/config/hypr/scripts/PortalHyprland.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # /* ---- πŸ’« https://github.com/JaKooLit πŸ’« ---- */ ## # For manually starting xdg-desktop-portal-hyprland diff --git a/config/hypr/scripts/Refresh.sh b/config/hypr/scripts/Refresh.sh index 719c368d..2e772aa9 100755 --- a/config/hypr/scripts/Refresh.sh +++ b/config/hypr/scripts/Refresh.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # /* ---- πŸ’« https://github.com/JaKooLit πŸ’« ---- */ ## # Scripts for refreshing ags, waybar, rofi, swaync, wallust diff --git a/config/hypr/scripts/RefreshNoWaybar.sh b/config/hypr/scripts/RefreshNoWaybar.sh index 8454124e..54c760bd 100755 --- a/config/hypr/scripts/RefreshNoWaybar.sh +++ b/config/hypr/scripts/RefreshNoWaybar.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # /* ---- πŸ’« https://github.com/JaKooLit πŸ’« ---- */ ## # Modified version of Refresh.sh but waybar wont refresh diff --git a/config/hypr/scripts/RofiEmoji.sh b/config/hypr/scripts/RofiEmoji.sh index 4570831e..7e3ef0f3 100755 --- a/config/hypr/scripts/RofiEmoji.sh +++ b/config/hypr/scripts/RofiEmoji.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # /* ---- πŸ’« https://github.com/JaKooLit πŸ’« ---- */ ## # Variables diff --git a/config/hypr/scripts/RofiSearch.sh b/config/hypr/scripts/RofiSearch.sh index 4218bed3..8ef12c46 100755 --- a/config/hypr/scripts/RofiSearch.sh +++ b/config/hypr/scripts/RofiSearch.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # /* ---- πŸ’« https://github.com/JaKooLit πŸ’« ---- */ ## # For Searching via web browsers diff --git a/config/hypr/scripts/RofiThemeSelector-modified.sh b/config/hypr/scripts/RofiThemeSelector-modified.sh index 2cfc2d24..d6a353c0 100755 --- a/config/hypr/scripts/RofiThemeSelector-modified.sh +++ b/config/hypr/scripts/RofiThemeSelector-modified.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # /* ---- πŸ’« https://github.com/JaKooLit πŸ’« ---- */ ## # A modified version of Rofi-Theme-Selector, concentrating only on ~/.local and also, applying only 10 @themes in ~/.config/rofi/config.rasi # as opposed to continous adding of //@theme diff --git a/config/hypr/scripts/RofiThemeSelector.sh b/config/hypr/scripts/RofiThemeSelector.sh index 8b2fcb71..b7236e8f 100755 --- a/config/hypr/scripts/RofiThemeSelector.sh +++ b/config/hypr/scripts/RofiThemeSelector.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # /* ---- πŸ’« https://github.com/JaKooLit πŸ’« ---- */Β  # # Rofi Themes - Script to preview and apply themes by live-reloading the config. diff --git a/config/hypr/scripts/ScreenShot.sh b/config/hypr/scripts/ScreenShot.sh index 0a37c7e4..0ef70964 100755 --- a/config/hypr/scripts/ScreenShot.sh +++ b/config/hypr/scripts/ScreenShot.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # /* ---- πŸ’« https://github.com/JaKooLit πŸ’« ---- */ ## # Screenshots scripts diff --git a/config/hypr/scripts/Sounds.sh b/config/hypr/scripts/Sounds.sh index 8b2cc76e..b372d714 100755 --- a/config/hypr/scripts/Sounds.sh +++ b/config/hypr/scripts/Sounds.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # /* ---- πŸ’« https://github.com/JaKooLit πŸ’« ---- */ ## # This script is used to play system sounds. # Script is used by Volume.Sh and ScreenShots.sh diff --git a/config/hypr/scripts/SwitchKeyboardLayout.sh b/config/hypr/scripts/SwitchKeyboardLayout.sh index f505fa6c..18a9517e 100755 --- a/config/hypr/scripts/SwitchKeyboardLayout.sh +++ b/config/hypr/scripts/SwitchKeyboardLayout.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # /* ---- πŸ’« https://github.com/JaKooLit πŸ’« ---- */ ## # This is for changing kb_layouts. Set kb_layouts in $settings_file diff --git a/config/hypr/scripts/Tak0-Autodispatch.sh b/config/hypr/scripts/Tak0-Autodispatch.sh index a1f72129..114a3e8e 100755 --- a/config/hypr/scripts/Tak0-Autodispatch.sh +++ b/config/hypr/scripts/Tak0-Autodispatch.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # USAGE / Π†ΠΠ‘Π’Π Π£ΠšΠ¦Π†Π―: # 1) Run from terminal: # ./dispatch.sh diff --git a/config/hypr/scripts/TouchPad.sh b/config/hypr/scripts/TouchPad.sh index 8509d79f..030c36de 100755 --- a/config/hypr/scripts/TouchPad.sh +++ b/config/hypr/scripts/TouchPad.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # /* ---- πŸ’« https://github.com/JaKooLit πŸ’« ---- */ ## # For disabling touchpad. # Edit the Touchpad_Device on ~/.config/hypr/UserConfigs/Laptops.conf according to your system diff --git a/config/hypr/scripts/Volume.sh b/config/hypr/scripts/Volume.sh index 8efdb55c..4c82f543 100755 --- a/config/hypr/scripts/Volume.sh +++ b/config/hypr/scripts/Volume.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # /* ---- πŸ’« https://github.com/JaKooLit πŸ’« ---- */ ## # Scripts for volume controls for audio and mic diff --git a/config/hypr/scripts/WallustSwww.sh b/config/hypr/scripts/WallustSwww.sh index 5e0148ee..657f41ab 100755 --- a/config/hypr/scripts/WallustSwww.sh +++ b/config/hypr/scripts/WallustSwww.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # /* ---- πŸ’« https://github.com/JaKooLit πŸ’« ---- */ ## # Wallust: derive colors from the current wallpaper and update templates # Usage: WallustSwww.sh [absolute_path_to_wallpaper] diff --git a/config/hypr/scripts/WaybarLayout.sh b/config/hypr/scripts/WaybarLayout.sh index f65c9c00..d3725a91 100755 --- a/config/hypr/scripts/WaybarLayout.sh +++ b/config/hypr/scripts/WaybarLayout.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # /* ---- πŸ’« https://github.com/JaKooLit πŸ’« ---- */ ## # Script for waybar layout or configs diff --git a/config/hypr/scripts/WaybarScripts.sh b/config/hypr/scripts/WaybarScripts.sh index 7b3aaba2..d2205c42 100755 --- a/config/hypr/scripts/WaybarScripts.sh +++ b/config/hypr/scripts/WaybarScripts.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # /* ---- πŸ’« https://github.com/JaKooLit πŸ’« ---- */ # # This file used on waybar modules sourcing defaults set in $HOME/.config/hypr/UserConfigs/01-UserDefaults.conf diff --git a/config/hypr/scripts/WaybarStyles.sh b/config/hypr/scripts/WaybarStyles.sh index 15767c2a..8ebfed92 100755 --- a/config/hypr/scripts/WaybarStyles.sh +++ b/config/hypr/scripts/WaybarStyles.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # /* ---- πŸ’« https://github.com/JaKooLit πŸ’« ---- */ ## # Script for waybar styles diff --git a/config/hypr/scripts/Wlogout.sh b/config/hypr/scripts/Wlogout.sh index f552b83d..8879858c 100755 --- a/config/hypr/scripts/Wlogout.sh +++ b/config/hypr/scripts/Wlogout.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # /* ---- πŸ’« https://github.com/JaKooLit πŸ’« ---- */ ## # wlogout (Power, Screen Lock, Suspend, etc) diff --git a/config/hypr/scripts/sddm_wallpaper.sh b/config/hypr/scripts/sddm_wallpaper.sh index 9487188c..9dca2f72 100644 --- a/config/hypr/scripts/sddm_wallpaper.sh +++ b/config/hypr/scripts/sddm_wallpaper.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # /* ---- πŸ’« https://github.com/JaKooLit πŸ’« ---- */ # SDDM Wallpaper and Wallust Colors Setter diff --git a/copy.sh b/copy.sh index d54402f3..496811d8 100755 --- a/copy.sh +++ b/copy.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # /* ---- πŸ’« https://github.com/JaKooLit πŸ’« ---- */ # clear @@ -111,8 +111,17 @@ fi # Proper Polkit for NixOS if hostnamectl | grep -q 'Operating System: NixOS'; then echo "${INFO} NixOS Distro Detected. Setting up proper env's and configs." 2>&1 | tee -a "$LOG" || true - sed -i -E '/^#?exec-once = \$scriptsDir\/Polkit-NixOS\.sh/s/^#//' config/hypr/UserConfigs/Startup_Apps.conf - sed -i '/^exec-once = \$scriptsDir\/Polkit\.sh$/ s/^#*/#/' config/hypr/UserConfigs/Startup_Apps.conf + # Ensure NixOS polkit is enabled via overlay and default polkit is disabled via disable list + OVERLAY_SA="config/hypr/UserConfigs/Startup_Apps.conf" + DISABLE_SA="config/hypr/UserConfigs/Startup_Apps.disable" + mkdir -p "$(dirname "$OVERLAY_SA")" + touch "$OVERLAY_SA" "$DISABLE_SA" + if ! grep -qx 'exec-once = $scriptsDir/Polkit-NixOS.sh' "$OVERLAY_SA"; then + echo 'exec-once = $scriptsDir/Polkit-NixOS.sh' >> "$OVERLAY_SA" + fi + if ! grep -qx '\$scriptsDir/Polkit.sh' "$DISABLE_SA"; then + echo '$scriptsDir/Polkit.sh' >> "$DISABLE_SA" + fi fi # activating hyprcursor on env by checking if the directory ~/.icons/Bibata-Modern-Ice/hyprcursors exists @@ -236,17 +245,23 @@ done # Check if asusctl is installed and add rog-control-center on Startup if command -v asusctl >/dev/null 2>&1; then - sed -i '/^\s*#exec-once = rog-control-center/s/^#//' config/hypr/UserConfigs/Startup_Apps.conf + OVERLAY_SA="config/hypr/UserConfigs/Startup_Apps.conf" + mkdir -p "$(dirname "$OVERLAY_SA")"; touch "$OVERLAY_SA" + grep -qx 'exec-once = rog-control-center' "$OVERLAY_SA" || echo 'exec-once = rog-control-center' >> "$OVERLAY_SA" fi # Check if blueman-applet is installed and add blueman-applet on Startup if command -v blueman-applet >/dev/null 2>&1; then - sed -i '/^\s*#exec-once = blueman-applet/s/^#//' config/hypr/UserConfigs/Startup_Apps.conf + OVERLAY_SA="config/hypr/UserConfigs/Startup_Apps.conf" + mkdir -p "$(dirname "$OVERLAY_SA")"; touch "$OVERLAY_SA" + grep -qx 'exec-once = blueman-applet' "$OVERLAY_SA" || echo 'exec-once = blueman-applet' >> "$OVERLAY_SA" fi # Check if ags is installed edit ags behaviour on configs if command -v ags >/dev/null 2>&1; then - sed -i '/^\s*#exec-once = ags/s/^#//' config/hypr/UserConfigs/Startup_Apps.conf + OVERLAY_SA="config/hypr/UserConfigs/Startup_Apps.conf" + mkdir -p "$(dirname "$OVERLAY_SA")"; touch "$OVERLAY_SA" + grep -qx 'exec-once = ags' "$OVERLAY_SA" || echo 'exec-once = ags' >> "$OVERLAY_SA" sed -i '/#ags -q && ags &/s/^#//' config/hypr/scripts/RefreshNoWaybar.sh sed -i '/#ags -q && ags &/s/^#//' config/hypr/scripts/Refresh.sh @@ -259,7 +274,9 @@ fi # Check if quickshell is installed; edit quickshell behaviour on configs if command -v qs >/dev/null 2>&1; then - sed -i '/^\s*#exec-once = qs/s/^#//' config/hypr/UserConfigs/Startup_Apps.conf + OVERLAY_SA="config/hypr/UserConfigs/Startup_Apps.conf" + mkdir -p "$(dirname "$OVERLAY_SA")"; touch "$OVERLAY_SA" + grep -qx 'exec-once = qs' "$OVERLAY_SA" || echo 'exec-once = qs' >> "$OVERLAY_SA" sed -i '/#pkill qs && qs &/s/^#//' config/hypr/scripts/RefreshNoWaybar.sh sed -i '/#pkill qs && qs &/s/^#//' config/hypr/scripts/Refresh.sh @@ -814,6 +831,37 @@ FILES_TO_RESTORE=( "WindowRules.conf" ) +# Helper to extract overlay (additions) and optional disables from a previous user file compared to vendor base +compose_overlay_from_backup() { + local type="$1" # startup|windowrules + local base_file="$2" + local old_user_file="$3" + local new_user_file="$4" + local disable_file="$5" + + mkdir -p "$(dirname "$new_user_file")" + : >"$new_user_file" + : >"$disable_file" + + if [ "$type" = "startup" ]; then + # additions: exec-once lines present in old user but not in base + grep -E '^\s*exec-once\s*=' "$old_user_file" | sed -E 's/^\s+//;s/\s+$//' | sort -u >"$old_user_file.tmp.exec" + grep -E '^\s*exec-once\s*=' "$base_file" | sed -E 's/^\s+//;s/\s+$//' | sort -u >"$base_file.tmp.exec" + comm -23 "$old_user_file.tmp.exec" "$base_file.tmp.exec" >"$new_user_file" + # treat commented exec-once in old user as disables + grep -E '^\s*#\s*exec-once\s*=' "$old_user_file" | sed -E 's/^\s*#\s*exec-once\s*=\s*//' | sed -E 's/^\s+//;s/\s+$//' | sort -u >"$disable_file" + rm -f "$old_user_file.tmp.exec" "$base_file.tmp.exec" + elif [ "$type" = "windowrules" ]; then + # additions + grep -E '^(windowrule|layerrule)\s*=' "$old_user_file" | sed -E 's/^\s+//;s/\s+$//' | sort -u >"$old_user_file.tmp.rules" + grep -E '^(windowrule|layerrule)\s*=' "$base_file" | sed -E 's/^\s+//;s/\s+$//' | sort -u >"$base_file.tmp.rules" + comm -23 "$old_user_file.tmp.rules" "$base_file.tmp.rules" >"$new_user_file" + # disables: lines commented in old user + grep -E '^\s*#\s*(windowrule|layerrule)\s*=' "$old_user_file" | sed -E 's/^\s*#\s*//' | sed -E 's/^\s+//;s/\s+$//' | sort -u >"$disable_file" + rm -f "$old_user_file.tmp.rules" "$base_file.tmp.rules" + fi +} + DIRPATH="$HOME/.config/$DIRH" BACKUP_DIR=$(get_backup_dirname) BACKUP_DIR_PATH="$DIRPATH-backup-$BACKUP_DIR/UserConfigs" @@ -830,14 +878,27 @@ if [ -d "$BACKUP_DIR_PATH" ]; then NOTES for RESTORING PREVIOUS CONFIGS β–ˆβ–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–„β–ˆ - If you decide to restore your old configs, make sure to - handle the updates or changes manually !!! + We now auto-migrate Startup_Apps and WindowRules by extracting + your additions into overlay files and optional disable lists. + This keeps new defaults while preserving your custom changes. " echo -e "${MAGENTA}Kindly Visit and check KooL's Hyprland-Dots GitHub page for the history of commits.${RESET}" for FILE_NAME in "${FILES_TO_RESTORE[@]}"; do BACKUP_FILE="$BACKUP_DIR_PATH/$FILE_NAME" if [ -f "$BACKUP_FILE" ]; then + # Special handling for Startup_Apps.conf and WindowRules.conf + if [ "$FILE_NAME" = "Startup_Apps.conf" ]; then + compose_overlay_from_backup "startup" "$DIRPATH/configs/Startup_Apps.conf" "$BACKUP_FILE" "$DIRPATH/UserConfigs/Startup_Apps.conf" "$DIRPATH/UserConfigs/Startup_Apps.disable" + echo "${OK} - Migrated overlay for ${YELLOW}$FILE_NAME${RESET}" 2>&1 | tee -a "$LOG" + continue + fi + if [ "$FILE_NAME" = "WindowRules.conf" ]; then + compose_overlay_from_backup "windowrules" "$DIRPATH/configs/WindowRules.conf" "$BACKUP_FILE" "$DIRPATH/UserConfigs/WindowRules.conf" "$DIRPATH/UserConfigs/WindowRules.disable" + echo "${OK} - Migrated overlay for ${YELLOW}$FILE_NAME${RESET}" 2>&1 | tee -a "$LOG" + continue + fi + printf "\n${INFO} Found ${YELLOW}$FILE_NAME${RESET} in hypr backup...\n" echo -n "${CAT} Do you want to restore ${YELLOW}$FILE_NAME${RESET} from backup? (y/N): " read file_restore @@ -855,6 +916,11 @@ if [ -d "$BACKUP_DIR_PATH" ]; then done fi +# Compose merged configs (Startup_Apps and WindowRules) +if [ -x "$DIRPATH/scripts/ComposeHyprConfigs.sh" ]; then + "$DIRPATH/scripts/ComposeHyprConfigs.sh" 2>&1 | tee -a "$LOG" || true +fi + printf "\n%.0s" {1..1} # Restoring previous UserScripts diff --git a/release.sh b/release.sh index 78063ee1..e29eaa79 100755 --- a/release.sh +++ b/release.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # /* ---- πŸ’« https://github.com/JaKooLit πŸ’« ---- */ # # For downloading dots from releases diff --git a/upgrade.sh b/upgrade.sh index a47bd48b..9aee3c2c 100755 --- a/upgrade.sh +++ b/upgrade.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # /* ---- πŸ’« https://github.com/JaKooLit πŸ’« ---- */ # # for Semi-Manual upgrading your system. # NOTE: requires rsync @@ -196,7 +196,12 @@ if version_gt "$latest_version" "$stored_version"; then chmod +x "$HOME/.config/hypr/scripts/"* 2>&1 | tee -a "$LOG" chmod +x "$HOME/.config/hypr/UserScripts/"* 2>&1 | tee -a "$LOG" # Set executable for initial-boot.sh - chmod +x "$HOME/.config/hypr/initial-boot.sh" 2>&1 | tee -a "$LOG" + chmod +x "$HOME/.config/hypr/initial-boot.sh" 2>&1 | tee -a "$LOG" + + # Compose merged configs (Startup_Apps and WindowRules) + if [ -x "$HOME/.config/hypr/scripts/ComposeHyprConfigs.sh" ]; then + "$HOME/.config/hypr/scripts/ComposeHyprConfigs.sh" 2>&1 | tee -a "$LOG" || true + fi else echo "$MAGENTA Upgrade declined. No files or directories changed" 2>&1 | tee -a "$LOG" fi -- cgit v1.2.3 From 70cb1f313d04558da9ab4e4f9ca5eecd373acb45 Mon Sep 17 00:00:00 2001 From: Don Williams Date: Thu, 30 Oct 2025 22:39:02 -0400 Subject: refactor(keybinds): use bindd with descriptions across configs - Convert binds to description form (bindd/bindld/binded/bindmd/bindlnd) - Keep naming as powermenu for shutdown/reboot/logout/suspend - Update KeyBinds.sh to parse and display descriptions - Update CHANGELOG --- CHANGELOG.md | 8 ++ config/hypr/UserConfigs/UserKeybinds.conf | 82 ++++++------- config/hypr/configs/Keybinds.conf | 196 +++++++++++++++--------------- config/hypr/scripts/KeyBinds.sh | 69 +++++++++-- 4 files changed, 203 insertions(+), 152 deletions(-) (limited to 'config/hypr/scripts') diff --git a/CHANGELOG.md b/CHANGELOG.md index 623e697c..dd01997b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,14 @@ ## October 2025 +### ⌨️ Keybinds + +- Convert Hyprland keybinds to description form (`bindd`, `bindld`, `binded`, + `bindmd`, `bindlnd`) in `config/hypr/...`. +- Add concise descriptions for each keybind; keep the name "powermenu". +- Update `config/hypr/scripts/KeyBinds.sh` to parse and display descriptions + as: MODS+KEY β€” DESCRIPTION β€” DISPATCHER [PARAMS]. + ### πŸ› Fixes - Updated `/bin/bash` to `/usr/bin/env bash` diff --git a/config/hypr/UserConfigs/UserKeybinds.conf b/config/hypr/UserConfigs/UserKeybinds.conf index 338bf0d1..5b257b33 100644 --- a/config/hypr/UserConfigs/UserKeybinds.conf +++ b/config/hypr/UserConfigs/UserKeybinds.conf @@ -16,67 +16,67 @@ source= $UserConfigs/01-UserDefaults.conf # common shortcuts #bindr = $mainMod, $mainMod_L, exec, pkill rofi || rofi -show drun -modi drun,filebrowser,run,window # Super Key to Launch rofi menu -bind = $mainMod, D, exec, pkill rofi || true && rofi -show drun -modi drun,filebrowser,run,window # Main Menu (APP Launcher) -bind = $mainMod, B, exec, xdg-open "https://" # default browser +bindd = $mainMod, D, app launcher, exec, pkill rofi || true && rofi -show drun -modi drun,filebrowser,run,window +bindd = $mainMod, B, open default browser, exec, xdg-open "https://" #bind = $mainMod, A, exec, pkill rofi || true && ags -t 'overview' # desktop overview (if installed) #bind = $mainMod, A, global, quickshell:overviewToggle # desktop overview (if installed) -bind = $mainMod, Return, exec, $term #terminal -bind = $mainMod, E, exec, $files #file manager +bindd = $mainMod, Return, terminal, exec, $term +bindd = $mainMod, E, file manager, exec, $files # FEATURES / EXTRAS -bind = $mainMod, H, exec, $scriptsDir/KeyHints.sh # help / cheat sheet -bind = $mainMod ALT, R, exec, $scriptsDir/Refresh.sh # Refresh waybar, swaync, rofi -bind = $mainMod ALT, E, exec, $scriptsDir/RofiEmoji.sh # emoji menu -bind = $mainMod, S, exec, $scriptsDir/RofiSearch.sh # Google search using rofi -bind = $mainMod CTRL, S, exec, rofi -show window # list/switch apps using rofi -bind = $mainMod ALT, O, exec, $scriptsDir/ChangeBlur.sh # Toggle blur settings -bind = $mainMod SHIFT, G, exec, $scriptsDir/GameMode.sh # Toggle animations ON/OFF -bind = $mainMod ALT, L, exec, $scriptsDir/ChangeLayout.sh # Toggle Master or Dwindle Layout -bind = $mainMod ALT, V, exec, $scriptsDir/ClipManager.sh # Clipboard Manager -bind = $mainMod CTRL, R, exec, $scriptsDir/RofiThemeSelector.sh # KooL Rofi Menu Theme Selector -bind = $mainMod CTRL SHIFT, R, exec, pkill rofi || true && $scriptsDir/RofiThemeSelector-modified.sh # modified Rofi Theme Selector +bindd = $mainMod, H, help / cheat sheet, exec, $scriptsDir/KeyHints.sh +bindd = $mainMod ALT, R, refresh bar and menus, exec, $scriptsDir/Refresh.sh +bindd = $mainMod ALT, E, emoji menu, exec, $scriptsDir/RofiEmoji.sh +bindd = $mainMod, S, web search, exec, $scriptsDir/RofiSearch.sh +bindd = $mainMod CTRL, S, window switcher, exec, rofi -show window +bindd = $mainMod ALT, O, toggle blur, exec, $scriptsDir/ChangeBlur.sh +bindd = $mainMod SHIFT, G, toggle game mode, exec, $scriptsDir/GameMode.sh +bindd = $mainMod ALT, L, toggle master/dwindle layout, exec, $scriptsDir/ChangeLayout.sh +bindd = $mainMod ALT, V, clipboard manager, exec, $scriptsDir/ClipManager.sh +bindd = $mainMod CTRL, R, rofi theme selector, exec, $scriptsDir/RofiThemeSelector.sh +bindd = $mainMod CTRL SHIFT, R, rofi theme selector (modified), exec, pkill rofi || true && $scriptsDir/RofiThemeSelector-modified.sh -bind = $mainMod SHIFT, F, fullscreen # whole full screen -bind = $mainMod CTRL, F, fullscreen, 1 # fake full screen -bind = $mainMod, SPACE, togglefloating, #Float Mode -bind = $mainMod ALT, SPACE, exec, hyprctl dispatch workspaceopt allfloat #All Float Mode -bind = $mainMod SHIFT, Return, exec, $scriptsDir/Dropterminal.sh $term # Dropdown terminal +bindd = $mainMod SHIFT, F, fullscreen, fullscreen +bindd = $mainMod CTRL, F, fake fullscreen, fullscreen, 1 +bindd = $mainMod, SPACE, toggle floating, togglefloating, +bindd = $mainMod ALT, SPACE, all float mode, exec, hyprctl dispatch workspaceopt allfloat +bindd = $mainMod SHIFT, Return, dropdown terminal, exec, $scriptsDir/Dropterminal.sh $term # Desktop zooming or magnifier -bind = $mainMod ALT, mouse_down, exec, hyprctl keyword cursor:zoom_factor "$(hyprctl getoption cursor:zoom_factor | awk 'NR==1 {factor = $2; if (factor < 1) {factor = 1}; print factor * 2.0}')" -bind = $mainMod ALT, mouse_up, exec, hyprctl keyword cursor:zoom_factor "$(hyprctl getoption cursor:zoom_factor | awk 'NR==1 {factor = $2; if (factor < 1) {factor = 1}; print factor / 2.0}')" +bindd = $mainMod ALT, mouse_down, zoom in, exec, hyprctl keyword cursor:zoom_factor "$(hyprctl getoption cursor:zoom_factor | awk 'NR==1 {factor = $2; if (factor < 1) {factor = 1}; print factor * 2.0}')" +bindd = $mainMod ALT, mouse_up, zoom out, exec, hyprctl keyword cursor:zoom_factor "$(hyprctl getoption cursor:zoom_factor | awk 'NR==1 {factor = $2; if (factor < 1) {factor = 1}; print factor / 2.0}')" ## NOTES for ja (Hyprland version 0.39 (Ubuntu 24.04)) #bind = $mainMod ALT, mouse_down, exec, hyprctl keyword misc:cursor_zoom_factor "$(hyprctl getoption misc:cursor_zoom_factor | awk 'NR==1 {factor = $2; if (factor < 1) {factor = 1}; print factor * 2.0}')" #bind = $mainMod ALT, mouse_up, exec, hyprctl keyword misc:cursor_zoom_factor "$(hyprctl getoption misc:cursor_zoom_factor | awk 'NR==1 {factor = $2; if (factor < 1) {factor = 1}; print factor / 2.0}')" # Waybar / Bar related -bind = $mainMod CTRL ALT, B, exec, pkill -SIGUSR1 waybar # Toggle hide/show waybar -bind = $mainMod CTRL, B, exec, $scriptsDir/WaybarStyles.sh # Waybar Styles Menu -bind = $mainMod ALT, B, exec, $scriptsDir/WaybarLayout.sh # Waybar Layout Menu +bindd = $mainMod CTRL ALT, B, toggle waybar, exec, pkill -SIGUSR1 waybar +bindd = $mainMod CTRL, B, waybar styles menu, exec, $scriptsDir/WaybarStyles.sh +bindd = $mainMod ALT, B, waybar layout menu, exec, $scriptsDir/WaybarLayout.sh # Night light toggle (Hyprsunset) -bind = $mainMod, N, exec, $scriptsDir/Hyprsunset.sh toggle +bindd = $mainMod, N, toggle night light, exec, $scriptsDir/Hyprsunset.sh toggle # FEATURES / EXTRAS (UserScripts) -bind = $mainMod SHIFT, M, exec, $UserScripts/RofiBeats.sh # online music using rofi -bind = $mainMod, W, exec, $UserScripts/WallpaperSelect.sh # Select wallpaper to apply -bind = $mainMod SHIFT, W, exec, $UserScripts/WallpaperEffects.sh # Wallpaper Effects by imagemagick -bind = CTRL ALT, W, exec, $UserScripts/WallpaperRandom.sh # Random wallpapers -bind = $mainMod CTRL, O, exec, hyprctl setprop active opaque toggle # disable opacity on active window -bind = $mainMod SHIFT, K, exec, $scriptsDir/KeyBinds.sh # search keybinds via rofi -bind = $mainMod SHIFT, A, exec, $scriptsDir/Animations.sh #hyprland animations menu -bind = $mainMod SHIFT, O, exec, $UserScripts/ZshChangeTheme.sh # Change oh-my-zsh theme -bindln = ALT_L, SHIFT_L, exec, $scriptsDir/SwitchKeyboardLayout.sh # Change keyboard layout globally -bindln = SHIFT_L, ALT_L, exec, $scriptsDir/Tak0-Per-Window-Switch.sh # Change keyboard layout locally for each window -bind = $mainMod ALT, C, exec, $UserScripts/RofiCalc.sh # calculator (qalculate) +bindd = $mainMod SHIFT, M, online music, exec, $UserScripts/RofiBeats.sh +bindd = $mainMod, W, select wallpaper, exec, $UserScripts/WallpaperSelect.sh +bindd = $mainMod SHIFT, W, wallpaper effects, exec, $UserScripts/WallpaperEffects.sh +bindd = CTRL ALT, W, random wallpaper, exec, $UserScripts/WallpaperRandom.sh +bindd = $mainMod CTRL, O, toggle active window opacity, exec, hyprctl setprop active opaque toggle +bindd = $mainMod SHIFT, K, search keybinds, exec, $scriptsDir/KeyBinds.sh +bindd = $mainMod SHIFT, A, animations menu, exec, $scriptsDir/Animations.sh +bindd = $mainMod SHIFT, O, change oh-my-zsh theme, exec, $UserScripts/ZshChangeTheme.sh +bindlnd = ALT_L, SHIFT_L, switch keyboard layout globally, exec, $scriptsDir/SwitchKeyboardLayout.sh +bindlnd = SHIFT_L, ALT_L, switch keyboard layout per-window, exec, $scriptsDir/Tak0-Per-Window-Switch.sh +bindd = $mainMod ALT, C, calculator, exec, $UserScripts/RofiCalc.sh # Move current workspaces to monitors (left right up or down) -bind = $mainMod CTRL, F9, movecurrentworkspacetomonitor, l #move current workspace to LEFT monitor -bind = $mainMod CTRL, F10, movecurrentworkspacetomonitor, r #move current workspace to RIGHT monitor -bind = $mainMod CTRL, F11, movecurrentworkspacetomonitor, u #move current workspace to UP monitor -bind = $mainMod CTRL, F12, movecurrentworkspacetomonitor, d #move current workspace to DOWN monitor +bindd = $mainMod CTRL, F9, move workspace to left monitor, movecurrentworkspacetomonitor, l +bindd = $mainMod CTRL, F10, move workspace to right monitor, movecurrentworkspacetomonitor, r +bindd = $mainMod CTRL, F11, move workspace to up monitor, movecurrentworkspacetomonitor, u +bindd = $mainMod CTRL, F12, move workspace to down monitor, movecurrentworkspacetomonitor, d # For passthrough keyboard into a VM diff --git a/config/hypr/configs/Keybinds.conf b/config/hypr/configs/Keybinds.conf index c2ba9681..0fa250b7 100644 --- a/config/hypr/configs/Keybinds.conf +++ b/config/hypr/configs/Keybinds.conf @@ -8,142 +8,142 @@ $scriptsDir = $HOME/.config/hypr/scripts $UserConfigs = $HOME/.config/hypr/UserConfigs $UserScripts = $HOME/.config/hypr/UserScripts -bind = CTRL ALT, Delete, exec, hyprctl dispatch exit 0 # exit Hyprland -bind = $mainMod, Q, killactive, # close active (not kill) -bind = $mainMod SHIFT, Q, exec, $scriptsDir/KillActiveProcess.sh # Kill active process -bind = CTRL ALT, L, exec, $scriptsDir/LockScreen.sh # screen lock -bind = CTRL ALT, P, exec, $scriptsDir/Wlogout.sh # power menu -bind = $mainMod SHIFT, N, exec, swaync-client -t -sw # swayNC notification panel -bind = $mainMod SHIFT, E, exec, $scriptsDir/Kool_Quick_Settings.sh # Settings Menu KooL Hyprland Settings +bindd = CTRL ALT, Delete, exit Hyprland, exec, hyprctl dispatch exit 0 +bindd = $mainMod, Q, close active window, killactive, +bindd = $mainMod SHIFT, Q, kill active process, exec, $scriptsDir/KillActiveProcess.sh +bindd = CTRL ALT, L, lock screen, exec, $scriptsDir/LockScreen.sh +bindd = CTRL ALT, P, powermenu, exec, $scriptsDir/Wlogout.sh +bindd = $mainMod SHIFT, N, notification panel, exec, swaync-client -t -sw +bindd = $mainMod SHIFT, E, settings menu, exec, $scriptsDir/Kool_Quick_Settings.sh # Master Layout -bind = $mainMod CTRL, D, layoutmsg, removemaster -bind = $mainMod, I, layoutmsg, addmaster -bind = $mainMod, J, layoutmsg, cyclenext -bind = $mainMod, K, layoutmsg, cycleprev -bind = $mainMod CTRL, Return, layoutmsg, swapwithmaster +bindd = $mainMod CTRL, D, remove master, layoutmsg, removemaster +bindd = $mainMod, I, add master, layoutmsg, addmaster +bindd = $mainMod, J, cycle next, layoutmsg, cyclenext +bindd = $mainMod, K, cycle previous, layoutmsg, cycleprev +bindd = $mainMod CTRL, Return, swap with master, layoutmsg, swapwithmaster # Dwindle Layout -bind = $mainMod SHIFT, I, togglesplit # only works on dwindle layout -bind = $mainMod, P, pseudo, # dwindle +bindd = $mainMod SHIFT, I, toggle split (dwindle), togglesplit +bindd = $mainMod, P, toggle pseudo (dwindle), pseudo, # Works on either layout (Master or Dwindle) -bind = $mainMod, M, exec, hyprctl dispatch splitratio 0.3 +bindd = $mainMod, M, set split ratio 0.3, exec, hyprctl dispatch splitratio 0.3 # group -bind = $mainMod, G, togglegroup # toggle group -bind = $mainMod CTRL, tab, changegroupactive # change focus to another window +bindd = $mainMod, G, toggle group, togglegroup +bindd = $mainMod CTRL, tab, change active in group, changegroupactive - # Cycle windows if floating bring to top -bind = ALT, tab, cyclenext -bind = ALT, tab, bringactivetotop +# Cycle windows; if floating bring to top +bindd = ALT, tab, cycle next window, cyclenext +bindd = ALT, tab, bring active to top, bringactivetotop # Special Keys / Hot Keys -bindel = , xf86audioraisevolume, exec, $scriptsDir/Volume.sh --inc # volume up -bindel = , xf86audiolowervolume, exec, $scriptsDir/Volume.sh --dec # volume down -bindl = , xf86AudioMicMute, exec, $scriptsDir/Volume.sh --toggle-mic # mic mute -bindl = , xf86audiomute, exec, $scriptsDir/Volume.sh --toggle # mute -bindl = , xf86Sleep, exec, systemctl suspend # sleep button -bindl = , xf86Rfkill, exec, $scriptsDir/AirplaneMode.sh # Airplane mode +bindeld = , xf86audioraisevolume, volume up, exec, $scriptsDir/Volume.sh --inc +bindeld = , xf86audiolowervolume, volume down, exec, $scriptsDir/Volume.sh --dec +bindld = , xf86AudioMicMute, toggle mic mute, exec, $scriptsDir/Volume.sh --toggle-mic +bindld = , xf86audiomute, toggle mute, exec, $scriptsDir/Volume.sh --toggle +bindld = , xf86Sleep, sleep, exec, systemctl suspend +bindld = , xf86Rfkill, airplane mode, exec, $scriptsDir/AirplaneMode.sh # media controls using keyboards -bindl = , xf86AudioPlayPause, exec, $scriptsDir/MediaCtrl.sh --pause -bindl = , xf86AudioPause, exec, $scriptsDir/MediaCtrl.sh --pause -bindl = , xf86AudioPlay, exec, $scriptsDir/MediaCtrl.sh --pause -bindl = , xf86AudioNext, exec, $scriptsDir/MediaCtrl.sh --nxt -bindl = , xf86AudioPrev, exec, $scriptsDir/MediaCtrl.sh --prv -bindl = , xf86audiostop, exec, $scriptsDir/MediaCtrl.sh --stop +bindld = , xf86AudioPlayPause, play/pause, exec, $scriptsDir/MediaCtrl.sh --pause +bindld = , xf86AudioPause, pause, exec, $scriptsDir/MediaCtrl.sh --pause +bindld = , xf86AudioPlay, play, exec, $scriptsDir/MediaCtrl.sh --pause +bindld = , xf86AudioNext, next track, exec, $scriptsDir/MediaCtrl.sh --nxt +bindld = , xf86AudioPrev, previous track, exec, $scriptsDir/MediaCtrl.sh --prv +bindld = , xf86audiostop, stop, exec, $scriptsDir/MediaCtrl.sh --stop # Screenshot keybindings NOTE: You may need to press Fn key as well -bind = $mainMod, Print, exec, $scriptsDir/ScreenShot.sh --now # screenshot -bind = $mainMod SHIFT, Print, exec, $scriptsDir/ScreenShot.sh --area # screenshot (area) -bind = $mainMod CTRL, Print, exec, $scriptsDir/ScreenShot.sh --in5 # screenshot (5 secs delay) -bind = $mainMod CTRL SHIFT, Print, exec, $scriptsDir/ScreenShot.sh --in10 # screenshot (10 secs delay) -bind = ALT, Print, exec, $scriptsDir/ScreenShot.sh --active # screenshot (active window only) +bindd = $mainMod, Print, screenshot now, exec, $scriptsDir/ScreenShot.sh --now +bindd = $mainMod SHIFT, Print, screenshot (area), exec, $scriptsDir/ScreenShot.sh --area +bindd = $mainMod CTRL, Print, screenshot in 5s, exec, $scriptsDir/ScreenShot.sh --in5 +bindd = $mainMod CTRL SHIFT, Print, screenshot in 10s, exec, $scriptsDir/ScreenShot.sh --in10 +bindd = ALT, Print, screenshot active window, exec, $scriptsDir/ScreenShot.sh --active # screenshot with swappy (another screenshot tool) -bind = $mainMod SHIFT, S, exec, $scriptsDir/ScreenShot.sh --swappy #screenshot (swappy) +bindd = $mainMod SHIFT, S, screenshot (swappy), exec, $scriptsDir/ScreenShot.sh --swappy # Resize windows -binde = $mainMod SHIFT, left, resizeactive,-50 0 -binde = $mainMod SHIFT, right, resizeactive,50 0 -binde = $mainMod SHIFT, up, resizeactive,0 -50 -binde = $mainMod SHIFT, down, resizeactive,0 50 +binded = $mainMod SHIFT, left, resize left (-50), resizeactive, -50 0 +binded = $mainMod SHIFT, right, resize right (+50), resizeactive, 50 0 +binded = $mainMod SHIFT, up, resize up (-50), resizeactive, 0 -50 +binded = $mainMod SHIFT, down, resize down (+50), resizeactive, 0 50 # Move windows -bind = $mainMod CTRL, left, movewindow, l -bind = $mainMod CTRL, right, movewindow, r -bind = $mainMod CTRL, up, movewindow, u -bind = $mainMod CTRL, down, movewindow, d +bindd = $mainMod CTRL, left, move window left, movewindow, l +bindd = $mainMod CTRL, right, move window right, movewindow, r +bindd = $mainMod CTRL, up, move window up, movewindow, u +bindd = $mainMod CTRL, down, move window down, movewindow, d # Swap windows -bind = $mainMod ALT, left, swapwindow, l -bind = $mainMod ALT, right, swapwindow, r -bind = $mainMod ALT, up, swapwindow, u -bind = $mainMod ALT, down, swapwindow, d +bindd = $mainMod ALT, left, swap window left, swapwindow, l +bindd = $mainMod ALT, right, swap window right, swapwindow, r +bindd = $mainMod ALT, up, swap window up, swapwindow, u +bindd = $mainMod ALT, down, swap window down, swapwindow, d # Move focus with mainMod + arrow keys -bind = $mainMod, left, movefocus, l -bind = $mainMod, right, movefocus, r -bind = $mainMod, up, movefocus, u -bind = $mainMod, down, movefocus, d +bindd = $mainMod, left, focus left, movefocus, l +bindd = $mainMod, right, focus right, movefocus, r +bindd = $mainMod, up, focus up, movefocus, u +bindd = $mainMod, down, focus down, movefocus, d # Workspaces related -bind = $mainMod, tab, workspace, m+1 -bind = $mainMod SHIFT, tab, workspace, m-1 +bindd = $mainMod, tab, next workspace, workspace, m+1 +bindd = $mainMod SHIFT, tab, previous workspace, workspace, m-1 # Special workspace -bind = $mainMod SHIFT, U, movetoworkspace, special -bind = $mainMod, U, togglespecialworkspace, +bindd = $mainMod SHIFT, U, move to special workspace, movetoworkspace, special +bindd = $mainMod, U, toggle special workspace, togglespecialworkspace, # The following mappings use the key codes to better support various keyboard layouts # 1 is code:10, 2 is code 11, etc # Switch workspaces with mainMod + [0-9] -bind = $mainMod, code:10, workspace, 1 # NOTE: code:10 = key 1 -bind = $mainMod, code:11, workspace, 2 # NOTE: code:11 = key 2 -bind = $mainMod, code:12, workspace, 3 # NOTE: code:12 = key 3 -bind = $mainMod, code:13, workspace, 4 # NOTE: code:13 = key 4 -bind = $mainMod, code:14, workspace, 5 # NOTE: code:14 = key 5 -bind = $mainMod, code:15, workspace, 6 # NOTE: code:15 = key 6 -bind = $mainMod, code:16, workspace, 7 # NOTE: code:16 = key 7 -bind = $mainMod, code:17, workspace, 8 # NOTE: code:17 = key 8 -bind = $mainMod, code:18, workspace, 9 # NOTE: code:18 = key 9 -bind = $mainMod, code:19, workspace, 10 # NOTE: code:19 = key 0 +bindd = $mainMod, code:10, workspace 1, workspace, 1 # NOTE: code:10 = key 1 +bindd = $mainMod, code:11, workspace 2, workspace, 2 # NOTE: code:11 = key 2 +bindd = $mainMod, code:12, workspace 3, workspace, 3 # NOTE: code:12 = key 3 +bindd = $mainMod, code:13, workspace 4, workspace, 4 # NOTE: code:13 = key 4 +bindd = $mainMod, code:14, workspace 5, workspace, 5 # NOTE: code:14 = key 5 +bindd = $mainMod, code:15, workspace 6, workspace, 6 # NOTE: code:15 = key 6 +bindd = $mainMod, code:16, workspace 7, workspace, 7 # NOTE: code:16 = key 7 +bindd = $mainMod, code:17, workspace 8, workspace, 8 # NOTE: code:17 = key 8 +bindd = $mainMod, code:18, workspace 9, workspace, 9 # NOTE: code:18 = key 9 +bindd = $mainMod, code:19, workspace 10, workspace, 10 # NOTE: code:19 = key 0 # Move active window and follow to workspace mainMod + SHIFT [0-9] -bind = $mainMod SHIFT, code:10, movetoworkspace, 1 # NOTE: code:10 = key 1 -bind = $mainMod SHIFT, code:11, movetoworkspace, 2 # NOTE: code:11 = key 2 -bind = $mainMod SHIFT, code:12, movetoworkspace, 3 # NOTE: code:12 = key 3 -bind = $mainMod SHIFT, code:13, movetoworkspace, 4 # NOTE: code:13 = key 4 -bind = $mainMod SHIFT, code:14, movetoworkspace, 5 # NOTE: code:14 = key 5 -bind = $mainMod SHIFT, code:15, movetoworkspace, 6 # NOTE: code:15 = key 6 -bind = $mainMod SHIFT, code:16, movetoworkspace, 7 # NOTE: code:16 = key 7 -bind = $mainMod SHIFT, code:17, movetoworkspace, 8 # NOTE: code:17 = key 8 -bind = $mainMod SHIFT, code:18, movetoworkspace, 9 # NOTE: code:18 = key 9 -bind = $mainMod SHIFT, code:19, movetoworkspace, 10 # NOTE: code:19 = key 0 -bind = $mainMod SHIFT, bracketleft, movetoworkspace, -1 # brackets [ -bind = $mainMod SHIFT, bracketright, movetoworkspace, +1 # brackets ] +bindd = $mainMod SHIFT, code:10, move to workspace 1, movetoworkspace, 1 # NOTE: code:10 = key 1 +bindd = $mainMod SHIFT, code:11, move to workspace 2, movetoworkspace, 2 # NOTE: code:11 = key 2 +bindd = $mainMod SHIFT, code:12, move to workspace 3, movetoworkspace, 3 # NOTE: code:12 = key 3 +bindd = $mainMod SHIFT, code:13, move to workspace 4, movetoworkspace, 4 # NOTE: code:13 = key 4 +bindd = $mainMod SHIFT, code:14, move to workspace 5, movetoworkspace, 5 # NOTE: code:14 = key 5 +bindd = $mainMod SHIFT, code:15, move to workspace 6, movetoworkspace, 6 # NOTE: code:15 = key 6 +bindd = $mainMod SHIFT, code:16, move to workspace 7, movetoworkspace, 7 # NOTE: code:16 = key 7 +bindd = $mainMod SHIFT, code:17, move to workspace 8, movetoworkspace, 8 # NOTE: code:17 = key 8 +bindd = $mainMod SHIFT, code:18, move to workspace 9, movetoworkspace, 9 # NOTE: code:18 = key 9 +bindd = $mainMod SHIFT, code:19, move to workspace 10, movetoworkspace, 10 # NOTE: code:19 = key 0 +bindd = $mainMod SHIFT, bracketleft, move to previous workspace, movetoworkspace, -1 # brackets [ +bindd = $mainMod SHIFT, bracketright, move to next workspace, movetoworkspace, +1 # brackets ] # Move active window to a workspace silently mainMod + CTRL [0-9] -bind = $mainMod CTRL, code:10, movetoworkspacesilent, 1 # NOTE: code:10 = key 1 -bind = $mainMod CTRL, code:11, movetoworkspacesilent, 2 # NOTE: code:11 = key 2 -bind = $mainMod CTRL, code:12, movetoworkspacesilent, 3 # NOTE: code:12 = key 3 -bind = $mainMod CTRL, code:13, movetoworkspacesilent, 4 # NOTE: code:13 = key 4 -bind = $mainMod CTRL, code:14, movetoworkspacesilent, 5 # NOTE: code:14 = key 5 -bind = $mainMod CTRL, code:15, movetoworkspacesilent, 6 # NOTE: code:15 = key 6 -bind = $mainMod CTRL, code:16, movetoworkspacesilent, 7 # NOTE: code:16 = key 7 -bind = $mainMod CTRL, code:17, movetoworkspacesilent, 8 # NOTE: code:17 = key 8 -bind = $mainMod CTRL, code:18, movetoworkspacesilent, 9 # NOTE: code:18 = key 9 -bind = $mainMod CTRL, code:19, movetoworkspacesilent, 10 # NOTE: code:19 = key 0 -bind = $mainMod CTRL, bracketleft, movetoworkspacesilent, -1 # brackets [ -bind = $mainMod CTRL, bracketright, movetoworkspacesilent, +1 # brackets ] +bindd = $mainMod CTRL, code:10, move silently to workspace 1, movetoworkspacesilent, 1 # NOTE: code:10 = key 1 +bindd = $mainMod CTRL, code:11, move silently to workspace 2, movetoworkspacesilent, 2 # NOTE: code:11 = key 2 +bindd = $mainMod CTRL, code:12, move silently to workspace 3, movetoworkspacesilent, 3 # NOTE: code:12 = key 3 +bindd = $mainMod CTRL, code:13, move silently to workspace 4, movetoworkspacesilent, 4 # NOTE: code:13 = key 4 +bindd = $mainMod CTRL, code:14, move silently to workspace 5, movetoworkspacesilent, 5 # NOTE: code:14 = key 5 +bindd = $mainMod CTRL, code:15, move silently to workspace 6, movetoworkspacesilent, 6 # NOTE: code:15 = key 6 +bindd = $mainMod CTRL, code:16, move silently to workspace 7, movetoworkspacesilent, 7 # NOTE: code:16 = key 7 +bindd = $mainMod CTRL, code:17, move silently to workspace 8, movetoworkspacesilent, 8 # NOTE: code:17 = key 8 +bindd = $mainMod CTRL, code:18, move silently to workspace 9, movetoworkspacesilent, 9 # NOTE: code:18 = key 9 +bindd = $mainMod CTRL, code:19, move silently to workspace 10, movetoworkspacesilent, 10 # NOTE: code:19 = key 0 +bindd = $mainMod CTRL, bracketleft, move silently to previous workspace, movetoworkspacesilent, -1 # brackets [ +bindd = $mainMod CTRL, bracketright, move silently to next workspace, movetoworkspacesilent, +1 # brackets ] # Scroll through existing workspaces with mainMod + scroll -bind = $mainMod, mouse_down, workspace, e+1 -bind = $mainMod, mouse_up, workspace, e-1 -bind = $mainMod, period, workspace, e+1 -bind = $mainMod, comma, workspace, e-1 +bindd = $mainMod, mouse_down, next workspace, workspace, e+1 +bindd = $mainMod, mouse_up, previous workspace, workspace, e-1 +bindd = $mainMod, period, next workspace, workspace, e+1 +bindd = $mainMod, comma, previous workspace, workspace, e-1 # Move/resize windows with mainMod + LMB/RMB and dragging -bindm = $mainMod, mouse:272, movewindow # NOTE: mouse:272 = left click -bindm = $mainMod, mouse:273, resizewindow # NOTE: mouse:272 = right click \ No newline at end of file +bindmd = $mainMod, mouse:272, move window, movewindow # NOTE: mouse:272 = left click +bindmd = $mainMod, mouse:273, resize window, resizewindow # NOTE: mouse:272 = right click diff --git a/config/hypr/scripts/KeyBinds.sh b/config/hypr/scripts/KeyBinds.sh index 3a19390f..46953cc5 100755 --- a/config/hypr/scripts/KeyBinds.sh +++ b/config/hypr/scripts/KeyBinds.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash # /* ---- πŸ’« https://github.com/JaKooLit πŸ’« ---- */ ## -# searchable enabled keybinds using rofi +# searchable enabled keybinds using rofi (supports bindd descriptions) # kill yad to not interfere with this binds pkill yad || true @@ -17,23 +17,66 @@ laptop_conf="$HOME/.config/hypr/UserConfigs/Laptops.conf" rofi_theme="$HOME/.config/rofi/config-keybinds.rasi" msg='☣️ NOTE ☣️: Clicking with Mouse or Pressing ENTER will have NO function' -# combine the contents of the keybinds files and filter for keybinds -keybinds=$(cat "$keybinds_conf" "$user_keybinds_conf" | grep -E '^bind') +# collect raw bind lines (strip end-of-line comments) from available files +files=("$keybinds_conf" "$user_keybinds_conf") +[[ -f "$laptop_conf" ]] && files+=("$laptop_conf") -# check if laptop.conf exists and add its keybinds if present -if [[ -f "$laptop_conf" ]]; then - laptop_binds=$(grep -E '^bind' "$laptop_conf") - keybinds+=$'\n'"$laptop_binds" -fi +raw_keybinds=$(cat "${files[@]}" 2>/dev/null \ + | grep -E '^[[:space:]]*bind' \ + | sed -E 's/[[:space:]]+#.*$//') # check for any keybinds to display -if [[ -z "$keybinds" ]]; then +if [[ -z "$raw_keybinds" ]]; then echo "no keybinds found." exit 1 fi -# replace $mainmod with super in the displayed keybinds for rofi -display_keybinds=$(echo "$keybinds" | sed 's/\$mainMod/SUPER/g') +# transform into a readable list: MODS+KEY β€” DESCRIPTION β€” DISPATCHER [PARAMS] +display_keybinds=$(echo "$raw_keybinds" | awk -F'=' ' + function trim(s){ gsub(/^[ \t]+|[ \t]+$/,"",s); return s } + /^[[:space:]]*bind/ { + binder=$1; gsub(/[ \t]/, "", binder); + hasdesc = (index(binder, "d")>0); + + rhs=$2; rhs=trim(rhs); + n=split(rhs, a, /[ \t]*,[ \t]*/); + + mods=trim(a[1]); key=(n>=2?trim(a[2]):""); + desc=""; dispatcher=""; params=""; + + if (hasdesc) { + desc=(n>=3?trim(a[3]):""); + dispatcher=(n>=4?trim(a[4]):""); + start=5; + } else { + dispatcher=(n>=3?trim(a[3]):""); + start=4; + } + + for(i=start;i<=n;i++){ if(length(a[i])){ p=trim(a[i]); if(p!="") params = (params?params", ":"") p } } + + gsub(/\$mainMod/,"SUPER",mods); + gsub(/[ \t]+/,"+",mods); + + combo = (mods && key) ? mods "+" key : (key?key:mods); + + if (desc != "") { + if (dispatcher != "" && params != "") + print combo, " β€” ", desc, " β€” ", dispatcher, " ", params; + else if (dispatcher != "") + print combo, " β€” ", desc, " β€” ", dispatcher; + else + print combo, " β€” ", desc; + } else { + if (dispatcher != "" && params != "") + print combo, " β€” ", dispatcher, " ", params; + else if (dispatcher != "") + print combo, " β€” ", dispatcher; + else + print combo; + } + } +') -# use rofi to display the keybinds with the modified content -echo "$display_keybinds" | rofi -dmenu -i -config "$rofi_theme" -mesg "$msg" \ No newline at end of file +# use rofi to display the keybinds +printf '%s\n' "$display_keybinds" | rofi -dmenu -i -config "$rofi_theme" -mesg "$msg" -- cgit v1.2.3 From 7441f2cb05b6916ff7cb08a8c0f14b7ff865a1b1 Mon Sep 17 00:00:00 2001 From: Don Williams Date: Sun, 2 Nov 2025 17:23:53 -0500 Subject: feat: Add smart AGS/Quickshell fallback with OverviewToggle wrapper Implements a robust fallback mechanism for desktop overview functionality that handles both AGS and Quickshell installations gracefully. Changes: - Add OverviewToggle.sh wrapper script that tries Quickshell first, falls back to AGS if unavailable or broken - Update UserKeybinds.conf with new SUPER+A binding to OverviewToggle.sh - Preserve original AGS and Quickshell keybinds as commented references - Simplify copy.sh logic to enable both AGS and QS simultaneously - Remove conflicting keybind toggle logic from copy.sh Benefits: - Users can have both AGS and Quickshell installed simultaneously - Automatic fallback when one tool is broken or unavailable - Quickshell preferred (tried first) as it's more performant - Graceful degradation with user notification if neither available - Auto-starts AGS if installed but not running - Compatible with existing upgrade.sh and ComposeHyprConfigs.sh workflow Technical details: - OverviewToggle.sh checks for running processes before attempting toggle - Uses hyprctl dispatch for Quickshell's global dispatcher - Falls back to ags -t 'overview' with rofi cleanup for AGS - Shows desktop notification if neither tool is available - Script auto-made executable via existing chmod in copy.sh (line 1027) Addresses: Issue where AGS and Quickshell have had recent stability problems, requiring manual keybind switching between them --- config/hypr/UserConfigs/UserKeybinds.conf | 1 + config/hypr/scripts/OverviewToggle.sh | 28 ++++++++++++++++++++++++++++ copy.sh | 21 +++++++-------------- 3 files changed, 36 insertions(+), 14 deletions(-) create mode 100644 config/hypr/scripts/OverviewToggle.sh (limited to 'config/hypr/scripts') diff --git a/config/hypr/UserConfigs/UserKeybinds.conf b/config/hypr/UserConfigs/UserKeybinds.conf index 4bebe342..17711559 100644 --- a/config/hypr/UserConfigs/UserKeybinds.conf +++ b/config/hypr/UserConfigs/UserKeybinds.conf @@ -18,6 +18,7 @@ source= $UserConfigs/01-UserDefaults.conf #bindr = $mainMod, $mainMod_L, exec, pkill rofi || rofi -show drun -modi drun,filebrowser,run,window # Super Key to Launch rofi menu bindd = $mainMod, D, app launcher, exec, pkill rofi || true && rofi -show drun -modi drun,filebrowser,run,window bindd = $mainMod, B, open default browser, exec, xdg-open "https://" +bindd = $mainMod, A, desktop overview, exec, $scriptsDir/OverviewToggle.sh # toggles quickshell or ags overview (tries QS first, falls back to AGS) #bindd = $mainMod, A, ags overview, exec, pkill rofi || true && ags -t 'overview' # desktop overview (if installed) #bindd = $mainMod, A, Quickshell overview, global, quickshell:overviewToggle # desktop overview (if installed) bindd = $mainMod, Return, Open terminal, exec, $term diff --git a/config/hypr/scripts/OverviewToggle.sh b/config/hypr/scripts/OverviewToggle.sh new file mode 100644 index 00000000..18683984 --- /dev/null +++ b/config/hypr/scripts/OverviewToggle.sh @@ -0,0 +1,28 @@ +#!/usr/bin/env bash +# /* ---- πŸ’« https://github.com/JaKooLit πŸ’« ---- */ # +# Overview toggle wrapper - tries quickshell first, falls back to AGS + +# Try quickshell first if installed +if command -v qs >/dev/null 2>&1; then + # Check if quickshell is running + if pgrep -x qs >/dev/null 2>&1; then + # Try to toggle quickshell overview + hyprctl dispatch global quickshell:overviewToggle 2>/dev/null && exit 0 + fi +fi + +# Fall back to AGS if quickshell failed or isn't available +if command -v ags >/dev/null 2>&1; then + # Check if AGS is running, start it if not + if ! pgrep -x ags >/dev/null 2>&1; then + ags & + sleep 0.5 + fi + # Toggle AGS overview + pkill rofi || true + ags -t 'overview' 2>/dev/null && exit 0 +fi + +# If we get here, neither worked +notify-send "Overview" "Neither Quickshell nor AGS is available" -u low 2>/dev/null || true +exit 1 diff --git a/copy.sh b/copy.sh index 762af601..b4e958a9 100755 --- a/copy.sh +++ b/copy.sh @@ -259,38 +259,31 @@ if command -v blueman-applet >/dev/null 2>&1; then grep -qx 'exec-once = blueman-applet' "$OVERLAY_SA" || echo 'exec-once = blueman-applet' >>"$OVERLAY_SA" fi -# Check if ags is installed edit ags behaviour on configs +# Check if ags is installed and enable it if command -v ags >/dev/null 2>&1; then + echo "${INFO} AGS detected - enabling in startup and refresh scripts" 2>&1 | tee -a "$LOG" OVERLAY_SA="config/hypr/UserConfigs/Startup_Apps.conf" mkdir -p "$(dirname "$OVERLAY_SA")" touch "$OVERLAY_SA" grep -qx 'exec-once = ags' "$OVERLAY_SA" || echo 'exec-once = ags' >>"$OVERLAY_SA" sed -i '/#ags -q && ags &/s/^#//' config/hypr/scripts/RefreshNoWaybar.sh sed -i '/#ags -q && ags &/s/^#//' config/hypr/scripts/Refresh.sh - - # Uncomment the ags overview keybind - sed -i '/^#bind = \$mainMod, A, exec, pkill rofi || true && ags -t '\''overview'\''/s/^#//' config/hypr/UserConfigs/UserKeybinds.conf - - # Comment the quickshell line if not already commented - sed -i '/^\s*bind\s*=\s*\$mainMod,\s*A,\s*global,\s*quickshell:overviewToggle/{s/^\s*/#/}' config/hypr/UserConfigs/UserKeybinds.conf fi -# Check if quickshell is installed; edit quickshell behaviour on configs +# Check if quickshell is installed and enable it if command -v qs >/dev/null 2>&1; then + echo "${INFO} Quickshell detected - enabling in startup and refresh scripts" 2>&1 | tee -a "$LOG" OVERLAY_SA="config/hypr/UserConfigs/Startup_Apps.conf" mkdir -p "$(dirname "$OVERLAY_SA")" touch "$OVERLAY_SA" grep -qx 'exec-once = qs' "$OVERLAY_SA" || echo 'exec-once = qs' >>"$OVERLAY_SA" sed -i '/#pkill qs && qs &/s/^#//' config/hypr/scripts/RefreshNoWaybar.sh sed -i '/#pkill qs && qs &/s/^#//' config/hypr/scripts/Refresh.sh - - # Uncomment the quickshell keybind line - sed -i "/^#bind = \$mainMod, A, global, quickshell:overviewToggle/s/^#//" config/hypr/UserConfigs/UserKeybinds.conf - - # Ensure the ags overview keybind is commented - sed -i "/^\s*bind\s*=\s*\\\$mainMod,\s*A,\s*exec,\s*pkill rofi\s*||\s*true\s*&&\s*ags\s*-t\s*'overview'/{s/^\s*/#/}" config/hypr/UserConfigs/UserKeybinds.conf fi +# Note: The SUPER+A keybind now uses OverviewToggle.sh which automatically +# tries quickshell first and falls back to AGS, so both can be installed + printf "\n%.0s" {1..1} # Checking if neovim or vim is installed and offer user if they want to make as default editor -- cgit v1.2.3 From f992b375bfaf76e82df939ac16502755984db53e Mon Sep 17 00:00:00 2001 From: Don Williams Date: Mon, 3 Nov 2025 22:27:24 -0500 Subject: scripts is config/hypr/scripts weren't executable On branch development Your branch is up to date with 'origin/development'. Changes to be committed: modified: scripts/Battery.sh modified: scripts/ComposeHyprConfigs.sh modified: scripts/OverviewToggle.sh modified: scripts/sddm_wallpaper.sh --- config/hypr/scripts/Battery.sh | 0 config/hypr/scripts/ComposeHyprConfigs.sh | 0 config/hypr/scripts/OverviewToggle.sh | 37 +++++++++++++++++++------------ config/hypr/scripts/sddm_wallpaper.sh | 0 4 files changed, 23 insertions(+), 14 deletions(-) mode change 100644 => 100755 config/hypr/scripts/Battery.sh mode change 100644 => 100755 config/hypr/scripts/ComposeHyprConfigs.sh mode change 100644 => 100755 config/hypr/scripts/OverviewToggle.sh mode change 100644 => 100755 config/hypr/scripts/sddm_wallpaper.sh (limited to 'config/hypr/scripts') diff --git a/config/hypr/scripts/Battery.sh b/config/hypr/scripts/Battery.sh old mode 100644 new mode 100755 diff --git a/config/hypr/scripts/ComposeHyprConfigs.sh b/config/hypr/scripts/ComposeHyprConfigs.sh old mode 100644 new mode 100755 diff --git a/config/hypr/scripts/OverviewToggle.sh b/config/hypr/scripts/OverviewToggle.sh old mode 100644 new mode 100755 index 18683984..21c2da34 --- a/config/hypr/scripts/OverviewToggle.sh +++ b/config/hypr/scripts/OverviewToggle.sh @@ -1,26 +1,35 @@ #!/usr/bin/env bash # /* ---- πŸ’« https://github.com/JaKooLit πŸ’« ---- */ # -# Overview toggle wrapper - tries quickshell first, falls back to AGS +# Overview toggle wrapper - tries Quickshell first, falls back to AGS -# Try quickshell first if installed +set -euo pipefail + +# 1) Try Quickshell via Hyprland global dispatch (works if QS is running and listening) +if hyprctl dispatch global quickshell:overviewToggle >/dev/null 2>&1; then + exit 0 +fi + +# If QS isn't running, try starting it and retry once if command -v qs >/dev/null 2>&1; then - # Check if quickshell is running - if pgrep -x qs >/dev/null 2>&1; then - # Try to toggle quickshell overview - hyprctl dispatch global quickshell:overviewToggle 2>/dev/null && exit 0 + qs >/dev/null 2>&1 & + sleep 0.6 + if hyprctl dispatch global quickshell:overviewToggle >/dev/null 2>&1; then + exit 0 fi fi -# Fall back to AGS if quickshell failed or isn't available +# 2) Fall back to AGS template if command -v ags >/dev/null 2>&1; then - # Check if AGS is running, start it if not - if ! pgrep -x ags >/dev/null 2>&1; then - ags & - sleep 0.5 - fi - # Toggle AGS overview pkill rofi || true - ags -t 'overview' 2>/dev/null && exit 0 + if ags -t 'overview' >/dev/null 2>&1; then + exit 0 + fi + # If it failed, try starting AGS daemon then call the template + ags >/dev/null 2>&1 & + sleep 0.6 + if ags -t 'overview' >/dev/null 2>&1; then + exit 0 + fi fi # If we get here, neither worked diff --git a/config/hypr/scripts/sddm_wallpaper.sh b/config/hypr/scripts/sddm_wallpaper.sh old mode 100644 new mode 100755 -- cgit v1.2.3 From ebae2be8c6cc37fd6e66baaac18368789ee97851 Mon Sep 17 00:00:00 2001 From: Don Williams Date: Wed, 5 Nov 2025 00:50:08 -0500 Subject: feat(hypr): align SUPER+J/K binds to current layout on startup\n\n- Add scripts/KeybindsLayoutInit.sh to set J/K (and O for togglesplit) based on general:layout\n- Wire via Startup_Apps.conf (exec-once) so default dwindle or master both get correct binds\n- Complements scripts/ChangeLayout.sh dynamic rebinds --- config/hypr/configs/Startup_Apps.conf | 1 + config/hypr/scripts/KeybindsLayoutInit.sh | 30 ++++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100755 config/hypr/scripts/KeybindsLayoutInit.sh (limited to 'config/hypr/scripts') diff --git a/config/hypr/configs/Startup_Apps.conf b/config/hypr/configs/Startup_Apps.conf index d952e65b..07a92a3f 100644 --- a/config/hypr/configs/Startup_Apps.conf +++ b/config/hypr/configs/Startup_Apps.conf @@ -19,6 +19,7 @@ exec-once = swww-daemon --format xrgb # Startup exec-once = dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP exec-once = systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP +exec-once = $scriptsDir/KeybindsLayoutInit.sh # Initialize Drop Down terminal - See Bug#810 https://github.com/JaKooLit/Hyprland-Dots/issues/810#issuecomment-3351947644 exec-once = $HOME/.config/hypr/scripts/Dropterminal.sh kitty & diff --git a/config/hypr/scripts/KeybindsLayoutInit.sh b/config/hypr/scripts/KeybindsLayoutInit.sh new file mode 100755 index 00000000..7e328cde --- /dev/null +++ b/config/hypr/scripts/KeybindsLayoutInit.sh @@ -0,0 +1,30 @@ +#!/usr/bin/env bash +# /* ---- πŸ’« https://github.com/JaKooLit πŸ’« ---- */ ## +# Initialize J/K keybinds to match the current default layout at startup + +# Query current layout (master|dwindle) +LAYOUT=$(hyprctl -j getoption general:layout | jq -r '.str') + +case "$LAYOUT" in + master) + # Ensure master layout-style binds + hyprctl keyword unbind SUPER,J + hyprctl keyword unbind SUPER,K + hyprctl keyword unbind SUPER,O + hyprctl keyword bind SUPER,J,layoutmsg,cyclenext + hyprctl keyword bind SUPER,K,layoutmsg,cycleprev + ;; + dwindle) + # Ensure dwindle layout-style binds + hyprctl keyword unbind SUPER,J + hyprctl keyword unbind SUPER,K + hyprctl keyword unbind SUPER,O + hyprctl keyword bind SUPER,J,cyclenext + hyprctl keyword bind SUPER,K,cyclenext,prev + hyprctl keyword bind SUPER,O,togglesplit + ;; + *) + # Do nothing for unexpected values + : + ;; + esac -- cgit v1.2.3 From a35eb612dda901c5d14d559e55e64c0b1e93eae4 Mon Sep 17 00:00:00 2001 From: Don Williams Date: Wed, 5 Nov 2025 02:32:31 -0500 Subject: fix(startup): preserve KeybindsLayoutInit in composed Startup_Apps; harden hyprlock 12h edits\n\n- ComposeHyprConfigs.sh: ignore disabling /KeybindsLayoutInit.sh\n- copy.sh migration: filter KeybindsLayoutInit from Startup_Apps.disable\n- copy.sh: target existing hyprlock template, avoid sed errors --- config/hypr/scripts/ComposeHyprConfigs.sh | 4 ++++ copy.sh | 22 +++++++++++++++++----- 2 files changed, 21 insertions(+), 5 deletions(-) (limited to 'config/hypr/scripts') diff --git a/config/hypr/scripts/ComposeHyprConfigs.sh b/config/hypr/scripts/ComposeHyprConfigs.sh index 55bc3c5c..f0928a24 100755 --- a/config/hypr/scripts/ComposeHyprConfigs.sh +++ b/config/hypr/scripts/ComposeHyprConfigs.sh @@ -58,6 +58,10 @@ compose_startup_apps() { while IFS= read -r d; do d="$(echo "$d" | trim)" [[ -z "$d" || "$d" =~ ^# ]] && continue + # Never disable our layout-aware keybind init unless user re-enables via explicit edit here + if [[ "$d" == "\$scriptsDir/KeybindsLayoutInit.sh" ]]; then + continue + fi unset 'cmds[$d]' done <"$disable_file" fi diff --git a/copy.sh b/copy.sh index 1addda84..cd5f5212 100755 --- a/copy.sh +++ b/copy.sh @@ -414,11 +414,19 @@ while true; do sed -i 's#^\(\s*\)\("format": "{:%a %d | %H:%M}",\) #\1//\2#g' config/waybar/Modules 2>&1 | tee -a "$LOG" # for hyprlock - sed -i 's/^\s*text = cmd\[update:1000\] echo "\$(date +"%H")"/# &/' config/hypr/hyprlock.conf 2>&1 | tee -a "$LOG" - sed -i 's/^\(\s*\)# *text = cmd\[update:1000\] echo "\$(date +"%I")" #AM\/PM/\1 text = cmd\[update:1000\] echo "\$(date +"%I")" #AM\/PM/' config/hypr/hyprlock.conf 2>&1 | tee -a "$LOG" + HYPRLOCK_FILE="config/hypr/hyprlock.conf" + if [ ! -f "$HYPRLOCK_FILE" ] && [ -f "config/hypr/hyprlock-1080p.conf" ]; then + HYPRLOCK_FILE="config/hypr/hyprlock-1080p.conf" + fi + if [ -f "$HYPRLOCK_FILE" ]; then + sed -i 's/^\s*text = cmd\[update:1000\] echo "\$(date +"%H")"/# &/' "$HYPRLOCK_FILE" 2>&1 | tee -a "$LOG" + sed -i 's/^\(\s*\)# *text = cmd\[update:1000\] echo "\$(date +"%I")" #AM\/PM/\1 text = cmd\[update:1000\] echo "\$(date +"%I")" #AM\/PM/' "$HYPRLOCK_FILE" 2>&1 | tee -a "$LOG" - sed -i 's/^\s*text = cmd\[update:1000\] echo "\$(date +"%S")"/# &/' config/hypr/hyprlock.conf 2>&1 | tee -a "$LOG" - sed -i 's/^\(\s*\)# *text = cmd\[update:1000\] echo "\$(date +"%S %p")" #AM\/PM/\1 text = cmd\[update:1000\] echo "\$(date +"%S %p")" #AM\/PM/' config/hypr/hyprlock.conf 2>&1 | tee -a "$LOG" + sed -i 's/^\s*text = cmd\[update:1000\] echo "\$(date +"%S")"/# &/' "$HYPRLOCK_FILE" 2>&1 | tee -a "$LOG" + sed -i 's/^\(\s*\)# *text = cmd\[update:1000\] echo "\$(date +"%S %p")" #AM\/PM/\1 text = cmd\[update:1000\] echo "\$(date +"%S %p")" #AM\/PM/' "$HYPRLOCK_FILE" 2>&1 | tee -a "$LOG" + else + echo "${WARN} hyprlock template not found; skipping 12H lock format edits" 2>&1 | tee -a "$LOG" + fi echo "${OK} 12H format set on waybar clocks succesfully." 2>&1 | tee -a "$LOG" @@ -854,7 +862,11 @@ compose_overlay_from_backup() { grep -E '^\s*exec-once\s*=' "$base_file" | sed -E 's/^\s+//;s/\s+$//' | sort -u >"$base_file.tmp.exec" comm -23 "$old_user_file.tmp.exec" "$base_file.tmp.exec" >"$new_user_file" # treat commented exec-once in old user as disables - grep -E '^\s*#\s*exec-once\s*=' "$old_user_file" | sed -E 's/^\s*#\s*exec-once\s*=\s*//' | sed -E 's/^\s+//;s/\s+$//' | sort -u >"$disable_file" + grep -E '^\s*#\s*exec-once\s*=' "$old_user_file" \ + | sed -E 's/^\s*#\s*exec-once\s*=\s*//' \ + | sed -E 's/^\s+//;s/\s+$//' \ + | grep -Ev '^\$scriptsDir/KeybindsLayoutInit\.sh$' \ + | sort -u >"$disable_file" rm -f "$old_user_file.tmp.exec" "$base_file.tmp.exec" elif [ "$type" = "windowrules" ]; then # additions -- cgit v1.2.3 From 67cc7cdab26ad7dc0f9c0aa691a1efc3a200518a Mon Sep 17 00:00:00 2001 From: Don Williams Date: Wed, 5 Nov 2025 02:45:53 -0500 Subject: fix(qs): Edit Startup Apps opens full vendor defaults (configs/Startup_Apps.conf)\n\n- Restores prior behavior where users edit the complete startup config\n- Composition still merges overlay+vendor at runtime --- config/hypr/scripts/Kool_Quick_Settings.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'config/hypr/scripts') diff --git a/config/hypr/scripts/Kool_Quick_Settings.sh b/config/hypr/scripts/Kool_Quick_Settings.sh index 79ddc163..d6e1b089 100755 --- a/config/hypr/scripts/Kool_Quick_Settings.sh +++ b/config/hypr/scripts/Kool_Quick_Settings.sh @@ -58,7 +58,7 @@ main() { "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 Startup Apps") file="$configs/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" ;; -- cgit v1.2.3 From 74b5fe09f3a0b04093ff1442b1dfc683f40d3eca Mon Sep 17 00:00:00 2001 From: Don Williams Date: Wed, 5 Nov 2025 21:59:55 -0500 Subject: Dropped duplicate startup_apps.sh script Removed the ComposeHyprConfitg.sh script Your branch is up to date with 'origin/development'. Changes to be committed: deleted: config/hypr/UserConfigs/Startup_Apps.conf modified: config/hypr/hyprland.conf deleted: config/hypr/scripts/ComposeHyprConfigs.sh modified: config/hypr/scripts/Kool_Quick_Settings.sh modified: copy.sh modified: upgrade.sh --- config/hypr/UserConfigs/Startup_Apps.conf | 62 ---------------- config/hypr/hyprland.conf | 2 - config/hypr/scripts/ComposeHyprConfigs.sh | 113 ----------------------------- config/hypr/scripts/Kool_Quick_Settings.sh | 2 +- copy.sh | 4 - upgrade.sh | 4 - 6 files changed, 1 insertion(+), 186 deletions(-) delete mode 100644 config/hypr/UserConfigs/Startup_Apps.conf delete mode 100755 config/hypr/scripts/ComposeHyprConfigs.sh (limited to 'config/hypr/scripts') diff --git a/config/hypr/UserConfigs/Startup_Apps.conf b/config/hypr/UserConfigs/Startup_Apps.conf deleted file mode 100644 index 4f4fbd22..00000000 --- a/config/hypr/UserConfigs/Startup_Apps.conf +++ /dev/null @@ -1,62 +0,0 @@ -# /* ---- πŸ’« https://github.com/JaKooLit πŸ’« ---- */ # -# Commands and Apps to be executed at launch - -$scriptsDir = $HOME/.config/hypr/scripts -$UserScripts = $HOME/.config/hypr/UserScripts - -$wallDIR=$HOME/Pictures/wallpapers -$lock = $scriptsDir/LockScreen.sh -$SwwwRandom = $UserScripts/WallpaperAutoChange.sh -$livewallpaper="" - -# wallpaper stuff -exec-once = swww-daemon --format argb # New flag for v0.11.2 -#exec-once = swww-daemon --format xrgb # old 0.9.5 option -#exec-once = mpvpaper '*' -o "load-scripts=no no-audio --loop" $livewallpaper - -# wallpaper random -#exec-once = $SwwwRandom $wallDIR # random wallpaper switcher every 30 minutes - -# Startup -exec-once = dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP -exec-once = systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP - -# Initialize Drop Down terminal - See Bug#810 https://github.com/JaKooLit/Hyprland-Dots/issues/810#issuecomment-3351947644 -exec-once = $HOME/.config/hypr/scripts/Dropterminal.sh kitty & - - -# Polkit (Polkit Gnome / KDE) -exec-once = $scriptsDir/Polkit.sh - -# starup apps -exec-once = nm-applet --indicator -exec-once = nm-tray # For ubuntu -exec-once = swaync -#exec-once = ags -#exec-once = blueman-applet -#exec-once = rog-control-center -exec-once = waybar -exec-once = qs # quickshell AGS Desktop Overview alternative - -#clipboard manager -exec-once = wl-paste --type text --watch cliphist store -exec-once = wl-paste --type image --watch cliphist store - -# Rainbow borders -exec-once = $UserScripts/RainbowBorders.sh - -# Starting hypridle to start hyprlock -exec-once = hypridle - -# Weather script to populate cache on startup -exec-once = $UserScripts/WeatherWrap.sh - - -# Here are list of features available but disabled by default -# exec-once = swww-daemon --format xrgb && swww img $HOME/Pictures/wallpapers/mecha-nostalgia.png # persistent wallpaper - -#gnome polkit for nixos -#exec-once = $scriptsDir/Polkit-NixOS.sh - -# xdg-desktop-portal-hyprland (should be auto starting. However, you can force to start) -#exec-once = $scriptsDir/PortalHyprland.sh diff --git a/config/hypr/hyprland.conf b/config/hypr/hyprland.conf index 8f0fc1e5..8eb91df7 100644 --- a/config/hypr/hyprland.conf +++ b/config/hypr/hyprland.conf @@ -17,7 +17,6 @@ $UserConfigs = $HOME/.config/hypr/UserConfigs # User Configs directory path # Load vendor defaults, then user additions/overrides source= $configs/Startup_Apps.conf -source= $UserConfigs/Startup_Apps.conf source= $UserConfigs/ENVariables.conf # Environment variables to load @@ -30,7 +29,6 @@ source= $UserConfigs/LaptopDisplay.conf # Laptop display related. You need to re # Load vendor defaults, then user additions source= $configs/WindowRules.conf # all about Hyprland Window Rules and Layer Rules (defaults) -source= $UserConfigs/WindowRules.conf # user rules and layer rules source= $UserConfigs/UserDecorations.conf # Decorations config file diff --git a/config/hypr/scripts/ComposeHyprConfigs.sh b/config/hypr/scripts/ComposeHyprConfigs.sh deleted file mode 100755 index f0928a24..00000000 --- a/config/hypr/scripts/ComposeHyprConfigs.sh +++ /dev/null @@ -1,113 +0,0 @@ -#!/usr/bin/env bash -# Compose merged Hyprland configs for Startup_Apps and WindowRules -set -euo pipefail - -BASE_DIR="$HOME/.config/hypr" -BASE_CFG_DIR="$BASE_DIR/configs" -USER_DIR="$BASE_DIR/UserConfigs" -GEN_DIR="$BASE_DIR/generated" - -mkdir -p "$GEN_DIR" - -log() { printf "[compose] %s\n" "$*"; } - -# Trim leading/trailing whitespace -trim() { sed -E 's/^\s+//;s/\s+$//'; } - -# Normalize spaces in a directive line -normalize() { awk '{$1=$1;print}'; } - -# Build merged Startup_Apps.conf -compose_startup_apps() { - local base_file="$BASE_CFG_DIR/Startup_Apps.conf" - local user_file="$USER_DIR/Startup_Apps.conf" - local disable_file="$USER_DIR/Startup_Apps.disable" - local out_file="$GEN_DIR/Startup_Apps.conf" - - : >"$out_file" - - # Header and variable lines come from base - if [[ -f "$base_file" ]]; then - # Copy all non exec-once lines (comments, blanks, variables, etc.) - grep -Ev '^\s*exec-once\s*=' "$base_file" || true >>"$out_file" - fi - - # Collect exec-once commands (the right side of '=') - declare -A cmds=() - - if [[ -f "$base_file" ]]; then - while IFS= read -r line; do - [[ "$line" =~ ^\s*exec-once\s*= ]] || continue - cmd="${line#*=}" - cmd="$(echo "$cmd" | trim)" - cmds["$cmd"]=1 - done <"$base_file" - fi - - if [[ -f "$user_file" ]]; then - while IFS= read -r line; do - [[ "$line" =~ ^\s*exec-once\s*= ]] || continue - cmd="${line#*=}" - cmd="$(echo "$cmd" | trim)" - cmds["$cmd"]=1 - done <"$user_file" - fi - - # Apply disables (exact match of command string) - if [[ -f "$disable_file" ]]; then - while IFS= read -r d; do - d="$(echo "$d" | trim)" - [[ -z "$d" || "$d" =~ ^# ]] && continue - # Never disable our layout-aware keybind init unless user re-enables via explicit edit here - if [[ "$d" == "\$scriptsDir/KeybindsLayoutInit.sh" ]]; then - continue - fi - unset 'cmds[$d]' - done <"$disable_file" - fi - - # Emit combined exec-once (stable sort) - for k in "${!cmds[@]}"; do echo "$k"; done | sort -u | while IFS= read -r cmd; do - [[ -z "$cmd" ]] && continue - printf "exec-once = %s\n" "$cmd" >>"$out_file" - done - - log "Wrote $out_file" -} - -# Build merged WindowRules.conf -compose_window_rules() { - local base_file="$BASE_CFG_DIR/WindowRules.conf" - local user_file="$USER_DIR/WindowRules.conf" - local disable_file="$USER_DIR/WindowRules.disable" - local out_file="$GEN_DIR/WindowRules.conf" - - : >"$out_file" - echo "# Generated merged WindowRules" >>"$out_file" - - declare -A rules=() - add_rules() { - local f="$1" - [[ -f "$f" ]] || return 0 - grep -E '^(windowrule|layerrule)\s*=' "$f" | trim | while IFS= read -r r; do - rules["$r"]=1 - done - } - - add_rules "$base_file" - add_rules "$user_file" - - if [[ -f "$disable_file" ]]; then - while IFS= read -r d; do - d="$(echo "$d" | trim)" - [[ -z "$d" || "$d" =~ ^# ]] && continue - unset 'rules[$d]' - done <"$disable_file" - fi - - for r in "${!rules[@]}"; do echo "$r"; done | sort -u >>"$out_file" - log "Wrote $out_file" -} - -compose_startup_apps -compose_window_rules \ No newline at end of file diff --git a/config/hypr/scripts/Kool_Quick_Settings.sh b/config/hypr/scripts/Kool_Quick_Settings.sh index d6e1b089..16742492 100755 --- a/config/hypr/scripts/Kool_Quick_Settings.sh +++ b/config/hypr/scripts/Kool_Quick_Settings.sh @@ -55,7 +55,7 @@ main() { case "$choice" in "view/edit User Defaults") file="$UserConfigs/01-UserDefaults.conf" ;; "view/edit ENV variables") file="$UserConfigs/ENVariables.conf" ;; - "view/edit Window Rules") file="$UserConfigs/WindowRules.conf" ;; + "view/edit Window Rules") file="$configs/WindowRules.conf" ;; "view/edit User Keybinds") file="$UserConfigs/UserKeybinds.conf" ;; "view/edit User Settings") file="$UserConfigs/UserSettings.conf" ;; "view/edit Startup Apps") file="$configs/Startup_Apps.conf" ;; diff --git a/copy.sh b/copy.sh index cd5f5212..b1cc6e1a 100755 --- a/copy.sh +++ b/copy.sh @@ -933,10 +933,6 @@ if [ -d "$BACKUP_DIR_PATH" ]; then done fi -# Compose merged configs (Startup_Apps and WindowRules) -if [ -x "$DIRPATH/scripts/ComposeHyprConfigs.sh" ]; then - "$DIRPATH/scripts/ComposeHyprConfigs.sh" 2>&1 | tee -a "$LOG" || true -fi printf "\n%.0s" {1..1} diff --git a/upgrade.sh b/upgrade.sh index 9aee3c2c..07ee1f8b 100755 --- a/upgrade.sh +++ b/upgrade.sh @@ -198,10 +198,6 @@ if version_gt "$latest_version" "$stored_version"; then # Set executable for initial-boot.sh chmod +x "$HOME/.config/hypr/initial-boot.sh" 2>&1 | tee -a "$LOG" - # Compose merged configs (Startup_Apps and WindowRules) - if [ -x "$HOME/.config/hypr/scripts/ComposeHyprConfigs.sh" ]; then - "$HOME/.config/hypr/scripts/ComposeHyprConfigs.sh" 2>&1 | tee -a "$LOG" || true - fi else echo "$MAGENTA Upgrade declined. No files or directories changed" 2>&1 | tee -a "$LOG" fi -- cgit v1.2.3 From 206f51d28f8f0cb17289c573991eea5eedae2eec Mon Sep 17 00:00:00 2001 From: Don Williams Date: Wed, 5 Nov 2025 22:07:57 -0500 Subject: Fixing layout aware SUPER J/K cycle next/prev On branch development Your branch is up to date with 'origin/development'. Changes to be committed: modified: config/hypr/configs/Keybinds.conf modified: config/hypr/scripts/KeybindsLayoutInit.sh --- config/hypr/configs/Keybinds.conf | 6 ++++-- config/hypr/scripts/KeybindsLayoutInit.sh | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'config/hypr/scripts') diff --git a/config/hypr/configs/Keybinds.conf b/config/hypr/configs/Keybinds.conf index ebaee30a..fbe3bfe5 100644 --- a/config/hypr/configs/Keybinds.conf +++ b/config/hypr/configs/Keybinds.conf @@ -19,8 +19,10 @@ bindd = $mainMod SHIFT, E, Quick settings menu, exec, $scriptsDir/Kool_Quick_Set # Master Layout bindd = $mainMod CTRL, D, remove master, layoutmsg, removemaster bindd = $mainMod, I, add master, layoutmsg, addmaster -bindd = $mainMod, J, cycle next, layoutmsg, cyclenext -bindd = $mainMod, K, cycle previous, layoutmsg, cycleprev +# NOTE: J/K bindings are set dynamically by scripts/KeybindsLayoutInit.sh and scripts/ChangeLayout.sh +# (we intentionally do not bind them statically here to avoid conflicts across layouts) +# bindd = $mainMod, J, cycle next, layoutmsg, cyclenext +# bindd = $mainMod, K, cycle previous, layoutmsg, cycleprev bindd = $mainMod CTRL, Return, swap with master, layoutmsg, swapwithmaster # Dwindle Layout diff --git a/config/hypr/scripts/KeybindsLayoutInit.sh b/config/hypr/scripts/KeybindsLayoutInit.sh index 7e328cde..af81f62e 100755 --- a/config/hypr/scripts/KeybindsLayoutInit.sh +++ b/config/hypr/scripts/KeybindsLayoutInit.sh @@ -20,7 +20,8 @@ case "$LAYOUT" in hyprctl keyword unbind SUPER,K hyprctl keyword unbind SUPER,O hyprctl keyword bind SUPER,J,cyclenext - hyprctl keyword bind SUPER,K,cyclenext,prev +hyprctl keyword bind SUPER,K,cyclenext,prev +# ensure SUPER+O togglesplit is available on dwindle hyprctl keyword bind SUPER,O,togglesplit ;; *) -- cgit v1.2.3 From 1788691d242abe607add69d211478e306a154cc6 Mon Sep 17 00:00:00 2001 From: Don Williams Date: Fri, 7 Nov 2025 12:26:05 -0500 Subject: Fixing Super J/K cycle next/prev for auto layout Cycle next/prev is different for dwindle vs. master Oringinal code only worked in master. This script detects which and rebunds SUPER J/K accordingly On branch development Your branch is up to date with 'origin/development'. Changes to be committed: modified: config/hypr/scripts/KeybindsLayoutInit.sh --- config/hypr/scripts/KeybindsLayoutInit.sh | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'config/hypr/scripts') diff --git a/config/hypr/scripts/KeybindsLayoutInit.sh b/config/hypr/scripts/KeybindsLayoutInit.sh index af81f62e..fd34f90e 100755 --- a/config/hypr/scripts/KeybindsLayoutInit.sh +++ b/config/hypr/scripts/KeybindsLayoutInit.sh @@ -2,8 +2,15 @@ # /* ---- πŸ’« https://github.com/JaKooLit πŸ’« ---- */ ## # Initialize J/K keybinds to match the current default layout at startup -# Query current layout (master|dwindle) -LAYOUT=$(hyprctl -j getoption general:layout | jq -r '.str') +set -euo pipefail + +# Determine current layout (master|dwindle); be robust to null at startup +LAYOUT=$(hyprctl -j getoption general:layout | jq -r '.str // empty' 2>/dev/null || true) +if [ -z "${LAYOUT:-}" ]; then + # Fallback: parse non-JSON output (e.g., "str: dwindle") + LAYOUT=$(hyprctl getoption general:layout 2>/dev/null | awk -F'str:' 'NF>1 {gsub(/^ +| +$/,"",$2); print $2}') +fi +[ -z "${LAYOUT:-}" ] && exit 0 case "$LAYOUT" in master) @@ -20,8 +27,8 @@ case "$LAYOUT" in hyprctl keyword unbind SUPER,K hyprctl keyword unbind SUPER,O hyprctl keyword bind SUPER,J,cyclenext -hyprctl keyword bind SUPER,K,cyclenext,prev -# ensure SUPER+O togglesplit is available on dwindle + hyprctl keyword bind SUPER,K,cyclenext,prev + # ensure SUPER+O togglesplit is available on dwindle hyprctl keyword bind SUPER,O,togglesplit ;; *) -- cgit v1.2.3 From 672aaf336df2a4897c086d84da6fea8611a5ec54 Mon Sep 17 00:00:00 2001 From: Alberson Miranda <45690517+albersonmiranda@users.noreply.github.com> Date: Sat, 8 Nov 2025 00:17:21 -0300 Subject: feat: resume hyprsunset (#862) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Looks good! Merging this into development branch πŸ‘ --- config/hypr/configs/Startup_Apps.conf | 2 ++ config/hypr/scripts/Hyprsunset.sh | 22 +++++++++++++++++----- 2 files changed, 19 insertions(+), 5 deletions(-) (limited to 'config/hypr/scripts') diff --git a/config/hypr/configs/Startup_Apps.conf b/config/hypr/configs/Startup_Apps.conf index 07a92a3f..c1670595 100644 --- a/config/hypr/configs/Startup_Apps.conf +++ b/config/hypr/configs/Startup_Apps.conf @@ -48,6 +48,8 @@ exec-once = $UserScripts/RainbowBorders.sh # Starting hypridle to start hyprlock exec-once = hypridle +# Resume Hyprsunset if state is "on" from previous session +exec-once = $scriptsDir/Hyprsunset.sh init # Here are list of features available but disabled by default # exec-once = swww-daemon --format xrgb && swww img $HOME/Pictures/wallpapers/mecha-nostalgia.png # persistent wallpaper diff --git a/config/hypr/scripts/Hyprsunset.sh b/config/hypr/scripts/Hyprsunset.sh index c7c4b395..4a2b52f4 100755 --- a/config/hypr/scripts/Hyprsunset.sh +++ b/config/hypr/scripts/Hyprsunset.sh @@ -8,12 +8,12 @@ set -euo pipefail # - On: sunset icon if available, otherwise a blue sun # # Customize via env vars: -# HYPERSUNSET_TEMP default 4500 (K) -# HYPERSUNSET_ICON_MODE sunset|blue (default: sunset) +# HYPRSUNSET_TEMP default 4500 (K) +# HYPRSUNSET_ICON_MODE sunset|blue (default: sunset) STATE_FILE="$HOME/.cache/.hyprsunset_state" -TARGET_TEMP="${HYPERSUNSET_TEMP:-4500}" -ICON_MODE="${HYPERSUNSET_ICON_MODE:-sunset}" +TARGET_TEMP="${HYPRSUNSET_TEMP:-4500}" +ICON_MODE="${HYPRSUNSET_ICON_MODE:-sunset}" ensure_state() { [[ -f "$STATE_FILE" ]] || echo "off" > "$STATE_FILE" @@ -92,8 +92,20 @@ cmd_status() { printf '{"text":"%s","class":"%s","tooltip":"%s"}\n' "$txt" "$cls" "$tip" } +cmd_init() { + ensure_state + state="$(cat "$STATE_FILE" || echo off)" + + if [[ "$state" == "on" ]]; then + if command -v hyprsunset >/dev/null 2>&1; then + nohup hyprsunset -t "$TARGET_TEMP" >/dev/null 2>&1 & + fi + fi +} + case "${1:-}" in toggle) cmd_toggle ;; status) cmd_status ;; - *) echo "usage: $0 [toggle|status]" >&2; exit 2 ;; + init) cmd_init ;; + *) echo "usage: $0 [toggle|status|init]" >&2; exit 2 ;; esac -- cgit v1.2.3 From f9e882782d23b2869cd272841af12f7e0ce2ad37 Mon Sep 17 00:00:00 2001 From: Don Williams Date: Fri, 14 Nov 2025 12:10:46 -0500 Subject: hyprctl dispatch returned success w/o QS installed On branch development Your branch is up to date with 'origin/development'. Changes to be committed: modified: config/hypr/scripts/OverviewToggle.sh --- config/hypr/scripts/OverviewToggle.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'config/hypr/scripts') diff --git a/config/hypr/scripts/OverviewToggle.sh b/config/hypr/scripts/OverviewToggle.sh index 21c2da34..2737234c 100755 --- a/config/hypr/scripts/OverviewToggle.sh +++ b/config/hypr/scripts/OverviewToggle.sh @@ -5,11 +5,15 @@ set -euo pipefail # 1) Try Quickshell via Hyprland global dispatch (works if QS is running and listening) -if hyprctl dispatch global quickshell:overviewToggle >/dev/null 2>&1; then - exit 0 +# Only attempt this if a Quickshell process is running; otherwise Hyprland will +# still return success for the dispatch and we'll never fall back to AGS. +if pgrep -x quickshell >/dev/null 2>&1; then + if hyprctl dispatch global quickshell:overviewToggle >/dev/null 2>&1; then + exit 0 + fi fi -# If QS isn't running, try starting it and retry once +# If QS isn't running, but the CLI exists, try starting it and retry once if command -v qs >/dev/null 2>&1; then qs >/dev/null 2>&1 & sleep 0.6 -- cgit v1.2.3 From 0a9484f35e7726c697e1e64b27355a5f9ebc53b0 Mon Sep 17 00:00:00 2001 From: Don Williams Date: Fri, 14 Nov 2025 12:27:19 -0500 Subject: Fixed SUPER J/K ping ponging On branch development Your branch is up to date with 'origin/development'. Changes to be committed: new file: CHANGES-v2.3.18.md modified: config/hypr/scripts/ChangeLayout.sh modified: config/hypr/scripts/KeybindsLayoutInit.sh --- CHANGES-v2.3.18.md | 19 +++++++++++++++ config/hypr/scripts/ChangeLayout.sh | 10 ++------ config/hypr/scripts/KeybindsLayoutInit.sh | 40 +++++++------------------------ 3 files changed, 29 insertions(+), 40 deletions(-) create mode 100644 CHANGES-v2.3.18.md (limited to 'config/hypr/scripts') diff --git a/CHANGES-v2.3.18.md b/CHANGES-v2.3.18.md new file mode 100644 index 00000000..97af5183 --- /dev/null +++ b/CHANGES-v2.3.18.md @@ -0,0 +1,19 @@ +# CHANGES: Hyprland-Dots v2.3.18 + +## FIXES: + +- Changed to Hyprland (only) Packages from SID + - No longer build from source + - Hyprland Version @ v0.51.1 + - If/When SID it updated, updates will be done as normal process +- Overview Toggle keyind SUPER + A now properly detects QS +- If QS fails, or not installed AGS will be started instead +- Fixed Super J/K cycle next/prev being activated switch + +## CHANGES: + +- Lock screen + - Clock now horizontal and smaller + - Adjust spacing margines of the various fields + - Small changes to color variabbles Trying to balance colors + - Fixed both 1080 and 2K+ configurations diff --git a/config/hypr/scripts/ChangeLayout.sh b/config/hypr/scripts/ChangeLayout.sh index 78428188..e2436b79 100755 --- a/config/hypr/scripts/ChangeLayout.sh +++ b/config/hypr/scripts/ChangeLayout.sh @@ -9,20 +9,14 @@ LAYOUT=$(hyprctl -j getoption general:layout | jq '.str' | sed 's/"//g') case $LAYOUT in "master") hyprctl keyword general:layout dwindle - hyprctl keyword unbind SUPER,J - hyprctl keyword unbind SUPER,K - hyprctl keyword bind SUPER,J,cyclenext - hyprctl keyword bind SUPER,K,cyclenext,prev + # SUPER+J/K are global and managed by KeybindsLayoutInit.sh; only manage SUPER+O here hyprctl keyword bind SUPER,O,togglesplit notify-send -e -u low -i "$notif" " Dwindle Layout" ;; "dwindle") hyprctl keyword general:layout master - hyprctl keyword unbind SUPER,J - hyprctl keyword unbind SUPER,K + # Drop togglesplit binding on SUPER+O when switching back to master hyprctl keyword unbind SUPER,O - hyprctl keyword bind SUPER,J,layoutmsg,cyclenext - hyprctl keyword bind SUPER,K,layoutmsg,cycleprev notify-send -e -u low -i "$notif" " Master Layout" ;; *) ;; diff --git a/config/hypr/scripts/KeybindsLayoutInit.sh b/config/hypr/scripts/KeybindsLayoutInit.sh index fd34f90e..0a53eaaf 100755 --- a/config/hypr/scripts/KeybindsLayoutInit.sh +++ b/config/hypr/scripts/KeybindsLayoutInit.sh @@ -1,38 +1,14 @@ #!/usr/bin/env bash # /* ---- πŸ’« https://github.com/JaKooLit πŸ’« ---- */ ## -# Initialize J/K keybinds to match the current default layout at startup +# Initialize J/K keybinds so they always cycle windows globally (no layout-specific behavior) +# This avoids double-actions when layouts change. set -euo pipefail -# Determine current layout (master|dwindle); be robust to null at startup -LAYOUT=$(hyprctl -j getoption general:layout | jq -r '.str // empty' 2>/dev/null || true) -if [ -z "${LAYOUT:-}" ]; then - # Fallback: parse non-JSON output (e.g., "str: dwindle") - LAYOUT=$(hyprctl getoption general:layout 2>/dev/null | awk -F'str:' 'NF>1 {gsub(/^ +| +$/,"",$2); print $2}') -fi -[ -z "${LAYOUT:-}" ] && exit 0 +# Always reset and bind SUPER+J/K the same way on startup +hyprctl keyword unbind SUPER,J || true +hyprctl keyword unbind SUPER,K || true -case "$LAYOUT" in - master) - # Ensure master layout-style binds - hyprctl keyword unbind SUPER,J - hyprctl keyword unbind SUPER,K - hyprctl keyword unbind SUPER,O - hyprctl keyword bind SUPER,J,layoutmsg,cyclenext - hyprctl keyword bind SUPER,K,layoutmsg,cycleprev - ;; - dwindle) - # Ensure dwindle layout-style binds - hyprctl keyword unbind SUPER,J - hyprctl keyword unbind SUPER,K - hyprctl keyword unbind SUPER,O - hyprctl keyword bind SUPER,J,cyclenext - hyprctl keyword bind SUPER,K,cyclenext,prev - # ensure SUPER+O togglesplit is available on dwindle - hyprctl keyword bind SUPER,O,togglesplit - ;; - *) - # Do nothing for unexpected values - : - ;; - esac +# Cycle windows globally: J = next, K = previous +hyprctl keyword bind SUPER,J,cyclenext +hyprctl keyword bind SUPER,K,cyclenext,prev -- cgit v1.2.3 From a151dda103af298fb4af3ed381217e35b8cc97c9 Mon Sep 17 00:00:00 2001 From: Don Williams Date: Fri, 21 Nov 2025 22:28:45 -0500 Subject: Repeated gamemode cycling gets multiple waybars MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit You have to hammer on it, to get it to occr Added addtional sleep timer to allow pkill to keep up Resolves: https://github.com/JaKooLit/Hyprland-Dots/issues/870 On branch development Your branch is up to date with 'origin/development'. Changes to be committed: modified: CHANGES-v2.3.18.md modified: config/hypr/scripts/GameMode.sh modified: config/hypr/scripts/Refresh.sh --- CHANGES-v2.3.18.md | 4 ++++ config/hypr/scripts/GameMode.sh | 1 + config/hypr/scripts/Refresh.sh | 6 +++++- 3 files changed, 10 insertions(+), 1 deletion(-) (limited to 'config/hypr/scripts') diff --git a/CHANGES-v2.3.18.md b/CHANGES-v2.3.18.md index 4f76a5d0..69aabec4 100644 --- a/CHANGES-v2.3.18.md +++ b/CHANGES-v2.3.18.md @@ -18,6 +18,10 @@ - Fixed: `GameMode.sh` to function consistently - Updated: `WalllustSwww.sh` wallpaper path - Corrected: Typo in Show Open Apps +- GameMode.sh / Refresh.sh + - Enabling / Disabling repeatedly would result in multiple waybars + - Added additional `sleep` commands in `GameMode.sh` and `Refresh.sh` + - Resolves [Issue 870](https://github.com/JaKooLit/Hyprland-Dots/issues/870) ## CHANGES: diff --git a/config/hypr/scripts/GameMode.sh b/config/hypr/scripts/GameMode.sh index ec1e541e..59cf7372 100755 --- a/config/hypr/scripts/GameMode.sh +++ b/config/hypr/scripts/GameMode.sh @@ -20,6 +20,7 @@ if [ "$HYPRGAMEMODE" = 1 ] ; then hyprctl keyword "windowrule opacity 1 override 1 override 1 override, ^(.*)$" swww kill notify-send -e -u low -i "$notif" " Gamemode:" " enabled" + sleep 0.1 exit else swww-daemon --format xrgb && swww img "$HOME/.config/rofi/.current_wallpaper" & diff --git a/config/hypr/scripts/Refresh.sh b/config/hypr/scripts/Refresh.sh index 2e772aa9..1dd59752 100755 --- a/config/hypr/scripts/Refresh.sh +++ b/config/hypr/scripts/Refresh.sh @@ -24,6 +24,9 @@ done # added since wallust sometimes not applying killall -SIGUSR2 waybar +# Added sleep for GameMode causing multiple waybar +sleep 0.1 + # quit ags & relaunch ags #ags -q && ags & @@ -34,6 +37,7 @@ killall -SIGUSR2 waybar # some process to kill for pid in $(pidof waybar rofi swaync ags swaybg); do kill -SIGUSR1 "$pid" + sleep 0.3 done #Restart waybar @@ -52,4 +56,4 @@ if file_exists "${UserScripts}/RainbowBorders.sh"; then ${UserScripts}/RainbowBorders.sh & fi -exit 0 \ No newline at end of file +exit 0 -- cgit v1.2.3 From 1351220a092414ae593bc006e3a3ebc09523198d Mon Sep 17 00:00:00 2001 From: installer Date: Sat, 22 Nov 2025 11:27:26 -0500 Subject: Adjusted sleep timers, last change was too long Slowed down changes and waybar startup On branch development Your branch is up to date with 'origin/development'. Changes to be committed: modified: config/hypr/scripts/Refresh.sh --- config/hypr/scripts/Refresh.sh | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) (limited to 'config/hypr/scripts') diff --git a/config/hypr/scripts/Refresh.sh b/config/hypr/scripts/Refresh.sh index 1dd59752..76757aa4 100755 --- a/config/hypr/scripts/Refresh.sh +++ b/config/hypr/scripts/Refresh.sh @@ -7,27 +7,26 @@ UserScripts=$HOME/.config/hypr/UserScripts # Define file_exists function file_exists() { - if [ -e "$1" ]; then - return 0 # File exists - else - return 1 # File does not exist - fi + if [ -e "$1" ]; then + return 0 # File exists + else + return 1 # File does not exist + fi } # Kill already running processes _ps=(waybar rofi swaync ags) for _prs in "${_ps[@]}"; do - if pidof "${_prs}" >/dev/null; then - pkill "${_prs}" - fi + if pidof "${_prs}" >/dev/null; then + pkill "${_prs}" + fi done # added since wallust sometimes not applying -killall -SIGUSR2 waybar +killall -SIGUSR2 waybar # Added sleep for GameMode causing multiple waybar sleep 0.1 - # quit ags & relaunch ags #ags -q && ags & @@ -36,24 +35,24 @@ sleep 0.1 # some process to kill for pid in $(pidof waybar rofi swaync ags swaybg); do - kill -SIGUSR1 "$pid" - sleep 0.3 + kill -SIGUSR1 "$pid" + sleep 0.1 done #Restart waybar -sleep 1 +sleep 0.1 waybar & # relaunch swaync -sleep 0.5 -swaync > /dev/null 2>&1 & +sleep 0.3 +swaync >/dev/null 2>&1 & # reload swaync swaync-client --reload-config # Relaunching rainbow borders if the script exists sleep 1 if file_exists "${UserScripts}/RainbowBorders.sh"; then - ${UserScripts}/RainbowBorders.sh & + ${UserScripts}/RainbowBorders.sh & fi exit 0 -- cgit v1.2.3