Advertisement
Tarrasquero

Cambiar wallpapers en debian

Sep 26th, 2016
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.45 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. Dir="/home/nogi/imágenes/wallpapers"
  4.  
  5. if [ ! -d "$Dir" ]; then
  6.     echo "Not Exist $Dir"
  7.     exit 1
  8. fi
  9.  
  10. SetBG () {
  11. TotalFiles=$( ls -1 "$Dir" | wc -l )
  12. RandomNumber=$(( $RANDOM % $TotalFiles ))
  13. test ! $RandomNumber = 0 || RandomNumber=1
  14.  
  15. RandomFile="$( ls -1 $Dir | head -n $RandomNumber | tail -n 1)"
  16.  
  17. #echo "Selected File: $RandomFile"
  18. feh --bg-fill "${Dir%/}/${RandomFile}"
  19. }
  20.  
  21. while true; do
  22.     SetBG
  23.     sleep 10m
  24. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement