merge master

This commit is contained in:
Dylan Araps 2016-10-19 20:54:30 +11:00
commit 0e87355eb0
13 changed files with 595 additions and 383 deletions

View file

@ -14,16 +14,8 @@ suggesting a new feature then just a description will suffice.
## Verbose log ## Verbose log
**Neofetch 1.6** 1. Run `neofetch -vv 2> neofetchlog`
2. Upload the contents of `neofetchlog` to pastebin, gist or equivalent.
1. Add `set -x` to a new line near the top of the script.
2. Run `neofetch 2> neofetchlog`
3. Upload the contents of `neofetchlog` to pastebin, gist or equivalent.
**Neofetch 1.7**
2. Run `neofetch -vv 2> neofetchlog`
3. Upload the contents of `neofetchlog` to pastebin, gist or equivalent.

View file

@ -10,5 +10,6 @@ before_install:
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install screenresolution; fi - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install screenresolution; fi
script: script:
- sudo make install - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then PREFIX=/usr/local make install ; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo make install ; fi
- time neofetch --ascii --config off --ascii_distro travis -v --test - time neofetch --ascii --config off --ascii_distro travis -v --test

163
1.8.md
View file

@ -1,163 +0,0 @@
# Neofetch 1.8
### Contributers
- **[@hashhar](https://github.com/hashhar)**
- **[@williamkray](https://github.com/williamkray)**
- **[@dar-irl](https://github.com/dar-irl)**
- **[@gabe565](https://github.com/gabe565)**
- **[@maddcoder](https://github.com/maddcoder)**
- **[@iandrewt](https://github.com/iandrewt)**
- **[@aranega](https://github.com/aranega)**
- **[@vendion](https://github.com/vendion)**
- **[@konimex](https://github.com/konimex)**
### General
- Moved all whitespace trimming to a dedicated function.
- Neofetch will no longer have any whitespace issues in the output.
- See [trim()](https://github.com/dylanaraps/neofetch/commit/d3c87cdaacf1ea9fbf245146c910dc53b49dba08#diff-e863270127ca6116fd30e708cdc582fcR2789)
- Only call `tput` when we really need to.
- Supress `getconfig` and `getscriptdir` errors.
- Removed `stdout` mode since it's been broken for a while now and I don't see the<br\>
point in fixing it.
- Fix issue when title and background were both color `7`.
- Added `--version` to print the neofetch version.
- The title at the top is now much more colorful.
- Supress `xprop` errors since it's now an optional dependency.
- Fix lint errors.
- Remove all instances of `! -z` since they're pointless.
- Quote all variable/command substitutions.
- Remove all `bc` usage by simplifying math.
- The prompt is now dynamically set in image mode instead of being anchored to the<br \>
bottom of the window. See [#279](https://github.com/dylanaraps/neofetch/pull/279) and [#299](https://github.com/dylanaraps/neofetch/pull/299) for examples.
- Removed `line_wrap` as having it set to `on` broke the output.
- Minor text fixes.
- Fix issue with incorrect text color when `barinfo` is set.
- Fixed various Travis.ci bugs.
- `-v` now shows where the config files were sourced from.
- Removed in-script config in favor of sourcing the default user config.
- Moved commands near the bottom of the script to a new function called `main`.
- Use `read -s` instead of `stty -echo` and `stty +echo`.
- Cleanup
### OS
- Added support for Devuan Linux.
- Added support for GalliumOS.
- Added support for Openwrt.
- Added support for PacBSD. **[@vendion](https://github.com/vendion)**
- Added support for Rosa.
- Added support for Solaris (Oracle / OpenIndiana). **[@konimex](https://github.com/konimex)**
- Added support for macOS Sierra. **[@iandrewt](https://github.com/iandrewt)**
- Fixed various iOS related issues.
### Packages
- Added Cydia package for iOS.
- See https://github.com/dylanaraps/neofetch#ios-1
### Terminal and Terminal Font
![img](https://ipfs.pics/ipfs/QmR39ScLi56Yt73pA3YWri9ayatN6mpwSTEmM8RVdeRsB1)
- Added `term` function to display current terminal emulator. \[1\]
- Added `termfont` function to display current terminal font. \[2\]
\[1\] Both of these functions are enabled by default.<br \>
\[2\] See this wiki page for more info about the functions: [Link](https://github.com/dylanaraps/neofetch/wiki/Terminal-and-Terminal-Font-detection)
### Info
- Use faster `$(())` syntax for index variables.
**Model**<br \>
- Added `model` a new function which displays your device's product vendor/name.
![Mode](https://ipfs.pics/ipfs/Qmcy2o5xZCELxroNLHAhY96ZsrwBFR86NGDCu5e2UPVn4b)
**Title**<br \>
- Added additional fallback which gets the current username from `$HOME`.
**Color Blocks**<br \>
- Added `--block_height` / `$block_height` to change the number of lines high each<br \>
block will be.
![Big Blocks](https://ipfs.pics/ipfs/QmZpR8ukZNfGXkhXjTwAy3eWVRCeHdrurhgAdV5CSiTVvR)
**Resolution**<br \>
- [Windows] Fix resolution on Windows 10. **[@dar-irl](https://github.com/dar-irl)**
- [Mac OS X] Hide refresh rate if `0`. **[@iandrewt](https://github.com/iandrewt)**
- Fixed `xrandr` output on systems not using gawk.
- [Linux / BSD] Shortened refresh rate output.
**Shell**<br \>
- Show `fish` shell version. **[@maddcoder](https://github.com/maddcoder)**
**Song**<br \>
- [Cmus] Prevent `tag artistsort` from showing up in song title. **[@williamkray](https://github.com/williamkray)**
- [Cmus] Fix order of music tags. **[@iandrewt](https://github.com/iandrewt)**
- [Cmus] The function now works on both OS X and Linux.
- [iTunes] Fix song not displaying. **[@iandrewt](https://github.com/iandrewt)**
**CPU**<br \>
- Simplify CPU Core command.
**CPU Usage**<br \>
- Fixed broken CPU usage output on BSD and Windows.
- Fixed misleading output on Linux / Mac OS X.
- Moved CPU Usage to its own dedicated function.
### Image
![terminology](https://ipfs.pics/ipfs/QmbVEUREBg4hMG22WrQ2bkt2sZZzyTEP5EEXmHRw7MHD6A)
- Added image support for terminology with `tycat`. **[@aranega](https://github.com/aranega)** \[1\]
- Fixed issues with lines getting drawn through images. See [#296](https://github.com/dylanaraps/neofetch/pull/296)
- Added `--crop_mode none` / `crop_mode=none` to disable cropping the images.
- Added `--size none` / `size=none` to disable resizing / cropping the images.
- Removed `image_position`
- `--image off` now behaves like the other image modes.
\[1\] `tycat` is a terminology builtin that works similarly to w3m-img. Those using terminology<br \>
now have working image support.
##### Shuffle mode
- Fixed directory going out of bounds causing a fallback to ascii mode. **[@gabe565](https://github.com/gabe565)**
- Simplified shuffle function.
- Path no longer requires a `/` at the end. **[@aranega](https://github.com/aranega)**
### Ascii
- Add `ascii_bold` which allows you to bold the ascii art.
- Custom ascii files (`--ascii path/to/ascii_file`) now follow the same format as the<br\>
distro ascii files. See this wiki page that explains the syntax. [Link](https://github.com/dylanaraps/neofetch/wiki/Custom-Ascii-art-file-format)
- Better `Ubuntu-GNOME` ascii art. **[@hashhar](https://github.com/hashhar)**
- Fix a color issue with Debian's ascii logo.
- Added `--ascii_distro mac` as a shorter way of using the OS X ascii.
- Added missing `$ascii_distro` config option.
- Use a pure bash solution to getting ascii size.

103
Changelog.md Normal file
View file

@ -0,0 +1,103 @@
## Contributors
- **[@konimex](https://github.com/konimex)**
- **[@iandrewt](https://github.com/iandrewt)**
- **[@coypoop](https://github.com/coypoop)**
<br \>
## General
- Added new function called `checkoldflags` which informs users about deprecated config options.
- Change all `OS X` references to `macOS`. **[@iandrewt](https://github.com/iandrewt)**
- Fix corrupted text when long lines are cut-off.
## Operating System
- Added support for Bitrig. **[@konimex](https://github.com/konimex)**
- Added support for Sparky Linux.
## Packages
- Neofetch is now in Gentoo's official repos.
## Images
**Fixed rendering issues in URxvt when using an XFT font.**
![scrot](https://i.sli.mg/6qp9Cg.png)
This was first thought to be an issue between URxvt and W3m-img and I apologize for immediately closing bug reports and dismissing comments about this.
I spent yesterday trying to fix this issue and found out that launching neofetch with `--bold off`
reduced the rendering problems. I did more digging and found out that removing all text formatting fixes the issue entirely. I later found out that adding a single unformatted character before the formatted text fixed the issue while keeping the formatting the same.
I opened up this PR https://github.com/dylanaraps/neofetch/pull/358 which added options to enable a border between the image and the text to fix the issue. **[@konimex](https://github.com/konimex)** later commented informing me that we could just use a `zero-width space` to fix the issue and that we didn't need a new function/args/ugly border. doh
The final fix was as simple as adding a zero-width space before the info, here's the commit.
https://github.com/dylanaraps/neofetch/commit/3e9c3d648cb4c6f0d5fe5f0b96f9e29429af39d9
## Ascii
- Bold ascii art by default.
- Fixed incorrect prompt location when using `ascii_logo_size small`.
## Info
**Distro**<br \>
- Expanded `distro_shorthand` to macOS and Solaris. **[@konimex](https://github.com/konimex)**
- Removed `osx_buildversion` and `osx_codename` in favour of `distro_shorthand`. **[@konimex](https://github.com/konimex)**
**Window Manager**<br \>
- [Windows] Added support for custom WMs/Shells.
- Neofetch now detects `blackbox`, `bugn`, `Windawesome`, `emerge` and `litestep`.
- Uppercase first letter of `wm` output.
**Window Manager Theme**<br \>
- [Windows] Added support for Blackbox themes.
**CPU**<br \>
- [macOS] Print physical cores instead of hyper-threaded cores. **[@iandrewt](https://github.com/iandrewt)**
**Resolution**<br \>
- [macOS] Add @2x label for retina resolutions. **[@iandrewt](https://github.com/iandrewt)**
**Memory**<br \>
- [NetBSD] Fix memory output for sizes over 4GB. **[@coypoop](https://github.com/coypoop)**
**Shell**<br \>
- Hide shell path by default.
- Show shell version by default.
**Theme Font**<br \>
- [XFCE] Fixed incorrect font output.
**Color Blocks**<br \>
- Fixed `block_width` not working.
- Fixed `% s` appearing in color blocks when neofetch is run from `tty`
- Fixed `block_width` being off by one. A value of `2` made the blocks `3` wide instead of `2` wide.
- Show 16 colors by default instead of 8.
**Terminal and Terminal Font**<br \>
- Uppercase first letter of `term` and `termfont` outputs.
- Remove path from output.
**Song**<br \>
- [macOS] Fix iTunes automatically opening. **[@iandrewt](https://github.com/iandrewt)**

View file

@ -29,8 +29,9 @@ Have a look at the wiki, I've updated/added some new pages!<br \>
- [Fedora / RHEL / CentOS](#fedora--rhel--centos) - [Fedora / RHEL / CentOS](#fedora--rhel--centos)
- [Void Linux](#void-linux) - [Void Linux](#void-linux)
- [BunsenLabs](#bunsenlabs) - [BunsenLabs](#bunsenlabs)
- [Solus](#solus)
- [Slackware](#slackware) - [Slackware](#slackware)
- [Mac OS X](#mac-os-x) - [macOS](#mac-os-x)
- [iOS](#ios-1) - [iOS](#ios-1)
- [Others](#others) - [Others](#others)
- [Post Install](#post-install) - [Post Install](#post-install)
@ -50,7 +51,7 @@ Have a look at the wiki, I've updated/added some new pages!<br \>
![Linux](https://ipfs.pics/ipfs/QmRRYwcSRz1FHNx8VQiBixZq3qvBNk487fKGwUNTs7GQjA) ![Linux](https://ipfs.pics/ipfs/QmRRYwcSRz1FHNx8VQiBixZq3qvBNk487fKGwUNTs7GQjA)
![Windows](https://ipfs.pics/ipfs/Qmf5GpmqnMRhEzC1qoQ2tM4699tEXLManZTs5pz4mWJbCg) ![Windows](https://ipfs.pics/ipfs/Qmf5GpmqnMRhEzC1qoQ2tM4699tEXLManZTs5pz4mWJbCg)
![Mac OS X](https://ipfs.pics/ipfs/QmWA8XX6pFkEuLLcrq5JZBx1KFEUaXanTy1jMxzKVRpwaT) ![macOS](https://ipfs.pics/ipfs/QmWA8XX6pFkEuLLcrq5JZBx1KFEUaXanTy1jMxzKVRpwaT)
![bsd](https://ipfs.pics/ipfs/QmSpyCGzSgYnyfbMetKqxy9cU3UFbneS3G8JrbdxkiNLgm) ![bsd](https://ipfs.pics/ipfs/QmSpyCGzSgYnyfbMetKqxy9cU3UFbneS3G8JrbdxkiNLgm)
![bsd](https://ipfs.pics/ipfs/QmeZhs3CwGtM8CSVoorA2d2CqLxRzbJkdD7aYxa4Dixsea) ![bsd](https://ipfs.pics/ipfs/QmeZhs3CwGtM8CSVoorA2d2CqLxRzbJkdD7aYxa4Dixsea)
@ -63,7 +64,7 @@ Have a look at the wiki, I've updated/added some new pages!<br \>
## Features ## Features
- Supports **Linux**, **Mac OS X**, **iOS**, **BSD**, **Solaris** and **Windows** (Cygwin) - Supports **Linux**, **macOS**, **iOS**, **BSD**, **Solaris** and **Windows** (Cygwin/Windows 10 Linux subsystem)
- Display a **full color image**, a file containing **ascii art** or your **distro's logo** in ascii next to the info. - Display a **full color image**, a file containing **ascii art** or your **distro's logo** in ascii next to the info.
- The script is **fast**. We use bash builtins wherever possible and only spawn external processes when necessary. - The script is **fast**. We use bash builtins wherever possible and only spawn external processes when necessary.
- Take a screenshot of your desktop on script finish. - Take a screenshot of your desktop on script finish.
@ -105,7 +106,7 @@ Note: The cydia package installs these dependencies for you.
- Thumbnail creation: `imagemagick` - Thumbnail creation: `imagemagick`
- Displaying song information from Google Play Music Desktop Player: [`gpmdp-remote`](https://github.com/iAndrewT/gpmdp-remote) - Displaying song information from Google Play Music Desktop Player: [`gpmdp-remote`](https://github.com/iAndrewT/gpmdp-remote)
##### Linux / BSD ##### Linux / BSD / Solaris
- Wallpaper: `feh`, `nitrogen` or `gsettings` - Wallpaper: `feh`, `nitrogen` or `gsettings`
- Current Song: `mpc`, `cmus`, `moc`, `spotify`, `gpmdc` - Current Song: `mpc`, `cmus`, `moc`, `spotify`, `gpmdc`
@ -116,7 +117,7 @@ Note: The cydia package installs these dependencies for you.
- Resolution (quicker): `screenresolution` - Resolution (quicker): `screenresolution`
##### BSD ##### BSD / Solaris
- GPU: `glxinfo` - GPU: `glxinfo`
- Not required on FreeBSD. - Not required on FreeBSD.
@ -163,8 +164,9 @@ https://github.com/dylanaraps/neofetch/wiki/Following-HEAD
- [Fedora / RHEL / CentOS](#fedora--rhel--centos) - [Fedora / RHEL / CentOS](#fedora--rhel--centos)
- [Void Linux](#void-linux) - [Void Linux](#void-linux)
- [BunsenLabs](#bunsenlabs) - [BunsenLabs](#bunsenlabs)
- [Solus](#solus)
- [Slackware](#slackware) - [Slackware](#slackware)
- [Mac OS X](#mac-os-x) - [macOS](#mac-os-x)
- [iOS](##ios-1) - [iOS](##ios-1)
- [Others](#others) - [Others](#others)
@ -176,35 +178,27 @@ https://github.com/dylanaraps/neofetch/wiki/Following-HEAD
### Gentoo / Funtoo ### Gentoo / Funtoo
1. Add the 3rd party repo You can install `app-misc/neofetch` from Gentoo/Funtoo's official repositories.
- `# wget -O /etc/portage/repos.conf/konimex.conf https://git.io/vocNV`
2. Sync the repo
- `# emerge --sync konimex`
3. To enable additional features such as w3m and music support, enable the appropriate USE flags. For example:
- `# echo "app-misc/neofetch X -moc" >> /etc/portage/package.use`
4. Install the package
- `# emerge -a app-misc/neofetch`
To install the git version, just add `app-misc/neofetch ~<your architecture>` to `package.accept_keywords`
To install the git version of neofetch, use `=app-misc/neofetch-9999` instead.
### CRUX ### CRUX
1. Install git and the git ports(8) driver 1. Install git and the git ports(8) driver
- `sudo prt-get depinst git` - `sudo prt-get depinst git`
2. Add the 3rd party repo 2. Add the `6c36-git` repository
- `sudo wget -O /etc/ports/tudurom.git https://git.io/vV46y` - `sudo wget -O /etc/ports/6c37-git.git "https://raw.githubusercontent.com/6c37/cross/master/git-driver/6c37-git.git"`
3. Sync the repos 3. Sync the repos
- `sudo ports -u` - `sudo ports -u`
4. Add the repo to /etc/prt-get.conf with your text editor of choice 4. Add the repo to /etc/prt-get.conf with your text editor of choice
- `prtdir /usr/ports/tudurom` - `prtdir /usr/ports/6c37-git`
5. Install the package 5. Install the package
- `sudo prt-get depinst neofetch` - `sudo prt-get depinst neofetch`
Or alternatively use the [port](https://github.com/tudurom/crux-ports/blob/master/neofetch/Pkgfile): Or alternatively use the [port](https://raw.githubusercontent.com/6c37/crux-ports-git/3.2/neofetch/Pkgfile):
1. Download port 1. Download port
- `wget -O ~/work/neofetch/Pkgfile https://raw.githubusercontent.com/tudurom/crux-ports/master/neofetch/Pkgfile` - `wget -O ~/work/neofetch/Pkgfile "https://raw.githubusercontent.com/6c37/crux-ports-git/3.2/neofetch/Pkgfile"`
2. Build the package 2. Build the package
- `fakeroot pkgmk -d` - `fakeroot pkgmk -d`
3. Install the package 3. Install the package
@ -261,11 +255,15 @@ Neofetch is available in the official repos.
1. `sudo apt-get update` 1. `sudo apt-get update`
2. `sudo apt-get install neofetch` 2. `sudo apt-get install neofetch`
### Solus
Use the Software Center or type `sudo eopkg it neofetch`.
### Slackware ### Slackware
Download the files from [SlackBuilds](https://slackbuilds.org/repository/14.2/desktop/neofetch/) and follow [their instructions](https://slackbuilds.org/howto/). Download the files from [SlackBuilds](https://slackbuilds.org/repository/14.2/desktop/neofetch/) and follow [their instructions](https://slackbuilds.org/howto/).
### Mac OS X ### macOS
1. Install `neofetch` with Homebrew 1. Install `neofetch` with Homebrew
- `brew install neofetch` - `brew install neofetch`
@ -359,9 +357,7 @@ alias neofetch2="neofetch \
in the output. in the output.
NOTE: You can supply multiple args. eg. NOTE: You can supply multiple args. eg.
'neofetch --disable cpu gpu disk shell' 'neofetch --disable cpu gpu disk shell'
--osx_buildversion on/off Hide/Show Mac OS X build version. --os_arch on/off Hide/Show OS architecture.
--osx_codename on/off Hide/Show Mac OS X codename.
--os_arch on/off Hide/Show Windows architecture.
--speed_type type Change the type of cpu speed to display. --speed_type type Change the type of cpu speed to display.
Possible values: current, min, max, bios, Possible values: current, min, max, bios,
scaling_current, scaling_min, scaling_max scaling_current, scaling_min, scaling_max
@ -369,11 +365,14 @@ alias neofetch2="neofetch \
--cpu_shorthand type Shorten the output of CPU --cpu_shorthand type Shorten the output of CPU
Possible values: name, speed, tiny, on, off Possible values: name, speed, tiny, on, off
--cpu_cores on/off Whether or not to display the number of CPU cores --cpu_cores on/off Whether or not to display the number of CPU cores
--distro_shorthand on/off Shorten the output of distro (tiny, on, off)
NOTE: This is only possible on Linux, macOS, and Solaris
--kernel_shorthand on/off Shorten the output of kernel --kernel_shorthand on/off Shorten the output of kernel
--uptime_shorthand on/off Shorten the output of uptime (tiny, on, off) --uptime_shorthand on/off Shorten the output of uptime (tiny, on, off)
--refresh_rate on/off Whether to display the refresh rate of each monitor --refresh_rate on/off Whether to display the refresh rate of each monitor
Unsupported on Windows Unsupported on Windows
--gpu_shorthand on/off Shorten the output of GPU (tiny, on, off) --gpu_shorthand on/off Shorten the output of GPU (tiny, on, off)
--gpu_brand on/off Enable/Disable GPU brand in output. (AMD/NVIDIA/Intel)
--gtk_shorthand on/off Shorten output of gtk theme/icons --gtk_shorthand on/off Shorten output of gtk theme/icons
--gtk2 on/off Enable/Disable gtk2 theme/icons output --gtk2 on/off Enable/Disable gtk2 theme/icons output
--gtk3 on/off Enable/Disable gtk3 theme/icons output --gtk3 on/off Enable/Disable gtk3 theme/icons output
@ -445,10 +444,13 @@ alias neofetch2="neofetch \
--ascii_logo_size Size of ascii logo. --ascii_logo_size Size of ascii logo.
Supported distros: Arch, Gentoo, Crux, OpenBSD. Supported distros: Arch, Gentoo, Crux, OpenBSD.
--ascii_bold on/off Whether or not to bold the ascii logo. --ascii_bold on/off Whether or not to bold the ascii logo.
--logo | -L Hide the info text and only show the ascii logo.
Screenshot: Screenshot:
--scrot /path/to/img Take a screenshot, if path is left empty the screen- --scrot /path/to/img Take a screenshot, if path is left empty the screen-
shot function will use \$scrot_dir and \$scrot_name. shot function will use \$scrot_dir and \$scrot_name.
--upload | -su /pth/t/img Same as --scrot but uploads the scrot to a website.
--image_host Website to upload scrots to. Takes: imgur, teknik
--scrot_cmd cmd Screenshot program to launch --scrot_cmd cmd Screenshot program to launch
Other: Other:

20
ascii/distro/bitrig Normal file
View file

@ -0,0 +1,20 @@
"\
${c1} \`hMMMMN+
-MMo-dMd\`
oMN- oMN\`
yMd /NM:
.mMmyyhMMs
:NMMMhsmMh
+MNhNNoyMm-
hMd.-hMNMN:
mMmsssmMMMo
.MMdyyhNMMMd
oMN.\`/dMddMN\`
yMm/hNm+./MM/
.dMMMmo.\`\`.NMo
:NMMMNmmmmmMMh
/MN/-------oNN:
hMd. .dMh
sm/ /ms
"

12
ascii/distro/guixsd Normal file
View file

@ -0,0 +1,12 @@
"\
${c1} .. \`.
\`--..\`\`\`..\` \`..\`\`\`..--\`
.-:///-:::. \`-:::///:-.
\`\`\`\`.:::\` \`:::.\`\`\`\`
-//:\` -::-
://: -::-
\`///- .:::\`
-+++-:::.
:+/:::-
\`-....\`
"

View file

@ -1,20 +1,20 @@
"\ "\
${c1} e e ${c3}......
eee ee .'${c1}D${c3}lddddddddddd'.
eeee eee .'ddd${c1}XM${c3}xdddddddddddddd.
${c2} wwwwwwwww${c1}eeeeee .dddddx${c1}MMM0${c3};dddddddddddddd.
${c2} wwwwwwwwwwwwwww${c1}eee 'dddddl${c1}MMMMMN${c3}cddddddddddddddd.
${c2} wwwwwwwwwwwwwwwwwww${c1}eeeeeeee ddddddc${c1}WMMMMMMW${c3}lddddddddddddddd.
${c2} wwwww ${c1}eeeee${c2}wwwwww${c1}eeee ddddddc${c1}WMMMMMMMMO${c3}ddoddddddddddddd.
${c2}www ${c1}eeee${c2}wwwwww${c1}e .ddddd:${c1}NMMMMMMMMMK${c3}dd${c1}NX${c3}od;c${c1}lxl${c3}dddddd
${c2}ww ${c1}ee${c2}wwwwww dddddc${c1}WMMMMMMMMMMNN${c3}dd${c1}MMXl${c3};d${c1}00xl;${c3}ddd.
w wwwww ddddl${c1}WMMMMMMMMMMMMM${c3}d;${c1}MMMM0${c3}:dl${c1}XMMXk:${c3}'
wwwww dddo${c1}WMMMMMMMMMMMMMM${c3}dd${c1}MMMMMW${c3}od${c3};${c1}XMMMOd
wwwww ${c3}.dd${c1}MMMMMMMMMMMMMMMM${c3}d:${c1}MMMMMMM${c3}kd${c1}lMKll
wwwww ${c3}.;dk0${c1}KXNWWMMMMMMMMM${c3}dx${c1}MMMMMMM${c3}Xl;lxK;
wwww ${c3} 'dddddddd;:cclodcddxddolloxO0O${c1}d'
wwww ${c1} ckkxxxddddddddxxkOOO000Okdool.
wwww ${c2}.lddddxxxxxxddddooooooooood
www .:oooooooooooooooooooc'
ww .,:looooooooooc;.
" "

23
ascii/distro/sparky Normal file
View file

@ -0,0 +1,23 @@
"\
${c1}
. \`-:-\`
.o\` .-///-\`
\`oo\` .:/++:.
os+\` -/+++:\` \`\`.........\`\`\`
/ys+\`./+++/-.-::::::----......\`\`
\`syyo\`++o+--::::-::/+++/-\`\`
-yyy+.+o+\`:/:-:sdmmmmmmmmdy+-\`
::-\` :yyy/-oo.-+/\`ymho++++++oyhdmdy/\`
\`/yy+-\`.syyo\`+o..o--h..osyhhddhs+//osyy/\`
-ydhs+-oyy/.+o.-: \` \` :/::+ydhy+\`\`\`-os-
.sdddy::syo--/:. \`.:dy+-ohhho ./:
:yddds/:+oo+//:-\`- /+ +hy+.shhy: \`\`
\`:ydmmdysooooooo-.ss\`/yss--oyyo
\`./ossyyyyo+:-/oo:.osso- .oys
\`\`..-------::////.-oooo/ :so
\`...----::::::::--.\`/oooo: .o:
\`\`\`\`\`\`\` ++o+:\` \`:\`
./+/-\` \`
\`-:-.
\`\`
"

View file

@ -3,7 +3,7 @@ ${c1} ,.=:!!t3Z3z.,
:tt:::tt333EE3 :tt:::tt333EE3
${c1} Et:::ztt33EEEL${c2} @Ee., .., ${c1} Et:::ztt33EEEL${c2} @Ee., ..,
${c1} ;tt:::tt333EE7${c2} ;EEEEEEttttt33# ${c1} ;tt:::tt333EE7${c2} ;EEEEEEttttt33#
${c1} :Et:::zt333EEQ.${c2} $EEEEEttttt33QL ${c1} :Et:::zt333EEQ.${c2} \$EEEEEttttt33QL
${c1} it::::tt333EEF${c2} @EEEEEEttttt33F ${c1} it::::tt333EEF${c2} @EEEEEEttttt33F
${c1} ;3=*^\`\`\`\"*4EEV${c2} :EEEEEEttttt33@. ${c1} ;3=*^\`\`\`\"*4EEV${c2} :EEEEEEttttt33@.
${c3} ,.=::::!t=., ${c1}\`${c2} @EEEEEEtttz33QF ${c3} ,.=::::!t=., ${c1}\`${c2} @EEEEEEtttz33QF

View file

@ -61,13 +61,9 @@ kernel_shorthand="on"
# Distro # Distro
# Mac OS X hide/show build version # Shorten the output of distro (tiny, on, off)
# --osx_buildversion on/off # NOTE: This is only possible on Linux, macOS, and Solaris
osx_buildversion="on" distro_shorthand="off"
# Mac OS X hide/show codename
# --osx_codename on/off
osx_codename="on"
# Show 'x86_64' and 'x86' in 'Distro:' output. # Show 'x86_64' and 'x86' in 'Distro:' output.
# --os_arch on/off # --os_arch on/off
@ -89,7 +85,7 @@ shell_path="off"
# Show $SHELL's version # Show $SHELL's version
# --shell_version on/off # --shell_version on/off
shell_version="off" shell_version="on"
# CPU # CPU
@ -122,6 +118,10 @@ cpu_cores="on"
# --gpu_shorthand on/off/tiny # --gpu_shorthand on/off/tiny
gpu_shorthand="on" gpu_shorthand="on"
# Enable/Disable GPU Brand
# --gpu_brand on/off
gpu_brand="on"
# Resolution # Resolution
# Display refresh rate next to each monitor # Display refresh rate next to each monitor
@ -233,7 +233,7 @@ underline_char="-"
# Color block range # Color block range
# --block_range start end # --block_range start end
start=0 start=0
end=7 end=15
# Toggle color blocks # Toggle color blocks
# --color_blocks on/off # --color_blocks on/off
@ -241,7 +241,7 @@ color_blocks="on"
# Color block width in spaces # Color block width in spaces
# --block_width num # --block_width num
block_width=2 block_width=3
# Color block height in lines # Color block height in lines
# --block_height num # --block_height num
@ -258,7 +258,7 @@ block_height=1
progress_char_elapsed="-" progress_char_elapsed="-"
progress_char_total="=" progress_char_total="="
# Progress vorder # Progress border
# --progress_border on/off # --progress_border on/off
progress_border="on" progress_border="on"
@ -370,7 +370,7 @@ ascii_logo_size="normal"
# Bold ascii logo # Bold ascii logo
# Whether or not to bold the ascii logo. # Whether or not to bold the ascii logo.
# --ascii_bold on/off # --ascii_bold on/off
ascii_bold="off" ascii_bold="on"
# }}} # }}}
@ -394,7 +394,17 @@ scrot_dir="$HOME/Pictures/"
# Scrot filename # Scrot filename
# What to name the screenshots # What to name the screenshots
# --scrot_name str # --scrot_name str
scrot_name="neofetch-$(date +%F-%T).png" scrot_name="neofetch-$(date +%F-%I-%M-%S-${RANDOM}).png"
# Image upload host
# Where to upload the image.
# Possible values: imgur, teknik
image_host="imgur"
# Imgur api key
# This is an api key for neofetch, you can sign up for your own
# here: http://api.imgur.com/oauth2/addclient
imgur_client_id="0e8b44d15e9fc95"
# }}} # }}}

485
neofetch
View file

@ -27,7 +27,7 @@ getos() {
case "$(uname)" in case "$(uname)" in
"Linux") os="Linux" ;; "Linux") os="Linux" ;;
"Darwin") os="$(sw_vers -productName)" ;; "Darwin") os="$(sw_vers -productName)" ;;
*"BSD" | "DragonFly") os="BSD" ;; *"BSD" | "DragonFly" | "Bitrig") os="BSD" ;;
"CYGWIN"*) os="Windows" ;; "CYGWIN"*) os="Windows" ;;
"SunOS") os="Solaris" ;; "SunOS") os="Solaris" ;;
*) printf "%s\n" "Unknown OS detected: $(uname)"; exit 1 ;; *) printf "%s\n" "Unknown OS detected: $(uname)"; exit 1 ;;
@ -104,6 +104,7 @@ getmodel() {
model="$(wmic computersystem get manufacturer,model /value)" model="$(wmic computersystem get manufacturer,model /value)"
model="${model/Manufacturer'='}" model="${model/Manufacturer'='}"
model="${model/Model'='}" model="${model/Model'='}"
model="${model//*To Be Filled*}"
;; ;;
"Solaris") "Solaris")
@ -121,24 +122,59 @@ getdistro() {
case "$os" in case "$os" in
"Linux" ) "Linux" )
if type -p lsb_release >/dev/null 2>&1; then if grep -q 'Microsoft' /proc/version >/dev/null 2>&1 || \
distro="$(lsb_release -d 2>/dev/null | awk -F ':' '/Description/ {printf $2}')" grep -q 'Microsoft' /proc/sys/kernel/osrelease >/dev/null 2>&1; then
case "$distro_shorthand" in
"on") distro="$(lsb_release -sir 2>/dev/null) [Windows 10]" ;;
"tiny") distro="Windows 10" ;;
*) distro="$(lsb_release -sd 2>/dev/null) on Windows 10" ;;
esac
ascii_distro="Windows 10"
elif type -p lsb_release >/dev/null 2>&1; then
case "$distro_shorthand" in
"on") distro="$(lsb_release -sir 2>/dev/null)" ;;
"tiny") distro="$(lsb_release -si 2>/dev/null)" ;;
*) distro="$(lsb_release -sd 2>/dev/null)" ;;
esac
elif type -p guix >/dev/null 2>&1; then
distro="GuixSD"
elif type -p crux >/dev/null 2>&1; then elif type -p crux >/dev/null 2>&1; then
distro="$(crux)" distro="$(crux)"
case "$distro_shorthand" in
"on") distro="${distro//version}" ;;
"tiny") distro="${distro//version*}" ;;
esac
elif [ -d "/system/app/" ] && [ -d "/system/priv-app" ]; then elif [ -d "/system/app/" ] && [ -d "/system/priv-app" ]; then
distro="Android $(getprop ro.build.version.release)" distro="Android $(getprop ro.build.version.release)"
else else
distro="$(awk -F 'NAME=' '/^NAME=/ {printf $2}' /etc/*ease)" # Workarounds are included in every shorthand option
distro="${distro//\"}" case "$distro_shorthand" in
"on")
distro="$(awk -F'=' '/^NAME|VERSION_ID=/ {print $2; exit}' /etc/*ease /usr/lib/*ease)"
[ -z "$distro" ] && distro="$(awk -F'=' '/^DISTRIB_ID|DISTRIB_RELEASE=/ {print $2}' /etc/openwrt_release)"
;;
# Workaround for distros that store the value differently. "tiny")
[ -z "$distro" ] && distro="$(awk -F 'TAILS_PRODUCT_NAME="|"' '/^TAILS_PRODUCT_NAME=/ {printf $2}' /etc/*ease)" distro="$(awk -F'=' '/^NAME=/ {print $2; exit}' /etc/*ease /usr/lib/*ease)"
[ -z "$distro" ] && distro="$(awk '/BLAG/ {print $1; exit}' /etc/*ease)" [ -z "$distro" ] && distro="$(awk -F'=' '/^TAILS_PRODUCT_NAME=/ {print $2}' /etc/*ease)"
[ -z "$distro" ] && distro="$(awk -F "'" '/^DISTRIB_DESCRIPTION/ {print $2}' /etc/openwrt_release)" [ -z "$distro" ] && distro="$(awk -F'=' '/^DISTRIB_ID=/ {print $2}' /etc/openwrt_release)"
;;
*)
distro="$(awk -F'=' '/^PRETTY_NAME=/ {print $2; exit}' /etc/*ease /usr/lib/*ease)"
[ -z "$distro" ] && distro="$(awk -F'=' '{print $2}' /etc/*ease)"
[ -z "$distro" ] && distro="$(awk '/BLAG/ {print $1; exit}' /etc/*ease)"
[ -z "$distro" ] && distro="$(awk -F'=' '/^DISTRIB_DESCRIPTION=/ {print $2}' /etc/openwrt_release)"
;;
esac
fi fi
distro="${distro//\"}"
distro="${distro//\'}"
;; ;;
"Mac OS X") "Mac OS X")
@ -155,9 +191,21 @@ getdistro() {
"10.10"*) codename="OS X Yosemite" ;; "10.10"*) codename="OS X Yosemite" ;;
"10.11"*) codename="OS X El Capitan" ;; "10.11"*) codename="OS X El Capitan" ;;
"10.12"*) codename="macOS Sierra" ;; "10.12"*) codename="macOS Sierra" ;;
*) codename="Mac OS X" ;; *) codename="macOS" ;;
esac esac
distro="$codename $osx_version $osx_build" distro="$codename $osx_version $osx_build"
case "$distro_shorthand" in
"on") distro="${distro/ ${osx_build}}" ;;
"tiny")
case "$osx_version" in
"10."[4-7]*) distro="${distro/${codename}/Mac OS X}" ;;
"10."[8-9]* | "10.1"[0-1]*) distro="${distro/${codename}/OS X}" ;;
"10.12"*) distro="${distro/${codename}/macOS}" ;;
esac
distro="${distro/ ${osx_build}}"
;;
esac
;; ;;
"iPhone OS") "iPhone OS")
@ -187,7 +235,10 @@ getdistro() {
;; ;;
"Solaris") "Solaris")
distro="$(nawk 'NR==1{gsub(/^ \t]+|[ \t]+$/,""); printf $1 " " $2;}' /etc/release)" case "$distro_shorthand" in
"on" | "tiny") distro="$(awk 'NR==1{print $1 " " $2;}' /etc/release)" ;;
*) distro="$(awk 'NR==1{print $1 " " $2 " " $3;}' /etc/release)" ;;
esac
;; ;;
esac esac
@ -195,12 +246,6 @@ getdistro() {
[ "$os_arch" == "on" ] && \ [ "$os_arch" == "on" ] && \
distro+=" $(uname -m)" distro+=" $(uname -m)"
[ "$osx_codename" == "off" ] && \
distro="${distro/${codename}/Mac OS X}"
[ "$osx_buildversion" == "off" ] && \
distro="${distro/ ${osx_build}}"
[ "${ascii_distro:-auto}" == "auto" ] && \ [ "${ascii_distro:-auto}" == "auto" ] && \
ascii_distro="$(trim "$distro")" ascii_distro="$(trim "$distro")"
} }
@ -363,6 +408,9 @@ getpackages() {
type -p nix-env >/dev/null 2>&1 && \ type -p nix-env >/dev/null 2>&1 && \
packages="$((packages+=$(ls -d -1 /nix/store/*/ | wc -l)))" packages="$((packages+=$(ls -d -1 /nix/store/*/ | wc -l)))"
type -p guix >/dev/null 2>&1 && \
packages="$((packages+=$(ls -d -1 /gnu/store/*/ | wc -l)))"
type -p apk >/dev/null 2>&1 && \ type -p apk >/dev/null 2>&1 && \
packages="$((packages+=$(apk info | wc -l)))" packages="$((packages+=$(apk info | wc -l)))"
@ -481,7 +529,7 @@ getde() {
case "$de" in case "$de" in
"KDE_SESSION_VERSION"*) de="KDE${de/* = }" ;; "KDE_SESSION_VERSION"*) de="KDE${de/* = }" ;;
*"TDE_FULL_SESSION"*) de="Trinity" ;; *"TDE_FULL_SESSION"*) de="Trinity" ;;
*"MUFFIN"*) de="Cinnamon" ;; *"MUFFIN"*) de="$(cinnamon --version 2>/dev/null)"; de="${de:-Cinnamon}" ;;
*"xfce4"*) de="XFCE4" ;; *"xfce4"*) de="XFCE4" ;;
*"xfce5"*) de="XFCE5" ;; *"xfce5"*) de="XFCE5" ;;
esac esac
@ -502,18 +550,29 @@ getwm() {
# Fallback for Wayland wms # Fallback for Wayland wms
case "$wm" in case "$wm" in
"xwlc") "xwlc") wm="$(ps -e | grep -m 1 -oE "sway|orbment|velox|orbital")" ;;
wm="$(ps -e | grep -m 1 -oE "sway|orbment|velox|orbital")"
[ "$version" -ge 4 ] && wm="${wm^}"
;;
esac esac
else else
case "$os" in case "$os" in
"Mac OS X") wm="Quartz Compositor" ;; "Mac OS X") wm="Quartz Compositor" ;;
"Windows") wm="Explorer" ;; "Windows")
wm="$(tasklist | grep -m 1 -o "bugn\|Windawesome\|blackbox\|emerge\|litestep")"
[ "$wm" == "blackbox" ] && wm="bbLean (Blackbox)"
if [ "$wm" ]; then
wm="$wm, Explorer"
else
wm="Explorer"
fi
;;
esac esac
fi fi
# Don't uppercase i3
[ "$version" -ge 4 ] && \
[ "$wm" != "i3" ] && \
wm="${wm^}"
} }
# }}} # }}}
@ -537,7 +596,10 @@ getwmtheme() {
'Compiz' | 'Mutter'* | 'GNOME Shell' | 'Gala') 'Compiz' | 'Mutter'* | 'GNOME Shell' | 'Gala')
if type -p gsettings >/dev/null 2>&1; then if type -p gsettings >/dev/null 2>&1; then
wmtheme="$(gsettings get org.gnome.desktop.wm.preferences theme)" wmtheme="$(gsettings get org.gnome.shell.extensions.user-theme name)"
[ -z "$wmtheme" ] && \
wmtheme="$(gsettings get org.gnome.desktop.wm.preferences theme)"
elif type -p gconftool-2 >/dev/null 2>&1; then elif type -p gconftool-2 >/dev/null 2>&1; then
wmtheme="$(gconftool-2 -g /apps/metacity/general/theme)" wmtheme="$(gconftool-2 -g /apps/metacity/general/theme)"
@ -613,7 +675,7 @@ getwmtheme() {
fi fi
;; ;;
'Explorer') *'Explorer')
path="/proc/registry/HKEY_CURRENT_USER/Software/Microsoft" path="/proc/registry/HKEY_CURRENT_USER/Software/Microsoft"
path+="/Windows/CurrentVersion/Themes/CurrentTheme" path+="/Windows/CurrentVersion/Themes/CurrentTheme"
@ -622,6 +684,15 @@ getwmtheme() {
wmtheme="${wmtheme%.*}" wmtheme="${wmtheme%.*}"
;; ;;
'Blackbox' | "bbLean"*)
path="$(wmic process get ExecutablePath | grep "blackbox")"
path="${path//'\'/'/'}"
wmtheme="$(grep "^session\.styleFile:" ${path/\.exe/.rc})"
wmtheme="${wmtheme/'session.styleFile: '}"
wmtheme="${wmtheme##*\\}"
wmtheme="${wmtheme%.*}"
;;
esac esac
wmtheme="${wmtheme//\'}" wmtheme="${wmtheme//\'}"
@ -647,9 +718,10 @@ getcpu() {
"Android"*) cpu="$(getprop ro.product.board)" ;; "Android"*) cpu="$(getprop ro.product.board)" ;;
*) cpu="$(awk -F ': | @' '/model name|Processor/ {printf $2; exit}' /proc/cpuinfo)" ;; *) cpu="$(awk -F ': | @' '/model name|Processor/ {printf $2; exit}' /proc/cpuinfo)" ;;
esac esac
cpu_dir="/sys/devices/system/cpu/cpu0/cpufreq"
# Get cpu speed # Get cpu speed
if [ -d "/sys/devices/system/cpu/cpu0/cpufreq" ]; then if [ -d "$cpu_dir" ]; then
case "$speed_type" in case "$speed_type" in
current) speed_type="scaling_cur_freq" ;; current) speed_type="scaling_cur_freq" ;;
min) speed_type="scaling_min_freq" ;; min) speed_type="scaling_min_freq" ;;
@ -660,8 +732,9 @@ getcpu() {
scaling_max) speed_type="scaling_max_freq" ;; scaling_max) speed_type="scaling_max_freq" ;;
esac esac
read -t 1 -r speed < \ # Fallback to cpuinfo_max_freq if $speed_type fails
/sys/devices/system/cpu/cpu0/cpufreq/${speed_type} read -t 1 -r speed < "${cpu_dir}/${speed_type}" || \
read -t 1 -r speed < "${cpu_dir}/cpuinfo_max_freq"
speed="$((speed / 100000))" speed="$((speed / 100000))"
else else
@ -673,9 +746,9 @@ getcpu() {
# Fix for speeds under 1ghz # Fix for speeds under 1ghz
if [ -z "${speed:1}" ]; then if [ -z "${speed:1}" ]; then
speed="0.${speed}" speed="0.${speed}"
else else
speed="${speed:0:1}.${speed:1}" speed="${speed:0:1}.${speed:1}"
fi fi
cpu="$cpu @ ${speed}GHz" cpu="$cpu @ ${speed}GHz"
@ -683,7 +756,7 @@ getcpu() {
"Mac OS X") "Mac OS X")
cpu="$(sysctl -n machdep.cpu.brand_string)" cpu="$(sysctl -n machdep.cpu.brand_string)"
cores="$(sysctl -n hw.ncpu)" cores="$(sysctl -n hw.physicalcpu)"
;; ;;
"iPhone OS") "iPhone OS")
@ -811,9 +884,9 @@ getcpu() {
# Fix for speeds under 1ghz # Fix for speeds under 1ghz
if [ -z "${speed:1}" ]; then if [ -z "${speed:1}" ]; then
speed="0.${speed}" speed="0.${speed}"
else else
speed="${speed:0:1}.${speed:1}" speed="${speed:0:1}.${speed:1}"
fi fi
cpu="$cpu @ ${speed}GHz" cpu="$cpu @ ${speed}GHz"
@ -834,9 +907,9 @@ getcpu() {
# Fix for speeds under 1ghz # Fix for speeds under 1ghz
if [ -z "${speed:1}" ]; then if [ -z "${speed:1}" ]; then
speed="0.${speed}" speed="0.${speed}"
else else
speed="${speed:0:1}.${speed:1}" speed="${speed:0:1}.${speed:1}"
fi fi
cpu="$cpu @ ${speed}GHz" cpu="$cpu @ ${speed}GHz"
@ -908,10 +981,10 @@ getcpu_usage() {
# Print the bar # Print the bar
case "$cpu_display" in case "$cpu_display" in
"info") cpu_usage="${cpu_usage}%" ;;
"bar") cpu_usage="$(bar $cpu_usage 100)" ;; "bar") cpu_usage="$(bar $cpu_usage 100)" ;;
"infobar") cpu_usage="${cpu_usage}% $(bar $cpu_usage 100)" ;; "infobar") cpu_usage="${cpu_usage}% $(bar $cpu_usage 100)" ;;
"barinfo") cpu_usage="$(bar $cpu_usage 100) ${cpu_usage}%" ;; "barinfo") cpu_usage="$(bar $cpu_usage 100) ${cpu_usage}%" ;;
*) cpu_usage="${cpu_usage}%" ;;
esac esac
} }
@ -920,8 +993,8 @@ getcpu_usage() {
# GPU {{{ # GPU {{{
getgpu() { getgpu() {
case "$os" in case "$os" in
"Linux") "Linux")
gpu="$(PATH="/sbin:$PATH" lspci | grep -F "3D")" gpu="$(PATH="/sbin:$PATH" lspci | grep -F "3D")"
# If a GPU with a prefix of '3D' doesn't exist # If a GPU with a prefix of '3D' doesn't exist
@ -958,23 +1031,11 @@ getgpu() {
gpu="${gpu/Advanced Micro Devices, Inc\. }" gpu="${gpu/Advanced Micro Devices, Inc\. }"
gpu="${gpu/'[AMD/ATI]' }" gpu="${gpu/'[AMD/ATI]' }"
gpu="${gpu/Tahiti PRO}" gpu="${gpu/Tahiti PRO}"
gpu="${gpu/Seymour}"
gpu="${gpu/Cayman}"
gpu="${gpu/Richland}"
gpu="${gpu/Pitcairn}"
gpu="${gpu/Broadway}"
gpu="${gpu/XTMobility}"
gpu="${gpu/Mobility}"
gpu="${gpu/Hawaii}"
gpu="${gpu/Tobago}"
gpu="${gpu/Thames}"
gpu="${gpu/Kabini}"
gpu="${gpu/Bonaire}"
gpu="${gpu/XTX}" gpu="${gpu/XTX}"
gpu="${gpu/ OEM}" gpu="${gpu/ OEM}"
gpu="${gpu/ Cape Verde}"
gpu="${gpu/ \[}" gpu="${gpu/ \[}"
gpu="${gpu/\]}" gpu="${gpu/\]}"
gpu="${gpu/*Radeon/Radeon}"
brand="AMD " brand="AMD "
;; ;;
@ -1105,6 +1166,12 @@ getgpu() {
;; ;;
esac esac
if [ "$gpu_brand" == "off" ]; then
gpu="${gpu/AMD}"
gpu="${gpu/NVIDIA}"
gpu="${gpu/Intel}"
fi
gpu="${gpu}${count}" gpu="${gpu}${count}"
} }
@ -1141,7 +1208,10 @@ getmemory() {
*) memfree="$(($(vmstat | awk 'END{printf $5}') / 1024))" ;; *) memfree="$(($(vmstat | awk 'END{printf $5}') / 1024))" ;;
esac esac
memtotal="$(($(sysctl -n hw.physmem) / 1024 / 1024))" case "$distro" in
"NetBSD"*) memtotal="$(($(sysctl -n hw.physmem64) / 1024 / 1024))" ;;
*) memtotal="$(($(sysctl -n hw.physmem) / 1024 / 1024))" ;;
esac
memused="$((memtotal - memfree))" memused="$((memtotal - memfree))"
;; ;;
@ -1208,20 +1278,42 @@ getsong() {
song="$(gpmdp-remote current)" song="$(gpmdp-remote current)"
state="$(gpmdp-remote status)" state="$(gpmdp-remote status)"
elif [ -n "$(ps x | awk '!(/awk/ || /Helper/) && /iTunes/')" ]; then elif [ -n "$(ps x | awk '!(/awk/ || /Helper/ || /Cache/) && /iTunes.app/')" ]; then
song="$(osascript -e 'tell application "iTunes" to artist of current track as string & " - " & name of current track as string')" song="$(osascript -e 'tell application "iTunes" to artist of current track as string & " - " & name of current track as string')"
state="$(osascript -e 'tell application "iTunes" to player state as string')" state="$(osascript -e 'tell application "iTunes" to player state as string')"
elif [ -n "$(ps x | awk '!(/awk/) && /rhythmbox/')" ]; then
song="$(rhythmbox-client --print-playing)"
# Well, what can you expect? It's dbus after all.
state="$(dbus-send --print-reply --dest=org.mpris.MediaPlayer2.rhythmbox /org/mpris/MediaPlayer2 \
org.freedesktop.DBus.Properties.Get string:'org.mpris.MediaPlayer2.Player' string: 'PlayBackStatus' |\
awk -F 'string "' '{printf $2}')"
state="${state//\"}"
elif [ -n "$(ps x | awk '!(/awk/) && /banshee/')" ]; then
artist="$(banshee --query-artist | awk -F':' '{print $2}')"
title="$(banshee --query-title | awk -F':' '{print $2}')"
song="$artist - $title"
state="$(banshee --query-current-state | awk -F':' '{print $2}')"
elif [ -n "$(ps x | awk '!(/awk/) && /amarok/')" ]; then
artist="$(qdbus org.kde.amarok /Player GetMetadata | awk -F':' '/^artist/ {print $2}')"
title="$(qdbus org.kde.amarok /Player GetMetadata | awk -F':' '/title/ {print $2}')"
song="$artist - $title"
elif [ -n "$(ps x | awk '!(/awk/) && /deadbeef/')" ]; then
song="$(deadbeef --nowplaying '%a - %t')"
else else
song="Not Playing" song="Not Playing"
fi fi
case "$state" in case "$state" in
"paused" | "PAUSE") "paused" | "PAUSE" | "Paused")
song="Paused" song="Paused"
;; ;;
"stopped" | "STOP") "stopped" | "STOP" | "Stopped")
song="Stopped" song="Stopped"
;; ;;
esac esac
@ -1271,6 +1363,11 @@ getresolution() {
awk '/Resolution:/ {printf $2"x"$4" @ "$6"Hz, "}')" awk '/Resolution:/ {printf $2"x"$4" @ "$6"Hz, "}')"
fi fi
scale_factor="$(/usr/libexec/PlistBuddy -c "Print DisplayAnyUserSets:0:0:Resolution" /Library/Preferences/com.apple.windowserver.plist)"
[ "${scale_factor%.*}" == "2" ] && \
resolution="${resolution// @/@2x @}"
if [ "$refresh_rate" == "off" ]; then if [ "$refresh_rate" == "off" ]; then
resolution="${resolution// @ [0-9][0-9]Hz}" resolution="${resolution// @ [0-9][0-9]Hz}"
resolution="${resolution// @ [0-9][0-9][0-9]Hz}" resolution="${resolution// @ [0-9][0-9][0-9]Hz}"
@ -1309,7 +1406,7 @@ getstyle() {
name="gtk-theme-name" name="gtk-theme-name"
gsettings="gtk-theme" gsettings="gtk-theme"
gconf="gtk_theme" gconf="gtk_theme"
xfconf="ThemeName" xfconf="/Net/ThemeName"
kde="widgetStyle" kde="widgetStyle"
;; ;;
@ -1317,7 +1414,7 @@ getstyle() {
name="gtk-icon-theme-name" name="gtk-icon-theme-name"
gsettings="icon-theme" gsettings="icon-theme"
gconf="icon_theme" gconf="icon_theme"
xfconf="IconThemeName" xfconf="/Net/IconThemeName"
kde="Theme" kde="Theme"
;; ;;
@ -1325,7 +1422,7 @@ getstyle() {
name="gtk-font-name" name="gtk-font-name"
gsettings="font-name" gsettings="font-name"
gconf="font_theme" gconf="font_theme"
xfconf="FontName" xfconf="/Gtk/FontName"
kde="font" kde="font"
;; ;;
esac esac
@ -1374,7 +1471,7 @@ getstyle() {
"Xfce"*) "Xfce"*)
type -p xfconf-query >/dev/null 2>&1 && \ type -p xfconf-query >/dev/null 2>&1 && \
gtk2theme="$(xfconf-query -c xsettings -p /Net/"$xfconf")" gtk2theme="$(xfconf-query -c xsettings -p "$xfconf")"
;; ;;
esac esac
@ -1474,7 +1571,7 @@ getterm() {
# Check $PPID for terminal emulator. # Check $PPID for terminal emulator.
case "$os" in case "$os" in
"Mac OS X") "Mac OS X")
# Workaround for OS X systems that # Workaround for macOS systems that
# don't support the block below. # don't support the block below.
case "$TERM_PROGRAM" in case "$TERM_PROGRAM" in
"iTerm.app") term="iTerm2" ;; "iTerm.app") term="iTerm2" ;;
@ -1500,12 +1597,14 @@ getterm() {
esac esac
case "${name// }" in case "${name// }" in
"${SHELL/*\/}" | *"sh" | "tmux" | "screen") getterm "$parent" ;; "${SHELL/*\/}" | *"sh" | "tmux"* | "screen") getterm "$parent" ;;
"login" | "init") term="$(tty)"; term="${term/*\/}" ;; "login" | "init") term="$(tty)" ;;
"ruby" | "1" | "systemd" | "sshd"* | "python"*) unset term ;; "ruby" | "1" | "systemd" | "sshd"* | "python"*) unset term ;;
"gnome-terminal-") term="gnome-terminal" ;; "gnome-terminal-") term="gnome-terminal" ;;
*) term="$name" ;; *) term="${name##*/}" ;;
esac esac
[ "$version" -ge 4 ] && term="${term^}"
} }
# }}} # }}}
@ -1537,7 +1636,7 @@ gettermfont() {
;; ;;
"termite") "termite")
termfont="$(awk -F '= ' '!/^($|#)/ && /font/ {printf $2; exit}' "${XDG_CONFIG_HOME}/termite/config")" termfont="$(awk -F '= ' '!/^($|#|;)/ && /font/ {printf $2; exit}' "${XDG_CONFIG_HOME}/termite/config")"
;; ;;
"mintty") "mintty")
@ -1554,6 +1653,8 @@ gettermfont() {
termfont="${termfont/:*}" termfont="${termfont/:*}"
;; ;;
esac esac
[ "$version" -ge 4 ] && termfont="${termfont^}"
} }
# }}} # }}}
@ -1575,7 +1676,7 @@ getdisk() {
"Mac OS X" | "BSD") "Mac OS X" | "BSD")
case "$distro" in case "$distro" in
"FreeBSD"* | *"OS X"* ) "FreeBSD"* | *"OS X"* | "Mac"* )
df_flags="-l -H /" df_flags="-l -H /"
df_dir="/" df_dir="/"
;; ;;
@ -1679,20 +1780,20 @@ getbattery() {
battery="$(envstat | awk '\\(|\\)' '/charge:/ {print $2}')" battery="$(envstat | awk '\\(|\\)' '/charge:/ {print $2}')"
battery="${battery/\.*/%}" battery="${battery/\.*/%}"
;; ;;
"OpenBSD"* | "Bitrig"*)
battery0full="$(sysctl -n hw.sensors.acpibat0.watthour0)"
battery0full="${battery0full/ Wh*}"
battery0now="$(sysctl -n hw.sensors.acpibat0.watthour3)"
battery0now="${battery0now/ Wh*}"
[ "$battery0full" ] && \
battery="$((100 * ${battery0now/\.} / ${battery0full/\.}))%"
;;
esac esac
;; ;;
"OpenBSD")
battery0full="$(sysctl -n hw.sensors.acpibat0.watthour0)"
battery0full="${battery0full/ Wh*}"
battery0now="$(sysctl -n hw.sensors.acpibat0.watthour3)"
battery0now="${battery0now/ Wh*}"
[ "$battery0full" ] && \
battery="$((100 * ${battery0now/\.} / ${battery0full/\.}))%"
;;
"Mac OS X") "Mac OS X")
battery="$(pmset -g batt | grep -o '[0-9]*%')" battery="$(pmset -g batt | grep -o '[0-9]*%')"
battery_state="$(pmset -g batt | awk 'NR==2 {print $3}')" battery_state="$(pmset -g batt | awk 'NR==2 {print $3}')"
@ -1793,7 +1894,7 @@ getbirthday() {
"BSD") "BSD")
case "$distro" in case "$distro" in
"OpenBSD"*) "OpenBSD"* | "Bitrig"*)
birthday="$(ls -alctT / | awk '/lost\+found/ {printf $6 " " $7 " " $9 " " $8}')" birthday="$(ls -alctT / | awk '/lost\+found/ {printf $6 " " $7 " " $9 " " $8}')"
birthday_shorthand="on" birthday_shorthand="on"
;; ;;
@ -1840,14 +1941,15 @@ getbirthday() {
getcols() { getcols() {
if [ "$color_blocks" == "on" ]; then if [ "$color_blocks" == "on" ]; then
# Convert the width to space chars. # Convert the width to space chars.
block_width="$(printf "%$((block_width-=1))s")" block_width="$(printf "%${block_width}s")"
block_width="${block_width// /█}"
# Generate the string. # Generate the string.
while [ $start -le $end ]; do while [ $start -le $end ]; do
case "$start" in case "$start" in
[0-6]) blocks+="${reset}\033[3${start}m\033[4${start}m%${block_width}s" ;; [0-6]) blocks+="${reset}\033[3${start}m\033[4${start}m${block_width}" ;;
7) blocks+="${reset}\033[3${start}m\033[4${start}m%${block_width}s" ;; 7) blocks+="${reset}\033[3${start}m\033[4${start}m${block_width}" ;;
*) blocks2+="\033[38;5;${start}m\033[48;5;${start}m%${block_width}s" ;; *) blocks2+="\033[38;5;${start}m\033[48;5;${start}m${block_width}" ;;
esac esac
start="$((start+=1))" start="$((start+=1))"
done done
@ -1861,7 +1963,7 @@ getcols() {
# Add newlines to the string. # Add newlines to the string.
cols="${cols%%'nl'}" cols="${cols%%'nl'}"
cols="${cols//nl/\\n${padding}}" cols="${cols//nl/\\n${padding}}"
fi fi
} }
@ -1894,6 +1996,7 @@ getwallpaper() {
# Strip quotes etc from the path. # Strip quotes etc from the path.
img="${img/'file://'}" img="${img/'file://'}"
img="${img//\'}" img="${img//\'}"
img="${img//\%20/ }"
fi fi
;; ;;
@ -1941,8 +2044,10 @@ getascii() {
ascii="${ascii_distro,,}" ascii="${ascii_distro,,}"
fi fi
[ "$ascii_logo_size" == "small" ] && \ if [ "$ascii_logo_size" == "small" ]; then
ascii="${ascii/ *}_small" ascii="${ascii/ *}_small"
prompt_loc="3"
fi
if [ -f "/usr/share/neofetch/ascii/distro/${ascii/ *}" ]; then if [ -f "/usr/share/neofetch/ascii/distro/${ascii/ *}" ]; then
ascii="/usr/share/neofetch/ascii/distro/${ascii/ *}" ascii="/usr/share/neofetch/ascii/distro/${ascii/ *}"
@ -2057,6 +2162,8 @@ getimage() {
[ "${#term_size}" -le 5 ] && err "Your terminal doesn't support \\\033[14t, falling back to ascii mode." [ "${#term_size}" -le 5 ] && err "Your terminal doesn't support \\\033[14t, falling back to ascii mode."
return return
else
clear
fi fi
# Get terminal lines and columns # Get terminal lines and columns
@ -2170,10 +2277,6 @@ getimage() {
img="$thumbnail_dir/$imgname" img="$thumbnail_dir/$imgname"
} }
takescrot() {
$scrot_cmd "${scrot_dir}${scrot_name}"
}
# }}} # }}}
# Find w3m-img {{{ # Find w3m-img {{{
@ -2209,6 +2312,9 @@ displayimage() {
if [ "$image" != "ascii" ]; then if [ "$image" != "ascii" ]; then
case "$image_backend" in case "$image_backend" in
"w3m") "w3m")
# Add a tiny delay to fix issues with images not
# appearing in specific terminal emulators.
sleep 0.05
printf "%b%s\n" "0;1;$xoffset;$yoffset;$width;$height;;;;;$img\n4;\n3;" |\ printf "%b%s\n" "0;1;$xoffset;$yoffset;$width;$height;;;;;$img\n4;\n3;" |\
$w3m_img_path 2>/dev/null || padding="\033[0C" $w3m_img_path 2>/dev/null || padding="\033[0C"
;; ;;
@ -2242,6 +2348,48 @@ getimagebackend() {
# }}} # }}}
# Screenshot {{{
takescrot() {
$scrot_cmd "${scrot_dir}${scrot_name}"
[ "$scrot_upload" == "on" ] && scrot_upload
}
# }}}
# Screenshot Upload {{{
scrot_upload() {
if ! type -p curl >/dev/null 2>&1; then
printf "%s\n" "[!] Install curl to upload images"
return
fi
image_file="${scrot_dir}${scrot_name}"
printf "%s\n" "Uploading image..."
case "$image_host" in
"teknik")
image_url="$(curl -sf -F file="@${image_file}" "https://api.teknik.io/v1/Upload")"
image_url="$(awk -F 'url:|,' '{printf $2}' <<< "${image_url//\"}")"
;;
"imgur")
image_url="$(curl -sH "Authorization: Client-ID $imgur_client_id" -F image="@${image_file}" "https://api.imgur.com/3/upload")"
image_url="$(awk -F 'id:|,' '{printf $2}' <<< "${image_url//\"}")"
[ "$image_url" ] && image_url="https://i.imgur.com/${image_url}.png"
;;
esac
if [ "$image_url" ]; then
printf "%s\n" "$image_url"
else
printf "%s\n" "[!] Image failed to upload"
fi
}
# }}}
# }}} # }}}
# Text Formatting {{{ # Text Formatting {{{
@ -2268,14 +2416,6 @@ info() {
# Trim whitespace # Trim whitespace
output="$(trim "$output")" output="$(trim "$output")"
# Fix rendering issues with w3m and lines that
# wrap to the next line by adding a max line
# length.
if [ "$image" != "off" ] && [ "$image" != "ascii" ] && [ "$1" != "cols" ]; then
padding_num="${padding/\\033\[}"
output="$(printf "%.$((columns - ${padding_num/C} - gap - ${#subtitle}))s" "$output")"
fi
case "$1" in case "$1" in
title) title)
string="${title_color}${bold}${output}" string="${title_color}${bold}${output}"
@ -2298,7 +2438,18 @@ info() {
[ -z "$2" ] && string="${string/*: }" [ -z "$2" ] && string="${string/*: }"
# Print the string # Print the string
printf "%b%s\n" "${padding}${string}${reset}" printf "%b%s\n" "${padding}${string}${reset} "
# Calculate info height
info_height="$((info_height+=1))"
# Fix rendering issues with w3m and lines that
# wrap to the next line by adding a max line
# length.
if [ "$image" != "off" ] && [ "$image" != "ascii" ] && [ "$1" != "cols" ]; then
padding_num="${padding/\\033\[}"
output="$(printf "%.$((columns - ${padding_num/C} - gap - ${#subtitle}))s" "$output")"
fi
} }
# }}} # }}}
@ -2308,14 +2459,6 @@ info() {
prin() { prin() {
string="$1${2:+: $2}" string="$1${2:+: $2}"
# Fix rendering issues with w3m and lines that
# wrap to the next line by adding a max line
# length.
if [ "$image" != "off" ] && [ "$image" != "ascii" ]; then
padding_num="${padding/\\033\[}"
string="$(printf "%.$((columns - ${padding_num/C} - gap))s" "$string")"
fi
# If $2 doesn't exist we format $1 as info # If $2 doesn't exist we format $1 as info
if [ -z "$2" ]; then if [ -z "$2" ]; then
subtitle_color="$info_color" subtitle_color="$info_color"
@ -2330,7 +2473,18 @@ prin() {
string="$(trim "$string")" string="$(trim "$string")"
# Print the info # Print the info
printf "%b%s\n" "${padding}${string}${reset}" printf "%b%s\n" "${padding}${string}${reset} "
# Calculate info height
info_height="$((info_height+=1))"
# Fix rendering issues with w3m and lines that
# wrap to the next line by adding a max line
# length.
if [ "$image" != "off" ] && [ "$image" != "ascii" ]; then
padding_num="${padding/\\033\[}"
string="$(printf "%.$((columns - ${padding_num/C} - gap))s" "$string")"
fi
} }
# }}} # }}}
@ -2342,7 +2496,7 @@ getunderline() {
"on") "on")
underline="$(printf %"$length"s)" underline="$(printf %"$length"s)"
underline="${underline// /$underline_char}" underline="${underline// /$underline_char}"
;; ;;
"off") underline="" ;; "off") underline="" ;;
esac esac
} }
@ -2431,7 +2585,7 @@ colors() {
ascii_distro="mint" ascii_distro="mint"
;; ;;
"LMDE"* | "Chapeau"* | "Android"*) "LMDE"* | "Chapeau"* | "Bitrig"* | "Android"*)
setcolors 2 7 setcolors 2 7
;; ;;
@ -2439,7 +2593,7 @@ colors() {
setcolors 5 7 setcolors 5 7
;; ;;
"OpenBSD"*) "OpenBSD"* | "GuixSD"*)
setcolors 3 7 6 1 8 setcolors 3 7 6 1 8
;; ;;
@ -2456,12 +2610,17 @@ colors() {
ascii_distro="puppy" ascii_distro="puppy"
;; ;;
"Sparky"*)
setcolors 1 7
ascii_distro="sparky"
;;
"Scientific"*) "Scientific"*)
setcolors 4 1 7 setcolors 4 1 7
;; ;;
"Solus"*) "Solus"*)
setcolors 7 8 setcolors 7 4 0
;; ;;
"Trisquel"* | "NixOS"* | "Zorin"*) "Trisquel"* | "NixOS"* | "Zorin"*)
@ -2566,7 +2725,7 @@ bold() {
# Linebreak {{{ # Linebreak {{{
getlinebreak() { getlinebreak() {
linebreak=" " linebreak=" "
} }
# }}} # }}}
@ -2603,6 +2762,15 @@ err() {
# }}} # }}}
# Check for old flags {{{
checkoldflags() {
[ -n "$osx_buildversion" ] && err "\$osx_buildversion is deprecated, use \$distro_shorthand instead."
[ -n "$osx_codename" ] && err "\$osx_codename is deprecated, use \$distro_shorthand instead."
}
# }}}
# Get script directory {{{ # Get script directory {{{
getscriptdir() { getscriptdir() {
@ -2741,20 +2909,41 @@ kdeconfigdir() {
# Dynamic prompt location {{{ # Dynamic prompt location {{{
dynamicprompt() { dynamicprompt() {
# Get cursor position
info_height="$(IFS=';' builtin read -srdR -t 1 -d c -p $'\033[6n\033[c' ROW COL; printf "%s" "${ROW#*[}")"
# Calculate image height in terminal cells. # Calculate image height in terminal cells.
# The '+ 3' adds a gap between the prompt and the content. # The '+ 4' adds a gap between the prompt and the content.
[ "$image" != "ascii" ] && [ "$image" != "off" ] && \ [ "$image" != "ascii" ] && [ "$image" != "off" ] && \
lines="$((${height:-1} / ${font_height:-1} + 3))" lines="$((${height:-1} / ${font_height:-1} + 4))"
# If the info is higher than the ascii/image place the prompt # If the info is higher than the ascii/image place the prompt
# based on the info height instead of the ascii/image height. # based on the info height instead of the ascii/image height.
[ "${lines:-0}" -lt "${info_height:-0}" ] && lines="$info_height" if [ "${lines:-0}" -lt "${info_height:-0}" ]; then
lines="0"
else
lines="$((lines - info_height - 4))"
fi
# Set the prompt location # Set the prompt location
[ "$image" != "off" ] && printf "%b%s" "\033[${lines:-0}H" [ "$image" != "off" ] && printf "\033[${lines/-*/0}B"
# Add some padding if the lines are above 0
if [ "$lines" -gt 0 ]; then
printf "\n\n"
fi
}
# }}}
# Scrot args {{{
scrot_args() {
scrot="on"
case "$2" in
"-"* | "") ;;
*)
scrot_name="${2##*/}"
scrot_dir="${2/$scrot_name}"
;;
esac
} }
# }}} # }}}
@ -2774,9 +2963,7 @@ usage() { cat << EOF
in the output. in the output.
NOTE: You can supply multiple args. eg. NOTE: You can supply multiple args. eg.
'neofetch --disable cpu gpu disk shell' 'neofetch --disable cpu gpu disk shell'
--osx_buildversion on/off Hide/Show Mac OS X build version. --os_arch on/off Hide/Show OS architecture.
--osx_codename on/off Hide/Show Mac OS X codename.
--os_arch on/off Hide/Show Windows architecture.
--speed_type type Change the type of cpu speed to display. --speed_type type Change the type of cpu speed to display.
Possible values: current, min, max, bios, Possible values: current, min, max, bios,
scaling_current, scaling_min, scaling_max scaling_current, scaling_min, scaling_max
@ -2784,11 +2971,14 @@ usage() { cat << EOF
--cpu_shorthand type Shorten the output of CPU --cpu_shorthand type Shorten the output of CPU
Possible values: name, speed, tiny, on, off Possible values: name, speed, tiny, on, off
--cpu_cores on/off Whether or not to display the number of CPU cores --cpu_cores on/off Whether or not to display the number of CPU cores
--distro_shorthand on/off Shorten the output of distro (tiny, on, off)
NOTE: This is only possible on Linux, macOS, and Solaris
--kernel_shorthand on/off Shorten the output of kernel --kernel_shorthand on/off Shorten the output of kernel
--uptime_shorthand on/off Shorten the output of uptime (tiny, on, off) --uptime_shorthand on/off Shorten the output of uptime (tiny, on, off)
--refresh_rate on/off Whether to display the refresh rate of each monitor --refresh_rate on/off Whether to display the refresh rate of each monitor
Unsupported on Windows Unsupported on Windows
--gpu_shorthand on/off Shorten the output of GPU (tiny, on, off) --gpu_shorthand on/off Shorten the output of GPU (tiny, on, off)
--gpu_brand on/off Enable/Disable GPU brand in output. (AMD/NVIDIA/Intel)
--gtk_shorthand on/off Shorten output of gtk theme/icons --gtk_shorthand on/off Shorten output of gtk theme/icons
--gtk2 on/off Enable/Disable gtk2 theme/icons output --gtk2 on/off Enable/Disable gtk2 theme/icons output
--gtk3 on/off Enable/Disable gtk3 theme/icons output --gtk3 on/off Enable/Disable gtk3 theme/icons output
@ -2860,10 +3050,13 @@ usage() { cat << EOF
--ascii_logo_size Size of ascii logo. --ascii_logo_size Size of ascii logo.
Supported distros: Arch, Gentoo, Crux, OpenBSD. Supported distros: Arch, Gentoo, Crux, OpenBSD.
--ascii_bold on/off Whether or not to bold the ascii logo. --ascii_bold on/off Whether or not to bold the ascii logo.
--logo | -L Hide the info text and only show the ascii logo.
Screenshot: Screenshot:
--scrot /path/to/img Take a screenshot, if path is left empty the screen- --scrot | -s /path/to/img Take a screenshot, if path is left empty the screen-
shot function will use \$scrot_dir and \$scrot_name. shot function will use \$scrot_dir and \$scrot_name.
--upload | -su /pth/t/img Same as --scrot but uploads the scrot to a website.
--image_host Website to upload scrots to. Takes: imgur, teknik
--scrot_cmd cmd Screenshot program to launch --scrot_cmd cmd Screenshot program to launch
Other: Other:
@ -2892,7 +3085,7 @@ getargs() {
config="off" config="off"
;; ;;
*"--config --"*) ;; *"--config -"*) ;;
*"--config"*) config="off" ;; *"--config"*) config="off" ;;
esac esac
@ -2902,14 +3095,14 @@ getargs() {
case $1 in case $1 in
# Info # Info
--os_arch) os_arch="$2" ;; --os_arch) os_arch="$2" ;;
--osx_buildversion) osx_buildversion="$2" ;;
--osx_codename) osx_codename="$2" ;;
--cpu_cores) cpu_cores="$2" ;; --cpu_cores) cpu_cores="$2" ;;
--speed_type) speed_type="$2" ;; --speed_type) speed_type="$2" ;;
--distro_shorthand) distro_shorthand="$2" ;;
--kernel_shorthand) kernel_shorthand="$2" ;; --kernel_shorthand) kernel_shorthand="$2" ;;
--uptime_shorthand) uptime_shorthand="$2" ;; --uptime_shorthand) uptime_shorthand="$2" ;;
--cpu_shorthand) cpu_shorthand="$2" ;; --cpu_shorthand) cpu_shorthand="$2" ;;
--gpu_shorthand) gpu_shorthand="$2" ;; --gpu_shorthand) gpu_shorthand="$2" ;;
--gpu_brand) gpu_brand="$2" ;;
--refresh_rate) refresh_rate="$2" ;; --refresh_rate) refresh_rate="$2" ;;
--gtk_shorthand) gtk_shorthand="$2" ;; --gtk_shorthand) gtk_shorthand="$2" ;;
--gtk2) gtk2="$2" ;; --gtk2) gtk2="$2" ;;
@ -2927,7 +3120,7 @@ getargs() {
for func in "$@"; do for func in "$@"; do
case "$func" in case "$func" in
"--disable") continue ;; "--disable") continue ;;
"--"*) return ;; "-"*) return ;;
*) unset -f "get$func" ;; *) unset -f "get$func" ;;
esac esac
done done
@ -2938,7 +3131,7 @@ getargs() {
unset colors unset colors
for arg in "$2" "$3" "$4" "$5" "$6" "$7"; do for arg in "$2" "$3" "$4" "$5" "$6" "$7"; do
case "$arg" in case "$arg" in
"--"*) break ;; "-"*) break ;;
*) colors+=($arg) *) colors+=($arg)
esac esac
done done
@ -2975,10 +3168,10 @@ getargs() {
# Image # Image
--image) --image)
image="$2" image="$2"
case "$2" in "--"* | "") image="ascii" ;; esac case "$2" in "-"* | "") image="ascii" ;; esac
;; ;;
--size) image_size="$2" ;; --image_size | --size) image_size="$2" ;;
--crop_mode) crop_mode="$2" ;; --crop_mode) crop_mode="$2" ;;
--crop_offset) crop_offset="$2" ;; --crop_offset) crop_offset="$2" ;;
--xoffset) xoffset="$2" ;; --xoffset) xoffset="$2" ;;
@ -2994,14 +3187,14 @@ getargs() {
--ascii) --ascii)
image="ascii" image="ascii"
ascii="$2" ascii="$2"
case "$2" in "--"* | "") ascii="distro" ;; esac case "$2" in "-"* | "") ascii="distro" ;; esac
;; ;;
--ascii_colors) --ascii_colors)
unset ascii_colors unset ascii_colors
for arg in "$2" "$3" "$4" "$5" "$6" "$7"; do for arg in "$2" "$3" "$4" "$5" "$6" "$7"; do
case "$arg" in case "$arg" in
"--"*) break ;; "-"*) break ;;
*) ascii_colors+=($arg) *) ascii_colors+=($arg)
esac esac
done done
@ -3010,20 +3203,27 @@ getargs() {
--ascii_distro) --ascii_distro)
ascii_distro="$2" ascii_distro="$2"
case "$2" in "--"* | "") ascii_distro="$distro" ;; esac case "$2" in "-"* | "") ascii_distro="$distro" ;; esac
;; ;;
--ascii_logo_size) ascii_logo_size="$2" ;; --ascii_logo_size) ascii_logo_size="$2" ;;
--ascii_bold) ascii_bold="$2" ;; --ascii_bold) ascii_bold="$2" ;;
--logo | -L)
image="ascii"
printinfo() { info linebreak; }
;;
# Screenshot # Screenshot
--scrot | -s) --scrot | -s)
scrot="on" scrot_args "$@"
if [ "$2" ]; then
scrot_name="${2##*/}"
scrot_dir="${2/$scrot_name}"
fi
;; ;;
--upload | -su)
scrot_upload="on"
scrot_args "$@"
;;
--image_host) image_host="$2" ;;
--scrot_cmd) scrot_cmd="$2" ;; --scrot_cmd) scrot_cmd="$2" ;;
# Other # Other
@ -3062,7 +3262,7 @@ getargs() {
-v) verbose="on" ;; -v) verbose="on" ;;
-vv) set -x; verbose="on" ;; -vv) set -x; verbose="on" ;;
--help) usage ;; --help) usage ;;
--version) printf "%s\n" "Neofetch 1.8"; exit ;; --version) printf "%s\n" "Neofetch 1.9"; exit ;;
esac esac
shift shift
@ -3076,6 +3276,7 @@ getargs() {
main() { main() {
getos getos
getdefaultconfig 2>/dev/null getdefaultconfig 2>/dev/null
checkoldflags
getargs "$@" getargs "$@"
getdistro getdistro
@ -3089,9 +3290,6 @@ main() {
# If the script exits for any reason, unhide the cursor. # If the script exits for any reason, unhide the cursor.
trap 'printf "\033[?25h"' EXIT trap 'printf "\033[?25h"' EXIT
# Clear the scren
clear
# Hide the cursor and disable line wrap # Hide the cursor and disable line wrap
printf "\033[?25l\033[?7l" printf "\033[?25l\033[?7l"
@ -3111,8 +3309,11 @@ main() {
displayimage displayimage
fi fi
# Move cursor to the top # Set cursor position next to ascii art
printf "\033[0H" printf "\033[$((${lines:-4} - ${prompt_loc:-4}))A"
# Reset horizontal cursor position
printf "\033[9999999D"
# Print the info # Print the info
printinfo printinfo

View file

@ -19,14 +19,8 @@ NOTE: You can supply multiple args. eg.
.br .br
\'neofetch --disable cpu gpu disk shell\' \'neofetch --disable cpu gpu disk shell\'
.TP .TP
.B \--osx_buildversion 'on/off'
Hide/Show Mac OS X build version.
.TP
.B \--osx_codename 'on/off'
Hide/Show Mac OS X codename.
.TP
.B \--os_arch 'on/off' .B \--os_arch 'on/off'
Hide/Show Windows architecture. Hide/Show OS architecture.
.TP .TP
.B \--speed_type 'type' .B \--speed_type 'type'
Change the type of cpu speed to display. Change the type of cpu speed to display.
@ -44,6 +38,11 @@ Possible values: name, speed, tiny, on, off
.B \--cpu_cores 'on/off' .B \--cpu_cores 'on/off'
Whether or not to display the number of CPU cores Whether or not to display the number of CPU cores
.TP .TP
.B \--distro_shorthand 'on/off'
Shorten the output of distro (tiny, on, off)
.br
NOTE: This is only possible on Linux, macOS, and Solaris
.TP
.B \--kernel_shorthand 'on/off' .B \--kernel_shorthand 'on/off'
Shorten the output of kernel Shorten the output of kernel
.TP .TP
@ -57,6 +56,9 @@ Unsupported on Windows
.B \--gpu_shorthand 'on/off' .B \--gpu_shorthand 'on/off'
Shorten the output of GPU (tiny, on, off) Shorten the output of GPU (tiny, on, off)
.TP .TP
.B \--gpu_brand on/off
Enable/Disable GPU brand in output. (AMD/NVIDIA/Intel)
.TP
.B \--gtk_shorthand 'on/off' .B \--gtk_shorthand 'on/off'
Shorten output of gtk theme/icons Shorten output of gtk theme/icons
.TP .TP
@ -67,10 +69,10 @@ Enable/Disable GTK2 theme/icons output
Enable/Disable gtk3 theme/icons output Enable/Disable gtk3 theme/icons output
.TP .TP
.B \--shell_path 'on/off' .B \--shell_path 'on/off'
Enable/Disable showing \$SHELL path Enable/Disable showing $SHELL path
.TP .TP
.B \--shell_version 'on/off' .B \--shell_version 'on/off'
Enable/Disable showing \$SHELL version Enable/Disable showing $SHELL version
.TP .TP
.B \--battery_num 'num' .B \--battery_num 'num'
Which battery to display, default value is 'all' Which battery to display, default value is 'all'
@ -222,12 +224,21 @@ Possible values: small, normal
.TP .TP
.B \--ascii_bold 'on/off' .B \--ascii_bold 'on/off'
Whether or not to bold the ascii logo. Whether or not to bold the ascii logo.
.TP
.B \--logo | -L
Hide the info text and only show the ascii logo.
.SH SCREENSHOT .SH SCREENSHOT
.TP .TP
.B \--scrot 'path' .B \--scrot 'path'
Take a screenshot, if path is left empty the screenshot Take a screenshot, if path is left empty the screenshot
function will use \$scrot_dir and \$scrot_name. function will use $scrot_dir and $scrot_name.
.TP
.B \--upload | -su 'path'
Same as --scrot but uploads the scrot to a website.
.TP
.B \--image_host 'host'
Website to upload scrots to. Takes: imgur, teknik
.TP .TP
.B \--scrot_cmd 'cmd' .B \--scrot_cmd 'cmd'
Screenshot program to launch Screenshot program to launch