From 6594a935a8c0c4b3bc90e6d5f5d74829c06c53f7 Mon Sep 17 00:00:00 2001 From: aditya-an1l Date: Thu, 22 May 2025 11:08:00 +0530 Subject: feat: Add Power Info (level and status) in Hyprlock Window - Display current power level (battery percentage) and power status (full, charging, discharging) at the bottom right section of Hyprlock - This feature allows laptop user to view the power info when their device are locked, especially if the device is getting discharged. --- config/hypr/scripts/Power.sh | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 config/hypr/scripts/Power.sh (limited to 'config/hypr/scripts') diff --git a/config/hypr/scripts/Power.sh b/config/hypr/scripts/Power.sh new file mode 100644 index 00000000..42431ea9 --- /dev/null +++ b/config/hypr/scripts/Power.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +for i in {0..3}; do + if [ -f /sys/class/power_supply/BAT$i/capacity ]; then + battery_level=$(cat /sys/class/power_supply/BAT$i/status) + battery_capacity=$(cat /sys/class/power_supply/BAT$i/capacity) + echo "Power: $battery_capacity% ($battery_level)" + fi +done -- cgit v1.2.3 From 2c33cef6fdee97ac9a13f0f4bf49158aa48c9f03 Mon Sep 17 00:00:00 2001 From: Kiran George Date: Sun, 25 May 2025 20:02:03 +0530 Subject: Improved Dropdown terminal --- config/hypr/UserConfigs/UserKeybinds.conf | 2 +- config/hypr/scripts/Dropterminal.sh | 65 +++++++++++++++++++++++++++++++ 2 files changed, 66 insertions(+), 1 deletion(-) create mode 100755 config/hypr/scripts/Dropterminal.sh (limited to 'config/hypr/scripts') diff --git a/config/hypr/UserConfigs/UserKeybinds.conf b/config/hypr/UserConfigs/UserKeybinds.conf index 871f2ffb..ce501d85 100644 --- a/config/hypr/UserConfigs/UserKeybinds.conf +++ b/config/hypr/UserConfigs/UserKeybinds.conf @@ -39,7 +39,7 @@ 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, [float; move 15% 5%; size 70% 60%] $term # Dropdown terminal +bind = $mainMod SHIFT, Return, exec, $scriptsDir/Dropterminal.sh $term # Dropdown terminal # 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}')" diff --git a/config/hypr/scripts/Dropterminal.sh b/config/hypr/scripts/Dropterminal.sh new file mode 100755 index 00000000..a160c3e9 --- /dev/null +++ b/config/hypr/scripts/Dropterminal.sh @@ -0,0 +1,65 @@ +#!/bin/bash +# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## +# Dropdown Terminal Usage: ./dropdown.sh [foot|kitty] + +TERMINAL="$1" +SPECIAL_WS="special:scratchpad" + +# Validate input and set CLASS and CMD +case "$TERMINAL" in + foot) + CLASS="foot-dropterminal" + TERMINAL_CMD="foot --app-id $CLASS" + ;; + kitty) + CLASS="kitty-dropterminal" + TERMINAL_CMD="kitty --class $CLASS" + ;; + *) + echo "Invalid or missing terminal argument. Usage: $0 [foot|kitty]" + exit 1 + ;; +esac + +# Get the current workspace +CURRENT_WS=$(hyprctl activeworkspace -j | jq -r '.id') + +# Function to check if terminal exists +terminal_exists() { + hyprctl clients -j | jq -e --arg CLASS "$CLASS" 'any(.[]; .class == $CLASS)' >/dev/null 2>&1 +} + +# Function to check if terminal is in special workspace +terminal_in_special() { + hyprctl clients -j | jq -e --arg CLASS "$CLASS" 'any(.[]; .class == $CLASS and .workspace.name == "special:scratchpad")' >/dev/null 2>&1 +} + +# Function to get terminal address +get_terminal_address() { + hyprctl clients -j | jq -r --arg CLASS "$CLASS" '.[] | select(.class == $CLASS) | .address' +} + +if terminal_exists; then + TERMINAL_ADDR=$(get_terminal_address) + + if terminal_in_special; then + echo "Bringing terminal to workspace $CURRENT_WS and pinning" + hyprctl dispatch movetoworkspace "$CURRENT_WS,address:$TERMINAL_ADDR" + hyprctl dispatch pin "address:$TERMINAL_ADDR" + hyprctl dispatch focuswindow "address:$TERMINAL_ADDR" + else + echo "Unpinning and hiding terminal to special workspace" + hyprctl dispatch pin "address:$TERMINAL_ADDR" # Unpin (toggle) + sleep 0.1 + hyprctl dispatch movetoworkspacesilent "$SPECIAL_WS,address:$TERMINAL_ADDR" + fi +else + echo "Creating new dropdown terminal with command: $TERMINAL_CMD" + hyprctl dispatch exec "[float; move 25% 5%; size 50% 50%] $TERMINAL_CMD" + sleep 0.5 + if terminal_exists; then + TERMINAL_ADDR=$(get_terminal_address) + hyprctl dispatch pin "address:$TERMINAL_ADDR" + hyprctl dispatch focuswindow "address:$TERMINAL_ADDR" + fi +fi -- cgit v1.2.3 From c6c06f0448413454b9ea58af7526c55c360b0e97 Mon Sep 17 00:00:00 2001 From: JaKooLit Date: Tue, 27 May 2025 03:58:55 +0900 Subject: updated Power.sh, renamed to Battery.sh since it is about battery information --- config/hypr/hyprlock-1080p.conf | 12 ++++++++++++ config/hypr/hyprlock.conf | 4 ++-- config/hypr/scripts/Battery.sh | 9 +++++++++ config/hypr/scripts/Power.sh | 9 --------- 4 files changed, 23 insertions(+), 11 deletions(-) create mode 100644 config/hypr/scripts/Battery.sh delete mode 100644 config/hypr/scripts/Power.sh (limited to 'config/hypr/scripts') diff --git a/config/hypr/hyprlock-1080p.conf b/config/hypr/hyprlock-1080p.conf index a0e105e0..70c00c16 100644 --- a/config/hypr/hyprlock-1080p.conf +++ b/config/hypr/hyprlock-1080p.conf @@ -156,6 +156,18 @@ label { valign = bottom } +# battery information +label { + monitor = + text = cmd[update:1000] echo " "$($Scripts/Battery.sh)" " + color = $color13 + font_size = 16 + font_family = Victor Mono Bold Oblique + position = 0, 50 + halign = right + valign = bottom +} + # weather edit the scripts for locations # weather scripts are located in ~/.config/hypr/UserScripts Weather.sh and/or Weather.py # see https://github.com/JaKooLit/Hyprland-Dots/wiki/TIPS#%EF%B8%8F-weather-app-related-for-waybar-and-hyprlock diff --git a/config/hypr/hyprlock.conf b/config/hypr/hyprlock.conf index 80a94fb1..b67bba51 100644 --- a/config/hypr/hyprlock.conf +++ b/config/hypr/hyprlock.conf @@ -157,10 +157,10 @@ label { valign = bottom } -# battery +# battery information label { monitor = - text = cmd[update:1000] echo " "$($Scripts/Power.sh)" " + text = cmd[update:1000] echo " "$($Scripts/Battery.sh)" " color = $color13 font_size = 18 font_family = Victor Mono Bold Oblique diff --git a/config/hypr/scripts/Battery.sh b/config/hypr/scripts/Battery.sh new file mode 100644 index 00000000..d7830058 --- /dev/null +++ b/config/hypr/scripts/Battery.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +for i in {0..3}; do + if [ -f /sys/class/power_supply/BAT$i/capacity ]; then + battery_level=$(cat /sys/class/power_supply/BAT$i/status) + battery_capacity=$(cat /sys/class/power_supply/BAT$i/capacity) + echo "Battery: $battery_capacity% ($battery_level)" + fi +done diff --git a/config/hypr/scripts/Power.sh b/config/hypr/scripts/Power.sh deleted file mode 100644 index 42431ea9..00000000 --- a/config/hypr/scripts/Power.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash - -for i in {0..3}; do - if [ -f /sys/class/power_supply/BAT$i/capacity ]; then - battery_level=$(cat /sys/class/power_supply/BAT$i/status) - battery_capacity=$(cat /sys/class/power_supply/BAT$i/capacity) - echo "Power: $battery_capacity% ($battery_level)" - fi -done -- cgit v1.2.3 From 84466963633538013e84c74c2d8b2ce33e06c504 Mon Sep 17 00:00:00 2001 From: Kiran George Date: Tue, 27 May 2025 10:11:45 +0530 Subject: Updated dropdown terminal script to use addressed based window tracking instead of class --- config/hypr/scripts/Dropterminal.sh | 140 ++++++++++++++++++++++++++++-------- 1 file changed, 109 insertions(+), 31 deletions(-) (limited to 'config/hypr/scripts') diff --git a/config/hypr/scripts/Dropterminal.sh b/config/hypr/scripts/Dropterminal.sh index a160c3e9..98420a24 100755 --- a/config/hypr/scripts/Dropterminal.sh +++ b/config/hypr/scripts/Dropterminal.sh @@ -1,65 +1,143 @@ #!/bin/bash # /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## -# Dropdown Terminal Usage: ./dropdown.sh [foot|kitty] +# Dropdown Terminal +# Usage: ./dropdown.sh [-d] +# Example: ./dropdown.sh foot +# ./dropdown.sh -d foot (with debug output) +# ./dropdown.sh "kitty -e zsh" +# ./dropdown.sh "alacritty --working-directory /home/user" -TERMINAL="$1" +DEBUG=false SPECIAL_WS="special:scratchpad" +ADDR_FILE="/tmp/dropdown_terminal_addr" -# Validate input and set CLASS and CMD -case "$TERMINAL" in - foot) - CLASS="foot-dropterminal" - TERMINAL_CMD="foot --app-id $CLASS" - ;; - kitty) - CLASS="kitty-dropterminal" - TERMINAL_CMD="kitty --class $CLASS" - ;; - *) - echo "Invalid or missing terminal argument. Usage: $0 [foot|kitty]" - exit 1 - ;; -esac +# Parse arguments +if [ "$1" = "-d" ]; then + DEBUG=true + shift +fi + +TERMINAL_CMD="$1" + +# Debug echo function +debug_echo() { + 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'" + exit 1 +fi # Get the current workspace 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 + cat "$ADDR_FILE" + fi +} + # Function to check if terminal exists terminal_exists() { - hyprctl clients -j | jq -e --arg CLASS "$CLASS" 'any(.[]; .class == $CLASS)' >/dev/null 2>&1 + 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() { - hyprctl clients -j | jq -e --arg CLASS "$CLASS" 'any(.[]; .class == $CLASS and .workspace.name == "special:scratchpad")' >/dev/null 2>&1 + 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 get terminal address -get_terminal_address() { - hyprctl clients -j | jq -r --arg CLASS "$CLASS" '.[] | select(.class == $CLASS) | .address' +# Function to spawn terminal and capture its address +spawn_terminal() { + debug_echo "Creating new dropdown terminal with command: $TERMINAL_CMD" + + # Get window count and list before spawning + local windows_before=$(hyprctl clients -j) + local count_before=$(echo "$windows_before" | jq 'length') + + # Launch terminal with rules applied from the start + hyprctl dispatch exec "[float; move 25% 5%; size 50% 50%; pin] $TERMINAL_CMD" + + # Wait for window to appear + sleep 1 + + # Get windows after spawning + local windows_after=$(hyprctl clients -j) + local count_after=$(echo "$windows_after" | jq 'length') + + if [ "$count_after" -gt "$count_before" ]; then + # Find the new window by comparing before/after lists + local new_addr=$(comm -13 \ + <(echo "$windows_before" | jq -r '.[].address' | sort) \ + <(echo "$windows_after" | jq -r '.[].address' | sort) \ + | head -1) + + if [ -n "$new_addr" ] && [ "$new_addr" != "null" ]; then + # Store the address + echo "$new_addr" > "$ADDR_FILE" + debug_echo "Terminal created with address: $new_addr" + return 0 + fi + fi + + # Fallback: try to find by the most recently mapped window + local new_addr=$(hyprctl clients -j | jq -r 'sort_by(.focusHistoryID) | .[-1] | .address') + + if [ -n "$new_addr" ] && [ "$new_addr" != "null" ]; then + echo "$new_addr" > "$ADDR_FILE" + debug_echo "Terminal created with address: $new_addr (fallback method)" + 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" if terminal_in_special; then - echo "Bringing terminal to workspace $CURRENT_WS and pinning" + debug_echo "Bringing terminal to workspace $CURRENT_WS and pinning" hyprctl dispatch movetoworkspace "$CURRENT_WS,address:$TERMINAL_ADDR" hyprctl dispatch pin "address:$TERMINAL_ADDR" hyprctl dispatch focuswindow "address:$TERMINAL_ADDR" else - echo "Unpinning and hiding terminal to special workspace" + debug_echo "Unpinning and hiding terminal to special workspace" hyprctl dispatch pin "address:$TERMINAL_ADDR" # Unpin (toggle) sleep 0.1 hyprctl dispatch movetoworkspacesilent "$SPECIAL_WS,address:$TERMINAL_ADDR" fi else - echo "Creating new dropdown terminal with command: $TERMINAL_CMD" - hyprctl dispatch exec "[float; move 25% 5%; size 50% 50%] $TERMINAL_CMD" - sleep 0.5 - if terminal_exists; then + debug_echo "No existing terminal found, creating new one" + if spawn_terminal; then TERMINAL_ADDR=$(get_terminal_address) - hyprctl dispatch pin "address:$TERMINAL_ADDR" - hyprctl dispatch focuswindow "address:$TERMINAL_ADDR" + if [ -n "$TERMINAL_ADDR" ]; then + hyprctl dispatch focuswindow "address:$TERMINAL_ADDR" + fi + else + echo "Failed to create terminal" + exit 1 fi -fi +fi \ No newline at end of file -- cgit v1.2.3 From b56edcff4d48d215ad26e1c64729a8ea7c311f22 Mon Sep 17 00:00:00 2001 From: Kiran George Date: Tue, 27 May 2025 21:45:24 +0530 Subject: Added animation similar to pyprland --- config/hypr/scripts/Dropterminal.sh | 196 ++++++++++++++++++++++++++++++------ 1 file changed, 168 insertions(+), 28 deletions(-) (limited to 'config/hypr/scripts') diff --git a/config/hypr/scripts/Dropterminal.sh b/config/hypr/scripts/Dropterminal.sh index 98420a24..51cdf31f 100755 --- a/config/hypr/scripts/Dropterminal.sh +++ b/config/hypr/scripts/Dropterminal.sh @@ -1,16 +1,21 @@ #!/bin/bash # /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## # Dropdown Terminal -# Usage: ./dropdown.sh [-d] -# Example: ./dropdown.sh foot -# ./dropdown.sh -d foot (with debug output) -# ./dropdown.sh "kitty -e zsh" -# ./dropdown.sh "alacritty --working-directory /home/user" +# Usage: ./Dropdown.sh [-d] +# Example: ./Dropdown.sh foot +# ./Dropdown.sh -d foot (with debug output) +# ./Dropdown.sh "kitty -e zsh" +# ./Dropdown.sh "alacritty --working-directory /home/user" DEBUG=false SPECIAL_WS="special:scratchpad" ADDR_FILE="/tmp/dropdown_terminal_addr" +# Animation settings +ANIMATION_DURATION=100 # milliseconds +SLIDE_STEPS=10 +SLIDE_DELAY=5 # milliseconds between steps + # Parse arguments if [ "$1" = "-d" ]; then DEBUG=true @@ -37,6 +42,91 @@ if [ -z "$TERMINAL_CMD" ]; then 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])"' +} + +# 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 +} + +# 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" +} + +# Function to get monitor info for centering +get_monitor_info() { + hyprctl monitors -j | jq -r '.[0] | "\(.x) \(.y) \(.width) \(.height)"' +} + +# Function to calculate dropdown position +calculate_dropdown_position() { + local monitor_info=$(get_monitor_info) + 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) + + # Calculate 50% width, 50% height, centered horizontally, 5% from top + local width=$((mon_width / 2)) + local height=$((mon_height / 2)) + local x=$((mon_x + (mon_width - width) / 2)) + local y=$((mon_y + mon_height / 20)) # 5% from top + + echo "$x $y $width $height" +} + # Get the current workspace CURRENT_WS=$(hyprctl activeworkspace -j | jq -r '.id') @@ -71,41 +161,57 @@ terminal_in_special() { spawn_terminal() { debug_echo "Creating new dropdown terminal with command: $TERMINAL_CMD" - # Get window count and list before spawning - local windows_before=$(hyprctl clients -j) - local count_before=$(echo "$windows_before" | jq 'length') + # Calculate dropdown position for later use + 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) + + debug_echo "Target position: ${target_x}x${target_y}, size: ${width}x${height}" - # Launch terminal with rules applied from the start - hyprctl dispatch exec "[float; move 25% 5%; size 50% 50%; pin] $TERMINAL_CMD" + # Get window count before spawning + windows_before=$(hyprctl clients -j) + 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 1 + sleep 0.1 # Get windows after spawning - local windows_after=$(hyprctl clients -j) - local count_after=$(echo "$windows_after" | jq 'length') + windows_after=$(hyprctl clients -j) + count_after=$(echo "$windows_after" | jq 'length') + + new_addr="" if [ "$count_after" -gt "$count_before" ]; then # Find the new window by comparing before/after lists - local new_addr=$(comm -13 \ + new_addr=$(comm -13 \ <(echo "$windows_before" | jq -r '.[].address' | sort) \ <(echo "$windows_after" | jq -r '.[].address' | sort) \ | head -1) - - if [ -n "$new_addr" ] && [ "$new_addr" != "null" ]; then - # Store the address - echo "$new_addr" > "$ADDR_FILE" - debug_echo "Terminal created with address: $new_addr" - return 0 - fi fi # Fallback: try to find by the most recently mapped window - local new_addr=$(hyprctl clients -j | jq -r 'sort_by(.focusHistoryID) | .[-1] | .address') + 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 echo "$new_addr" > "$ADDR_FILE" - debug_echo "Terminal created with address: $new_addr (fallback method)" + debug_echo "Terminal created with address: $new_addr in special workspace" + + # Small delay to ensure it's properly in special workspace + sleep 0.2 + + # Now bring it back with the same animation as subsequent shows + hyprctl dispatch movetoworkspace "$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 @@ -119,15 +225,49 @@ if terminal_exists; then debug_echo "Found existing terminal: $TERMINAL_ADDR" if terminal_in_special; then - debug_echo "Bringing terminal to workspace $CURRENT_WS and pinning" + 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) + + # Move to current workspace and pin hyprctl dispatch movetoworkspace "$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 "Unpinning and hiding terminal to special workspace" - hyprctl dispatch pin "address:$TERMINAL_ADDR" # Unpin (toggle) - sleep 0.1 - hyprctl dispatch movetoworkspacesilent "$SPECIAL_WS,address:$TERMINAL_ADDR" + 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 fi else debug_echo "No existing terminal found, creating new one" -- cgit v1.2.3 From d8aee89ba261d17597deff3fe00a7907adf240e2 Mon Sep 17 00:00:00 2001 From: Kiran George Date: Sat, 31 May 2025 08:18:33 +0530 Subject: Dropdown terminal improvements - Round 2 --- config/hypr/scripts/Dropterminal.sh | 36 +++++++++++++++++++++++------------- 1 file changed, 23 insertions(+), 13 deletions(-) (limited to 'config/hypr/scripts') diff --git a/config/hypr/scripts/Dropterminal.sh b/config/hypr/scripts/Dropterminal.sh index 51cdf31f..a8e1cda3 100755 --- a/config/hypr/scripts/Dropterminal.sh +++ b/config/hypr/scripts/Dropterminal.sh @@ -11,9 +11,15 @@ DEBUG=false 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 +X_PERCENT=25 # X position as percentage from left (25% centers a 50% width window) +Y_PERCENT=5 # Y position as percentage from top + # Animation settings ANIMATION_DURATION=100 # milliseconds -SLIDE_STEPS=10 +SLIDE_STEPS=5 SLIDE_DELAY=5 # milliseconds between steps # Parse arguments @@ -39,6 +45,12 @@ if [ -z "$TERMINAL_CMD" ]; then 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 " X_PERCENT - X position from left as percentage (default: 25)" + echo " Y_PERCENT - Y position from top as percentage (default: 5)" exit 1 fi @@ -118,11 +130,11 @@ calculate_dropdown_position() { local mon_width=$(echo $monitor_info | cut -d' ' -f3) local mon_height=$(echo $monitor_info | cut -d' ' -f4) - # Calculate 50% width, 50% height, centered horizontally, 5% from top - local width=$((mon_width / 2)) - local height=$((mon_height / 2)) - local x=$((mon_x + (mon_width - width) / 2)) - local y=$((mon_y + mon_height / 20)) # 5% from top + # Calculate position and size based on percentages + local width=$((mon_width * WIDTH_PERCENT / 100)) + local height=$((mon_height * HEIGHT_PERCENT / 100)) + local x=$((mon_x + (mon_width * X_PERCENT / 100))) + local y=$((mon_y + (mon_height * Y_PERCENT / 100))) echo "$x $y $width $height" } @@ -175,7 +187,7 @@ spawn_terminal() { 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" + hyprctl dispatch exec "[float; size $width $height; stayfocused; workspace special:scratchpad silent] $TERMINAL_CMD" # Wait for window to appear sleep 0.1 @@ -208,7 +220,8 @@ spawn_terminal() { sleep 0.2 # Now bring it back with the same animation as subsequent shows - hyprctl dispatch movetoworkspace "$CURRENT_WS,address:$new_addr" + # 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" @@ -234,8 +247,8 @@ if terminal_exists; then width=$(echo $pos_info | cut -d' ' -f3) height=$(echo $pos_info | cut -d' ' -f4) - # Move to current workspace and pin - hyprctl dispatch movetoworkspace "$CURRENT_WS,address:$TERMINAL_ADDR" + # 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 @@ -276,8 +289,5 @@ else if [ -n "$TERMINAL_ADDR" ]; then hyprctl dispatch focuswindow "address:$TERMINAL_ADDR" fi - else - echo "Failed to create terminal" - exit 1 fi fi \ No newline at end of file -- cgit v1.2.3 From 713f9498329cd15457abe3d65b07ae9481510a22 Mon Sep 17 00:00:00 2001 From: "Ja.KooLit" <85185940+JaKooLit@users.noreply.github.com> Date: Sat, 31 May 2025 20:28:08 +0000 Subject: Revert "Dropdown terminal improvements - Round 2" --- config/hypr/scripts/Dropterminal.sh | 36 +++++++++++++----------------------- 1 file changed, 13 insertions(+), 23 deletions(-) (limited to 'config/hypr/scripts') diff --git a/config/hypr/scripts/Dropterminal.sh b/config/hypr/scripts/Dropterminal.sh index a8e1cda3..51cdf31f 100755 --- a/config/hypr/scripts/Dropterminal.sh +++ b/config/hypr/scripts/Dropterminal.sh @@ -11,15 +11,9 @@ DEBUG=false 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 -X_PERCENT=25 # X position as percentage from left (25% centers a 50% width window) -Y_PERCENT=5 # Y position as percentage from top - # Animation settings ANIMATION_DURATION=100 # milliseconds -SLIDE_STEPS=5 +SLIDE_STEPS=10 SLIDE_DELAY=5 # milliseconds between steps # Parse arguments @@ -45,12 +39,6 @@ if [ -z "$TERMINAL_CMD" ]; then 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 " X_PERCENT - X position from left as percentage (default: 25)" - echo " Y_PERCENT - Y position from top as percentage (default: 5)" exit 1 fi @@ -130,11 +118,11 @@ calculate_dropdown_position() { local mon_width=$(echo $monitor_info | cut -d' ' -f3) local mon_height=$(echo $monitor_info | cut -d' ' -f4) - # Calculate position and size based on percentages - local width=$((mon_width * WIDTH_PERCENT / 100)) - local height=$((mon_height * HEIGHT_PERCENT / 100)) - local x=$((mon_x + (mon_width * X_PERCENT / 100))) - local y=$((mon_y + (mon_height * Y_PERCENT / 100))) + # Calculate 50% width, 50% height, centered horizontally, 5% from top + local width=$((mon_width / 2)) + local height=$((mon_height / 2)) + local x=$((mon_x + (mon_width - width) / 2)) + local y=$((mon_y + mon_height / 20)) # 5% from top echo "$x $y $width $height" } @@ -187,7 +175,7 @@ spawn_terminal() { count_before=$(echo "$windows_before" | jq 'length') # Launch terminal directly in special workspace to avoid visible spawn - hyprctl dispatch exec "[float; size $width $height; stayfocused; workspace special:scratchpad silent] $TERMINAL_CMD" + hyprctl dispatch exec "[float; size $width $height; workspace special:scratchpad silent] $TERMINAL_CMD" # Wait for window to appear sleep 0.1 @@ -220,8 +208,7 @@ spawn_terminal() { 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 movetoworkspace "$CURRENT_WS,address:$new_addr" hyprctl dispatch pin "address:$new_addr" animate_slide_down "$new_addr" "$target_x" "$target_y" "$width" "$height" @@ -247,8 +234,8 @@ if terminal_exists; then 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" + # Move to current workspace and pin + hyprctl dispatch movetoworkspace "$CURRENT_WS,address:$TERMINAL_ADDR" hyprctl dispatch pin "address:$TERMINAL_ADDR" # Set size and animate slide down @@ -289,5 +276,8 @@ else if [ -n "$TERMINAL_ADDR" ]; then hyprctl dispatch focuswindow "address:$TERMINAL_ADDR" fi + else + echo "Failed to create terminal" + exit 1 fi fi \ No newline at end of file -- cgit v1.2.3 From 4564b38d1b84888f153802cc5b4e9c32de4aa8a3 Mon Sep 17 00:00:00 2001 From: "Ja.KooLit" <85185940+JaKooLit@users.noreply.github.com> Date: Sat, 31 May 2025 20:37:06 +0000 Subject: Revert "Revert "Dropdown terminal improvements - Round 2"" --- config/hypr/scripts/Dropterminal.sh | 36 +++++++++++++++++++++++------------- 1 file changed, 23 insertions(+), 13 deletions(-) (limited to 'config/hypr/scripts') diff --git a/config/hypr/scripts/Dropterminal.sh b/config/hypr/scripts/Dropterminal.sh index 51cdf31f..a8e1cda3 100755 --- a/config/hypr/scripts/Dropterminal.sh +++ b/config/hypr/scripts/Dropterminal.sh @@ -11,9 +11,15 @@ DEBUG=false 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 +X_PERCENT=25 # X position as percentage from left (25% centers a 50% width window) +Y_PERCENT=5 # Y position as percentage from top + # Animation settings ANIMATION_DURATION=100 # milliseconds -SLIDE_STEPS=10 +SLIDE_STEPS=5 SLIDE_DELAY=5 # milliseconds between steps # Parse arguments @@ -39,6 +45,12 @@ if [ -z "$TERMINAL_CMD" ]; then 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 " X_PERCENT - X position from left as percentage (default: 25)" + echo " Y_PERCENT - Y position from top as percentage (default: 5)" exit 1 fi @@ -118,11 +130,11 @@ calculate_dropdown_position() { local mon_width=$(echo $monitor_info | cut -d' ' -f3) local mon_height=$(echo $monitor_info | cut -d' ' -f4) - # Calculate 50% width, 50% height, centered horizontally, 5% from top - local width=$((mon_width / 2)) - local height=$((mon_height / 2)) - local x=$((mon_x + (mon_width - width) / 2)) - local y=$((mon_y + mon_height / 20)) # 5% from top + # Calculate position and size based on percentages + local width=$((mon_width * WIDTH_PERCENT / 100)) + local height=$((mon_height * HEIGHT_PERCENT / 100)) + local x=$((mon_x + (mon_width * X_PERCENT / 100))) + local y=$((mon_y + (mon_height * Y_PERCENT / 100))) echo "$x $y $width $height" } @@ -175,7 +187,7 @@ spawn_terminal() { 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" + hyprctl dispatch exec "[float; size $width $height; stayfocused; workspace special:scratchpad silent] $TERMINAL_CMD" # Wait for window to appear sleep 0.1 @@ -208,7 +220,8 @@ spawn_terminal() { sleep 0.2 # Now bring it back with the same animation as subsequent shows - hyprctl dispatch movetoworkspace "$CURRENT_WS,address:$new_addr" + # 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" @@ -234,8 +247,8 @@ if terminal_exists; then width=$(echo $pos_info | cut -d' ' -f3) height=$(echo $pos_info | cut -d' ' -f4) - # Move to current workspace and pin - hyprctl dispatch movetoworkspace "$CURRENT_WS,address:$TERMINAL_ADDR" + # 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 @@ -276,8 +289,5 @@ else if [ -n "$TERMINAL_ADDR" ]; then hyprctl dispatch focuswindow "address:$TERMINAL_ADDR" fi - else - echo "Failed to create terminal" - exit 1 fi fi \ No newline at end of file -- cgit v1.2.3 From e9c7d8a3882b1166c0ed99e4501e465937089b05 Mon Sep 17 00:00:00 2001 From: Kiran George Date: Sun, 1 Jun 2025 08:45:47 +0530 Subject: Fixed drop down terminal focus --- config/hypr/scripts/Dropterminal.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'config/hypr/scripts') diff --git a/config/hypr/scripts/Dropterminal.sh b/config/hypr/scripts/Dropterminal.sh index a8e1cda3..fa5b899b 100755 --- a/config/hypr/scripts/Dropterminal.sh +++ b/config/hypr/scripts/Dropterminal.sh @@ -187,7 +187,7 @@ spawn_terminal() { count_before=$(echo "$windows_before" | jq 'length') # Launch terminal directly in special workspace to avoid visible spawn - hyprctl dispatch exec "[float; size $width $height; stayfocused; workspace special:scratchpad silent] $TERMINAL_CMD" + hyprctl dispatch exec "[float; size $width $height; workspace special:scratchpad silent] $TERMINAL_CMD" # Wait for window to appear sleep 0.1 -- cgit v1.2.3 From 30ed636ba6c51b417cccb5acde1fbb8221b55b84 Mon Sep 17 00:00:00 2001 From: Kiran George Date: Sun, 1 Jun 2025 08:48:40 +0530 Subject: SwayNC DND bypass for volume and brightness notification --- config/hypr/scripts/Brightness.sh | 2 +- config/hypr/scripts/BrightnessKbd.sh | 2 +- config/hypr/scripts/Volume.sh | 14 +++++++------- 3 files changed, 9 insertions(+), 9 deletions(-) (limited to 'config/hypr/scripts') diff --git a/config/hypr/scripts/Brightness.sh b/config/hypr/scripts/Brightness.sh index 8e5d525a..bf28fc8c 100755 --- a/config/hypr/scripts/Brightness.sh +++ b/config/hypr/scripts/Brightness.sh @@ -29,7 +29,7 @@ get_icon() { # Notify notify_user() { - notify-send -e -h string:x-canonical-private-synchronous:brightness_notif -h int:value:$current -u low -i $icon "Screen" "Brightness:$current%" + notify-send -e -h string:x-canonical-private-synchronous:brightness_notif -h int:value:$current -h boolean:SWAYNC_BYPASS_DND:true -u low -i $icon "Screen" "Brightness:$current%" } # Change brightness diff --git a/config/hypr/scripts/BrightnessKbd.sh b/config/hypr/scripts/BrightnessKbd.sh index 4c56bc03..24737b73 100755 --- a/config/hypr/scripts/BrightnessKbd.sh +++ b/config/hypr/scripts/BrightnessKbd.sh @@ -26,7 +26,7 @@ get_icon() { } # Notify notify_user() { - notify-send -e -h string:x-canonical-private-synchronous:brightness_notif -h int:value:$current -u low -i "$icon" "Keyboard" "Brightness:$current%" + notify-send -e -h string:x-canonical-private-synchronous:brightness_notif -h int:value:$current -h boolean:SWAYNC_BYPASS_DND:true -u low -i "$icon" "Keyboard" "Brightness:$current%" } # Change brightness diff --git a/config/hypr/scripts/Volume.sh b/config/hypr/scripts/Volume.sh index b205f8f9..8efdb55c 100755 --- a/config/hypr/scripts/Volume.sh +++ b/config/hypr/scripts/Volume.sh @@ -32,9 +32,9 @@ get_icon() { # Notify notify_user() { if [[ "$(get_volume)" == "Muted" ]]; then - notify-send -e -h string:x-canonical-private-synchronous:volume_notif -u low -i "$(get_icon)" " Volume:" " Muted" + notify-send -e -h string:x-canonical-private-synchronous:volume_notif -h boolean:SWAYNC_BYPASS_DND:true -u low -i "$(get_icon)" " Volume:" " Muted" else - notify-send -e -h int:value:"$(get_volume | sed 's/%//')" -h string:x-canonical-private-synchronous:volume_notif -u low -i "$(get_icon)" " Volume Level:" " $(get_volume)" && + notify-send -e -h int:value:"$(get_volume | sed 's/%//')" -h string:x-canonical-private-synchronous:volume_notif -h boolean:SWAYNC_BYPASS_DND:true -u low -i "$(get_icon)" " Volume Level:" " $(get_volume)" && "$sDIR/Sounds.sh" --volume fi } @@ -60,18 +60,18 @@ dec_volume() { # Toggle Mute toggle_mute() { if [ "$(pamixer --get-mute)" == "false" ]; then - pamixer -m && notify-send -e -u low -i "$iDIR/volume-mute.png" " Mute" + pamixer -m && notify-send -e -u low -h boolean:SWAYNC_BYPASS_DND:true -i "$iDIR/volume-mute.png" " Mute" elif [ "$(pamixer --get-mute)" == "true" ]; then - pamixer -u && notify-send -e -u low -i "$(get_icon)" " Volume:" " Switched ON" + pamixer -u && notify-send -e -u low -h boolean:SWAYNC_BYPASS_DND:true -i "$(get_icon)" " Volume:" " Switched ON" fi } # Toggle Mic toggle_mic() { if [ "$(pamixer --default-source --get-mute)" == "false" ]; then - pamixer --default-source -m && notify-send -e -u low -i "$iDIR/microphone-mute.png" " Microphone:" " Switched OFF" + pamixer --default-source -m && notify-send -e -u low -h boolean:SWAYNC_BYPASS_DND:true -i "$iDIR/microphone-mute.png" " Microphone:" " Switched OFF" elif [ "$(pamixer --default-source --get-mute)" == "true" ]; then - pamixer -u --default-source u && notify-send -e -u low -i "$iDIR/microphone.png" " Microphone:" " Switched ON" + pamixer -u --default-source u && notify-send -e -u low -h boolean:SWAYNC_BYPASS_DND:true -i "$iDIR/microphone.png" " Microphone:" " Switched ON" fi } # Get Mic Icon @@ -98,7 +98,7 @@ get_mic_volume() { notify_mic_user() { volume=$(get_mic_volume) icon=$(get_mic_icon) - notify-send -e -h int:value:"$volume" -h "string:x-canonical-private-synchronous:volume_notif" -u low -i "$icon" " Mic Level:" " $volume" + notify-send -e -h int:value:"$volume" -h "string:x-canonical-private-synchronous:volume_notif" -h boolean:SWAYNC_BYPASS_DND:true -u low -i "$icon" " Mic Level:" " $volume" } # Increase MIC Volume -- cgit v1.2.3 From ab03e009ba48f96b6b6bd4fa0d040e48f404d5d2 Mon Sep 17 00:00:00 2001 From: Lars Müller Date: Thu, 12 Jun 2025 18:12:36 +0200 Subject: add: better rofi theme selector --- config/hypr/scripts/RofiThemeSelector.sh | 207 +++++++++++++++++++++---------- 1 file changed, 143 insertions(+), 64 deletions(-) (limited to 'config/hypr/scripts') diff --git a/config/hypr/scripts/RofiThemeSelector.sh b/config/hypr/scripts/RofiThemeSelector.sh index 6fd8a6f8..8423b2fe 100755 --- a/config/hypr/scripts/RofiThemeSelector.sh +++ b/config/hypr/scripts/RofiThemeSelector.sh @@ -1,75 +1,154 @@ #!/bin/bash -# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## -# Script for adding a selected theme to the Rofi config - -IFS=$'\n\t' - -# Define directories and variables -rofi_theme_dir="$HOME/.config/rofi/themes" -rofi_config_file="$HOME/.config/rofi/config.rasi" -SED=$(which sed) -iDIR="$HOME/.config/swaync/images" -rofi_theme="$HOME/.config/rofi/config-rofi-theme.rasi" - -# Function to display menu options -menu() { - options=() - while IFS= read -r file; do - options+=("$file") - done < <(find -L "$rofi_theme_dir" -maxdepth 1 -type f -exec basename {} \; | sort -V) - - printf '%s\n' "${options[@]}" -} +# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */  # +# Rofi Themes - Script to preview and apply themes by live-reloading the config. -# Function to add or update theme in the config.rasi -add_theme_to_config() { - local theme_name="$1" - local theme_path="$rofi_theme_dir/$theme_name" - - # if config in $HOME to write as $HOME - if [[ "$theme_path" == $HOME/* ]]; then - theme_path_with_tilde="~${theme_path#$HOME}" - else - theme_path_with_tilde="$theme_path" - fi +# --- Configuration --- +ROFI_THEMES_DIR_CONFIG="$HOME/.config/rofi/themes" +ROFI_THEMES_DIR_LOCAL="$HOME/.local/share/rofi/themes" +ROFI_CONFIG_FILE="$HOME/.config/rofi/config.rasi" +ROFI_THEME_FOR_THIS_SCRIPT="$HOME/.config/rofi/config-rofi-theme.rasi" # A separate rofi theme for the picker itself +IDIR="$HOME/.config/swaync/images" # For notifications - # If no @theme is in the file, add it - if ! grep -q '^\s*@theme' "$rofi_config_file"; then - echo -e "\n\n@theme \"$theme_path_with_tilde\"" >> "$rofi_config_file" - echo "Added @theme \"$theme_path_with_tilde\" to $rofi_config_file" - else - $SED -i "s/^\(\s*@theme.*\)/\/\/\1/" "$rofi_config_file" - echo -e "@theme \"$theme_path_with_tilde\"" >> "$rofi_config_file" - echo "Updated @theme line to $theme_path_with_tilde" - fi +# --- Helper Functions --- - # Ensure no more than max # of lines with //@theme lines - max_line="9" - total_lines=$(grep -c '^\s*//@theme' "$rofi_config_file") - - if [ "$total_lines" -gt "$max_line" ]; then - excess=$((total_lines - max_line)) - # Remove the oldest or the very top //@theme lines - for i in $(seq 1 "$excess"); do - $SED -i '0,/^\s*\/\/@theme/ { /^\s*\/\/@theme/ {d; q; }}' "$rofi_config_file" - done - echo "Removed excess //@theme lines" - fi +# Function to send a notification +notify_user() { + notify-send -u low -i "$1" "$2" "$3" } -# Main function -main() { - choice=$(menu | rofi rofi -dmenu -i -config $rofi_theme) +# Function to apply the selected rofi theme to the main config file +apply_rofi_theme_to_config() { + local theme_name_to_apply="$1" - if [[ -z "$choice" ]]; then - exit 0 - fi - add_theme_to_config "$choice" - notify-send -i "$iDIR/ja.png" -u low 'Rofi Theme applied:' "$choice" + # Find the full path of the theme file + local theme_path + if [[ -f "$ROFI_THEMES_DIR_CONFIG/$theme_name_to_apply" ]]; then + theme_path="$ROFI_THEMES_DIR_CONFIG/$theme_name_to_apply" + elif [[ -f "$ROFI_THEMES_DIR_LOCAL/$theme_name_to_apply" ]]; then + theme_path="$ROFI_THEMES_DIR_LOCAL/$theme_name_to_apply" + else + notify_user "$IDIR/error.png" "Error" "Theme file not found: $theme_name_to_apply" + return 1 + fi + + # Use ~ for the home directory in the config path + local theme_path_with_tilde="~${theme_path#$HOME}" + + # Create a temporary file to safely edit the config + local temp_rofi_config_file + temp_rofi_config_file=$(mktemp) + cp "$ROFI_CONFIG_FILE" "$temp_rofi_config_file" + + # Comment out any existing @theme entry + sed -i -E 's/^(\s*@theme)/\\/\\/\1/' "$temp_rofi_config_file" + + # Add the new @theme entry at the end of the file + echo "@theme \"$theme_path_with_tilde\"" >>"$temp_rofi_config_file" + + # Overwrite the original config file + cp "$temp_rofi_config_file" "$ROFI_CONFIG_FILE" + rm "$temp_rofi_config_file" + + # Prune old commented-out theme lines to prevent clutter + local max_lines=10 + local total_lines=$(grep -c '^//\s*@theme' "$ROFI_CONFIG_FILE") + if [ "$total_lines" -gt "$max_lines" ]; then + local excess=$((total_lines - max_lines)) + for ((i = 1; i <= excess; i++)); do + sed -i '0,/^\s*\/\/@theme/s///' "$ROFI_CONFIG_FILE" + done + fi + + return 0 } -if pgrep -x "rofi" >/dev/null; then - pkill rofi +# --- Main Script Execution --- + +# Check for required directories and files +if [ ! -d "$ROFI_THEMES_DIR_CONFIG" ] && [ ! -d "$ROFI_THEMES_DIR_LOCAL" ]; then + notify_user "$IDIR/error.png" "E-R-R-O-R" "No Rofi themes directory found." + exit 1 +fi + +if [ ! -f "$ROFI_CONFIG_FILE" ]; then + notify_user "$IDIR/error.png" "E-R-R-O-R" "Rofi config file not found: $ROFI_CONFIG_FILE" + exit 1 fi -main +# Backup the original config content +original_rofi_config_content_backup=$(cat "$ROFI_CONFIG_FILE") + +# Generate a sorted list of available theme file names +mapfile -t available_theme_names < <(( + find "$ROFI_THEMES_DIR_CONFIG" -maxdepth 1 -name "*.rasi" -type f -printf "%f\n" 2>/dev/null + find "$ROFI_THEMES_DIR_LOCAL" -maxdepth 1 -name "*.rasi" -type f -printf "%f\n" 2>/dev/null +) | sort -u) + +if [ ${#available_theme_names[@]} -eq 0 ]; then + notify_user "$IDIR/error.png" "No Rofi Themes" "No .rasi files found in theme directories." + exit 1 +fi + +# Find the currently active theme to set as the initial selection +current_selection_index=0 +current_active_theme_path=$(grep -oP '^\s*@theme\s*"\K[^"]+' "$ROFI_CONFIG_FILE" | tail -n 1) +if [ -n "$current_active_theme_path" ]; then + current_active_theme_name=$(basename "$current_active_theme_path") + for i in "${!available_theme_names[@]}"; do + if [[ "${available_theme_names[$i]}" == "$current_active_theme_name" ]]; then + current_selection_index=$i + break + fi + done +fi + +# Main preview loop +while true; do + theme_to_preview_now="${available_theme_names[$current_selection_index]}" + + # Apply the theme for preview + if ! apply_rofi_theme_to_config "$theme_to_preview_now"; then + echo "$original_rofi_config_content_backup" >"$ROFI_CONFIG_FILE" + notify_user "$IDIR/error.png" "Preview Error" "Failed to apply $theme_to_preview_now. Reverted." + exit 1 + fi + + # Prepare theme list for Rofi + rofi_input_list="" + for theme_name_in_list in "${available_theme_names[@]}"; do + rofi_input_list+="$(basename "$theme_name_in_list" .rasi)\n" + done + rofi_input_list_trimmed="${rofi_input_list%\\n}" + + # Launch Rofi and get user's choice + chosen_index_from_rofi=$(echo -e "$rofi_input_list_trimmed" | + rofi -dmenu -i \ + -format 'i' \ + -p "Rofi Theme" \ + -mesg "Preview: $(basename "$theme_to_preview_now" .rasi) | Enter: Preview | Ctrl+S: Apply & Exit | Esc: Cancel" \ + -config "$ROFI_THEME_FOR_THIS_SCRIPT" \ + -selected-row "$current_selection_index" \ + -kb-custom-1 "Control+s") + + rofi_exit_code=$? + + # Handle Rofi's exit code + if [ $rofi_exit_code -eq 0 ]; then # Enter + if [[ "$chosen_index_from_rofi" =~ ^[0-9]+$ ]] && [ "$chosen_index_from_rofi" -lt "${#available_theme_names[@]}" ]; then + current_selection_index="$chosen_index_from_rofi" + fi + elif [ $rofi_exit_code -eq 1 ]; then # Escape + notify_user "$IDIR/note.png" "Rofi Theme" "Selection cancelled. Reverting to original theme." + echo "$original_rofi_config_content_backup" >"$ROFI_CONFIG_FILE" + break + elif [ $rofi_exit_code -eq 10 ]; then # Custom bind 1 (Ctrl+S) + notify_user "$IDIR/ja.png" "Rofi Theme Applied" "$(basename "$theme_to_preview_now" .rasi)" + break + else # Error or unexpected exit code + notify_user "$IDIR/error.png" "Rofi Error" "Unexpected Rofi exit ($rofi_exit_code). Reverting." + echo "$original_rofi_config_content_backup" >"$ROFI_CONFIG_FILE" + break + fi +done + +exit 0 -- cgit v1.2.3 From 22193a572b2672f982fde74e8544c8881caccb6d Mon Sep 17 00:00:00 2001 From: loner <2788892716@qq.com> Date: Wed, 25 Jun 2025 16:30:27 +0800 Subject: fix brightness The brightness adjustment response is slow --- config/hypr/scripts/Brightness.sh | 101 ++++++++++++++++++-------------------- 1 file changed, 48 insertions(+), 53 deletions(-) (limited to 'config/hypr/scripts') diff --git a/config/hypr/scripts/Brightness.sh b/config/hypr/scripts/Brightness.sh index 8e5d525a..3e283c11 100755 --- a/config/hypr/scripts/Brightness.sh +++ b/config/hypr/scripts/Brightness.sh @@ -6,69 +6,64 @@ iDIR="$HOME/.config/swaync/icons" notification_timeout=1000 step=10 # INCREASE/DECREASE BY THIS VALUE -# Get brightness -get_backlight() { - brightnessctl -m | cut -d, -f4 | sed 's/%//' +# Get current brightness as an integer (without %) +get_brightness() { + brightnessctl -m | cut -d, -f4 | tr -d '%' } -# Get icons -get_icon() { - current=$(get_backlight) - if [ "$current" -le "20" ]; then - icon="$iDIR/brightness-20.png" - elif [ "$current" -le "40" ]; then - icon="$iDIR/brightness-40.png" - elif [ "$current" -le "60" ]; then - icon="$iDIR/brightness-60.png" - elif [ "$current" -le "80" ]; then - icon="$iDIR/brightness-80.png" - else - icon="$iDIR/brightness-100.png" - fi +# Determine the icon based on brightness level +get_icon_path() { + local brightness=$1 + local level=$(( (brightness + 19) / 20 * 20 )) # Round up to next 20 + if (( level > 100 )); then + level=100 + fi + echo "$ICON_DIR/brightness-${level}.png" } -# Notify -notify_user() { - notify-send -e -h string:x-canonical-private-synchronous:brightness_notif -h int:value:$current -u low -i $icon "Screen" "Brightness:$current%" +# Send notification +send_notification() { + local brightness=$1 + local icon_path=$2 + + notify-send -e \ + -h string:x-canonical-private-synchronous:brightness_notif \ + -h int:value:"$brightness" \ + -u low \ + -i "$icon_path" \ + "Screen" "Brightness: ${brightness}%" } -# Change brightness -change_backlight() { - local current_brightness - current_brightness=$(get_backlight) +# Change brightness and notify +change_brightness() { + local delta=$1 + local current new icon + + current=$(get_brightness) + new=$((current + delta)) - # Calculate new brightness - if [[ "$1" == "+${step}%" ]]; then - new_brightness=$((current_brightness + step)) - elif [[ "$1" == "${step}%-" ]]; then - new_brightness=$((current_brightness - step)) - fi + # Clamp between 5 and 100 + (( new < 5 )) && new=5 + (( new > 100 )) && new=100 - # Ensure new brightness is within valid range - if (( new_brightness < 5 )); then - new_brightness=5 - elif (( new_brightness > 100 )); then - new_brightness=100 - fi + brightnessctl set "${new}%" - brightnessctl set "${new_brightness}%" - get_icon - current=$new_brightness - notify_user + icon=$(get_icon_path "$new") + send_notification "$new" "$icon" } -# Execute accordingly +# Main case "$1" in - "--get") - get_backlight - ;; - "--inc") - change_backlight "+${step}%" - ;; - "--dec") - change_backlight "${step}%-" - ;; - *) - get_backlight - ;; + "--get") + get_brightness + ;; + "--inc") + change_brightness "$STEP" + ;; + "--dec") + change_brightness "-$STEP" + ;; + *) + get_brightness + ;; esac -- cgit v1.2.3 From b37cf284a9d1ebd6583ba8489195c755c65935d8 Mon Sep 17 00:00:00 2001 From: JaKooLit Date: Tue, 15 Jul 2025 19:33:34 +0900 Subject: Introducing QuickShell --- config/hypr/UserConfigs/UserSettings.conf | 2 -- config/hypr/scripts/Refresh.sh | 4 +-- config/hypr/scripts/RefreshNoWaybar.sh | 2 +- copy.sh | 51 ++++++++++++++++++++++++++----- 4 files changed, 47 insertions(+), 12 deletions(-) (limited to 'config/hypr/scripts') diff --git a/config/hypr/UserConfigs/UserSettings.conf b/config/hypr/UserConfigs/UserSettings.conf index 29dbc572..1f8c23c3 100644 --- a/config/hypr/UserConfigs/UserSettings.conf +++ b/config/hypr/UserConfigs/UserSettings.conf @@ -104,8 +104,6 @@ xwayland { } render { - #explicit_sync = 2 - #explicit_sync_kms = 2 direct_scanout = 0 } diff --git a/config/hypr/scripts/Refresh.sh b/config/hypr/scripts/Refresh.sh index 2d7887a5..d04570b1 100755 --- a/config/hypr/scripts/Refresh.sh +++ b/config/hypr/scripts/Refresh.sh @@ -25,8 +25,8 @@ done # added since wallust sometimes not applying killall -SIGUSR2 waybar -# quit ags & relaunch ags -#ags -q && ags & +# quit quickshell & relaunch quickshell +#pkill qs && qs & # some process to kill for pid in $(pidof waybar rofi swaync ags swaybg); do diff --git a/config/hypr/scripts/RefreshNoWaybar.sh b/config/hypr/scripts/RefreshNoWaybar.sh index e5a0835e..cdbb82db 100755 --- a/config/hypr/scripts/RefreshNoWaybar.sh +++ b/config/hypr/scripts/RefreshNoWaybar.sh @@ -26,7 +26,7 @@ for _prs in "${_ps[@]}"; do done # quit ags & relaunch ags -#ags -q && ags & +#pkill qs && qs & # Wallust refresh ${SCRIPTSDIR}/WallustSwww.sh & diff --git a/copy.sh b/copy.sh index 0c556ddd..f752ac92 100755 --- a/copy.sh +++ b/copy.sh @@ -240,11 +240,11 @@ if command -v blueman-applet >/dev/null 2>&1; then sed -i '/^\s*#exec-once = blueman-applet/s/^#//' config/hypr/UserConfigs/Startup_Apps.conf 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 - sed -i '/#ags -q && ags &/s/^#//' config/hypr/scripts/RefreshNoWaybar.sh - sed -i '/#ags -q && ags &/s/^#//' config/hypr/scripts/Refresh.sh +# 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 + sed -i '/#pkill qs && qs &/s/^#//' config/hypr/scripts/RefreshNoWaybar.sh + sed -i '/#pkill qs && qs &/s/^#//' config/hypr/scripts/Refresh.sh fi printf "\n%.0s" {1..1} @@ -461,7 +461,7 @@ fi printf "${INFO} - copying dotfiles ${SKY_BLUE}first${RESET} part\n" # Config directories which will ask the user whether to replace or not -DIRS="ags fastfetch kitty rofi swaync" +DIRS="fastfetch kitty rofi swaync" for DIR2 in $DIRS; do DIRPATH="$HOME/.config/$DIR2" @@ -670,6 +670,43 @@ done printf "\n%.0s" {1..1} +# quickshell (ags alternative) +# Check if quickshell is running +if pgrep -x "qs" >/dev/null; then + echo -e "${NOTE} - ${YELLOW}quickshell${RESET} is currently installed and running." + + DIRPATH_QS="$HOME/.config/quickshell" + + if [ ! -d "$DIRPATH_QS" ]; then + echo "${INFO} - quickshell config not found, copying new config." + if [ -d "config/quickshell" ]; then + cp -r "config/quickshell/" "$DIRPATH" 2>&1 | tee -a "$LOG" + fi + else + read -p "${CAT} Do you want to overwrite your existing ${YELLOW}quickshell${RESET} config? [y/N] " answer_qs + case "$answer_qs" in + [Yy]* ) + BACKUP_DIR=$(get_backup_dirname) + mv "$DIRPATH_QS" "$DIRPATH_QS-backup-$BACKUP_DIR" 2>&1 | tee -a "$LOG" + echo -e "${NOTE} - Backed up quickshell to $DIRPATH_QS-backup-$BACKUP_DIR" + + cp -r "config/quickshell/" "$DIRPATH_QS" 2>&1 | tee -a "$LOG" + if [ $? -eq 0 ]; then + echo "${OK} - ${YELLOW}quickshell${RESET} overwritten successfully." + else + echo "${ERROR} - Failed to copy ${YELLOW}quickshell${RESET} config." + exit 1 + fi + ;; + * ) + echo "${NOTE} - Skipping overwrite of quickshell config." + ;; + esac + fi +fi +printf "\n%.0s" {1..1} + + # Restore automatically Animations and Monitor-Profiles # including monitors.conf and workspaces.conf HYPR_DIR="$HOME/.config/hypr" @@ -1037,4 +1074,4 @@ printf "\n%.0s" {1..1} printf "${INFO} However, it is ${MAGENTA}HIGHLY SUGGESTED${RESET} to logout and re-login or better reboot to avoid any issues" printf "\n%.0s" {1..1} printf "${SKY_BLUE}Thank you${RESET} for using ${MAGENTA}KooL's Hyprland Configuration${RESET}... ${YELLOW}ENJOY!!!${RESET}" -printf "\n%.0s" {1..3} +printf "\n%.0s" {1..3} \ No newline at end of file -- cgit v1.2.3 From 7a3bd4f9fe48aad02ef8b13d3677b3bd8358252c Mon Sep 17 00:00:00 2001 From: "Ja.KooLit" <85185940+JaKooLit@users.noreply.github.com> Date: Tue, 15 Jul 2025 23:45:52 +0900 Subject: Update Brightness.sh fixes upper case as it does not work --- config/hypr/scripts/Brightness.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'config/hypr/scripts') diff --git a/config/hypr/scripts/Brightness.sh b/config/hypr/scripts/Brightness.sh index 3e283c11..91ad5f05 100755 --- a/config/hypr/scripts/Brightness.sh +++ b/config/hypr/scripts/Brightness.sh @@ -18,7 +18,7 @@ get_icon_path() { if (( level > 100 )); then level=100 fi - echo "$ICON_DIR/brightness-${level}.png" + echo "$iDIR/brightness-${level}.png" } # Send notification @@ -58,10 +58,10 @@ case "$1" in get_brightness ;; "--inc") - change_brightness "$STEP" + change_brightness "$step" ;; "--dec") - change_brightness "-$STEP" + change_brightness "-$step" ;; *) get_brightness -- cgit v1.2.3 From d36df085bf093ce6f8092eeb6e6878d9ad2791d0 Mon Sep 17 00:00:00 2001 From: JaKooLit Date: Thu, 17 Jul 2025 00:58:43 +0900 Subject: integrated wallust colors into simple_sddm_2 SDDM theme --- config/hypr/UserScripts/WallpaperEffects.sh | 8 ++--- config/hypr/UserScripts/WallpaperSelect.sh | 10 +++--- config/hypr/scripts/sddm_wallpaper.sh | 56 +++++++++++++++++++++++++++++ 3 files changed, 63 insertions(+), 11 deletions(-) create mode 100755 config/hypr/scripts/sddm_wallpaper.sh (limited to 'config/hypr/scripts') diff --git a/config/hypr/UserScripts/WallpaperEffects.sh b/config/hypr/UserScripts/WallpaperEffects.sh index 3717543c..2ba58d0c 100755 --- a/config/hypr/UserScripts/WallpaperEffects.sh +++ b/config/hypr/UserScripts/WallpaperEffects.sh @@ -131,10 +131,8 @@ if [[ -n "$choice" ]]; then exit 1 fi - # Open terminal and set the wallpaper - $terminal -e bash -c "echo 'Enter your password to set wallpaper as SDDM Background'; \ - sudo cp -r $wallpaper_output '$sddm_simple/Backgrounds/default' && \ - notify-send -i '$iDIR/ja.png' 'SDDM' 'Background SET'" + exec $SCRIPTSDIR/sddm_wallpaper.sh --effects + fi fi -fi +fi \ No newline at end of file diff --git a/config/hypr/UserScripts/WallpaperSelect.sh b/config/hypr/UserScripts/WallpaperSelect.sh index 47a8f2cd..a6e6c4d4 100755 --- a/config/hypr/UserScripts/WallpaperSelect.sh +++ b/config/hypr/UserScripts/WallpaperSelect.sh @@ -123,11 +123,9 @@ set_sddm_wallpaper() { notify-send -i "$iDIR/error.png" "Missing $terminal" "Install $terminal to enable setting of wallpaper background" exit 1 fi - - # Open terminal to enter password - $terminal -e bash -c "echo 'Enter your password to set wallpaper as SDDM Background'; \ - sudo cp -r $wallpaper_current '$sddm_simple/Backgrounds/default' && \ - notify-send -i '$iDIR/ja.png' 'SDDM' 'Background SET'" + + exec $SCRIPTSDIR/sddm_wallpaper.sh --normal + fi fi } @@ -235,4 +233,4 @@ if pidof rofi >/dev/null; then pkill rofi fi -main +main \ No newline at end of file diff --git a/config/hypr/scripts/sddm_wallpaper.sh b/config/hypr/scripts/sddm_wallpaper.sh new file mode 100755 index 00000000..fd385fcd --- /dev/null +++ b/config/hypr/scripts/sddm_wallpaper.sh @@ -0,0 +1,56 @@ +#!/bin/bash +# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ +# SDDM Wallpaper and Wallust Colors Setter + +# variables +terminal=kitty +wallDIR="$HOME/Pictures/wallpapers" +SCRIPTSDIR="$HOME/.config/hypr/scripts" +wallpaper_current="$HOME/.config/hypr/wallpaper_effects/.wallpaper_current" +wallpaper_modified="$HOME/.config/hypr/wallpaper_effects/.wallpaper_modified" +sddm_simple="/usr/share/sddm/themes/simple_sddm_2" + +# rofi-wallust-sddm colors path +rofi_wallust="$HOME/.config/rofi/wallust/colors-rofi.rasi" +sddm_theme_conf="$sddm_simple/theme.conf" + +# Directory for swaync +iDIR="$HOME/.config/swaync/images" +iDIRi="$HOME/.config/swaync/icons" + +# Parse arguments +mode="effects" # default +if [[ "$1" == "--normal" ]]; then + mode="normal" +elif [[ "$1" == "--effects" ]]; then + mode="effects" +fi + +# Extract colors from rofi wallust config +main_color=$(grep -oP 'color13:\s*\K#[A-Fa-f0-9]+' "$rofi_wallust") +accent_color=$(grep -oP 'color12:\s*\K#[A-Fa-f0-9]+' "$rofi_wallust") +bg_color=$(grep -oP 'color0:\s*\K#[A-Fa-f0-9]+' "$rofi_wallust") +placeholder_color="$accent_color" +icon_color=$(grep -oP 'foreground:\s*\K#[A-Fa-f0-9]+' "$rofi_wallust") + +# wallpaper to use +if [[ "$mode" == "normal" ]]; then + wallpaper_path="$wallpaper_current" +else + wallpaper_path="$wallpaper_modified" +fi + +# Launch terminal and apply changes +$terminal -e bash -c " +echo 'Enter your password to update SDDM wallpapers and colors'; +sudo sed -i \"s/MainColor=\\\"#.*\\\"/MainColor=\\\"$main_color\\\"/\" \"$sddm_theme_conf\" +sudo sed -i \"s/AccentColor=\\\"#.*\\\"/AccentColor=\\\"$accent_color\\\"/\" \"$sddm_theme_conf\" +sudo sed -i \"s/BackgroundColor=\\\"#.*\\\"/BackgroundColor=\\\"$bg_color\\\"/\" \"$sddm_theme_conf\" +sudo sed -i \"s/placeholderColor=\\\"#.*\\\"/placeholderColor=\\\"$placeholder_color\\\"/\" \"$sddm_theme_conf\" +sudo sed -i \"s/IconColor=\\\"#.*\\\"/IconColor=\\\"$icon_color\\\"/\" \"$sddm_theme_conf\" + +# Copy wallpaper +sudo cp \"$wallpaper_path\" \"$sddm_simple/Backgrounds/default\" + +notify-send -i \"$iDIR/ja.png\" \"SDDM\" \"Background SET\" +" -- cgit v1.2.3 From 090139faea37a45bca4c9ad27661284410f12bef Mon Sep 17 00:00:00 2001 From: Lars Müller Date: Sat, 19 Jul 2025 14:46:56 +0200 Subject: add: message to rofi theme selector --- config/hypr/scripts/RofiThemeSelector.sh | 2 +- config/rofi/config-rofi-theme.rasi | 25 +++++++++++++++++++++++-- 2 files changed, 24 insertions(+), 3 deletions(-) (limited to 'config/hypr/scripts') diff --git a/config/hypr/scripts/RofiThemeSelector.sh b/config/hypr/scripts/RofiThemeSelector.sh index 8423b2fe..569b5739 100755 --- a/config/hypr/scripts/RofiThemeSelector.sh +++ b/config/hypr/scripts/RofiThemeSelector.sh @@ -125,7 +125,7 @@ while true; do rofi -dmenu -i \ -format 'i' \ -p "Rofi Theme" \ - -mesg "Preview: $(basename "$theme_to_preview_now" .rasi) | Enter: Preview | Ctrl+S: Apply & Exit | Esc: Cancel" \ + -mesg "Enter: Preview | Ctrl+S: Apply & Exit | Esc: Cancel" \ -config "$ROFI_THEME_FOR_THIS_SCRIPT" \ -selected-row "$current_selection_index" \ -kb-custom-1 "Control+s") diff --git a/config/rofi/config-rofi-theme.rasi b/config/rofi/config-rofi-theme.rasi index 652cd94c..0d77f857 100644 --- a/config/rofi/config-rofi-theme.rasi +++ b/config/rofi/config-rofi-theme.rasi @@ -11,8 +11,17 @@ window { /* ---- Mainbox ---- */ mainbox { - children: - [ "inputbar", "listview"]; + children: [ "inputbar", "message", "listview" ]; +} + +/* ---- Custombox ---- */ +/* Override custombox to ensure listview is visible for themes that use it */ +custombox { + spacing: 0px; + background-color: inherit; + text-color: inherit; + orientation: vertical; + children: [ "listview" ]; } /* ---- Entry input ---- */ @@ -42,3 +51,15 @@ element-text { margin: 0px; padding: 0px; } + +/* ---- Message ---- */ +message { + padding: 10px; + border-radius: 10px; + background-color: inherit; +} + +textbox { + text-color: inherit; + background-color: inherit; +} -- cgit v1.2.3 From 0d09e35428e645c4d28fe1ffc6acfa5c17c7965d Mon Sep 17 00:00:00 2001 From: "Ja.KooLit" <85185940+JaKooLit@users.noreply.github.com> Date: Sun, 20 Jul 2025 09:55:26 +0900 Subject: Update RofiThemeSelector.sh --- config/hypr/scripts/RofiThemeSelector.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'config/hypr/scripts') diff --git a/config/hypr/scripts/RofiThemeSelector.sh b/config/hypr/scripts/RofiThemeSelector.sh index 569b5739..4c9d0e8f 100755 --- a/config/hypr/scripts/RofiThemeSelector.sh +++ b/config/hypr/scripts/RofiThemeSelector.sh @@ -125,7 +125,7 @@ while true; do rofi -dmenu -i \ -format 'i' \ -p "Rofi Theme" \ - -mesg "Enter: Preview | Ctrl+S: Apply & Exit | Esc: Cancel" \ + -mesg "‼️ **note** ‼️ Enter: Preview | Ctrl+S: Apply & Exit | Esc: Cancel" \ -config "$ROFI_THEME_FOR_THIS_SCRIPT" \ -selected-row "$current_selection_index" \ -kb-custom-1 "Control+s") -- cgit v1.2.3 From a3adc26702e4e0339f6a68c0465f38e2cddd9554 Mon Sep 17 00:00:00 2001 From: "Ja.KooLit" <85185940+JaKooLit@users.noreply.github.com> Date: Sun, 20 Jul 2025 09:58:35 +0900 Subject: Update RofiThemeSelector.sh updated to sort numerically and also added exclamation on message for better visibility --- config/hypr/scripts/RofiThemeSelector.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'config/hypr/scripts') diff --git a/config/hypr/scripts/RofiThemeSelector.sh b/config/hypr/scripts/RofiThemeSelector.sh index 4c9d0e8f..8b2fcb71 100755 --- a/config/hypr/scripts/RofiThemeSelector.sh +++ b/config/hypr/scripts/RofiThemeSelector.sh @@ -82,7 +82,7 @@ original_rofi_config_content_backup=$(cat "$ROFI_CONFIG_FILE") mapfile -t available_theme_names < <(( find "$ROFI_THEMES_DIR_CONFIG" -maxdepth 1 -name "*.rasi" -type f -printf "%f\n" 2>/dev/null find "$ROFI_THEMES_DIR_LOCAL" -maxdepth 1 -name "*.rasi" -type f -printf "%f\n" 2>/dev/null -) | sort -u) +) | sort -V -u) if [ ${#available_theme_names[@]} -eq 0 ]; then notify_user "$IDIR/error.png" "No Rofi Themes" "No .rasi files found in theme directories." @@ -125,7 +125,7 @@ while true; do rofi -dmenu -i \ -format 'i' \ -p "Rofi Theme" \ - -mesg "‼️ **note** ‼️ Enter: Preview | Ctrl+S: Apply & Exit | Esc: Cancel" \ + -mesg "‼️ **note** ‼️ Enter: Preview || Ctrl+S: Apply & Exit || Esc: Cancel" \ -config "$ROFI_THEME_FOR_THIS_SCRIPT" \ -selected-row "$current_selection_index" \ -kb-custom-1 "Control+s") -- cgit v1.2.3 From ed1fe4992d44b05767a65731837d8cfa37f59230 Mon Sep 17 00:00:00 2001 From: JaKooLit Date: Mon, 21 Jul 2025 17:26:37 +0900 Subject: uploaded new script for the new sddm theme --- config/hypr/scripts/sddm_wallpaper-v2.sh | 82 ++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 config/hypr/scripts/sddm_wallpaper-v2.sh (limited to 'config/hypr/scripts') diff --git a/config/hypr/scripts/sddm_wallpaper-v2.sh b/config/hypr/scripts/sddm_wallpaper-v2.sh new file mode 100644 index 00000000..898053c7 --- /dev/null +++ b/config/hypr/scripts/sddm_wallpaper-v2.sh @@ -0,0 +1,82 @@ +#!/bin/bash +# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ +# SDDM Wallpaper and Wallust Colors Setter + +# for the upcoming changes on the simple_sddm_theme + +# variables +terminal=kitty +wallDIR="$HOME/Pictures/wallpapers" +SCRIPTSDIR="$HOME/.config/hypr/scripts" +wallpaper_current="$HOME/.config/hypr/wallpaper_effects/.wallpaper_current" +wallpaper_modified="$HOME/.config/hypr/wallpaper_effects/.wallpaper_modified" +sddm_simple="/usr/share/sddm/themes/simple_sddm_2" + +# rofi-wallust-sddm colors path +rofi_wallust="$HOME/.config/rofi/wallust/colors-rofi.rasi" +sddm_theme_conf="$sddm_simple/theme.conf" + +# Directory for swaync +iDIR="$HOME/.config/swaync/images" +iDIRi="$HOME/.config/swaync/icons" + +# Parse arguments +mode="effects" # default +if [[ "$1" == "--normal" ]]; then + mode="normal" +elif [[ "$1" == "--effects" ]]; then + mode="effects" +fi + + + +# Extract colors from rofi wallust config +get_color() { + grep -oP "$1:\s*\K#[A-Fa-f0-9]+" "$rofi_wallust" +} + +color11=$(get_color 'color11') +HeaderTextColor=$(get_color 'color12') +DateTextColor=$(get_color 'color13') +bg_color=$(get_color 'color0') +placeholder_color="$accent_color" +icon_color=$(get_color 'foreground') +color11=$(get_color 'color11') + +# Define an array of key-value pairs for SDDM config updates +declare -A color_updates=( + [HeaderTextColor]="$HeaderTextColor" + [DateTextColor]="$DateTextColor" + [TimeTextColor]="$DateTextColor" + [SystemButtonsIconsColor]="$DateTextColor" + [SessionButtonTextColor]="$DateTextColor" + [VirtualKeyboardButtonTextColor]="$DateTextColor" + [BackgroundColor]="$bg_color" + [PlaceholderTextColor]="$placeholder_color" + [IconColor]="$icon_color" + [DropdownBackgroundColor]="$bg_color" + [HighlightBackgroundColor]="$color11" +) + +# Apply changes via terminal and sudo +$terminal -e bash -c " +echo 'Enter your password to update SDDM wallpapers and colors'; +$(for key in "${!color_updates[@]}"; do + value="${color_updates[$key]}" + echo "sudo sed -i \"s/${key}=\\\"#.*\\\"/${key}=\\\"$value\\\"/\" \"$sddm_theme_conf\"" +done) +" + +# Set wallpaper path based on mode +wallpaper_path=$([[ "$mode" == "normal" ]] && echo "$wallpaper_current" || echo "$wallpaper_modified") + +# Copy wallpaper safely +if [[ -f "$wallpaper_path" ]]; then + sudo cp "$wallpaper_path" "$sddm_simple/Backgrounds/default" + notify-send -i "$iDIR/ja.png" "SDDM" "Background SET" +else + notify-send -i "$iDIR/ja.png" "SDDM" "Wallpaper not found: $wallpaper_path" + echo "Error: Wallpaper file not found: $wallpaper_path" + exit 1 +fi + -- cgit v1.2.3 From 54af0ed84c6efcf61f088ab1af1188842aa4ed0d Mon Sep 17 00:00:00 2001 From: JaKooLit Date: Tue, 22 Jul 2025 00:13:48 +0900 Subject: updated copy.sh to work with simple_sddm_2 and updated wallpaper_sddm script --- config/hypr/scripts/sddm_wallpaper-v2.sh | 82 +++++++++++++++----------------- copy.sh | 2 +- 2 files changed, 39 insertions(+), 45 deletions(-) (limited to 'config/hypr/scripts') diff --git a/config/hypr/scripts/sddm_wallpaper-v2.sh b/config/hypr/scripts/sddm_wallpaper-v2.sh index 898053c7..19fe7158 100644 --- a/config/hypr/scripts/sddm_wallpaper-v2.sh +++ b/config/hypr/scripts/sddm_wallpaper-v2.sh @@ -28,55 +28,49 @@ elif [[ "$1" == "--effects" ]]; then mode="effects" fi - - # Extract colors from rofi wallust config -get_color() { - grep -oP "$1:\s*\K#[A-Fa-f0-9]+" "$rofi_wallust" -} - -color11=$(get_color 'color11') -HeaderTextColor=$(get_color 'color12') -DateTextColor=$(get_color 'color13') -bg_color=$(get_color 'color0') -placeholder_color="$accent_color" -icon_color=$(get_color 'foreground') -color11=$(get_color 'color11') +color14=$(grep -oP 'color14:\s*\K#[A-Fa-f0-9]+' "$rofi_wallust") +color13=$(grep -oP 'color13:\s*\K#[A-Fa-f0-9]+' "$rofi_wallust") +color12=$(grep -oP 'color12:\s*\K#[A-Fa-f0-9]+' "$rofi_wallust") +color1=$(grep -oP 'color1:\s*\K#[A-Fa-f0-9]+' "$rofi_wallust") +color0=$(grep -oP 'color0:\s*\K#[A-Fa-f0-9]+' "$rofi_wallust") +color10=$(grep -oP 'color10:\s*\K#[A-Fa-f0-9]+' "$rofi_wallust") +foreground=$(grep -oP 'foreground:\s*\K#[A-Fa-f0-9]+' "$rofi_wallust") +#background-color=$(grep -oP 'background:\s*\K#[A-Fa-f0-9]+' "$rofi_wallust") -# Define an array of key-value pairs for SDDM config updates -declare -A color_updates=( - [HeaderTextColor]="$HeaderTextColor" - [DateTextColor]="$DateTextColor" - [TimeTextColor]="$DateTextColor" - [SystemButtonsIconsColor]="$DateTextColor" - [SessionButtonTextColor]="$DateTextColor" - [VirtualKeyboardButtonTextColor]="$DateTextColor" - [BackgroundColor]="$bg_color" - [PlaceholderTextColor]="$placeholder_color" - [IconColor]="$icon_color" - [DropdownBackgroundColor]="$bg_color" - [HighlightBackgroundColor]="$color11" -) +# wallpaper to use +if [[ "$mode" == "normal" ]]; then + wallpaper_path="$wallpaper_current" +else + wallpaper_path="$wallpaper_modified" +fi -# Apply changes via terminal and sudo +# Launch terminal and apply changes $terminal -e bash -c " echo 'Enter your password to update SDDM wallpapers and colors'; -$(for key in "${!color_updates[@]}"; do - value="${color_updates[$key]}" - echo "sudo sed -i \"s/${key}=\\\"#.*\\\"/${key}=\\\"$value\\\"/\" \"$sddm_theme_conf\"" -done) -" -# Set wallpaper path based on mode -wallpaper_path=$([[ "$mode" == "normal" ]] && echo "$wallpaper_current" || echo "$wallpaper_modified") +# Update the colors in the SDDM config +sudo sed -i \"s/HeaderTextColor=\\\"#.*\\\"/HeaderTextColor=\\\"$color13\\\"/\" \"$sddm_theme_conf\" +sudo sed -i \"s/DateTextColor=\\\"#.*\\\"/DateTextColor=\\\"$color13\\\"/\" \"$sddm_theme_conf\" +sudo sed -i \"s/TimeTextColor=\\\"#.*\\\"/TimeTextColor=\\\"$color13\\\"/\" \"$sddm_theme_conf\" +sudo sed -i \"s/DropdownSelectedBackgroundColor=\\\"#.*\\\"/DropdownSelectedBackgroundColor=\\\"$color13\\\"/\" \"$sddm_theme_conf\" -# Copy wallpaper safely -if [[ -f "$wallpaper_path" ]]; then - sudo cp "$wallpaper_path" "$sddm_simple/Backgrounds/default" - notify-send -i "$iDIR/ja.png" "SDDM" "Background SET" -else - notify-send -i "$iDIR/ja.png" "SDDM" "Wallpaper not found: $wallpaper_path" - echo "Error: Wallpaper file not found: $wallpaper_path" - exit 1 -fi +sudo sed -i \"s/SystemButtonsIconsColor=\\\"#.*\\\"/SystemButtonsIconsColor=\\\"$color12\\\"/\" \"$sddm_theme_conf\" +sudo sed -i \"s/SessionButtonTextColor=\\\"#.*\\\"/SessionButtonTextColor=\\\"$color12\\\"/\" \"$sddm_theme_conf\" +sudo sed -i \"s/VirtualKeyboardButtonTextColor=\\\"#.*\\\"/VirtualKeyboardButtonTextColor=\\\"$color12\\\"/\" \"$sddm_theme_conf\" +sudo sed -i \"s/HighlightBackgroundColor=\\\"#.*\\\"/HighlightBackgroundColor=\\\"$color12\\\"/\" \"$sddm_theme_conf\" +sudo sed -i \"s/LoginFieldTextColor=\\\"#.*\\\"/LoginFieldTextColor=\\\"$color12\\\"/\" \"$sddm_theme_conf\" +sudo sed -i \"s/PasswordFieldTextColor=\\\"#.*\\\"/PasswordFieldTextColor=\\\"$color12\\\"/\" \"$sddm_theme_conf\" + +sudo sed -i \"s/DropdownBackgroundColor=\\\"#.*\\\"/DropdownBackgroundColor=\\\"$color0\\\"/\" \"$sddm_theme_conf\" +sudo sed -i \"s/HighlightTextColor=\\\"#.*\\\"/HighlightTextColor=\\\"$color10\\\"/\" \"$sddm_theme_conf\" + +sudo sed -i \"s/PlaceholderTextColor=\\\"#.*\\\"/PlaceholderTextColor=\\\"$color14\\\"/\" \"$sddm_theme_conf\" +sudo sed -i \"s/UserIconColor=\\\"#.*\\\"/UserIconColor=\\\"$color14\\\"/\" \"$sddm_theme_conf\" +sudo sed -i \"s/PasswordIconColor=\\\"#.*\\\"/PasswordIconColor=\\\"$color14\\\"/\" \"$sddm_theme_conf\" + +# Copy wallpaper to SDDM theme +sudo cp \"$wallpaper_path\" \"$sddm_simple/Backgrounds/default\" +notify-send -i \"$iDIR/ja.png\" \"SDDM\" \"Background SET\" +" \ No newline at end of file diff --git a/copy.sh b/copy.sh index 3677c86e..b3e001bd 100755 --- a/copy.sh +++ b/copy.sh @@ -406,7 +406,7 @@ while true; do # Applying to different SDDM themes apply_sddm_12h_format "/usr/share/sddm/themes/simple-sddm" - apply_sddm_12h_format "/usr/share/sddm/themes/simple-sddm-2" + apply_sddm_12h_format "/usr/share/sddm/themes/simple_sddm_2" # For SDDM (sequoia_2) sddm_directory_3="/usr/share/sddm/themes/sequoia_2" -- cgit v1.2.3 From 894c6900c1e1c312b5097f35c15b59a407a991a9 Mon Sep 17 00:00:00 2001 From: JaKooLit Date: Tue, 22 Jul 2025 12:55:13 +0900 Subject: updated sddm-wallpaper script --- config/hypr/scripts/sddm_wallpaper-v2.sh | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'config/hypr/scripts') diff --git a/config/hypr/scripts/sddm_wallpaper-v2.sh b/config/hypr/scripts/sddm_wallpaper-v2.sh index 19fe7158..a781156e 100644 --- a/config/hypr/scripts/sddm_wallpaper-v2.sh +++ b/config/hypr/scripts/sddm_wallpaper-v2.sh @@ -29,12 +29,13 @@ elif [[ "$1" == "--effects" ]]; then fi # Extract colors from rofi wallust config -color14=$(grep -oP 'color14:\s*\K#[A-Fa-f0-9]+' "$rofi_wallust") -color13=$(grep -oP 'color13:\s*\K#[A-Fa-f0-9]+' "$rofi_wallust") -color12=$(grep -oP 'color12:\s*\K#[A-Fa-f0-9]+' "$rofi_wallust") -color1=$(grep -oP 'color1:\s*\K#[A-Fa-f0-9]+' "$rofi_wallust") -color0=$(grep -oP 'color0:\s*\K#[A-Fa-f0-9]+' "$rofi_wallust") + +color0=$(grep -oP 'color1:\s*\K#[A-Fa-f0-9]+' "$rofi_wallust") +color1=$(grep -oP 'color0:\s*\K#[A-Fa-f0-9]+' "$rofi_wallust") +color7=$(grep -oP 'color14:\s*\K#[A-Fa-f0-9]+' "$rofi_wallust") color10=$(grep -oP 'color10:\s*\K#[A-Fa-f0-9]+' "$rofi_wallust") +color12=$(grep -oP 'color12:\s*\K#[A-Fa-f0-9]+' "$rofi_wallust") +color13=$(grep -oP 'color13:\s*\K#[A-Fa-f0-9]+' "$rofi_wallust") foreground=$(grep -oP 'foreground:\s*\K#[A-Fa-f0-9]+' "$rofi_wallust") #background-color=$(grep -oP 'background:\s*\K#[A-Fa-f0-9]+' "$rofi_wallust") @@ -54,20 +55,19 @@ sudo sed -i \"s/HeaderTextColor=\\\"#.*\\\"/HeaderTextColor=\\\"$color13\\\"/\" sudo sed -i \"s/DateTextColor=\\\"#.*\\\"/DateTextColor=\\\"$color13\\\"/\" \"$sddm_theme_conf\" sudo sed -i \"s/TimeTextColor=\\\"#.*\\\"/TimeTextColor=\\\"$color13\\\"/\" \"$sddm_theme_conf\" sudo sed -i \"s/DropdownSelectedBackgroundColor=\\\"#.*\\\"/DropdownSelectedBackgroundColor=\\\"$color13\\\"/\" \"$sddm_theme_conf\" - -sudo sed -i \"s/SystemButtonsIconsColor=\\\"#.*\\\"/SystemButtonsIconsColor=\\\"$color12\\\"/\" \"$sddm_theme_conf\" -sudo sed -i \"s/SessionButtonTextColor=\\\"#.*\\\"/SessionButtonTextColor=\\\"$color12\\\"/\" \"$sddm_theme_conf\" -sudo sed -i \"s/VirtualKeyboardButtonTextColor=\\\"#.*\\\"/VirtualKeyboardButtonTextColor=\\\"$color12\\\"/\" \"$sddm_theme_conf\" +sudo sed -i \"s/SystemButtonsIconsColor=\\\"#.*\\\"/SystemButtonsIconsColor=\\\"$color13\\\"/\" \"$sddm_theme_conf\" +sudo sed -i \"s/SessionButtonTextColor=\\\"#.*\\\"/SessionButtonTextColor=\\\"$color13\\\"/\" \"$sddm_theme_conf\" +sudo sed -i \"s/VirtualKeyboardButtonTextColor=\\\"#.*\\\"/VirtualKeyboardButtonTextColor=\\\"$color13\\\"/\" \"$sddm_theme_conf\" sudo sed -i \"s/HighlightBackgroundColor=\\\"#.*\\\"/HighlightBackgroundColor=\\\"$color12\\\"/\" \"$sddm_theme_conf\" sudo sed -i \"s/LoginFieldTextColor=\\\"#.*\\\"/LoginFieldTextColor=\\\"$color12\\\"/\" \"$sddm_theme_conf\" sudo sed -i \"s/PasswordFieldTextColor=\\\"#.*\\\"/PasswordFieldTextColor=\\\"$color12\\\"/\" \"$sddm_theme_conf\" -sudo sed -i \"s/DropdownBackgroundColor=\\\"#.*\\\"/DropdownBackgroundColor=\\\"$color0\\\"/\" \"$sddm_theme_conf\" +sudo sed -i \"s/DropdownBackgroundColor=\\\"#.*\\\"/DropdownBackgroundColor=\\\"$color1\\\"/\" \"$sddm_theme_conf\" sudo sed -i \"s/HighlightTextColor=\\\"#.*\\\"/HighlightTextColor=\\\"$color10\\\"/\" \"$sddm_theme_conf\" -sudo sed -i \"s/PlaceholderTextColor=\\\"#.*\\\"/PlaceholderTextColor=\\\"$color14\\\"/\" \"$sddm_theme_conf\" -sudo sed -i \"s/UserIconColor=\\\"#.*\\\"/UserIconColor=\\\"$color14\\\"/\" \"$sddm_theme_conf\" -sudo sed -i \"s/PasswordIconColor=\\\"#.*\\\"/PasswordIconColor=\\\"$color14\\\"/\" \"$sddm_theme_conf\" +sudo sed -i \"s/PlaceholderTextColor=\\\"#.*\\\"/PlaceholderTextColor=\\\"$color7\\\"/\" \"$sddm_theme_conf\" +sudo sed -i \"s/UserIconColor=\\\"#.*\\\"/UserIconColor=\\\"$color7\\\"/\" \"$sddm_theme_conf\" +sudo sed -i \"s/PasswordIconColor=\\\"#.*\\\"/PasswordIconColor=\\\"$color7\\\"/\" \"$sddm_theme_conf\" # Copy wallpaper to SDDM theme sudo cp \"$wallpaper_path\" \"$sddm_simple/Backgrounds/default\" -- cgit v1.2.3 From 7ed2aa6c81627626339c48a37be2249ce4ff54bf Mon Sep 17 00:00:00 2001 From: jteijema Date: Fri, 25 Jul 2025 13:12:24 +0200 Subject: fix: resolve emoji removal --- config/hypr/scripts/WaybarLayout.sh | 5 +++-- config/hypr/scripts/WaybarStyles.sh | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'config/hypr/scripts') diff --git a/config/hypr/scripts/WaybarLayout.sh b/config/hypr/scripts/WaybarLayout.sh index 955432fc..b4d9c493 100755 --- a/config/hypr/scripts/WaybarLayout.sh +++ b/config/hypr/scripts/WaybarLayout.sh @@ -29,9 +29,10 @@ main() { # Mark and locate the active layout default_row=0 + MARKER="👉" for i in "${!options[@]}"; do if [[ "${options[i]}" == "$current_name" ]]; then - options[i]="👉 ${options[i]}" + options[i]="$MARKER ${options[i]}" default_row=$i break fi @@ -49,7 +50,7 @@ main() { [[ -z "$choice" ]] && { echo "No option selected. Exiting."; exit 0; } # Strip marker before applying - choice=${choice% ⮕} + choice=${choice# $MARKER} case "$choice" in "no panel") diff --git a/config/hypr/scripts/WaybarStyles.sh b/config/hypr/scripts/WaybarStyles.sh index 20f0873b..a439f8eb 100755 --- a/config/hypr/scripts/WaybarStyles.sh +++ b/config/hypr/scripts/WaybarStyles.sh @@ -31,9 +31,10 @@ main() { # mark the active style and record its index default_row=0 + MARKER="👉" for i in "${!options[@]}"; do if [[ "${options[i]}" == "$current_name" ]]; then - options[i]="👉 ${options[i]}" + options[i]="$MARKER ${options[i]}" default_row=$i break fi @@ -50,7 +51,7 @@ main() { [[ -z "$choice" ]] && { echo "No option selected. Exiting."; exit 0; } # remove annotation and apply - choice=${choice% ⮕} + choice=${choice# $MARKER} apply_style "$choice" } -- cgit v1.2.3