From d34f01f21b5f64620c3207b9807c37c987e84dde Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Mon, 27 Mar 2017 08:29:04 +1100 Subject: [PATCH] Scrot: Make scrot easier to use --- config/config | 10 ---------- neofetch | 12 +++++------- 2 files changed, 5 insertions(+), 17 deletions(-) diff --git a/config/config b/config/config index d1621962..0e11e354 100644 --- a/config/config +++ b/config/config @@ -681,16 +681,6 @@ scrot="off" # Flag: --scrot_cmd scrot_cmd="auto" -# Screenshot Directory -# Where to save the screenshots -# -# Default: '~/Pictures/' -# Values: 'dir' -# Flag: --scrot_dir -# -# Note: Neofetch won't create the directory if it doesn't exist. -scrot_dir="$HOME/Pictures/" - # Screenshot Filename # What to name the screenshots # diff --git a/neofetch b/neofetch index a3690aa9..1fd40c24 100755 --- a/neofetch +++ b/neofetch @@ -637,13 +637,13 @@ get_wm() { case "$os" in "Mac OS X") ps_line="$(ps -e | grep -o '[S]pectacle\|[A]methyst\|[k]wm')" - + case "$ps_line" in *"kwm"*) wm="Kwm" ;; *"Amethyst"*) wm="Amethyst" ;; *"Spectacle"*) wm="Spectacle" ;; *) wm="Quartz Compositor" ;; - esac + esac ;; "Windows") @@ -2516,11 +2516,7 @@ to_off() { # SCREENSHOT take_scrot() { - if [[ -d "$scrot_dir" ]]; then - scrot_program "${scrot_dir}${scrot_name}" 2>/dev/null - else - printf "%s\n" "Screenshot: $scrot_dir doesn't exist. Edit the config file or create the directory to take screenshots." - fi + scrot_program "${scrot_dir}${scrot_name}" 2>/dev/null [[ "$scrot_upload" == "on" ]] && scrot_upload } @@ -2568,6 +2564,8 @@ scrot_args() { scrot_dir="${2/$scrot_name}" ;; esac + + [[ -z "$@" ]] && scrot_dir="${PWD:+${PWD}/}" } scrot_program() {