From 08204fc9b9f63015a1dc083b471c6839818eeb59 Mon Sep 17 00:00:00 2001 From: filip <“filip.rabiega@gmail.com”> Date: Fri, 10 Oct 2025 18:37:10 +0200 Subject: new stuff --- auxless | 5 ----- ls_new | 14 -------------- maimpick | 19 +++++++++++++++++++ remaps | 2 +- rssadd | 18 ++++++++++++++++++ se | 4 ---- unix | 26 ++++++++++++++++++++++++++ 7 files changed, 64 insertions(+), 24 deletions(-) delete mode 100755 auxless delete mode 100755 ls_new create mode 100755 maimpick create mode 100755 rssadd delete mode 100755 se create mode 100755 unix diff --git a/auxless b/auxless deleted file mode 100755 index 50f4919..0000000 --- a/auxless +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -[ "$#" -ne 1 ] && { echo "Usage: auxless " >&2 ; exit 1; } - -cd "$HOME"/repos/"$1" && vim config.def.h && sudo cp config.def.h config.h && sudo make clean install && cd - || exit diff --git a/ls_new b/ls_new deleted file mode 100755 index e062f2c..0000000 --- a/ls_new +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh - -# New and better ls -ls_new () { - LC_ALL=C $( which ls ) -lAFh --color=always "$1" | awk '{ - name = $9; - for (i = 10; i <= NF; i++) name = name " " $i; - print $1, $5, name - }' | column -t -l 3 -s ' '| tail -n +2 -} - -dir="$1" -[ -z "$1" ] && dir="$(pwd)" -ls_new "$dir" diff --git a/maimpick b/maimpick new file mode 100755 index 0000000..1f0c4a3 --- /dev/null +++ b/maimpick @@ -0,0 +1,19 @@ +#!/bin/sh + +# This is bound to Shift+1 by default, requires maim. It lets you +# choose the kind of screenshot to take, including copying the image or even +# highlighting an area to copy. scrotcucks on suicidewatch right now. + +output="$(date '+%y%m%d-%H%M-%S').png" +xclip_cmd="xclip -sel clip -t image/png" +ocr_cmd="xclip -sel clip" + +case "$(printf "a selected area\\ncurrent window\\nfull screen\\na selected area (copy)\\ncurrent window (copy)\\nfull screen (copy)\\ncopy selected image to text" | dmenu -l 7 -i -p "Screenshot which area?")" in + "a selected area") maim -u -s pic-selected-"${output}" ;; + "current window") maim -B -q -d 0.2 -i "$(xdotool getactivewindow)" pic-window-"${output}" ;; + "full screen") maim -q -d 0.2 pic-full-"${output}" ;; + "a selected area (copy)") maim -u -s | ${xclip_cmd} ;; + "current window (copy)") maim -q -d 0.2 -i "$(xdotool getactivewindow)" | ${xclip_cmd} ;; + "full screen (copy)") maim -q -d 0.2 | ${xclip_cmd} ;; + "copy selected image to text") tmpfile=$(mktemp /tmp/ocr-XXXXXX.png) && maim -u -s > "$tmpfile" && tesseract "$tmpfile" - -l eng | ${ocr_cmd} && rm "$tmpfile" ;; +esac diff --git a/remaps b/remaps index 0363051..df6051f 100755 --- a/remaps +++ b/remaps @@ -1,7 +1,7 @@ #!/bin/sh # Increase key speed -xset r rate 150 50 +xset r rate 200 50 # Switch caps and esc setxkbmap us -option caps:swapescape diff --git a/rssadd b/rssadd new file mode 100755 index 0000000..910fca3 --- /dev/null +++ b/rssadd @@ -0,0 +1,18 @@ +#!/bin/sh + +if echo "$1" | grep -q "https*://\S\+\.[A-Za-z]\+\S*" ; then + url="$1" +else + url="$(grep -Eom1 '<[^>]+(rel="self"|application/[a-z]+\+xml)[^>]+>' "$1" | + grep -o "https?://[^\" ]")" + + echo "$url" | grep -q "https*://\S\+\.[A-Za-z]\+\S*" || + notify-send "That doesn't look like a full URL." && exit 1 +fi + +RSSFILE="${XDG_CONFIG_HOME:-$HOME/.config}/newsboat/urls" +if awk '{print $1}' "$RSSFILE" | grep "^$url$" >/dev/null; then + notify-send "You already have this RSS feed." +else + echo "$url" >> "$RSSFILE" && notify-send "RSS feed added." +fi diff --git a/se b/se deleted file mode 100755 index b076862..0000000 --- a/se +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -file="$SCRIPTS/$( /bin/ls "$SCRIPTS" | sed 's/[\s]+/ /g' | dmenu -l 15 -i -p "Choose a script to edit: " )" -[ -f "$file" ] && vim "$file" diff --git a/unix b/unix new file mode 100755 index 0000000..a9fb96e --- /dev/null +++ b/unix @@ -0,0 +1,26 @@ +#!/bin/sh + +#original artwork by http://www.sanderfocus.nl/#/portfolio/tech-heroes +#converted to shell by #nixers @ irc.unix.chat + +cat << 'eof' + ,_ ,_==▄▂ + , ▂▃▄▄▅▅▅▂▅¾. / / + ▄▆<´ "»▓▓▓%\ / / / / + ,▅7" ´>▓▓▓% / / > / >/% + ▐¶▓ ,»▓▓¾´ /> %/%// / / + ▓▃▅▅▅▃,,▄▅▅▅Æ\// ///>// />/ / + V║«¼.;→ ║<«.,`=// />//%/% / / + //╠<´ -²,)(▓~"-╝/¾/ %/>/ /> + / / / ▐% -./▄▃▄▅▐, /7//;//% / / + / ////`▌▐ %zWv xX▓▇▌//&;% / / + / / / %//%/¾½´▌▃▄▄▄▄▃▃▐¶\/& / + </ /)VY>7; \_ UNIX IS VERY SIMPLE IT JUST NEEDS A + / /</ //<///<_/%\▓ V%W%£)XY _/%‾\_, GENIUS TO UNDERSTAND ITS SIMPLICITY + / / //%/_,=--^/%/%%\¾%¶%%} /%%%%%%;\, + %/< /_/ %%%%%;X%%\%%;, _/%%%;, \ + / / %%%%%%;, \%%l%%;// _/%;, dmr + / %%%;, <;\-=-/ / + ;, l +eof -- cgit v1.2.3