Giter Club home page Giter Club logo

fetch-master-6000's Introduction

Fetch-master 6000

Simple dilbert themed fetching tool for Linux and BSD.

ASCII art of Dilbert is taken from the Kakoune text editor ASCII art of Alice, PHB is taken from Christopher Johnson's collection ASCII art of the Wolf is taken from asciiart.eu ASCII art of the Astronaut is taken from this site

Screenshots

all.png

Installation

Its just a perl script download it, make it executable and put somewhere in your $PATH

For Gentoo refer to the XDream's Repository For Arch users its available in the AUR as fm6000

Via install script

sh -c "$(curl https://codeberg.org/anhsirk0/fetch-master-6000/raw/branch/main/install.sh)"

install script help page

sh -c "$(curl https://codeberg.org/anhsirk0/fetch-master-6000/raw/branch/main/install.sh)" -- -h

install script options

  • use --install-path option or set "install_path" variable(this variable defaults to $HOME/.local/bin, if it does not exist /usr/local/bin is used)
  • use --root(-r), --noroot(-nr) or set "root" variable(this is automatically detected via stat if "root" var is not set and options are not used)
  • use --dry-run(-dr) to dry run fm6000

example

sh -c "$(curl https://codeberg.org/anhsirk0/fetch-master-6000/raw/branch/main/install.sh)" -- --install-path=/usr/bin --root

or

install_path=/usr/bin root=1 sh -c "$(curl https://codeberg.org/anhsirk0/fetch-master-6000/raw/branch/main/install.sh)"

Manually

with wget

wget https://codeberg.org/anhsirk0/fetch-master-6000/raw/branch/main/fm6000.pl -O fm6000

or

with curl

curl https://codeberg.org/anhsirk0/fetch-master-6000/raw/branch/main/fm6000.pl --output fm6000

making it executable

chmod +x fm6000

copying it to $PATH (~/.local/bin/ , this step is optional)

cp fm6000 ~/.local/bin/

Usage

if fm6000 in $PATH

fm6000

runing the script

./fm6000

or

perl fm6000

or

bash fm6000

Displaying custom ASCII from file

fm6000 -f arch_logo.txt

arch_logo.png

About custom ascii_art file

every line should be of same length (use spaces if needed) atleast 10 lines is required (use empty spaces lines if needed)

Say

fm6000 -say "Hello world!"

say.png

Geometry

geometry.png

Available Options

  • -c or --color=STR Base color
  • -w or --wally Display Wally
  • -dog or --dogbert Display Dogbert
  • -al or --alice Display Alice
  • -phb or --phb Display Pointy haired Boss
  • -as or --asok Display Asok
  • -nd or --not_de To use 'WM' instead of 'DE'
  • -o or --os=STR OS name
  • -k or --kernel=STR Kernel version
  • -d or --de=STR Desktop environment name
  • -sh or --shell=STR Shell name
  • -u or --uptime=STR Uptime
  • -p or --package=INT Number of packages
  • -v or --vnstat=STR Use vnstat instead of kernel
  • -f or --file Display art from file
  • -r or --random Display Random Art
  • -rd or --random-dir=STR Directory for random ascii art
  • -s or --say=STR Say provided text instead of info
  • -sf or --say-file=STR Say text from a file instead of info
  • -m or --margin=INT Spaces on the left side of info
  • -g or --gap=INT Spaces between info and info_value (default 10)
  • -l or --length=INT Length of the board (default 13)
  • -h or --help Print this help message

Available colors

black red green yellow blue magenta cyan bright_black bright_red bright_green bright_yellow bright_blue bright_magenta bright_cyan random

Randomization

For random color:

fm6000 -color "random"

or

fm6000 -c "random"

For random character:

fm6000 -random

or

fm6000 -r

For random ascii from a directory:

fm6000 --random-dir "directory_name"

or

fm6000 -rd "directory_name"

Troubleshooting

If your distro is not {arch, debian, fedora, freeBSD, gentoo, venom, solus} based fetch-master-6000 wont be able to detect number of packages In that case you have to specify number of packages yourself For example: On Solus (eopkg) Solus is already supported command to list all istalled packages is:

eopkg list-installed is slow because its prints a lot of info, use ls /var/lib/eopkg/package instead

eopkg list-installed

to count packages pipe the list to wc -l

eopkg list-installed | wc -l

make it an alias to avoid typing it everytime

alias fm6000='fm6000 -p $(eopkg list-installed | wc -l)'

Similiarly for other distros

fm6000 -p $(pacman -Q | wc -l)

