Open TTtrace opened 1 year ago
bind = ALT,Tab,cyclenext prev
And if you happen to have two or more floating windows overlapping, you might also want to add a second bind to the same keys: bind = ALT,Tab,bringactivetotop
bind = ALT,Tab,cyclenext prev
I have tried it. Unfortunately not what I expect.
Let me make it clearer. The Scenario is:
There are three or more windows in the same workspace. I do something in window 1, and move to window 2 for something else. Then if I want to go back to window 1 , I just ALT+Tab. After a while, I can switch back to window 2 using ALT + Tab. This way, ALT + Tab always makes me go back to previous focused window.
But cyclenext, prev
will move like: window 1 -> 2 -> 3 -> 4 -> 1 ...
By the way, if windows in the workspace is in full screen mode, cyclenext, prev
will act as I need, different from normal behavior.
Anyway, thank you for your help!
Ah I see, sorry for the misunderstanding.
I mulled over this for a bit, tried binding hyprctl dispatch cyclenext || hyprctl dispatch cyclenext prev
, like the wofi/rofi bind suggested in the wiki, but seems like it only works for processes that hang on.
Your idea is essentially the workspace previous
dispatcher (with misc:allow_workspace_cycles 1) but for cyclenext
instead, so each window remembers what was focused before, like workspaces remember what was the previous workspace. Would be an interesting feature to have.
I asked the same Q on reddit about master
layout and switching between last focused window. hyprctl
doesn't return enough metadata to script solutions. To get close to this in master
layout, bind focuscurrentorlast
and layoutmsg, swapwithmaster
.
Unfortunately, there isn't enough metadata to determine if the active window is master or a slave in the layout. The solution would be something like
if is_focused_master:
hyprctrl dispatch "focuscurrentorlast"
hyprctl dispatch "layoutmsg swapwithmaster"
else:
hyprctl dispatch "swapwithmaster"
In an ideal world, hyprctl
would provide metadata about the current workspace layout, the order of clients within the layout and a MRU clients stack. Additionally, a dispatcher like swapwindows ADDR1 ADDR2
.
I probably could take a stab at a PR, but it's been ages since I touched C++.
I use these bindings:
bind = ALT,Tab,cyclenext
bind = ALT_SHIFT,Tab,cyclenext,prev
Quite useful ALT+TAB => to go forwards and ALT + SHIFT + TAB => to go backwards Similar experience to what I have with browser tabs(ctrl+tab and ctrl+shift+tab)
any idea on how to expand this in a multimonitor setup?
Hi all. I found this website, when i was searching for the exact same functionallity and bindings: https://lib.rs/crates/window_switcher WindowSwitcher
A small rust CLI tool to switch between windows in hyperland.
It can switch through all windows or only windows of same class(= application) in regular or reverse order. The script accepts 5 parameters:.
--same-class Switch between windows of same class (type)
--reverse Reverse the order of the windows
--stay-workspace Restrict cycling of windows to current workspace
--ignore-workspace Ignore workspaces and sort like one big workspace for each monitor
--ignore-monitor Ignore monitors and sort like one big monitor, workspaces must have offset of 10 for each monitor
--vertical-workspaces will treat workspaces as vertical aligned (used with --ignore-workspace)
I used i3-wm for years, and it has a unique feature: auto_back_and_forth , which is applicable to workspaces. So, what it does is: Say, i'm on ws.2, running a browser. I open a terminal, which opens on ws.1 and autom. switches to ws.1., bringing the terminal on top. Now, when i invoke "Alt-Tab"., it switches back to the previously focused window, across workspaces, so it switches to ws.2 , bringing the browser on top.
When i close the terminal on ws.1 ., the exact same thing happens, and brings me back to ws.2 ., de browser focused.
I'm looking for the same functionallity for Hyprland, and the closest thing/setting i can think of is:
(since we can bind more commands to the same binding...) bind = ALT, Tab, cyclenext # cycle through applications on same workspace bind = ALT, Tab, bringactivetotop # while cycling on same workspace, bring selected to top bind = $mainMod, Tab, focuscurrentorlast # bring back focus to previous focused window across workspaces
It somehow DOES work., allthough it's not really the same.
hyprswitch is the only thing that worked for me:
Discussed in https://github.com/hyprwm/Hyprland/discussions/2037