Coder Social home page Coder Social logo

hr's Introduction

hr

A horizontal ruler for your terminal

Tired of not finding things in your terminal because there's a lot of logs and garbage? Tired of destroying the Enter key by creating a "void zone" in your terminal so that you can see the error that you're trying to debug?

Setup

Linux

Quick install

$ curl https://raw.githubusercontent.com/LuRsT/hr/master/hr > ~/bin/hr
(Examine ~/bin/hr)
$ chmod +x ~/bin/hr

Note: You should have ~/bin in your $PATH for this to work.

Complete install

$ git clone [email protected]:LuRsT/hr.git
$ cd hr

Open Makefile and edit the PREFIX variable, specifying the directory where you'd want the software to reside. Then:

$ sudo make install

OSX

OSX users can install using Homebrew:

$ brew install hr

How to use it?

$ hr
################################## # Till the end of your terminal window
$

$ hr '*'
********************************** # Till the end of your terminal window
$

You can also make "beautiful" ASCII patterns

$ hr - '#' -
----------------------------------
##################################
----------------------------------
$ hr '-#-' '-' '-#-'
-#--#--#--#--#--#--#--#--#--#--#--
----------------------------------
-#--#--#--#--#--#--#--#--#--#--#--

That's it, no requirements, just pure old bash and tput, check the source, it's free.

More

Check out more information in hrs wiki

hr's People

Contributors

ajkerrigan avatar awendt avatar blaskovic avatar dodecahedral-champion avatar dotemacs avatar freed-wu avatar gen0cide avatar hasit avatar jdowning avatar jesskay avatar jscheel avatar keith-s-thompson avatar lkdjiin avatar lurst avatar markusfisch avatar neo1001 avatar prayagverma avatar pweldon avatar smallwat3r avatar strugee avatar szepeviktor avatar xuxiaodong 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hr's Issues

Integration with PS1

Hey, it would be nice if one could automatically run hr when PS1 is printed, so that the prompt automatically spans to the end of the line. Is that possible?

Here's a mockup:
hr

Release

Hey @LuRsT

can you please consider making a new "release"?

The reason I ask is because the way OS X's homebrew expects new formulas to be a release, in order to make it into the official repo. If isn't a release, then it goes into a separate repo. And seeing how hr is already in homebrew, it would be good to update it.

Just to make things easier, here are the official GitHub instructions for creating a new release:

https://help.github.com/articles/creating-releases

Maybe bumping it to version 1.1 ?

As soon as you do that, I'll create a pull request for homebrew with the new version bump.

Thanks

Different port to C

Hey there. I thought you might be interested in seeing my port of hr to C. It works slightly differently in that the argument it takes is a number, not a series of characters, and it prints that many lines, so that you don't have to manually write out a loop in bash to do it.

https://github.com/djmattyg007/hr

'*' does not work for me

Hi,

outputting a line of asterikses like suggested in the README does not work for me, but the following:

> ls -l
insgesamt 4
-rw-r--r-- 1 svh svh    0 24. Feb 11:21 aaa
-rw-r--r-- 1 svh svh    0 24. Feb 11:21 bbb
-rw-r--r-- 1 svh svh    0 24. Feb 11:21 ccc
drwxr-xr-x 2 svh svh 4096 24. Feb 11:21 ddd
> hr '*'
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd

which is clearly not intended.

What am I doing wrong?

Thanks,
Sven

[Feature request] Config hr default text `#` through environment variable

Hello, I think the option to customize the default text (when running hr without argument) via environment variable will be a nice feature:

export HR_DEFAULT_TEXT="<text>"

I suggest using HR_DEFAULT_TEXT instead of HR_DEFAULT_WORD like from the code:

hrs() {
    local WORD

    for WORD in "${@:-#}"
    do
        hr "$WORD"
    done
}

because if (by some reason) we type:

hr 'The quick brown fox jumps over the lazy dog'

then it is definitely not a word :(

BTW, thank you for inspiring me to create hr (SuperB HR), a portable posix shell hr.

Add support for multiple lines

Examples:

hr 5

######################### ...
######################### ...
######################### ...
######################### ...
######################### ...

hr $ 3
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ ...
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ ...
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ ...

Man page

Hey @LuRsT

nice project!

So nice, that here is a man page for it (below).

Instructions for testing:

  1. copy it to a file named hr.1
  2. nroff -man ~/Downloads/hr.1
  3. love it, add it to the project
.\"-
.\" The MIT License (MIT)
.\"
.\" Copyright (c) 2014 Gil Gonçalves
.\"
.\" Permission is hereby granted, free of charge, to any person obtaining a copy of
.\" this software and associated documentation files (the "Software"), to deal in
.\" the Software without restriction, including without limitation the rights 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 AUTHORS OR
.\" COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
.\" IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
.\" CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
.\"
.\"     hr.1
.\"
.Dd February 18, 2014
.Dt HR 1
.Os
.Sh NAME
.Nm hr
.Nd insert horizontal rule
.Sh SYNOPSIS
.Nm
.Op |*~#
.Sh DESCRIPTION
The
.Nm
utility prints a horizontal rule for the width of the terminal.
.Sh EXIT STATUS
.Ex -std
.Sh EXAMPLES
The command:
.Pp
.Dl "hr"
.Pp
will print
.Pa #
across the width of the terminal
.Pp
The command:
.Pp
.Dl "hr - '#' -"
.Pp
will print
.Dl ----------------------------------
.Dl ##################################
.Dl ----------------------------------
.Pp
The command:
.Pp
.Dl "hr '-#-' '-' '-#-'"
.Pp
.Dl -#--#--#--#--#--#--#--#--#--#--#--
.Dl ----------------------------------
.Dl -#--#--#--#--#--#--#--#--#--#--#--
.Sh SEE ALSO
.Xr echo 1 ,
.Xr jot 1 ,
.Xr vis 1 ,
.Xr seq 1
.Rs

License?

Please add a License for your code, I'd like to package it for nixos.

Homebrew install doesn't work

From my terminal:

$ brew install hr
Error: No available formula for hr

$ # in case it's relevant...
$ brew tap
homebrew/dupes
nwoolls/xgminer
phinze/cask

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.