Just wondering since I know a lot of people quietly use a screen-area-select -> tesseract OCR -> clipboard shortcut.

  • I separate subjects of interest into different Firefox windows, in different workspaces – so I have an extension title them and a startup script parse text to ask the compositor to put them in the correct workspace (lets me restart more conveniently).
  • I have automatically-set different-orientation wallpapers for using my 2-in-1 depending on whether I use it in portrait or landscape (kind of just for looks, but I don’t think if anyone else adds a wallpaper change to their screen rotation keybind).
  • faercol@lemmy.blahaj.zone
    link
    fedilink
    arrow-up
    2
    ·
    6 minutes ago

    I boot on a custom EFI app to control my dualboot (instead of systemd-boot or grub) that asks a service on my proxmox server which OS I’m supposed to boot.

    Overkill, but it allows me to control my dual-boot without a keyboard in my computer (because it’s a Bluetooth keyboard so I can’t really use it in grub anyway)

    • fool@discuss.tchncs.deOP
      link
      fedilink
      English
      arrow-up
      1
      ·
      2 minutes ago

      A custom EFI app? Is that like a handrolled Unified Kernel Image with some Proxmox-specific addons in it? How’d you make it?

  • oldfart@lemm.ee
    link
    fedilink
    arrow-up
    2
    ·
    2 hours ago

    ChatGPT wrote a Python program that does select->Tesseract OCR for me, but it doesn’t always work right with two monitors. I’m too stupid to correct it. How have you done yours, what are you using for selecting the area?

    • fool@discuss.tchncs.deOP
      link
      fedilink
      English
      arrow-up
      1
      ·
      edit-2
      10 minutes ago

      pasting from my keybind config

      # snippet based on end4 dotfiles -- FIXME edge case where a
      #     preexisting tmp.png might be overwritten
      # English
      bind = Super+Shift,T,exec,grim -g "$(slurp $SLURP_ARGS)" "tmp.png" && tesseract -l eng "tmp.png" - | wl-copy && rm "tmp.png"
      # Korean
      bind = Super+Shift,K,exec,grim -g "$(slurp $SLURP_ARGS)" "tmp.png" && tesseract -l kor "tmp.png" - | wl-copy && rm "tmp.png"
      # Japanese
      bind = Super+Shift,J,exec,grim -g "$(slurp $SLURP_ARGS)" "tmp.png" && tesseract -l jpn "tmp.png" - | wl-copy && rm "tmp.png"
      

      edit: syntax highlight

  • Captain Aggravated@sh.itjust.works
    link
    fedilink
    English
    arrow-up
    2
    ·
    2 hours ago

    I’m pretty sure no one else has my shell script that takes a picture, uses imagemagick to copy a scaled down version of it to a special folder, and then build a string that allows me to just middle click paste the image into Rednotebook so it appears correctly.

    • fool@discuss.tchncs.deOP
      link
      fedilink
      English
      arrow-up
      1
      ·
      7 minutes ago

      ooh I should do that for Obsidian instead of having an enormous directory of Pasted Image 202302050124300845012.pngs. =◡=

  • scrooge101@lemmy.ml
    link
    fedilink
    arrow-up
    2
    ·
    3 hours ago

    I also seperate Firefox on different workspaces, but only manually. How is the extension called? Having it automated would save me some seconds every reboot.

    • tankplanker@lemmy.world
      link
      fedilink
      arrow-up
      1
      ·
      3 minutes ago

      Sway (and i3) you can assign windows to workspaces based on any property that is available in the swaymsg tree. It can do parital matches, so for example if you wanted your Lemmy firefox window to always start on workspace 3 you could use:

      assign [title=“lemmy” app_id=“firefox”] workspace number $ws3

      Title can use regex so you can do some pretty neat matching if you need it.

    • fool@discuss.tchncs.deOP
      link
      fedilink
      English
      arrow-up
      1
      ·
      edit-2
      10 minutes ago

      The main idea is:

      1. Use Window Titler to add a title. For me, if I want it on workspace 7, I title the window “7”. (NOTE: The title will probably appear like [title], see below)
      2. Make a script that queries the window manager, and then dispatches a movement to the appropriate workspace. In Hyprland that might be hyprctl -j which gives
      ... json blahblah
      "title": "[7] What's a unique customization on your Linux machine you think no one else has? - tchncs — Mozilla Firefox"
      ... json blahblah
      

      but in Sway it might be something similar to using swaymsg. Only titled windows will have the bracket number thing so just regex that part

      1. Put it in autostart. Because Firefox takes a while to load on my junk machine I sleep for like 30 seconds to a minute before all the titles register.
  • Tony N@lemmy.ml
    link
    fedilink
    arrow-up
    11
    ·
    6 hours ago

    When I press Super + PrtSc, a bash script performs the following:

    Takes a screenshot of the entire desktop (import -window root) and saves it as ~/screenshot.png…

    Analyzes the screenshot to calculate the “mean brightness” value of the image. It converts the image to grayscale and determines the average pixel brightness (a value between 0 and 1, where 0 is black and 1 is white).

    Checks if the image is dark by comparing the mean brightness to a threshold of 0.2. If the mean brightness is less than 0.2 (i.e., the image is very dark), it applies a negative filter to the image (convert -negate), effectively inverting the colors (black becomes white and vice versa).

    Sends the image to a printer (lp command) named MF741C-743C for printing.

  • data1701d (He/Him)@startrek.website
    link
    fedilink
    English
    arrow-up
    5
    ·
    5 hours ago

    On my desktop, I wrote a Python script that pulls a random Star Trek: The Next Generation or Deep Space Nine script from a folder and prints it in STDOUT. I use this in the XScreenSaver Text Manipulation > Program option to turn Star Trek into a screen saver.

    Currently, I use it with the Apple II screensaver, but in its original incarnation, I used the Star Wars intro screensaver. 😈

  • haui@lemmy.giftedmc.com
    link
    fedilink
    arrow-up
    3
    ·
    edit-2
    5 hours ago

    Definitely not nobody but statistically VERY FEW people will have this combination:

    • pop!os (fight me!)
    • script that limits accumulator charge to 80% on asus laptop
    • script that turns on vpn if out of home and kicks off a backup if at home (through wifi ssid)

    Edit: nice try to fingerprint me, big tech. You succeeded! /j

    • fool@discuss.tchncs.deOP
      link
      fedilink
      English
      arrow-up
      2
      ·
      17 minutes ago

      Triangulating your location. Are you… in the Milky Way Galaxy?

      (Thanks for reminding me to limit accumulator charge)

      • dave@feddit.uk
        link
        fedilink
        English
        arrow-up
        1
        ·
        50 seconds ago

        Yeah, I have a script that toggles my Dell XPS between full charge and 80%, as I’m usually on mains and only need full charge occasionally.

  • Rimu@piefed.social
    link
    fedilink
    English
    arrow-up
    20
    ·
    13 hours ago

    I have an old gamer keyboard with extra programmable keys on the side, which I use for cut, copy, paste, close tab, close window, etc. Logitech provides drivers/software for Windows & Mac only.

    To make it work I have a custom monkey-patched USB driver that I compiled from source, some weird daemon that interacts with the driver and some shell scripts on top of that. I’m not sure how but it works thanks to a 9 year old youtube video made by a guy from eastern europe somewhere.

    • tankplanker@lemmy.world
      link
      fedilink
      arrow-up
      1
      ·
      10 minutes ago

      I do something similar.

      I have a V4N4G0N that I use the top row (half the normal number row on a full sized board) for switching workspace or switching apps to another workspace, and doing other stuff like copy and paste on different layers for the keyboard.

      As its QMK (via VIAL) I have set all that up directly on the keyboard so its portable to any other PC I want to use. I have eight of these, mix of alu, acrylic and 3D printed, that I can choose from, all sharing the same map. I don’t like using anything else now as its become integral to my normal workflow.

    • fool@discuss.tchncs.deOP
      link
      fedilink
      English
      arrow-up
      7
      ·
      13 hours ago

      Awesome…

      Care to share the video/code? I actually have something similar (Corsair Scimitar’s macro customizer doesn’t work on Linux

      As I was writing this I found a project that deals with Corsair MMO mice on Linux so now I will be going on an egg hunt.

  • tetris11@lemmy.ml
    link
    fedilink
    arrow-up
    6
    ·
    11 hours ago

    my awesome wm config has a lot of customization. We’re talking 5+ years of basically re-writing an entire theme, along with behaviours, widgets, and bindings.

  • golden_zealot@lemmy.ml
    link
    fedilink
    English
    arrow-up
    8
    ·
    12 hours ago

    I am indecisive when it comes to wallpapers so I have a script somewhere which accepts tag-words as arguments and then scrapes wallhaven.cc for those words at the resolution of my setup and picks one that contains those words at random before downloading it to my wallpapers folder and setting it as my wallpaper image.

    So for example, you could just know you want something blue so you would run wallpaper blue and it just grabs one and sets it. You could get a wallpaper of the sky, of a blue car, of the ocean, whatever happens to be a wallpaper that met the criteria of the word/s supplied.

    • LiveLM@lemmy.zip
      link
      fedilink
      English
      arrow-up
      6
      ·
      edit-2
      11 hours ago

      Risky business considering there’s always some horny anime crap mixed in on Wallhaven.
      Filters and tags only help so much since lots of it either has poor tags or no tags at all.

      • golden_zealot@lemmy.ml
        link
        fedilink
        English
        arrow-up
        8
        ·
        11 hours ago

        There is a toggle for SFW/Sketchy which in my experience has worked pretty well in avoiding such things, but you are probably right it does not catch everything.

        If such a thing happened, I would just re-run the same command to update to a different one though. I guess I generally just make sure no one is in the room when it runs haha.

  • atzanteol@sh.itjust.works
    link
    fedilink
    English
    arrow-up
    8
    ·
    edit-2
    12 hours ago

    I’ve got a RPI running a full-screen ‘kiosk’ view from homeassitant that turns an external display on/off based on a motion sensor.

    So basically it’s showing current temperatures, thermostat control, etc. but I have the display turn off after X minutes of no movement and turn on when there has been movement so it’s only on when you’re in the room.

    • thejevans@lemmy.ml
      link
      fedilink
      arrow-up
      5
      ·
      edit-2
      9 hours ago

      I have a similar display in my kitchen. It’s in portrait mode and has time (my timezone and others), weather (hourly and daily), and dynamic popups for weather alerts in the top 1/3. It has a spot for dynamic content below that that shows things like time remaining for my espresso machine to heat up and the temperature of my ember mug if I’m using it. The bottom half of the screen flips every 15 seconds between calenders for my partner and I, and local scheduled transit times and live train times with a map of current train positions.

      • atzanteol@sh.itjust.works
        link
        fedilink
        English
        arrow-up
        3
        ·
        11 hours ago

        Much simpler than that - The motion sensors are zigbee and integrated with HomeAssistant. I have a HA automation that sends a REST call to a webservice I wrote on the PI that then just needs to write 1 or 0 to /sys/class/backlight/rpi_backlight/bl_power.

          • atzanteol@sh.itjust.works
            link
            fedilink
            English
            arrow-up
            2
            ·
            10 hours ago

            It’s one of these. I don’t know the chip but I haven’t had any issues with false positives. If anything they’re slightly under sensitive, but not enough to be a deal breaker for my purposes.

    • treadful@lemmy.zip
      link
      fedilink
      English
      arrow-up
      1
      ·
      edit-2
      10 hours ago

      I have similar, but I turn my display on/off with HDMI-CEC based on time.