Commit Graph

53 Commits

Author SHA1 Message Date
01b247d7fa Nix Fix 2025-04-10 10:42:17 +03:00
Narvin Singh
e776588a92 Fix: Typo 2021-10-26 09:24:07 -04:00
Narvin Singh
fe52291eda Feat: Example to update all daemons 2021-10-26 09:18:04 -04:00
Narvin Singh
8d02ac14c9 Merge: feat-request-all 2021-10-25 22:53:41 -04:00
Narvin Singh
d19eaeb6e9 Refactor: DRY 2021-10-25 22:43:46 -04:00
Narvin Singh
1bf05d0972 Feat: Return a PID in edge cases
- Return the first ancestor PID if root_name is not found.
- Return the process' own PID if its own name is root_name.
2021-10-25 22:29:52 -04:00
Narvin Singh
b19495a93c Fix: Treat date +%S as decimal instead of octal
The number of seconds elapsed in the current minute given by date
is a 2-digit number. That means seconds 0 to 9 have a leading 0,
which causes them to be interpreted as octal numbers. This is not
intended, but doesn't actually break things (because 00 to 07 octal
are equivalent to 0 to 7 decimal) until second 8 or 9, at which point
we get an error because 08 and 09 are invalid octal numbers.
2021-02-16 14:10:37 -05:00
Narvin Singh
24554f2b69 Feat: Utility module
- Move function to show usage upon request and exit into module
- Move/create time functions
- Move function that maps module file names to module functions
- Move rpid into the module and rename it to root_pid
2021-01-23 23:20:56 -05:00
Narvin Singh
6c8cf878f7 Chore: Fix formatting 2021-01-18 14:15:21 -05:00
Narvin Singh
fdeb1696d0 Refactor: Use rpid will all default parameters 2021-01-04 14:55:45 -05:00
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
2ee11a5eac Feat: Send request to all daemons
Write the requests to all named pipes if the mod list begins with
'>>* '. This feature will probably not be merged into the main branch
because we have to search for the fifo files before each send, and if
the daemon for this login session exits, the scheduler will continue
running, which may not be desirable.
2021-01-03 01:10:16 -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