Skip to content
You are looking at the legacy documentation of AGS v1. Go to aylur.github.io/ags for AGS v2.

App

This is the main Gtk.Application instance that is running.

signals

  • window-toggled: (windowName: string, visible: boolean)
  • config-parsed: emitted on startup

properties

  • windows: Gtk.Window[]
  • configDir: string path to the config directory
  • iconTheme: string
  • cursorTheme: string
  • gtkTheme: string

methods

  • addWindow: (window: Gtk.Window) => void
  • removeWindow: (window: Gtk.Window) => void
  • getWindow: (name: string) => Gtk.Window
  • closeWindow: (name: string) => void
  • openWindow: (name: string) => void
  • toggleWindow: (name: string) => void
  • quit: () => void
  • resetCss: () => void
  • applyCss: (path: string) => void
  • addIcons: (path: string) => void

Window toggled signal

// this is only signaled for windows exported in config.js
// or added with App.addWindow
const label = Widget.Label()
.hook(App, (self, windowName, visible) => {
self.label = `${windowName} is ${visible ? 'visible' : 'not visible'}`;
}, 'window-toggled')
});

Applying CSS

If you want to change the style sheet on runtime

specifying a css file

App.applyCss('/path/to/file.css');

applying a stylesheet

App.applyCss(`
window {
background-color: transparent;
}
`)

to reset applied stylesheets

App.resetCss();