Skip to content

Hdrop feature request: an option to bring a window to the top. #156

@Oneechan69

Description

@Oneechan69

In Hyprland I have all my windows float and absolutely zero tiling. I think hdrop should have an option to bring the most recently focused window of an app to the top, perhaps with alterzorder. Before finding hdrop I wrote a fish script that does basically the same thing, but also includes alterzorder (this is how I use Hyprland without tiling nor pulling my hair out):

#!/usr/bin/env fish
argparse 'c/class=' 'a/appcommand=' -- $argv
set top_window (hyprctl clients -j | \
		jq -r "[.[] | select(.class == \"$_flag_c\")] | sort_by(.focusHistoryID) | .[0].focusHistoryID")
if test $top_window = "null"
	$_flag_a
	hyprctl dispatch alterzorder top,address:$_flag_c
	hyprctl dispatch focuswindow address:$_flag_c
	return
end
if test $top_window = "0"
	set top_window (hyprctl clients -j | jq -r '.[] | select(.focusHistoryID == 1) | .address')
else
	set top_window (hyprctl clients -j | \
			jq -r "[.[] | select(.class == \"$_flag_c\")] | sort_by(.focusHistoryID) | .[0].address")
end

hyprctl dispatch alterzorder top,address:$top_window
hyprctl dispatch focuswindow address:$top_window

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions