You are not logged in.
Pages: 1
when ~/.config/autostart stuff runs, how much of Xfce is (supposed to be) up and running?
Offline
On Xubuntu 20.04, the run hooks are started after Client2, which is xfce4-panel, so pretty much the core Xfce is already set up.
Remember to edit the subject of your topic to include the [SOLVED] tag once you're satisfied with the answers or have found a solution (in which case, don't forget to share it as well), so that other members of the community can quickly refer to it and save their time. Pretty please!
Offline
is the panel up and visible? i guess panel loads plugins so that can be a timing thing. i'm trying to decide if i can put my custom initialization code in autostart, or if i need to run it before Xfce starts (e.g X starts my script first and then my script starts Xfce (or whatever X was configured to start). my script needs to be sure that only one instance gets run per session. i'm worried that the environment won't have enough session context until Xfce is started.
Last edited by Skaperen (2022-06-30 03:42:44)
Offline
is the panel up and visible?
It is in the middle of it: the base windows get initialized just a split second later, though the bus name and is already owned.
i guess panel loads plugins so that can be a timing thing.
They are loaded as soon as the base window is initialized. Sequentially, IIRC.
i'm trying to decide if i can put my custom initialization code in autostart, or if i need to run it before Xfce starts (e.g X starts my script first and then my script starts Xfce (or whatever X was configured to start).
It really depends on what the script is intended to do and the component it acts upon. For example, my little wrapper to xfce4-panel that rearranges panel windows resides in the autostart directory and just waits until the panel windows appear, then calls the script that does the actual job in ~/bin.
my script needs to be sure that only one instance gets run per session. i'm worried that the environment won't have enough session context until Xfce is started.
To help you decide, you can copy /etc/xdg/xfce4/xinitrc to ~/.config/xfce4/xinitrc and set the XFSM_VERBOSE environment variable there. This will make the Xfce session manager log its activity to ~/.xfce4-session.verbose-log, which you can further inspect and analyze.
Remember to edit the subject of your topic to include the [SOLVED] tag once you're satisfied with the answers or have found a solution (in which case, don't forget to share it as well), so that other members of the community can quickly refer to it and save their time. Pretty please!
Offline
would be nice if it put timestamps on those log entries.
Offline
I haven't tested it, but it probably opens that file on file descriptor 2 (stderr).
Perhaps you could try duplicating stderr from stdout, then capturing that output in a while read loop and sending it back, or to another file.
Remember to edit the subject of your topic to include the [SOLVED] tag once you're satisfied with the answers or have found a solution (in which case, don't forget to share it as well), so that other members of the community can quickly refer to it and save their time. Pretty please!
Offline
Perhaps you could try duplicating stderr from stdout, then capturing that output in a while read loop and sending it back, or to another file.
you mean in a script the runs in place of Xfce, sets up the file descriptors, launches a script to read stdin lines coming from stderr over a pipe, add the timestamp, and exec the real XFce? won't that affect stderr in everything run from there?
edit:
Skaperen notices his posts count reached 666.
Last edited by Skaperen (2022-07-03 17:27:25)
Offline
you mean in a script the runs in place of Xfce, sets up the file descriptors, launches a script to read stdin lines coming from stderr over a pipe, add the timestamp, and exec the real XFce? won't that affect stderr in everything run from there?
You make it sound incredibly complex. Here, try this working example:
# start xfce4-session normally
(sleep 2s; while read -r line; do printf "[%s] %s\n" "$(date '+%T.%N')" "$line"; done < /home/sid/.xfce4-session.verbose-log > $(mktemp) ) &
XFSM_VERBOSE=1 exec xfce4-session
Add it to your ~/.config/xfce4/xinitrc. The temporary log will live in /tmp/tmp.* for the duration of the session.
Remember to edit the subject of your topic to include the [SOLVED] tag once you're satisfied with the answers or have found a solution (in which case, don't forget to share it as well), so that other members of the community can quickly refer to it and save their time. Pretty please!
Offline
i was trying to describe the steps in running a program (script, binary, whatever) that becomes the other end of of a pipe that gets written to whenever stderr is written to. i would avoid having processes be started just to get a timestamp. i would do this in Python or C.
Offline
i would avoid having processes be started just to get a timestamp.
How do you think programs run?
i would do this in Python or C.
Please do and share the result!
Remember to edit the subject of your topic to include the [SOLVED] tag once you're satisfied with the answers or have found a solution (in which case, don't forget to share it as well), so that other members of the community can quickly refer to it and save their time. Pretty please!
Offline
Pages: 1
[ Generated in 0.012 seconds, 7 queries executed - Memory usage: 556.55 KiB (Peak: 573.02 KiB) ]