Commit Graph

71 Commits

Author SHA1 Message Date
phundrak 0a8a340260 Add OS name detection for BSD OSes, memory improvements for UNIX
Simpler function for UNIX systems, including macOS.

Bump to 0.6
2021-11-07 00:08:01 +01:00
phundrak 41222b5f89 Add error handling in case of an unknown OS, warn instead of message
Warn the user if something goes wrong instead of just a message in the
minibuffer and the *Message* buffer.
2021-11-06 23:09:54 +01:00
phundrak 27ae353336 Add installation method in the README 2021-07-13 17:57:09 +02:00
phundrak cebb21818e Add macOS versions and fallback value, close #11 2021-07-09 19:22:52 +02:00
phundrak 718663f50d Better memory display 2021-06-18 19:29:06 +02:00
phundrak d35516a354 Better Windows support for partition detection with duf 2021-06-18 19:26:16 +02:00
phundrak 1635241762 Add new partitions detection method through duf
eshell-info-banner will now default to duf if it is installed and
avaliable on the system, otherwise it will default to
platform-specific implementation.
2021-06-18 18:38:11 +02:00
phundrak 6a043f6c19 Add versions custom variables were introduced in, minor fixes
All custom variables now have the package version in which they were
introduced specified.

This commit fixes a small typo in the documentation of
`eshell-info-banner--abbr-path'

Remove a leftover line used for debugging
2021-06-18 18:11:02 +02:00
phundrak e3461e6f99 README update, add CONTRIBUTING
Remove upcoming changes since nothing backward-incompatible is
upcoming, and OS and Linux distro support is already specified in
pinned issue.
2021-05-23 02:15:12 +02:00
phundrak 8b72edda09 Upgrade Emacs minimum version required
seq.el became part of Emacs with Emacs 25.1 and is used in the code,
hence the upgrade
2021-05-23 00:32:18 +02:00
phundrak 913120fae5 Rename function, and set locale for `vm_stat' 2021-05-23 00:07:00 +02:00
phundrak 46ada1b264 Add RAM detection support for macOS 2021-05-22 23:48:36 +02:00
phundrak 508c6883fe Bump revision version, fix newline display after memory
If memory usage is not displayed, a newline was still inserted. This
commit fixes this.
2021-05-22 04:30:34 +02:00
phundrak 3934c4e472 Add partition detection to macOS and OSX 2021-05-22 04:26:33 +02:00
phundrak 2a6f8bea29 Manage one more case of -p' not accepted as uptime' switch 2021-05-22 04:15:27 +02:00
phundrak 0f39c31884 Add partial support for Mac, Guix, improve Windows OS detection
This commit adds detection of the current OSX or macOS version.

It also adds support for non-standard Guix SD Linux distribution.

