Merge pull request #174 from dylanaraps/shuffle

Remove shuffledir in favor of '--image path/to/dir/'
This commit is contained in:
Dylan Araps 2016-03-26 09:28:34 +11:00
commit 0eff00c3ff
4 changed files with 24 additions and 27 deletions

View File

@ -284,13 +284,15 @@ alias fetch2="fetch \
## Usage ## Usage
usage: fetch --option "value" --option "value" usage: neofetch --option "value" --option "value"
NOTE: There's also a config option for each flag below.
Info: Info:
--disable infoname Allows you to disable an info line from appearing --disable infoname Allows you to disable an info line from appearing
in the output. in the output.
NOTE: You can supply multiple args. eg. NOTE: You can supply multiple args. eg.
'fetch --disable cpu gpu disk shell' 'neofetch --disable cpu gpu disk shell'
--osx_buildversion on/off Hide/Show Mac OS X build version. --osx_buildversion on/off Hide/Show Mac OS X build version.
--osx_codename on/off Hide/Show Mac OS X codename. --osx_codename on/off Hide/Show Mac OS X codename.
--os_arch on/off Hide/Show Windows architecture. --os_arch on/off Hide/Show Windows architecture.
@ -337,8 +339,8 @@ alias fetch2="fetch \
Progress Bars: Progress Bars:
--progress_char char Character to use when drawing progress bars. --progress_char char Character to use when drawing progress bars.
--progress_length num Length in spaces to make the progress bars. --progress_length num Length in spaces to make the progress bars.
--progress_colors num num Colors to make the progress bar. Set in this order: --progress_colors num num Colors to make the progress bar.
elapsed, total Set in this order: elapsed, total
--cpu_display mode1 mode2 Which shorthand to use and how CPU usage should be printed --cpu_display mode1 mode2 Which shorthand to use and how CPU usage should be printed
mode1 takes: name, speed, tiny, on, off mode1 takes: name, speed, tiny, on, off
mode2 takes: info, bar, infobar, barinfo mode2 takes: info, bar, infobar, barinfo
@ -352,11 +354,10 @@ alias fetch2="fetch \
Image: Image:
--image type Image source. Where and what image we display. --image type Image source. Where and what image we display.
Possible values: wall, shuffle, ascii, Possible values: wall, ascii,
/path/to/img, off /path/to/img, /path/to/dir/, off
--size 20px | --size 20% Size to make the image, takes pixels or a percentage. --size 20px | --size 20% Size to make the image, takes pixels or a percentage.
--image_backend w3m/iterm2 Which program to use to draw images. --image_backend w3m/iterm2 Which program to use to draw images.
--shuffle_dir path/to/dir Which directory to shuffle for an image.
--image_position left/right Where to display the image: (Left/Right) --image_position left/right Where to display the image: (Left/Right)
--crop_mode mode Which crop mode to use --crop_mode mode Which crop mode to use
Takes the values: normal, fit, fill Takes the values: normal, fit, fill
@ -378,11 +379,11 @@ alias fetch2="fetch \
--ascii value Where to get the ascii from, Possible values: --ascii value Where to get the ascii from, Possible values:
distro, /path/to/ascii distro, /path/to/ascii
--ascii_colors x x x x x x Colors to print the ascii art --ascii_colors x x x x x x Colors to print the ascii art
--ascii_distro distro Which Distro\'s ascii art to print --ascii_distro distro Which Distro's ascii art to print
Stdout: Stdout:
--stdout info info Launch fetch in stdout mode which prints the info --stdout info info Launch neofetch in stdout mode which prints the info
in a plain-text format that you can use with in a plain-text format that you can use with
lemonbar etc. lemonbar etc.
--stdout_separator string String to use as a separator in stdout mode. --stdout_separator string String to use as a separator in stdout mode.
@ -393,6 +394,7 @@ alias fetch2="fetch \
shot function will use \$scrot_dir and \$scrot_name. shot function will use \$scrot_dir and \$scrot_name.
--scrot_cmd cmd Screenshot program to launch --scrot_cmd cmd Screenshot program to launch
Other: Other:
--config /path/to/config Specify a path to a custom config file --config /path/to/config Specify a path to a custom config file
--config none Launch the script without a config file --config none Launch the script without a config file

View File

