Last active
November 19, 2024 11:27
-
-
Save cbrunnkvist/98d9e95dc0136ba03797b561db4fddc0 to your computer and use it in GitHub Desktop.
Neofetch: Current IPv4 details (macOS)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ~/.config/neofetch/config.conf | |
# (snippet - not including the default full file here) | |
# This goes inside the ... | |
# print_info() { | |
# I place this just below the "Memory" section, but... Up 2 U! | |
prin | |
prin "en0 $(tput sgr0)IPv4 status" | |
info underline | |
# I prefer to use "ifdata" from the "moreutils" package in favor of the native "ipconfig". Up 2 U! | |
# ipconfig getpacket en0 | grep yiaddr | cut -f2 -d= | |
prin "Address" "$(tput setaf 212)$(ifdata -pa en0)$(tput sgr0)" | |
# ipconfig getpacket en0 | grep subnet | cut -f2 -d: | |
prin "Netmask" "$(tput setaf 179)$(ifdata -pn en0)$(tput sgr0)" | |
# ipconfig getpacket en0 | grep router | cut -f2 -d: | |
prin "Router" " $(tput setaf 29) $(ipconfig getoption en0 router)" | |
# ... | |
# } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment