all repos — dotfiles @ 52e2b6882aca85563ba3517c977256ea872c5cf6

personal dotfiles

add scrot_cmd script

also keep readme up to date.
la-ninpre leobrekalini@gmail.com
Mon, 08 Nov 2021 22:59:06 +0300
commit

52e2b6882aca85563ba3517c977256ea872c5cf6

parent

433eae255f687889f03c2ded5bf94882a661b3a1

3 files changed, 42 insertions(+), 0 deletions(-)

jump to
M README.mdREADME.md

@@ -28,6 +28,8 @@ * moc

* alacritty +* kitty + * starship prompt ## scripts

@@ -51,6 +53,9 @@

* `print_codes` -- makes a printable qr-code backup for otp recovery codes * `rand` -- outputs random string + +* `scrot_cmd` -- wrapper for scrot utility to simplify it's usage + in keybindings ## license
A bin/.local/bin/scrot_cmd

@@ -0,0 +1,35 @@

+#!/bin/sh + +# a simple scrot wrapper to be used wm-agnostically + +scrot_cmd() { + # shellcheck disable=SC2086 + + # scrot_cmd flags path + + scrot $1 "$2" -e "notify-send -t 3000 \"scrot\" \"screenshot \$f saved\"" +} + +main() { + + _scrot_dir="$HOME/Pictures/Screenshots" + _scrot_name="%Y-%m-%d-%s_\$wx\$h_scrot.png" + _scrot_path="$_scrot_dir/$_scrot_name" + + case $1 in + -f|--full) + scrot_cmd "" "$_scrot_path" + ;; + -a|--area) + scrot_cmd "-sf" "$_scrot_path" + ;; + -c|--focused) + scrot_cmd "-u" "$_scrot_path" + ;; + *) + exit 1 + ;; + esac +} + +main "$@"
M installinstall

@@ -1,5 +1,7 @@

#!/bin/sh +# TODO: make this better. it really sucks. + for prg in alacritty bin bash doom-emacs kitty moc mpd nvim starship xmonad do stow -vDt ~ "$prg"