TheTwelveYearOld

joined 2 years ago
MODERATOR OF
 

It says on https://support.mozilla.org/en-US/kb/about-picture-picture-firefox#w_keyboard-shortcuts that the hotkey to toggle PiP is CTRL Shift ]. When I play a video it shows the PiP button, but the hotkey doesn't work. The other PiP keys like seeking and volume work. I'm on Fedora 41 with KDE 6.3.3 & Wayland.

 

It says on https://support.mozilla.org/en-US/kb/about-picture-picture-firefox#w_keyboard-shortcuts that the hotkey to toggle PiP is CTRL Shift ]. When I play a video it shows the PiP button, but the hotkey doesn't work. The other PiP keys like seeking and volume work. I'm on Fedora 41 with KDE 6.3.3 & Wayland.

[–] [email protected] 2 points 1 day ago (1 children)

I solved it on my own. I edited the post to include the code, basically I just run spectacle asynchronously so slurp immediately opens and then crops the image after I make a sleection.

 

I did some looking and there doesn't seem to be one, unless you know of any. Ideally I want a modal file manager like Yazi: it's keys are highly inspired by vim with H J K L navigation (H & L for traversing directories), a visual mode for selecting files, and lots of commands and customization. The one thing its missing is a grid view to preview image files. None of the orthodox file manager seem to have one, including Krusader which I just looked at. I'd love to finally stop using the mouse for file management and could go with either a TUI or GUI manager.

 

I did some looking and there doesn't seem to be one, unless you know of any. Ideally I want a modal file manager like Yazi: it's keys are highly inspired by vim with H J K L navigation (H & L for traversing directories), a visual mode for selecting files, and lots of commands and customization. The one thing its missing is a grid view to preview image files. None of the orthodox file manager seem to have one, including Krusader which I just looked at. I'd love to finally stop using the mouse for file management and could go with either a TUI or GUI manager.

[–] [email protected] 1 points 4 days ago (1 children)

I'd rather just write b t or h. I already have some single character search keywords.

 

Right now when you go to settings and click on the cell for a search engine under the keyword column, it shows a text box for me to add keywords to use in the URL bar. You can't do so for bookmarks, tabs, or history which are locked to * % and ^ respectively.

 

Right now when you go to settings and click on the cell for a search engine under the keyword column, it shows a text box for me to add keywords to use in the URL bar. You can't do so for bookmarks, tabs, or history which are locked to * % and ^ respectively.

[–] [email protected] 0 points 5 days ago (3 children)

lmao, thanks for trying to help though.

7
submitted 5 days ago* (last edited 1 day ago) by [email protected] to c/[email protected]
 

Edit: I edited the script to take a screenshot asynchronously, get the region with slurp, and use magickto crop it. I also multiply the values from slurp 2x to account for the 200% display scaling I have.

  #!/bin/bash 

	die(){
    notify-send "$1"
    exit 1
  }
  cleanup(){
    [[ -n $1 ]] && rm -r "$1"
  }
  SCR_IMG=$(mktemp -d) || die "failed to take screenshot"
  trap "cleanup '$SCR_IMG'" EXIT

	spectacle -nbo "$SCR_IMG/scr.tiff" &
	region=($(slurp -b "#00000000" -c "#80808080" -w 2 -f "%w %h %x %y"))
	for i in "${!region[@]}" 
	do
		region[i]=$(expr ${region[i]} "*" "2")
	done
	magick "$SCR_IMG/scr.tiff" -crop "${region[0]}x${region[1]}+${region[2]}+${region[3]}" "$SCR_IMG/scr.tiff" 

	tesseract "$SCR_IMG/scr.tiff" "$SCR_IMG/scr" &> /dev/null || die "failed to extract text"
  wl-copy < "$SCR_IMG/scr.txt" || die "failed to copy text to clipboard"
  notify-send "Text extracted from image" "$(head -c 100 "$SCR_IMG/scr.txt")" || die "failed to send notification"
  exit

