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
2 files changed,
14 insertions(+),
8 deletions(-)
M
bash/.bashrc.d/90-aliases.bash
→
bash/.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.sh
→
bin/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