@ -274,7 +274,7 @@ disk_display="off"
# Image Source # Image Source
# --image wall, shuffle, ascii, /path/to/img, off # --image wall, ascii, /path/to/img, /path/to/dir/, off
image="wall" image="wall"
# Thumbnail directory # Thumbnail directory
@ -294,9 +294,6 @@ w3m_img_path="/usr/lib/w3m/w3mimgdisplay"
# --image_position left/right # --image_position left/right
image_position="left" image_position="left"
# Shuffle dir
shuffle_dir="$HOME/Pictures/wallpapers/wash"
# Crop mode # Crop mode
# --crop_mode normal/fit/fill # --crop_mode normal/fit/fill
crop_mode="normal" crop_mode="normal"

View File

@ -295,7 +295,7 @@ disk_display="off"
# Image Source # Image Source
# --image wall, shuffle, ascii, /path/to/img, off # --image wall, ascii, /path/to/img, /path/to/dir/, off
image="wall" image="wall"
# Thumbnail directory # Thumbnail directory
@ -315,9 +315,6 @@ w3m_img_path="/usr/lib/w3m/w3mimgdisplay"
# --image_position left/right # --image_position left/right
image_position="left" image_position="left"
# Shuffle dir
shuffle_dir="$HOME/Pictures/wallpapers/wash"
# Crop mode # Crop mode
# --crop_mode normal/fit/fill # --crop_mode normal/fit/fill
crop_mode="normal" crop_mode="normal"
@ -1930,9 +1927,15 @@ getimage () {
case "$image" in case "$image" in
"wall") getwallpaper ;; "wall") getwallpaper ;;
"shuffle") img="$(find "$shuffle_dir" -type f \( -name '*.jpg' -o -name '*.png' \) -print0 | shuf -n1 -z)" ;;
"ascii") getascii; return ;; "ascii") getascii; return ;;
*) img="$image" ;; *)
if [ "${image: -1}" == "/" ]; then
files=("$image"*.png "$image"*.jpg)
img="$(printf "%s" "${files[RANDOM % ${#files[@]}]}")"
else
img="$image"
fi
;;
esac esac
# Get terminal width and height # Get terminal width and height
@ -2560,11 +2563,10 @@ usage () { cat << EOF
Image: Image:
--image type Image source. Where and what image we display. --image type Image source. Where and what image we display.
Possible values: wall, shuffle, ascii, Possible values: wall, ascii,
/path/to/img, off /path/to/img, /path/to/dir/, off
--size 20px | --size 20% Size to make the image, takes pixels or a percentage. --size 20px | --size 20% Size to make the image, takes pixels or a percentage.
--image_backend w3m/iterm2 Which program to use to draw images. --image_backend w3m/iterm2 Which program to use to draw images.
--shuffle_dir path/to/dir Which directory to shuffle for an image.
--image_position left/right Where to display the image: (Left/Right) --image_position left/right Where to display the image: (Left/Right)
--crop_mode mode Which crop mode to use --crop_mode mode Which crop mode to use
Takes the values: normal, fit, fill Takes the values: normal, fit, fill
@ -2699,7 +2701,6 @@ while [ "$1" ]; do
--size) image_size="$2" ;; --size) image_size="$2" ;;
--image_backend) image_backend="$2" ;; --image_backend) image_backend="$2" ;;
--shuffle_dir) shuffle_dir="$2" ;;
--image_position) image_position="$2" ;; --image_position) image_position="$2" ;;
--crop_mode) crop_mode="$2" ;; --crop_mode) crop_mode="$2" ;;
--crop_offset) crop_offset="$2" ;; --crop_offset) crop_offset="$2" ;;

View File

@ -158,7 +158,7 @@ Takes: bar, infobar, barinfo, perc
.B \--image 'type' .B \--image 'type'
Image source. Where and what image we display. Image source. Where and what image we display.
.br .br
Possible values: wall, shuffle, ascii, /path/to/img, off Possible values: wall, ascii, /path/to/img, /path/to/dir/, off
.TP .TP
.B \--size 'size' .B \--size 'size'
Size to make the image, takes pixels or a percentage. Size to make the image, takes pixels or a percentage.
@ -166,9 +166,6 @@ Size to make the image, takes pixels or a percentage.
.B \--image_backend 'w3m/iterm2' .B \--image_backend 'w3m/iterm2'
Which program to use to draw images. Which program to use to draw images.
.TP .TP
.B \--shuffle_dir 'path'
Which directory to shuffle for an image.
.TP
.B \--image_position 'left/right' .B \--image_position 'left/right'
Where to display the image: (Left/Right) Where to display the image: (Left/Right)
.TP .TP