Can't locate experimental.pm

fm6000 uses experimental module to do a smartmatch for WMs .This module is pre-installed on most of the distros, if for some reason its not present. Use your package manager to install perl-experimental module.

fetch-master-6000's People

Contributors

amn1729 avatar anhsirk0 avatar darthhelmut avatar hecodes2much avatar krappramiro avatar marcelarie avatar mtwb47 avatar olaoluwam avatar pineapples5972 avatar pluma9 avatar rayit avatar xdream8 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

fetch-master-6000's Issues

Add a license

Pretty straight forward request: Please add a (FLOSS) license to this repo :)

improve script

echo "Fetch-master-6000 is succesfully installed"

Move this line after line where you install it line 36

I said NO do not install and it says installed to me
nice project by the way
love dilbert

Number of Packages is unknown (openSUSE)

No matter what I try and add to show the number of packages it always comes up with unknown
Screenshot_20220306_123830
. I am using a custom command for customization in my bashrc.
I was wondering if there was a way to add the package count manually to the command in openSUSE?

unable to detect DE or WM

I used fm6000 in several wms exclusively dwm, xmonad, openbox
and everytime it shows de UNKNOWN so i have to use -de flag and specify manually which wm i am currently using.
However I did some research and found that wmctrl can be useful to detect current wm.

sub get_de {
    my $de = $ENV{DESKTOP_SESSION};
    unless ($de) { $de = $ENV{XDG_SESSION_DESKTOP}
}
    unless ($de) { $de = $ENV{XDG_CURRENT_DESKTOP}
}
    unless ($de) { $de = `wmctrl -m | grep Name | awk '{print $2}' `}
    unless ($de) { $de = "Unknown" }
    return $de;
}

Here I tried to use it in my noobie way but I unable to get rid of trailing new line it gives at the end.
wmctrl -m | grep Name | awk '{print $2}'
I know implementing wmctrl might add to another dependancy stack but i think its worth it.

I hope you'd find some fix for it.

Install script error

On running the install script. fm6000 is installed correctly but the script prints out some error.

the error:

sh: line 166: return: can only 'return' from a function or sourced script

WM not showing

I use "xmonad" but it does not show and instead is blank.

2021-05-03_16:17:06

Packages Data Title Needs To Be Plural

In the list of packages using the command, the name of the title for the amount of packages on your system is called "PACKAGE" when it should be "PACKAGES"

Use `dpkg-query` instead of `apt`.

unless($pacs) { $pacs = `apt list --installed`; }

This spits out following error WARNING: apt does not have a stable CLI interface. Use with caution in scripts..
I think the solution might be either to redirect the error to /dev/null or to use dpkg-query which both neofetch and pfetch use.

dpkg-query -f '\n' -W' or dpkg-query -W -f='${binary:Package}\n'

But there was slight difference between apt list --installed | wc -l and dpkg-query -f '\n' -W | wc -l.

I did man apt and found this, but I can't figure out how to get the apt list --installed functionality using apt-get or apt-cache.

The apt(8) commandline is designed as an end-user tool and it
       may change behavior between versions. While it tries not to
       break backward compatibility this is not guaranteed either if
       a change seems beneficial for interactive use.

       All features of apt(8) are available in dedicated APT tools
       like apt-get(8) and apt-cache(8) as well.  apt(8) just
       changes the default value of some options (see apt.conf(5)
       and specifically the Binary scope). So you should prefer
       using these commands (potentially with some additional
       options enabled) in your scripts as they keep backward
       compatibility as much as possible.

Getting 'command not found' error on Fedora 34

I followed every step as it is and when i run it, i am getting an error message sh: line 1: dpkg-query: command not found along with the fm6000 output. i'm also attaching a screenshot of the error.
fm6000_error_fedora_34

Random colours and characters

Hi there, love this script but would it be possible to add support for random colours and/or random character e.g. it picks a random ASCII character and random colours each time you run the script when you pass it a "--random" or "-r" flag or something?

OpenBSD

Had some problems with OpenBSD support (made a fork).
Added following lines to get_uptime seems fixing it...

sub get_uptime { my $seconds; my $now = time(); # macOS if ($os eq "OSX") { my $boot = sysctl -n kern.boottime; ($boot) = $boot =~ /{ sec = (\d+)/; $seconds = $now - $boot; } elsif ($os eq "OpenBSD") { my $boot = sysctl -n kern.boottime; $seconds = $now - $boot;

How to set a random character?

I edited the file so that my $color='random but would also like to do this for the character displayed.

Could not find how to do this, any idea?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.