├── .github └── workflows │ └── main.yml ├── LICENSE ├── Makefile ├── README.md ├── mfetch └── scrot ├── scrot1.png ├── scrot2.png └── scrot3.png /.github/workflows/main.yml: -------------------------------------------------------------------------------- 1 | 2 | name: Shellcheck 3 | 4 | on: [push, pull_request] 5 | 6 | jobs: 7 | build: 8 | 9 | runs-on: ubuntu-latest 10 | 11 | steps: 12 | - uses: ludeeus/action-shellcheck@0.2.1 13 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 depsterr 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | PREFIX?=/usr 2 | BIN?=$(PREFIX)/bin 3 | 4 | default: 5 | @printf "targets:\n make install\n make uninstall\n" 6 | 7 | install: 8 | install -Dm755 mfetch $(BIN)/mfetch 9 | 10 | uninstall: 11 | rm -f $(BIN)/mfetch 12 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

screenshot

2 |

mfetch

3 |

A minimal Linux fetch script

4 | 5 | ![Shellcheck](https://github.com/depsterr/mfetch/workflows/Shellcheck/badge.svg) 6 | 7 | mfetch is a tiny fetch script using less than 30 sloc! 8 | ```sh 9 | $ grep -v '^$\|^#' mfetch | wc -l 10 | 21 11 | ``` 12 | 13 | It assumes you're launching your wm by having it be exec'd in `~/.xinitrc` 14 | -------------------------------------------------------------------------------- /mfetch: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # read system info 3 | read -r host < /proc/sys/kernel/hostname 4 | read -r kernel < /proc/sys/kernel/osrelease 5 | . /etc/os-release 6 | 7 | # Get wm from xinitrc 8 | while read -r line; do 9 | [ "${line#exec }" = "$line" ] || wm="${line#exec }" 10 | done < "$HOME/.xinitrc" 11 | 12 | # Colors and palette method stolen from dylanaraps pftech 13 | # https://github.com/dylanaraps/pfetch 14 | c0=''; 15 | c1=''; c2='' 16 | c3=''; c4='' 17 | c5=''; c6='' 18 | c7=''; c8='' 19 | palette="$c1 $c1 $c2 $c2 $c3 $c3 $c4 $c4 $c5 $c5 $c6 $c6 " 20 | 21 | # Output 22 | printf '%s\n' " 23 | 24 | ${c5} .-. ${USER}${c0}@${c5}${host} 25 | ${c5} __/ ( ${c6}os${c0} ${PRETTY_NAME} 26 | ${c5}, '-.____\\ ${ARTR3}${c6}kernel${c0} ${kernel} 27 | ${c5} u=='/ \\ ${c6}shell${c0} ${SHELL##*/} 28 | ${c5} /_/ \\ ${c6}wm${c0} ${wm} 29 | ${c5} .-'' | 30 | ${c5} ( ${c6}____${c5}/${c6}_____ ${palette} 31 | 32 | " 33 | -------------------------------------------------------------------------------- /scrot/scrot1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rachelambda/mfetch/92941c2ff3ce9edd729591529ca2d66b26ca1796/scrot/scrot1.png -------------------------------------------------------------------------------- /scrot/scrot2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rachelambda/mfetch/92941c2ff3ce9edd729591529ca2d66b26ca1796/scrot/scrot2.png -------------------------------------------------------------------------------- /scrot/scrot3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rachelambda/mfetch/92941c2ff3ce9edd729591529ca2d66b26ca1796/scrot/scrot3.png --------------------------------------------------------------------------------