Make the pid parameter default to the PID of the current process.
Change the exit code for invalid arguments to a value in the user
defined range (see https://tldp.org/LDP/abs/html/exitcodes.html). This
may be considered a breaking change, but since the only applications
that currently use this script don't rely on this code, I don't think
we need to bump the major version for this.
Use rpid in the daemon and the scheduler to append the PID of their
common login process to the named pipe so daemons and schedulers in
other sessions won't conflict with one another.
The daemon and scheduler will need rpid to get the PID of the login
process that they are both descended from in order to create a unique
fifo in order to not conflict with other daemons and schedulers in
other sessions.
It looks like if the daemon is started in the .xinitrc, its PID
can change once the X session is fully started. This will cause
long-running schedulers that were started along with the daemon
to not find it and exit soon after the session is started. So have
the schedulers check for the newest daemon instance each time they
are about to send it a signal. This is probably more efficient than
before when we were getting the PID once when the scheduler starts,
because the scheduler would validate that the PID still referred to
a daemon each time it sent a signal. Getting the PID replaces that
validation check, and may actually be faster.
The code for each module is wrapped in a function so the module
can be parameterized, and so its variables can be scoped to the
function. However, the function names must be unique, otherwise when
the modules are sourced, functions will overwrite functions with the
same name in previously sourced modules.
The project name is changing from status-bar to xrsb (for X root
window status bar), so the scheduler is called xrsbs.
The scheduler sends the SIGUSR1 signal to a daemon that is
responsible for maintaining and updating the status (X root window
name property). The daemon will determine which actions to perform
based on the files present in the action directory and remove the files
once the actions are performed, so the scheduler creates action files
just before sending the signal. The scheduler can send one signal to
perform multiple actions by creating multiple action files, and can
create the action file(s) and send the signal immediately,
after some delay, or repeatedly at some interval.
Use free without -h to get raw numbers to report correct memory usage,
otherwise when the free memory is a lower order of magnitude than the
total memory, e.g., the free memory is in MiB and the total memory
is in GiB, then the human-readable free memory number will be too
large compared to the total memory number.
Each panel of the status bar can be turned on or off and configured
with an icon or no icon.
- Loops every 2 seconds
- Reports on:
- CPU usage
- Memory usage
- Backlight brightness
- Volume (requires amixer from alsa-utils)
- Icon changes when volume is below 50%, at or above 50%, or muted
- Battery percentage for each batter
- Icon changes from batter to plug when on AC power
- Date and time