I'm using this script from HN* to select regions on the screen and copy their text, I took out the line with mogrify. It uses spectacle but it takes a moment before opening the UI, is it possible and would it be faster if Spectacle stayed open in the background? The slurp CLI starts instantly for me for selecting regions, I looked for command line screenshot tools to maybe use with it or has its own region support but didn't find any. Neither maim scrot and grim don't work on Plasma Wayland. I installed the ksnip flatpak but the option for rectangular regions doesn't show for me.

* The script:

  #!/bin/bash 
  # Dependencies: tesseract-ocr imagemagick 
  # on gnome: gnome-screenshot 
  # on kde: spectacle
  # on x11: xsel
  # on wayland: wl-clipboard

  die(){
    notify-send "$1"
    exit 1
  }
  cleanup(){
    [[ -n $1 ]] && rm -r "$1"
  }

  SCR_IMG=$(mktemp -d) || die "failed to take screenshot"

  # shellcheck disable=SC2064
  trap "cleanup '$SCR_IMG'" EXIT

  #notify-send "Select the area of the text" 
  if  which "spectacle" &> /dev/null
  then
    spectacle -n -b -r -o "$SCR_IMG/scr.png" || die "failed to take screenshot"
  else
    gnome-screenshot -a -f "$SCR_IMG/scr.png" || die "failed to take screenshot"
  fi

  # increase image quality with option -q from default 75 to 100
  mogrify -modulate 100,0 -resize 400% "$SCR_IMG/scr.png"  || die "failed to convert image"
  #should increase detection rate

  tesseract "$SCR_IMG/scr.png" "$SCR_IMG/scr" &> /dev/null || die "failed to extract text"
  if [ "$XDG_SESSION_TYPE" == "wayland" ]
  then 
    wl-copy < "$SCR_IMG/scr.txt" || die "failed to copy text to clipboard"
  else
    # xsel -b -i  < "$SCR_IMG/scr.txt" || die "failed to copy text to clipboard"
    xclip -selection clipboard -i < "$SCR_IMG/scr.txt" || die "failed to copy text to clipboard"  
  fi
  # Notify the user what was copied but truncate the text to 100 characters
  notify-send "Text extracted from image" "$(head -c 100 "$SCR_IMG/scr.txt")" || die "failed to send notification"
  exit  #!/bin/bash 
  # Dependencies: tesseract-ocr imagemagick 
  # on gnome: gnome-screenshot 
  # on kde: spectacle
  # on x11: xsel
  # on wayland: wl-clipboard

  die(){
    notify-send "$1"
    exit 1
  }
  cleanup(){
    [[ -n $1 ]] && rm -r "$1"
  }

  SCR_IMG=$(mktemp -d) || die "failed to take screenshot"

  # shellcheck disable=SC2064
  trap "cleanup '$SCR_IMG'" EXIT

  #notify-send "Select the area of the text" 
  if  which "spectacle" &> /dev/null
  then
    spectacle -n -b -r -o "$SCR_IMG/scr.png" || die "failed to take screenshot"
  else
    gnome-screenshot -a -f "$SCR_IMG/scr.png" || die "failed to take screenshot"
  fi

  # increase image quality with option -q from default 75 to 100
  mogrify -modulate 100,0 -resize 400% "$SCR_IMG/scr.png"  || die "failed to convert image"
  #should increase detection rate

  tesseract "$SCR_IMG/scr.png" "$SCR_IMG/scr" &> /dev/null || die "failed to extract text"
  if [ "$XDG_SESSION_TYPE" == "wayland" ]
  then 
    wl-copy < "$SCR_IMG/scr.txt" || die "failed to copy text to clipboard"
  else
    # xsel -b -i  < "$SCR_IMG/scr.txt" || die "failed to copy text to clipboard"
    xclip -selection clipboard -i < "$SCR_IMG/scr.txt" || die "failed to copy text to clipboard"  
  fi
  # Notify the user what was copied but truncate the text to 100 characters
  notify-send "Text extracted from image" "$(head -c 100 "$SCR_IMG/scr.txt")" || die "failed to send notification"
  exit
