Skip to content

Instantly share code, notes, and snippets.

@Jach
Created July 2, 2025 06:39
Show Gist options
  • Save Jach/7df076ff544a268998233e891df4db82 to your computer and use it in GitHub Desktop.
Save Jach/7df076ff544a268998233e891df4db82 to your computer and use it in GitHub Desktop.
#!/bin/sh
# About:
# Highlight text and launch a PhraseReader.com window for speed-reading it!
# Setup:
# Uses xdotool and makes use of the fact that highlighting text on Linux makes it paste-able via middle clicking.
# Make a nwe firefox profile via `firefox --no-remote --ProfileManager`, use it as the profile flag below.
# Open the profile and adjust its look to be very minimal, like a popup. Suggestions:
# ctrl+shift+b hides the bookmark toolbar
# right clicking the toolbar and "customizing toolbar" lets you turn on the title bar, which I like for window chrome
# in the menu bar, you can check things in view to turn off, before turning off the menu bar itself
# install ubo
# in about:config, set toolkit.legacyUserProfileCustomizations.stylesheets = true
# in the profile folder below, make a dir called chrome/ and add userChrome.css
# I added:
# #TabsToolbar {
# visibility:collpase;
# }
# #sidebar-header {
# visibility: collpase !important;
# }
#
# #titlebar { display: none !important; }
#
# #urlbar {
# visibility: collapse !important;
# }
#
# Now you may need to adjust the default width/height/offset below.
# Usage:
# Set this script to launch in response to a keyboard shortcut for easiest use. I use meta+F1.
firefox --profile ~/.mozilla/firefox/dffppvt9.phrasereader/ --new-window https://phrasereader.com &
win_id=`xdotool search --sync --name "PhraseReader — Mozilla Firefox" | head -n 1`
W=900
H=500
eval `xdotool getmouselocation --shell`
xdotool windowsize $win_id $W $H
new_x=$((X - W / 2))
new_y=$((Y - H / 2))
xdotool windowmove $win_id $new_x $new_y
xdotool windowactivate $win_id
# middle click paste:
xdotool click 2
# move down to the parse button and click it
xdotool mousemove_relative 0 200 click 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment