Aylur / astal

Building blocks for creating custom desktop shells
https://aylur.github.io/astal/
GNU Lesser General Public License v2.1
97 stars 10 forks source link

How to send notifications #26

Open danielphan2003 opened 6 days ago

danielphan2003 commented 6 days ago

Similar to Utils.notify

Aylur commented 6 days ago

There is currently no builtin utility for sending notifications yet, you can use libnotify in the meantime

adminy commented 5 days ago

what about opening apps? I tried exec but that closes the apps if ags is closed.

Aylur commented 5 days ago

exec runs a subprocess which will be closed when the parent process (ags) is closed. You should use the Apps library and the launch method If your app does not have a .desktop file you should launch it through your compositor so that it won't be a child process of ags but your compositor. For example on Hyprland execAsync('hyprctl dispatch exec your-command')

adminy commented 5 days ago

Thanks,

const results = apps.fuzzy_query(request)
execAsync(['hyprctl', 'dispatch', 'exec', results[0].executable])

worked. Now I'll just have to figure out how to make a nice widget for it.

Aylur commented 5 days ago

execAsync(['hyprctl', 'dispatch', 'exec', results[0].executable])

This will not work if the executable has some special characters. Like I said, you should use .launch()

result.launch()