lbonn / rofi

Rofi: A window switcher, run dialog and dmenu replacement - fork with wayland support
Other
943 stars 37 forks source link

docs: provide sample script and docs for window switching in Sway. #5

Closed markstos closed 2 years ago

markstos commented 4 years ago

I might have spoken too soon. When I run rofi from a terminal, the script and syntax presented here work. But If I run it via bindsym in my Sway config file, the results for the other modes appear, but I get no "window" results. Strange! I haven't figured out why I'm getting this behavior yet. Here's my Sway config file syntax.

bindsym Mod4+d exec rofi -combi-modi "sway:~/.config/rofi/sway_window_switch.sh#drun#ssh" -font 'hack 14' -show combi
markstos commented 4 years ago

My personal issue was that I installed jq from a snap, which placed the binary in /snap/bin. When I ran the command from my shell, this directory was in my $PATH, so the command succeed. However, this directory is not part of the executable path used by the sh shell in a Sway exec command. I resolved the issue for myself by using the full path jq in my script, but this shouldn't be an issue for other people have jq in a standard directory.

lbonn commented 4 years ago

You're right I should have given more details. I also started with some jq script but was disappointed with the speed (it shelled-out a lot of programs), so in the end I extended a small program I wrote in rust: https://github.com/lbonn/i3-focus-last/tree/menu-plus

It has a daemon to track windows in order of focus: i3-focus-last server. Then you can just spawn a menu with i3-focus-last menu.

markstos commented 4 years ago

@lbonn Your i3-focus-last in Rust looks great. I'd love to see the README updated to document the 3 modes with example syntax. As a new i3/sway user the note that it's re-implementation of a classic tool doesn't help me. I've bookmarked it to try later and may submit a doc-patch if I end up using it.

lbonn commented 4 years ago

Sorry, some things are still in flux.

It's not documented yet and lives in a separate branch because I was waiting for some features to be merged in the i3ipc-rs crate it depends on. However, this project seems inactive now, so I might switch to using swayipc-rs...

markstos commented 4 years ago

I keep finding new projects written in Rust. Now I'm looking forward to contributing to a Rust project myself some day.

lbonn commented 4 years ago

It's now merged in the master branch: https://github.com/lbonn/i3-focus-last/tree/master#menu-mode

markstos commented 4 years ago

Thanks!

Will this be packaged for AUR as well?

On Tue, Aug 18, 2020 at 9:44 AM lbonn notifications@github.com wrote:

It's now merged in the master branch: https://github.com/lbonn/i3-focus-last/tree/master#menu-mode

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/lbonn/rofi/pull/5#issuecomment-675486997, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAGJZP66TMYNMG2RWMFSX3SBKATBANCNFSM4PSWSNJQ .

-- Mark Stosberg Director of Systems and Security RideAmigos

lbonn commented 4 years ago

I don't use Arch myself these days so I won't do it but anybody who cares is welcome. It is on crates.io though, you can install it by running cargo install i3-focus-last.

RagnarGrootKoerkamp commented 3 years ago

@markstos FYI: I've created https://aur.archlinux.org/packages/i3-focus-last-git/

lbonn commented 2 years ago

Now addressed in the README