summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfilip <“filip.rabiega@gmail.com”>2025-10-10 18:37:10 +0200
committerfilip <“filip.rabiega@gmail.com”>2025-10-10 18:37:10 +0200
commit08204fc9b9f63015a1dc083b471c6839818eeb59 (patch)
tree3b68ffffe45759f82cebb24fbeaecf3e66aec7a1
parent9535dd8f8ac46335f75d42b773cf0fa9305a722d (diff)
downloadchadscripts-08204fc9b9f63015a1dc083b471c6839818eeb59.tar.gz
chadscripts-08204fc9b9f63015a1dc083b471c6839818eeb59.tar.bz2
chadscripts-08204fc9b9f63015a1dc083b471c6839818eeb59.zip
new stuff
-rwxr-xr-xauxless5
-rwxr-xr-xls_new14
-rwxr-xr-xmaimpick19
-rwxr-xr-xremaps2
-rwxr-xr-xrssadd18
-rwxr-xr-xse4
-rwxr-xr-xunix26
7 files changed, 64 insertions, 24 deletions
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 <suckless-program>" >&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▓▇▌//&;% / /
+ / / / %//%/¾½´▌▃▄▄▄▄▃▃▐¶\/& /
+ </ /</%//`▓!%▓%╣[38;5;255;╣WY<Y)y&/`\
+ / / %/%//</%//\i7; ╠N>)VY>7; \_ UNIX IS VERY SIMPLE IT JUST NEEDS A
+ / /</ //<///<_/%\▓ V%W%£)XY _/%‾\_, GENIUS TO UNDERSTAND ITS SIMPLICITY
+ / / //%/_,=--^/%/%%\¾%¶%%} /%%%%%%;\,
+ %/< /_/ %%%%%;X%%\%%;, _/%%%;, \
+ / / %%%%%%;, \%%l%%;// _/%;, dmr
+ / %%%;, <;\-=-/ /
+ ;, l
+eof