Compare commits

...

13 Commits

Author SHA1 Message Date
Radovan Garabík d324edd803
Merge pull request #212 from pemensik/ls-locales
Fix ls colors also for French
2024-02-25 17:08:23 +01:00
Radovan Garabík 2c48356775
Merge pull request #187 from StayPirate/patch-1
Remove duplicated word
2024-02-25 17:00:29 +01:00
Radovan Garabík d8ad4fead5
Merge pull request #218 from nodauf/devel
Add color for json output of base64 command
2024-02-25 16:57:04 +01:00
Radovan Garabík 70277ef098 remove duplicate mount command 2024-02-25 16:55:53 +01:00
Radovan Garabík bedfa6cd01
Merge pull request #219 from shariqmalik/logo-ls
Added support for logo-ls
2024-02-25 16:55:11 +01:00
Radovan Garabík e1b9adbad0 add support for phpunit 2024-02-25 16:51:37 +01:00
Radovan Garabík eac97e5ce4
Merge pull request #226 from cephi-sui/patch-1
Change README.markdown Bash alias source
2024-02-25 16:39:45 +01:00
Cephi a8d98ea229
Change README.markdown Bash alias source
Changes README Bash alias source to match the file location that was tested just prior to sourcing.
2023-07-25 23:18:07 -04:00
nodauf 1612ab4954
Fix mistake copy / paste 2022-10-19 19:05:07 +02:00
Shariq Malik efecc041d7 Added support for logo-ls
logo-ls is a modern ls command with beautiful icons and Git integration. Written in Golang.

https://github.com/Yash-Handa/logo-ls

I just added support for the colorized output of logo-ls if you're using it as an alternate to ls.
2022-09-09 17:57:01 +05:00
Florian a6971517b2 Add json format for base64 2022-08-26 11:05:46 +02:00
Petr Menšík fb349233b4 Fix ls colors also for French
French locale has visible difference, which fails even after the last change.

Example:
fr_FR: 21 févr. 17:24

Allow up to 5 letters on month and accept also dot at the end of month
name. Do that only for one direction. Extend spaces matching after date.

Signed-off-by: Petr Menšík <pemensik@redhat.com>
2022-03-17 13:24:23 +01:00
Gianluca Gabrielli 6965c30625
Remove duplicated word 2021-08-06 13:39:20 +02:00
8 changed files with 151 additions and 7 deletions

View File

@ -104,7 +104,7 @@ To facilitate the use, command `grc` acts as frontend for `grcat`, automatically
etc...
`grc` will execute command command with optional parameters piping its stdout into `grcat`.
`grc` will execute command with optional parameters piping its stdout into `grcat`.
Configuration file for `grcat` is determined by `/etc/grc.conf` or `~/.grc/grc.conf` file.
@ -190,7 +190,7 @@ You can start using grc automatically with supported commands. The following ass
To set aliases for supported commands, append to your `~/.bashrc`:
GRC_ALIASES=true
[[ -s "/etc/profile.d/grc.sh" ]] && source /etc/grc.sh
[[ -s "/etc/profile.d/grc.sh" ]] && source /etc/profile.d/grc.sh
If the file `/etc/default/grc` exists, it is sourced first, therefore you can place a line saying `GRC_ALIASES=true` there.

91
colourfiles/conf.logo-ls Normal file
View File

