Replies: 4 comments 3 replies
-
|
try a shell script mentioned in the wiki |
Beta Was this translation helpful? Give feedback.
-
|
I'm also interested by this feature, but for Wofi. Did you find a solution? For now, it can't be done by Wofi itself : https://todo.sr.ht/~scoopta/wofi/198 By the way @Prayag2, what tool do you use to create your far right menu on your screenrec? |
Beta Was this translation helpful? Give feedback.
-
|
This is the top results when searching how to close rofi when unfocused, especially so for wayland, so I thought I'd share my solution. I'm on plasma wayland, using lbonn/rofi. The params like tl;dr: check active window with This is for nushell, but it should be easily convertible to any other. def rofi [] {
let ok_str = "OK-for-nushell"
mut seen_rofi = false;
mut timeout = 0;
let cmd = $"rofi -show run -on-entry-accepted \"echo \'($ok_str)\'\"";
# nushell cannot queue task in the background, so we use `pueue` for that
# you can use & in bash or what not
let id = pueue add --immediate $cmd | parse 'New task added (id {id}).'| get id.0;
loop {
let curr = kdotool getactivewindow | kdotool getwindowclassname $
# need this because until rofi actually launches,
# our current window will be whatever we were on before for
if $curr == "rofi" { $seen_rofi = true; }
if $seen_rofi and $curr != "rofi" {
let no_selection = pueue log --json $id
| from json
| get $"($id)"
| get output
| find $ok_str
| is-empty
if $no_selection {
pueue kill $id;
}
break;
}
sleep 25ms
$timeout += 25;
if $seen_rofi == false and $timeout > 250 { break; }
}
} |
Beta Was this translation helpful? Give feedback.
-
|
I made these scripts to solve this issue after finding this page and not being able to get it to work. This script works perfectly on hyprland. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm using rofi (xwayland) on my hyprland setup as most plugins that work on rofi don't actually work that well on wofi and other wayland alternatives (I have also tried rofi-wayland but it has major bugs right now). I want it to close when it's out of focus. For example, see this video-
video.mp4
In this video, you can see that upon clicking elsewhere, rofi doesn't close. I want it to close when it's out of focus. I also want the same for a few other apps.
Beta Was this translation helpful? Give feedback.
All reactions