John D Pell
c09c050325
Revert "bash_it: source reloader.bash without arguments for the default enabling"
...
This reverts commit e05fa477d7 .
This reverts commit ee853670a1 .
2022-03-04 13:06:04 -08:00
John D Pell
8a6debd9d2
lint: add lib to clean_files.txt
2022-03-04 13:05:56 -08:00
John D Pell
affbce6de1
template: `shellcheck`
...
- and generally comment out useless varbls
2022-03-04 13:04:48 -08:00
John D Pell
52cd75b27e
template: `shfmt`
2022-03-04 13:04:48 -08:00
John D Pell
68149f7c8d
uninstall: try to determine initialization file
...
uninstall: TIL that `fgrep` is deprecated...
2022-03-04 13:04:48 -08:00
John D Pell
0485778117
uninstall: //echo/printf
...
- Alsö, add implementation note at top.
2022-03-04 13:04:48 -08:00
John D Pell
4c5e87e545
install: `_bash-it-install-modify-profile()`
2022-03-04 13:04:48 -08:00
John D Pell
d55adc610f
docs: fix references to `~/.bashrc`
...
docs/installation: add to note about interactive/login shells
2022-03-04 13:04:48 -08:00
John D Pell
c3de63b787
uninstall: cleanup
2022-03-04 13:04:48 -08:00
John D Pell
0853724c7d
install: cleanup
2022-03-04 13:04:48 -08:00
John D Pell
e888ddf953
install: use `.bashrc` and notify user
...
The logic to guess whether to use `.bash_profile` or `.bashrc` was buggy and wrong. Just use `.bashrc` and either automatically fill in a `.bash_profile`, or notify the user that they need to edit their `.bash_profile`.
2022-03-04 13:04:48 -08:00
John D Pell
3a778072db
Merge pull request #1906 from gaelicWizard/command_duration
...
Revamp command duration helper/plugin
2022-03-04 13:00:05 -08:00
John D Pell
866e5be86b
lib/command_duration: tests & whitespace
2022-03-04 12:58:07 -08:00
John D Pell
1c2fc2837f
lib/command_duration: adopt `_bash_it_library_finalize_hook`
2022-03-04 12:58:07 -08:00
John D Pell
4e0e59230b
lib/command_duration: rename `theme/command_duration.theme`
...
Rename the `theme/command_duration.theme` file as it's not really got anything to do with theming or SCM.
2022-03-04 12:58:07 -08:00
John D Pell
6ca10cf84c
plugin/cmd-returned-notify: Rewrite to match/use `lib/command_duration`
...
Use `$EPOCHREALTIME` (or `$SECONDS`) built-in variable provided by Bash instead of `date +%s`. We're only measuing the difference in seconds, so avoid both the binary invocation as well as the subshell.
Alsö, Reduce environmental pollution by not exporting every variable, and unsetting when done.
Change variable names to match lib/command-duration
Remove `preexec_return_notification()` in favor of `lib/command-duration`'s `_command_duration_pre_exec()`.
This should now use the same preexec hook and variables as the theme library `command_duration`.
tests: handle nanoseconds
2022-03-04 12:58:07 -08:00
John D Pell
33505d4db1
lib/command_duration: Refactor using `$EPOCHREALTIME`
...
Fallback to `$SECONDS` for older versions of _Bash_.
Instead of shortcircuiting the definition, just short-circuit the function. This allows the variable to be set later, e.g. on theme change.
2022-03-04 12:58:07 -08:00
John D Pell
09e8c25b64
lib/command_duration: dynamic clock hand
...
Calculate the position (from 1 to 12) of the hour hand on the clock emoji used for the _command_duration string.
Expressly handle COMMAND_DURATION_COLOR as blank when undefined.
2022-03-04 12:39:58 -08:00
John D Pell
ad1d73aaa1
lib/command_duration: remove temporary files
2022-03-04 12:39:02 -08:00
John D Pell
ca8101b34a
Merge pull request #2031 from gaelicWizard/bats-cleanup
2022-03-04 11:25:06 -08:00
Noah Gorny
9dece7fe58
Merge pull request #2105 from gaelicWizard/bats/upower
...
plugin/battery: fix handling of multiple batteries with `upower`
2022-03-04 20:58:17 +02:00
Noah Gorny
49649c5f0c
Merge pull request #2028 from gaelicWizard/plugin/base
...
lib/appearance: export `$CLICOLOR` instead of `$LSCOLOR`
2022-03-04 20:50:33 +02:00
Noah Gorny
6a53066b05
Merge pull request #2077 from Console-Utils/feature/issue-forms
...
Upgrade to GitHub issue forms
2022-03-04 20:49:54 +02:00
Noah Gorny
53e5965f2d
Merge pull request #2038 from gaelicWizard/theme/base
...
lib/theme: `shfmt`, `shellcheck`, and some cleanup
2022-03-04 20:49:24 +02:00
John D Pell
999b787c92
Close #2082
2022-03-04 00:07:35 -08:00
John D Pell
0286a50fcd
lib/appearance: export `$CLICOLOR` instead of `$LSCOLOR`
...
Alsö, since the *value* of `$CLICOLOR` is not used anywhere, overload it to count the number of colors available for use elsewhere.
2022-03-03 23:58:55 -08:00
John D Pell
f7cba27f10
lib/appearance: `shellcheck` && `shfmt`
2022-03-03 23:58:55 -08:00
John D Pell
029e53a433
plugin/battery: fix handling of multiple batteries with `upower`
2022-03-03 23:45:40 -08:00
John D Pell
6d422f17e4
Revert dc380e9ed6
2022-03-03 23:33:05 -08:00
John D Pell
dc380e9ed6
test/battery: fix tests…
2022-03-03 23:14:33 -08:00
John D Pell
6734baf950
test/base: lose old TravisCS skip
2022-03-03 23:02:29 -08:00
John D Pell
df87b41635
lib/theme: use `_command_exists()` in `rbenv_version_prompt()`
2022-03-03 22:54:09 -08:00
John D Pell
7762aa687a
lib/theme: `local hg_root` in `hg_prompt_vars()`
2022-03-03 22:54:09 -08:00
John D Pell
c9efc161ff
lib/theme: improve performance of `scm()`
...
- Don't invoke the source control utility when all we want to know is if we're somewhere inside the repository; use `_bash-it-find-in-ancestor()`.
2022-03-03 22:54:09 -08:00
John D Pell
d86a182b6e
lib/theme: export `$LS_COLORS` et al
2022-03-03 22:54:09 -08:00
John D Pell
c6ac9109d7
lib/theme: parameter cleanup
...
Improve handling of parameters by adding defaults (often blank).
Alsö, eliminate newlines from `echo` in many places.
2022-03-03 22:54:09 -08:00
John D Pell
2b3af0d8c9
lib/theme: eliminate a lot of subshells
...
A lot of useless `echo`s in here.
2022-03-03 22:54:09 -08:00
John D Pell
ac0d91b682
lib/theme.githelpers: remove dead code
...
Five years deprecation is plenty warning.
2022-03-03 22:54:09 -08:00
John D Pell
1d73537dbf
lib/theme: `shfmt` && `shellcheck`
...
My apologies to future `git blame` hunters ♥
Use the "short" host name by default (`\h`), not the fully qualified domain name (`\H`)...
lib/theme: don't redefine battery_char()
Combine the two definitions for `battery_char()` so the second one doesn't just overwrite the first one. Do one or the other, not both.
Don't evaluate if `battery_percentage()` is available at load time, evaluate it at run time.
Don't run `date` for `$THEME_TIME_FORMAT`, use `\D{fmt}`.
2022-03-03 22:54:09 -08:00
John D Pell
6bacd5fb1c
lib/githelpers: `shfmt` && `shellcheck`
...
My apologies to future `git blame` hunters ♥
2022-03-03 22:54:08 -08:00
John D Pell
fbc5d0a5af
lib/p4helpers: `shfmt`
...
My apologies to future `git blame` hunters ♥
2022-03-03 22:53:13 -08:00
John D Pell
0e0e0d3035
lib/theme: Fix a *few* SC2154
...
These variables are referenced by themes already linted.
2022-03-03 22:53:13 -08:00
John D Pell
a9dda3d358
test/preexec: adopt newly revamped `setup()`
2022-03-03 22:43:17 -08:00
John D Pell
0d55a2406c
test/base: adopt newly revamped `setup()`
2022-03-03 22:43:17 -08:00
John D Pell
f0dfe1a67f
test/theme: adopt newly revamped `setup()`
2022-03-03 22:43:17 -08:00
John D Pell
b686515877
test/xterm: adopt newly revamped `setup()`
2022-03-03 22:43:17 -08:00
John D Pell
a36a4c4038
test/ruby: adopt newly revamped `setup()`
2022-03-03 22:43:17 -08:00
John D Pell
fbf7efa1b8
test/go: adopt newly revamped `setup()`
2022-03-03 22:43:17 -08:00
John D Pell
4a9df8ec88
test/cmd-returned-notify: adopt newly revamped `setup()`
2022-03-03 22:43:17 -08:00
John D Pell
6e2e0af7f9
test/battery: adopt newly revamped `setup()`
2022-03-03 22:43:17 -08:00