fix(ags): fix latest breaking changes
All checks were successful
Discord / discord commits (push) Has been skipped

This commit is contained in:
matt1432 2024-02-11 02:18:59 -05:00
parent 58f2056e41
commit 281e00c7fe
20 changed files with 53 additions and 53 deletions

View file

@ -145,10 +145,10 @@ class Pointers extends Service {
return;
}
Hyprland.sendMessage('j/layers').then((response) => {
Hyprland.messageAsync('j/layers').then((response) => {
const layers = JSON.parse(response) as { Layers: Layers };
Hyprland.sendMessage('j/cursorpos').then((res) => {
Hyprland.messageAsync('j/cursorpos').then((res) => {
const pos = JSON.parse(res) as CursorPos;
Object.values(layers).forEach((key) => {

View file

@ -133,14 +133,14 @@ class Tablet extends Service {
const orientation = ROTATION_MAP[index];
Hyprland.sendMessage(
Hyprland.messageAsync(
`keyword monitor ${SCREEN},transform,${orientation}`,
).catch(print);
const batchRotate = DEVICES.map((dev) =>
`keyword device:${dev}:transform ${orientation}; `);
Hyprland.sendMessage(`[[BATCH]] ${batchRotate.flat()}`);
Hyprland.messageAsync(`[[BATCH]] ${batchRotate.flat()}`);
if (TouchGestures.gestureDaemon) {
TouchGestures.killDaemon();

View file

@ -15,7 +15,7 @@ const BarCloser = (variable: Var<boolean>) => Window({
child: EventBox({
on_hover: (self) => {
variable.value = false;
variable.setValue(false);
const parent = self.get_parent();
if (parent) {
@ -45,12 +45,12 @@ export default (props?: DefaultProps) => {
);
if (workspace) {
Revealed.value = !workspace['hasfullscreen'];
Revealed.setValue(!workspace['hasfullscreen']);
}
};
const checkGlobalFsState = (_: BoxGeneric, fullscreen: boolean) => {
Revealed.value = !fullscreen;
Revealed.setValue(!fullscreen);
};
self
@ -73,7 +73,7 @@ export default (props?: DefaultProps) => {
child: EventBox({
on_hover: () => {
barCloser.visible = true;
Revealed.value = true;
Revealed.setValue(true);
},
child: Box({

View file

@ -21,7 +21,7 @@ const getKbdLayout = (self: LabelGeneric, _: string, layout: string) => {
}
else {
// At launch, kb layout is undefined
Hyprland.sendMessage('j/devices').then((obj) => {
Hyprland.messageAsync('j/devices').then((obj) => {
const keyboards = Array.from(JSON.parse(obj)
.keyboards) as Keyboard[];
const kb = keyboards.find((v) => v.name === DEFAULT_KB);

View file

@ -16,7 +16,7 @@ Persist({
export default () => CursorBox({
on_primary_click_release: () => {
HeartState.value = HeartState.value === '' ? '󰣐' : '';
HeartState.setValue(HeartState.value === '' ? '󰣐' : '');
},
child: Label({

View file

@ -50,7 +50,7 @@ const SysTray = () => MenuBar({
}
self.attribute.items.set(id, w);
self.child = w;
self.add(w);
self.show_all();
w.child.reveal_child = true;

View file

@ -26,7 +26,7 @@ const Workspace = ({ id }: { id: number }) => {
tooltip_text: `${id}`,
on_primary_click_release: () => {
Hyprland.sendMessage(`dispatch workspace ${id}`);
Hyprland.messageAsync(`dispatch workspace ${id}`);
},
child: Box({

View file

@ -60,17 +60,17 @@ export const CoverArt = (
// Give temp cover art
readFileAsync(player.cover_path).catch(() => {
if (!colors.value && !player.track_cover_url) {
colors.value = {
colors.setValue({
imageAccent: '#6b4fa2',
buttonAccent: '#ecdcff',
buttonText: '#25005a',
hoverAccent: '#d4baff',
};
});
self.attribute.bgStyle = `
background: radial-gradient(circle,
rgba(0, 0, 0, 0.4) 30%,
${colors.value.imageAccent}),
${(colors as Var<Colors>).value.imageAccent}),
rgb(0, 0, 0);
background-size: cover;
background-position: center;
@ -87,7 +87,7 @@ export const CoverArt = (
return;
}
colors.value = JSON.parse(out);
colors.setValue(JSON.parse(out));
self.attribute.bgStyle = `
background: radial-gradient(circle,

View file

@ -23,14 +23,14 @@ Audio.connect('speaker-changed', () => {
}
if (Audio.speaker.stream?.is_muted) {
SpeakerIcon.value = speakerIcons[0];
SpeakerIcon.setValue(speakerIcons[0]);
}
else {
const vol = Audio.speaker.volume * 100;
for (const threshold of [-1, 0, 33, 66, 100]) {
if (vol > threshold + 1) {
SpeakerIcon.value = speakerIcons[threshold + 1];
SpeakerIcon.setValue(speakerIcons[threshold + 1]);
}
}
}
@ -43,14 +43,14 @@ Audio.connect('microphone-changed', () => {
}
if (Audio.microphone.stream?.is_muted) {
MicIcon.value = micIcons[0];
MicIcon.setValue(micIcons[0]);
}
else {
const vol = Audio.microphone.volume * 100;
for (const threshold of [-1, 0, 33, 66]) {
if (vol > threshold + 1) {
MicIcon.value = micIcons[threshold + 1];
MicIcon.setValue(micIcons[threshold + 1]);
}
}
}

View file

@ -70,10 +70,10 @@ export class CursorBox<Child extends Gtk.Widget, Attr> extends Gtk.EventBox {
return;
}
this.#canRun.value = !(
this.#canRun.setValue(!(
x > this.get_allocated_width() ||
y > this.get_allocated_height()
);
));
}, 'end');
this.connect('enter-notify-event', (_, event: Gdk.Event) => {
@ -169,7 +169,7 @@ export class CursorBox<Child extends Gtk.Widget, Attr> extends Gtk.EventBox {
}
set disabled(value: boolean) {
this.#disabled.value = value;
this.#disabled.setValue(value);
}
get child() {

View file

@ -43,7 +43,7 @@ export class PopupWindow<
}
set content(value: Gtk.Widget) {
this.#content.value = value;
this.#content.setValue(value);
this.child.show_all();
}
@ -79,7 +79,7 @@ export class PopupWindow<
const antiClip = Variable(false);
if (content) {
contentVar.value = content;
contentVar.setValue(content);
}
super({
@ -104,7 +104,7 @@ export class PopupWindow<
});
if (blur) {
Hyprland.sendMessage('[[BATCH]] ' +
Hyprland.messageAsync('[[BATCH]] ' +
`keyword layerrule ignorealpha[0.97],${name}; ` +
`keyword layerrule blur,${name}`);
}
@ -254,7 +254,7 @@ export class PopupWindow<
alloc.height + 10;
if (needsAnticlipping) {
antiClip.value = true;
antiClip.setValue(true);
const thisTimeout = timeout(
transition_duration,
@ -262,7 +262,7 @@ export class PopupWindow<
// Only run the timeout if there isn't a newer timeout
if (thisTimeout ===
currentTimeout) {
antiClip.value = false;
antiClip.setValue(false);
}
},
);

View file

@ -64,15 +64,15 @@ const NotificationIcon = (notif: NotifObj) => {
iconCmd = (box) => {
if (!getDragState(box)) {
if (wmClass === 'thunderbird') {
Hyprland.sendMessage('dispatch ' +
Hyprland.messageAsync('dispatch ' +
'togglespecialworkspace thunder');
}
else if (wmClass === 'Spotify') {
Hyprland.sendMessage('dispatch ' +
Hyprland.messageAsync('dispatch ' +
'togglespecialworkspace spot');
}
else {
Hyprland.sendMessage('j/clients').then((msg) => {
Hyprland.messageAsync('j/clients').then((msg) => {
const clients = JSON.parse(msg) as Array<Client>;
const classes = [] as Array<string>;
@ -83,11 +83,11 @@ const NotificationIcon = (notif: NotifObj) => {
}
if (wmClass && classes.includes(wmClass)) {
Hyprland.sendMessage('dispatch ' +
Hyprland.messageAsync('dispatch ' +
`focuswindow ^(${wmClass})`);
}
else {
Hyprland.sendMessage('dispatch workspace empty')
Hyprland.messageAsync('dispatch workspace empty')
.then(() => {
app.launch();
});
@ -183,7 +183,7 @@ export const Notification = ({
return;
}
HasNotifs.value = Notifications.notifications.length > 0;
HasNotifs.setValue(Notifications.notifications.length > 0);
// Init notif
const notifWidget = Gesture({

View file

@ -123,8 +123,8 @@ export default ({
// Kill notif and update HasNotifs after anim is done
command();
HasNotifs.value = Notifications
.notifications.length > 0;
HasNotifs.setValue(Notifications
.notifications.length > 0);
(widget.get_parent() as BoxGeneric)?.remove(widget);
});

View file

@ -76,7 +76,7 @@ export default (window) => {
// Begin drag
signals.push(
gesture.connect('drag-begin', () => {
Hyprland.sendMessage('j/cursorpos').then((out) => {
Hyprland.messageAsync('j/cursorpos').then((out) => {
window.attribute.startY = JSON.parse(out).y;
});
}),
@ -85,7 +85,7 @@ export default (window) => {
// Update drag
signals.push(
gesture.connect('drag-update', () => {
Hyprland.sendMessage('j/cursorpos').then((out) => {
Hyprland.messageAsync('j/cursorpos').then((out) => {
const currentY = JSON.parse(out).y;
const offset = window.attribute.startY - currentY;
@ -117,7 +117,7 @@ export default (window) => {
// Begin drag
signals.push(
gesture.connect('drag-begin', () => {
Hyprland.sendMessage('j/cursorpos').then((out) => {
Hyprland.messageAsync('j/cursorpos').then((out) => {
window.attribute.startY = JSON.parse(out).y;
});
}),
@ -126,7 +126,7 @@ export default (window) => {
// Update drag
signals.push(
gesture.connect('drag-update', () => {
Hyprland.sendMessage('j/cursorpos').then((out) => {
Hyprland.messageAsync('j/cursorpos').then((out) => {
const currentY = JSON.parse(out).y;
const offset = window.attribute.startY - currentY;

View file

@ -22,7 +22,7 @@ const RCtrl = Variable(false);
const Caps = Variable(false);
Brightness.connect('caps', (_, state) => {
Caps.value = state;
Caps.setValue(state);
});
// Assume both shifts are the same for key.labelShift
@ -32,10 +32,10 @@ const RShift = Variable(false);
const Shift = Variable(false);
LShift.connect('changed', () => {
Shift.value = LShift.value || RShift.value;
Shift.setValue(LShift.value || RShift.value);
});
RShift.connect('changed', () => {
Shift.value = LShift.value || RShift.value;
Shift.setValue(LShift.value || RShift.value);
});
const SPACING = 4;
@ -100,13 +100,13 @@ const ModKey = (key: Key) => {
execAsync(`ydotool key ${key.keycode}:${Mod.value ? 0 : 1}`);
label.toggleClassName('active', !Mod.value);
Mod.value = !Mod.value;
Mod.setValue(!Mod.value);
},
setup: (self) => {
self
.hook(NormalClick, () => {
Mod.value = false;
Mod.setValue(false);
label.toggleClassName('active', false);
execAsync(`ydotool key ${key.keycode}:0`);
@ -238,7 +238,7 @@ const RegularKey = (key: Key) => {
execAsync(`ydotool key ${key.keycode}:1`);
execAsync(`ydotool key ${key.keycode}:0`);
NormalClick.value = true;
NormalClick.setValue(true);
}, 'cancelled');
return Box({

View file

@ -13,7 +13,7 @@ const AUDIO_MAX = 1.5;
const ShowSpeaker = Variable(true);
globalThis.showSpeaker = () => {
ShowSpeaker.value = !ShowSpeaker.value;
ShowSpeaker.setValue(!ShowSpeaker.value);
};
// Types

View file

@ -33,7 +33,7 @@ const PowermenuWidget = () => CenterBox({
end_widget: CursorBox({
class_name: 'logout button',
on_primary_click_release: () => Hyprland.sendMessage('dispatch exit')
on_primary_click_release: () => Hyprland.messageAsync('dispatch exit')
.catch(print),
child: Label({

View file

@ -132,10 +132,10 @@ const GridButton = ({
on_primary_click_release: () => {
ButtonStates.forEach((state) => {
if (state !== Activated) {
state.value = false;
state.setValue(false);
}
});
Activated.value = !Activated.value;
Activated.setValue(!Activated.value);
},
on_hover: (self) => {

View file

@ -170,7 +170,7 @@ export const NetworkMenu = () => {
if (accesPoint.strength < ap.strength) {
APList.get(ap.ssid).attribute
.ap.value = ap;
.ap.setValue(ap);
}
}
else {

View file

@ -50,7 +50,7 @@ export default () => {
name: 'swipeSpotify1',
gesture: 'LR',
edge: 'L',
command: () => Hyprland.sendMessage(
command: () => Hyprland.messageAsync(
'dispatch togglespecialworkspace spot',
),
});
@ -59,7 +59,7 @@ export default () => {
name: 'swipeSpotify2',
gesture: 'RL',
edge: 'L',
command: () => Hyprland.sendMessage(
command: () => Hyprland.messageAsync(
'dispatch togglespecialworkspace spot',
),
});