Skip to content

added Root Usage and Filesystem info#465

Open
DmitryHetman wants to merge 8 commits intoKittyKatt:masterfrom
DmitryHetman:master
Open

added Root Usage and Filesystem info#465
DmitryHetman wants to merge 8 commits intoKittyKatt:masterfrom
DmitryHetman:master

Conversation

@DmitryHetman
Copy link
Copy Markdown
Contributor

Added Root usage function.
wayland-screenshot

Comment thread screenfetch-dev Outdated

# Root Usage Detection - Begin
detectrootusage(){
root=$(df -hT -xdevtmpfs -xtmpfs|sed -n 2p|awk '{print $4 "/" $3 " " $2}')
Copy link
Copy Markdown

@tedwardd tedwardd Apr 13, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The arguments for df used here are specific to GNU df and causes errors on systems that use BSD df (OS X). Should either wrap the usage of detectrootusage inside a conditional that checks that the version of df being used is part of GNU coreutils or provide a check for this inside of the detectrootusage function and provide an alternative for systems using BSD df.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which options exactly?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-xdevtmpfs -xtmpfs removed

@DmitryHetman
Copy link
Copy Markdown
Contributor Author

It's no longer GNU-specific, merge/

@tedwardd
Copy link
Copy Markdown

@DmitryHetman The -T flag means something different in BSD df. Might I recommend running either your original df command or the one below based on the value of $distro as defined here on line 895

df -h|sed -n 2p|awk '{print $3 "/" $2}'

@DmitryHetman
Copy link
Copy Markdown
Contributor Author

No! It measns add type!

@DmitryHetman
Copy link
Copy Markdown
Contributor Author

@tedwardd
Copy link
Copy Markdown

It looks like the FreeBSD version of BSD df is different than the one for Mac's version of BSD df: https://developer.apple.com/legacy/library/documentation/Darwin/Reference/ManPages/man1/df.1.html

@DmitryHetman
Copy link
Copy Markdown
Contributor Author

What return code of df -T on your system?

@DmitryHetman
Copy link
Copy Markdown
Contributor Author

It's ready.

@DmitryHetman
Copy link
Copy Markdown
Contributor Author

merge please

@konfou
Copy link
Copy Markdown
Contributor

konfou commented May 21, 2017

@k4k could complete detectroot() to provide filesystem info on macOS, but otherwise this should work on systems having POSIX df.

@KittyKatt
Copy link
Copy Markdown
Owner

This has some conflicts, let me look it over and get back to you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants