bar: power button works
Use wlogout for power menu Add more defaults for PopupWindow
This commit is contained in:
parent
c2e03775db
commit
a53389c8b5
3 changed files with 4 additions and 5 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
import { GLib, register, Variable } from "astal";
|
import { execAsync, GLib, register, Variable } from "astal";
|
||||||
import { bind, kebabify } from "astal/binding";
|
import { bind, kebabify } from "astal/binding";
|
||||||
import { App, Astal, astalify, Gdk, Gtk, type ConstructProps } from "astal/gtk3";
|
import { App, Astal, astalify, Gdk, Gtk, type ConstructProps } from "astal/gtk3";
|
||||||
import AstalHyprland from "gi://AstalHyprland";
|
import AstalHyprland from "gi://AstalHyprland";
|
||||||
|
|
@ -251,9 +251,7 @@ const Power = () => (
|
||||||
className="module power"
|
className="module power"
|
||||||
label="power_settings_new"
|
label="power_settings_new"
|
||||||
cursor="pointer"
|
cursor="pointer"
|
||||||
onClicked={() => {
|
onClicked={() => execAsync("fish -c 'pkill wlogout || wlogout -p layer-shell'").catch(console.error)}
|
||||||
// TODO: Power menu
|
|
||||||
}}
|
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -363,7 +363,6 @@ export default class Launcher extends PopupWindow {
|
||||||
super({
|
super({
|
||||||
name: "launcher",
|
name: "launcher",
|
||||||
keymode: Astal.Keymode.EXCLUSIVE,
|
keymode: Astal.Keymode.EXCLUSIVE,
|
||||||
exclusivity: Astal.Exclusivity.IGNORE,
|
|
||||||
onKeyPressEvent(_, event) {
|
onKeyPressEvent(_, event) {
|
||||||
const keyval = event.get_keyval()[1];
|
const keyval = event.get_keyval()[1];
|
||||||
// Focus entry on typing
|
// Focus entry on typing
|
||||||
|
|
|
||||||
|
|
@ -100,6 +100,8 @@ export class PopupWindow extends Widget.Window {
|
||||||
sProps.namespace = `caelestia-${props.name}`;
|
sProps.namespace = `caelestia-${props.name}`;
|
||||||
sProps.anchor =
|
sProps.anchor =
|
||||||
Astal.WindowAnchor.TOP | Astal.WindowAnchor.LEFT | Astal.WindowAnchor.BOTTOM | Astal.WindowAnchor.RIGHT;
|
Astal.WindowAnchor.TOP | Astal.WindowAnchor.LEFT | Astal.WindowAnchor.BOTTOM | Astal.WindowAnchor.RIGHT;
|
||||||
|
sProps.exclusivity = Astal.Exclusivity.IGNORE;
|
||||||
|
if (!sProps.keymode) sProps.keymode = Astal.Keymode.ON_DEMAND;
|
||||||
sProps.onKeyPressEvent = (self, event) => {
|
sProps.onKeyPressEvent = (self, event) => {
|
||||||
// Close window on escape
|
// Close window on escape
|
||||||
if (event.get_keyval()[1] === Gdk.KEY_Escape) self.hide();
|
if (event.get_keyval()[1] === Gdk.KEY_Escape) self.hide();
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue