Created
January 3, 2023 05:36
-
-
Save 641i130/f764ee2f2907adb4fac4de90a365e942 to your computer and use it in GitHub Desktop.
Set random wallpaper with given folders
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
feh --bg-fill "$(find /landscape/images/path/ -regextype posix-extended -regex '.*\.(png|jpg|jpeg)$' -print0 |shuf -z -n 1)" "$(find /portrait/images/path/ -regextype posix-extended -regex '.*\.(png|jpg|jpeg)$' -print0 |shuf -z -n 1)" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Here is a one-liner that should do what you're asking:
find /path/to/directory -type f -exec convert {} -resize 1920x1080! {} ;
This will find all files in the directory specified by /path/to/directory, and for each file it will run the convert command to resize the image to 1920x1080 pixels, using the ! flag to overwrite the original image file.
Note that this command assumes that you have the convert command installed on your system. This command is part of the imagemagick package, which you can install using the following command:
sudo pacman -S imagemagick
I hope this helps! Let me know if you have any questions or if you need further assistance.