Skip to content

Commit

Permalink
Add a script to pix and delete images from directory.
Browse files Browse the repository at this point in the history
  • Loading branch information
kraasch committed Feb 20, 2024
1 parent 2334022 commit 276fd75
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ hub_update:
@hub_ctrl ${HUB_MODE} ln "$(realpath ./src/core/expand_globs)"
@hub_ctrl ${HUB_MODE} ln "$(realpath ./src/core/expand_globs_py)"
@hub_ctrl ${HUB_MODE} ln "$(realpath ./src/wrappers/git/git_commit_past)"
@hub_ctrl ${HUB_MODE} ln "$(realpath ./src/wrappers/misc/sxiv_rm)"
23 changes: 23 additions & 0 deletions src/wrappers/misc/sxiv_rm
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash

DIR="$1"

function main() {
if $(test -d "$DIR"); then
sxiv -t "$DIR"/*
echo 'Delete some of those? (y/ctrl-c)'
read answer
if $(test "$answer" != "y"); then
echo 'User abort.'
return 1
fi
sxiv -t "$DIR"/* -o | xargs -I{} rm "{}"
echo "REMAINING"
ls "$DIR"
else
echo 'Usage: sxiv_rm "<dirctory_name>"'
return 1
fi
}

main

0 comments on commit 276fd75

Please sign in to comment.