diff options
-rw-r--r-- | .config/Zeal/Zeal.conf | 4 | ||||
-rw-r--r-- | .config/i3/config | 1 | ||||
-rw-r--r-- | .config/i3blocks/systeminfo | 78 | ||||
-rw-r--r-- | .config/lf/lfrc | 2 | ||||
-rw-r--r-- | .config/nvim/coc/coc-settings.json | 4 | ||||
-rw-r--r-- | .config/nvim/dev.vim | 2 | ||||
m--------- | .config/nvim/pack/plugins/opt/copilot.vim | 0 | ||||
-rw-r--r-- | .config/shell/profile | 11 | ||||
-rw-r--r-- | .config/zsh/.zshrc | 2 | ||||
-rwxr-xr-x | .local/bin/open | 4 | ||||
-rwxr-xr-x | .local/bin/shorts/adbs | 6 | ||||
-rwxr-xr-x | .local/bin/shorts/mk | 5 | ||||
-rwxr-xr-x | .local/bin/shorts/windowshot | 6 | ||||
-rwxr-xr-x | .local/bin/statusbar/disk-io | 93 | ||||
-rwxr-xr-x | .local/bin/statusbar/disk_usage | 123 | ||||
-rwxr-xr-x | .local/bin/statusbar/i3weather | 3 |
16 files changed, 305 insertions, 39 deletions
diff --git a/.config/Zeal/Zeal.conf b/.config/Zeal/Zeal.conf index 2344fae..7b4d6ad 100644 --- a/.config/Zeal/Zeal.conf +++ b/.config/Zeal/Zeal.conf @@ -1,6 +1,6 @@ [General] check_for_update=true -hide_on_close=false +hide_on_close=true minimize_to_systray=false show_systray_icon=true start_minimized=false @@ -25,7 +25,7 @@ smooth_scrolling=true path=/home/master/.local/share/Zeal/Zeal/docsets [global_shortcuts] -show=Meta+/ +show=Meta+Z [internal] install_id=7cf1e6a2-9a52-4dfc-a7de-bc1acd562804 diff --git a/.config/i3/config b/.config/i3/config index 952f000..23697c5 100644 --- a/.config/i3/config +++ b/.config/i3/config @@ -546,6 +546,7 @@ bar { bar { output nonprimary + status_command exec i3blocks -c ~/.config/i3blocks/systeminfo bindsym --release button3 exec jgmenu --at-pointer workspace_min_width 40 strip_workspace_numbers yes diff --git a/.config/i3blocks/systeminfo b/.config/i3blocks/systeminfo index 68a6944..d4428a1 100644 --- a/.config/i3blocks/systeminfo +++ b/.config/i3blocks/systeminfo @@ -23,28 +23,56 @@ # Global properties separator=false -separator_block_width=35 - -[badwidth] -seprator=false -command=echo "$(i3bandwidth)" -interval=1 - -[wifi] -# command=echo "📡 $(i3wifi wlp0s20f3)" -command=i3wifi wlp0s20f3 -interval=1 - -[battery] -command=i3battery -interval=1 - -[cpu] -command=echo " $(i3cpu)" -interval=3 - -[memory] -separator=true -separator_block_width=50 -command=echo " $(i3memory)" -interval=1 +separator_block_width=60 + +# [badwidth] +# seprator=false +# command=echo "$(i3bandwidth)" +# interval=1 + +# [wifi] +# # command=echo "📡 $(i3wifi wlp0s20f3)" +# command=i3wifi wlp0s20f3 +# interval=1 + +# [battery] +# command=i3battery +# interval=1 + +# [cpu] +# command=echo " $(i3cpu)" +# interval=3 + +# [memory] +# separator=true +# separator_block_width=50 +# command=echo " $(i3memory)" +# interval=1 + +[disk_nas] +label= +instance=/nas +interval=30 +command=disk_usage + +[disk-io] +separator_block_width=60 +command=disk-io +#command=$SCRIPT_DIR/disk-io -w 3 -M -P 0 +interval=persist +markup=pango +LABEL= +#instance=/^sda/ +#DT=5 +#MB_ONLY=0 #0 or 1 +#KB_ONLY=0 #0 or 1 +#WIDTH=4 +#MB_PRECISION=1 +#KB_PRECISION=0 +#REGEX=/^(s|h)d[a-zA-Z]+/ +#THRESHOLD=0 +#WARN_COLOR="#FF0000" +#SEPARATOR=/ +#PREFIX= +#SUFFIX="B/s" + diff --git a/.config/lf/lfrc b/.config/lf/lfrc index a9b2874..c0bf283 100644 --- a/.config/lf/lfrc +++ b/.config/lf/lfrc @@ -132,7 +132,7 @@ map M $lf -remote "send $id select \"$(FZF_DEFAULT_OPTS="--track --query '^${f## map D delete map W $setsid -f $TERMINAL >/dev/null 2>&1 map X !$f -map T push :$touch<space>""<c-b> +map C push :$mk<space>""<c-b> map b $vidir map V push :!nvim<space>""<c-b> map P :link diff --git a/.config/nvim/coc/coc-settings.json b/.config/nvim/coc/coc-settings.json index 8b56371..2f3abdc 100644 --- a/.config/nvim/coc/coc-settings.json +++ b/.config/nvim/coc/coc-settings.json @@ -3,5 +3,7 @@ "diagnostic.enable": true, "python.linting.pycodestyleEnabled": true, "html.autoCreateQuotes": false, - "coc.preferences.formatOnType": true + "coc.preferences.formatOnType": true, + "copilot.enable": false, + "copilot.showRemainingText": true } diff --git a/.config/nvim/dev.vim b/.config/nvim/dev.vim index 149b931..23afa9f 100644 --- a/.config/nvim/dev.vim +++ b/.config/nvim/dev.vim @@ -4,6 +4,7 @@ packadd! onedark.vim " packadd! fzf packadd! fzf.vim packadd! vim-jsx-pretty +packadd! copilot.vim " --> Fzf source ~/.config/nvim/other/fzf.vim @@ -38,6 +39,7 @@ nnoremap <silent><nowait> <leader>ck :<C-u>CocPrev<CR> nnoremap <silent><nowait> <leader>cp :<C-u>CocListResume<CR> nnoremap <leader>cm :CocList marketplace<CR> nnoremap <leader>cff :Format<CR> +inoremap <silent><expr><c-l> coc#refresh() " --> Vimspector let g:vimspector_base_dir = expand('$HOME/.local/share/nvim/vimspector') diff --git a/.config/nvim/pack/plugins/opt/copilot.vim b/.config/nvim/pack/plugins/opt/copilot.vim new file mode 160000 +Subproject 7167958954532a0a1b83f2db2f591b43aebff44 diff --git a/.config/shell/profile b/.config/shell/profile index 234b1c2..af1b4a9 100644 --- a/.config/shell/profile +++ b/.config/shell/profile @@ -1,5 +1,10 @@ #!/bin/sh +XDG_CONFIG_HOME="$HOME/.config" +XDG_DATA_HOME="$HOME/.local/share" +XDG_STATE_HOME="$HOME/.local/state" +XDG_CACHE_HOME="$HOME/.cache" + export OPENER="open" export PAGER="less" export EDITOR="nvim" @@ -8,11 +13,6 @@ export FILES="lf" export TERMINAL="st" export PREVIEWER="preview" -XDG_CONFIG_HOME="$HOME/.config" -XDG_DATA_HOME="$HOME/.local/share" -XDG_STATE_HOME="$HOME/.local/state" -XDG_CACHE_HOME="$HOME/.cache" - export MOUNTPATH="/run/media/$USER" export PASSWORD_STORE_DIR="$HOME/Phone/Backup/pass" export SSH_AUTH_SOCK="$HOME/.ssh/ssh_auth_sock" @@ -20,6 +20,7 @@ export NCFTPDIR="$XDG_DATA_HOME/ncftp" export R_ENVIRON_USER="$XDG_DATA_HOME/R/.Renviron" export GOPATH="$XDG_DATA_HOME/go" export ANDROID_USER_HOME="$XDG_DATA_HOME/android" +export ANDROID_HOME="$HOME/Android/Sdk" export __GL_SHADER_DISK_CACHE_PATH="$HOME/.cache/nv" export PYENV_ROOT="$XDG_DATA_HOME/pyenv" diff --git a/.config/zsh/.zshrc b/.config/zsh/.zshrc index 22bf62f..9fb8143 100644 --- a/.config/zsh/.zshrc +++ b/.config/zsh/.zshrc @@ -263,7 +263,7 @@ case "$TERM" in *256*) } command -v fd >/dev/null && { - FZF_DEFAULT_COMMAND="fd --hidden --no-ignore-vcs --color=always | sort" + FZF_DEFAULT_COMMAND="fd --color=always | sort" FZF_DEFAULT_OPTS="$FZF_DEFAULT_OPTS --ansi" ff() { FZF_DEFAULT_COMMAND+="$@" fzf -m; } alias f='fd --hidden --no-ignore-vcs' diff --git a/.local/bin/open b/.local/bin/open index 5936451..69dcb9c 100755 --- a/.local/bin/open +++ b/.local/bin/open @@ -7,7 +7,7 @@ for file in "$@"; do *.pdf|*.djvu|*.epub) setsid -f zathura "$file" 2>/dev/null ;; *.png|*.jpg|*.jpeg|*.webp) setsid -f nsxiv "$file" ;; - *.gif|*.mkv|*.mp3|*.mp4|*.webm|*.ogg) ${PLAYER:-mpv --sub-auto=fuzzy} "$file" ;; + *.gif|*.mkv|*.mp3|*.mp4|*.webm|*.ogg) ${PLAYER:-mpv --no-config --sub-auto=fuzzy} "$file" ;; *.html) ${BROWSER:-w3m} "$file" ;; *.pl.txt) fpl "$file" ;; *.txt|*.description) ${PAGER:-less} "$file" ;; @@ -31,7 +31,7 @@ for file in "$@"; do application/sc) sc-im "$file" ;; application/x-executable) "$file" ;; image/*) setsid -f nsxiv "$file" ;; - video/*|audio/*) ${PLAYER:- mpv --sub-auto=fuzzy} "$file" ;; + video/*|audio/*) ${PLAYER:- mpv --no-config --sub-auto=fuzzy} "$file" ;; *) xdg-open "$file" || exit [ -n "$DISPLAY" ] && notify-send "⚠️ open: unknown filetype" "$filetype" diff --git a/.local/bin/shorts/adbs b/.local/bin/shorts/adbs index bca7733..20bba2b 100755 --- a/.local/bin/shorts/adbs +++ b/.local/bin/shorts/adbs @@ -1,3 +1,7 @@ #!/bin/sh -adb -s "${ADB_DEVICE}" shell "$@" +if [ -n "$ADB_DEVICE" ]; then + adb -s "${ADB_DEVICE}" shell "$@" +else + adb shell "$@" +fi diff --git a/.local/bin/shorts/mk b/.local/bin/shorts/mk new file mode 100755 index 0000000..392320f --- /dev/null +++ b/.local/bin/shorts/mk @@ -0,0 +1,5 @@ +#!/bin/sh + +# make a file in specified path + +mkdir -pv "$(dirname "$1")" && touch "$1" diff --git a/.local/bin/shorts/windowshot b/.local/bin/shorts/windowshot new file mode 100755 index 0000000..c654cc7 --- /dev/null +++ b/.local/bin/shorts/windowshot @@ -0,0 +1,6 @@ +#!/bin/sh + +image="${XDG_PICTURES_DIR:-$HOME/Pictures}/xwindow.jpg" +import -window "$(xdotool selectwindow)" "$image" +# dragon-drop --and-exit "$image" +xclip -sel clipboard -t image/png -i "$image" diff --git a/.local/bin/statusbar/disk-io b/.local/bin/statusbar/disk-io new file mode 100755 index 0000000..daf8e58 --- /dev/null +++ b/.local/bin/statusbar/disk-io @@ -0,0 +1,93 @@ +#!/usr/bin/env bash +# +# Copyright (C) 2016 James Murphy +# Licensed under the terms of the GNU GPL v2 only. +# +# i3blocks blocklet script to monitor disk io + +label="${LABEL:-""}" +dt="${DT:-5}" +MB_only="${MB_ONLY:-0}" +kB_only="${KB_ONLY:-0}" +width="${WIDTH:-4}" +MB_precision="${MB_PRECISION:-1}" +kB_precision="${KB_PRECISION:-0}" +regex="${REGEX:-$BLOCK_INSTANCE}" +regex="${regex:-/^(s|h)d[a-zA-Z]+/}" +threshold="${THRESHOLD:-0}" +warn_color="${WARN_COLOR:-#FF0000}" +sep="${SEPARATOR:-/}" +unit_suffix="${SUFFIX:-B/s}" +align="${ALIGN--}" + +function list_devices { + echo "Devices iostat reports that match our regex:" + iostat | awk '$1~/^(s|h)d[a-zA-Z]+/{print $1}' +} + +while getopts L:t:w:p:P:R:s:ST:C:lLMmKkh opt; do + case "$opt" in + L) label="$OPTARG" ;; + t) dt="$OPTARG" ;; + w) width="$OPTARG" ;; + p) kB_precision="$OPTARG" ;; + P) MB_precision="$OPTARG" ;; + R) regex="$OPTARG" ;; + s) sep="$OPTARG" ;; + S) unit_suffix="" ;; + T) threshold="$OPTARG" ;; + C) warn_color="$OPTARG" ;; + l) list_devices; exit 0 ;; + M|m) MB_only=1 ;; + K|k) kB_only=1 ;; + h) printf \ +"Usage: disk-io [-t time] [-w width] [-p kB_precision] [-P MB_precision] [-R regex] [-s separator] [-S] [-T threshold [-C warn_color]] [-k|-M] [-l] [-h] +Options: +-L\tLabel to put in front of the text. Default: $label +-t\tTime interval in seconds between measurements. Default: $dt +-w\tThe width of printed floats. Default: $width +-p\tThe precision of kB/s floats. Default: $kB_precision +-P\tThe precision of MB/s floats. Default: $MB_precision +-R\tRegex that devices must match. Default: $regex +-s\tSeparator to put between rates. Default: $sep +-S\tShort units, omit B/s in kB/s and MB/s. +-T\tRate in kB/s to exceed to trigger a warning. Default: not enabled +-C\tColor to change the blocklet to warn the user. Default: $warn_color +-l\tList devices that iostat reports +-M\tDo not switch between MB/s and kB/s, use only MB/s +-k\tDo not switch between MB/s and kB/s, use only kB/s +-h\tShow this help text +" && exit 0;; + esac +done + +iostat -dyz "$dt" | awk -v sep="$sep" " + BEGIN { + rx = wx = 0; + } + { + if(\$0 == \"\") { + if ($threshold > 0 && (rx >= $threshold || wx >= $threshold)) { + printf \"<span color='$warn_color'>\"; + } + printf \"$label\"; + if(!$kB_only && ($MB_only || rx >= 1024 || wx >= 1024)) { + printf \"%$align$width.${MB_precision}f%s%$width.${MB_precision}f M$unit_suffix\", rx/1024, sep, wx/1024; + } + else { + printf \"%$align$width.${kB_precision}f%s%$width.${kB_precision}f k$unit_suffix\", rx, sep, wx; + } + if ($threshold > 0 && (rx >= $threshold || wx >= $threshold)) { + printf \"</span>\"; + } + printf \"\n\"; + fflush(stdout); + } + else if(\$1~/^Device:?/) { + rx = wx = 0; + } + else if(\$1~$regex) { + rx += \$3; + wx += \$4; + } + }" diff --git a/.local/bin/statusbar/disk_usage b/.local/bin/statusbar/disk_usage new file mode 100755 index 0000000..b129fc9 --- /dev/null +++ b/.local/bin/statusbar/disk_usage @@ -0,0 +1,123 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# MIT License + +# Copyright (c) 2017 Christian Schläppi + +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: + +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +import os +import sys +import subprocess + + +def get_disk_stats(mp): + stat = os.statvfs(mp) + + total = stat.f_blocks * stat.f_frsize / 1024 ** 3 + avail = stat.f_bavail * stat.f_frsize / 1024 ** 3 + used = total - avail + + return { + 'avail': avail, + 'total': total, + 'used': used, + 'perc_used': 100 * used / total + } + + +def launch_ncdu(mp): + cmd = [ + '/usr/bin/sakura', + '-t', + 'pop-up', + '-e', + '/usr/bin/ncdu %s' % mp, + '-x', + ] + + subprocess.Popen( + cmd, + stdout=open(os.devnull, 'w'), + stderr=subprocess.STDOUT + ) + + +def parse_args(): + args = { + 'warn_threshold': 80, + 'crit_threshold': 90, + 'warn_color': '#d6af4e', + 'crit_color': '#d64e4e', + 'format': '{used:.1f}G/{total:.1f}G ({perc_used:.1f}%) - {avail:.1f}G' + } + + try: + for arg in sys.argv[1:]: + key, value = arg.split('=') + args[key] = int(value) if value.isdigit() else value + except (KeyError, ValueError): + # ValuError in case user does something weird + pass + + return args + + +def get_instance(): + p = os.getenv('BLOCK_INSTANCE') + if p and os.path.exists(p): + return p + + return os.getenv('HOME') + + +def main(): + + output_color = '' + args = parse_args() + m_point = get_instance() + stats = get_disk_stats(m_point) + + # get some more info when not called by i3blocks + if not os.getenv('BLOCK_NAME'): + print('Args: %s' % args) + print('Stats: %s' % stats) + print('Mount Point: %s' % m_point) + + # print stats with format if given + print(args['format'].format(**stats)) + print() + + # determine color + if args['crit_threshold'] > int(stats['perc_used']) >= args['warn_threshold']: + output_color = args['warn_color'] + elif stats['perc_used'] >= args['crit_threshold']: + output_color = args['crit_color'] + + print(output_color) + + # handle click-event + _button = os.getenv('BLOCK_BUTTON') + if _button and int(_button) == 1: + launch_ncdu(m_point) + + +if __name__ == '__main__': + main() diff --git a/.local/bin/statusbar/i3weather b/.local/bin/statusbar/i3weather index 2d34149..d008deb 100755 --- a/.local/bin/statusbar/i3weather +++ b/.local/bin/statusbar/i3weather @@ -1,5 +1,6 @@ #!/bin/sh -# i3block for displaying the current temperature, humidity and precipitation, if wttr.in i unavailable then WEATHER UNAVAILABLE will be displayed +# weather module for i3blocks +# output is set to 'WEATHER UNAVAILABLE' in case wttr.in is unreachable case "$BLOCK_BUTTON" in '') ;; |