diff --git a/bin/scanpdf b/bin/scanpdf new file mode 100755 index 0000000..9c2278d --- /dev/null +++ b/bin/scanpdf @@ -0,0 +1,18 @@ +#!/usr/bin/bash +set -e + +usage() { + echo -e "USAGE: $0 FILE.pdf" + exit 0 +} + +DEVICE='pixma:04A9178A_31A16C' +FORMAT='png' +RES=300 + +if [ "$1" == '-h' ] || [[ "$1" != *.pdf ]]; then + usage +fi + +scanimage -d "$DEVICE" --format="$FORMAT" --resolution "$RES" > "$1" +convert "$1" "$1" diff --git a/bin/set-ddc-light b/bin/set-ddc-light index 6a86e2e..d3e2ecc 100755 --- a/bin/set-ddc-light +++ b/bin/set-ddc-light @@ -1,7 +1,7 @@ #!/usr/bin/bash set -e -CUR_LIGHT="$(set-light "$@")" +CUR_LIGHT="$("$(dirname "$0")"/set-light "$@")" SCREENS="$(ddcutil detect | awk '$1 == "Display" {print $2}')" diff --git a/bin/set-vol b/bin/set-vol index 102e46d..4eaddf8 100755 --- a/bin/set-vol +++ b/bin/set-vol @@ -5,10 +5,10 @@ CUR="$(pactl get-sink-volume 0 | awk '$1 == "Volume:" {print substr($5, 1, lengt SHIFT="${1}" case "${1:0:1}" in - "") + '') exit 1 ;; - "+"|"-") + '+'|'-') NEW="$((CUR - CUR % SHIFT + SHIFT))" ;; *)