Skip Navigation

Search

KDE Krauts @discuss.tchncs.de
TheTwelveYearOld @lemmy.world

Taking region screenshots faster?

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.

 undefined
    
  #!/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

  
KDE Krauts @discuss.tchncs.de
TheTwelveYearOld @lemmy.world

Adding a custom refresh rate or cvt modeline to KDE Wayland?

Edit: I got answers on the Fedora forum and used this command in my parallels VM and restarted: sudo grubby --update-kernel=ALL --args=video=Virtual-1:3456x2234@120.

I'm trying to get a custom resolution & refresh rate in KDE Wayland. I can get 120hz working on X11 by getting a modeline with cvt 4112 2572 120 and using xrandr commands, but how about Wayland? Perhaps be done with kscreen-doctor?