diff --git a/apps/shell/fish/aliases.fish b/apps/shell/fish/aliases.fish index f9591ac..1aaeddd 100755 --- a/apps/shell/fish/aliases.fish +++ b/apps/shell/fish/aliases.fish @@ -13,35 +13,7 @@ alias la 'll -A' # show all # other file aliases alias tree 'tree -Csuh' alias f fzf -alias rcp 'rsync -ah --progress' - -function ltl --description 'Echoes the newest file in the specified directory (or current directory if none is given)' - set d $argv[1] . - set -l l "" - for f in $d[1]/* - if test -z $l; set l $f; continue; end - if command test $f -nt $l; and test ! -d $f - set l $f - end - end - echo $l -end - -function scount -d "Silent count" -w count - count $argv > /dev/null -end - -function ltld --description 'Echoes the newest subdirectory in the specified directory (or current directory if none is given)' - set d $argv[1] . - set -l l "" - for f in $d[1]/* - if test -z $l; set l $f; continue; end - if command test $f -nt $l; and test -d $f - set l $f - end - end - echo $l -end +alias rcp 'rsync -r -ah --progress' alias vltl "$EDITOR (ltl)" alias cdltl "cd (ltld)" diff --git a/bin/editscrot b/bin/editscrot index 886c067..b4bfe63 100755 --- a/bin/editscrot +++ b/bin/editscrot @@ -1,6 +1,2 @@ #!/usr/bin/env bash - -scrot_dir="$NICE_HOME/img/scrots/" -# shellcheck disable=SC2012 -latest_scrot="$(\ls -Art "${scrot_dir}" | tail -n 1)" -krita "${scrot_dir}${latest_scrot}" +krita "$(ltl "$NICE_HOME/img/scrots/")" diff --git a/bin/ltl b/bin/ltl new file mode 100755 index 0000000..4f3414f --- /dev/null +++ b/bin/ltl @@ -0,0 +1,13 @@ +#!/usr/bin/env fish + +# Echoes the newest file in the specified directory (or current directory if none is given) + +set d $argv[1] . +set -l l "" +for f in $d[1]/* + if test -z $l; set l $f; continue; end + if command test $f -nt $l; and test ! -d $f + set l $f + end +end +echo $l diff --git a/bin/ltld b/bin/ltld new file mode 100755 index 0000000..35bd118 --- /dev/null +++ b/bin/ltld @@ -0,0 +1,13 @@ +#!/usr/bin/env fish + +# Echoes the newest subdirectory in the specified directory (or current directory if none is given) + +set d $argv[1] . +set -l l "" +for f in $d[1]/* + if test -z $l; set l $f; continue; end + if command test $f -nt $l; and test -d $f + set l $f + end +end +echo $l diff --git a/bin/scount b/bin/scount new file mode 100755 index 0000000..9454c83 --- /dev/null +++ b/bin/scount @@ -0,0 +1,6 @@ +#!/usr/bin/env fish + +# Silent count + +count $argv > /dev/null + diff --git a/bin/screenshot b/bin/screenshot index 2c6c4fa..0dc661b 100755 --- a/bin/screenshot +++ b/bin/screenshot @@ -2,5 +2,5 @@ SCROT_DIR="$NICE_HOME/img/scrots" mkdir -p "$SCROT_DIR/" -FILENAME="$SCROT_DIR/screenshot_%Y-%m-%d_%H-%M-%S_\$wx\$h.png" -scrot "$@" "${FILENAME}" >/dev/null && echo "Saved screenshot to: ${FILENAME}" +FILENAME="$SCROT_DIR/screenshot_$(date +%Y-%m-%d_%H-%M-%S).png" +grim -t png "$@" "${FILENAME}" >/dev/null && echo "Saved screenshot to: ${FILENAME}" diff --git a/readme.md b/readme.md index 414752a..d9d2ccd 100644 --- a/readme.md +++ b/readme.md @@ -1,8 +1,9 @@ # lytedev's dotfiles -This repository is undergoing some massive changes. +![Desktop Screenshot][desktop-screenshot] -Tread lightly. +My various configuration files. Don't use them directly, just take from them at +will. And don't run this: ``` curl -s -L https://git.lyte.dev/lytedev/dotfiles/raw/branch/master/bin/init-dotfiles | sh @@ -10,7 +11,6 @@ curl -s -L https://git.lyte.dev/lytedev/dotfiles/raw/branch/master/bin/init-dotf [🖥️ Upstream][upstream] • [🐙 GitHub Mirror][github] - ## To Do + Setup `nnn`