13
submitted 5 days ago* (last edited 1 day ago) by [email protected] to c/[email protected]
 

Edit: I edited the script to take a screenshot asynchronously, get the region with slurp, and use magickto crop it. I also multiply the values from slurp 2x to account for the 200% display scaling I have.

  #!/bin/bash 

	die(){
    notify-send "$1"
    exit 1
  }
  cleanup(){
    [[ -n $1 ]] && rm -r "$1"
  }
  SCR_IMG=$(mktemp -d) || die "failed to take screenshot"
  trap "cleanup '$SCR_IMG'" EXIT

	spectacle -nbo "$SCR_IMG/scr.tiff" &
	region=($(slurp -b "#00000000" -c "#80808080" -w 2 -f "%w %h %x %y"))
	for i in "${!region[@]}" 
	do
		region[i]=$(expr ${region[i]} "*" "2")
	done
	magick "$SCR_IMG/scr.tiff" -crop "${region[0]}x${region[1]}+${region[2]}+${region[3]}" "$SCR_IMG/scr.tiff" 

	tesseract "$SCR_IMG/scr.tiff" "$SCR_IMG/scr" &> /dev/null || die "failed to extract text"
  wl-copy < "$SCR_IMG/scr.txt" || die "failed to copy text to clipboard"
  notify-send "Text extracted from image" "$(head -c 100 "$SCR_IMG/scr.txt")" || die "failed to send notification"
  exit

I'm using this script from HN* to select regions on the screen and copy their text, I took out the line with mogrify. It uses spectacle but it takes a moment before opening the UI, is it possible and would it be faster if Spectacle stayed open in the background? The slurp CLI starts instantly for me for selecting regions, I looked for command line screenshot tools to maybe use with it or has its own region support but didn't find any. Neither maim scrot and grim don't work on Plasma Wayland. I installed the ksnip flatpak but the option for rectangular regions doesn't show for me.

* The script:

  #!/bin/bash 
  # Dependencies: tesseract-ocr imagemagick 
  # on gnome: gnome-screenshot 
  # on kde: spectacle
  # on x11: xsel
  # on wayland: wl-clipboard

  die(){
    notify-send "$1"
    exit 1
  }
  cleanup(){
    [[ -n $1 ]] && rm -r "$1"
  }

  SCR_IMG=$(mktemp -d) || die "failed to take screenshot"

  # shellcheck disable=SC2064
  trap "cleanup '$SCR_IMG'" EXIT

  #notify-send "Select the area of the text" 
  if  which "spectacle" &> /dev/null
  then
    spectacle -n -b -r -o "$SCR_IMG/scr.png" || die "failed to take screenshot"
  else
    gnome-screenshot -a -f "$SCR_IMG/scr.png" || die "failed to take screenshot"
  fi

  # increase image quality with option -q from default 75 to 100
  mogrify -modulate 100,0 -resize 400% "$SCR_IMG/scr.png"  || die "failed to convert image"
  #should increase detection rate

  tesseract "$SCR_IMG/scr.png" "$SCR_IMG/scr" &> /dev/null || die "failed to extract text"
  if [ "$XDG_SESSION_TYPE" == "wayland" ]
  then 
    wl-copy < "$SCR_IMG/scr.txt" || die "failed to copy text to clipboard"
  else
    # xsel -b -i  < "$SCR_IMG/scr.txt" || die "failed to copy text to clipboard"
    xclip -selection clipboard -i < "$SCR_IMG/scr.txt" || die "failed to copy text to clipboard"  
  fi
  # Notify the user what was copied but truncate the text to 100 characters
  notify-send "Text extracted from image" "$(head -c 100 "$SCR_IMG/scr.txt")" || die "failed to send notification"
  exit  #!/bin/bash 
  # Dependencies: tesseract-ocr imagemagick 
  # on gnome: gnome-screenshot 
  # on kde: spectacle
  # on x11: xsel
  # on wayland: wl-clipboard

  die(){
    notify-send "$1"
    exit 1
  }
  cleanup(){
    [[ -n $1 ]] && rm -r "$1"
  }

  SCR_IMG=$(mktemp -d) || die "failed to take screenshot"

  # shellcheck disable=SC2064
  trap "cleanup '$SCR_IMG'" EXIT

  #notify-send "Select the area of the text" 
  if  which "spectacle" &> /dev/null
  then
    spectacle -n -b -r -o "$SCR_IMG/scr.png" || die "failed to take screenshot"
  else
    gnome-screenshot -a -f "$SCR_IMG/scr.png" || die "failed to take screenshot"
  fi

  # increase image quality with option -q from default 75 to 100
  mogrify -modulate 100,0 -resize 400% "$SCR_IMG/scr.png"  || die "failed to convert image"
  #should increase detection rate

  tesseract "$SCR_IMG/scr.png" "$SCR_IMG/scr" &> /dev/null || die "failed to extract text"
  if [ "$XDG_SESSION_TYPE" == "wayland" ]
  then 
    wl-copy < "$SCR_IMG/scr.txt" || die "failed to copy text to clipboard"
  else
    # xsel -b -i  < "$SCR_IMG/scr.txt" || die "failed to copy text to clipboard"
    xclip -selection clipboard -i < "$SCR_IMG/scr.txt" || die "failed to copy text to clipboard"  
  fi
  # Notify the user what was copied but truncate the text to 100 characters
  notify-send "Text extracted from image" "$(head -c 100 "$SCR_IMG/scr.txt")" || die "failed to send notification"
  exit
 

