Commit Graph

42 Commits

Author SHA1 Message Date
Narvin Singh
1516ff1550 Feat: Default PID
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.
2021-01-04 14:47:13 -05:00
Narvin Singh
f2bdd47bec Feat: Add section to README
Add reserved namespace and contributing sections to README, and revise
the entire document.
2021-01-02 12:42:03 -05:00
Narvin Singh
9af153d466 Feat: Change reserved namespace from res to daem 2021-01-02 12:40:35 -05:00
Narvin Singh
1ad7087552 Feat: Process all requestd modules before drawing 2021-01-02 12:23:25 -05:00
Narvin Singh
8669361595 Fix: Unique fifo per session
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.
2021-01-02 00:03:01 -05:00
Narvin Singh
3b675b0da0 Feat: Help options 2021-01-01 23:56:13 -05:00
Narvin Singh
a4e443d946 Fix: Update usage to show help options 2021-01-01 23:40:53 -05:00
Narvin Singh
886d4e8d2d Feat: rpid
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.
2021-01-01 23:21:44 -05:00
Narvin Singh
d5c02f8459 Feat: Use named pipe instead of signals and sleep
This is a breaking change and will lead to a new major version.
2021-01-01 14:08:29 -05:00
Narvin Singh
4ddf06147d Fix: Failure to find daemon after PID changes
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.
2020-12-31 18:41:29 -05:00
Narvin Singh
e5578dfb14 Fix: Uncommented line to sleep by day 2020-12-31 16:51:27 -05:00
Narvin Singh
7d21134068 Feat: Rename module directory to mod
This is a breaking change so this will be a new major version.
2020-12-31 13:50:52 -05:00
Narvin Singh
59b3d77547 Feat: Commands
Add commands that can be the target of keybindings to perform an
action and update the status bar.
2020-12-31 13:39:04 -05:00
Narvin Singh
3c56b60400 Feat: MIT License 2020-12-30 01:24:32 -05:00
Narvin Singh
994cbf659f Feat: Rename the application to akuma-v-dwm 2020-12-30 01:05:06 -05:00
Narvin Singh
bf2f67a28d Refactor: Lifted code outside of main function
It seemed like overkill to enclose the entire script in a function
just so readonly variables would work correctly.
2020-12-30 00:36:11 -05:00
Narvin Singh
7a2f2bbf08 Style: Remove unnecessary declare statements 2020-12-29 22:32:16 -05:00
Narvin Singh
a071b38a9d Refactor: Use short signal name 2020-12-29 21:59:23 -05:00
Narvin Singh
5f6db51c0a Fix: ShellCheck SC2091 2020-12-29 21:25:13 -05:00
Narvin Singh
410fbe2477 Fix: Quote variable 2020-12-29 20:26:56 -05:00
Narvin Singh
5a6f16ea5b Feat: Usage and help parameter 2020-12-29 20:25:42 -05:00
Narvin Singh
96442be9b3 Feat: Efficient waiting with long-running sleep
Replace short foreground sleep in a loop with a long background sleep
in a loop that we wait, which should be much more efficient.
2020-12-29 18:58:38 -05:00
Narvin Singh
ea4806df9d Feat: Module list can be comma or space delimited 2020-12-29 15:08:25 -05:00
Narvin Singh
f0734ee8cb Fix: Update usage to reflect name: xrsbs
Update usage to refer to the scheduler by its new name and declare
constant variables as readonly.
2020-12-29 12:24:20 -05:00
Narvin Singh
8a512754e5 Refactor: Make variable names more descriptive
Change variable names and revise and consolidate comments so the code
is clearer.
2020-12-29 11:23:44 -05:00
Narvin Singh
0e8ca10665 Chore: Revise comments 2020-12-28 22:04:18 -05:00
Narvin Singh
56b1b2c9c8 Feat: Swap resolution and module list param order 2020-12-28 21:58:52 -05:00
Narvin Singh
3b421f4faa Chore: Add comment for ShellCheck SC1090 2020-12-28 20:17:51 -05:00
Narvin Singh
8471ea66c0 Feat: Daemon 2020-12-28 20:02:32 -05:00
Narvin Singh
08dc3a58d3 Feat: CPU, memory, backlight and volume modules 2020-12-28 14:03:50 -05:00
Narvin Singh
01ee5fba93 Feat: Default suffix is percent sign
By making the percent sign part of the suffix, it can be changed or
entirely omitted by changing the suffix.
2020-12-28 13:58:09 -05:00
Narvin Singh
2355282d88 Fix: Change module function names to be unique
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.
2020-12-28 11:48:33 -05:00
Narvin Singh
d05a68932b Feat: Battery module 2020-12-27 22:14:21 -05:00
Narvin Singh
1e331865af Feat: Date/time module 2020-12-27 22:13:52 -05:00
Narvin Singh
da7febb8f9 Chore: Add xrsbd and xrsbs level 2 headings 2020-12-27 14:32:18 -05:00
Narvin Singh
186fce8d9f Chore: Update README to describe xrsb 2020-12-27 14:25:41 -05:00
Narvin Singh
3ca912c80c Feat: Scheduler
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.
2020-12-27 13:31:56 -05:00
Narvin Singh
b79e5bbcd0 Refactor: Change from using xprop to xsetroot 2020-12-25 21:22:42 -05:00
Narvin Singh
3ee3574351 Fix: CPU usage using %cpu
Use %cpu format in ps and drop the percent sign from the output since
the numbers don't usually add up to 100.
2020-12-24 11:34:53 -05:00
Narvin Singh
fc8f655bb7 Fix: Memory usage using raw numbers
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.
2020-12-24 10:46:11 -05:00
Narvin Singh
deca8326c1 Feat: status-bar
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
2020-12-23 23:48:59 -05:00
Narvin Singh
4227b4f854 Feat: README stub 2020-12-23 00:35:30 -05:00