Windows OS detection is improved, with a separation of the name of the
version of Windows and its build number, the latter is treated as the
kernel version of Windows.
2021-05-22 03:59:08 +02:00
phundrak f5b5ebccc7 Preliminary rewrite of OS detection 2021-05-22 01:29:12 +02:00
phundrak e78aaa41f9 Handle case where battery is incorrectly detected
On my Windows VM, `battery' reported a battery as present but with a
charge of `N/A' percents. This commit handle this case as no battery
present.
2021-05-22 01:25:42 +02:00
phundrak be0c8859d6 Simpler way of getting the kernel name 2021-05-22 00:31:11 +02:00
phundrak 964d4bfe4c Make uptime detection more portable 2021-05-22 00:20:46 +02:00
phundrak 84294cb12c Code formatting, version revision bump
Making shorter lines
2021-05-22 00:20:35 +02:00
Juergen Hoetzel 285fd95b8b Fix void-variable error: partitions 2021-05-21 21:13:35 +02:00
phundrak e9136b77cd Better regex for battery level detection
Detect the battery level, whether or not it is followed by decimals
2021-05-21 21:12:27 +02:00
phundrak 763d459a9e Make eshell-info-banner more portable
Memory detection and partition detection now relies of the operating
system detection of Emacs to know whether it can run or not. Also,
this is cleaning up a lot the function `eshell-info-banner', and I
think I will continue cleaning it up even more in the future.
2021-05-17 17:58:37 +02:00
phundrak a3e6aebac3 Reorganize comments, add page breaks, swap from variable to function
Old one-line comments that used to separate parts of the file are now
on three lines, while one-line comments are a sort of subsection of
these new big sections.

Page breaks will make it easier to navigate the code source.

Variable `system-name' is obsolete and is replaced by a function with
the same name.
2021-05-17 17:42:44 +02:00
phundrak 1b06956235 Mark custom variables with :safe option 2021-05-17 17:14:43 +02:00
phundrak 6463265938 Merge branch 'main' of github.com:Phundrak/eshell-info-banner.el 2021-05-15 21:04:37 +02:00
phundrak 6ea9c74a4e Remove paragraph on upcoming changes already made 2021-05-15 21:03:23 +02:00
phundrak 7ddb41ed3e Merge pull request #8 from juergenhoetzel/leverage-reduce
Leverage -reduce-from function
2021-05-15 21:00:25 +02:00
phundrak e3b230f881 Bump version 2021-05-15 20:56:47 +02:00
phundrak 94ebf5b5cc README formatting fix 2021-05-15 20:40:55 +02:00
phundrak e7092c5846 Customize which partitions to show, close #9
New variable `eshell-info-banner-partition-prefixes' now allows for
finer filtering of user partitions.
2021-05-15 20:35:22 +02:00
phundrak 624256442f Fix documentation formatting 2021-05-15 20:34:17 +02:00
Juergen Hoetzel 468167e356 Leverage -reduce-from function
Use the high order function -reduce-from instead of reimplementing a
specialiced reduce function to go get the longest path length.
2021-05-15 14:29:43 +02:00
phundrak 999f170337 README update
Update information on OS support

Add information on new custom variable
2021-05-14 10:33:07 +02:00
phundrak c2c7093c58 Merge pull request #7 from juergenhoetzel/tramp
Use tramp aware functions and paths
2021-05-14 10:24:57 +02:00
Juergen Hoetzel 8ea35d0d20 Use tramp aware functions and paths
Add new custom variable eshell-info-banner-tramp-aware to configure
tramp awareness.

Fixes invalid (localhost) infos for hostname and os-relase when using
Eshell on remote hosts.
2021-05-08 13:41:41 +02:00
phundrak 6217784057 Merge pull request #6 from bkaestner/main
Add Windows version detection
2021-05-07 15:19:06 +02:00
Benjamin Kästner e6a0dabe9a os: Add Windows detection
The Windows registry key "CurrentVersion" contains both "ProductName"
as well as "BuildLab" to identify the currently running Windows
variant.

As all returned `reg` lines are either values

   name REG_<TYPE> value

or the list of subkeys, we can just use a regular expression to filter
the values from the input.

For a more generic variant, see Ashraz code on the Discord.

See also #4 for more progress on all OS detections.
2021-05-02 21:32:23 +02:00
phundrak 5841c7f711 Remove leftover from debugging 2021-05-02 18:15:09 +02:00
phundrak bb7cf0eab4 Merge pull request #5 from juergenhoetzel/locale
Use C locale for external processes to prevent parsing issues
2021-05-02 18:14:17 +02:00
phundrak b5f6d66578 Add gitignore 2021-05-02 17:59:32 +02:00
phundrak 2ed6b68d1a Bump version, add Github link 2021-05-02 17:57:35 +02:00
Juergen Hoetzel 08f16efde7 Use C locale for external processes to prevent parsing issues 2021-05-02 16:28:22 +02:00
phundrak 3ebb3a65fe Merge pull request #2 from bkaestner/main
Use alternatives for /etc/os-release
2021-05-02 14:02:01 +02:00
Benjamin Kästner 3ac03293a9 os: Remove fall-back on function argument
As `release-file` is used only once in the function, we don't need to
set its default value via `setq' if it is `nil`.
2021-05-01 23:46:56 +02:00
Benjamin Kästner c432776b95 os: Check for programs/files instead of ignoring errors 2021-05-01 17:48:15 +02:00
phundrak 1c3c31ace7 Merge pull request #3 from juergenhoetzel/undefine-funtions
Replace undefined functions length= and length> with Emacs builtins
2021-05-01 15:34:46 +02:00
Juergen Hoetzel 1fdf0b0c0a Replace undefined functions length= and length> with Emacs builtins 2021-05-01 14:04:53 +02:00
Benjamin Kästner 9ccd234a3d os: search in temporary buffer instead of string
Instead of filtering all lines for `PRETTY_LINE` and then replace the
line with only the quoted contents, `re-serach-forward` (or -backward)
provide a `match-*` interface. That way we can work solely inside the
buffer and return only the matching string part.
2021-05-01 12:47:29 +02:00