@ -0,0 +1,91 @@
# logo-ls is modern ls command with beautiful Icons and Git Integrations . Written in Golang
# https://github.com/Yash-Handa/logo-ls
#
#
# The following matches file sizes as produced by logo-ls -l or logo-ls -lh
# The output produced by logo-ls -s is probably not specific
# enough to be reliably matched, especially considering logo-ls -s(k|m|g|G).
#
# Example lines:
# -rw-r--r--MrSkoodlemrskoodle710 Sep 9 17:13:38_grc
# LrwxrwxrwxMrSkoodlemrskoodle16 Sep 9 17:13:38CHANGES@
# drwxr-xr-xMrSkoodlemrskoodle4096 Sep 9 17:31:34colourfiles/
# drwxr-xr-xMrSkoodlemrskoodle4096 Sep 9 17:13:38contrib/
# LrwxrwxrwxMrSkoodlemrskoodle16 Sep 9 17:13:38COPYING@
# -rw-r--r--MrSkoodlemrskoodle619 Sep 9 17:13:38CREDITS
# drwxr-xr-xMrSkoodlemrskoodle4096 Sep 9 17:13:38debian/
# -rwxr-xr-xMrSkoodlemrskoodle5188 Sep 9 17:13:38grc*
# -rw-r--r--MrSkoodlemrskoodle1479 Sep 9 17:13:38grc.1
# -rw-r--r--MrSkoodlemrskoodle4107 Sep 9 17:35:50grc.conf
# -rw-r--r--MrSkoodlemrskoodle968 Sep 9 17:13:57grc.fish
# -rw-r--r--MrSkoodlemrskoodle1843 Sep 9 17:13:57grc.sh
# -rw-r--r--MrSkoodlemrskoodle1482 Sep 9 17:37:07grc.spec
# -rw-r--r--MrSkoodlemrskoodle1321 Sep 9 17:13:38grc.spec.old
# -rw-r--r--MrSkoodlemrskoodle975 Sep 9 17:36:26grc.zsh
# -rwxr-xr-xMrSkoodlemrskoodle10849Sep 9 17:13:57grcat*
# -rw-r--r--MrSkoodlemrskoodle2492 Sep 9 17:13:38grcat.1
# -rw-r--r--MrSkoodlemrskoodle1021 Sep 9 17:13:38INSTALL
# -rwxr-xr-xMrSkoodlemrskoodle706 Sep 9 17:13:57install.sh*
# -rw-r--r--MrSkoodlemrskoodle9808 Sep 9 17:13:57README.markdown
# -rw-r--r--MrSkoodlemrskoodle11312Sep 9 17:13:38Regexp.txt
# -rw-r--r--MrSkoodlemrskoodle74 Sep 9 17:13:38TODO
#
# The regexp uses lookahead to match a date following the size
# size: 1M <= size < 10M
regexp=\W+(\d{7}|\d(?:[,.]?\d+)*[KM])(?=\W*[A-Z][a-z]{2}\s)
colours=green
=======
# size: 10M <= size < 100M
regexp=\W+(\d{8}|\d\d(?:[,.]?\d+)*M)(?=\W*[A-Z][a-z]{2}\s)
colours=yellow
=======
# size: 100M <= size < 1G
regexp=\W+(\d{9}|\d{3}M)(?=\W*[A-Z][a-z]{2}\s)
colours=red
=======
# size: 1G <= size
regexp=\W+(\d{10,}|[\d.,]+G)(?=\W*[A-Z][a-z]{2}\s)
colours=bold red
=======
# device major minor numbers
regexp=\s(\d+),\s+(\d+)\s
colours=default,bright_yellow ,yellow
=======
# Date-Time => G1=Month G2=Day G3=Hour G4=Minutes G5=Year
regexp=([A-Z][a-z]{2})\s([ 1-3]\d)\s(?:([0-2]?\d):([0-5]\d):([0-5]\d))
colours=unchanged,cyan,cyan,cyan,cyan,bold magenta
=======
# root
regexp=\s*(root|wheel)(?=\s*|$)
colours=unchanged,bold white on_red
=======
# SELinux
regexp=(\w+_u):(\w+_r):(\w+_t):(\w\d)
colours=default,green,yellow,cyan,magenta
-
# -rwxrwxrwx ============================
# File Type
regexp=(-|([bcCdDlMnpPs?]))(?=[-r][-w][-xsStT][-r][-w][-xsStT][-r][-w][-xsStT])
colours=unchanged,unchanged,bold white
-
# owner rwx
regexp=(?<=[-bcCdDlMnpPs?])(-|(r))(-|(w))(-|([xsStT]))(?=[-r][-w][-xsStT][-r][-w][-xsStT])
colours=unchanged,unchanged,bright_green,unchanged,bright_green,unchanged,bright_green
-
# group rwx
regexp=(?<=[-bcCdDlMnpPs?][-r][-w][-xsStT])(-|(r))(-|(w))(-|([xsStT]))(?=[-r][-w][-xsStT])
colours=unchanged,unchanged,yellow,unchanged,yellow,unchanged,yellow
-
# other rwx
regexp=(?<=[-bcCdDlMnpPs?][-r][-w][-xsStT][-r][-w][-xsStT])(-|(r))(-|(w))(-|([xsStT]))
colours=unchanged,unchanged,bright_red,unchanged,bright_red,unchanged,bright_red
-
# sStT all
regexp=(?<=[-bcCdDlMnpPs?])[-r][-w]([sStT])[-r][-w]([sStT])[-r][-w]([sStT])
colours=unchanged,bold green,bold yellow, bold red
-
# ACL
regexp=^\S{10}(\+)
colours=unchanged,on_cyan bold white

View File

