From 27fa2aa9db8a2aa7301c24660486cc76f39cd348 Mon Sep 17 00:00:00 2001 From: Alexander Rosenberg Date: Thu, 18 May 2023 01:19:56 -0700 Subject: [PATCH 1/3] Add notifications to some scripts --- copy-screen-text.sh | 8 +++++++- screenshot.sh | 9 ++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/copy-screen-text.sh b/copy-screen-text.sh index 5b3728b..aea42a4 100755 --- a/copy-screen-text.sh +++ b/copy-screen-text.sh @@ -1,2 +1,8 @@ #!/usr/bin/env zsh -maim -k -s -f png | tesseract stdin stdout -l eng | xclip -selection clipboard + +local text="$(maim -k -s -f png | tesseract stdin stdout -l eng 2>/dev/null)" +let char_count="$(printf '%s' "${text}" | wc -c)" + +printf '%s' "${text}" | xclip -selection clipboard + +notify-send -t 5000 "Coppied Text" "Coppied ${char_count} characters" diff --git a/screenshot.sh b/screenshot.sh index d85c9a8..e9c1c38 100755 --- a/screenshot.sh +++ b/screenshot.sh @@ -1,13 +1,16 @@ #!/usr/bin/env zsh local maim_args=("-f" "png") -local outfile="${HOME}/downloads/screenshot--$(date +'%F_%k-%M-%S').png" +local outfile="screenshot--$(date +'%F_%k-%M-%S').png" +local outpath="${HOME}/downloads/${outfile}" case "${1}" in; '-root') - maim ${maim_args} "${outfile}" + maim ${maim_args} "${outpath}" ;; '-select' | *) - maim ${maim_args} -s "${outfile}" + maim ${maim_args} -s "${outpath}" ;; esac + +notify-send -t 5000 "Screenshot Taken" "Screenshot saved to \"${outfile}\"" From 3b33657ebb710ca379c22def68e45cdd99f5b18d Mon Sep 17 00:00:00 2001 From: Alexander Rosenberg Date: Fri, 19 May 2023 14:50:20 -0700 Subject: [PATCH 2/3] Added leap to kitty-scrollback-neovim.sh --- kitty-scrollback-neovim.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kitty-scrollback-neovim.sh b/kitty-scrollback-neovim.sh index 5807fa9..427e61e 100755 --- a/kitty-scrollback-neovim.sh +++ b/kitty-scrollback-neovim.sh @@ -12,6 +12,9 @@ fi exec nvim 63<&0 0 q :qa!" \ -c "set scrollback=100000 nonumber termguicolors laststatus=0 clipboard+=unnamedplus" \ -c "autocmd TermEnter * stopinsert" \ From 5f324035a77f499e5a2597e308e217297521a54f Mon Sep 17 00:00:00 2001 From: Alexander Rosenberg Date: Fri, 19 May 2023 21:09:48 -0700 Subject: [PATCH 3/3] Fix notification in screenshot.sh --- screenshot.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/screenshot.sh b/screenshot.sh index e9c1c38..fc3bf16 100755 --- a/screenshot.sh +++ b/screenshot.sh @@ -6,10 +6,10 @@ local outpath="${HOME}/downloads/${outfile}" case "${1}" in; '-root') - maim ${maim_args} "${outpath}" + maim ${maim_args} "${outpath}" || exit ;; '-select' | *) - maim ${maim_args} -s "${outpath}" + maim ${maim_args} -s "${outpath}" || exit ;; esac