Skip to content

m-faizan-tariq/textsniper-linux

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TextSniper for Linux

A simple, yet effective alternative to TextSniper for macOS — now for Linux (GNOME Wayland).

Uses Flameshot for interactive region selection, Tesseract OCR for text extraction, and wl-clipboard to put the result on your clipboard.

screenshot

Requirements

  • Linux with GNOME on Wayland (tested on Ubuntu 26.04, GNOME Shell 50)
  • Flameshot — region screenshot
  • Tesseract OCR — text recognition
  • wl-clipboard — Wayland clipboard (wl-copy)
  • Python 3 with PyGObject and AyatanaAppIndicator3 — tray icon
sudo apt install flameshot tesseract-ocr wl-clipboard gir1.2-ayatanaappindicator3-0.1 python3-gi

How to use it?

Automatic install

git clone https://github.com/m-faizan-tariq/textsniper-linux.git
cd textsniper-linux
chmod +x install.sh
./install.sh

Manual setup

  1. Copy the scripts to ~/.local/bin/:

    cp textsnip.sh ~/.local/bin/textsnip
    cp textsnip-tray ~/.local/bin/textsnip-tray
    chmod +x ~/.local/bin/textsnip ~/.local/bin/textsnip-tray
  2. Add desktop entries:

    cp textsnip.desktop ~/.local/share/applications/
    cp textsnip-tray.desktop ~/.config/autostart/
  3. Bind a keyboard shortcut (e.g. Win+Shift+T):

    gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:\
      /org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/\
      name 'TextSniper'
    gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:\
      /org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/\
      command 'textsnip'
    gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:\
      /org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/\
      binding '<Super><Shift>T'
  4. Start the tray icon to access OCR from your system tray:

    textsnip-tray
  5. Configure Flameshot to hide the help overlay:

    mkdir -p ~/.config/flameshot
    cat > ~/.config/flameshot/flameshot.ini << 'EOF'
    [General]
    showHelp=false
    EOF
    

How it works

textsnip ──> flameshot gui -s -r ──> PNG (stdout)
                 │
                 ▼
          tesseract stdin stdout ──> plain text
                 │
                 ▼
              wl-copy ──> system clipboard

Files

File Purpose
textsnip.sh Main OCR pipeline script
textsnip-tray System tray icon (Python/Gtk)
textsnip.desktop Application launcher entry
textsnip-tray.desktop Autostart entry
install.sh One-command installer

Notes

  • The Flameshot dimensions overlay cannot be hidden and will briefly appear on each capture.
  • This project was built for GNOME Wayland. X11 users may need xclip instead of wl-copy.
  • AI-generated.

License

Apache-2.0

About

TextSniper for Linux — OCR text extraction on GNOME Wayland (Flameshot + Tesseract + wl-clipboard). Open-source alternative to the macOS TextSniper app.

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors