29 lines
880 B
Plaintext
29 lines
880 B
Plaintext
--- usr/lib/byobu/disk.orig 2020-02-09 16:40:29 UTC
|
|
+++ usr/lib/byobu/disk
|
|
@@ -20,7 +20,11 @@
|
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
__disk_detail() {
|
|
- df -h -P
|
|
+ if [ $(uname) = "FreeBSD" ]; then
|
|
+ df -h
|
|
+ else
|
|
+ df -h -P
|
|
+ fi
|
|
}
|
|
|
|
__disk() {
|
|
@@ -32,7 +36,11 @@ __disk() {
|
|
esac
|
|
# this could be done faster with 'stat --file-system --format'
|
|
# but then we'd have to do blocks -> human units ourselves
|
|
- out=$({ df -h -P "$MP" 2>/dev/null || df -h "$MP"; } | awk 'END { printf("%s %s", $2, $5); }')
|
|
+ if [ $(uname) = "FreeBSD" ]; then
|
|
+ out=$({ df -h "$MP" 2>/dev/null || df -h "$MP"; } | awk 'END { printf("%s %s", $2, $5); }')
|
|
+ else
|
|
+ out=$({ df -h -P "$MP" 2>/dev/null || df -h "$MP"; } | awk 'END { printf("%s %s", $2, $5); }')
|
|
+ fi
|
|
set -- ${out}
|
|
size=${1}; pct=${2};
|
|
unit=${size#${size%?}} # get the unit (last char)
|