Compare commits

...

143 Commits
1.1 ... 1.2

Author SHA1 Message Date
Dylan Araps
ed953cdf82 Merge pull request #79 from dylanaraps/xprop
Use 'xprop' instead of 'wmctrl' to get the window manager.
2016-02-17 17:34:54 +11:00
Dylan
e7799892c0 Update docs 2016-02-17 17:31:20 +11:00
Dylan
33a1a8fb12 Update docs 2016-02-17 17:29:01 +11:00
Dylan
4d1ebbe600 Remove quotes from theme output 2016-02-17 17:14:58 +11:00
Dylan
9a7a213746 Remove wmctrl stuff 2016-02-17 16:55:12 +11:00
Dylan
7a36f2fef0 Get window manager using xprop 2016-02-17 16:54:18 +11:00
Dylan
1e2bde6dbe Changelog 2016-02-17 16:01:22 +11:00
Dylan
b21533d842 Reduce size of if block 2016-02-17 11:01:26 +11:00
Dylan
8891cce908 Fix missing ascii art when fetch is installed in /usr/local 2016-02-17 10:23:52 +11:00
Dylan
a314447afa Remove leftover substitutions 2016-02-17 09:43:05 +11:00
Dylan
d8ebd113ad Readme 2016-02-17 09:41:52 +11:00
Dylan
530507614c changelog 2016-02-17 09:33:49 +11:00
Dylan
c2fcf322d0 Merge branch 'master' of github.com:dylanaraps/fetch 2016-02-17 09:33:08 +11:00
Dylan Araps
ece1f55183 Merge pull request #77 from dylanaraps/wmctrl
Make 'wmctrl' a required dependency. See #75 for more info.
2016-02-17 09:34:22 +11:00
Dylan
bd6eb8e3f3 Changelog 2016-02-17 09:32:29 +11:00
Dylan
44fdd4d894 Changelog 2016-02-17 08:55:18 +11:00
Dylan
427fc68814 Fix issue number 2016-02-17 00:25:34 +11:00
Dylan
e4d51ed0d4 Changelog 2016-02-17 00:16:20 +11:00
Dylan
490bf1da70 Changelog 2016-02-17 00:15:57 +11:00
Dylan Araps
071f776914 Merge pull request #74 from dylanaraps/kde
Added KDE support to getstyle.
2016-02-17 00:12:07 +11:00
Dylan
7e57c7eb59 Make ChromiumOS use the same logo as ChromeOS 2016-02-17 00:00:44 +11:00
Dylan
012938e81d Added support for Chrome OS 2016-02-16 23:47:04 +11:00
Dylan
c22ff5ec91 Misc cleanup 2016-02-16 21:54:21 +11:00
Dylan
31e7057fbc Reduce size of 'ascii' function 2016-02-16 20:58:06 +11:00
Dylan
5981cb6eca wmctrl is now a required dependency 2016-02-16 18:01:40 +11:00
Dylan
4a0f02bde7 Added support for Exherbo Linux 2016-02-16 16:31:55 +11:00
Dylan
1335eb295b changelog 2016-02-16 16:12:35 +11:00
Dylan
6ba5f78dee Added support for Scientific Linux 2016-02-16 16:10:11 +11:00
Dylan
4c026be4cd Remove #! ascii art 2016-02-16 15:53:04 +11:00
Dylan
958ac55617 Changelog 2016-02-16 15:23:15 +11:00
Dylan
7dd92aab9d Fix packages on Slackware 2016-02-16 15:21:45 +11:00
Dylan
13dde29326 changelog 2016-02-16 15:06:20 +11:00
Dylan
362cbb5b7d Add playback state to getsong 2016-02-16 14:50:20 +11:00
Dylan
0d2db03909 Uppercase first letter in KDE theme output 2016-02-16 10:53:12 +11:00
Dylan
c4bd708a09 Fix stray gtktheme string 2016-02-16 10:52:26 +11:00
Dylan
1b3e0e71bb Update config 2016-02-16 10:50:40 +11:00
Dylan
bb2e0210de getgtk has been renamed to getstyle and is now a generic function that prints the GTK/QT theme 2016-02-16 10:49:21 +11:00
Dylan
98f1a0e057 If KDE theme is found don't look for GTK2/3 Themes 2016-02-16 10:42:38 +11:00
Dylan
0427eb3f05 Add support for older KDE versions 2016-02-16 10:31:13 +11:00
Dylan
1b1bfa2dab Added experimental KDE theme detection to getgtk 2016-02-16 10:19:28 +11:00
Dylan
b603d3395c Change Deepin's ascii art to the new logo 2016-02-16 10:04:43 +11:00
Dylan
9788d8b81c Added support for Chapeau 2016-02-16 09:52:10 +11:00
Dylan
c8b41da31c getsong, check to see if music player is running 2016-02-16 00:31:28 +11:00
Dylan
a1c9452bda Add MOC support to getsong 2016-02-16 00:12:15 +11:00
Dylan
5e6cc26b93 changelog 2016-02-15 23:59:57 +11:00
Dylan
e0be28a83d Check for packages based on which package manager is installed. 2016-02-15 23:59:05 +11:00
Dylan
6fa9366006 Added support for Frugalware 2016-02-15 22:59:28 +11:00
Dylan
9f851df3b4 Changelog 2016-02-15 21:15:28 +11:00
Dylan
9fc58aeb85 Added support for Sabayon 2016-02-15 21:15:16 +11:00
Dylan
376e594c9d Added package support for KaOS 2016-02-15 12:43:55 +11:00
Dylan
1d57507c01 Changelog 2016-02-15 12:39:16 +11:00
Dylan
0f0806ca06 Added support for KaOS 2016-02-15 12:39:02 +11:00
Dylan
362ae7b9d0 Changelog 2016-02-15 12:20:40 +11:00
Dylan
1cb6970c74 Added support for LMDE 2016-02-15 12:20:26 +11:00
Dylan
baa20e4115 Changelog 2016-02-15 12:07:46 +11:00
Dylan
884e38915f Added support for gNewSense 2016-02-15 12:07:32 +11:00
Dylan
7d403db369 Rename mandriva to openmandriva 2016-02-15 11:59:28 +11:00
Dylan
3bcd07b8f2 Changelog 2016-02-15 11:55:32 +11:00
Dylan
e3245fba63 Added support for Mandriva 2016-02-15 11:55:18 +11:00
Dylan
b0cee7c7d7 Merge branch 'master' of github.com:dylanaraps/fetch 2016-02-15 09:29:00 +11:00
Dylan Araps
182284bd05 Merge pull request #68 from tudurom/master
Fixed uptime output when the uptime is under a minute
2016-02-15 09:30:22 +11:00
Dylan
49771d8925 Added support for Dragora (No ascii
)
2016-02-15 09:28:51 +11:00
Tudor
8d2e2b5ee4 Forgot the uptime file 2016-02-14 15:56:02 +02:00
Tudor
06797de423 Now we have uptime shorthand for seconds 2016-02-14 15:50:24 +02:00
Dylan
2bdd52f1dc Changelog 2016-02-15 00:06:46 +11:00
Dylan
51791c5fcf Add gitter badge 2016-02-15 00:04:55 +11:00
Dylan
dbf0d34dc7 Added support for Chakra Linux 2016-02-14 23:49:36 +11:00
Dylan
6daade00ad Added support for NixOS 2016-02-14 23:29:04 +11:00
Dylan
d2df70f77d Rename Red Hat ascii art from 'red' to 'redhat' 2016-02-14 20:43:08 +11:00
Dylan
cb87a2095d --ascii_distro now also enables ascii mode 2016-02-14 20:39:35 +11:00
Dylan
4cc6fec6a0 Added support for Peppermint Linux 2016-02-14 20:35:42 +11:00
Dylan
191fb776b3 Added support for Solus 2016-02-14 19:42:27 +11:00
Dylan
c0b36ad48c Changelog 2016-02-14 17:05:55 +11:00
Dylan
53dde789a6 added support for Trisquel 2016-02-14 17:02:45 +11:00
Dylan
9277ba2775 Fix some lint errors 2016-02-14 09:26:52 +11:00
Tudor
5c7cb81c27 Forgot about that 2016-02-13 19:29:59 +02:00
Tudor
32053b795e Forgot a space 2016-02-13 19:27:54 +02:00
Tudor
a588f88f6c Fixed uptime output if it is under a minute 2016-02-13 19:24:44 +02:00
Dylan
96e05f78f8 Added support for BLAG Linux 2016-02-13 21:14:50 +11:00
Dylan Araps
33d0e5886b Merge pull request #66 from dylanaraps/tails_support
Tails support
2016-02-13 19:59:53 +11:00
Dylan
9f93bb681d Added ascii art for Tails Linux 2016-02-13 19:55:58 +11:00
Dylan
6f46d44435 Change substitution to also work with tails 2016-02-13 19:31:28 +11:00
Dylan
7132a82571 Added tails support 2016-02-13 19:29:08 +11:00
Dylan
71e09d0d6d Changelog 2016-02-13 12:21:29 +11:00
Dylan
8470a256fd Added support for Zorin OS 2016-02-13 12:20:40 +11:00
Dylan
b5e95a8ce4 Added support for PCLinuxOS 2016-02-13 11:16:15 +11:00
Dylan
e6df26166a clarify which BSD versions we officially support 2016-02-12 22:57:45 +11:00
Dylan
dc5eae2234 Added ascii colors for Mageia 2016-02-12 21:28:24 +11:00
Dylan
55c84d09b0 Changelog 2016-02-12 21:24:55 +11:00
Dylan
0c6e0048e8 Added support for Mageia Linux 2016-02-12 21:24:37 +11:00
Dylan
6d30f5131f Added Raspbian ascii art 2016-02-12 10:43:31 +11:00
Dylan
4d7e6be30c Changelog 2016-02-12 09:21:11 +11:00
Dylan
32110bc87e Remove processor info from Intel GPUs 2016-02-12 09:19:22 +11:00
Dylan
4f3c2e3b1f Add Raspbian to packages function 2016-02-12 09:08:12 +11:00
Dylan
2e0e3f5d64 If a GPU with a prefix of '3D' exists, use it instead. 2016-02-12 00:00:41 +11:00
Dylan
371bd64a8e Changelog 2016-02-11 09:20:59 +11:00
Dylan
9e7ad5c0ef Enable gpu_shorthand by default 2016-02-11 09:20:03 +11:00
Dylan
3ea8a401bd License 2016-02-11 00:00:16 +11:00
Dylan
203d2059a0 Changelog 2016-02-10 23:05:37 +11:00
Dylan Araps
9bec0fef70 Merge pull request #64 from dylanaraps/locale_fix
Fix locale issues when the user didn't have 'en_US.UTF8' installed.
2016-02-10 23:01:35 +11:00
Dylan
8da9015026 Possible locale fix 2016-02-10 22:54:07 +11:00
Dylan
e28f873461 Changelog 2016-02-10 22:46:50 +11:00
Dylan
a81b4238df Added support for showing the user's Desktop Environment and renamded 'windowmanager' to 'wm' 2016-02-10 22:44:23 +11:00
Dylan
1ac98037d5 Possible fix for the locale issue 2016-02-10 10:20:51 +11:00
Dylan
b61f33854a Add comments of the new functions to the printinfo fucntion 2016-02-09 21:50:57 +11:00
Dylan
8a8441f6f9 Merge branch 'master' of github.com:dylanaraps/fetch 2016-02-09 21:49:33 +11:00
Dylan
cba1c4a72c Changelog 2016-02-09 21:49:16 +11:00
Dylan Araps
fcefefee8b Merge pull request #60 from dylanaraps/ip
IP Address support
2016-02-09 21:49:07 +11:00
Dylan
33f68b7c6f Changelog 2016-02-09 21:45:52 +11:00
Dylan
e050ba6d1a If $img is an xml file fallback ro ascii mode 2016-02-09 21:30:41 +11:00
Dylan
f1450d1fc8 Add support for showing 'MATE' wallpaper 2016-02-09 21:12:09 +11:00
Dylan
f38da87a79 Left stray '/usr/' 2016-02-09 20:58:41 +11:00
Dylan
de8ab1eeb7 Fix lspci not found on open SUSE 2016-02-09 20:54:24 +11:00
Dylan
7ec516860a Replace broken BSD local ip cmd with a tested working one 2016-02-09 18:32:01 +11:00
Dylan
111caa6356 Add experimental and untested BSD support to localip 2016-02-09 17:53:52 +11:00
Dylan
76d583a124 Added '--ip_host' and '' which allow you to choose which website to ping for the public ip 2016-02-09 17:26:44 +11:00
Dylan
609e18a31c Add 'publicip' command to display your public ip address. 2016-02-09 17:20:19 +11:00
Dylan
2f13ce79de Added local IP support to OS X 2016-02-09 10:48:37 +11:00
Dylan
3e9975c438 Add local IP support to Linux and Windows 2016-02-09 09:36:43 +11:00
Dylan
73d50eb6b8 Changelog 2016-02-09 09:12:52 +11:00
Dylan Araps
ccc43cbcae Merge pull request #54 from dylanaraps/getgtk_rewrite
Rewrite GTK theme detection to also get correct DE theme.
2016-02-09 09:11:58 +11:00
Dylan
924714b76d Fix whitespace issue with openSUSE uptime 2016-02-09 09:04:05 +11:00
Dylan
9a3a3bc83d Really fix openSUSE uptime command 2016-02-09 09:02:07 +11:00
Dylan
74d4943115 OpenSUSE: Add uptime support 2016-02-09 08:55:53 +11:00
Dylan
a311897efd Fix package count on Kali Linux 2016-02-09 08:21:28 +11:00
Dylan
6a8f20c4c1 Added puppy linux ascii art 2016-02-09 08:08:19 +11:00
Dylan
4a99a128f9 Uptime: Match Puppy linux's weird way of versioning 2016-02-09 07:55:13 +11:00
Dylan
44ace4e837 Uptime: Add puppy linux support 2016-02-09 07:49:42 +11:00
Dylan
daa56b0851 Changelog 2016-02-09 07:31:07 +11:00
Dylan
5ddd145bdc Grab last occurence of '^exec x' when parsing xinit files 2016-02-09 07:30:19 +11:00
Dylan
5e8953c7fa We now check for GTK theme by GTK version 2016-02-09 07:16:15 +11:00
Dylan Araps
a850702843 Merge pull request #56 from tudurom/master
Fixed typo
2016-02-09 07:08:15 +11:00
Tudor
9ab756b084 Fixed typo 2016-02-08 20:25:18 +02:00
Dylan
cbc33486f7 If the DE detection fails fallback to the generic theme detection 2016-02-09 02:21:12 +11:00
Dylan
caf55803f3 Remove new from comment 2016-02-09 01:06:54 +11:00
Dylan
5446b6afd5 Add back support for '$gtk2/3' 2016-02-09 00:48:55 +11:00
Dylan
438d5e0542 GTK: Fix xfce case 2016-02-08 23:37:14 +11:00
Dylan
f15f5728ea Rewrite getgtk to also check DE 2016-02-08 23:29:48 +11:00
Dylan
a272874833 Add 1.2 changelog 2016-02-08 22:29:25 +11:00
Dylan
f053f5b8b2 Make a note about installing on El Captain systems 2016-02-08 22:27:43 +11:00
Dylan
4fe770cc3d Makefile: Fix missing '-D' flag on OS X 2016-02-08 22:14:26 +11:00
Dylan
0d78a6bdfe Makefile: Use for the install of ascii art and default config 2016-02-08 22:02:49 +11:00
Dylan
9d35c8e6d1 Fix typo in usage and remove 1.1 changelog. Closes #51 2016-02-07 16:41:34 +11:00
32 changed files with 1021 additions and 414 deletions