When I try getting the student discount for ProtonVPN on https://proton.me/student, it takes me to the payment page and I try to log into my existing Proton account, but when I do it redirects me to protonvpn.com and I can't apply it (I never used ProtonVPN btw).

[–] [email protected] 0 points 1 week ago

I crossposted the post btw.

 

For years I’ve on and off looked for web archiving software that can capture most sites, including ones that are “complex” with lots of AJAX and require logins like Reddit. Which ones have worked best for you?

Ideally I want one that can be started up programatically or via command line, an opens a chromium instance (or any browser), and captures everything shown on the page. I could also open the instance myself and log into sites and install addons like UBlock Origin. (btw, archiveweb.page must be started manually).

[–] [email protected] 1 points 1 week ago

Yeah I used a color picker to compare the 2 background colors, both with p3 color enabled btw (also tested that on both windows with macOS Safari's color picker, which detects p3 colors)

[–] [email protected] 0 points 1 week ago

except one time when I knocked a cup of water into one in 2005.

This but repeatedly for some people. I only drink from my metal bottles, and turn away from my computer. Admittedly I could be more careful by moving away from the computer but now its been years since it happened.

[–] [email protected] 4 points 1 week ago (1 children)

Here's the page shown in the image: https://typeof.net/Iosevka/customizer.

The visual editor generates a toml file below that you copy into a plan file. You clone the Iosevka repo, place the plan file there, and compile it. Full instructions are here: https://github.com/be5invis/Iosevka/blob/main/doc/custom-build.md. It takes 30-40 mins to compile Iosevka TTFs on my M1 Pro MBP though.

[–] [email protected] 0 points 1 week ago (1 children)

DId u read the post? I'm on a MBP so I would dual boot to macOS (it's not possible to run windows on it rn without a VM).

[–] [email protected] -1 points 1 week ago (1 children)

That hasn't really happened with macs even up to several years old with those parts irreplaceable, by the time that would happen the device should be replaced.

Yes replaceable parts would be better but the ones on Macs do in fact last a very long time.

[–] [email protected] 0 points 1 week ago

I looked at that but it doesn't feel as nice as Asahi Linux - since it's not constrained to a VM and brightness and text look better.

[–] [email protected] 1 points 1 week ago (3 children)

Unfortunately it doesn't work on ARM devices right now.

[–] [email protected] -1 points 2 weeks ago (1 children)

As the name says, It's just using kscreen-doctor under the hood to change the refresh rate to available modes.

view more: next ›