Skip to content

Commit

Permalink
Fix window being hidden behind the floating windows (#55)
Browse files Browse the repository at this point in the history
This commit fixes window is hidden behind the floating windows when
reterivied from the scratchpad

Also formatts the code with shfmt
  • Loading branch information
niksingh710 authored Sep 4, 2023
1 parent bef073c commit 74aa6b0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion scratchpad/scratchpad
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ getBack() {
_ifs="$IFS"
IFS=$'\n'$'\n'

if pgrep "${_menu_cmd%% *}" >/dev/null; then exit; fi # Menu running already? → exit
if pgrep "${_menu_cmd%% *}" >/dev/null; then exit; fi # Menu running already? → exit

_current_workspace="$(hyprctl monitors -j | jq '.[] | select(.focused==true)' | jq -j '.activeWorkspace.name')"

Expand Down Expand Up @@ -125,6 +125,10 @@ getBack() {
[ -z "$_selected_client" ] && _selected_client="$(echo "${_clients_on_spad[*]}" | eval "${_menu_cmd[*]}")"
_address="$(echo "$_selected_client" | awk '{print $NF}')"
hyprctl dispatch movetoworkspace "$_current_workspace,address:$_address"
hyprctl dispatch focuswindow "address:$_address"
[ "$(hyprctl activewindow -j | jq '.floating')" = true ] && {
hyprctl dispatch bringactivetotop none
}
IFS="$_ifs"
}

Expand Down

0 comments on commit 74aa6b0

Please sign in to comment.