diff options
author | Raymaekers Luca <raymaekers.luca@gmail.com> | 2023-12-12 09:22:22 +0100 |
---|---|---|
committer | Raymaekers Luca <raymaekers.luca@gmail.com> | 2023-12-12 09:22:22 +0100 |
commit | ffc2a7d3cee6385508601374bdd34db253b70c65 (patch) | |
tree | 433bda0daa8504538ce27bdc7a80999bba611663 /config | |
parent | f4dc6e9489bd1274cba77aec04343dbec72f4a7d (diff) | |
parent | 6b44e39caba17672bf32960f5829597d9fa544b1 (diff) |
Merge branch 'main' of debuc.com:dotfiles
Diffstat (limited to 'config')
-rw-r--r-- | config/common/newsboat/config | 8 | ||||
-rw-r--r-- | config/essentials/zsh/.zshrc | 2 | ||||
-rw-r--r-- | config/essentials/zsh/aliases.sh | 3 | ||||
-rw-r--r-- | config/essentials/zsh/functions.sh (renamed from config/essentials/zsh/functions.zsh) | 52 | ||||
-rw-r--r-- | config/extra/tridactyl/tridactylrc | 2 |
5 files changed, 36 insertions, 31 deletions
diff --git a/config/common/newsboat/config b/config/common/newsboat/config index 5f93d68..88ec7ad 100644 --- a/config/common/newsboat/config +++ b/config/common/newsboat/config @@ -18,15 +18,19 @@ highlight article "\\[[0-9]+\\]" color10 default bold highlight article "\\[image\\ [0-9]+\\]" color10 default bold highlight feedlist "^─.*$" color6 color0 bold -bind-key j next all -bind-key k prev all +bind-key j next +bind-key k prev bind-key h quit +bind-key h set-tag feedlist # return back to tags from 'selected tag' view bind-key l open bind-key g home bind-key G end bind-key U show-urls bind-key a toggle-article-read +# Set home to tags +run-on-startup set-tag + show-keymap-hint no swap-title-and-hints yes diff --git a/config/essentials/zsh/.zshrc b/config/essentials/zsh/.zshrc index c590d54..7b1f7a0 100644 --- a/config/essentials/zsh/.zshrc +++ b/config/essentials/zsh/.zshrc @@ -67,7 +67,7 @@ zle -N add-surround surround zle -N change-surround surround # Source files -. $ZDOTDIR/functions.zsh +. $ZDOTDIR/functions.sh . $ZDOTDIR/aliases.sh for file in /{etc,usr/lib}/os-release diff --git a/config/essentials/zsh/aliases.sh b/config/essentials/zsh/aliases.sh index a7e14fb..2e23010 100644 --- a/config/essentials/zsh/aliases.sh +++ b/config/essentials/zsh/aliases.sh @@ -1,4 +1,4 @@ -#!/bin/zsh +#!/bin/sh # s/alias \([^-]\)/alias -g \1 # The most important one @@ -287,6 +287,7 @@ alias ffwin='hyprctl clients -j | jq '\''.[].pid'\'' | fzf --preview "hyprctl cl alias pff='find ${PASSWORD_STORE_DIR:=~/src/password-store/} -name "*.gpg" | sed -e "s@$PASSWORD_STORE_DIR/@@" -e '\''s/\.gpg$//'\'' | fzf | xargs pass show -c' alias fzps='fzf --print0 | xargs -0I{}' alias ytdl='yt-dlp --restrict-filenames --embed-chapters -f "b" -S "res:1080" -P "$HOME/vids/youtube/" -o "%(channel)s/%(title)s.%(ext)s"' +alias ytplay='mpv "$(ytlink)"' # emacs aliases alias emacsd='emacs --daemon' diff --git a/config/essentials/zsh/functions.zsh b/config/essentials/zsh/functions.sh index 98cca08..b285e05 100644 --- a/config/essentials/zsh/functions.zsh +++ b/config/essentials/zsh/functions.sh @@ -1,4 +1,4 @@ -#!/bin/zsh +#!/bin/sh log() { >&2 printf '%s' "$@"; } logn() { >&2 printf '%s\n' "$@"; } @@ -9,8 +9,8 @@ vmp() { -c 'set ft=man nolist nonu nornu' } nvf() { - local cache="$HOME/.cache/nvf" - local match="$(grep -m1 "$1$" "$cache" 2> /dev/null)" + cache="$HOME/.cache/nvf" + match="$(grep -m1 "$1$" "$cache" 2> /dev/null)" if test ! -f "$match" then logn "resetting cache..." @@ -26,8 +26,8 @@ nvf() { fi } -nnn() { test -z "$NNNLVL" && /usr/bin/nnn "$@" || exit } -ranger() { test -z "$RANGER_LEVEL" && /usr/bin/ranger "$@" || exit } +nnn() { test -z "$NNNLVL" && /usr/bin/nnn "$@" || exit; } +ranger() { test -z "$RANGER_LEVEL" && /usr/bin/ranger "$@" || exit; } # googoo aliases _googoo_fzf_opt() @@ -62,7 +62,7 @@ vimh() { vi -c "help $1" -c 'call feedkeys("\<c-w>o")'; } dgo() { cd "$(goo d ~ | fzf --filter "$@" | head -n 1)"; } open() { $EDITOR "$(goo f ~ | fzf --filter "$@" | head -n 1)"; } pkbs() { doas pacman -Sy "$(pkgfile -b "$1" | tee /dev/stderr)"; } -oclip() { printf "\033]52;c;$(echo -n "$@" | base64)\a"; } +oclip() { printf "\033]52;c;$(printf '%s' "$@" | base64)\a"; } sms() { ssh -t phone sendmsg "$1" "'$2'"; } trcp() { scp "$1" db:/media/basilisk/downloads/transmission/torrents/; } rln() { ln -s "$(readlink -f "$1")" "$2"; } @@ -70,7 +70,7 @@ getgit() { git clone git@db:"$1"; } ipc() { - if [[ "$(ip link show eno1 | awk -F, 'NR=1 {print $3}')" == "UP" ]] + if [ "$(ip link show eno1 | awk -F, 'NR=1 {print $3}')" = "UP" ] then doas ip link set eno1 down else @@ -85,7 +85,6 @@ psgrep() } unique() { - local f f="$(mktemp)" awk '!x[$0]++' "$1" > "$f" mv "$f" "$1" @@ -152,16 +151,16 @@ ginit() # Returns current branch git_current_branch() { - command git rev-parse --git-dir &>/dev/null || return + command git rev-parse --git-dir > /dev/null 2>&1 || return git branch --show-current } # Check if main exists and use instead of master git_main_branch() { - command git rev-parse --git-dir &>/dev/null || return - local ref - for ref in refs/{heads,remotes/{origin,upstream}}/{main,trunk,mainline,default}; do + command git rev-parse --git-dir > /dev/null 2>&1 || return + for ref in refs/{heads,remotes/{origin,upstream}}/{main,trunk,mainline,default} + do if command git show-ref -q --verify $ref; then echo ${ref:t} return @@ -172,10 +171,11 @@ git_main_branch() # Check for develop and similarly named branches function git_develop_branch() { - command git rev-parse --git-dir &>/dev/null || return - local branch - for branch in dev devel development; do - if command git show-ref -q --verify refs/heads/$branch; then + command git rev-parse --git-dir > /dev/null 2>&1 || return + for branch in dev devel development + do + if command git show-ref -q --verify refs/heads/$branch + then echo $branch return fi @@ -186,11 +186,14 @@ function git_develop_branch() { # gpg backup gpg_backup() { - gpg --export-secret-keys --armor > private.asc - gpg --export --armor > public.asc - gpg --export-ownertrust --armor > trust.asc - tar czf gpg_backup.tar.gz {public,private,trust}.asc - shred -uz {public,private,trust}.asc + # $1: option + # $2: output file (without .asc) + gpg_command() {gpg "$1" --armor > "$2".asc ; } + gpg_command --export-secret-keys "private" + gpg_command --export "public" + gpg_command --export-ownertrust "trust" + tar -czvf gpg_backup.tar.gz public.asc private.asc trust.asc + shred -uz public.asc private.asc trust.asc } gpg_import() @@ -200,7 +203,7 @@ gpg_import() gpg --import public.asc gpg --import-ownertrust trust.asc gpg --import private.asc - shred -uz {public,private,trust}.asc + shred -uz public.asc private.asc trust.asc } ngenable() @@ -242,7 +245,6 @@ pacsize() mime-default () { - local mime [ "${mime:=$1}" ] || mime="$(find /usr/share/applications/ -iname '*.desktop' -printf '%f\n' | sed 's/\.desktop$//' | @@ -259,7 +261,7 @@ mime-default () addedkeys() { find ~/.ssh -iname "*.pub" | while read key do - local fingerprint="$(ssh-keygen -lf "$key" 2>/dev/null)" + fingerprint="$(ssh-keygen -lf "$key" 2>/dev/null)" if ssh-add -l | grep -q "$fingerprint" then echo "$key" @@ -277,8 +279,6 @@ fpass() { muttmail() { - local config - local mail config="$HOME/.config/mutt" mail="$(find "$config"/configs -type f -printf '%f\n' | fzf)" [ "$mail" ] || return 1 diff --git a/config/extra/tridactyl/tridactylrc b/config/extra/tridactyl/tridactylrc index 977578b..1a96af5 100644 --- a/config/extra/tridactyl/tridactylrc +++ b/config/extra/tridactyl/tridactylrc @@ -1,5 +1,5 @@ set newtab http://localhost:28669 -set searchengine duckduckgo +set searchengine "" " Searchurls set searchurls.1x https://www.1377x.to/search/%s/1 |