You are not logged in.
Hi, this is a short one:
How can I read tty messages from within my Sway session? Is there a way that uses basic command line tools and doesn't revolve around some AUR package?
I struggle to get my Wayland/Sway setup running on my new device (Hiding the Waybar is bugging around: Flickering shadow of hidden Waybar). I start Sway manually from tty. Every time I want to read the tty debug info, I have to exit Sway. My iteration process would be a lot less painful if I just could read those messages from within the session (I don't even want to input anything). Any help is appreciated.
Much love
- An archly novice
Last edited by archlynovice (2024-11-04 19:22:49)
Offline
Log stdout and stderr to a file yourself by starting sway with
sway |& tee /tmp/sway.log
or so.
Offline
Well, this leaves a lot out. It only prints messages, errors, warnings, or logs generated by Sway.
Everything _during_ Sway, but not _by_ Sway will not be printed. This includes:
Environment variable $... not set, ignoring.
Gdk-Message: Error reading events ...
[common/ipc-client.c:XX] Unable to receive ...
All of this is missing.
Any idea to just follow along the tty directly?
Offline
You want every programs output that's ever happening ever? You're not going to have that in the tty either, in a general sense. your probably seeing systemd journal integration or so, so check the journal with journalctl. Can you link to a screenshot of which messages you mean that would be excluded?
Offline
I'm tired. Will respond tomorrow.
Last edited by archlynovice (2024-11-03 22:00:33)
Offline
exec >> /tmp/sway.log 2>&1
sway
However
Everything _during_ Sway, but not _by_ Sway
You cannot perfectly control where random stuff prints its messages and also the behavior might differ depending on whether the tty is occupied by something else.
Run tmux, start sway from there and attach to the session from some GUI terminal inside sway.
Remember that sway is pot. the foreground process in that shell, so ctrl+c inside the tmux session will kick you out of the sway session!
Offline
@V1del I'm pretty new to shell scripting, so I tried to understand your command first. I learned about the |& expression and replaced it by 2>&1 (thought I'm smart). My shell interpreter didn't read that well and split the output in two files: /tmp/sway.log and ~/%1. When using your command, it works just fine. Thank you for the help :)
@seth I wanted to learn about tmux anyway, so this may be a reason to do it now. Thanks! :)
Offline