aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorla-ninpre <leobrekalini@gmail.com>2021-11-08 22:59:06 +0300
committerla-ninpre <leobrekalini@gmail.com>2021-11-08 22:59:06 +0300
commit52e2b6882aca85563ba3517c977256ea872c5cf6 (patch)
tree071475f2443983dad4412e6cb3c20afade3ddb9a
parent433eae255f687889f03c2ded5bf94882a661b3a1 (diff)
downloaddotfiles-52e2b6882aca85563ba3517c977256ea872c5cf6.tar.gz
dotfiles-52e2b6882aca85563ba3517c977256ea872c5cf6.zip
add scrot_cmd script
also keep readme up to date.
-rw-r--r--README.md5
-rwxr-xr-xbin/.local/bin/scrot_cmd35
-rwxr-xr-xinstall2
3 files changed, 42 insertions, 0 deletions
diff --git a/README.md b/README.md
index 19ac62f..8d5e959 100644
--- a/README.md
+++ b/README.md
@@ -28,6 +28,8 @@ a list of programs that i have configurations for.
* alacritty
+* kitty
+
* starship prompt
## scripts
@@ -52,6 +54,9 @@ a list of useful (for me) shell scripts also provided in current repo.
* `rand` -- outputs random string
+* `scrot_cmd` -- wrapper for scrot utility to simplify it's usage
+ in keybindings
+
## license
all code in this repo is licensed under an isc license.
diff --git a/bin/.local/bin/scrot_cmd b/bin/.local/bin/scrot_cmd
new file mode 100755
index 0000000..827ddf7
--- /dev/null
+++ b/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 "$@"
diff --git a/install b/install
index 215bb46..f17a945 100755
--- a/install
+++ b/install
@@ -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"