Scrot: Make scrot easier to use
This commit is contained in:
parent
464a810f94
commit
d34f01f21b
2 changed files with 5 additions and 17 deletions
|
@ -681,16 +681,6 @@ scrot="off"
|
||||||
# Flag: --scrot_cmd
|
# Flag: --scrot_cmd
|
||||||
scrot_cmd="auto"
|
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
|
# Screenshot Filename
|
||||||
# What to name the screenshots
|
# What to name the screenshots
|
||||||
#
|
#
|
||||||
|
|
12
neofetch
12
neofetch
|
@ -637,13 +637,13 @@ get_wm() {
|
||||||
case "$os" in
|
case "$os" in
|
||||||
"Mac OS X")
|
"Mac OS X")
|
||||||
ps_line="$(ps -e | grep -o '[S]pectacle\|[A]methyst\|[k]wm')"
|
ps_line="$(ps -e | grep -o '[S]pectacle\|[A]methyst\|[k]wm')"
|
||||||
|
|
||||||
case "$ps_line" in
|
case "$ps_line" in
|
||||||
*"kwm"*) wm="Kwm" ;;
|
*"kwm"*) wm="Kwm" ;;
|
||||||
*"Amethyst"*) wm="Amethyst" ;;
|
*"Amethyst"*) wm="Amethyst" ;;
|
||||||
*"Spectacle"*) wm="Spectacle" ;;
|
*"Spectacle"*) wm="Spectacle" ;;
|
||||||
*) wm="Quartz Compositor" ;;
|
*) wm="Quartz Compositor" ;;
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
|
|
||||||
"Windows")
|
"Windows")
|
||||||
|
@ -2516,11 +2516,7 @@ to_off() {
|
||||||
# SCREENSHOT
|
# SCREENSHOT
|
||||||
|
|
||||||
take_scrot() {
|
take_scrot() {
|
||||||
if [[ -d "$scrot_dir" ]]; then
|
scrot_program "${scrot_dir}${scrot_name}" 2>/dev/null
|
||||||
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_upload" == "on" ]] && scrot_upload
|
[[ "$scrot_upload" == "on" ]] && scrot_upload
|
||||||
}
|
}
|
||||||
|
@ -2568,6 +2564,8 @@ scrot_args() {
|
||||||
scrot_dir="${2/$scrot_name}"
|
scrot_dir="${2/$scrot_name}"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
[[ -z "$@" ]] && scrot_dir="${PWD:+${PWD}/}"
|
||||||
}
|
}
|
||||||
|
|
||||||
scrot_program() {
|
scrot_program() {
|
||||||
|
|
Loading…
Reference in a new issue