mirror of
https://github.com/tonydamage/nux-env.git
synced 2025-12-13 13:44:28 +01:00
Compare commits
3 commits
f69327b2ca
...
a95a906f5a
| Author | SHA1 | Date | |
|---|---|---|---|
| a95a906f5a | |||
| 1de6be55f7 | |||
| 3d19888293 |
3 changed files with 19 additions and 12 deletions
19
bin/foldy
19
bin/foldy
|
|
@ -1,16 +1,27 @@
|
|||
#!/usr/bin/env nuxr-nuxsh
|
||||
nux.use nux/fs
|
||||
|
||||
CLOSEST=$(nux.fs.closest .foldy.nuxsh)
|
||||
FOLDY_FILE=.foldy.nuxsh
|
||||
CLOSEST=$(nux.fs.closest $FOLDY_FILE)
|
||||
FOLDY_DIR=$(dirname "$CLOSEST")
|
||||
|
||||
## list:: List Available foldy integrated directories
|
||||
@command list {
|
||||
#nux.fs.info "Listing foldy files in $CLOSEST"
|
||||
find -iname ".foldy.nuxsh" | while read line; do
|
||||
find -name $FOLDY_FILE | while read line; do
|
||||
echo "${line%.foldy.nuxsh}"
|
||||
done
|
||||
}
|
||||
|
||||
## all:: <command> [<args>]
|
||||
## Run foldy command in all descendant foldy managed directories.
|
||||
@command all command {
|
||||
find -name $FOLDY_FILE | while read line; do
|
||||
dir="${line%.foldy.nuxsh}"
|
||||
nux.fs.info $dir Running foldy $command
|
||||
task.run "$dir" "$command" "$@"
|
||||
done
|
||||
}
|
||||
|
||||
## exec:: <path> <command> [<args>]
|
||||
## Run foldy command in directory.
|
||||
|
|
@ -19,8 +30,8 @@ CLOSEST=$(nux.fs.closest .foldy.nuxsh)
|
|||
}
|
||||
|
||||
@command help.additional {
|
||||
echo "Tasks defined in ${NC_White}$CLOSEST${NC_No}"
|
||||
echo "Custom Help"
|
||||
echo
|
||||
echo "Tasks defined in ${NC_White}${CLOSEST%$FOLDY_FILE}${NC_No}:"
|
||||
nux.help.comment "$CLOSEST"
|
||||
|
||||
}
|
||||
|
|
|
|||
10
bin/medie
10
bin/medie
|
|
@ -110,16 +110,12 @@ nux.log debug "FFMPEG: $FFMPEG_OR_LIBAV Magick: $NUX_MAGICK"
|
|||
target_file=$(basename "$file" | sed -re 's/\.[a-z0-9_]+$//g' -e "s/\$/.$target/g" );
|
||||
target_full="$target_dir/$target_file";
|
||||
media.to.$target "$file" "$target_full"
|
||||
echo $file $target_file
|
||||
fs:info "$target_full" Created from $file
|
||||
done
|
||||
}
|
||||
|
||||
## datetime-name:: <image...>
|
||||
## Normalizes name to format `yyyymmdd_hhmmss.suffix`
|
||||
###
|
||||
### Useful for:
|
||||
### - generating RGBD Images for *holograms* - *left is color* space, *right is depth*
|
||||
### - joining Instagram photos in slideshow, where photo is splitted in middle
|
||||
@command datetime-name {
|
||||
for file in "$@"; do
|
||||
date=$($NUX_MAGICK identify -format "%[EXIF:DateTimeOriginal]" "$file" 2> /dev/null)
|
||||
|
|
@ -148,7 +144,7 @@ nux.log debug "FFMPEG: $FFMPEG_OR_LIBAV Magick: $NUX_MAGICK"
|
|||
### - joining Instagram photos in slideshow, where photo is splitted in middle
|
||||
@command side-by-side left right output {
|
||||
$NUX_MAGICK montage -mode concatenate "$left" "$right" -geometry +0+0 -quality $QUALITY "$output"
|
||||
nux.fs.info "$output" "Created"
|
||||
fs:info "$output" "Created"
|
||||
}
|
||||
|
||||
## top-bottom:: <rop> <bottom> <output>
|
||||
|
|
@ -158,7 +154,7 @@ nux.log debug "FFMPEG: $FFMPEG_OR_LIBAV Magick: $NUX_MAGICK"
|
|||
### - joined splitted images during editing
|
||||
@command top-bottom top bottom output {
|
||||
$NUX_MAGICK montage -mode concatenate "$top" "$bottom" -geometry +0+0 -tile 1x2 -quality $QUALITY "$output"
|
||||
nux.fs.info "$output" "Created"
|
||||
fs:info "$output" "Created"
|
||||
}
|
||||
|
||||
## split-horizontally:: <image>
|
||||
|
|
|
|||
|
|
@ -58,8 +58,8 @@ nux.use nux/help
|
|||
if [ -z "$allArgs" ] {
|
||||
echo Usage: $NC_Bold$NUX_SCRIPTNAME ${NC_No}${NC_White}\<command\>${NC_No} [\<options\>]
|
||||
help:comment "$NUX_SCRIPT"
|
||||
help:comment "$NUX_RUNNER"
|
||||
nux.exec.optional task.help.additional
|
||||
help:comment "$NUX_RUNNER"
|
||||
else
|
||||
:topic "$@"
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue