parent
8ee3530330
commit
276c399f49
6 changed files with 25 additions and 19 deletions
nixosModules/ags/v2/widgets/bar
|
@ -4,7 +4,7 @@ import { bind, Variable } from 'astal';
|
|||
import AstalHyprland from 'gi://AstalHyprland?version=0.1';
|
||||
const Hyprland = AstalHyprland.get_default();
|
||||
|
||||
import { get_hyprland_monitor_desc, get_monitor_desc } from '../../lib';
|
||||
import { get_hyprland_monitor_desc, get_monitor_desc, hyprMessage } from '../../lib';
|
||||
|
||||
|
||||
const FullscreenState = Variable({
|
||||
|
@ -12,7 +12,7 @@ const FullscreenState = Variable({
|
|||
clientAddrs: new Map() as Map<string, string>,
|
||||
});
|
||||
|
||||
Hyprland.connect('event', () => {
|
||||
Hyprland.connect('event', async() => {
|
||||
const arrayEquals = (a1: unknown[], a2: unknown[]) =>
|
||||
a1.sort().toString() === a2.sort().toString();
|
||||
|
||||
|
@ -20,7 +20,7 @@ Hyprland.connect('event', () => {
|
|||
m1.size === m2.size &&
|
||||
Array.from(m1.keys()).every((key) => m1.get(key) === m2.get(key));
|
||||
|
||||
const newMonitors = JSON.parse(Hyprland.message('j/monitors')) as AstalHyprland.Monitor[];
|
||||
const newMonitors = JSON.parse(await hyprMessage('j/monitors')) as AstalHyprland.Monitor[];
|
||||
|
||||
const fs = FullscreenState.get();
|
||||
const fsClients = Hyprland.get_clients().filter((c) => {
|
||||
|
|
|
@ -7,6 +7,7 @@ import AstalHyprland from 'gi://AstalHyprland?version=0.1';
|
|||
const Hyprland = AstalHyprland.get_default();
|
||||
|
||||
import Separator from '../../misc/separator';
|
||||
import { hyprMessage } from '../../../lib';
|
||||
|
||||
|
||||
export default () => {
|
||||
|
@ -37,8 +38,8 @@ export default () => {
|
|||
updateVars();
|
||||
Hyprland.connect('notify::focused-client', () => updateVars());
|
||||
Hyprland.connect('client-removed', () => updateVars());
|
||||
Hyprland.connect('client-added', () => {
|
||||
updateVars(Hyprland.get_client(JSON.parse(Hyprland.message('j/activewindow')).address));
|
||||
Hyprland.connect('client-added', async() => {
|
||||
updateVars(Hyprland.get_client(JSON.parse(await hyprMessage('j/activewindow')).address));
|
||||
});
|
||||
|
||||
return (
|
||||
|
|
|
@ -4,6 +4,8 @@ import { timeout } from 'astal';
|
|||
import AstalHyprland from 'gi://AstalHyprland?version=0.1';
|
||||
const Hyprland = AstalHyprland.get_default();
|
||||
|
||||
import { hyprMessage } from '../../../lib';
|
||||
|
||||
|
||||
const URGENT_DURATION = 1000;
|
||||
|
||||
|
@ -17,7 +19,7 @@ const Workspace = ({ id = 0 }) => (
|
|||
tooltip_text={id.toString()}
|
||||
|
||||
onClickRelease={() => {
|
||||
Hyprland.message_async(`dispatch workspace ${id}`, () => { /**/ });
|
||||
hyprMessage(`dispatch workspace ${id}`);
|
||||
}}
|
||||
>
|
||||
<box
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue