image: Use stty instead of sequence first.

This commit is contained in:
Dylan Araps 2018-06-19 09:21:48 +10:00
parent 2783446387
commit 94362674f2
2 changed files with 14 additions and 21 deletions

View file

@ -11,15 +11,16 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
**Contributors** **Contributors**
- [**@mstraube**](https://github.com/mstraube) - [**@arisinfenix**](https://github.com/arisinfenix)
- [**@iandrewt**](https://github.com/iandrewt) - [**@iandrewt**](https://github.com/iandrewt)
- [**@konimex**](https://github.com/konimex) - [**@konimex**](https://github.com/konimex)
**Operating System** **Operating System**
- Added support for Condres OS. [**@mstraube**](https://github.com/mstraube) - Added support for Condres OS. [**@arisinfenix**](https://github.com/arisinfenix)
- Added support for RedCore Linux. [**@mstraube**](https://github.com/mstraube) - Added support for RedCore Linux. [**@arisinfenix**](https://github.com/arisinfenix)
- Added support for Regata OS. [**@mstraube**](https://github.com/mstraube) - Added support for Regata OS. [**@arisinfenix**](https://github.com/arisinfenix)
- Added support for ClearOS. [**@arisinfenix**](https://github.com/arisinfenix)
- Added support for PureOS. - Added support for PureOS.
- Added support for Kibojoe Linux. - Added support for Kibojoe Linux.
- Added support for SharkLinux. - Added support for SharkLinux.
@ -62,24 +63,24 @@ See: https://github.com/dylanaraps/neofetch/issues/1001
- **cpu**: Remove extra call to `uname`. - **cpu**: Remove extra call to `uname`.
- **cpu**: Simplify core calculation. - **cpu**: Simplify core calculation.
- **disk**: Clean up. - **disk**: Clean up.
- **font**: Fix iTerm2 checking for 2 extra profiles that don't exist. - **font**: Fix iTerm2 checking for 2 extra profiles that don't exist. [**@iandrewt**](https://github.com/iandrewt")
[**@iandrewt**](https://github.com/iandrewt")
- **gpu**: Fixed ATI/AMD branding issue. - **gpu**: Fixed ATI/AMD branding issue.
- **gpu**: Removed `glxinfo` usage (*too slow*). - **gpu**: Removed `glxinfo` usage (*too slow*).
- **packages**: Added support for `flatpak`. - **packages**: Added support for `flatpak`. [**@konimex**](https://github.com/konimex)
[**@konimex**](https://github.com/konimex) - **packages**: Added support for `snap`. [**@konimex**](https://github.com/konimex)
- **packages**: Added support for `snap`.
[**@konimex**](https://github.com/konimex)
- **packages**: Added used package managers to output (`Packages: 900 - **packages**: Added used package managers to output (`Packages: 900
(pacman, snap)`). (pacman, snap)`).
- **packages**: Fixed issues with `pacman` 5.1. - **packages**: Fixed issues with `pacman` 5.1.
- **packages**: Fixed issues with `dpkg`.
- **packages**: Removed `find` usage. - **packages**: Removed `find` usage.
- **packages**: Removed `ls` usage. - **packages**: Removed `ls` usage.
- **packages**: Removed `wc -l` usage. - **packages**: Removed `wc -l` usage.
- **song**: Added support for `gmusicbrowser`. - **song**: Added support for `gmusicbrowser`. [**@arisinfenix**](https://github.com/arisinfenix)
[**@mstraube**](https://github.com/mstraube) - **song**: Added support for `SMPlayer`. [**@arisinfenix**](https://github.com/arisinfenix)
- **song**: Added support for `Dragon Player`. [**@arisinfenix**](https://github.com/arisinfenix)
- **song**: Fixed song detection on macOS. - **song**: Fixed song detection on macOS.
- **song**: Fixed song output on systems using `C` locale. - **song**: Fixed song output on systems using `C` locale.
- **song**: Added `mpc_args` to send additional arguments to `mpc`.
- **term\_font**: Clean up of config file handling. - **term\_font**: Clean up of config file handling.
- **resolution**: Added support for `xwininfo`. - **resolution**: Added support for `xwininfo`.

View file

@ -3608,15 +3608,7 @@ get_window_size() {
get_term_size() { get_term_size() {
# Get the terminal size in cells. # Get the terminal size in cells.
printf '%b' '\e[18t' read -r lines columns < <(stty size)
IFS=';t' read -d t -t 0.05 -sra term_cells
lines="${term_cells[1]}"
columns="${term_cells[2]}"
# Fallback to stty if above sequence isn't supported.
[[ -z "$lines" || -z "$columns" ]] && \
read -r lines columns < <(stty size)
# Calculate font size. # Calculate font size.
font_width="$((term_width / columns))" font_width="$((term_width / columns))"