diff --git a/bin/.bin/screenrecord b/bin/.bin/screenrecord new file mode 100755 index 00000000..26bac652 --- /dev/null +++ b/bin/.bin/screenrecord @@ -0,0 +1,80 @@ +#!/bin/bash + +# A simple wrapper around ffmpeg +# +# When run, a screenrecording will be made +# The file path will be put in the primary selection +# Will create notification containing file path +# +# If you have a project specified, it will put the sceenshot in that folder instead of /tmp +# +# Relies on ffmpeg for taking screenrecording + +PIDFILE="/tmp/screenrecord.pid" + + + +if [ -f "$PIDFILE" ]; then + pkill ffmpeg + exit +fi + +echo $$ > "$PIDFILE" + + + +path='/tmp' +command -v ffmpeg > /dev/null || ( echo -n "You need to install ffmpeg" && exit 1 ) + +#If a project is set we will put screenshots in the project's folder +command -v project > /dev/null && project=$(project current --path) +if [ -n "$project" ]; then + path="$project/screenrecordings" + #Make the directory if it doesn't exist + mkdir "$path" 2> /dev/null +fi + +filename="$(date +"%Y-%m-%dT%H-%M-%SZ").mkv" +file="${path}/${filename}" + +[ "$1" = "-w" ] && sleep "$2" && shift && shift + +case $1 in + "select") + if [ -n "$WAYLAND_DISPLAY" ]; then + echo "Shouldn't get here" + echo "No wayland support yet" >&2 + exit + else + echo "I get here" + ffmpeg -framerate 30 -f x11grab $(slop -l -c "0.41,0.62,0.42,0.2" -f "-video_size %wx%h -i :0.0+%x,%y") "$file" + fi + ;; + *) + if [ -n "$WAYLAND_DISPLAY" ]; then + echo "No wayland support yet" >&2 + exit + else + ffmpeg -framerate 30 -f x11grab -video_size "$(xdpyinfo | grep dimensions | awk '{print $2}')" -i :0.0 "$file" + fi + ;; +esac + +if [ -f "$file" ]; then + # Create a gif + ffmpeg -i "$file" -vf "fps=10,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse" -loop 0 "${file%.*}".gif + if [ -n "$WAYLAND_DISPLAY" ]; then + # Copies the image to your clipboard (ctrl + v) + wl-copy < "${file%.*}.gif" + # Copies the filename to primary selection (shift + insert or middle mouse) + echo -n "${file%.*}.gif" | wl-copy --primary + else + # Copies the image to your clipboard (ctrl + v) + xclip -selection clipboard -target image/gif -i "${file%.*}.gif" + # Copies the filename to primary selection (shift + insert or middle mouse) + echo -n "${file%.*}.gif" | xclip -selection primary + fi + # Creates notification with file name + notify-send "New Screenrecording" "$file\n${file%.*}.gif" +fi +rm "$PIDFILE" diff --git a/nvim/.config/nvim/after/plugin/lsp.vim b/nvim/.config/nvim/after/plugin/lsp.vim index f8b60955..b575dd07 100644 --- a/nvim/.config/nvim/after/plugin/lsp.vim +++ b/nvim/.config/nvim/after/plugin/lsp.vim @@ -3,18 +3,21 @@ if !has('nvim') finish endif lua < lua vim.lsp.buf.definition() diff --git a/nvim/.config/nvim/pack/bundle/opt/deoplete-lsp b/nvim/.config/nvim/pack/bundle/opt/deoplete-lsp index fb51bfeb..a716897b 160000 --- a/nvim/.config/nvim/pack/bundle/opt/deoplete-lsp +++ b/nvim/.config/nvim/pack/bundle/opt/deoplete-lsp @@ -1 +1 @@ -Subproject commit fb51bfebd8ac57282154d119f80368b4b94199b7 +Subproject commit a716897b958d1f1c0809d92a70e8d849a3d652e2 diff --git a/nvim/.config/nvim/pack/bundle/opt/deoplete.nvim b/nvim/.config/nvim/pack/bundle/opt/deoplete.nvim index 51440bb8..4caf1273 160000 --- a/nvim/.config/nvim/pack/bundle/opt/deoplete.nvim +++ b/nvim/.config/nvim/pack/bundle/opt/deoplete.nvim @@ -1 +1 @@ -Subproject commit 51440bb8d9bc5e421d31d1a2a60a204468624e1b +Subproject commit 4caf12730256579921d77e80423b339b8128c5b6 diff --git a/nvim/.config/nvim/pack/bundle/opt/firenvim b/nvim/.config/nvim/pack/bundle/opt/firenvim index 5e6fac42..22e7618f 160000 --- a/nvim/.config/nvim/pack/bundle/opt/firenvim +++ b/nvim/.config/nvim/pack/bundle/opt/firenvim @@ -1 +1 @@ -Subproject commit 5e6fac425119bcbd03a6b7e4d293de0c63cbc5ff +Subproject commit 22e7618fc338baea39c46d0c7369f134b7d18f44 diff --git a/nvim/.config/nvim/pack/bundle/opt/fzf.vim b/nvim/.config/nvim/pack/bundle/opt/fzf.vim index 7d45724f..e34f6c12 160000 --- a/nvim/.config/nvim/pack/bundle/opt/fzf.vim +++ b/nvim/.config/nvim/pack/bundle/opt/fzf.vim @@ -1 +1 @@ -Subproject commit 7d45724fdd323d5eb7d39c8caa2e38e63c5e84a7 +Subproject commit e34f6c129d39b90db44df1107c8b7dfacfd18946 diff --git a/nvim/.config/nvim/pack/bundle/opt/lexima.vim b/nvim/.config/nvim/pack/bundle/opt/lexima.vim index 89bf4dc1..6b716e21 160000 --- a/nvim/.config/nvim/pack/bundle/opt/lexima.vim +++ b/nvim/.config/nvim/pack/bundle/opt/lexima.vim @@ -1 +1 @@ -Subproject commit 89bf4dc13539131a29cf938074b3f1ce9d000bfd +Subproject commit 6b716e2118d842a26620387f0845e57cfd69ffaf diff --git a/nvim/.config/nvim/pack/bundle/opt/nvim-lspconfig b/nvim/.config/nvim/pack/bundle/opt/nvim-lspconfig index 60133c47..ea72eaae 160000 --- a/nvim/.config/nvim/pack/bundle/opt/nvim-lspconfig +++ b/nvim/.config/nvim/pack/bundle/opt/nvim-lspconfig @@ -1 +1 @@ -Subproject commit 60133c47e0fd82556d7ca092546ebfa8d047466e +Subproject commit ea72eaae8809c0e475a8248aa665034d7d4520db diff --git a/nvim/.config/nvim/pack/bundle/opt/ultisnips b/nvim/.config/nvim/pack/bundle/opt/ultisnips index c2709504..8803960a 160000 --- a/nvim/.config/nvim/pack/bundle/opt/ultisnips +++ b/nvim/.config/nvim/pack/bundle/opt/ultisnips @@ -1 +1 @@ -Subproject commit c270950492d71bac0317d47d42cd0884eefe6490 +Subproject commit 8803960a4e09daf1ad4d82e16a25bbdb4c78530e diff --git a/nvim/.config/nvim/pack/bundle/opt/vim-fugitive b/nvim/.config/nvim/pack/bundle/opt/vim-fugitive index 1a77f1c0..6c53da07 160000 --- a/nvim/.config/nvim/pack/bundle/opt/vim-fugitive +++ b/nvim/.config/nvim/pack/bundle/opt/vim-fugitive @@ -1 +1 @@ -Subproject commit 1a77f1c00e12e8460f39098ec3289c5433d32512 +Subproject commit 6c53da0783a15d2dcde504ae299468ac69078ebe diff --git a/nvim/.config/nvim/pack/bundle/opt/vim-repeat b/nvim/.config/nvim/pack/bundle/opt/vim-repeat index c947ad2b..24afe922 160000 --- a/nvim/.config/nvim/pack/bundle/opt/vim-repeat +++ b/nvim/.config/nvim/pack/bundle/opt/vim-repeat @@ -1 +1 @@ -Subproject commit c947ad2b6a16983724a0153bdf7f66d7a80a32ca +Subproject commit 24afe922e6a05891756ecf331f39a1f6743d3d5a diff --git a/nvim/.config/nvim/pack/bundle/opt/vim-snippets b/nvim/.config/nvim/pack/bundle/opt/vim-snippets index 0c5114e9..75309fc9 160000 --- a/nvim/.config/nvim/pack/bundle/opt/vim-snippets +++ b/nvim/.config/nvim/pack/bundle/opt/vim-snippets @@ -1 +1 @@ -Subproject commit 0c5114e90837eac9af2150406f7821041e7e720b +Subproject commit 75309fc96c49725cf9bbd7bc881b7b342a60aa9a diff --git a/nvim/.config/nvim/pack/bundle/opt/vim-vinegar b/nvim/.config/nvim/pack/bundle/opt/vim-vinegar index 5fee9d23..b245f3ab 160000 --- a/nvim/.config/nvim/pack/bundle/opt/vim-vinegar +++ b/nvim/.config/nvim/pack/bundle/opt/vim-vinegar @@ -1 +1 @@ -Subproject commit 5fee9d230ec4a6a16c45f2c71482595e4d9a67bd +Subproject commit b245f3ab4580eba27616a5ce06a56d5f791e67bd diff --git a/nvim/.config/nvim/plugin/deoplete.vim b/nvim/.config/nvim/plugin/deoplete.vim index 62997aed..0a777bfd 100644 --- a/nvim/.config/nvim/plugin/deoplete.vim +++ b/nvim/.config/nvim/plugin/deoplete.vim @@ -5,3 +5,6 @@ endif " Make deoplete start at startup let g:deoplete#enable_at_startup = 1 + +" Closes the preview window once a completion is done +autocmd CompleteDone * silent! pclose! diff --git a/nvim/.config/nvim/plugin/settings.vim b/nvim/.config/nvim/plugin/settings.vim index 59ec690b..105d58d0 100644 --- a/nvim/.config/nvim/plugin/settings.vim +++ b/nvim/.config/nvim/plugin/settings.vim @@ -52,6 +52,9 @@ set formatoptions+=o " Show the results of the substitute command as you type set inccommand=nosplit +" Sets the default fold method to indent +set foldmethod=indent + if executable('rg') set grepprg=rg\ --vimgrep\ --no-heading\ --color=never\ --glob=\"!shell-logs/*\" set grepformat=%f:%l:%c:%m,%f:%l:%m diff --git a/shells/shared/aliases b/shells/shared/aliases index 079c7f59..f63c9cf6 100644 --- a/shells/shared/aliases +++ b/shells/shared/aliases @@ -33,6 +33,8 @@ alias imapfilter="imapfilter -c \"$XDG_CONFIG_HOME/imapfilter/config.lua\"" # Makes rem output color by default alias rem="rem -@ -gaadd" +# Make df show human readable format +alias df="df -h" #################### # Path Shortcuts # @@ -112,6 +114,7 @@ type -p exa > /dev/null && alias tree="exa -FT" || alias tree='tree -F -C' # If nvim is available, alias vim to neovim type -p nvim > /dev/null && alias vim="nvim" +type -p nvim > /dev/null && alias vimdiff="nvim -d" # Trash instead of rm type -p rmtrash > /dev/null && alias rm="rmtrash" @@ -124,6 +127,7 @@ type -p sc-im > /dev/null && alias sc="sc-im" # versions type -p mycli > /dev/null && alias mysql="echo \"You might want to use mycli instead\"; /usr/bin/mysql" type -p pgcli > /dev/null && alias postgres="echo \"You might want to use pgcli instead\"; /usr/bin/postgres" +type -p ncdu > /dev/null && alias du="echo \"You might want to use ncdu instead\"; /usr/bin/du" # These are the gnu coreutils mv and cp with a progress bar patched in type -p mvg > /dev/null && alias mv="mvg -g" @@ -192,7 +196,7 @@ alias rot13="tr 'A-Za-z' 'N-ZA-Mn-za-m'" # Make sqlmap put output in the current project folder alias sqlmap="[ -L ~/Projects/current ] && sqlmap --output-dir=\"~/Projects/current/sqlmap\"" # Cd into the current project -alias pp="[ -L ~/Projects/current ] && cd \$(readlink ~/Projects/current) || cd ~/Projects" +alias pp="[ -L ~/Projects/current ] && cd \"\$(readlink ~/Projects/current)\" || cd ~/Projects" # Automatically switch project based on current location alias pa="project switch --auto" # Change project using fzf @@ -209,6 +213,8 @@ if [ -f "$HOME/GitRepos/openssl-weak/openssl-1.0.2-chacha/apps/openssl" ]; then alias weakopenssl="$HOME/GitRepos/openssl-weak/openssl-1.0.2-chacha/apps/openssl" alias testssl="testssl --openssl=\"$HOME/GitRepos/openssl-weak/openssl-1.0.2-chacha/apps/openssl\"" alias verifySSL="verifySSL --openssl \"$HOME/GitRepos/openssl-weak/openssl-1.0.2-chacha/apps/openssl\"" +else + alias testssl="docker run --rm -ti -v \$PWD:/data drwetter/testssl.sh" fi @@ -281,6 +287,10 @@ alias chrome-curl="node $HOME/GitRepos/chrome-curl/index.js" # Plays a youtube video or playlist - audio only alias ytaudio='mpv --ytdl-format="bestaudio"' +alias asciicast2gif='docker run --rm -v $PWD:/data asciinema/asciicast2gif' + +alias anboxPrepare='sudo modprobe -a binder && sudo mkdir /dev/binderfs && sudo chmod 755 /dev/binderfs && sudo mount -t binder none /dev/binderfs && mount | grep binderfs && sudo systemctl start systemd-networkd anbox-container-manager' + if type grc > /dev/null 2>&1; then for cmd in "nmap" "ping" "traceroute" "mount" "netstat" "ps" "dig" "du" "df" "ip" "iptables" "lsblk" "id" "free" "tcpdump" "uptime" "showmount" "whois" ; do alias "$cmd"="grc $(whence $cmd)" diff --git a/shells/shared/environmentVariables b/shells/shared/environmentVariables index ca2bd799..b2bc2ba1 100644 --- a/shells/shared/environmentVariables +++ b/shells/shared/environmentVariables @@ -18,7 +18,7 @@ for d in "$HOME"/.bin/*/; do mypath+=":$d" done -export PATH=~/Projects/current/bin:$mypath:$GOPATH/bin:$HOME/.local/share/bin:$PATH:. +export PATH=~/Projects/current/bin:$mypath:$GOPATH/bin:$HOME/.local/share/bin:$HOME/.config/composer/vendor/bin:$PATH:. #Ruby things if type -p ruby > /dev/null; then @@ -46,6 +46,14 @@ export LESS_TERMCAP_us=$'\e[1;32m' export DOTFILES="$HOME/.dotfiles" +# Telemetry +export DO_NOT_TRACK=1 # Hopefully this will take on: https://consoledonottrack.com/ +export MSSQL_CLI_TELEMETRY_OPTOUT=1 +export DOTNET_CLI_TELEMETRY_OPTOUT=1 +export POWERSHELL_CLI_TELEMETRY_OPTOUT=1 + +#export GTK_THEME=Adapta-Nokto + if [ -n "$GTK_MODULES" ] then export GTK_MODULES="$GTK_MODULES:unity-gtk-module" diff --git a/shells/zsh/includes/currentwordcompletion.zsh b/shells/zsh/includes/currentwordcompletion.zsh index dbda0358..b155d600 100644 --- a/shells/zsh/includes/currentwordcompletion.zsh +++ b/shells/zsh/includes/currentwordcompletion.zsh @@ -10,6 +10,25 @@ wordlistSelect() { fd -a --type f --hidden --follow --color=always --exclude .git --exclude \*.md --exclude \*.gif --exclude \*.jpg --exclude \*.png --exclude \*.lua --exclude \*.jar --exclude \*.pl '' /usr/share/wordlists/ | fzf --preview 'bat --color=always {}' } +regexSelect(){ + ( + echo -e "Name\tRegex\tNotes" + + echo -ne "IP Address\t" + echo -n '(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])' + echo -e "\tRequires extended regex -E in grep" + + echo -ne "URLs\t" + echo -n 'https?://[^\"\\'"'"'> ]+' + echo -e "\tRequires extended regex -E in grep" + + echo -ne "AWS Keys\t" + echo -n '([^A-Z0-9]|^)(AKIA|A3T|AGPA|AIDA|AROA|AIPA|ANPA|ANVA|ASIA)[A-Z0-9]{12,}' + echo -e "\tRequires extended regex -E in grep" + + ) | column -t -s $'\t' | fzf --preview-window top:1 --preview 'echo {3}' --delimiter ' +' --header-lines 1 --with-nth 1,2 | awk -F ' +' '{print "\"" $2 "\""}' +} + word_replace(){ local ret=1 local word="$1" @@ -17,6 +36,7 @@ word_replace(){ case "$word" in wl) wordlistSelect; return 0 ;; myip) ip route | grep -oE '(dev|src) [^ ]+' | sed 'N;s/\n/,/;s/src //;s/dev //' | awk -F',' '{print $2 " " $1}' | sort -u | fzf -1 --no-preview | cut -d' ' -f1; return 0 ;; + regex) regexSelect; return 0 ;; esac return "$ret" } diff --git a/shells/zsh/includes/keybindings.zsh b/shells/zsh/includes/keybindings.zsh index bee2ee7d..91b33d3a 100644 --- a/shells/zsh/includes/keybindings.zsh +++ b/shells/zsh/includes/keybindings.zsh @@ -121,7 +121,7 @@ bindkey '\em' make_current_word_directory swap_command(){ # Each group should be seperated by a colon with each item in a group # seperated by a space - local groups="cd vim ls:ping mtr" + local groups="cd vim ls:ping mtr:mysql mycli postgres pgcli:du:ncdu" local tokens=(${(z)LBUFFER}) local cmd="${tokens[1]}" local newindex=0 diff --git a/shells/zsh/includes/navi.zsh b/shells/zsh/includes/navi.zsh new file mode 100644 index 00000000..e7a3b138 --- /dev/null +++ b/shells/zsh/includes/navi.zsh @@ -0,0 +1,19 @@ +#!/usr/bin/env zsh + +#_call_navi() { +# local selected +# if [ -n "$LBUFFER" ]; then +# if selected="$(printf "%s" "$(navi --print --fzf-overrides '--no-select-1' --query "${LBUFFER}" G composite js "git clone " + document.location.href.replace(/https? bind c composite hint_focus; !s xdotool key Menu " Makes link hints only hint links on duck duck go -bindurl ^https://duckduckgo.com f hint -Jc [class=result__a] -bindurl ^https://duckduckgo.com F hint -Jbc [class=result__a] +""bindurl ^https://duckduckgo.com f hint -Jc [class=result__a] +""bindurl ^https://duckduckgo.com F hint -Jbc [class=result__a] autocmd DocStart .*github\.com.* zoom 150