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
Wayland menu for Sway? #1367
Comments
You could fire up a wayland based terminal with a specified geometry and
placement that is running fzf inside it. Here's an example in a blog post
about it: https://medium.com/njiuko/using-fzf-instead-of-dmenu-2780d184753f
…On Sat, Sep 23, 2017 at 12:38 AM, gnidorah ***@***.***> wrote:
Hi.
Is there any application launcher for Sway that doesn't require xwayland?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#1367>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AADgP3_8jq_dAO1l6WHwGcOPBpAJelhWks5slKdJgaJpZM4PhdpL>
.
--
Bearcat M. Şándor
Feline Soul Systems LLC
Voice: 872.CAT.SOUL (872.228.7685)
Fax: 406.235.7070
|
There's bemenu but it has some issues. |
Thanks. We should wait then. |
@gnidorah see the wayland branch of https://github.com/michaelforney/dmenu |
That is swc-specific, does not work on Sway. |
oh, well shoot |
@bearcatsandor Funny solution, thanks. Would be nice to find .desktop files parser for that to get something similar to i3-dmenu-desktop/j4-dmenu-desktop |
i3-dmenu-desktop works on sway. |
@SirCmpwn That's what I currently use, but It uses dmenu which requires xwayland |
I use |
For what it's worth, i'm no longer having focus issues with rofi after upgrading to 1.4.1. |
still have focus issue with rofi 1.5.1 and sway 0.15 |
@jbg could you explain your solution a bit? |
|
@jbg Thank you. This part is still unclear for me:
How can I change window style in wayland/sway? |
@alexryndin In 1.0 version albert (simmilar to rofi) is alive so maybe so maybe rofi will also work without any problem. |
Yeah I think rofi works fine on sway master. |
@jbg Hi, I am curious about your solution. However, I can not figure out how to launch a terminal window with a specific class in sway. Any help appreciated |
@alexryndin @KubqoA I don't think there is an easy way to change window classes, but you can use specific criteria of that window to customize it. See the Criteria section on sway's man page. I thought the best way would be to mark that terminal window upon launch and then use [con_mark="whatevermark"], but unfortunately that doesn't work since for some reason it is always the previously focussed window that is being marked instead of the new one. I've worked around this by launching the terminal window with a specific title (I guess most terminals support this) and then using that title as a criterion for customization commands. So my full command with gnome-terminal looks like this: |
Classes (and instances) are specific to X11. Wayland has a similar thing called app_id. The good news is on Sway we can see all three of them and apply criteria to all of them too. As for how to set the class, you need to check the man page for the terminal you're running, but it's usually
I don't understand the steps you're doing. How are you marking the window? You shouldn't need to mark the window in this case anyway.
That's not really how it should be done. This is how I'm doing it with termite:
|
I was marking it with
Yes, you're right. I wasn't aware of that, makes much more sense to define the customization outside of the menu command. |
I modified this so it lets you select from the .desktop files at
It works for most apps, but some, like |
I modified this so you can also execute arbitrary commands, like you can with dmenu/rofi:
If fzf finds a match, this will be executed. Else, what you typed will be executed. |
If anyone is interested, I made a script based on this (still uses fzf). |
Bemenu can be used in combination with j4-dmenu-desktop (or maybe even with i3-dmenu-desktop) for getting similar result like with dmenu (-i => ignore case switch is mandatory for bemenu to work like expected) :
|
Indeed there is no any focus issues with rofi on latest sway beta with wlroots. It actually doesn't have anything to do with rofi and still reproduces with latest, not beta sway with wlc. |
Thanks to all of you for your great examples! Just in case anyone's interested, here's my take, based partly on the examples in this thread: I've written a script that launches a terminal in which the fzf-based completion takes place, depending on what mode the script was launched in. In my sway config, I have the following:
I have decided to go that route so that I have the terminal launching and completion in one, reusable place. Best regards! |
Another solution which takes history into account:
#!/bin/bash
HISTFILE="${XDG_CACHE_HOME:-$HOME/.cache}/launch_history"
HISTSIZE=30
touch "$HISTFILE"
compgen -c | sort --unique | awk '
{ if (ARGIND == 1) valid[$1]=1 }
{ sum[$1]+=1 }
END { for (i in sum) { if (valid[i]) print sum[i],i }}' - "$HISTFILE" | \
sort --numeric-sort --reverse --key=1,1 | awk '{ print $2 }' | \
fzf --no-extended --print-query --tiebreak=index | tail --lines=1 | \
xargs -I % sh -c "swaymsg -t command exec % && echo % >> '$HISTFILE'"
echo "$(tail --lines=$HISTSIZE "$HISTFILE")" > "$HISTFILE" |
Thanks @sherter! A few issues I would like to see if you have a solution for... first I really like your idea of using fzf. However, there isn't a shortcut to delete history items like with rofi. Also, if I click off the menu then it doesn't close. I also can't figure out how to get it to work with scripts or arguments. I miss my ssh quick access too. Any thoughts or suggestions for those? I know they most of it can be done with a terminal and fzf. I would also like to integrate something like emoji support too. I was using this before: https://github.com/Mange/rofi-emoji I know that is piling a lot on there. I think your idea of using termite though is great, or something like alacritty, which both look great with transparency. |
Suggestion: write a rofi patch to add Wayland support. |
I'll see what I can do. I would like to contribute more. I am so glad I finally switched, and the nouveau drivers aren't as bad as I thought they'd be. |
Just for those reading that don't want their window in the middle of their screen, and would like it on an edge more similar to dmenu, here's my modification of the
|
Seen out there: https://hg.sr.ht/~scoopta/wofi |
I've been testing out wofi since @blaggacao mentioned it, and can recommend it as as a fast, functional |
https://github.com/Cloudef/bemenu is just as easy:
|
Nice. |
There is now also a dmenu clone for wayland called wmenu Some things are missing, like dmenu_path - but it works well. I use it daily like this:
Contributing works via email, so you mail your commits with I like this a lot, it makes drive-by commits much easier, as you do not need to have forks around as in github. |
Thanks everyone who gave tips on configuring sway above! Here's a configuration for foot:
|
Hi.
Is there any application launcher for Sway that doesn't require xwayland?
The text was updated successfully, but these errors were encountered: