toggle window fix monitor #435
Answered
by
kotontrion
The-Lost-Light
asked this question in
Q&A
-
I want fix the window at the same monitor when its visible const hyprland = await Service.import("hyprland");
import Logout from "./modules/logout";
import Poweroff from "./modules/poweroff";
import Reboot from "./modules/reboot";
import Sleep from "./modules/sleep";
let visible = Variable(false);
let x = Utils.merge(
[visible.bind(), hyprland.active.monitor.bind("id")],
(v, id) => {
print(v);
return id;
},
);
export default () =>
Widget.Window({
name: "power_menu",
class_name: "power_menu",
visible: visible.bind(),
anchor: ["right"],
monitor: x,
child: Widget.Box({
vertical: true,
children: [Logout(), Poweroff(), Reboot(), Sleep()],
}),
}); and why the print is always display false Ps: Is there method i click other application except ags window then hide the ags window |
Beta Was this translation helpful? Give feedback.
Answered by
kotontrion
Jun 3, 2024
Replies: 1 comment 5 replies
-
|
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If you want to the window to open at the currently focused monitor and stay there until it is closed, you should not specify the monitor property at all. So it will switch monitors only when the window is opened.