Compare commits
10 Commits
d49703c5d5
...
v4.0.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1225230a07 | ||
|
|
9c43190202 | ||
|
|
9477638a28 | ||
|
|
f16ad711fb | ||
|
|
15ef317029 | ||
|
|
a6e4d7a256 | ||
|
|
6106ca7684 | ||
|
|
1088029ae6 | ||
|
|
eb4c89759b | ||
|
|
1dc5d72ac6 |
2
LICENSE
2
LICENSE
@@ -1,4 +1,4 @@
|
|||||||
Copyright 2013-2022 Geoffray Levasseur <fatalerrors@geoffray-levasseur.org>
|
Copyright 2013-2026 Geoffray Levasseur <fatalerrors@geoffray-levasseur.org>
|
||||||
|
|
||||||
This is distributed with BSD-3-Clause license with the following terms and
|
This is distributed with BSD-3-Clause license with the following terms and
|
||||||
condition:
|
condition:
|
||||||
|
|||||||
@@ -68,7 +68,8 @@ A bar-style prompt showing current time, execution time of the last command
|
|||||||
| `mcd` | filefct | Create a directory and immediately move into it |
|
| `mcd` | filefct | Create a directory and immediately move into it |
|
||||||
| `meteo` | info | Display weather forecast for the configured or given city |
|
| `meteo` | info | Display weather forecast for the configured or given city |
|
||||||
| `myextip` | net | Get information about your public IP address |
|
| `myextip` | net | Get information about your public IP address |
|
||||||
| `pkgs` | packages | Search for a pattern in installed package names (dpkg/rpm, supports `-i`) |
|
| `get_pkgmgr` | packages | Detect the active package manager of the running distribution (`apt`, `dnf`, `yum`, `zypper`, `pacman`, `apk`, `portage`, `xbps`, `nix`) |
|
||||||
|
| `pkgs` | packages | Search for a pattern in installed package names (distro-aware via `get_pkgmgr`, supports `-i`) |
|
||||||
| `ppg` | processes | Look for the given pattern in running processes |
|
| `ppg` | processes | Look for the given pattern in running processes |
|
||||||
| `ppn` | processes | List processes matching an exact command name |
|
| `ppn` | processes | List processes matching an exact command name |
|
||||||
| `ppu` | processes | List processes owned by a specific user |
|
| `ppu` | processes | List processes owned by a specific user |
|
||||||
|
|||||||
@@ -7,6 +7,32 @@ Versions follow `MAJOR.MINOR.PATCH-REVISION_STAGE_N` (e.g. `3.99.1-4_rc_1`).
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
## [3.99.2-4_rc_2] — 2026-04-21
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- **`prompt.sh`** — `\$Last_Command` in PS1 was escaped, preventing the exit
|
||||||
|
code from ever appearing in the prompt (the local variable no longer exists
|
||||||
|
when PS1 is rendered by bash). Removed the backslash so the value is embedded
|
||||||
|
at `set_prompt` build time.
|
||||||
|
- **`filefct.sh` — `file_stats()`** — a stray unconditional `shift` after
|
||||||
|
`esac` doubled-shifted arguments already shifted by each `case` branch;
|
||||||
|
successive options such as `-H -d` were silently skipped.
|
||||||
|
- **`packages.sh` — `pkgs()`** — replaced the unreliable binary-presence test
|
||||||
|
(`command -v dpkg / rpm`) with the new `get_pkgmgr` function. Also corrected
|
||||||
|
a typo in the "no package manager" error message (`avialable` → `available`).
|
||||||
|
- **`processes.sh` — `kt()`** — copy-paste error: usage error message read
|
||||||
|
`"Usage: ppg <string>"` instead of `"Usage: kt <pid>"`.
|
||||||
|
|
||||||
|
### Added
|
||||||
|
- **`packages.sh` — `get_pkgmgr()`** — new exported helper that detects the
|
||||||
|
active package manager of the running distribution. Detection first reads
|
||||||
|
`/etc/os-release` (`ID` then `ID_LIKE`), then falls back to a
|
||||||
|
fixed-priority binary scan. Supported families: `apt`, `dnf`, `yum`,
|
||||||
|
`zypper`, `pacman`, `apk`, `portage`, `xbps`, `nix`. Returns 1 when
|
||||||
|
nothing is identified. Available to all future commands in `packages.sh`.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
## [3.99.1-4_rc_1] — 2026
|
## [3.99.1-4_rc_1] — 2026
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|||||||
@@ -29,9 +29,48 @@ to target). Stale forks cause avoidable merge conflicts.
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## 3. Development environment
|
## 3. Branch policy
|
||||||
|
|
||||||
| Requirement | Minimum version | Notes |
|
| Branch | Purpose |
|
||||||
|
|---|---|
|
||||||
|
| `master` | Main development branch — new features and enhancements go here |
|
||||||
|
| `<version>` (e.g. `3.x`) | Maintenance branch for a released version — bugfixes backported from `master` |
|
||||||
|
|
||||||
|
**New functionality** must always target `master`.
|
||||||
|
|
||||||
|
**Bugfixes** must target the branch where the bug was introduced:
|
||||||
|
- If the bug exists in a released version, open the fix against that version's
|
||||||
|
maintenance branch first, then cherry-pick onto `master`.
|
||||||
|
- If the bug is only in `master` (unreleased), fix it directly on `master`.
|
||||||
|
- During a release-candidate cycle, bugfixes go on the `x.*` branch and are
|
||||||
|
merged back into `master` before the final release.
|
||||||
|
|
||||||
|
Do **not** add new features to a maintenance branch.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 4. Versioning scheme
|
||||||
|
|
||||||
|
Versions follow the format **`MAJOR.MINOR.PATCH`** where the `MINOR` number
|
||||||
|
conveys the development stage of the next major release:
|
||||||
|
|
||||||
|
| Minor range | Stage | Rules |
|
||||||
|
|---|---|---|
|
||||||
|
| `x.90.y` | **Alpha** toward `x+1` | Stays on `master`. Development is open: new features are welcome, regressions are acceptable. |
|
||||||
|
| `x.95.y` | **Beta** toward `x+1` | The `x+1.*` maintenance branch is created at this point. No regression unless absolutely necessary; new features still allowed. |
|
||||||
|
| `x.99.y` | **RC** toward `x+1` | Bugfixes only. No new features. No regression allowed. Becomes `x+1.0.0` when stable. |
|
||||||
|
|
||||||
|
Examples: `3.90.1` is the first alpha toward `4.0`, `3.99.2` is the second
|
||||||
|
release candidate for `4.0`.
|
||||||
|
|
||||||
|
The `PATCH` number increments freely within a stage. A bump in `MINOR`
|
||||||
|
(e.g. `90` → `95`) always indicates a stage promotion in development phase.
|
||||||
|
|
||||||
|
Any experimental version must have it's dedicated branch.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 5. Development environment
|
||||||
|---|---|---|
|
|---|---|---|
|
||||||
| Bash | 4.3 | Namerefs (`local -n`) required |
|
| Bash | 4.3 | Namerefs (`local -n`) required |
|
||||||
| shellcheck | any recent | Run before every commit |
|
| shellcheck | any recent | Run before every commit |
|
||||||
@@ -52,7 +91,7 @@ brew install shellcheck
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## 4. Code style
|
## 6. Code style
|
||||||
|
|
||||||
### General rules
|
### General rules
|
||||||
- **Bash only** — no external interpreters in core modules. Python or Perl is
|
- **Bash only** — no external interpreters in core modules. Python or Perl is
|
||||||
@@ -62,8 +101,8 @@ brew install shellcheck
|
|||||||
- **`[[ … ]]`** for all conditionals — not `[ … ]`.
|
- **`[[ … ]]`** for all conditionals — not `[ … ]`.
|
||||||
- **`(( … ))`** for arithmetic — not `$(( … ))` in conditionals.
|
- **`(( … ))`** for arithmetic — not `$(( … ))` in conditionals.
|
||||||
- **`local`** for all function-internal variables — avoid polluting the
|
- **`local`** for all function-internal variables — avoid polluting the
|
||||||
environment.
|
environment. Prefer upper case for global and lowercase for local.
|
||||||
- **`printf`** instead of `echo` wherever the format matters.
|
- **`printf`** instead of `echo` all the time.
|
||||||
- **Never `eval`** — use namerefs (`local -n`), `${!varname}` indirection, or
|
- **Never `eval`** — use namerefs (`local -n`), `${!varname}` indirection, or
|
||||||
`declare -g` instead.
|
`declare -g` instead.
|
||||||
- **No hardcoded defaults** — wire every configurable value through
|
- **No hardcoded defaults** — wire every configurable value through
|
||||||
@@ -100,7 +139,7 @@ Add the `load_conf` call near the top after any variable declarations.
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## 5. Configuration keys
|
## 7. Configuration keys
|
||||||
|
|
||||||
When adding a configurable default:
|
When adding a configurable default:
|
||||||
|
|
||||||
@@ -110,7 +149,7 @@ When adding a configurable default:
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## 6. Theming
|
## 8. Theming
|
||||||
|
|
||||||
New theme files go in `profile.d/themes/` with a `.theme` extension.
|
New theme files go in `profile.d/themes/` with a `.theme` extension.
|
||||||
They are **parsed, not executed** — do not add shell logic.
|
They are **parsed, not executed** — do not add shell logic.
|
||||||
@@ -118,7 +157,7 @@ See the existing themes and `README.md §4.4` for the allowed syntax.
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## 7. Running shellcheck
|
## 9. Running shellcheck
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
shellcheck -x profile.sh profile.d/*.sh
|
shellcheck -x profile.sh profile.d/*.sh
|
||||||
@@ -130,7 +169,7 @@ comment explaining why the suppression is necessary.
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## 8. Submitting a contribution
|
## 10. Submitting a contribution
|
||||||
|
|
||||||
### Via Git (preferred)
|
### Via Git (preferred)
|
||||||
1. Contact the maintainer to obtain push access, or fork on the Gitea instance.
|
1. Contact the maintainer to obtain push access, or fork on the Gitea instance.
|
||||||
@@ -156,7 +195,7 @@ Reference issue numbers if applicable: closes #42.
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## 9. What will be rejected
|
## 11. What will be rejected
|
||||||
|
|
||||||
- Code requiring packages not in a minimal Debian or CentOS install.
|
- Code requiring packages not in a minimal Debian or CentOS install.
|
||||||
- Use of `eval`, `source`-based config loading, or other code-injection vectors.
|
- Use of `eval`, `source`-based config loading, or other code-injection vectors.
|
||||||
@@ -166,6 +205,6 @@ Reference issue numbers if applicable: closes #42.
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## 10. Financial contributions
|
## 12. Financial contributions
|
||||||
|
|
||||||
Contact the maintainer by mail if you wish to make a financial contribution.
|
Contact the maintainer by mail if you wish to make a financial contribution.
|
||||||
|
|||||||
29
doc/LICENSE
Executable file
29
doc/LICENSE
Executable file
@@ -0,0 +1,29 @@
|
|||||||
|
Copyright 2021-2026 Geoffray Levasseur <fatalerrors@geoffray-levasseur.org>
|
||||||
|
|
||||||
|
This software is distributed under the BSD-3-Clause license with the
|
||||||
|
following terms and conditions:
|
||||||
|
|
||||||
|
Redistribution and use in source and binary forms, with or without modification,
|
||||||
|
are permitted provided that the following conditions are met:
|
||||||
|
|
||||||
|
1. Redistributions of source code must retain the above copyright notice, this
|
||||||
|
list of conditions and the following disclaimer.
|
||||||
|
|
||||||
|
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||||
|
this list of conditions and the following disclaimer in the documentation and/or
|
||||||
|
other materials provided with the distribution.
|
||||||
|
|
||||||
|
3. Neither the name of the copyright holder nor the names of its contributors
|
||||||
|
may be used to endorse or promote products derived from this software without
|
||||||
|
specific prior written permission.
|
||||||
|
|
||||||
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
|
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||||
|
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||||
|
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||||
|
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||||
|
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||||
|
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||||
|
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
@@ -15,9 +15,6 @@ version-bump.
|
|||||||
- [ ] **Bash completion** — add a `profile.d/completion/` directory and write
|
- [ ] **Bash completion** — add a `profile.d/completion/` directory and write
|
||||||
`_profile_upgrade`, `_taz`, `_utaz`, `_meteo`, etc. completions so that
|
`_profile_upgrade`, `_taz`, `_utaz`, `_meteo`, etc. completions so that
|
||||||
`<Tab>` works on all public functions. **[medium]**
|
`<Tab>` works on all public functions. **[medium]**
|
||||||
- [ ] **`shellcheck` clean pass** — run `shellcheck -x profile.sh profile.d/*.sh`
|
|
||||||
and address every remaining warning (currently a handful of SC2034 and SC2086
|
|
||||||
items). Integrate as a pre-commit hook. **[easy]**
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -70,10 +67,6 @@ version-bump.
|
|||||||
(configurable via `MYEXTIP_FALLBACK_URL`) when the primary times out.
|
(configurable via `MYEXTIP_FALLBACK_URL`) when the primary times out.
|
||||||
**[easy]**
|
**[easy]**
|
||||||
|
|
||||||
### packages
|
|
||||||
- [ ] **Additional backends** — add support for `pacman` (Arch), `apk` (Alpine),
|
|
||||||
`xbps-query` (Void), and `brew` (macOS). **[medium]**
|
|
||||||
|
|
||||||
### processes
|
### processes
|
||||||
- [ ] **`ku` dry-run flag** — add `-n` / `--dry-run` to print what would be
|
- [ ] **`ku` dry-run flag** — add `-n` / `--dry-run` to print what would be
|
||||||
killed without acting. **[easy]**
|
killed without acting. **[easy]**
|
||||||
|
|||||||
@@ -422,7 +422,7 @@ taz()
|
|||||||
disp W "xz format is not suited for long term archiving."
|
disp W "xz format is not suited for long term archiving."
|
||||||
disp I "See https://www.nongnu.org/lzip/xz_inadequate.html for details."
|
disp I "See https://www.nongnu.org/lzip/xz_inadequate.html for details."
|
||||||
|
|
||||||
# Compresse to xz (lzma2) - Deprecated
|
# Compress with xz (lzma2) - Deprecated
|
||||||
xz "${verb[@]}" --compress --keep "-$3" -T "$2" "$1"
|
xz "${verb[@]}" --compress --keep "-$3" -T "$2" "$1"
|
||||||
return $?
|
return $?
|
||||||
}
|
}
|
||||||
@@ -449,7 +449,7 @@ taz()
|
|||||||
[[ $4 ]] && opt=('-vv')
|
[[ $4 ]] && opt=('-vv')
|
||||||
opt+=("$procopt")
|
opt+=("$procopt")
|
||||||
|
|
||||||
# Compresse au format lzip (lzma)
|
# Compress with lzip (lzma)
|
||||||
$command "${opt[@]}" --keep "-$3" "$1"
|
$command "${opt[@]}" --keep "-$3" "$1"
|
||||||
return $?
|
return $?
|
||||||
}
|
}
|
||||||
@@ -503,7 +503,7 @@ taz()
|
|||||||
[[ $4 ]] && opt=('-v')
|
[[ $4 ]] && opt=('-v')
|
||||||
opt+=("$procopt")
|
opt+=("$procopt")
|
||||||
|
|
||||||
# Compresse au format bz2
|
# Compress with bz2
|
||||||
$command "${opt[@]}" --compress --keep "-$3" "$1"
|
$command "${opt[@]}" --compress --keep "-$3" "$1"
|
||||||
return $?
|
return $?
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -447,7 +447,6 @@ file_stats()
|
|||||||
return 1
|
return 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
shift
|
|
||||||
done
|
done
|
||||||
|
|
||||||
[[ -n "$1" ]] && path="$1"
|
[[ -n "$1" ]] && path="$1"
|
||||||
|
|||||||
@@ -34,9 +34,73 @@
|
|||||||
# * OF SUCH DAMAGE.
|
# * OF SUCH DAMAGE.
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
# ------------------------------------------------------------------------------
|
||||||
|
# Detect the active package manager of the current distribution.
|
||||||
|
# Detection is based on /etc/os-release (ID / ID_LIKE), then falls back to
|
||||||
|
# checking available binaries in a fixed priority order.
|
||||||
|
# Echoes one of: apt dnf yum zypper pacman apk portage xbps nix
|
||||||
|
# Returns 1 if no known package manager could be identified.
|
||||||
|
_get_pkgmgr()
|
||||||
|
{
|
||||||
|
local distro_id="" distro_like=""
|
||||||
|
if [[ -r /etc/os-release ]]; then
|
||||||
|
# shellcheck disable=SC1091
|
||||||
|
distro_id=$( . /etc/os-release 2>/dev/null; printf '%s' "${ID:-}" )
|
||||||
|
# shellcheck disable=SC1091
|
||||||
|
distro_like=$( . /etc/os-release 2>/dev/null; printf '%s' "${ID_LIKE:-}" )
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Map distro IDs/families to a package manager.
|
||||||
|
# ID_LIKE is space-separated and may list multiple families.
|
||||||
|
local id
|
||||||
|
for id in $distro_id $distro_like; do
|
||||||
|
case "${id,,}" in
|
||||||
|
debian|ubuntu|linuxmint|raspbian|pop|kali|elementary|zorin|neon|parrot)
|
||||||
|
echo "apt"; return 0 ;;
|
||||||
|
fedora)
|
||||||
|
echo "dnf"; return 0 ;;
|
||||||
|
rhel|centos|rocky|almalinux|ol|scientific|amzn)
|
||||||
|
command -v dnf >/dev/null 2>&1 && { echo "dnf"; return 0; }
|
||||||
|
echo "yum"; return 0 ;;
|
||||||
|
opensuse*|sles|sled)
|
||||||
|
echo "zypper"; return 0 ;;
|
||||||
|
arch|manjaro|endeavouros|garuda|artix|cachyos)
|
||||||
|
echo "pacman"; return 0 ;;
|
||||||
|
alpine)
|
||||||
|
echo "apk"; return 0 ;;
|
||||||
|
gentoo)
|
||||||
|
echo "portage"; return 0 ;;
|
||||||
|
void)
|
||||||
|
echo "xbps"; return 0 ;;
|
||||||
|
nixos)
|
||||||
|
echo "nix"; return 0 ;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
# Fallback: check for binaries in priority order.
|
||||||
|
local bin
|
||||||
|
for bin in apt-get dnf yum zypper pacman apk emerge xbps-install nix-env; do
|
||||||
|
command -v "$bin" >/dev/null 2>&1 && {
|
||||||
|
case "$bin" in
|
||||||
|
apt-get) echo "apt" ;;
|
||||||
|
emerge) echo "portage" ;;
|
||||||
|
xbps-install) echo "xbps" ;;
|
||||||
|
nix-env) echo "nix" ;;
|
||||||
|
*) echo "$bin" ;;
|
||||||
|
esac
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
done
|
||||||
|
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
export -f _get_pkgmgr
|
||||||
|
# ------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
# Look for a package within installed one
|
# Look for a package within installed one
|
||||||
# Usage: dpkgs <string>
|
# Usage: pkgs <string>
|
||||||
pkgs()
|
pkgs()
|
||||||
{
|
{
|
||||||
local ignore_case=${PKGS_DEFAULT_IGNORE_CASE:-0}
|
local ignore_case=${PKGS_DEFAULT_IGNORE_CASE:-0}
|
||||||
@@ -85,13 +149,28 @@ pkgs()
|
|||||||
local grep_opt=""
|
local grep_opt=""
|
||||||
(( ignore_case )) && grep_opt="-i"
|
(( ignore_case )) && grep_opt="-i"
|
||||||
|
|
||||||
command -v dpkg >/dev/null 2>&1 && local cmd="dpkg -l"
|
local pkgmgr
|
||||||
command -v rpm >/dev/null 2>&1 && local cmd="rpm -qa"
|
pkgmgr=$(_get_pkgmgr) || {
|
||||||
if [[ -z $cmd ]]; then
|
disp E "No usable package manager could be detected on this system."
|
||||||
disp E "No usable package manager seems avialable."
|
|
||||||
return 2
|
return 2
|
||||||
fi
|
}
|
||||||
$cmd | grep "$grep_opt" "$pkg"
|
|
||||||
|
local -a list_cmd
|
||||||
|
case "$pkgmgr" in
|
||||||
|
apt) list_cmd=(dpkg-query -l) ;;
|
||||||
|
dnf|yum|zypper) list_cmd=(rpm -qa) ;;
|
||||||
|
pacman) list_cmd=(pacman -Q) ;;
|
||||||
|
apk) list_cmd=(apk list --installed) ;;
|
||||||
|
portage) list_cmd=(qlist -I) ;;
|
||||||
|
xbps) list_cmd=(xbps-query -l) ;;
|
||||||
|
nix) list_cmd=(nix-env -q) ;;
|
||||||
|
*)
|
||||||
|
disp E "Package manager '$pkgmgr' is not supported by pkgs."
|
||||||
|
return 2
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
"${list_cmd[@]}" | grep ${grep_opt:+"$grep_opt"} "$pkg"
|
||||||
}
|
}
|
||||||
export -f pkgs
|
export -f pkgs
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -227,7 +227,7 @@ kt()
|
|||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
if [[ -z "$1" ]]; then
|
if [[ -z "$1" ]]; then
|
||||||
disp E "Usage: ppg <string>"
|
disp E "Usage: kt <pid>"
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -311,13 +311,13 @@ set_prompt()
|
|||||||
# Add exit status of the last command.
|
# Add exit status of the last command.
|
||||||
# If it was successful, print a green check mark. Otherwise, print a red X.
|
# If it was successful, print a green check mark. Otherwise, print a red X.
|
||||||
if [[ $Last_Command == 0 ]]; then
|
if [[ $Last_Command == 0 ]]; then
|
||||||
PS1+="\[${_ok_fg}${_bar_bg}\] [ \$Last_Command "
|
PS1+="\[${_ok_fg}${_bar_bg}\] [ $Last_Command "
|
||||||
PS1+="\[${_ok_mark}${_bar_bg}\]${Checkmark} "
|
PS1+="\[${_ok_mark}${_bar_bg}\]${Checkmark} "
|
||||||
# Add the elapsed time, then close the status section and return to bar bg.
|
# Add the elapsed time, then close the status section and return to bar bg.
|
||||||
timer_stop
|
timer_stop
|
||||||
PS1+="($timer_show)\[${_ok_fg}${_bar_bg}\] ] "
|
PS1+="($timer_show)\[${_ok_fg}${_bar_bg}\] ] "
|
||||||
else
|
else
|
||||||
PS1+="\[${_err_fg}${_err_bg}\] [ \$Last_Command "
|
PS1+="\[${_err_fg}${_err_bg}\] [ $Last_Command "
|
||||||
PS1+="\[${_err_mark}${_err_bg}\]${FancyX} "
|
PS1+="\[${_err_mark}${_err_bg}\]${FancyX} "
|
||||||
timer_stop
|
timer_stop
|
||||||
PS1+="($timer_show)\[${_err_fg}${_err_bg}\] ] "
|
PS1+="($timer_show)\[${_err_fg}${_err_bg}\] ] "
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ Green="\e[0;96m" # teal (ICyan — abyss string colour)
|
|||||||
Yellow="\e[0;93m" # bright gold (IYellow — abyss constant colour)
|
Yellow="\e[0;93m" # bright gold (IYellow — abyss constant colour)
|
||||||
|
|
||||||
PROMPT_COLOR_TIME_FG="$ICyan" # electric teal clock
|
PROMPT_COLOR_TIME_FG="$ICyan" # electric teal clock
|
||||||
PROMPT_COLOR_TIME_BG="\e[48;2;15;20;40m" # near-black midnight bg for time
|
PROMPT_COLOR_TIME_BG="\e[48;2;0;60;70m" # very dark cyan bg for time
|
||||||
PROMPT_COLOR_BAR_BG="\e[48;2;0;30;70m" # deep navy bar (24-bit)
|
PROMPT_COLOR_BAR_BG="\e[48;2;0;30;70m" # deep navy bar (24-bit)
|
||||||
|
|
||||||
PROMPT_COLOR_OK_FG="$ICyan" # teal on success
|
PROMPT_COLOR_OK_FG="$ICyan" # teal on success
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
# shift to their dark/regular equivalents for contrast on a light terminal.
|
# shift to their dark/regular equivalents for contrast on a light terminal.
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
|
|
||||||
PROMPT_COLOR_TIME_FG="$Black" # Clock text (black on light bg — maximum contrast)
|
PROMPT_COLOR_TIME_FG="$BBlack" # Clock text (bold black — forces true black on terminals that render Black as dark grey)
|
||||||
PROMPT_COLOR_TIME_BG="$On_IWhite" # Clock background (On_Black → On_IWhite)
|
PROMPT_COLOR_TIME_BG="$On_IWhite" # Clock background (On_Black → On_IWhite)
|
||||||
PROMPT_COLOR_BAR_BG="$On_White" # Main bar background (On_IBlack → On_White)
|
PROMPT_COLOR_BAR_BG="$On_White" # Main bar background (On_IBlack → On_White)
|
||||||
|
|
||||||
|
|||||||
@@ -26,8 +26,8 @@ Blue="\e[0;94m" # electric blue (IBlue)
|
|||||||
Purple="\e[0;95m" # vivid magenta (IPurple — Plasma's signature colour)
|
Purple="\e[0;95m" # vivid magenta (IPurple — Plasma's signature colour)
|
||||||
Cyan="\e[0;96m" # electric cyan (ICyan)
|
Cyan="\e[0;96m" # electric cyan (ICyan)
|
||||||
|
|
||||||
PROMPT_COLOR_TIME_FG="$IPurple" # vivid purple clock text
|
PROMPT_COLOR_TIME_FG="$BIPurple" # vivid purple clock text
|
||||||
PROMPT_COLOR_TIME_BG="$On_IBlack" # dark grey background
|
PROMPT_COLOR_TIME_BG="\e[48;2;50;50;55m" # deep charcoal (darker than On_IBlack)
|
||||||
PROMPT_COLOR_BAR_BG="\e[48;2;75;0;130m" # deep indigo-purple (24-bit) — darker than On_Purple
|
PROMPT_COLOR_BAR_BG="\e[48;2;75;0;130m" # deep indigo-purple (24-bit) — darker than On_Purple
|
||||||
|
|
||||||
PROMPT_COLOR_OK_FG="$ICyan" # electric cyan on success
|
PROMPT_COLOR_OK_FG="$ICyan" # electric cyan on success
|
||||||
|
|||||||
@@ -183,7 +183,8 @@ load_conf()
|
|||||||
{
|
{
|
||||||
local section_name="CONF_$1"
|
local section_name="CONF_$1"
|
||||||
|
|
||||||
[[ "$(declare -p "$section_name" 2>/dev/null)" != "declare -A"* ]] && return 1
|
# Missing section is not an error: modules can rely on built-in defaults.
|
||||||
|
[[ "$(declare -p "$section_name" 2>/dev/null)" != "declare -A"* ]] && return 0
|
||||||
|
|
||||||
local -n current_vars="$section_name"
|
local -n current_vars="$section_name"
|
||||||
|
|
||||||
@@ -215,12 +216,12 @@ if [[ ! -e "$MYPATH/profile.sh" ]]; then
|
|||||||
echo "[ Warning ] Path detection failed, trying to use pwd..."
|
echo "[ Warning ] Path detection failed, trying to use pwd..."
|
||||||
MYPATH=$(pwd)
|
MYPATH=$(pwd)
|
||||||
if [[ ! -e "$MYPATH/profile.sh" ]]; then
|
if [[ ! -e "$MYPATH/profile.sh" ]]; then
|
||||||
echo "[ Error ] Impossible to determine installation path, pretty much nothing will work."
|
echo "[ Error ] Unable to determine installation path, pretty much nothing will work."
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ ! -s "$MYPATH/version" ]]; then
|
if [[ ! -s "$MYPATH/version" ]]; then
|
||||||
echo "[ Warning ] Impossible to determine running version of profile, your installation might be broken."
|
echo "[ Warning ] Unable to determine running profile version; your installation might be broken."
|
||||||
fi
|
fi
|
||||||
PROFVERSION=$(cat "$MYPATH"/version)
|
PROFVERSION=$(cat "$MYPATH"/version)
|
||||||
export PROFVERSION
|
export PROFVERSION
|
||||||
@@ -276,7 +277,7 @@ if [[ $INTERACTIVE ]]; then
|
|||||||
fi
|
fi
|
||||||
showinfo && printf "\n"
|
showinfo && printf "\n"
|
||||||
check_updates -q
|
check_updates -q
|
||||||
disp I "Profile version $PROFVERSION chargé..."
|
disp I "Profile version $PROFVERSION loaded..."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Cleanup
|
# Cleanup
|
||||||
|
|||||||
Reference in New Issue
Block a user