@ -35,7 +35,7 @@ regexp=\s(\d+),\s+(\d+)\s
colours=default,bright_yellow ,yellow
=======
# Date-Time => G1=Month G2=Day G3=Hour G4=Minutes G5=Year
regexp=(?:(\w{2,3})\s([ 1-3]\d)|([ 1-3]\d\.?)\s(\w{2,3}))\s(?:([0-2]?\d)[\.:]([0-5]\d)(?=[\s,]|$)|\s*(\d{4}))
regexp=(?:(\w{2,5})\s([ 1-3]\d)|([ 1-3]\d\.?)\s(\w{2,5}\.?))\s{1,3}(?:([0-2]?\d)[\.:]([0-5]\d)(?=[\s,]|$)|(\d{4}))
colours=unchanged,cyan,cyan,cyan,cyan,cyan,cyan,bold magenta
=======
# root

41
colourfiles/conf.phpunit Normal file
View File

@ -0,0 +1,41 @@
regexp=^(PHPUnit )(\d+\.\d+\.\d+)(?:.*$)
colours=dark, dark, dark
======
# Memory and time
regexp=^Time: (\d\d:\d\d\.\d\d\d), Memory: (\d+\.\d\d MB)
colours=dark, dark, dark
======
regexp=^(\w+(?:Error|Exception): ).*$
colours=default, bright_red
======
# Error stack
regexp=^((?:\w+:\/\/)?\/(?:[^\/]+\/)*)([^:]+)(?::)(\d+)$
colours=bright_black, bright_black, dark, dark
======
# Number of errors
regexp=^(?:^There (?:was|were) )(\d+)(?: (?:errors?|failures?):)$
colours=default, bright_red
======
# Errors
regexp=(ERRORS|FAILURES)!
colours=bright_red
======
# Failure stats
regexp=(?:Tests: (\d+)|Assertions: (\d+)|Errors: (\d+)|Failures: (\d+)|Incomplete: (\d+))
colours=default, bright_green, bright_yellow, bright_red, bright_red, bright_cyan
======
# Success
regexp=(OK) \((\d+) tests?, (\d+) assertions?\)
colours=dark, bright_green, bold, bold
======
# Classes in general
regexp=(?:[\s:"'])((?:[^\\\s]+\\)+)([^\s:"']+)(?:(?:::)([^\s"']+))?(?:[:\s"'])
colours=default, dark, bold, bold
======
# Loading bar
regexp=(?:.*)(\d+)(?:\s+)(\/)(?:\s+)(\d+)(?:\s+)(\()(\d+%)(\))
colours=dark, bold, bold, bold, bold, bold, bold
======
# Test and its name
regexp=^(?:^\d+\))(?: )((?:\w+\\)*)(\w+)(?:::)(\w+)
colours=default, bright_black, dark, yellow

View File

@ -78,9 +78,9 @@ conf.ifconfig
^([/\w\.]+\/)?ls\s
conf.ls
# mount
^([/\w\.]+\/)?mount\b
conf.mount
# logo-ls command
^([/\w\.]+\/)?logo-ls\s
conf.logo-ls
# df
^([/\w\.]+\/)?df\b
@ -153,6 +153,10 @@ conf.fdisk
^([/\w\.]+\/)?free\b
conf.free
# base64
^([/\w\.]+\/)?base64\b
conf.json
------------
# docker
@ -301,3 +305,8 @@ conf.log
# GPG
^([/\w\.]+\/)?gpg (-[kK]|--list-keys|--list-secret-keys|--fingerprint)\s?
conf.gpg
# phpunit
^(./vendor/bin/)?phpunit\b
conf.phpunit

View File

@ -6,7 +6,7 @@
#
# See also the plugin at https://github.com/oh-my-fish/plugin-grc
set -U grc_plugin_execs cat cvs df diff dig gcc g++ ls ifconfig \
set -U grc_plugin_execs base64 cat cvs df diff dig gcc g++ ls ifconfig \
make mount mtr netstat ping ps tail traceroute \
wdiff blkid du dnf docker docker-compose docker-machine env id ip iostat journalctl kubectl \
last lsattr lsblk lspci lsmod lsof getfacl getsebool ulimit uptime nmap \

1
grc.sh
View File

@ -11,6 +11,7 @@
GRC="$(which grc)"
if tty -s && [ -n "$TERM" ] && [ "$TERM" != dumb ] && [ -n "$GRC" ]; then
alias colourify="$GRC -es"
alias base64='colourify base64'
alias blkid='colourify blkid'
alias configure='colourify ./configure'
alias df='colourify df'

View File

@ -9,6 +9,7 @@ fi
cmds=(
as
ant
base64
blkid
cc
configure
@ -44,6 +45,7 @@ cmds=(
last
ldap
lolcat
logo-ls
ld
ls
lsattr