• eduardog3000 [he/him]
    ·
    edit-2
    4 years ago

    Here is example of simple bash script:

    #!/bin/bash
    
    WP="$(find ~+ -type f -exec mimetype {} + 2>/dev/null | awk -F': +' '{ if ($2 ~ /^image\//) print $1 }' | sort -R | tail -30 | shuf -n 1)"
    
    dconf write /org/mate/desktop/background/picture-filename "'${WP}'"
    

    lmao

      • eduardog3000 [he/him]
        ·
        4 years ago

        wdym, this is so easy to read:

        https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)
        
        • alcoholicorn [comrade/them, doe/deer]
          ·
          edit-2
          4 years ago

          You joke, but that's very straightforward to me.

          https, or nothing

          ://

          www., or nothing

          1-256 of these chars: [-a-zA-Z0-9@:%._+~#=]

          Until you get to a "." followed by:

          1-6 of these chars:[a-zA-Z0-9()]

          Any line break

          0+ of these chars: [-a-zA-Z0-9()@:%_+.~#?&//=]

          • eduardog3000 [he/him]
            ·
            4 years ago

            I mean, yeah it's really not too bad when you really dig into it. But it's still just a mess.

            Although your "https, or nothing" is actually "http, optionally s"

            That one isn't even completely right. It gets a lot of false positives AFAIK (example: https://..com). The real thing is even worse.