Skip to content

Instantly share code, notes, and snippets.

View Amooti73's full-sized avatar

John Flood Amooti73

  • Catholic University of Eastern Africa
  • Nairobi, Kenya
View GitHub Profile
@Amooti73
Amooti73 / wikx.sh
Last active March 8, 2022 07:06
Click and drag to select a word or words on the screen and send them to rofi and then display the introductory section of the matching wikipedia article.
#!/bin/bash
# Dependencies: tesseract-ocr imagemagick scrot xsel wikit rofi
set -e
SCR_IMG=$(mktemp)
trap 'rm $SCR_IMG*' EXIT
scrot -s "$SCR_IMG.png"
mogrify -modulate 100,0 -resize 400% "$SCR_IMG.png" #should increase detection rate
tesseract "$SCR_IMG.png" "$SCR_IMG" &> /dev/null
@Amooti73
Amooti73 / dict.sh
Last active October 5, 2023 23:08
Click and drag to select a word on the screen and send it to rofi to display its definition with sdcv
#!/bin/bash
# Dependencies: tesseract-ocr imagemagick scrot xsel rofi
set -e
SCR_IMG=$(mktemp)
trap 'rm $SCR_IMG*' EXIT
scrot -s "$SCR_IMG.png"
mogrify -modulate 100,0 -resize 400% "$SCR_IMG.png" #should increase detection rate
tesseract "$SCR_IMG.png" "$SCR_IMG" &> /dev/null
#!/bin/bash
# Dependencies: tesseract-ocr imagemagick scrot xsel
SCR_IMG=`mktemp`
trap "rm $SCR_IMG*" EXIT
/usr/bin/scrot -s $SCR_IMG.png
/usr/bin/mogrify -modulate 100,0 -resize 400% $SCR_IMG.png #should increase detection rate
/usr/bin/tesseract $SCR_IMG.png $SCR_IMG &> /dev/null
cat $SCR_IMG.txt | /usr/bin/xsel -bi
@Amooti73
Amooti73 / .muttrc
Last active May 1, 2017 06:22 — forked from manolomartinez/.muttrc
Use ranger to save attachments in mutt.
# use ranger to save attachment
macro attach S "<pipe-message>/path/to/muttsaveattach.sh"<enter>