right, so as the title suggests…

i like linux based OSes because you can pretty much mould your operating system to the shape of your brain. i call it cognitive ergonomy. and i’d like it to catch on. even on a relatively play-it-safe distro like the one i’m currently using, the repos are full of handy little applications to make life immeasurably easier for you, if they aren’t installed already. thanks to xdotool, xdo, wmctrl, and sxhkd, pretty much any action can easily be bound to a shortcut key. for eg, i have xdotool search --name vimnote windowactivate || kitty --title=vimnote nvim -c "norm 13j" ~/notes/index.md bound to mod+n. it’s so simple, and i was so proud of myself when i got it to work (i’m not really a scripty person). i just wanted to make something easy. then i wanted to make it a bit easier. then i was feeling like “idk this is still way too many key presses” so i found a way of making it even easier.

i’ve got a bunch of little hacks like this. before i found qmmp, i set up global keys for mpv so i could listen to podcasts on another workspace. i have ranger set up to give specific info from mediainfo as a preview for audio and video files. (which windows does easily in gui file browser but THAT’S NOT THE POINT OK)

anyway, the ubuntu forums and arch wiki are full of tricks that a lot of people want to set up, i’m curious as to the ones you had to set up for yourself.

  • Lvxferre@lemmy.ml
    link
    fedilink
    English
    arrow-up
    10
    ·
    1 year ago

    Are clicking games destroying your mouse?

    #!/bin/bash
    export LC_ALL=C
    if [[ $(xset -q | grep -o "Scroll Lock: off") == "Scroll Lock: off" ]]
      then xdotool key Scroll_Lock
      fi
    ScrollStatus=$"Scroll Lock: on"
    while [[ $(xset -q | grep -o "Scroll Lock: on") == "Scroll Lock: on" ]]
      do xdotool click --delay 40 1
      done
    

    Save it as whatever.sh, then create some convenient shortcut for it (I use Ctrl+Print Screen). Use the shortcut to make it click once each 40ms, indefinitely. Press Scroll Lock to turn it off.

    I have a more complex version of that using grabc (to detect pixel colour) and a bunch of if/while/until loops to literally bot some games.