183
1.1.md
View File

@@ -1,183 +0,0 @@
# Fetch 1.1 changelog
Over the past 10~ days over **190** more commits have been pushed to master and the<br \>
script has had some big changes. Thanks to everyone who has contributed, you've been<br \>
a big help.
![screenfetch mode](http://i.imgur.com/nW3HiNP.png)<br \>
<sup>New screenfetch mode</sup>
- If `w3m` or `imagemagick` aren't installed we gracefully fallback to ascii mode.
- Automatically find the `w3m-img` path and fallback to ascii mode if not found. \[1\]
- Fix padding escape codes on BSD systems.
- Swap escape codes from `\e` to `\033` for consistency.
- We only move the cursor to the bottom of the terminal in w3m/iterm2 rendering modes.
- Cursor position is now dynamic in ascii mode based on the height of the ascii and info text.
- If images and ascii are off, don't clear the terminal
- The script now exits correctly instead of always exiting with status code `1`
- If the script exits for any reason, unhide the cursor.
- Removed duplicate blocks inside `getcpu` and `getmemory`.
- Removed `--colors` as it was apparently broken from day 1.
- Usage has been reformatted so that every flag has a value.
\[1\] Setting `$w3m_img_path` will make the script look there first.
### Image
- Added support for displaying ascii art inside of text files.
- Added "screenfetch mode" which will display your distro's ascii art next to the info. \[1\]<br \>
- Added `--ascii_distro` to choose which distro's ascii logo to display.
- Added `--ascii_colors` and `$ascii_colors` which allow you to change the colors of the ascii art<br \>
and distro logos. \[2\]
- Added `--size` and `$image_size` to set the image size in pixels.
- Rename `--shuffledir` and `$shuffledir` to `shuffle_dir`.
- Rename `--imgtempdir` and `$imgtempdir` to `thumbnail_dir`
- Removed `--split_size` and `$split_size` as they were weird and confusing to use.
- Default thumbnail directory is now `$HOME/.cache/thumbnails/fetch`. Thanks @tudurom
- If `--image` and `--ascii` are left empty we fallback to ascii distro mode.
Example usage of ascii from file:
```sh
fetch --ascii "path/to/ascii" --ascii_color 2
```
\[1\] **[How do I enable screenfetch mode?](http://github.com/dylanaraps/fetch#how-do-i-enable-screenfetch-mode)**<br \>
\[2\] `ascii_colors` takes a range of colors which allows you to color every aspect of<br \>
distro and OS ascii art. For custom art the script will color the entirety of it using<br \>
the first value of `ascii_colors`. If `ascii_colors` is left empty, color will be disabled.
### Config file
- Fetch now has a config file that you can share with people and keep between<br \>
script versions!
- Added `--config` and `$config_file` to specify a custom config location.
- Added `--config off`, `--config none` and `$config` to enable / disable config files<br \>
at launch or in script.
### Makefile
- Fetch now has a make file due to the increasing number of files,<br \>
this allows the script to be easily installed and uninstalled on<br \>
systems it isn't packaged for yet! \[1\]
\[1\] The script will still work just fine on its own, you'll just be missing<br \>
the distro ascii art and the automatic config creation.
### Packages
- Fetch now has a Gentoo/Funtoo e-build courtesy of **@z1lt0id**
### Stdout
- Added `stdout` mode which allows you to fetch info in a plain text format that works<br \>
with lemonbar and in your scripts. You can use it by launching fetch with `--stdout` to print all<br \>
functions enabled in your `printinfo` function. You can selectively print functions by passing<br \>
arguments to `--stdout` like so:
```sh
# Print the output of all info functions enabled in printinfo
fetch --stdout
# Print the output of memory
fetch --stdout memory
# Print the output of memory and disk
fetch --stdout disk
# Print the output of all functions excluding x
fetch --stdout --disable kernel packages gtktheme
```
- Added `--stdout_separator` and `$stdout_separator` which takes a string and adds it<br \>
as a separator between the output.
- Added `--stdout_title` and `$stdout_title` which allow you to toggle the `title@hostname`<br \>
from appearing in the output.
- Added `--stdout_subtitles` which allow you to toggle the `Info:` titles from appearing in<br \>
the output.
```sh
# Hiding subtitles
fetch --stdout --stdout_subtitles off
# Custom separator
fetch --stdout disk gpu --stdout_separator " | "
```
**NOTE:** `stdout_subtitles` and `stdout_title` only work when `--stdout` is used on its own<br \>
without any args.
### Info
- You can now display info without a subtitle. eg. `info memory`
- Added `--disable` which allows you to stop an info line from appearing at launch.<br \>
- Added `--underline` and `$underline` which allow you to toggle visibility of the<br \>
underline at launch and in your config.
```sh
# Stop cpu, gpu, disk and shell functions from being called
fetch --disable cpu gpu disk shell
```
**Kernel:** Added `--kernel_shorthand` and `$kernel_shorthand` to print less or more kernel info<br \>
**Window Manager:** Added support for `$XINITRC`<br \>
**GTK:** Fix incorrect GTK3 theme being displayed<br \>
**CPU:** `cpu_shorthand`: New substitutions<br \>
**GPU:** `[Linux]` Count the number of identical GPUs. eg. `Nvidia Geforce GTX 970 x 2`<br \>
**Memory:** `[Mac OS X]` Added wired memory to memory usage.<br \>
**Distro:**
- Added support for showing OS architecture. eg `Arch Linux x86_64`, `Windows 7 Ultimate 64-bit` \[1\]
- Mac OS X: Added support for showing Max OS X build version. \[2\]
- Windows: Distro now displays Windows edition. eg. `Windows 7 Ultimate`
\[1\] You can toggle this using `--os_arch` and `$os_arch`.<br \>
\[2\] You can toggle it using `--osx_buildversion` and `$osx_buildversion`.
**Shell:**
- Added `--shell_version` and `$shell_version` to hide/show your shell's version.
- Added `--shell_path` and `$shell_path` to hide/show the path to your shell
**Birthday:**
- Added `birthday` which prints the age of your OS install.
- Added `--birthday_shorthand` and `$birthday_shorthand` to shorten/lengthen<br \>
the output of birthday.
- Added `--birthday_time` and `$birthday_time` to show/hide the time in the output.
**Battery:**
- Added `battery` which prints the battery usage percentage for each battery<br \>
in your system.
- Linux: Added `battery_num` which allows you to choose which battery to display, <br \>
it also takes the value `all` which will print all batteries line by line.
- Linux: Added `battery_shorthand` which when set to `on` prints each battery on the<br \>
same line like so:
```sh
# battery_shorthand="on"
Battery: 10%, 5%, 67%
# battery_shorthand="off"
Battery0: 10%
Battery1: 5%
Battery2: 67%
# If there's only a single battery in the system
# we ommit the numbered title.
Battery: 10%
```
- **NOTE:** This currently doesn't support BSD systems as we have no one to help us test
- See **[Issue #46](https://github.com/dylanaraps/fetch/issues/46)**

117
1.2.md Normal file
View File

@@ -0,0 +1,117 @@
# Fetch 1.2
This new release comes with a few config breaking changes, see this wiki page<br \>
for info on how you can workaround the issues.
https://github.com/dylanaraps/fetch/wiki/Following-HEAD
- Fetch now has a **gitter** chatroom. [![Gitter](https://badges.gitter.im/dylanaraps/fetch.svg)](https://gitter.im/dylanaraps/fetch?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
- Fixed text padding when the user didn't have the locale `en_US.UTF8` installed.
- Cleaned up parts of the script.
### OS
Fetch is now at support parity with Screenfetch. We support all the Linux distros<br \>
Screenfetch supports excluding the distros that have been discontinued.
Added support for these distros:
- `Puppy Linux`
- `Kali Linux`
- `openSUSE`
- `Raspbian`
- `Mageia`
- `PCLinuxOS`
- `Zorin OS`
- `Tails`
- `BLAG`
- `Void Linux`
- `Trisquel`
- `Solus`
- `Peppermint`
- `NixOS`
- `Chakra`
- `Mandriva`
- `gNewSense`
- `LMDE`
- `KaOS`
- `Sabayon`
- `Frugalware`
- `Chapeau`
- `Slackware`
- `Scientific Linux`
- `Exherbo`
- `Chrome OS`
- `Chromium OS`
### Makefile
- Fixed makefile on OS X El Captain.
- `$PREFIX` is now also used when installing ascii art and the default config
### Wallpaper
- Fetch now supports using `MATE` desktop's wallpapers.
- Fetch now fallsback to ascii mode if the found wallpaper is an xml file. This<br \>
fixes issues where the wallpaper set by gsettings is an xml file.
### Info
**Desktop Environment**:
- Added support for showing the user's DE.
**Window Manager**:
- `xprop` is now a required dependency. See **[#79](https://github.com/dylanaraps/fetch/issues/79)**
- Renamed 'windowmanager' to 'wm'
**IP Address**:
- Added function to get your local IP
- Added function to get your public IP \[1\]
- Added `--ip_host` and `$public_ip_host` which allow you to change the website we<br \>
ping for the public IP.
\[1\] Public IP requires an internet connection as we ping a website.
**Packages**:
- Check for packages based on which package manager is installed instead of<br \>
using a hardcoded list of distros.
**Theme**:
- Added support for getting DE theme.
- Added support for getting KDE theme.
- Renamed `getgtk` to `getstyle`.
- Dropped the `gtk` from these printinfo functions `gtktheme`, `gtkicons`<br \>
and `gtkfont`. Theme output will be blank until you make these changes:
```sh
# Old Naming
info "GTK Theme" gtktheme
info "Icons" gtkicons
info "Font" gtkfont
# New Naming
info "Theme" theme
info "Icons" icons
info "Font" font
```
**GPU**:
- `gpu_shorthand` is now enabled by default.
- We now favor showing the dedicated GPU over the integrated one.
**Song**:
- Added support for `MOC`.
- We now check to see if the player is running before printing anything.
- We now check playback state and show it if relevent.
**Uptime**:
- [Linux] Fixed uptime when it's under 1 minute.
### Ascii Art
- `--ascii_distro` now also enables ascii mode.
- Fix missing ascii art when fetch is installed in /usr/local
- Update Deepin's ascii art to their new logo

View File

@@ -9,9 +9,6 @@ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE

View File

@@ -1,21 +1,21 @@
PREFIX ?= usr
PREFIX ?= /usr
RM ?= rm -f
INSTALL_DIR ?= install -m755 -d
INSTALL_PROG ?= install -m755 -D
INSTALL_FILE ?= install -m644 -D
INSTALL_PROG ?= install -m755
INSTALL_FILE ?= install -m644
all:
@echo Run \'make install\' to install Fetch
install:
$(INSTALL_DIR) $(DESTDIR)/$(PREFIX)/bin
$(INSTALL_DIR) $(DESTDIR)/usr/share/fetch/ascii/distro
$(INSTALL_PROG) fetch $(DESTDIR)/$(PREFIX)/bin/fetch
$(INSTALL_PROG) config/config $(DESTDIR)/usr/share/fetch/config
$(INSTALL_PROG) ascii/distro/* $(DESTDIR)/usr/share/fetch/ascii/distro
$(INSTALL_DIR) $(DESTDIR)$(PREFIX)/bin
$(INSTALL_DIR) $(DESTDIR)$(PREFIX)/share/fetch/ascii/distro
$(INSTALL_PROG) fetch $(DESTDIR)$(PREFIX)/bin/fetch
$(INSTALL_PROG) config/config $(DESTDIR)$(PREFIX)/share/fetch/config
$(INSTALL_PROG) ascii/distro/* $(DESTDIR)$(PREFIX)/share/fetch/ascii/distro
uninstall:
$(RM) $(DESTDIR)/$(PREFIX)/bin/fetch
$(RM) -r $(DESTDIR)/usr/share/fetch
$(RM) $(DESTDIR)$(PREFIX)/bin/fetch
$(RM) -r $(DESTDIR)$(PREFIX)/share/fetch

View File

@@ -1,5 +1,7 @@
# fetch
[![Gitter](https://badges.gitter.im/dylanaraps/fetch.svg)](https://gitter.im/dylanaraps/fetch?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
This is the home of my fetch script! This script gathers info <br />
about your system and prints it to the terminal next to an image, <br \>
your distro's logo or any ascii art of your choice!
@@ -46,7 +48,7 @@ your distro's logo or any ascii art of your choice!
## Features
- Supports **Linux**, **Mac OS X**, **BSD** and **Windows** (Cygwin)
- Supports **Linux**, **Mac OS X**, **BSD (FreeBSD, OpenBSD & NetBSD)** and **Windows** (Cygwin)
- 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.
- Take a screenshot of your desktop on script finish.
@@ -65,8 +67,9 @@ your distro's logo or any ascii art of your choice!
### Required dependencies:
- `Bash 4.0+`
- `procps-ng`
- `Bash 4.0+`
- `xprop` \[3\]
- `procps-ng`
- Not required on OS X
@@ -77,7 +80,6 @@ your distro's logo or any ascii art of your choice!
##### Linux / BSD
- Window Manager: `wmctrl` \[3\]
- Wallpaper: `feh`, `nitrogen` or `gsettings`
- Current Song: `mpc` or `cmus`
- Resolution: `xorg-xdpyinfo`
@@ -88,8 +90,7 @@ your distro's logo or any ascii art of your choice!
\[2\] You can enable the `iTerm2` image backend by using the launch flag `--image_backend iterm2` or by<br \>
changing the config option `$image_backend` to `iterm2`.
\[3\] You should install wmctrl if the builtin window manager detection isn't working for you. The builtin<br \>
detection works for most people and is generally faster which is why wmctrl isn't default.
\[3\] See **[#79](https://github.com/dylanaraps/fetch/issues/79)** about why this is now a required dependency.
\[4\] You can use the launch flag `--scrot_cmd` or change the config option `$scrot_cmd` to your screenshot<br \>
program's cmd and fetch will use it instead of scrot.
@@ -103,6 +104,11 @@ program's cmd and fetch will use it instead of scrot.
## Installation
Those using a git version of fetch should check this page after<br \>
updating, this page lists any breaking changes that were made and<br \>
how you can workaround them.
https://github.com/dylanaraps/fetch/wiki/Following-HEAD
### Arch
@@ -125,6 +131,7 @@ program's cmd and fetch will use it instead of scrot.
1. Download the latest source at https://github.com/dylanaraps/fetch
2. Run `make install` inside the script directory to install the script.
- **El Captain**: `PREFIX=/usr/local make install`
**NOTE:** Fetch can be uninstalled easily using `make uninstall`.
@@ -238,8 +245,9 @@ alias fetch2="fetch \
--shell_version on/off Enable/Disable showing \$SHELL version
--battery_num num Which battery to display, default value is 'all'
--battery_shorthand on/off Whether or not each battery gets its own line/title
--ip_host url Url to ping for public IP
--birthday_shorthand on/off Shorten the output of birthday
--birthday_time on/ff Enable/Disable showing the time in birthday output
--birthday_time on/off Enable/Disable showing the time in birthday output
Text Colors:
--title_color num Change the color of the title
@@ -272,8 +280,6 @@ alias fetch2="fetch \
--shuffle_dir path/to/dir Which directory to shuffle for an image.
--font_width px Used to automatically size the image
--image_position left/right Where to display the image: (Left/Right)
--split_size num Width of img/text splits, A value of 2 makes each
split half the terminal width and etc.
--crop_mode mode Which crop mode to use
Takes the values: normal, fit, fill
--crop_offset value Change the crop offset for normal mode.

19
ascii/distro/blag Normal file
View File

@@ -0,0 +1,19 @@
"\
${c1} d
,MK:
xMMMX:
.NMMMMMX;
lMMMMMMMM0clodkO0KXWW:
KMMMMMMMMMMMMMMMMMMX'
.;d0NMMMMMMMMMMMMMMMMMMK.
.;dONMMMMMMMMMMMMMMMMMMMMMMx
'dKMMMMMMMMMMMMMMMMMMMMMMMMl
.:xKWMMMMMMMMMMMMMMMMMMM0.
.:xNMMMMMMMMMMMMMMMMMK.
lMMMMMMMMMMMMMMMMMMK.
,MMMMMMMMWkOXWMMMMMM0
.NMMMMMNd. \`':ldko
OMMMK:
oWk,
;:
"

20
ascii/distro/chakra Normal file
View File

@@ -0,0 +1,20 @@
"\
${c1} _ _ _ \"kkkkkkkk.
,kkkkkkkk., \'kkkkkkkkk,
,kkkkkkkkkkkk., \'kkkkkkkkk.
,kkkkkkkkkkkkkkkk,\'kkkkkkkk,
,kkkkkkkkkkkkkkkkkkk\'kkkkkkk.
\"\'\'\"\'\'\',;::,,\"\'\'kkk\'\'kkkkk; __
,kkkkkkkkkk, \"k\'\'kkkkk\' ,kkkk
,kkkkkkk\' ., \' .: \'kkkk\',kkkkkk
,kkkkkkkk\'.k\' , ,kkkk;kkkkkkkkk
,kkkkkkkk\';kk \'k \"\'k\',kkkkkkkkkkkk
.kkkkkkkkk.kkkk.\'kkkkkkkkkkkkkkkkkk\'
;kkkkkkkk\'\'kkkkkk;\'kkkkkkkkkkkkk\'\'
\'kkkkkkk; \'kkkkkkkk.,\"\"\'\'\"\'\'\"\"
\'\'kkkk; \'kkkkkkkkkk.,
\';\' \'kkkkkkkkkkkk.,
';kkkkkkkkkk\'
';kkkkkk\'
\"\'\'\"
"

20
ascii/distro/chapeau Normal file
View File

@@ -0,0 +1,20 @@
"\
${c2} .-/-.
${c2} ////////.
${c2} ////////${c1}y+${c2}//.
${c2} ////////${c1}mMN${c2}/////.
${c2} ////////${c1}mMN+${c2}////////.
${c2} ////////////////////////.
${c2} /////////+${c1}shhddhyo${c2}+////////.
${c2} ////////${c1}ymMNmdhhdmNNdo${c2}///////.
${c2} ///////+${c1}mMms${c2}////////${c1}hNMh${c2}///////.
${c2} ///////${c1}NMm+${c2}//////////${c1}sMMh${c2}///////
${c2} //////${c1}oMMNmmmmmmmmmmmmMMm${c2}///////
${c2} //////${c1}+MMmssssssssssssss+${c2}///////
${c2} \`//////${c1}yMMy${c2}////////////////////
${c2} \`//////${c1}smMNhso++oydNm${c2}////////
${c2} \`///////${c1}ohmNMMMNNdy+${c2}///////
${c2} \`//////////${c1}++${c2}//////////
${c2} \`////////////////.
${c2} -////////-
"

20
ascii/distro/chrome Normal file
View File

@@ -0,0 +1,20 @@
"\
${c2} .,:loool:,.
${c2} .,coooooooooooooc,.
${c2} .,lllllllllllllllllllll,.
${c2} ;ccccccccccccccccccccccccc;
${c1} '${c2}ccccccccccccccccccccccccccccc.
${c1} ,oo${c2}c::::::::okO${c5}000${c3}0OOkkkkkkkkkkk:
${c1} .ooool${c2};;;;:x${c5}K0${c4}kxxxxxk${c5}0X${c3}K0000000000.
${c1} :oooool${c2};,;O${c5}K${c4}ddddddddddd${c5}KX${c3}000000000d
${c1} lllllool${c2};l${c5}N${c4}dllllllllllld${c5}N${c3}K000000000
${c1} lllllllll${c2}o${c5}M${c4}dccccccccccco${c5}W${c3}K000000000
${c1} ;cllllllllX${c5}X${c4}c:::::::::c${c5}0X${c3}000000000d
${c1} .ccccllllllO${c5}Nk${c4}c;,,,;cx${c5}KK${c3}0000000000.
${c1} .cccccclllllxOO${c5}OOO${c1}Okx${c3}O0000000000;
${c1} .:ccccccccllllllllo${c3}O0000000OOO,
${c1} ,:ccccccccclllcd${c3}0000OOOOOOl.
${c1} '::ccccccccc${c3}dOOOOOOOkx:.
${c1} ..,::cccc${c3}xOOOkkko;.
${c1} ..,:${c3}dOkxl:.
"

View File

@@ -1,18 +0,0 @@
"\
${c2} ${c1}███${c2} ${c1}███${c2} ${c1}███${c2}
${c2} ${c1}███${c2} ${c1}███${c2} ${c1}███${c2}
${c2} ${c1}███${c2} ${c1}███${c2} ${c1}███${c2}
${c2} ${c1}███${c2} ${c1}███${c2} ${c1}███${c2}
${c2} ${c1}████████████████████████████${c2} ${c1}███${c2}
${c2} ${c1}████████████████████████████${c2} ${c1}███${c2}
${c2} ${c1}███${c2} ${c1}███${c2} ${c1}███${c2}
${c2} ${c1}███${c2} ${c1}███${c2} ${c1}███${c2}
${c2} ${c1}███${c2} ${c1}███${c2} ${c1}███${c2}
${c2} ${c1}███${c2} ${c1}███${c2} ${c1}███${c2}
${c2} ${c1}████████████████████████████${c2} ${c1}███${c2}
${c2} ${c1}████████████████████████████${c2} ${c1}███${c2}
${c2} ${c1}███${c2} ${c1}███${c2}
${c2} ${c1}███${c2} ${c1}███${c2}
${c2} ${c1}███${c2} ${c1}███${c2} ${c1}███${c2}
${c2} ${c1}███${c2} ${c1}███${c2} ${c1}███${c2}
"

View File

@@ -1,21 +1,21 @@
"\
${c1} eeeeeeeeeeeeeeeeeeeeeeeeeeee
${c1} eee eeeeeee eeeeeeee
${c1}ee eeeeeeeee eeeeeeeee ee
${c1}e eeeeeeeee eeeeeeeee e
${c1}e eeeeeee eeeeeeeeee e
${c1}e eeeeee eeeee e
${c1}e eeeee eee eee e
${c1}e eeeee ee eeeeee e
${c1}e eeeee eee eee e
${c1}e eeeeeeeeee eeee e
${c1}e eeeee eeee e
${c1}e eeeeee e
${c1}e eeeeeee e
${c1}e eee eeeeeeee e
${c1}eeeeeeeeeeeeeeee e
${c1}eeeeeeeeeeeee ee
${c1} eeeeeeeeeee eee
${c1} eeeeeeeeeeeeeeeeeeeeeeeeeeee
${c1} ............
.';;;;;. .,;,.
.,;;;;;;;. ';;;;;;;.
.;::::::::' .,::;;,''''',.
,'.:::::::: .;;'. ';
;' 'cccccc, ,' :: '.. .:
,, :ccccc. ;: .c, '' :. ,;
.l. cllll' ., .lc :; .l' l.
.c :lllc ;cl: .l' .ll. :'
.l 'looc. . ,o: 'oo' c,
.o. .:ool::coc' .ooo' o.
:: ..... .;dddo ;c
l:... .';lddddo. ,o
lxxxxxdoolllodxxxxxxxxxc :l
,dxxxxxxxxxxxxxxxxxxl. 'o,
,dkkkkkkkkkkkkko;. .;o;
.;okkkkkdl;. .,cl:.
.,:cccccccc:,.
"

24
ascii/distro/exherbo Normal file
View File

@@ -0,0 +1,24 @@
"\
${c1} ,
${c1} OXo.
${c1} NXdX0: .cok0KXNNXXK0ko:.
${c1} KX '0XdKMMK;.xMMMk, .0MMMMMXx; ...
${c1} 'NO..xWkMMx kMMM cMMMMMX,NMWOxOXd.
${c1} cNMk NK .oXM. OMMMMO. 0MMNo kW.
${c1} lMc o: ., .oKNk; ;NMMWlxW'
${c1} ;Mc .. .,,' .0M${c2}g;${c1}WMN'dWMMMMMMO
${c1} XX ,WMMMMW. cM${c2}cfli${c1}WMKlo. .kMk
${c1} .Mo .WM${c2}GD${c1}MW. XM${c2}WO0${c1}MMk oMl
${c1} ,M: ,XMMWx::,''oOK0x; NM.
${c1} 'Ml ,kNKOxxxxxkkO0XXKOd:. oMk
${c1} NK .0Nxc${c3}:::::::::::::::${c1}fkKNk, .MW
${c1} ,Mo .NXc${c3}::${c1}qXWXb${c3}::::::::::${c1}oo${c3}::${c1}lNK. .MW
${c1} ;Wo oMd${c3}:::${c1}oNMNP${c3}::::::::${c1}oWMMMx${c3}:${c1}c0M; lMO
${c1} 'NO;W0c${c3}:::::::::::::::${c1}dMMMMO${c3}::${c1}lMk .WM'
${c1} xWONXdc${c3}::::::::::::::${c1}oOOo${c3}::${c1}lXN. ,WMd
${c1} 'KWWNXXK0Okxxo,${c3}:::::::${c1},lkKNo xMMO
${c1} :XMNxl,';:lodxkOO000Oxc. .oWMMo
${c1} 'dXMMXkl;,. .,o0MMNo'
${c1} ':d0XWMMMMWNNNNMMMNOl'
${c1} ':okKXWNKkl'
"

25
ascii/distro/frugalware Normal file
View File

@@ -0,0 +1,25 @@
"\
${c2} \`++/::-.\`
${c2} /o+++++++++/::-.\`
${c2} \`o+++++++++++++++o++/::-.\`
${c2} /+++++++++++++++++++++++oo++/:-.\`\`
${c2} .o+ooooooooooooooooooosssssssso++oo++/:-\`
${c2} ++osoooooooooooosssssssssssssyyo+++++++o:
${c2} -o+ssoooooooooooosssssssssssssyyo+++++++s\`
${c2} o++ssoooooo++++++++++++++sssyyyyo++++++o:
${c2} :o++ssoooooo${c1}/-------------${c2}+syyyyyo+++++oo
${c2} \`o+++ssoooooo${c1}/-----${c2}+++++ooosyyyyyyo++++os:
${c2} /o+++ssoooooo${c1}/-----${c2}ooooooosyyyyyyyo+oooss
${c2} .o++++ssooooos${c1}/------------${c2}syyyyyyhsosssy-
${c2} ++++++ssooooss${c1}/-----${c2}+++++ooyyhhhhhdssssso
${c2} -s+++++syssssss${c1}/-----${c2}yyhhhhhhhhhhhddssssy.
${c2} sooooooyhyyyyyh${c1}/-----${c2}hhhhhhhhhhhddddyssy+
${c2} :yooooooyhyyyhhhyyyyyyhhhhhhhhhhdddddyssy\`
${c2} yoooooooyhyyhhhhhhhhhhhhhhhhhhhddddddysy/
${c2}-ysooooooydhhhhhhhhhhhddddddddddddddddssy
${c2} .-:/+osssyyyysyyyyyyyyyyyyyyyyyyyyyyssy:
${c2} \`\`.-/+oosysssssssssssssssssssssss
${c2} \`\`.:/+osyysssssssssssssh.
${c2} \`-:/+osyyssssyo
${c2} .-:+++\`
"

14
ascii/distro/gnewsense Normal file
View File

@@ -0,0 +1,14 @@
"\
${c1} ..,,,,..
.oocchhhhhhhhhhccoo.
.ochhlllllllc hhhhhh ollllllhhco.
ochlllllllllll hhhllllllhhh lllllllllllhco
.cllllllllllllll hlllllo +hllh llllllllllllllc.
ollllllllllhco\'\' hlllllo +hllh \`\`ochllllllllllo
hllllllllc\' hllllllllllllh \`cllllllllh
ollllllh +llllllllllll+ hllllllo
\`cllllh. ohllllllho .hllllc\'
ochllc. ++++ .cllhco
\`+occooo+. .+ooocco+\'
\`+oo++++ ++++oo+\'
"

18
ascii/distro/kaos Normal file
View File

@@ -0,0 +1,18 @@
"\
${c1} ████████ ████████
${c1} ██████ ██████
${c1} ████ ████
${c1} █ █
${c1} █
${c1} █ ${c2} ████████ ████████
${c1} █ ${c2} ██████ ██████
${c1} █ ${c2} ████ ████
${c1} █ ${c2} █ █
${c1} █ ${c2} █
${c1} ${c3}███████ ███████
${c1} ${c3} █████ █████${c2} █
${c1} █${c3} ███ ███ ${c2} █
${c1} █ ${c3} █ ${c2} █
${c1} █ ${c3}█ ${c2} █
${c1} █ ${c3}█ ${c2} █
"

19
ascii/distro/lmde Normal file
View File

@@ -0,0 +1,19 @@
"\
${c1}\`.-::---..
${c2} .:++++ooooosssoo:.
${c2} .+o++::. \`.:oos+.
${c2} :oo:.\` -+oo${c1}:
${c2} ${c1}\`${c2}+o/\` .${c1}::::::${c2}-. .++-${c1}\`
${c2} ${c1}\`${c2}/s/ .yyyyyyyyyyo: +o-${c1}\`
${c2} ${c1}\`${c2}so .ss ohyo\` :s-${c1}:
${c2} ${c1}\`${c2}s/ .ss h m myy/ /s\`${c1}\`
${c2} \`s: \`oo s m Myy+-o:\`
${c2} \`oo :+sdoohyoydyso/.
${c2} :o. .:////////++:
${c2} \`/++ ${c1}-:::::-
${c2} ${c1}\`${c2}++-
${c2} ${c1}\`${c2}/+-
${c2} ${c1}.${c2}+/.
${c2} ${c1}.${c2}:+-.
${c2} \`--.\`\`
"

21
ascii/distro/mageia Normal file
View File

@@ -0,0 +1,21 @@
"\
${c2} .°°.
${c2} °° .°°.
${c2} .°°°. °°
${c2} . .
${c2} °°° .°°°.
${c2} .°°°. '___'
${c1} .${c2}'___' ${c1} .
${c1} :dkxc;'. ..,cxkd;
${c1} .dkk. kkkkkkkkkk .kkd.
${c1} .dkk. ';cloolc;. .kkd
${c1} ckk. .kk;
${c1} xO: cOd
${c1} xO: lOd
${c1} lOO. .OO:
${c1} .k00. .00x
${c1} .k00; ;00O.
${c1} .lO0Kc;,,,,,,;c0KOc.
${c1} ;d00KKKKKK00d;
${c1} .,KKKK,.
"

21
ascii/distro/nixos Normal file
View File

@@ -0,0 +1,21 @@
"\
${c1} ::::. ${c2}'::::: ::::'
${c1} '::::: ${c2}':::::. ::::'
${c1} ::::: ${c2}'::::.:::::
${c1} .......:::::..... ${c2}::::::::
${c1} ::::::::::::::::::. ${c2}:::::: ${c1}::::.
${c1} ::::::::::::::::::::: ${c2}:::::. ${c1}.::::'
${c2} ..... ::::' ${c1}:::::'
${c2} ::::: '::' ${c1}:::::'
${c2} ........::::: ' ${c1}:::::::::::.
${c2}::::::::::::: ${c1}:::::::::::::
${c2} ::::::::::: ${c1}.. ${c1}:::::
${c2} .::::: ${c1}.::: ${c1}:::::
${c2} .::::: ${c1}::::: ${c1}''''' ${c2}.....
${c2} ::::: ${c1}':::::. ${c2}......:::::::::::::'
${c2} ::: ${c1}::::::. ${c2}':::::::::::::::::'
${c1} .:::::::: ${c2}'::::::::::
${c1} .::::''::::. ${c2}'::::.
${c1} .::::' ::::. ${c2}'::::.
${c1} .:::: :::: ${c2}'::::.
"

17
ascii/distro/openmandriva Normal file
View File

@@ -0,0 +1,17 @@
"\
${c2} \`\`
${c2} \`-.
${c1} \` ${c2}.---
${c1} -/ ${c2}-::--\`
${c1} \`++ ${c2}\`----...\`\`\`-:::::.
${c1} \`os. ${c2}.::::::::::::::-\`\`\` \` \`
${c1} +s+ ${c2}.::::::::::::::::---...--\`
${c1} -ss: ${c2}\`-::::::::::::::::-.\`\`.\`\`
${c1} /ss- ${c2}.::::::::::::-.\`\` \`
${c1} +ss: ${c2}.::::::::::::-
${c1} /sso ${c2}.::::::-::::::-
${c1} .sss/ ${c2}-:::-.\` .:::::
${c1} /sss+. ${c2}..\`${c1} \`--\` ${c2}.:::
${c1} -ossso+/:://+/-\` ${c2}.:\`
${c1} -/+ooo+/-. ${c2}\`
"

21
ascii/distro/pclinuxos Normal file
View File

@@ -0,0 +1,21 @@
"\
${c1}mhhhyyyyhhhdN
dyssyhhhhhhhhhhhssyhN
Nysyhhyo/:-.....-/oyhhhssd
Nsshhy+. \`/shhysm
dohhy/ -shhsy
dohhs\` /hhys
N+hho ${c2}+ssssss+- .+syhys+ ${c1}/hhsy
ohhh\` ${c2}ymmo++hmm+\`smmy/::+y\` ${c1}shh+
+hho ${c2}ymm- /mmy+mms ${c1}:hhod
/hh+ ${c2}ymmhhdmmh.smm/ ${c1}.hhsh
+hhs ${c2}ymm+::-\` /mmy\` \` ${c1}/hh+m
yyhh- ${c2}ymm- /dmdyosyd\` ${c1}\`yhh+
ohhy\` ${c2}://\` -/+++/- ${c1}ohhom
N+hhy- \`shhoh
sshho. \`+hhyom
dsyhhs/. \`:ohhhoy
dysyhhhso///://+syhhhssh
dhyssyhhhhhhyssyyhN
mddhdhdmN
"

21
ascii/distro/peppermint Normal file
View File

@@ -0,0 +1,21 @@
"\
${c2} 8ZZZZZZ${c1}MMMMM
${c2} .ZZZZZZZZZ${c1}MMMMMMM.
${c1} MM${c2}ZZZZZZZZZ${c1}MMMMMMM${c2}ZZZZ
${c1} MMMMM${c2}ZZZZZZZZ${c1}MMMMM${c2}ZZZZZZZM
${c1} MMMMMMM${c2}ZZZZZZZ${c1}MMMM${c2}ZZZZZZZZZ.
${c1} MMMMMMMMM${c2}ZZZZZZ${c1}MMM${c2}ZZZZZZZZZZZI
${c1} MMMMMMMMMMM${c2}ZZZZZZ${c1}MM${c2}ZZZZZZZZZZ${c1}MMM
${c2} .ZZZ${c1}MMMMMMMMMM${c2}IZZ${c1}MM${c2}ZZZZZ${c1}MMMMMMMMM
${c2} ZZZZZZZ${c1}MMMMMMMM${c2}ZZ${c1}M${c2}ZZZZ${c1}MMMMMMMMMMM
${c2} ZZZZZZZZZZZZZZZZ${c1}M${c2}Z${c1}MMMMMMMMMMMMMMM
${c2} .ZZZZZZZZZZZZZ${c1}MMM${c2}Z${c1}M${c2}ZZZZZZZZZZ${c1}MMMM
${c2} .ZZZZZZZZZZZ${c1}MMM${c2}7ZZ${c1}MM${c2}ZZZZZZZZZZ7${c1}M
${c2} ZZZZZZZZZ${c1}MMMM${c2}ZZZZ${c1}MMMM${c2}ZZZZZZZ77
${c1} MMMMMMMMMMMM${c2}ZZZZZ${c1}MMMM${c2}ZZZZZ77
${c1} MMMMMMMMMM${c2}7ZZZZZZ${c1}MMMMM${c2}ZZ77
${c1} .MMMMMMM${c2}ZZZZZZZZ${c1}MMMMM${c2}Z7Z
${c1} MMMMM${c2}ZZZZZZZZZ${c1}MMMMMMM
${c2} NZZZZZZZZZZZ${c1}MMMMM
${c2} ZZZZZZZZZ${c1}MM)
"

20
ascii/distro/puppy Normal file
View File

@@ -0,0 +1,20 @@
"\
${c1} \`-/osyyyysosyhhhhhyys+-
${c1} -ohmNNmh+/hMMMMMMMMNNNNd+dMMMMNM+
${c1} yMMMMNNmmddo/NMMMNNNNNNNNNo+NNNNNy
${c1} .NNNNNNmmmddds:MMNNNNNNNNNNNh:mNNN/
${c1} -NNNdyyyhdmmmd\`dNNNNNmmmmNNmdd/os/
${c1} .Nm+shddyooo+/smNNNNmmmmNh. :mmd.
${c1} NNNNy:\` ./hmmmmmmmNNNN: hNMh
${c1} NMN- -++- +NNNNNNNNNNm+..-sMMMM-
${c1} .MMo oNNNNo hNNNNNNNNmhdNNNMMMMM+
${c1} .MMs /NNNN/ dNmhs+:-\` yMMMMMMMM+
${c1} mMM+ .. \`sNN+. hMMMMhhMMM-
${c1} +MMMmo:...:sNMMMMMms:\` hMMMMm.hMMy
${c1} yMMMMMMMMMMMNdMMMMMM::/+o+//dMMd\`
${c1} sMMMMMMMMMMN+:oyyo:sMMMNNMMMNy\`
${c1} :mMMMMMMMMMMMmddNMMMMMMMMmh/
${c1} /dMMMMMMMMMMMMMMMMMMNdy/\`
${c1} .+hNMMMMMMMMMNmdhs/.
${c1} .:/+ooo+/:-.
"

20
ascii/distro/raspbian Normal file
View File

@@ -0,0 +1,20 @@
"\
${c1} .',;:cc;,'. .,;::c:,,.
${c1},ooolcloooo: 'oooooccloo:
${c1}.looooc;;:ol :oc;;:ooooo'
${c1};oooooo: ,ooooooc.
${c1}.,:;'. .;:;'.
${c2}.... ..'''''. ....
${c2}.''. ..'''''. ..''.
${c2}.. ..... ..... ..
${c2}. .''''''' .''''''. .
${c2}.'' .'''''''' .'''''''. ''.
${c2}''' ''''''' .'''''' '''
${c2}.' ........... ... .'.
${c2}.... ''''''''. .''.
${c2}'''''. ''''''''. .'''''
${c2}'''''. .'''''. .'''''.
${c2}..''. . .''..
${c2}.'''''''
${c2}......
"

20
ascii/distro/sabayon Normal file
View File

@@ -0,0 +1,20 @@
"\
${c2} ...........
${c2} .. ..
${c2} .. ..
${c2} .. ${c1}o ${c2}..
${c2} .. ${c1}:W' ${c2}..
${c2} .. ${c1}.d. ${c2}..
${c2}:. ${c1}.KNO ${c2}.:
${c2}:. ${c1}cNNN. ${c2}.:
${c2}: ${c1}dXXX, ${c2}:
${c2}: ${c1}. dXXX, .cd, ${c2}:
${c2}: ${c1}'kc .. dKKK. ,ll;:' ${c2}:
${c2}: ${c1}.xkkxc;..dkkkc',cxkkl ${c2}:
${c2}:. ${c1}.,cdddddddddddddo:. ${c2}.:
${c2} .. ${c1}:lllllll: ${c2}..
${c2} .. ${c1}',,,,, ${c2}..
${c2} .. ..
${c2} .. ..
${c2} ...............
"

22
ascii/distro/scientific Normal file
View File

@@ -0,0 +1,22 @@
"\
${c1} =/;;/-
${c1} +: //
${c1} /; /;
${c1} -X H.
${c1} .//;;;:;;-, X= :+ .-;:=;:;#;.
${c1} M- ,=;;;#:, ,:#;;:=, ,@
${c1} :# :#.=/++++/=.$= #=
${c1} ,#; #/:+/;,,/++:+/ ;+.
${c1} ,+/. ,;@+, ,#H;, ,/+,
${c1} ;+;;/= @. ${c2}.H${c3}#${c2}#X ${c1}-X :///+;
${c1} ;+=;;;.@, ${c3}.X${c2}M${c3}@$. ${c1}=X.//;=#/.
${c1} ,;: :@#= =\$H: .+#-
${c1} ,#= #;-///==///-// =#,
${c1} ;+ :#-;;;:;;;;-X- +:
${c1} @- .-;;;;M- =M/;;;-. -X
${c1} :;;::;;-. #- :+ ,-;;-;:==
${c1} ,X H.
${c1} ;/ #=
${c1} // +;
${c1} '////'
"

20
ascii/distro/solus Normal file
View File

@@ -0,0 +1,20 @@
"\
${c1} e e
${c1} eee ee
${c1} eeee eee
${c2} wwwwwwwww${c1}eeeeee
${c2} wwwwwwwwwwwwwww${c1}eee
${c2} wwwwwwwwwwwwwwwwwww${c1}eeeeeeee
${c2} wwwww ${c1}eeeee${c2}wwwwww${c1}eeee
${c2} www ${c1}eeee${c2}wwwwww${c1}e
${c2} ww ${c1}ee${c2}wwwwww
${c2} w wwwww
${c2} wwwww
${c2} wwwww
${c2} wwwww
${c2} wwww
${c2} wwww
${c2} wwww
${c2} www
${c2} ww
"

21
ascii/distro/tails Normal file
View File

@@ -0,0 +1,21 @@
"\
${c1} \`\`
./yhNh
syy/Nshh \`:o/
N:dsNshh █ \`ohNMMd
N-/+Nshh \`yMMMMd
N-yhMshh yMMMMd
N-s:hshh █ yMMMMd so//.
N-oyNsyh yMMMMd d Mms.
N:hohhhd:. yMMMMd syMMM+
Nsyh+-..+y+- yMMMMd :mMM+
+hy- -ss/\`yMMMM \`+d+
:sy/. ./yNMMMMm \`\`
.+ys- \`:+hNMMMMMMy/\`
\`hNmmMMMMMMMMMMMMdo.
dMMMMMMMMMMMMMMMMMNh:
+hMMMMMMMMMMMMMMMMMmy.
-oNMMMMMMMMMMmy+.\`
\`:yNMMMds/.\`
.//\`
"

20
ascii/distro/trisquel Normal file
View File

@@ -0,0 +1,20 @@
"\
${c1} ▄▄▄▄▄▄
${c1} ▄█████████▄
${c1} ▄▄▄▄▄▄ ████▀ ▀████
${c1} ▄██████████▄ ████▀ ▄▄ ▀███
${c1} ▄███▀▀ ▀▀████ ███▄ ▄█ ███
${c1}▄███ ▄▄▄ ████▄ ▀██████ ▄███
${c1}███ █▀▀██▄ █████▄ ▀▀ ▄████
${c1}▀███ ███ ███████▄▄ ▄▄██████
${c1} ▀███▄ ▄███ █████████████${c2}████▀
${c1} ▀█████████ ███████${c2}███▀▀▀
▀▀███▀▀ ██${c2}████▀▀
${c2} ██████▀ ▄▄▄▄
${c2} █████▀ ████████
${c2} █████ ███▀ ▀███
${c2} ████▄ ██▄▄▄ ███
${c2} █████▄ ▀▀ ▄██
${c2} ██████▄▄▄████
${c2} ▀▀█████▀▀
"

19
ascii/distro/zorin Normal file
View File

@@ -0,0 +1,19 @@
"\
${c1} \`osssssssssssssssssssso\`
.osssssssssssssssssssssso.
.+oooooooooooooooooooooooo+.
\`::::::::::::::::::::::. .:\`
\`+ssssssssssssssssss+:.\` \`.:+ssso\`
.ossssssssssssssso/. \`-+ossssssso.
ssssssssssssso/-\` \`-/osssssssssssss
.ossssssso/-\` .-/ossssssssssssssso.
\`+sss+:. \`.:+ssssssssssssssssss+\`
\`:. .::::::::::::::::::::::\`
.+oooooooooooooooooooooooo+.
-osssssssssssssssssssssso-
\`osssssssssssssssssssso\`
"

View File

@@ -26,17 +26,20 @@ printinfo () {
info "Uptime" uptime
info "Packages" packages
info "Shell" shell
info "Window Manager" windowmanager
info "GTK Theme" gtktheme
info "Icons" gtkicons
info "Desktop Environment" de
info "Window Manager" wm
info "Theme" theme
info "Icons" icons
info "CPU" cpu
info "GPU" gpu
info "Memory" memory
# info "Font" gtkfont
# info "Font" font
# info "Disk" disk
# info "Resolution" resolution
# info "Battery" battery
# info "Local IP" localip
# info "Public IP" public
# info "Birthday" birthday
# info "Song" song
# info "Visual Style" visualstyle
@@ -96,7 +99,7 @@ speed_type="max"
# Shorten output of the getgpu funcion
# --gpu_shorthand on/off
gpu_shorthand="off"
gpu_shorthand="on"
# Gtk Theme / Icons
@@ -130,6 +133,13 @@ battery_num="all"
battery_shorthand="off"
# IP Address
# Website to ping for the public IP
# --ip_host url
public_ip_host="http://ident.me"
# Birthday
# Whether to show a long pretty output

572
fetch
View File

@@ -6,13 +6,12 @@
#
# Required Dependencies:
# Bash 4.0+
# Text formatting, dynamic image size and padding: tput
# xprop
# [Linux / BSD / Windows] Uptime detection: procps or procps-ng
#
# Optional Dependencies: (You'll lose these features without them)
# Displaying Images: w3m + w3m-img
# Image Cropping: ImageMagick
# More accurate window manager detection: wmctrl
# [ Linux / BSD ] Wallpaper Display: feh, nitrogen or gsettings
# [ Linux / BSD ] Current Song: mpc or cmus
# [ Linux / BSD ] Resolution detection: xorg-xdpyinfo
@@ -21,10 +20,9 @@
# https://github.com/dylanaraps/
# Speed up script by not using unicode
SYS_LOCALE="$LANG"
export LC_ALL=C
export LANG=C
export LANGUAGE=C
# Config Options {{{
@@ -46,9 +44,10 @@ printinfo () {
info "Uptime" uptime
info "Packages" packages
info "Shell" shell
info "Window Manager" windowmanager
info "GTK Theme" gtktheme
info "Icons" gtkicons
info "Desktop Environment" de
info "Window Manager" wm
info "Theme" theme
info "Icons" icons
info "CPU" cpu
info "GPU" gpu
info "Memory" memory
@@ -58,6 +57,8 @@ printinfo () {
# info "Resolution" resolution
# info "Battery" battery
# info "Song" song
# info "Local IP" localip
# info "Public IP" public
# info "Birthday" birthday
# info "Visual Style" visualstyle
@@ -116,7 +117,7 @@ speed_type="max"
# Shorten output of the getgpu funcion
# --gpu_shorthand on/off
gpu_shorthand="off"
gpu_shorthand="on"
# Gtk Theme / Icons
@@ -150,6 +151,13 @@ battery_num="all"
battery_shorthand="off"
# IP Address
# Website to ping for the public IP
# --ip_host url
public_ip_host="http://ident.me"
# Birthday
# Whether to show a long pretty output
@@ -415,23 +423,27 @@ x32="x86"
case "$os" in
"Linux" )
if type -p lsb_release >/dev/null 2>&1; then
distro="$(lsb_release -a 2>/dev/null | awk -F':' '/Description/ {printf $2}')"
distro="$(lsb_release -d 2>/dev/null | awk -F':' '/Description/ {printf $2}')"
distro=${distro/[[:space:]]}
elif type -p crux >/dev/null 2>&1; then
distro="CRUX"
else
distro="$(grep -h '^NAME=' /etc/*ease)"
distro=${distro#NAME\=*}
distro=${distro#\"*}
distro=${distro%*\"}
# Workaround for distros that store the value differently.
[ -z "$distro" ] && distro="$(grep -h 'TAILS_PRODUCT_NAME' /etc/*ease)"
[ -z "$distro" ] && distro="$(awk '/BLAG/ {print $1; exit}' /etc/*ease)"
distro=${distro/*NAME\=}
distro=${distro//\"}
fi
;;
"Mac OS X")
distro="Mac OS X $(sw_vers -productVersion)"
[ "$osx_buildversion" == "on" ] && \
distro+=" $(sw_vers -buildVersion)"
[ "$osx_buildversion" == "on" ] && distro+=" $(sw_vers -buildVersion)"
;;
"OpenBSD")
@@ -500,7 +512,22 @@ getkernel() {
getuptime () {
case "$os" in
"Linux")
uptime="$(uptime -p)"
case "$distro" in
"Puppy Linux"* | "Quirky Werewolf"* | "Precise Puppy"*)
uptime=$(uptime | awk -F ':[0-9]{2}+ |(, ){1}+' '{printf $2}')
uptime=${uptime/ / }
;;
"openSUSE"*)
uptime=$(uptime | awk -F ':[0-9]{2}+[a-z][a-z] |(, ){1}+' '{printf $2}')
uptime=${uptime/ / }
;;
*)
uptime="$(uptime -p)"
[ "$uptime" == "up " ] && uptime="up $(awk -F'.' '{print $1}' /proc/uptime) seconds"
;;
esac
;;
"Mac OS X" | *"BSD")
@@ -554,6 +581,7 @@ getuptime () {
uptime=${uptime/up}
uptime=${uptime/minutes/mins}
uptime=${uptime/minute/min}
uptime=${uptime/seconds/secs}
uptime=${uptime# }
;;
@@ -565,6 +593,7 @@ getuptime () {
uptime=${uptime/ hour/h}
uptime=${uptime/ minutes/m}
uptime=${uptime/ minute/m}
uptime=${uptime/ seconds/s}
uptime=${uptime/,}
uptime=${uptime# }
;;
@@ -576,36 +605,49 @@ getuptime () {
# Package Count {{{
getpackages () {
case "$distro" in
"Arch Linux"* | "Parabola"* | "Manjaro"* | "Antergos"*)
packages="$(pacman -Qq --color never | wc -l)"
case "$os" in
"Linux")
if type -p dpkg >/dev/null 2>&1; then
packages="$(dpkg --get-selections | grep -cv deinstall$)"
elif type -p pacman >/dev/null 2>&1; then
packages="$(pacman -Qq --color never | wc -l)"
elif type -p pkgtool >/dev/null 2>&1; then
packages="$(ls -1 /var/log/packages | wc -l)"
elif type -p rpm >/dev/null 2>&1; then
packages="$(rpm -qa | wc -l)"
elif type -p xbps-query >/dev/null 2>&1; then
packages="$(xbps-query -l | wc -l)"
elif type -p pkginfo >/dev/null 2>&1; then
packages="$(pkginfo -i | wc -l)"
elif type -p pisi >/dev/null 2>&1; then
packages="$(pisi list-installed | wc -l)"
elif type -p pkg >/dev/null 2>&1; then
packages="$(ls -1 /var/db/pkg | wc -l)"
elif type -p emerge >/dev/null 2>&1; then
packages="$(ls -d /var/db/pkg/*/* | wc -l)"
elif type -p nix-env >/dev/null 2>&1; then
packages="$(ls -d -1 /nix/store/*/ | wc -l)"
elif type -p pacman-g2 >/dev/null 2>&1; then
packages="$(pacman-g2 -Q | wc -l)"
elif type -p cave >/dev/null 2>&1; then
cross_packages=$(ls -d -1 /var/db/paludis/repositories/cross-installed/*/data/* | wc -l)
packages=$(ls -d -1 /var/db/paludis/repositories/installed/data/* | wc -l)
packages=$((packages + cross_packages))
fi
;;
"void"*)
packages="$(xbps-query -l | wc -l)"
;;
"Ubuntu"* | *"Mint"* | "CrunchBang"* | "Debian"* | "Kali Linux"* | "Deepin Linux"* | "elementary"*)
packages="$(dpkg --get-selections | grep -cv deinstall$)"
;;
"Slackware"*)
packages="$(ls -1 /var/log/packages | wc -l)"
;;
"Gentoo"* | "Funtoo"*)
packages="$(ls -d /var/db/pkg/*/* | wc -l)"
;;
"Fedora"* | "openSUSE"* | "Red Hat Enterprise Linux"* | "CentOS"*)
packages="$(rpm -qa | wc -l)"
;;
"CRUX"*)
packages="$(pkginfo -i | wc -l)"
;;
"Mac OS X"*)
"Mac OS X")
if [ -d "/usr/local/bin" ]; then
local_packages=$(ls -l /usr/local/bin/ | grep -v "\(../Cellar/\|brew\)" | wc -l)
packages=$((local_packages - 1))
@@ -627,15 +669,16 @@ getpackages () {
fi
;;
"OpenBSD"* | "NetBSD"*)
packages=$(pkg_info | wc -l)
*"BSD")
if type -p pkg_info >/dev/null 2>&1; then
packages=$(pkg_info | wc -l)
elif type -p pkg >/dev/null 2>&1; then
packages=$(pkg info | wc -l)
fi
;;
"FreeBSD"*)
packages=$(pkg info | wc -l)
;;
"Windows"*)
"Windows")
packages=$(cygcheck -cd | wc -l)
# Count chocolatey packages
@@ -644,13 +687,10 @@ getpackages () {
packages=$((packages + choco_packages))
fi
;;
*)
packages="Unknown"
;;
esac
packages=${packages// }
[ -z "$packages" ] && packages="Unknown"
}
# }}}
@@ -694,33 +734,31 @@ getshell () {
# }}}
# Desktop Environment {{{
getde () {
[ "$XDG_CURRENT_DESKTOP" ] && de="$XDG_CURRENT_DESKTOP"
}
# }}}
# Window Manager {{{
getwindowmanager () {
if type -p wmctrl >/dev/null 2>&1; then
windowmanager="$(wmctrl -m | head -n1)"
windowmanager=${windowmanager/Name: }
elif [ "$XDG_CURRENT_DESKTOP" ]; then
windowmanager="$XDG_CURRENT_DESKTOP"
elif [ "$XINITRC" ]; then
windowmanager=$(grep "^[^#]*exec" "$XINITRC")
elif [ -e "$HOME/.xinitrc" ]; then
windowmanager=$(grep "^[^#]*exec" "${HOME}/.xinitrc")
getwm () {
if [ -n "$DISPLAY" ]; then
id="$(xprop -root -notype | \awk '$1=="_NET_SUPPORTING_WM_CHECK:"{print $5}')"
wm="$(xprop -id "$id" -notype -f _NET_WM_NAME 8t)"
wm=${wm/*_NET_WM_NAME = }
wm=${wm/\"}
wm=${wm/\"*}
else
case "$os" in
"Mac OS X") windowmanager="Quartz Compositor" ;;
"Windows") windowmanager="Explorer" ;;
*) windowmanager="Unknown" ;;
"Mac OS X") wm="Quartz Compositor" ;;
"Windows") wm="Explorer" ;;
*) wm="Unknown" ;;
esac
fi
windowmanager="${windowmanager/exec }"
windowmanager="${windowmanager/-session}"
windowmanager="${windowmanager^}"
}
# }}}
@@ -734,6 +772,7 @@ getcpu () {
cpu="$(grep -F 'model name' /proc/cpuinfo)"
cpu=${cpu/model name*: }
cpu=${cpu/ @*}
cpu=${cpu// }
cpu=${cpu%% }
# Get cpu speed
@@ -848,13 +887,18 @@ getcpu () {
getgpu () {
case "$os" in
"Linux")
# Get the GPUs
gpu="$(lspci | grep -F "VGA")"
gpu="$(PATH="/sbin:$PATH" lspci | grep -F "3D")"
# If a GPU with a prefix of '3D' doesn't exist
# fallback to looking for a prefix of 'VGA'
[ -z "$gpu" ] && \
gpu="$(PATH="/sbin:$PATH" lspci | grep -F "VGA")"
gpu=${gpu//??':'??'.'?}
# Count the number of GPUs
count="$(printf "%s" "$gpu" | uniq -c)"
count=${count/ VGA*}
count=${count/ 3D*}
count=${count//[[:space:]]}
# If there's more than one gpu
@@ -867,6 +911,7 @@ getgpu () {
# Format the output
gpu=${gpu/* VGA compatible controller: }
gpu=${gpu/* 3D controller: }
gpu=${gpu/(rev*)}
shopt -s nocasematch
@@ -874,6 +919,7 @@ getgpu () {
intel*)
gpu=${gpu/Intel Corporation }
gpu=${gpu/Haswell-??? }
gpu=${gpu/?th Gen Core Processor}
brand="Intel "
;;
@@ -884,6 +930,7 @@ getgpu () {
gpu=${gpu/Tahiti PRO}
gpu=${gpu/Seymour}
gpu=${gpu/ OEM}
gpu=${gpu/ Cape Verde}
gpu=${gpu/ \[}
gpu=${gpu/\]}
@@ -951,6 +998,7 @@ getgpu () {
gpu=${gpu// OEM}
gpu=${gpu// Mars}
gpu=${gpu// Series}
gpu=${gpu// Controller}
gpu=${gpu/\/*}
fi
@@ -1045,18 +1093,34 @@ getmemory () {
# Song {{{
getsong () {
if type -p mpc >/dev/null 2>&1; then
song="$(mpc current)"
if pgrep "mpd" >/dev/null 2>&1; then
song="$(mpc current 2>/dev/null)"
state=$(mpc | awk -F '\\[|\\]' '/\[/ {printf $2}' 2>/dev/null)
elif type -p cmus >/dev/null 2>&1; then
song="$(cmus-remote -Q | grep "tag artist\|title")"
elif pgrep "cmus" >/dev/null 2>&1; then
song="$(cmus-remote -Q | grep "tag artist\|title" 2>/dev/null)"
song=${song/tag artist }
song=${song/tag title/-}
song=${song//[[:space:]]/ }
state=$(cmus-remote -Q | awk -F ' ' '/status/ {printf $2}' 2>/dev/null)
elif pgrep "mocp" >/dev/null 2>&1; then
song="$(mocp -Q "%artist - %song" 2>/dev/null)"
state="$(mocp -Q "%state" 2>/dev/null)"
else
song="Unknown"
fi
case "$state" in
"paused" | "PAUSE")
song="Paused"
;;
"stopped" | "STOP" | "")
song="Stopped"
;;
esac
}
# }}}
@@ -1086,28 +1150,101 @@ getresolution () {
# }}}
# GTK Theme/Icons/Font {{{
# Theme/Icons/Font {{{
getstyle () {
# Fix weird output when the function
# is run multiple times.
unset gtk2theme gtk3theme
getgtk () {
case "$1" in
theme)
name="gtk-theme-name"
gsettings="gtk-theme"
gconf="gtk_theme"
xfconf="ThemeName"
kde="widgetStyle"
;;
icons)
name="gtk-icon-theme-name"
gsettings="icon-theme"
gconf="icon_theme"
xfconf="IconThemeName"
kde="Theme"
;;
font)
name="gtk-font-name"
gsettings="font-name"
gconf="font_theme"
xfconf="FontName"
kde="font"
;;
esac
# Current DE
desktop="$XDG_CURRENT_DESKTOP"
desktop=${desktop,,}
desktop=${desktop^}
case "$desktop" in
"KDE"*)
if type -p kde5-config >/dev/null 2>&1; then
kde_config_dir=$(kde5-config --localprefix)
elif type -p kde4-config >/dev/null 2>&1; then
kde_config_dir=$(kde4-config --localprefix)
elif type -p kde-config >/dev/null 2>&1; then
kde_config_dir=$(kde-config --localprefix)
fi
if [ -f "${kde_config_dir}/share/config/kdeglobals" ]; then
kde_config_file="${kde_config_dir}/share/config/kdeglobals"
theme=$(grep "^[^#]*$kde" "$kde_config_file")
theme=${theme/${kde}*=}
theme=${theme^}
gtk_shorthand="on"
return
fi
;;
"Cinnamon")
if type -p gsettings >/dev/null 2>&1; then
gtk3theme=$(gsettings get org.cinnamon.desktop.interface $gsettings)
gtk3theme=${gtk3theme//"'"}
gtk2theme=${gtk3theme}
fi
;;
"Gnome"* | "Unity"* | "Budgie")
if type -p gsettings >/dev/null 2>&1; then
gtk3theme=$(gsettings get org.gnome.desktop.interface $gsettings)
gtk3theme=${gtk3theme//"'"}
gtk2theme=${gtk3theme}
elif type -p gconftool-2 >/dev/null 2>&1; then
gtk2theme=$(gconftool-2 -g /desktop/gnome/interface/$gconf)
fi
;;
"Mate"*)
gtk3theme=$(gsettings get org.mate.interface $gsettings)
gtk2theme=${gtk3theme}
;;
"Xfce"*)
if type -p xfconf-query >/dev/null 2>&1; then
gtk2theme=$(xfconf-query -c xsettings -p /Net/$xfconf)
fi
;;
esac
# Check for gtk2 theme
if [ "$gtk2" == "on" ]; then
if [ -z "$gtk2theme" ]; then
if [ -f "$HOME/.gtkrc-2.0" ]; then
gtk2theme=$(grep "^[^#]*$name" "$HOME/.gtkrc-2.0")
@@ -1120,7 +1257,7 @@ getgtk () {
fi
# Check for gtk3 theme
if [ "$gtk3" == "on" ]; then
if [ -z "$gtk3theme" ]; then
if [ -f "$HOME/.config/gtk-3.0/settings.ini" ]; then
gtk3theme=$(grep "^[^#]*$name" "$HOME/.config/gtk-3.0/settings.ini")
@@ -1137,6 +1274,10 @@ getgtk () {
gtk3theme=${gtk3theme/[[:space:]]/ }
fi
# Toggle visibility of gtk themes.
[ "$gtk2" == "off" ] && unset gtk2theme
[ "$gtk3" == "off" ] && unset gtk3theme
# Format the string based on which themes exist
if [ "$gtk2theme" ] && [ "$gtk2theme" == "$gtk3theme" ]; then
gtk3theme+=" [GTK2/3]"
@@ -1151,31 +1292,33 @@ getgtk () {
fi
# Final string
gtktheme="${gtk2theme}${gtk3theme}"
theme="${gtk2theme}${gtk3theme}"
theme=${theme//\"}
theme=${theme//\'}
# If the final string is empty print "None"
[ -z "$gtktheme" ] && gtktheme="None"
[ -z "$theme" ] && theme="None"
# Make the output shorter by removing "[GTKX]" from the string
if [ "$gtk_shorthand" == "on" ]; then
gtktheme=${gtktheme/ '[GTK2]'}
gtktheme=${gtktheme/ '[GTK3]'}
gtktheme=${gtktheme/ '[GTK2/3]'}
theme=${theme/ '[GTK2]'}
theme=${theme/ '[GTK3]'}
theme=${theme/ '[GTK2/3]'}
fi
}
getgtktheme () {
getgtk theme
gettheme () {
getstyle theme
}
getgtkicons () {
getgtk icons
gtkicons="$gtktheme"
geticons () {
getstyle icons
icons="$theme"
}
getgtkfont () {
getgtk font
gtkfont="$gtktheme"
getfont () {
getstyle font
font="$theme"
}
# }}}
@@ -1270,6 +1413,47 @@ getbattery () {
# }}}
# IP Address {{{
getlocalip () {
case "$os" in
"Linux")
localip="$(ip route get 1 | awk '{print $NF;exit}')"
;;
"Mac OS X")
localip="$(ipconfig getifaddr en0)"
[ -z "$localip" ] && localip="$(ipconfig getifaddr en1)"
;;
*"BSD")
localip="$(ifconfig | awk '/broadcast/ {print $2}')"
;;
"Windows")
localip="$(ipconfig | awk -F ': ' '/IPv4 Address/ {printf $2}')"
;;
*)
localip="Unknown"
;;
esac
}
getpublicip () {
if type -p curl >/dev/null 2>&1; then
publicip="$(curl -w '\n' "$public_ip_host")"
elif type -p wget >/dev/null 2>&1; then
publicip="$(wget -qO- "$public_ip_host"; printf "%s")"
else
publicip="Unknown"
fi
}
# }}}
# Birthday {{{
getbirthday () {
@@ -1395,7 +1579,12 @@ getwallpaper () {
img="$(awk -F'=' '/file/ {printf $2}' "$HOME/.config/nitrogen/bg-saved.cfg")"
elif type -p gsettings >/dev/null 2>&1; then
img="$(gsettings get org.gnome.desktop.background picture-uri 2>/dev/null)"
case "$XDG_CURRENT_DESKTOP" in
"MATE"*) img="$(gsettings get org.mate.background picture-filename 2>/dev/null)" ;;
*) img="$(gsettings get org.gnome.desktop.background picture-uri 2>/dev/null)" ;;
esac
# Strip quotes etc from the path.
img=${img/'file://'}
img=${img//\'}
fi
@@ -1420,6 +1609,9 @@ getwallpaper () {
esac
;;
esac
# If img is an xml file don't use it.
[ "${img/*\./}" == "xml" ] && img=""
}
# }}}
@@ -1431,99 +1623,119 @@ getascii () {
shopt -s nocasematch
case "$ascii_distro" in
"Arch Linux"* | "Antergos"*)
c1=$(color 6)
c2=$(color 4)
ascii_colors 6 4
;;
"CentOS"*)
c1=$(color 3)
c2=$(color 2)
c3=$(color 4)
c4=$(color 5)
c5=$(color 7)
ascii_colors 3 2 4 5 7
;;
"CRUX")
c1=$(color 4)
c2=$(color 5)
c3=$(color 7)
"CRUX"* | "Chakra"* | "gNewSense"*)
ascii_colors 4 5 7
;;
"Debian"* | "FreeBSD"* | "Red Hat"* | "elementary"* | "CrunchBang"* | "Ubuntu"*)
c1=$(color 7)
c2=$(color 1)
c3=$(color 3)
"Chrom"*)
ascii_colors 2 1 3 4 7
ascii_distro="chrome"
;;
"Fedora"*)
c1=$(color 7)
c2=$(color 4)
"Debian"* | "FreeBSD"* | "Elementary"* | "CrunchBang"* | "Ubuntu"*)
ascii_colors 7 1 3
;;
"Red Hat"*)
ascii_colors 7 1 3
ascii_distro="redhat"
;;
"Fedora"* | "Sabayon"* | "Frugalware"* | "Exherbo"*)
ascii_colors 7 4 1
;;
"Gentoo"* | "Funtoo"*)
c1=$(color 7)
c2=$(color 5)
ascii_colors 7 5
;;
"Kali"*)
c1=$(color 4)
c2=$(color 8)
ascii_colors 4 8
;;
"KaOS"*)
ascii_colors 4 7 1
;;
"Mac OS X"* | "Manjaro"* | "Deepin"*)
c1=$(color 2)
c2=$(color 3)
c3=$(color 1)
c4=$(color 1)
c5=$(color 5)
c6=$(color 4)
ascii_colors 2 3 1 1 5 4
;;
"OpenMandriva"*)
ascii_colors 4 3
;;
"Mageia"*)
ascii_colors 7 6
;;
"Peppermint"*)
ascii_colors 7 1
;;
*"Mint"*)
c1=$(color 7)
c2=$(color 2)
ascii_colors 7 2
ascii_distro="mint"
;;
"NetBSD"* | "Parabola"*)
c1=$(color 5)
c2=$(color 7)
"LMDE"* | "Chapeau"*)
ascii_colors 7 2
;;
"NetBSD"* | "Parabola"* | "Tails"* | "BLAG"*)
ascii_colors 5 7
;;
"OpenBSD"*)
c1=$(color 3)
c2=$(color 3)
c3=$(color 6)
c4=$(color 1)
c5=$(color 8)
ascii_colors 3 3 6 1 8
;;
"OpenSuse"*)
c1=$(color 2)
c2=$(color 7)
ascii_colors 2 7
;;
"Slackware"*)
c1=$(color 4)
c2=$(color 7)
"PCLinuxOS"* | "Slackware"*)
ascii_colors 4 7
;;
"Raspbian"*)
ascii_colors 2 1
;;
"Scientific"*)
ascii_colors 4 1 7
;;
"Solus"*)
ascii_colors 7 8
;;
"Trisquel"* | "NixOS"*)
ascii_colors 4 6
;;
"void"*)
c1=$(color 2)
c2=$(color 2)
c3=$(color 8)
ascii_colors 2 2 8
;;
"Windows 10"*)
c1=$(color 6)
ascii_colors 6
ascii_distro="windows10"
;;
"Windows"*)
c1=$(color 1)
c2=$(color 2)
c3=$(color 4)
c4=$(color 3)
ascii_colors 1 2 4 3
;;
"Zorin"*)
ascii_colors 4
;;
esac
@@ -1539,6 +1751,10 @@ getascii () {
# looking in the script's directory.
if [ -f "/usr/share/fetch/ascii/distro/${ascii/ *}" ]; then
ascii="/usr/share/fetch/ascii/distro/${ascii/ *}"
elif [ -f "/usr/local/share/fetch/ascii/distro/${ascii/ *}" ]; then
ascii="/usr/local/share/fetch/ascii/distro/${ascii/ *}"
else
getscriptdir
@@ -1555,14 +1771,8 @@ getascii () {
# Overwrite distro colors if '$ascii_colors' doesn't
# equal 'distro'.
if [ "$ascii_colors" != "distro" ]; then
c1=$(color ${ascii_colors[0]})
c2=$(color ${ascii_colors[1]})
c3=$(color ${ascii_colors[2]})
c4=$(color ${ascii_colors[3]})
c5=$(color ${ascii_colors[4]})
c6=$(color ${ascii_colors[5]})
fi
[ "${ascii_colors[0]}" != "distro" ] && \
ascii_colors ${ascii_colors[@]}
# We only use eval in the distro ascii files.
print="$(eval printf "$(<"$ascii")")"
@@ -1575,6 +1785,9 @@ getascii () {
print="${ascii_color}$(<"$ascii")"
fi
# Set locale to get correct padding
export LC_ALL="$SYS_LOCALE"
# Turn the file into a variable.
ascii_strip=$(<"$ascii")
@@ -1583,20 +1796,32 @@ getascii () {
ascii_strip=${ascii_strip//\\}
# Get length of longest line
length="$(LC_ALL="en_US.UTF8" wc -L 2>/dev/null <<< "$ascii_strip")"
length="$(wc -L 2>/dev/null <<< "$ascii_strip")"
# Get the height in lines
lines="$(($(LC_ALL="en_US.UTF8" wc -l 2>/dev/null <<< "$ascii_strip") + 1))"
lines="$(($(wc -l 2>/dev/null <<< "$ascii_strip") + 1))"
# Fallback to using awk on systems without 'wc -L'
[ -z "$length" ] && \
length="$(LC_ALL="en_US.UTF8" awk 'length>max{max=length}END{print max}' <<< "$ascii_strip")"
length="$(awk 'length>max{max=length}END{print max}' <<< "$ascii_strip")"
# Set the text padding
padding="\033[$((length + gap))C"
# Print the ascii
printf "%b%s" "$print"
# Set locale to get correct padding
export LC_ALL=C
}
ascii_colors () {
c1=$(color "$1")
c2=$(color "$2")
c3=$(color "$3")
c4=$(color "$4")
c5=$(color "$5")
c6=$(color "$6")
}
@@ -1980,20 +2205,25 @@ getconfig () {
return
fi
# Make the directory if it doesn't exist
mkdir -p "$HOME/.config/fetch/"
# Check $HOME/.config/fetch and create the
# dir/files if they don't exist.
if [ -f "$HOME/.config/fetch/config" ]; then
source "$HOME/.config/fetch/config"
elif [ -f "/usr/share/fetch/config" ]; then
mkdir -p "$HOME/.config/fetch/"
cp "/usr/share/fetch/config" "$HOME/.config/fetch"
source "$HOME/.config/fetch/config"
elif [ -f "/usr/local/share/fetch/config" ]; then
cp "/usr/local/share/fetch/config" "$HOME/.config/fetch"
source "$HOME/.config/fetch/config"
else
getscriptdir
mkdir -p "$HOME/.config/fetch/"
cp "$script_dir/config/config" "$HOME/.config/fetch"
source "$HOME/.config/fetch/config"
fi
@@ -2044,8 +2274,9 @@ usage () { cat << EOF
--shell_version on/off Enable/Disable showing \$SHELL version
--battery_num num Which battery to display, default value is 'all'
--battery_shorthand on/off Whether or not each battery gets its own line/title
--ip_host url Url to ping for public IP
--birthday_shorthand on/off Shorten the output of birthday
--birthday_time on/ff Enable/Disable showing the time in birthday output
--birthday_time on/off Enable/Disable showing the time in birthday output
Text Colors:
--title_color num Change the color of the title
@@ -2148,6 +2379,7 @@ while [ "$1" ]; do
--shell_version) shell_version="$2" ;;
--battery_num) battery_num="$2" ;;
--battery_shorthand) battery_shorthand="$2" ;;
--ip_host) public_ip_host="$2" ;;
--birthday_shorthand) birthday_shorthand="$2" ;;
--birthday_time) birthday_time="$2" ;;
--disable)
@@ -2216,7 +2448,12 @@ while [ "$1" ]; do
done
ascii_colors+=(7 7 7 7 7 7)
;;
--ascii_distro) ascii_distro="$2" ;;
--ascii_distro)
image="ascii"
ascii_distro="$2"
case "$2" in "--"* | "") ascii_distro="$distro" ;; esac
;;
# Screenshot
--scrot | -s) scrot="on"; [ "$2" ] && scrot_path="$2" ;;
@@ -2229,7 +2466,7 @@ while [ "$1" ]; do
--stdout)
case "$2" in
"--"* | "") stdout="on" ;;
*) stdout="on"; stdout_args="on"; args=("$@"); stdout ;;
*) stdout="on"; args=("$@"); stdout ;;
esac
unset info_color colors
@@ -2329,4 +2566,3 @@ fi
# }}}