all repos — dotfiles @ 9bd89662d29e18d97b5bb92a919319fcc853caad

my *nix dotfiles

Add dt() and bat()

Signed-off-by: Anirudh Oppiliappan <x@icyphox.sh>
Anirudh Oppiliappan x@icyphox.sh
Sun, 05 Jan 2020 23:17:33 +0530
commit

9bd89662d29e18d97b5bb92a919319fcc853caad

parent

2706a909731d1bd0fffa9200b5f5f6153f31a96b

2 files changed, 14 insertions(+), 8 deletions(-)

jump to
M bash/.bashrc.d/90-aliases.bashbash/.bashrc.d/90-aliases.bash

@@ -29,8 +29,10 @@ function vpn {

~/bin/vpnon.sh } -function f() { - fff "$@" - cd "$(cat "${XDG_CACHE_HOME:=${HOME}/.cache}/fff/.fff_d")" +function dt() { + time.sh -n } +function bat() { + bat.sh -n +}
M bin/time.shbin/time.sh

@@ -3,19 +3,23 @@

fg="$(xres color15)" light="$(xres color8)" -time="%{F$light}time %{F$fg}$(date +%I:%M)" -date="%{F$light}date %{F$fg}$(date +"%a, %d %b" | tr A-Z a-z)" +raw_date="$(date +"%a, %d %b" | tr A-Z a-z)" +raw_time="$(date +%I:%M)" + +time="%{F$light}time %{F$fg}$raw_time" +date="%{F$light}date %{F$fg}$raw_date" while getopts dtn options do case $options in d) - echo -ne "$date" + printf "%s" "$date" ;; t) - echo -ne "$time" + printf "%s" "$time" ;; n) - echo -ne "$(date +"%a, %d %b" | tr A-Z a-z)" + printf "%s\n" "$raw_date" + printf "%s" "$raw_time" esac done