Aylur / ags

A customizable and extensible shell
GNU General Public License v3.0
1.74k stars 94 forks source link

Hyprland workspaces widget no longer working after update #427

Closed Zerodya closed 1 month ago

Zerodya commented 1 month ago

Hi, I'm using AGS with Hyprland on NixOS, and I used to have this Workspaces widget which was working just fine for months, but then a few days ago I updated my system (both AGS and Hyprland were updated) and the workspaces widget just disappeared, with no logs in terminal.

Wanted to do some debugging so I changed my Workspaces.js to this (by ChatGPT):

import Widget from 'resource:///com/github/Aylur/ags/widget.js';
import Service from 'resource:///com/github/Aylur/ags/service.js';

console.log('Starting basic script execution.');

let hyprland;
try {
  console.log('Attempting to import Hyprland service...');
  hyprland = await Service.import('hyprland');
  console.log('Hyprland service imported:', hyprland);
} catch (error) {
  console.error('Failed to import Hyprland service:', error);
}

if (!hyprland) {
  console.error('Hyprland service is not available after import.');
} else {
  console.log('Hyprland service is available:', hyprland);
}

export default () => Widget.Label({ label: 'Basic script executed' });

and I get this in terminal:

Gjs-Console-Message: 18:35:48.232: Starting basic script execution.
Gjs-Console-Message: 18:35:48.232: Attempting to import Hyprland service...

(com.github.Aylur.ags:14303): Gjs-Console-CRITICAL **: 18:35:48.250: Failed to import Hyprland service: Gio.IOErrorEnum: Could not connect: No such file or directory
socket@resource:///com/github/Aylur/ags/service/hyprland.js:7:6
_socketStream@resource:///com/github/Aylur/ags/service/hyprland.js:140:34
message@resource:///com/github/Aylur/ags/service/hyprland.js:151:43
Hyprland@resource:///com/github/Aylur/ags/service/hyprland.js:102:41
@resource:///com/github/Aylur/ags/service/hyprland.js:321:25
_init/GLib.MainLoop.prototype.runAsync/</<@resource:///org/gnome/gjs/modules/core/overrides/GLib.js:266:34

(com.github.Aylur.ags:14303): Gjs-Console-CRITICAL **: 18:35:48.250: Hyprland service is not available after import.

I also get the 'Basic script executed' label where the widget should be.

kotontrion commented 1 month ago

Gio.IOErrorEnum: Could not connect: No such file or directory

Hyprland changed its socket location in v0.40.0. This change is accounted for in ags version 1.8.2, so make sure ags is up to date.

Zerodya commented 1 month ago

I was sure both were up to date, and in fact they were, but it turns out that I somehow also had ags 1.7.7 installed in my nix profile so my system was using that one instead. All good now