-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
show all opened windows #4121
Comments
You can probably accomplish this with swaymsg -t get_tree and |
Is my naive bindsym using |
Hi Emantor ! Thanks :-) I have tested it and it shows only the tilled windows and not the floating windows and if im on an oher workspace it doesnt focus to that workspace to that windows ! Sorry i have no idea how to correct this ! Thanks kind regards kristoferus75 |
Hi ! With this script it works now :
kind regards kristoferus75 |
Edit: I realized jq wasn't installed there wasn't any error message. Installing jq fixed it. It now works. |
Tweaked the above code to make it work with floating windows: #!/bin/bash
# Get regular windows
regular_windows=$(swaymsg -t get_tree | jq -r '.nodes[1].nodes[].nodes[] | .. | (.id|tostring) + " " + .name?' | grep -e "[0-9]* ." )
# Get floating windows
floating_windows=$(swaymsg -t get_tree | jq '.nodes[1].nodes[].floating_nodes[] | (.id|tostring) + " " + .name?'| grep -e "[0-9]* ." | tr -d '"')
enter=$'\n'
if [[ $regular_windows && $floating_windows ]]; then
all_windows="$regular_windows$enter$floating_windows"
elif [[ $regular_windows ]]; then
all_windows=$regular_windows
else
all_windows=$floating_windows
fi
# Select window with rofi
selected=$(echo "$all_windows" | rofi -dmenu -i | awk '{print $1}')
# Tell sway to focus said window
swaymsg [con_id="$selected"] focus |
I reimplemented the above snipped in python, removing the need to include the window id for wofi, dropping the jq dependency and improving startup time by ~40% on my laptop, running in power saving mode. See here: https://github.com/tobiaspc/wofi-scripts |
I was looking for something a bit more like this (coming from AwesomeWM): https://github.com/guotsuan/awesome-revelation It show all windows in the same workspace and lets us choose the window with a key and then it switches to the window in its workspace. Is there anything of the sort that exists nowadays? That would be very nice. edit I found this: Which is nice, but not as cool as the awesome-revelation mosaïque I like. I'm linking it for references. |
@sim590 Woa, that's awsome-revelation seems overkill but very nice/handy switcher. But for it to work with sway, client needs to aware of window's location on screen. From So we need to center |
Also looking for something like this. I've been on sway for a little over a year now, and I realized that this is the one thing that I miss. Swayr does provide a sort of solution, but the visual aspect makes it far easier and faster to recognize and switch. |
BTW, rofi has this feature built in: |
Sadly, that doesn't show all windows. On my system, it only shows some windows, like Chrome. It doesn't show apps like Firefox, Emacs, Kitty.
|
Huh sorry man, can't help you there! I tried it with rofi 1.7.5 too, and was fully successful — so it has to be some external factor. Good luck! |
Isn't that related to how rofi sees windows, as in maybe it only sees the wayland native ones, and not the ones running through X? |
Hi !
I use sway 1.0
Is it possible to see all openend windows (for all workspaces) with a shell command to use it in a rofi or dmenu and to switch to this opened windows and to this workspace -> like a window switcher ? (with rofi i use it this on xfce)
thanks
kind regards
kristoferus75
The text was updated successfully, but these errors were encountered: