Compare commits

..

No commits in common. "master" and "0.1.3" have entirely different histories.

5 changed files with 70 additions and 69 deletions

0
.gitignore vendored Executable file → Normal file
View file

0
LICENSE Executable file → Normal file
View file

67
README.md Executable file → Normal file
View file

@ -1,43 +1,41 @@
# WPFind
![wpfind](pics/logo.png) ![wpfind](pics/logo.png)
WPFind
======
The purpose of this script is to find wallpapers among pictures files in directory and sub-directories and move/copy them to a separate directory. The purpose of this script is to find wallpapers among pictures files in directory and sub-directories and move/copy them to a separate directory.
It can be useful when you are trying to clean your mess on your computer ;-) It can be useful when you are trying to clean your mess on your computer ;-)
## Requirements Requirements
------------
- Ubuntu, Linux Mint (should work on Ubuntu derivatives), Arch Linux (should work on Ubuntu derivatives) and probably any Linux distro * Ubuntu, Linux Mint (should work on other Ubuntu derivatives)
- detox * detox
- imagemagick * imagemagick
## Installation Installation
------------
For Ubuntu 16.04, Linux Mint 18.x, and other derivatives
```
curl -L https://packagecloud.io/makoto/stable/gpgkey | sudo apt-key add -
echo "deb https://packagecloud.io/makoto/stable/ubuntu/ xenial main" | sudo tee /etc/apt/sources.list.d/makoto.list
sudo apt-get update
sudo apt-get install wpfind
```
For Ubuntu 18.04, Linux Mint 19.x, and other derivatives For Ubuntu 18.04, Linux Mint 19.x, and other derivatives
```shell ```
curl -L https://packagecloud.io/makoto/stable/gpgkey | sudo apt-key add - curl -L https://packagecloud.io/makoto/stable/gpgkey | sudo apt-key add -
echo "deb https://packagecloud.io/makoto/stable/ubuntu/ bionic main" | sudo tee /etc/apt/sources.list.d/makoto.list echo "deb https://packagecloud.io/makoto/stable/ubuntu/ bionic main" | sudo tee /etc/apt/sources.list.d/makoto.list
sudo apt-get update sudo apt-get update
sudo apt-get install wpfind sudo apt-get install wpfind
``` ```
For Ubuntu 20.04, Linux Mint 20.x, and other derivatives Usage options
-------------
```shell
curl -L https://packagecloud.io/makoto/stable/gpgkey | sudo apt-key add -
echo "deb https://packagecloud.io/makoto/stable/ubuntu/ focal main" | sudo tee /etc/apt/sources.list.d/makoto.list
sudo apt-get update
sudo apt-get install wpfind
```
For Arch Linux and derivatives
```shell
yay -S wpfind
```
## Usage options
``` ```
██╗ ██╗██████╗ ███████╗██╗███╗ ██╗██████╗ ██╗ ██╗██████╗ ███████╗██╗███╗ ██╗██████╗
@ -49,7 +47,7 @@ yay -S wpfind
Find wallpapers recursively in a dir and sub-directories... Find wallpapers recursively in a dir and sub-directories...
Version : 0.1.3 Version : 0.1.2
Author : Francois B (Makoto) Author : Francois B (Makoto)
Licence : GPLv3 Licence : GPLv3
@ -64,33 +62,36 @@ Usage : wpfind [options]
-h : show help & informations -h : show help & informations
``` ```
## Usage examples Usage examples
--------------
Copy wallpapers in the current directory and sub-directories with minimum width of 1920px to wpfiles Copy wallpapers in the current directory and sub-directories with minimum width of 1920px to wpfiles
```shell ```
wpfind -c wpfind -c
``` ```
Move wallpapers in the current directory and sub-directories with minimum width of 1920px to wpfiles Move wallpapers in the current directory and sub-directories with minimum width of 1920px to wpfiles
```shell ```
wpfind -m wpfind -m
``` ```
Move wallpapers in the /home/user/MyPics directory and sub-directories with minimum width of 2560px to /home/user/MyWP directory Move wallpapers in the /home/user/MyPics directory and sub-directories with minimum width of 2560px to /home/user/MyWP directory
```shell ```
wpfind -m -w 2560 -i /home/user/MyPics -o /home/user/MyWP wpfind -m -w 2560 -i /home/user/MyPics -o /home/user/MyWP
``` ```
## Credits Credits
-------
This script has been written by Francois B. (Makotosan/Shakasan) This script has been written by Francois B. (Makotosan/Shakasan)
- Email : francois@exoseed.be * Email : francois@makotonoblog.be
- Website : https://makotonoblog.be/wpfind/ * Website : https://makotonoblog.be/wpfind/
## Licence Licence
-------
The script is licensed under the terms of the GPLv3 The script is licensed under the terms of the GPLv3

0
pics/logo.png Executable file → Normal file
View file

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

8
wpfind
View file

@ -7,7 +7,7 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# app version number # app version number
version="0.1.3.2" version="0.1.3"
# logfile # logfile
logfile="wpfind.log" logfile="wpfind.log"
touch $logfile touch $logfile
@ -151,7 +151,7 @@ function wpFind () {
if [ "$verbosemode" = "yes" ]; then if [ "$verbosemode" = "yes" ]; then
printf "cp $iMode $pic $outputDir\n" printf "cp $iMode $pic $outputDir\n"
fi fi
cp $iMode "$pic" "$outputDir" cp $iMode $pic $outputDir
date2log=$($date +'%Y-%m-%d %H:%M:%S') date2log=$($date +'%Y-%m-%d %H:%M:%S')
printf "$date2log - cp $iMode $pic $outputDir\n" >> $logfile printf "$date2log - cp $iMode $pic $outputDir\n" >> $logfile
# if move mode # if move mode
@ -160,7 +160,7 @@ function wpFind () {
if [ "$verbosemode" = "yes" ]; then if [ "$verbosemode" = "yes" ]; then
printf "mv $iMode $pic $outputDir\n" printf "mv $iMode $pic $outputDir\n"
fi fi
mv $iMode "$pic" "$outputDir" mv $iMode $pic $outputDir
date2log=$($date +'%Y-%m-%d %H:%M:%S') date2log=$($date +'%Y-%m-%d %H:%M:%S')
printf "$date2log - mv $iMode $pic $outputDir\n" >> $logfile printf "$date2log - mv $iMode $pic $outputDir\n" >> $logfile
fi fi
@ -179,7 +179,7 @@ function main() {
beginProcess=$($date +'%s') beginProcess=$($date +'%s')
printf "$NORMAL""Analyzing...(this may take a (very)(long) while)\n""$NORMAL" printf "$NORMAL""Analyzing...(this may take a (very)(long) while)\n""$NORMAL"
# check if dependencies are installed # check if detox is installed
depInstalled depInstalled
# create the outputDir if doesn't exist # create the outputDir if doesn't exist