From 75316b70c23458ca41285f2e1712bd5be6ee0105 Mon Sep 17 00:00:00 2001 From: xeruf <27jf@pm.me> Date: Thu, 23 Dec 2021 21:39:55 +0100 Subject: [PATCH] config: script adjustments --- .config/espanso/default.yml | 8 ++++++++ .config/puddletag/puddletag.conf | 8 ++++---- .config/shell/functions | 5 ++--- .local/bin/scripts/b | 4 ++-- .local/bin/scripts/checkdomain | 7 +++++++ .local/bin/scripts/edconf | 4 +++- .local/bin/scripts/help | 3 ++- 7 files changed, 28 insertions(+), 11 deletions(-) create mode 100755 .local/bin/scripts/checkdomain diff --git a/.config/espanso/default.yml b/.config/espanso/default.yml index 95aea14..8bafff2 100644 --- a/.config/espanso/default.yml +++ b/.config/espanso/default.yml @@ -115,6 +115,14 @@ matches: params: cmd: "pass information/phone" + - trigger: ":adt" + replace: "{{output}}" + vars: + - name: output + type: shell + params: + cmd: "pass information/address-bt" + - trigger: ":add" replace: "{{output}}" vars: diff --git a/.config/puddletag/puddletag.conf b/.config/puddletag/puddletag.conf index 6dc9b54..8cf3776 100644 --- a/.config/puddletag/puddletag.conf +++ b/.config/puddletag/puddletag.conf @@ -16,7 +16,7 @@ }, "main": { "lang": "auto", - "lastfolder": "/home/janek/data/music/Electronic/TheFatRat", + "lastfolder": "/home/janek/data/music/Mixes", "maximized": false }, "playlist": { @@ -43,7 +43,7 @@ "fontsize": 10, "rowsize": 43, "sort_fields": [ - "title" + "__filename" ], "sort_reverse": false }, @@ -118,7 +118,7 @@ "$num(%track%,2) %title%", "%title%" ], - "index": 0 + "index": 3 }, "functions": { "last_used": "regex" @@ -133,4 +133,4 @@ "Artist splitting" ] } -} +} \ No newline at end of file diff --git a/.config/shell/functions b/.config/shell/functions index b5d8084..c8f26d5 100644 --- a/.config/shell/functions +++ b/.config/shell/functions @@ -187,9 +187,8 @@ sshl() { lemonade server -allow 127.0.0.1 & file="/var/tmp/ssh-$1" if test ! -e "$file"; then - ssh-copy-id -i "$(ssh -G "$1" | grep "^identityfile " | head -1 | cut -d " " -f2- | sed "s|^~|$HOME|")" "$1" && - kitty +kitten ssh -R 2489:127.0.0.1:2489 "$@" && - touch "$file" + ssh-copy-id -i "$(ssh -G "$1" | grep "^identityfile " | head -1 | cut -d " " -f2- | sed "s|^~|$HOME|")" "$1" && touch "$file" + TERM=xterm-256color kitty +kitten ssh -R 2489:127.0.0.1:2489 "$@" else ssh "$@" fi } diff --git a/.local/bin/scripts/b b/.local/bin/scripts/b index cc32270..4788fda 100755 --- a/.local/bin/scripts/b +++ b/.local/bin/scripts/b @@ -101,8 +101,8 @@ done if test "$timg"; then $inspect || $elevate timg $(test "$timga" && echo "-V") --rotate=exif -g $(tput cols)x$(expr $(tput lines) / 2) \ - $(test $# -gt 1 && grid=$(expr $(tput cols) / \( 30 - $# \& $# \< 20 \| 10 \)) && - echo "-t0.2 --center --title --grid=$((grid*3 < $# ? $#/3 + 1 : grid < $# ? grid : $#))x2") \ + $(test $# -gt 1 && grid=$(expr $(tput cols) / \( 30 - $# \& $# \< 25 \| 5 \)) && + echo "-t0.2 --center $(test $# -lt 30 && echo "--title") --grid=$((grid < $# ? grid : $#))x2") \ "${timg[@]}" "${timga[@]}" 2>/dev/null if $inspect || test $# -lt 15; then tput setaf 6 diff --git a/.local/bin/scripts/checkdomain b/.local/bin/scripts/checkdomain new file mode 100755 index 0000000..f4ee786 --- /dev/null +++ b/.local/bin/scripts/checkdomain @@ -0,0 +1,7 @@ +#!/bin/sh +# check domains from input files via checkdomain, 10 domains at once +tmp=/tmp/checkdomain +mkdir -p $tmp +prefix="$tmp/split$(date +%s)" +sh -c "printf '%s\n' {$(paste -s -d, domains)}.{$(paste -s -d, tlds)}" | split -l 10 - "$prefix" +find "$tmp" -path "$prefix*" -exec sh -c 'xdg-open "https://www.checkdomain.net/en/domains/search/?domain=$(paste -s -d, {})"' \; diff --git a/.local/bin/scripts/edconf b/.local/bin/scripts/edconf index 07c206c..59482c4 100755 --- a/.local/bin/scripts/edconf +++ b/.local/bin/scripts/edconf @@ -8,7 +8,9 @@ listconf() { find "${XDG_CONFIG_HOME:-$HOME/.config}" /etc /var/lib/postgres /var/lib/pleroma/static/instance \ -maxdepth 4 -follow \( -name Partitions -o -name mdn -o -name .git -o -name .local -o -name plugged \) -prune -o \ ! -iname "*.markdown" -a ! -iname "*.md" -a ! -iname "*.org" \ - -type f -readable -exec grep -lI '' {} + 2>/dev/null; } | dedup + -type f -readable -exec grep -lI '' {} + 2>/dev/null; + find /boot -name "*.c*"; + } | dedup } conf_cache_dir="${XDG_CACHE_HOME:-$HOME/.cache}/edconf" diff --git a/.local/bin/scripts/help b/.local/bin/scripts/help index d3c5e6b..22373d4 100755 --- a/.local/bin/scripts/help +++ b/.local/bin/scripts/help @@ -2,6 +2,7 @@ # open info-page, man-page or command help paginate="${PAGER:-less} +Gg" test "$1" = "-d" && browse=1 && shift +# TODO resolve aliases case $1 in (zsh|zmv) # https://unix.stackexchange.com/questions/19290/zmv-for-zsh-dry-runs-and-man-pages for last; do true; done @@ -9,7 +10,7 @@ case $1 in info --vi-keys "$(test "$last" != zsh && echo "--index-search=$last")" zsh || LESS="$LESS +/^ *$last *\\[" man zshall;; (vlc) unbuffer vlc --full-help "${@:2}" | $paginate;; - (gh|chordpro|bat|reflector) unbuffer "$@" --help | $paginate;; + (gh|chordpro|bat|pdfjam|reflector) unbuffer "$@" --help | $paginate;; (plantuml) unbuffer "$@" -help | $paginate;; (caddy|stretchly|go) "$1" help "${@:2}" | $paginate;; (kdeconnect*) kdeconnect-cli --help-all "${@:2}" | $paginate;;