From 363f4b6dd28fd4d7b30f8a669efea4b16f96a268 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Wed, 14 Feb 2024 15:33:28 +0100 Subject: Include text file in script --- bin/extra/p.sh | 657 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 656 insertions(+), 1 deletion(-) diff --git a/bin/extra/p.sh b/bin/extra/p.sh index 010ae0c..98f8ede 100755 --- a/bin/extra/p.sh +++ b/bin/extra/p.sh @@ -1,6 +1,661 @@ #!/bin/sh -ask_pokemon() { commander -xc < ./pokemon_bw.txt; } +list_pokemon() +{ + cat < Date: Sat, 24 Feb 2024 15:06:23 +0100 Subject: [ytlink] Add substitution for yt-local --- bin/common/ytlink | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bin/common/ytlink b/bin/common/ytlink index a5e9bf0..48be9cf 100755 --- a/bin/common/ytlink +++ b/bin/common/ytlink @@ -8,6 +8,8 @@ inp="$1" [ "${inp:=$(clipo)}" ] || inp="$(cat /dev/stdin)" +# if link is http://127.0.0.1:9010/https://www.youtube.com/watch?v=7KpxsqwNF0o +inp="${inp#*/https://}" # remove util scheme inp="${inp#*//}" inp="https://youtube.com/${inp#*/}" -- cgit v1.2.3 From 623951fb948261c0dbe1f5b3881596bb509534b6 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Tue, 27 Feb 2024 17:31:53 +0100 Subject: [zsh] added auto notify and keybind for autosuggestions --- config/essentials/zsh/.zshrc | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/config/essentials/zsh/.zshrc b/config/essentials/zsh/.zshrc index 9b105e6..02d0ddf 100644 --- a/config/essentials/zsh/.zshrc +++ b/config/essentials/zsh/.zshrc @@ -32,15 +32,22 @@ eval "$(zoxide init zsh)" ### Plugins [ -f "$HOME/.local/share/zap/zap.zsh" ] && source "$HOME/.local/share/zap/zap.zsh" +plug "MichaelAquilina/zsh-you-should-use" +plug "chivalryq/git-alias" plug "kutsan/zsh-system-clipboard" +# plug "marlonrichert/zsh-autocomplete" plug "xPMo/zsh-toggle-command-prefix" +plug "zap-zsh/fzf" plug "zap-zsh/vim" +plug "zdharma-continuum/fast-syntax-highlighting" plug "zsh-users/zsh-autosuggestions" plug "zsh-users/zsh-completions" -plug "zap-zsh/fzf" -plug "zdharma-continuum/fast-syntax-highlighting" plug "zsh-users/zsh-history-substring-search" -plug "MichaelAquilina/zsh-you-should-use" + +plug "MichaelAquilina/zsh-auto-notify" +export AUTO_NOTIFY_TITLE="zsh" +export AUTO_NOTIFY_BODY="%command [%exit_code]" +AUTO_NOTIFY_IGNORE+=("gurk") # Substring search settings export HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_FOUND="bg=blue,fg=black,bold" @@ -92,6 +99,7 @@ bindkey "^Xa" _expand_alias bindkey "^Xe" edit-command-line bindkey "^[." insert-last-word bindkey "^['" quote-line +bindkey '\ea' autosuggest-toggle ## Move around using h j k l in completion menu zmodload zsh/complist bindkey -M menuselect 'h' vi-backward-char -- cgit v1.2.3 From 2102e1ed005293b73e105729cc404ee6557a0508 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Tue, 27 Feb 2024 17:33:46 +0100 Subject: [zsh] added surround_in_var in widgets.zsh --- config/essentials/zsh/.zshrc | 1 + config/essentials/zsh/widgets.zsh | 9 +++++++++ 2 files changed, 10 insertions(+) create mode 100644 config/essentials/zsh/widgets.zsh diff --git a/config/essentials/zsh/.zshrc b/config/essentials/zsh/.zshrc index 02d0ddf..b9c1173 100644 --- a/config/essentials/zsh/.zshrc +++ b/config/essentials/zsh/.zshrc @@ -23,6 +23,7 @@ zle -N change-surround surround . $XDG_CONFIG_HOME/shell/functions.sh . $XDG_CONFIG_HOME/shell/aliases.sh . $XDG_CONFIG_HOME/zsh/comp.zsh +. $XDG_CONFIG_HOME/zsh/widgets.zsh # . $XDG_CONFIG_HOME/zsh/prompt.zsh # . $XDG_CONFIG_HOME/zsh/plugins.zsh diff --git a/config/essentials/zsh/widgets.zsh b/config/essentials/zsh/widgets.zsh new file mode 100644 index 0000000..e0cbf98 --- /dev/null +++ b/config/essentials/zsh/widgets.zsh @@ -0,0 +1,9 @@ +# surround line in variable +surround_in_var() +{ + BUFFER=" \$($BUFFER)" + zle beginning-of-line +} +zle -N surround_in_var +bindkey '\ev' surround_in_var + -- cgit v1.2.3 From 1e1b7fed63b806c2788baa4ca6c4244b7544006a Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Tue, 27 Feb 2024 22:50:20 +0100 Subject: fix commander not working --- bin/guiscripts/sturl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/guiscripts/sturl b/bin/guiscripts/sturl index d261e32..27a8f47 100755 --- a/bin/guiscripts/sturl +++ b/bin/guiscripts/sturl @@ -1,7 +1,7 @@ #!/bin/sh regex='(((file|https?|gopher|gemini|ftps?|git)://|www\.)[a-zA-Z0-9.]*[:;!a-zA-Z0-9./+@$&%?$\#=_~-]*)|(magnet:\?xt=urn:btih:[a-zA-Z0-9]*)' -url="$(tr -d '\n' | grep -Eo "$regex" | commander -cl)" +url="$(tr -d '\n' | grep -Eo "$regex" | commander -xcl)" [ -z "$url" ] && exit 1 case $1 in -- cgit v1.2.3 From 066db981ba91d232bead8a4543d7647465197ded Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Tue, 27 Feb 2024 22:50:50 +0100 Subject: fix commander --- bin/menuscripts/mpower | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bin/menuscripts/mpower b/bin/menuscripts/mpower index f8f7654..8c1a886 100755 --- a/bin/menuscripts/mpower +++ b/bin/menuscripts/mpower @@ -1,11 +1,13 @@ #!/bin/sh choice="$( -cat < Date: Tue, 27 Feb 2024 22:51:09 +0100 Subject: add aliases --- config/essentials/shell/aliases.sh | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/config/essentials/shell/aliases.sh b/config/essentials/shell/aliases.sh index ca9f0dd..a1e5fa0 100644 --- a/config/essentials/shell/aliases.sh +++ b/config/essentials/shell/aliases.sh @@ -77,8 +77,8 @@ alias lst1='ls --tree -L1' alias lst2='ls --tree -L2' alias lst3='ls --tree -L3' alias ls.='ls -dl .*' -which exa >/dev/null 2>&1 && - alias ls='exa --sort extension --group-directories-first --no-time --git' || +which eza >/dev/null 2>&1 && + alias ls='eza --sort extension --group-directories-first --no-time --git' || alias ls='ls --color --group-directories-first --sort=extension' # pacman aliases @@ -157,7 +157,7 @@ alias airpods='bluetoothctl connect 60:93:16:24:00:10' alias hotpsot='nmcli dev wifi hotspot ifname wlan0 ssid wiefie password "peepeepoopoo"' alias wtip='wt ip -c -brief addr' alias fusephone='sshfs myphone: /media/phone' -alias ttyper='ttyper -l english1000 -w 100' +alias ttyper='ttyper -l english1000' alias wgup='doas wg-quick up wg0' alias wgdown='doas wg-quick down wg0' @@ -226,7 +226,7 @@ alias vb='vbm startvm' # quick config alias ez='vi ${ZDOTDIR:-~}/.zshrc' -alias eza='vi $HOME/.config/shell/aliases.sh' +alias ezal='vi $HOME/.config/shell/aliases.sh' alias ezf='vi $HOME/.config/shell/functions.sh' alias eto='vi ~/sync/TODO' alias edw='vi ~/proj/suckless/dwm/config.def.h' @@ -314,7 +314,16 @@ alias dbinf='ssh db dlinfo' alias sshdb='ssh -t db "tmux a || tmux"' alias dbsmu='rsync -rlpP db:/media/basilisk/music/ /media/kilimanjaro/music' -# oh-my-zsh git aliases +# git alias config='GIT_WORK_TREE=~/src/dotfiles/ GIT_DIR=~/src/dotfiles/.git' alias cfg='vi ~/src/dotfiles/"$(config git ls-files | fzf || exit)"' alias gmod='git status --short | sed '\''/^\s*M/!d;s/^\s*M\s*//'\'' | fzf | xargs vi' + +# docker +alias dorm='docker container rm $(docker container ls -a | tail -n +2 | fzf -m | awk '\''{print $1}'\'')' +alias dostop='docker container stop $(docker container ls -a | tail -n +2 | fzf -m | awk '\''{print $1}'\'')' +alias doirm='docker image rm $(docker image ls | tail -n +2 | fzf -m | awk '\''{print $3}'\'')' + +alias -g skip='tail -n +2' +alias ddeps='pactree -r -d 1' +alias update-mirrors='reflector -p https | rankmirrors -n 10 -p -w - | doas tee /etc/pacman.d/mirrorlist' -- cgit v1.2.3 From d3d3c3dd1bdcac22c751b2ab1031de7c7bf6e903 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Tue, 27 Feb 2024 22:51:25 +0100 Subject: turn functions into one line --- config/essentials/shell/functions.sh | 41 ++++++++++-------------------------- 1 file changed, 11 insertions(+), 30 deletions(-) diff --git a/config/essentials/shell/functions.sh b/config/essentials/shell/functions.sh index 38fae34..22064e4 100644 --- a/config/essentials/shell/functions.sh +++ b/config/essentials/shell/functions.sh @@ -68,6 +68,14 @@ sms() { ssh -t phone sendmsg "$1" "'$2'"; } trcp() { scp "$1" db:/media/basilisk/downloads/transmission/torrents/; } rln() { ln -s "$(readlink -f "$1")" "$2"; } getgit() { git clone git@db:"$1"; } +esc() { eval "$EDITOR '$(which $1)'"; } +delfile() { curl "${2:-https://upfast.cronyakatsuki.xyz/delete/$1}"; } +upfile() { curl -F "file=@\"$1\"" "${2:-https://0x0.st}"; } +to_webm() { ffmpeg -y -i "$1" -vcodec libvpx -cpu-used -12 -deadline realtime "${1%.*}".webm; } +ngenable() { ln -sf /etc/nginx/sites-available/$1 /etc/nginx/sites-enabled/; } +remove_audio() { ffmpeg -i "$1" -cpu-used -$(nproc) -deadline realtime -c copy -an "${2:-out.mp4}"; } +nasg() { smbclient //192.168.178.24/Public/ -D ENFANTS/Luca/tmp -N -c "get $1"; } +trll() { printf "%s\n" "$1" | trl 2>/dev/null; } ipc() { @@ -105,22 +113,6 @@ unzipp() { rm -- "$1" } -# fix long waiting time -__git_files() { - _wanted files expl 'local files' _files -} - -esc() { - eval "$EDITOR '$(which $1)'" -} - -delfile() { - curl "${2:-https://upfast.cronyakatsuki.xyz/delete/$1}" -} -upfile() { - curl -F "file=@\"$1\"" ${2:-https://0x0.st} -} - # git sgd() { d="$PWD" @@ -141,6 +133,9 @@ sgd() { unset d } +# fix long waiting time +__git_files() { _wanted files expl 'local files' _files; } + ginit() { [ "$1" ] || return 1 @@ -207,11 +202,6 @@ gpg_import() shred -uz public.asc private.asc trust.asc } -ngenable() -{ - ln -sf /etc/nginx/sites-available/$1 /etc/nginx/sites-enabled/ -} - vbsr() { vboxmanage snapshot "$1" restore "$2" && @@ -300,12 +290,3 @@ edit_in_dir() { [ -f "$file" ] || return 1 $EDITOR "$file" } - -to_webm() -{ - ffmpeg -y -i "$1" -vcodec libvpx -cpu-used -12 -deadline realtime "${1%.*}".webm -} -remove_audio() { ffmpeg -i "$1" -cpu-used -$(nproc) -deadline realtime -c copy -an "${2:-out.mp4}"; } -nasg() { smbclient //192.168.178.24/Public/ -D ENFANTS/Luca/tmp -N -c "get $1"; } -trll() { printf "%s -" "$1" | trl 2>/dev/null; } -- cgit v1.2.3 From a441502e78ac4981c1c10ba017d2c98f08adfce8 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Tue, 27 Feb 2024 22:54:28 +0100 Subject: remove rounding on dwm status bar --- config/X/picom/picom.conf | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/config/X/picom/picom.conf b/config/X/picom/picom.conf index 3e15abf..48d6e20 100644 --- a/config/X/picom/picom.conf +++ b/config/X/picom/picom.conf @@ -3,7 +3,8 @@ ################################# corner-radius = 5.0; rounded-corners-exclude = [ - "class_g = 'Dunst'" + "class_g = 'Dunst'", + "class_g = 'dwm'" ]; round-borders = 1; -- cgit v1.2.3 From 34af8f4e92e6c41765ec51a1d72dc3dbc38f4893 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Tue, 27 Feb 2024 22:54:41 +0100 Subject: put dunst in top-center --- config/X/dunst/dunstrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/X/dunst/dunstrc b/config/X/dunst/dunstrc index a83f45f..31fbae0 100644 --- a/config/X/dunst/dunstrc +++ b/config/X/dunst/dunstrc @@ -30,7 +30,7 @@ height = 80 # Position the notification in the top right corner - origin = top-right + origin = top-center # Offset from the origin offset = 10x10 -- cgit v1.2.3 From a845f02e612696547fe2981bc987674e8058b419 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Tue, 27 Feb 2024 22:55:53 +0100 Subject: [zsh] added ignore for auto-notify and comments for profiling --- config/essentials/zsh/.zshrc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/config/essentials/zsh/.zshrc b/config/essentials/zsh/.zshrc index b9c1173..56b7c0d 100644 --- a/config/essentials/zsh/.zshrc +++ b/config/essentials/zsh/.zshrc @@ -1,5 +1,7 @@ #!/bin/zsh +# zmodload zsh/zprof + if [ "$(id -u)" -ne 0 ] then [ "${TTY%%tty*}" = '/dev/' ] && clear @@ -48,7 +50,7 @@ plug "zsh-users/zsh-history-substring-search" plug "MichaelAquilina/zsh-auto-notify" export AUTO_NOTIFY_TITLE="zsh" export AUTO_NOTIFY_BODY="%command [%exit_code]" -AUTO_NOTIFY_IGNORE+=("gurk") +AUTO_NOTIFY_IGNORE+=("gurk" "ttyper" "pulsemixer") # Substring search settings export HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_FOUND="bg=blue,fg=black,bold" @@ -142,3 +144,5 @@ setopt histreduceblanks setopt interactivecomments setopt notify setopt cdablevars + +# zprof -- cgit v1.2.3 From 9a145601b331c0077d183e2b8f39c8f69450b452 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Wed, 28 Feb 2024 10:33:54 +0100 Subject: use sshpass and refactor --- bin/extra/aivpn | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/bin/extra/aivpn b/bin/extra/aivpn index 3c87ce8..aab90a8 100755 --- a/bin/extra/aivpn +++ b/bin/extra/aivpn @@ -4,27 +4,18 @@ logn() { printf "%s\n" "$@"; } if [ "$1" = "-k" ] then - pgrep -f -- "ssh.*-L.*vm" | - xargs kill + pgrep -f -- "ssh.*-L.*vm" | xargs kill exit fi -# For when script calls itself -if [ "$PASSWORD" ] -then - pass show "$PASSWORD" && - exit - exit 1 -fi - keyadd ehb/ai -export SSH_ASKPASS="$0" +export SSH_ASKPASS="sshpass" export SSH_ASKPASS_REQUIRE="prefer" -export PASSWORD=zot/qemu +export PASSWORD="zot/qemu" logn "I: Waiting for connectivity..." -while ! ssh -o ConnectTimeout=1 -o BatchMode=yes vm 2>&1 | grep -q "Permission denied" +while ! ssh -o ConnectTimeout=1 -o BatchMode=yes vm 2>&1 | grep "Permission denied" > /dev/null do sleep 1 done -- cgit v1.2.3 From 5e044857f14932a950b12d61a1f1c58a934bc5e6 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Wed, 28 Feb 2024 10:34:10 +0100 Subject: added sshpass --- bin/common/sshpass | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100755 bin/common/sshpass diff --git a/bin/common/sshpass b/bin/common/sshpass new file mode 100755 index 0000000..71f8e93 --- /dev/null +++ b/bin/common/sshpass @@ -0,0 +1,6 @@ +#!/bin/sh +if [ "$PASSWORD" ] +then + pass show "$PASSWORD" && exit + exit 1 +fi -- cgit v1.2.3 From 66686bf68123ccc060e5ee2e61e1a5ba2d83ddb3 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Wed, 28 Feb 2024 10:34:51 +0100 Subject: added dir to srcsupd --- config/essentials/shell/aliases.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/essentials/shell/aliases.sh b/config/essentials/shell/aliases.sh index a1e5fa0..b075e07 100644 --- a/config/essentials/shell/aliases.sh +++ b/config/essentials/shell/aliases.sh @@ -185,7 +185,7 @@ alias gdate='date +%y_%m_%d-%T' alias tpid='tail -f /dev/null --pid' alias pwdcp='pwd | clipp' alias gw="grep -ri" -alias srcsupd='echo ~/src/{installdrier,dotfiles,password-store} ~/.config/emacs | supd' +alias srcsupd='echo ~/src/{installdrier,dotfiles,password-store} ~/proj/suckless/*/ ~/proj/personal/scripts/*/ ~/.config/emacs | supd' # systemctl aliases alias smc='systemctl' -- cgit v1.2.3 From 8ab76a9ebf8414c720f13bd0aaaa2e6452ff753b Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Wed, 28 Feb 2024 23:20:30 +0100 Subject: add gclc alias --- config/essentials/shell/aliases.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/config/essentials/shell/aliases.sh b/config/essentials/shell/aliases.sh index b075e07..478ded2 100644 --- a/config/essentials/shell/aliases.sh +++ b/config/essentials/shell/aliases.sh @@ -318,6 +318,7 @@ alias dbsmu='rsync -rlpP db:/media/basilisk/music/ /media/kilimanjaro/music' alias config='GIT_WORK_TREE=~/src/dotfiles/ GIT_DIR=~/src/dotfiles/.git' alias cfg='vi ~/src/dotfiles/"$(config git ls-files | fzf || exit)"' alias gmod='git status --short | sed '\''/^\s*M/!d;s/^\s*M\s*//'\'' | fzf | xargs vi' +alias gclc='git clone "$(clipo)"' # docker alias dorm='docker container rm $(docker container ls -a | tail -n +2 | fzf -m | awk '\''{print $1}'\'')' -- cgit v1.2.3