Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ags is using old UnixOutputStream and its apparently crashing ags #413

Open
Seme4eg opened this issue May 10, 2024 · 1 comment
Open

Ags is using old UnixOutputStream and its apparently crashing ags #413

Seme4eg opened this issue May 10, 2024 · 1 comment

Comments

@Seme4eg
Copy link

Seme4eg commented May 10, 2024

Code:

function Backlight() {
  let brightness = Variable("0", {
    listen: [
      ['bash', '-c', '/home/earthian/dotfiles/.config/eww/scripts/backlight'],
      out => Number(out).toFixed(0)
    ],
  })

  return Widget.Overlay({
    className: "backlight",
    child: Widget.CircularProgress({
      css: 'min-height: 10px;'
        + 'font-size: 3px;',
      value: brightness.bind()
    }),
    overlays: [
      Widget.Label({
        className: "circle-text",
        label: "󰃝"
      }),
    ]
  })
}

Error:

(com.github.Aylur.ags:975768): Gjs-WARNING **: 20:31:05.665: Gio.UnixOutputStream has been moved to a separate platform-specific library. Please update your code to use GioUnix.OutputStream instead.
0 subprocess() ["resource:///com/github/Aylur/ags/utils/exec.js":27:23]
1 startListen() ["resource:///com/github/Aylur/ags/variable.js":88:27]
2 Variable() ["resource:///com/github/Aylur/ags/variable.js":30:17]
3 default() ["resource:///com/github/Aylur/ags/variable.js":130:35]
4 Backlight() ["file:///home/earthian/.config/ags/js/right_center.js":65:27]
5 RCenter() ["file:///home/earthian/.config/ags/js/right_center.js":10:6]
6 Right() ["file:///home/earthian/.config/ags/js/right.js":12:6]
7 Bar() ["file:///home/earthian/.config/ags/config.js":41:18]
8 <TOP LEVEL> ["file:///home/earthian/.config/ags/config.js":49:4]
9 _init/GLib.MainLoop.prototype.runAsync/</<() ["resource:///org/gnome/gjs/modules/core/overrides/GLib.js":266:33]"

The script itself works just fine with eww and is just a oneliner:

#!/usr/bin/env bash

brillo
udevadm monitor | rg --line-buffered "backlight" | while read -r _; do brillo; done
@kotontrion
Copy link
Contributor

ags is not using Gio.UnixOutputStreamdirectly. ags uses Gio.Subprocesswhich then creates the streams. Therefore this is not an ags issue and has to be fixed in gjs, which already happened. The fix will then be included in the next gjs release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants