Hyprland icon indicating copy to clipboard operation
Hyprland copied to clipboard

Stdout access for an each and every app launched inside hyprland.

Open grappas opened this issue 1 year ago • 7 comments

Description

Lets say we launched something via exec or exec-once. Or we could launch an app through a dedicated dispatcher (that we would hook up to i.e. to rofi). We want an easy access to output of that app but we don't want to always see that output. What if we could attach and detach, on demand for that output via hyprctl? What if we want to comfortably, on demand debug i.e. hypridle? ;) Something like: hyprctl dispatch exec $app hyprctl apps list hyprctl apps log $appfromlist

grappas avatar Feb 18 '24 20:02 grappas

Redirect the output to a file or pipe, or start the program as a service and let the service supervisor capture the logs.

fufexan avatar Feb 18 '24 21:02 fufexan

Yea... you see the problem ;)

grappas avatar Feb 18 '24 21:02 grappas

Not really. A user service makes sense, as it's run in the background and you only see the output when you invoke the command that shows it. So why not use that?

fufexan avatar Feb 18 '24 21:02 fufexan

Inconvenience? Every new app, new service? I.e. Steam or Firefox as services? You can use systemd, but for what? To show off? You could generate those, but you don't expect that anyone would do this, don't you? No it doesn't make any sense. Whole idea is to avoid such thing.

grappas avatar Feb 18 '24 21:02 grappas

There's systemd-run made specifically for what you're describing. Running apps as one-off services, without the need to write service files for them. Also, >~/.cache/something.log works fine too.

I'm not opposed to adding the feature you're describing, just providing alternatives that can be used in the meantime.

fufexan avatar Feb 18 '24 22:02 fufexan

just providing alternatives that can be used in the meantime.

Yea... run-rdfcd4ffc338a496287c1e44fd4749443.service Not so convenient also ¯_(ツ)_/¯ Thanks anyway. The more you know.

Note that instead writing whole new thing you could just write a wrapper around that thing ( ͡° ͜ʖ ͡°)

grappas avatar Feb 18 '24 23:02 grappas

hyprland itself might be run as a systemd-service and u'll get output in journal with one major issue, if an app doesn't provide any additional info (like waybar or swaybg f.e.), there would be just

Hyprland[pid]: bla bla

the same with just launching (i did't find another way to get output without bloating from debug:enable_stdout_logs or debug:disable_logs

Hyprland &>/tmp/hypr.log

probably adding loglevel as config option is good idea

another improvement would be if output of swpawned processes had prefix like

[<time>] <process>[<pid>]: <output>

or any similar form, or even add [STDOUT] as loglevel whith changes above we can just grep needed output

bvr-yr avatar Feb 20 '24 00:02 bvr-yr