aboutsummaryrefslogtreecommitdiff
path: root/sh/snippets
diff options
context:
space:
mode:
Diffstat (limited to 'sh/snippets')
-rw-r--r--sh/snippets45
1 files changed, 45 insertions, 0 deletions
diff --git a/sh/snippets b/sh/snippets
new file mode 100644
index 0000000..de50f1e
--- /dev/null
+++ b/sh/snippets
@@ -0,0 +1,45 @@
+#!/bin/sh
+# misc code snippets
+
+for cmd in pacdiff 'tree -a'; do
+ alias ${cmd%% *}="sudo -E $cmd"
+done
+
+for cmd in pacdiff 'tree -a'; do alias ${cmd%% *}="sudo -E $cmd"; done
+
+if [ -e "$XDG_PICTURES_DIR/wallpapers/wallpaper" ]; then
+ display -window root "$XDG_PICTURES_DIR/wallpapers/wallpaper" &
+else
+ shufwall &
+fi
+
+# ~/.config/nsxiv/exec/key-handler
+case "$1" in
+ "l") linkwall ;;
+ "w") tr '\n' '\0' | xargs -0 shufwall ;;
+esac
+linkwall() {
+ tr '\n' '\0' | xargs -0 realpath | sort | uniq | while read -r file; do
+ walldir="$XDG_PICTURES_DIR/wallpapers/"
+ name=$(basename "$file")
+ if [ ! -e "$walldir$name" ]; then
+ convwall "$file" "$walldir$name" || ln -s "$file" "$walldir"
+ else
+ notify-send 'error' "$name exist"
+ fi
+ done
+}
+
+for cmd in czkawka_gui firefox freecad gimp krita mpv qmmp songrec zathura; do
+ alias $cmd="o $cmd"
+done
+
+pidof -q monerod || alacritty -e monerod
+
+f () {
+ while read -r site; do
+ curl -sm5 "$site" | grep -iq "creative common\|cc-by\|cc-0\|gnu free documentation license\|gfdl\|unlicense\|wtfpl" && echo "$site"
+ done
+}
+f < ~/downloads/blogs > ~/downloads/cc_blogs
+f < ~/downloads/news > ~/downloads/cc_news