├── zsh ├── .zprofile ├── .zsh │ └── pack │ │ └── bundle │ │ └── start │ │ ├── cdls.plugin.zsh │ │ ├── dotenv.plugin.zsh │ │ └── passenv.plugin.zsh ├── .profile └── .zshrc ├── keyd ├── .config │ └── keyd │ │ ├── app.lock │ │ └── app.conf ├── .stow-local-ignore └── default.conf ├── nvim └── .config │ └── nvim │ ├── .styluaignore │ ├── after │ ├── ftplugin │ │ ├── typescript.lua │ │ ├── json.lua │ │ ├── xml.lua │ │ ├── markdown.vim │ │ ├── lua.lua │ │ ├── java.lua │ │ ├── python.lua │ │ ├── javascript.lua │ │ └── cs.lua │ └── lsp │ │ ├── lua_ls.lua │ │ ├── vtsls.lua │ │ ├── pylance.lua │ │ └── jdtls.lua │ ├── .luarc.json │ ├── lua │ └── config │ │ ├── registry │ │ ├── init.lua │ │ └── pylance.lua │ │ ├── dap │ │ └── terminal.lua │ │ ├── myplugins.lua │ │ ├── utils.lua │ │ ├── icons.lua │ │ ├── copilot_extensions.lua │ │ ├── treesitter.lua │ │ ├── languages.lua │ │ ├── dap.lua │ │ ├── mason.lua │ │ ├── statuscolumn.lua │ │ ├── finder.lua │ │ ├── copilot.lua │ │ ├── ui.lua │ │ ├── git.lua │ │ └── lsp.lua │ ├── .stylua.toml │ └── init.lua ├── qutebrowser ├── .qutebrowser └── .config │ └── qutebrowser │ └── greasemonkey │ ├── objecthasown.js │ ├── reddit.js │ ├── youtube.js │ └── cookie-skip.js ├── scripts ├── .stow-local-ignore ├── update.sh ├── install-intel.sh ├── install-gamedev.sh ├── install-nvidia.sh ├── install-wayland.sh ├── install-asus.sh ├── install-devel.sh ├── generate-menu.py ├── install-desktop.sh ├── install-av.sh ├── install-core.sh └── install.sh ├── screenshot.png ├── cava └── .config │ └── cava │ └── config ├── git ├── .stow-local-ignore ├── .gitignore ├── .gitmessage └── .gitconfig ├── foot └── .config │ └── foot │ └── foot.ini ├── hyprland └── .wallpaper ├── tmux ├── .tmux │ ├── pack │ │ └── bundle │ │ │ └── start │ │ │ └── tmux.nvim │ └── switch-session.sh └── .tmux.conf ├── dunst └── .config │ └── dunst │ ├── alert.wav │ ├── alert.sh │ └── dunstrc ├── yay └── .config │ └── yay │ └── config.json ├── gnupg └── .gnupg │ └── gpg-agent.conf ├── cmdenv └── .config │ └── cmdenv │ └── krita.sh ├── x11 └── .Xresources ├── bin └── .local │ └── bin │ ├── hyprexpo │ ├── terminal │ ├── systest │ ├── previewwindow │ ├── menu-clip │ ├── menu-steam │ ├── menu-actions │ ├── menu-pass │ ├── overlay │ ├── menu-run │ ├── menu-notifications │ ├── screenrecorder │ ├── menu-proc │ ├── suspend-until │ ├── start-wm │ ├── start-steam │ ├── git-branch-cleanup │ ├── menu-actions.conf │ ├── menu-qutebrowser │ ├── menu-yay │ ├── menu-switch │ ├── poenotifier │ └── fzfmenu ├── gammastep └── .config │ └── gammastep │ └── config.ini ├── ssh └── .ssh │ └── config ├── .gitignore ├── tridactyl └── .config │ └── tridactyl │ ├── tridactylrc │ └── themes │ └── solarized.css ├── editorconfig └── .editorconfig ├── mpv └── .config │ └── mpv │ ├── mpv.conf │ ├── shaders │ ├── Anime4K_AutoDownscalePre_x2.glsl │ ├── Anime4K_AutoDownscalePre_x4.glsl │ ├── Anime4K_Denoise_Bilateral_Mean.glsl │ ├── Anime4K_Clamp_Highlights.glsl │ ├── Anime4K_Denoise_Bilateral_Mode.glsl │ ├── Anime4K_Upscale_DoG_x2.glsl │ ├── Anime4K_Denoise_Bilateral_Median.glsl │ ├── Anime4K_Deblur_DoG.glsl │ ├── Anime4K_Upscale_Deblur_DoG_x2.glsl │ ├── Anime4K_Darken_HQ.glsl │ └── Anime4K_Thin_HQ.glsl │ └── input.conf ├── quickshell └── .config │ └── quickshell │ └── bar │ ├── ClockWidget.qml │ ├── BrightnessWidget.qml │ ├── BatteryWidget.qml │ ├── MemoryWidget.qml │ ├── GpuWidget.qml │ ├── CpuWidget.qml │ ├── shell.qml │ ├── VolumeWidget.qml │ ├── Theme.qml │ ├── NetworkWidget.qml │ ├── NotificationsWidget.qml │ └── TopLevelWidget.qml ├── mcphub └── .config │ └── mcphub │ └── servers.json ├── fontconfig └── .config │ └── fontconfig │ └── fonts.conf ├── starship └── .config │ └── starship.toml ├── LICENSE ├── k9s └── .config │ └── k9s │ └── plugins.yaml ├── Makefile ├── readline └── .inputrc ├── README.md ├── vim └── .vimrc └── .gitmodules /zsh/.zprofile: -------------------------------------------------------------------------------- 1 | .profile -------------------------------------------------------------------------------- /keyd/.config/keyd/app.lock: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /keyd/.stow-local-ignore: -------------------------------------------------------------------------------- 1 | .*\.conf 2 | -------------------------------------------------------------------------------- /nvim/.config/nvim/.styluaignore: -------------------------------------------------------------------------------- 1 | pack 2 | -------------------------------------------------------------------------------- /qutebrowser/.qutebrowser: -------------------------------------------------------------------------------- 1 | .config/qutebrowser -------------------------------------------------------------------------------- /scripts/.stow-local-ignore: -------------------------------------------------------------------------------- 1 | .*\.conf 2 | -------------------------------------------------------------------------------- /nvim/.config/nvim/after/ftplugin/typescript.lua: -------------------------------------------------------------------------------- 1 | javascript.lua -------------------------------------------------------------------------------- /nvim/.config/nvim/after/ftplugin/json.lua: -------------------------------------------------------------------------------- 1 | vim.opt_local.formatprg = 'jq .' 2 | -------------------------------------------------------------------------------- /screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deathbeam/dotfiles/HEAD/screenshot.png -------------------------------------------------------------------------------- /cava/.config/cava/config: -------------------------------------------------------------------------------- 1 | [color] 2 | background = default 3 | foreground = '#002b36' 4 | -------------------------------------------------------------------------------- /git/.stow-local-ignore: -------------------------------------------------------------------------------- 1 | # This needs to be here, otherwise .gitignore will be ignored 2 | -------------------------------------------------------------------------------- /foot/.config/foot/foot.ini: -------------------------------------------------------------------------------- 1 | font=monospace:size=12 2 | 3 | [colors] 4 | background=002b36 5 | -------------------------------------------------------------------------------- /hyprland/.wallpaper: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deathbeam/dotfiles/HEAD/hyprland/.wallpaper -------------------------------------------------------------------------------- /nvim/.config/nvim/after/ftplugin/xml.lua: -------------------------------------------------------------------------------- 1 | vim.opt_local.formatprg = 'xmllint --format -' 2 | -------------------------------------------------------------------------------- /tmux/.tmux/pack/bundle/start/tmux.nvim: -------------------------------------------------------------------------------- 1 | ../../../../../nvim/.config/nvim/pack/bundle/start/tmux.nvim -------------------------------------------------------------------------------- /nvim/.config/nvim/.luarc.json: -------------------------------------------------------------------------------- 1 | { 2 | "diagnostics.disable": [ 3 | "missing-fields" 4 | ] 5 | } -------------------------------------------------------------------------------- /dunst/.config/dunst/alert.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deathbeam/dotfiles/HEAD/dunst/.config/dunst/alert.wav -------------------------------------------------------------------------------- /keyd/.config/keyd/app.conf: -------------------------------------------------------------------------------- 1 | [pathofexilesteam.exe] 2 | BTN_WHEEL_DOWN = BTN_LEFT 3 | BTN_WHEEL_UP = BTN_RIGHT 4 | -------------------------------------------------------------------------------- /nvim/.config/nvim/lua/config/registry/init.lua: -------------------------------------------------------------------------------- 1 | return { 2 | pylance = 'config.registry.pylance', 3 | } 4 | -------------------------------------------------------------------------------- /yay/.config/yay/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "removemake": "yes", 3 | "devel": true, 4 | "combinedupgrade": true 5 | } 6 | -------------------------------------------------------------------------------- /scripts/update.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/bash -l 2 | set -e 3 | shopt -s nullglob globstar 4 | 5 | arch-update 6 | hyprpm update 7 | -------------------------------------------------------------------------------- /dunst/.config/dunst/alert.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" 3 | aplay "$DIR/alert.wav" 4 | 5 | -------------------------------------------------------------------------------- /gnupg/.gnupg/gpg-agent.conf: -------------------------------------------------------------------------------- 1 | max-cache-ttl 60480000 2 | default-cache-ttl 60480000 3 | pinentry-program /usr/bin/pinentry 4 | # enable-ssh-support 5 | -------------------------------------------------------------------------------- /cmdenv/.config/cmdenv/krita.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Launch krita with custom scale factor as it goes through X11 4 | env QT_SCALE_FACTOR=$SCALE_FACTOR $1 5 | -------------------------------------------------------------------------------- /x11/.Xresources: -------------------------------------------------------------------------------- 1 | Xft.dpi: ${DPI} 2 | Xft.autohint: 0 3 | Xft.lcdfilter: lcddefault 4 | Xft.hintstyle: hintfull 5 | Xft.hinting: 1 6 | Xft.antialias: 1 7 | Xft.rgba: rgb 8 | -------------------------------------------------------------------------------- /scripts/install-intel.sh: -------------------------------------------------------------------------------- 1 | log "Installing Intel packages" 2 | packages=( 3 | vulkan-intel 4 | lib32-vulkan-intel 5 | thermald-git 6 | ) 7 | install_pkgs "${packages[@]}" 8 | -------------------------------------------------------------------------------- /nvim/.config/nvim/.stylua.toml: -------------------------------------------------------------------------------- 1 | column_width = 120 2 | line_endings = "Unix" 3 | indent_type = "Spaces" 4 | indent_width = 4 5 | quote_style = "AutoPreferSingle" 6 | call_parentheses = "Always" 7 | -------------------------------------------------------------------------------- /bin/.local/bin/hyprexpo: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | if [ "$(hyprctl activewindow -j | jq '.fullscreen')" != "0" ]; then 4 | hyprctl dispatch fullscreen; 5 | fi 6 | 7 | hyprctl dispatch hyprexpo:expo toggle 8 | -------------------------------------------------------------------------------- /bin/.local/bin/terminal: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | exec $TERMINAL -e $SHELL -ic "tmux new-session -A -s default" 4 | # exec $TERMINAL -e $SHELL -ic "dtach -A /tmp/dtach-default -r winch $SHELL -c 'cd ~; exec $SHELL'" 5 | -------------------------------------------------------------------------------- /nvim/.config/nvim/after/ftplugin/markdown.vim: -------------------------------------------------------------------------------- 1 | setlocal wrap 2 | setlocal linebreak 3 | setlocal conceallevel=2 4 | setlocal tabstop=2 shiftwidth=2 expandtab 5 | setlocal formatoptions+=t 6 | setlocal textwidth=80 7 | -------------------------------------------------------------------------------- /zsh/.zsh/pack/bundle/start/cdls.plugin.zsh: -------------------------------------------------------------------------------- 1 | _cdls_chpwd_handler () { 2 | emulate -L zsh 3 | ls -A --color=always 4 | } 5 | 6 | autoload -U add-zsh-hook 7 | add-zsh-hook chpwd _cdls_chpwd_handler 8 | _cdls_chpwd_handler 9 | -------------------------------------------------------------------------------- /bin/.local/bin/systest: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | echo "Vulkan GPU Info" 4 | vulkaninfo | grep -i "version" 5 | 6 | echo "GLX Info" 7 | glxinfo | grep -i "renderer" 8 | 9 | echo "VAAPI Info" 10 | vainfo | grep -i "version" 11 | -------------------------------------------------------------------------------- /scripts/install-gamedev.sh: -------------------------------------------------------------------------------- 1 | log "Installing gamedev packages" 2 | packages=( 3 | aseprite 4 | magicavoxel 5 | godot-git 6 | python-gdtoolkit 7 | trenchbroom-bin 8 | qt5-svg 9 | ) 10 | install_pkgs "${packages[@]}" 11 | -------------------------------------------------------------------------------- /gammastep/.config/gammastep/config.ini: -------------------------------------------------------------------------------- 1 | [general] 2 | temp-day=6000 3 | temp-night=4000 4 | fade=0 5 | brightness-day=1 6 | brightness-night=0.9 7 | gamma-day=1 8 | gamma-night=0.8 9 | location-provider=geoclue2 10 | dawn-time=06:30-07:30 11 | dusk-time=18:30-19:30 12 | -------------------------------------------------------------------------------- /zsh/.zsh/pack/bundle/start/dotenv.plugin.zsh: -------------------------------------------------------------------------------- 1 | _source_env() { 2 | if [[ ! -f ".env" ]]; then 3 | return 4 | fi 5 | 6 | setopt localoptions allexport 7 | source .env 8 | } 9 | 10 | autoload -U add-zsh-hook 11 | add-zsh-hook chpwd _source_env 12 | _source_env 13 | -------------------------------------------------------------------------------- /keyd/default.conf: -------------------------------------------------------------------------------- 1 | [ids] 2 | 3 | * 4 | 5 | [main] 6 | 7 | # Maps capslock to escape when pressed and control when held. 8 | capslock = overload(control, esc) 9 | 10 | # Disable escape and control keys to force using capslock instead 11 | # esc = noop 12 | # leftcontrol = noop 13 | -------------------------------------------------------------------------------- /bin/.local/bin/previewwindow: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | sock="$1" 3 | addr="$2" 4 | path="/tmp/window_preview_${addr}.png" 5 | 6 | if [ ! -f "$path" ]; then 7 | grim -t png -w "$addr" "$path" 8 | fi 9 | 10 | echo '{ "command": ["loadfile", "'"$path"'", "replace"] }' | socat - "$sock" >/dev/null 2>&1 11 | -------------------------------------------------------------------------------- /nvim/.config/nvim/lua/config/dap/terminal.lua: -------------------------------------------------------------------------------- 1 | return require('dap.ui').new_view(function() 2 | return vim.api.nvim_create_buf(false, true) 3 | end, function(buf) 4 | vim.cmd('split') 5 | local win = vim.api.nvim_get_current_win() 6 | vim.api.nvim_win_set_buf(win, buf) 7 | return win 8 | end) 9 | -------------------------------------------------------------------------------- /qutebrowser/.config/qutebrowser/greasemonkey/objecthasown.js: -------------------------------------------------------------------------------- 1 | // ==UserScript== 2 | // @name Object.hasOwn Polyfill 3 | // @match *://*/* 4 | // ==/UserScript== 5 | 6 | (function () { 7 | 'use strict'; 8 | ('hasOwn' in Object) || (Object.hasOwn = Object.call.bind(Object.hasOwnProperty)); 9 | })(); 10 | -------------------------------------------------------------------------------- /ssh/.ssh/config: -------------------------------------------------------------------------------- 1 | # Host * 2 | # AddKeysToAgent no 3 | # ServerAliveInterval 60 4 | # HostkeyAlgorithms +ssh-rsa 5 | # PubkeyAcceptedAlgorithms +ssh-rsa 6 | # IPQoS none 7 | # StrictHostKeyChecking no 8 | # UserKnownHostsFile /dev/null 9 | # 10 | 11 | Host github.com 12 | Hostname ssh.github.com 13 | Port 443 14 | -------------------------------------------------------------------------------- /bin/.local/bin/menu-clip: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | scriptpath=$(dirname "$(readlink -f "$0")") 3 | 4 | chosen_line=$(cliphist list \ 5 | | $scriptpath/fzfmenu "$@" \ 6 | --with-nth=2.. \ 7 | --preview="echo {} | cliphist decode" \ 8 | --preview-window=right:40%) 9 | 10 | [[ $chosen_line ]] || exit 1 11 | echo "$chosen_line" | cliphist decode | wl-copy 12 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.log 2 | /nvim/.config/nvim/pack/local/start 3 | /tmux/.tmux/pack/local/start 4 | /zsh/.zsh/pac/local/start 5 | /vim/.vim/undodir/ 6 | /tmux/.tmux/resurrect/ 7 | /qutebrowser/.config/qutebrowser/qsettings/ 8 | /qutebrowser/.config/qutebrowser/bookmarks/ 9 | /qutebrowser/.config/qutebrowser/autoconfig.yml 10 | /qutebrowser/.config/qutebrowser/quickmarks 11 | /mpv/.config/mpv/script-opts 12 | dotfyle-metadata.nvim 13 | -------------------------------------------------------------------------------- /bin/.local/bin/menu-steam: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | shopt -s nullglob globstar 3 | scriptpath=$(dirname "$(readlink -f "$0")") 4 | 5 | games="$(for file in ~/.steam/steam/steamapps/*.acf; do 6 | echo "$(grep -oP '"appid"\s+"\K\d+' "$file"): $(grep -oP '"name"\s+"\K[^"]+' "$file")" 7 | done)" 8 | 9 | appid=$(echo "$games" | \ 10 | $scriptpath/fzfmenu "$@" \ 11 | --with-nth=2.. \ 12 | | grep -oP '^\d+') 13 | 14 | [[ -n $appid ]] || exit 1 15 | exec steam -silent -applaunch "$appid" 16 | -------------------------------------------------------------------------------- /tridactyl/.config/tridactyl/tridactylrc: -------------------------------------------------------------------------------- 1 | " For syntax highlighting see https://github.com/tridactyl/vim-tridactyl 2 | " vim: set filetype=tridactyl 3 | 4 | " Disable GUI 5 | " guiset gui none 6 | 7 | " General Settings 8 | set configversion 2.0 9 | set theme solarized 10 | set allowautofocus false 11 | set incsearch true 12 | set modeindicatorshowkeys true 13 | 14 | " Swap J and K because of vertical tabs 15 | bind J tabnext 16 | bind K tabprev 17 | 18 | " Stuff 19 | set editorcmd $TERMINAL -e nvim 20 | -------------------------------------------------------------------------------- /scripts/install-nvidia.sh: -------------------------------------------------------------------------------- 1 | log "Installing Nvidia packages" 2 | packages=( 3 | dkms 4 | nvidia-open-dkms 5 | nvidia-settings 6 | nvidia-utils 7 | lib32-nvidia-utils 8 | opencl-nvidia 9 | lib32-opencl-nvidia 10 | libva-nvidia-driver 11 | nvidia-container-toolkit 12 | ) 13 | install_pkgs "${packages[@]}" 14 | 15 | log "Enabling Nvidia services" 16 | services=( 17 | nvidia-suspend 18 | nvidia-hibernate 19 | nvidia-resume 20 | nvidia-powerd 21 | ) 22 | enable_services "${services[@]}" 23 | -------------------------------------------------------------------------------- /bin/.local/bin/menu-actions: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | scriptpath=$(dirname "$(readlink -f "$0")") 3 | config="$scriptpath/menu-actions.conf" 4 | 5 | declare -A shortcuts 6 | while IFS=: read -r name cmd; do 7 | [[ -n "$name" && -n "$cmd" ]] && shortcuts["$name"]="$cmd" 8 | done < "$config" 9 | 10 | if [[ -n "$1" && -n "${shortcuts[$1]}" ]]; then 11 | eval "${shortcuts[$1]}" 12 | exit 13 | fi 14 | 15 | choice=$(printf "%s\n" "${!shortcuts[@]}" | $scriptpath/fzfmenu "$@") 16 | [[ -n "$choice" ]] && eval "${shortcuts[$choice]}" 17 | -------------------------------------------------------------------------------- /editorconfig/.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | indent_style = space 6 | indent_size = 4 7 | end_of_line = lf 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | max_line_length = 120 11 | 12 | [*.{js,jsx,ts,tsx,yml,yaml,json,nim}] 13 | indent_size = 2 14 | 15 | [*.lua] 16 | trim_trailing_whitespace = false 17 | 18 | [Makefile] 19 | indent_style = tab 20 | indent_size = 8 21 | 22 | [*.md] 23 | max_line_length = 0 24 | trim_trailing_whitespace = false 25 | 26 | [COMMIT_EDITMSG] 27 | max_line_length = 0 28 | -------------------------------------------------------------------------------- /bin/.local/bin/menu-pass: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | shopt -s nullglob globstar 3 | scriptpath=$(dirname "$(readlink -f "$0")") 4 | 5 | prefix=${PASSWORD_STORE_DIR-~/.password-store} 6 | password_files=( "$prefix"/**/*.gpg ) 7 | password_files=( "${password_files[@]#"$prefix"/}" ) 8 | password_files=( "${password_files[@]%.gpg}" ) 9 | 10 | password=$(printf '%s\n' "${password_files[@]}" | $scriptpath/fzfmenu "$@") 11 | 12 | [[ -n $password ]] || exit 1 13 | 14 | if [[ "$password" == OTP/* ]]; then 15 | exec pass otp -c "$password" 16 | else 17 | exec pass show -c "$password" 18 | fi 19 | -------------------------------------------------------------------------------- /bin/.local/bin/overlay: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | TITLE="Overlay" 4 | CLASS="overlay" 5 | TERM_CLASS="--class" 6 | if [ "$TERMINAL" = "st" ]; then 7 | TERM_CLASS="-n" 8 | elif [ "$TERMINAL" = "foot" ] || [ "$TERMINAL" = "footclient" ]; then 9 | TERM_CLASS="-a" 10 | fi 11 | 12 | while [ $# -gt 0 ]; do 13 | case "$1" in 14 | -t|--title) 15 | TITLE="$2" 16 | shift 2 17 | ;; 18 | *) 19 | CMD="$*" 20 | break 21 | ;; 22 | esac 23 | done 24 | 25 | exec $TERMINAL $TERM_CLASS $CLASS -T "$TITLE" -e "$SHELL" -ic "$CMD" 26 | -------------------------------------------------------------------------------- /qutebrowser/.config/qutebrowser/greasemonkey/reddit.js: -------------------------------------------------------------------------------- 1 | // ==UserScript== 2 | // @name Reddit Enhancements 3 | // @match *://*.reddit.com/* 4 | // ==/UserScript== 5 | 6 | (function() { 7 | 'use strict'; 8 | 9 | function removePromoted() { 10 | document.querySelectorAll('[data-promoted="true"], .promoted').forEach(el => el.remove()); 11 | } 12 | 13 | function observer() { 14 | removePromoted(); 15 | } 16 | 17 | window.addEventListener('load', observer); 18 | new MutationObserver(observer).observe(document.body, { childList: true, subtree: true }); 19 | })(); 20 | -------------------------------------------------------------------------------- /bin/.local/bin/menu-run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | scriptpath=$(dirname "$(readlink -f "$0")") 3 | 4 | selected_cmd=$( 5 | echo -n "$PATH" \ 6 | | xargs -d: -I{} -r -- find -L {} -maxdepth 1 -mindepth 1 -type f -executable -printf '%P\n' 2>/dev/null \ 7 | | sort -u \ 8 | | $scriptpath/fzfmenu "$@" \ 9 | --preview="which {}" \ 10 | --preview-window=down,1 11 | ) 12 | 13 | if [ -n "$selected_cmd" ]; then 14 | if [ -f "$HOME/.config/cmdenv/${selected_cmd}.sh" ]; then 15 | exec sh "$HOME/.config/cmdenv/${selected_cmd}.sh" "$selected_cmd" 16 | else 17 | exec "$selected_cmd" 18 | fi 19 | fi 20 | -------------------------------------------------------------------------------- /nvim/.config/nvim/after/ftplugin/lua.lua: -------------------------------------------------------------------------------- 1 | local dap = require('dap') 2 | 3 | dap.adapters['local-lua'] = { 4 | type = 'executable', 5 | command = 'local-lua-dbg', 6 | } 7 | 8 | dap.configurations.lua = { 9 | { 10 | type = 'local-lua', 11 | request = 'attach', 12 | name = 'Attach to remote', 13 | connect = function() 14 | local host = vim.fn.input('Host [127.0.0.1]: ') 15 | host = host ~= '' and host or '127.0.0.1' 16 | local port = tonumber(vim.fn.input('Port [9966]: ')) or 9966 17 | return { host = host, port = port } 18 | end, 19 | }, 20 | } 21 | -------------------------------------------------------------------------------- /bin/.local/bin/menu-notifications: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | scriptpath=$(dirname "$(readlink -f "$0")") 3 | 4 | notifications="$(dunstctl history | jq -r '.data[] | .[] | [.id.data, .appname.data, .summary.data, (.body.data | @base64)] | join("|")')" 5 | notification=$(echo "$notifications" | awk -F'|' '{print $0 "|" $2 ": " $3}' \ 6 | | $scriptpath/fzfmenu "$@" \ 7 | --delimiter='|' \ 8 | --with-nth=5 \ 9 | --preview="echo {4} | base64 -d | fold -s -w \$COLUMNS" \ 10 | --preview-window=down,5,wrap \ 11 | --tiebreak=index \ 12 | | cut -d'|' -f1) 13 | 14 | [[ -n $notification ]] || exit 1 15 | dunstctl history-pop "$notification" 2>/dev/null 16 | -------------------------------------------------------------------------------- /bin/.local/bin/screenrecorder: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | current_date=$(date +"%Y-%m-%d_%H-%M-%S") 4 | output_dir="$HOME/Videos/Record/" 5 | 6 | # Check if gpu-screen-recorder is running 7 | if pgrep -f "gpu-screen-recorder" > /dev/null 8 | then 9 | # If running, stop the recording 10 | pkill -SIGINT -f gpu-screen-recorder 11 | sleep 1 12 | notify-send "Screen Recording" "Recording stopped." 13 | else 14 | # If not running, start the recording 15 | notify-send "Screen Recording" "Recording started." 16 | sleep 1 17 | gpu-screen-recorder -w portal -a default_output -f 60 -q high -cr full -o "${output_dir}/${current_date}.mp4" 18 | fi 19 | -------------------------------------------------------------------------------- /bin/.local/bin/menu-proc: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | scriptpath=$(dirname "$(readlink -f "$0")") 3 | 4 | processes="$( 5 | ps -eo %cpu,%mem,pid,user,cmd | { 6 | head -n 1 7 | tail -n +2 \ 8 | | grep -v procmenu \ 9 | | grep -v 'ps -eo' \ 10 | | awk '{print $1+$2, $0}' \ 11 | | sort -k 1 -n -r \ 12 | | cut -d ' ' -f 2- 13 | } 14 | )" 15 | process=$(echo "$processes" \ 16 | | $scriptpath/fzfmenu "$@" \ 17 | --header-lines=1 \ 18 | --preview="echo {} | tr -s ' ' | cut -d ' ' -f 6-" \ 19 | --preview-window=down,3,wrap \ 20 | | awk '{print $3}') 21 | 22 | [[ -n $process ]] || exit 1 23 | kill -9 "$process" &>/dev/null 24 | -------------------------------------------------------------------------------- /bin/.local/bin/suspend-until: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ $# -lt 1 ]; then 4 | echo "Usage: suspend_until HH:MM" 5 | exit 1 6 | fi 7 | 8 | # Determine the desired wakeup time 9 | DESIRED=$(date +%s -d "$1") 10 | NOW=$(date +%s) 11 | if [ $DESIRED -lt $NOW ]; then 12 | DESIRED=$(($DESIRED + 24*60*60)) 13 | fi 14 | 15 | # Set RTC wakeup time 16 | sudo sh -c "echo 0 > /sys/class/rtc/rtc0/wakealarm" 17 | sudo sh -c "echo $DESIRED > /sys/class/rtc/rtc0/wakealarm" 18 | 19 | # Suspend the system 20 | sudo systemctl suspend 21 | 22 | # Wait a bit 23 | sleep 5 24 | 25 | # Play sound 26 | amixer -q set Master 100% on 27 | ffplay -loop 0 -volume 100 -nodisp "$HOME/.alarm" 28 | -------------------------------------------------------------------------------- /scripts/install-wayland.sh: -------------------------------------------------------------------------------- 1 | log "Installing Wayland packages" 2 | packages=( 3 | xorg-xwayland 4 | xclip 5 | qt5-wayland 6 | qt6-wayland 7 | hyprland 8 | hyprpolkitagent 9 | xdg-desktop-portal-hyprland 10 | swaybg 11 | swaylock 12 | wl-clipboard 13 | cliphist 14 | cpio 15 | foot 16 | slurp 17 | grim-hyprland-git 18 | quickshell-git 19 | ) 20 | install_pkgs "${packages[@]}" 21 | 22 | log "Configuring Hyprland" 23 | services=( 24 | hyprpolkitagent 25 | ) 26 | enable_user_services "${services[@]}" 27 | 28 | hyprpm update 29 | hyprpm add https://github.com/hyprwm/hyprland-plugins || true 30 | hyprpm enable hyprwinwrap 31 | -------------------------------------------------------------------------------- /scripts/install-asus.sh: -------------------------------------------------------------------------------- 1 | log "Setting up g14 repository" 2 | append_config '[g14]' /etc/pacman.conf 3 | append_config 'Server = https://arch.asus-linux.org' /etc/pacman.conf 4 | sudo pacman-key --recv-keys 8F654886F17D497FEFE3DB448B15A6B0E9A3FA35 5 | sudo pacman-key --finger 8F654886F17D497FEFE3DB448B15A6B0E9A3FA35 6 | sudo pacman-key --lsign-key 8F654886F17D497FEFE3DB448B15A6B0E9A3FA35 7 | sudo pacman-key --finger 8F654887F17D497FEFE3DB448B15A6B0E9A3FA35 8 | 9 | log 'Installing Asus packages' 10 | packages=( 11 | asusctl 12 | rog-control-center 13 | ) 14 | install_pkgs "${packages[@]}" 15 | 16 | log 'Enabling Asus services' 17 | services=( 18 | asusd 19 | ) 20 | enable_services "${services[@]}" 21 | -------------------------------------------------------------------------------- /bin/.local/bin/start-wm: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Check nvidia stuff 4 | if lspci | grep -q 'NVIDIA'; then 5 | echo "NVIDIA GPU detected, setting NVIDIA-specific environment variables" 6 | export NVD_BACKEND="direct" 7 | export LIBVA_DRIVER_NAME="nvidia" 8 | export PROTON_ENABLE_NGX_UPDATER=1 9 | export GBM_BACKEND="nvidia-drm" 10 | export __GL_GSYNC_ALLOWED=1 11 | export __GL_VRR_ALLOWED=1 12 | export __GL_MaxFramesAllowed=1 13 | export __NV_PRIME_RENDER_OFFLOAD=1 14 | export __GLX_VENDOR_LIBRARY_NAME="nvidia" 15 | export __VK_LAYER_NV_optimus="NVIDIA_only" 16 | fi 17 | 18 | # Launch compositor 19 | if command -v Hyprland &> /dev/null; then 20 | exec Hyprland 21 | else 22 | exit 1 23 | fi 24 | -------------------------------------------------------------------------------- /nvim/.config/nvim/init.lua: -------------------------------------------------------------------------------- 1 | -- Load existing vimrc 2 | vim.cmd([[ 3 | set runtimepath^=~/.vim runtimepath+=~/.vim/after 4 | let &packpath = &runtimepath 5 | source ~/.vimrc 6 | ]]) 7 | 8 | local function r(module) 9 | local status_ok, loaded_module = pcall(require, module) 10 | if not status_ok then 11 | vim.notify('Error loading ' .. module, vim.log.levels.ERROR) 12 | vim.notify(loaded_module, vim.log.levels.ERROR) 13 | end 14 | return loaded_module 15 | end 16 | 17 | r('config.myplugins') 18 | r('config.mason') 19 | r('config.ui') 20 | r('config.finder') 21 | r('config.treesitter') 22 | r('config.lsp') 23 | r('config.dap') 24 | r('config.git') 25 | r('config.copilot') 26 | r('config.statuscolumn') 27 | -------------------------------------------------------------------------------- /mpv/.config/mpv/mpv.conf: -------------------------------------------------------------------------------- 1 | # Rendering 2 | hwdec=auto 3 | profile=high-quality 4 | vo=gpu-next 5 | gpu-api=vulkan 6 | 7 | # Debanding 8 | deband=yes 9 | deband-range=64 10 | 11 | # Sub 12 | sub-auto=fuzzy 13 | demuxer-mkv-subtitle-preroll=yes 14 | 15 | # Audio 16 | audio-file-auto=fuzzy 17 | 18 | # Cache 19 | cache=yes 20 | cache-secs=300 21 | demuxer-max-bytes=1800M 22 | 23 | # YTDL 24 | ytdl-raw-options=cookies=~/.config/mpv/cookies.txt,mark-watched= 25 | 26 | # Anime4K 27 | # glsl-shaders="~~/shaders/Anime4K_Clamp_Highlights.glsl:~~/shaders/Anime4K_Restore_CNN_VL.glsl:~~/shaders/Anime4K_Upscale_CNN_x2_VL.glsl:~~/shaders/Anime4K_AutoDownscalePre_x2.glsl:~~/shaders/Anime4K_AutoDownscalePre_x4.glsl:~~/shaders/Anime4K_Upscale_CNN_x2_M.glsl" 28 | -------------------------------------------------------------------------------- /zsh/.zsh/pack/bundle/start/passenv.plugin.zsh: -------------------------------------------------------------------------------- 1 | CACHE_FILE="$HOME/.cache/pass_env" 2 | CACHE_AGE_MIN=60 3 | 4 | # Refresh cache if missing or older than CACHE_AGE_MIN 5 | if [ ! -f "$CACHE_FILE" ] || [ "$(find "$CACHE_FILE" -mmin +$CACHE_AGE_MIN)" ]; then 6 | print -n > "$CACHE_FILE" 7 | 8 | prefix=${PASSWORD_STORE_DIR-~/.password-store} 9 | password_files=( "$prefix"/Env/**/*.gpg ) 10 | password_files=( "${password_files[@]#"$prefix"/}" ) 11 | password_files=( "${password_files[@]%.gpg}" ) 12 | for password_file in "${password_files[@]}"; do 13 | varname=$(basename "$password_file") 14 | value="$(pass "$password_file")" 15 | print -r -- "export $varname='$value'" >> "$CACHE_FILE" 16 | done 17 | fi 18 | 19 | # Source cached exports 20 | source "$CACHE_FILE" 21 | -------------------------------------------------------------------------------- /bin/.local/bin/start-steam: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | if ! command -v gamescope >/dev/null 2>&1; then 5 | echo "gamescope not found!" >&2; exit 1 6 | fi 7 | if ! command -v steam >/dev/null 2>&1; then 8 | echo "steam not found!" >&2; exit 1 9 | fi 10 | 11 | if command -v hyprctl >/dev/null 2>&1; then 12 | WIDTH=$(hyprctl monitors -j | jq -r '.[0].width') 13 | HEIGHT=$(hyprctl monitors -j | jq -r '.[0].height') 14 | else 15 | WIDTH=2560 16 | HEIGHT=1600 17 | fi 18 | 19 | # --force-grab-cursor makes cursor slow 20 | echo "Starting Steam in gamescope with resolution ${WIDTH}x${HEIGHT}..." 21 | VKD3D_DISABLE_EXTENSIONS=VK_KHR_present_wait GAMESCOPE_WSI=0 gamescope -W "$WIDTH" -H "$HEIGHT" --backend sdl --hdr-enabled --immediate-flips --adaptive-sync -f --rt -e -- steam -tenfoot 22 | -------------------------------------------------------------------------------- /quickshell/.config/quickshell/bar/ClockWidget.qml: -------------------------------------------------------------------------------- 1 | import Quickshell 2 | import QtQuick 3 | 4 | Text { 5 | property string dateStr: "" 6 | property string timeStr: "" 7 | 8 | text: Theme.iconClock + " " + dateStr + " " + timeStr 9 | color: Theme.colorFg 10 | font.family: Theme.fontFamily 11 | font.pixelSize: Theme.fontSize 12 | leftPadding: Theme.margin 13 | rightPadding: Theme.margin 14 | 15 | Timer { 16 | interval: 1000 17 | running: true 18 | repeat: true 19 | triggeredOnStart: true 20 | 21 | onTriggered: { 22 | var now = new Date(); 23 | parent.dateStr = Qt.formatDate(now, "yyyy-MM-dd"); 24 | parent.timeStr = Qt.formatTime(now, "HH:mm"); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /bin/.local/bin/git-branch-cleanup: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | if [[ "$1" == '-D' ]]; then 3 | DELETE=1 4 | else 5 | DELETE=0 6 | fi 7 | 8 | REMOTE_BRANCHES="`mktemp`" 9 | LOCAL_BRANCHES="`mktemp`" 10 | DANGLING_BRANCHES="`mktemp`" 11 | git for-each-ref --format="%(refname)" refs/remotes/origin/ | \ 12 | sed 's#^refs/remotes/origin/##' > "$REMOTE_BRANCHES" 13 | git for-each-ref --format="%(refname)" refs/heads/ | \ 14 | sed 's#^refs/heads/##' > "$LOCAL_BRANCHES" 15 | grep -vxF -f "$REMOTE_BRANCHES" "$LOCAL_BRANCHES" | \ 16 | sort -V > "$DANGLING_BRANCHES" 17 | rm -f "$REMOTE_BRANCHES" "$LOCAL_BRANCHES" 18 | 19 | if [[ $DELETE -ne 0 ]]; then 20 | cat "$DANGLING_BRANCHES" | while read -r B; do 21 | git branch -D "$B" 22 | done 23 | else 24 | cat "$DANGLING_BRANCHES" 25 | fi 26 | rm -f "$DANGLING_BRANCHES" 27 | -------------------------------------------------------------------------------- /nvim/.config/nvim/after/ftplugin/java.lua: -------------------------------------------------------------------------------- 1 | vim.g.java_ignore_markdown = true 2 | 3 | local dap = require('dap') 4 | 5 | dap.configurations.java = { 6 | { 7 | type = 'java', 8 | request = 'attach', 9 | name = 'Attach to remote', 10 | connect = function() 11 | local host = vim.fn.input('Host [127.0.0.1]: ') 12 | host = host ~= '' and host or '127.0.0.1' 13 | local port = tonumber(vim.fn.input('Port [5005]: ')) or 5005 14 | return { host = host, port = port } 15 | end, 16 | }, 17 | } 18 | 19 | local function get_mason_lombok_agent() 20 | local jdtls_path = vim.fn.expand('$MASON/share/jdtls') 21 | return jdtls_path .. '/lombok.jar' 22 | end 23 | 24 | vim.env.JDTLS_JVM_ARGS = '-javaagent:' .. get_mason_lombok_agent() 25 | -------------------------------------------------------------------------------- /bin/.local/bin/menu-actions.conf: -------------------------------------------------------------------------------- 1 | terminal:terminal 2 | switch:menu-switch -p "switch" 3 | run:menu-run -p "run" 4 | passwords:menu-pass -p "pass" 5 | execute:menu-proc -p "proc" 6 | copy:menu-clip -p "clip" 7 | games:menu-steam -p "steam" 8 | install:menu-yay -p "yay" 9 | notifications:menu-notifications -p "notifications" 10 | urls:menu-qutebrowser -p "url" 11 | lock screen:swaylock -f -e -s fill -i $WALLPAPER 12 | flux:pkill -USR1 gammastep 13 | cheatsheet:hyprctl dispatch togglespecialworkspace cheatsheet 14 | btop:hyprctl dispatch togglespecialworkspace btop 15 | discord:hyprctl dispatch togglespecialworkspace discord 16 | youtube:hyprctl dispatch togglespecialworkspace youtubemusic 17 | kubernetes:hyprctl dispatch togglespecialworkspace kubernetes 18 | docker:hyprctl dispatch togglespecialworkspace docker 19 | escape:hyprctl reload 20 | -------------------------------------------------------------------------------- /bin/.local/bin/menu-qutebrowser: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | scriptpath=$(dirname "$(readlink -f "$0")") 3 | 4 | QUTE_CONFIG_DIR="$HOME/.config/qutebrowser" 5 | QUTE_DATA_DIR="$HOME/.local/share/qutebrowser" 6 | 7 | create_menu() { 8 | # Check quickmarks 9 | while read -r url; do 10 | printf -- '%s\n' "$url" 11 | done < "$QUTE_CONFIG_DIR"/quickmarks 12 | 13 | # Next bookmarks 14 | while read -r url _; do 15 | printf -- '%s\n' "$url" 16 | done < "$QUTE_CONFIG_DIR"/bookmarks/urls 17 | 18 | # Finally history 19 | printf -- '%s\n' "$(sqlite3 -separator ' ' "$QUTE_DATA_DIR/history.sqlite" 'select title, url from CompletionHistory ORDER BY last_atime DESC')" 20 | } 21 | 22 | url=$(create_menu | $scriptpath/fzfmenu "$@") 23 | 24 | [[ -n $url ]] || exit 1 25 | 26 | url=${url/*http/http} 27 | exec qutebrowser "$url" 28 | -------------------------------------------------------------------------------- /bin/.local/bin/menu-yay: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | scriptpath=$(dirname "$(readlink -f "$0")") 3 | 4 | installed=$(yay -Qq) 5 | available=$(yay -Slq) 6 | 7 | installed_pkgs=$(printf "%s\n" "$installed" | awk '{print "\033[0;33m" $0 "\033[0m"}') 8 | available_pkgs=$(printf "%s\n" "$available" | grep -vxFf <(printf "%s\n" "$installed")) 9 | all_pkgs=$(printf "%s\n%s\n" "$installed_pkgs" "$available_pkgs") 10 | 11 | pkg=$(printf "%s\n" "$all_pkgs" | "$scriptpath/fzfmenu" -p "yay" --ansi --preview="yay -Si {1}") 12 | 13 | [ -z "$pkg" ] && exit 1 14 | 15 | name=$(echo "$pkg" | awk '{print $1}') 16 | 17 | if printf "%s\n" "$installed" | grep -qx "$name"; then 18 | action="Uninstalling" 19 | cmd="yay -Rns $name" 20 | else 21 | action="Installing" 22 | cmd="yay -S $name" 23 | fi 24 | 25 | $TERMINAL -e "$SHELL" -ic "echo '$action $name...'; $cmd; echo; read 'REPLY?Press enter to exit...'" 26 | -------------------------------------------------------------------------------- /git/.gitignore: -------------------------------------------------------------------------------- 1 | # Worktrees 2 | worktrees/ 3 | 4 | # Compiled Python files 5 | *.pyc 6 | .venv/ 7 | .venv 8 | 9 | # Folder view configuration files 10 | .DS_Store 11 | Desktop.ini 12 | 13 | # Thumbnail cache files 14 | ._* 15 | Thumbs.db 16 | 17 | # Files that might appear on external disks 18 | .Spotlight-V100 19 | .Trashes 20 | 21 | # Eclipse 22 | workbench.xmi 23 | 24 | # IntelliJ 25 | .idea/ 26 | 27 | # Ignore tags created by etags, ctags, gtags (GNU global) and cscope 28 | TAGS 29 | !TAGS/ 30 | tags 31 | !tags/ 32 | .tags 33 | .tags1 34 | gtags.files 35 | tags.lock 36 | tags.temp 37 | GTAGS 38 | GRTAGS 39 | GPATH 40 | cscope.files 41 | cscope.out 42 | cscope.in.out 43 | cscope.po.out 44 | 45 | # Vim 46 | Session.vim 47 | .netrwhist 48 | 49 | # Misc 50 | .yangcp/ 51 | nohup.out 52 | 53 | ModCache.lua 54 | 55 | # jdtls 56 | .classpath 57 | .factorypath 58 | .project 59 | .settings/ 60 | -------------------------------------------------------------------------------- /quickshell/.config/quickshell/bar/BrightnessWidget.qml: -------------------------------------------------------------------------------- 1 | import Quickshell 2 | import Quickshell.Io 3 | import QtQuick 4 | 5 | Text { 6 | id: root 7 | property int brightness: 0 8 | 9 | text: Theme.iconBrightness + " " + brightness + "%" 10 | color: Theme.colorFg 11 | font.family: Theme.fontFamily 12 | font.pixelSize: Theme.fontSize 13 | leftPadding: Theme.margin 14 | rightPadding: Theme.margin 15 | 16 | Process { 17 | id: brightProc 18 | command: ["sh", "-c", "brightnessctl -m | awk -F, '{print $4}' | tr -d '%'"] 19 | running: false 20 | stdout: SplitParser { 21 | onRead: data => root.brightness = parseInt(data.trim()) 22 | } 23 | } 24 | 25 | Timer { 26 | interval: 1000 27 | running: true 28 | repeat: true 29 | triggeredOnStart: true 30 | onTriggered: brightProc.running = true 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /nvim/.config/nvim/after/lsp/lua_ls.lua: -------------------------------------------------------------------------------- 1 | return { 2 | settings = { 3 | -- See: https://luals.github.io/wiki/settings/ 4 | Lua = { 5 | runtime = { 6 | version = 'LuaJIT', 7 | -- Tell the language server how to find Lua modules same way as Neovim 8 | -- (see `:h lua-module-load`) 9 | path = { 10 | 'lua/?.lua', 11 | 'lua/?/init.lua', 12 | }, 13 | }, 14 | hint = { 15 | enable = true, 16 | }, 17 | workspace = { 18 | checkThirdParty = false, 19 | library = { 20 | vim.env.VIMRUNTIME, 21 | }, 22 | }, 23 | completion = { 24 | callSnippet = 'Disable', 25 | keywordSnippet = 'Disable', 26 | }, 27 | }, 28 | }, 29 | } 30 | -------------------------------------------------------------------------------- /mcphub/.config/mcphub/servers.json: -------------------------------------------------------------------------------- 1 | { 2 | "servers": { 3 | "context7": { 4 | "args": [ 5 | "-y", 6 | "@upstash/context7-mcp" 7 | ], 8 | "command": "npx", 9 | "env": { 10 | "DEFAULT_MINIMUM_TOKENS": "6000" 11 | } 12 | }, 13 | "github": { 14 | "headers": { 15 | "Authorization": "Bearer ${GITHUB_PERSONAL_ACCESS_TOKEN}" 16 | }, 17 | "url": "https://api.githubcopilot.com/mcp/" 18 | }, 19 | "memory": { 20 | "args": [ 21 | "-y", 22 | "@modelcontextprotocol/server-memory" 23 | ], 24 | "command": "npx" 25 | }, 26 | "sequentialthinking": { 27 | "args": [ 28 | "-y", 29 | "@modelcontextprotocol/server-sequential-thinking" 30 | ], 31 | "command": "npx" 32 | }, 33 | "tavily": { 34 | "disabled": false, 35 | "url": "https://mcp.tavily.com/mcp/?tavilyApiKey=${TAVILY_API_KEY}" 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /quickshell/.config/quickshell/bar/BatteryWidget.qml: -------------------------------------------------------------------------------- 1 | import Quickshell 2 | import Quickshell.Io 3 | import QtQuick 4 | 5 | Text { 6 | id: root 7 | property int capacity: 100 8 | 9 | text: Theme.iconBattery + " " + capacity + "%" 10 | color: capacity <= 10 ? Theme.colorUrgent : capacity <= 30 ? Theme.colorWarning : Theme.colorFg 11 | font.family: Theme.fontFamily 12 | font.pixelSize: Theme.fontSize 13 | leftPadding: Theme.margin 14 | rightPadding: Theme.margin 15 | 16 | Process { 17 | id: batProc 18 | command: ["sh", "-c", "cat /sys/class/power_supply/BAT0/capacity 2>/dev/null || echo 100"] 19 | running: false 20 | stdout: SplitParser { 21 | onRead: data => root.capacity = parseInt(data.trim()) 22 | } 23 | } 24 | 25 | Timer { 26 | interval: 5000 27 | running: true 28 | repeat: true 29 | triggeredOnStart: true 30 | onTriggered: batProc.running = true 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /fontconfig/.config/fontconfig/fonts.conf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | rgb 8 | 9 | 10 | true 11 | 12 | 13 | false 14 | 15 | 16 | true 17 | 18 | 19 | hintfull 20 | 21 | 22 | lcddefault 23 | 24 | 25 | 26 | monospace 27 | 28 | Terminus (TTF) 29 | Terminus 30 | Terminess Nerd Font 31 | 32 | fixed 33 | 34 | 35 | -------------------------------------------------------------------------------- /quickshell/.config/quickshell/bar/MemoryWidget.qml: -------------------------------------------------------------------------------- 1 | import Quickshell 2 | import Quickshell.Io 3 | import QtQuick 4 | 5 | Text { 6 | id: root 7 | property real percentUsed: 0 8 | 9 | text: Theme.iconMemory + " " + Math.round(percentUsed) + "%" 10 | color: percentUsed >= 80 ? Theme.colorUrgent : percentUsed >= 65 ? Theme.colorWarning : Theme.colorFg 11 | font.family: Theme.fontFamily 12 | font.pixelSize: Theme.fontSize 13 | leftPadding: Theme.margin 14 | rightPadding: Theme.margin 15 | 16 | Process { 17 | id: memProc 18 | command: ["sh", "-c", "free | grep Mem | awk '{print ($3/$2) * 100.0}'"] 19 | running: false 20 | stdout: SplitParser { 21 | onRead: data => root.percentUsed = parseFloat(data.trim()) 22 | } 23 | } 24 | 25 | Timer { 26 | interval: 2000 27 | running: true 28 | repeat: true 29 | triggeredOnStart: true 30 | onTriggered: memProc.running = true 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /starship/.config/starship.toml: -------------------------------------------------------------------------------- 1 | format = """ 2 | $username\ 3 | $hostname\ 4 | $directory\ 5 | $git_branch\ 6 | $git_state\ 7 | $git_status\ 8 | $cmd_duration\ 9 | $line_break\ 10 | $python\ 11 | $character""" 12 | 13 | [directory] 14 | style = "blue" 15 | 16 | [character] 17 | success_symbol = "[❯](purple)" 18 | error_symbol = "[❯](red)" 19 | vimcmd_symbol = "[❮](green)" 20 | 21 | [git_branch] 22 | format = "[$branch]($style)" 23 | style = "bright-black" 24 | 25 | [git_status] 26 | format = "[[(*$conflicted$untracked$modified$staged$renamed$deleted)](218) ($ahead_behind$stashed)]($style)" 27 | style = "cyan" 28 | conflicted = "​" 29 | untracked = "​" 30 | modified = "​" 31 | staged = "​" 32 | renamed = "​" 33 | deleted = "​" 34 | stashed = "≡" 35 | 36 | [git_state] 37 | format = '\([$state( $progress_current/$progress_total)]($style)\) ' 38 | style = "bright-black" 39 | 40 | [cmd_duration] 41 | format = "[$duration]($style) " 42 | style = "yellow" 43 | 44 | [python] 45 | format = "[$virtualenv]($style) " 46 | style = "bright-black" 47 | -------------------------------------------------------------------------------- /scripts/install-devel.sh: -------------------------------------------------------------------------------- 1 | log "Installing development packages" 2 | packages=( 3 | jdk8-openjdk openjdk8-doc openjdk8-src 4 | jdk-openjdk openjdk-doc openjdk-src 5 | python-pip python-dbus python-opengl python-virtualenv 6 | dotnet-sdk aspnet-runtime 7 | rust cargo 8 | maven python-poetry 9 | lua51 luarocks stylua 10 | zig choosenim-bin 11 | github-cli 12 | docker docker-compose lazydocker 13 | azure-cli kubectl k9s azure-kubelogin temporal-cli 14 | distrobox 15 | ) 16 | install_pkgs "${packages[@]}" 17 | 18 | packages=( 19 | https://github.com/dlenski/rsa_ct_kip/archive/HEAD.zip 20 | ) 21 | install_python_pkgs "${packages[@]}" 22 | 23 | packages=( 24 | httpyac 25 | @github/copilot 26 | opencode-ai@latest 27 | ) 28 | install_npm_pkgs "${packages[@]}" 29 | 30 | log "Configuring development environment" 31 | services=( 32 | keyd 33 | docker 34 | power-profiles-daemon 35 | ) 36 | enable_services "${services[@]}" 37 | 38 | groups=( 39 | docker 40 | ) 41 | enable_groups "${groups[@]}" 42 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2016 Tomas Slusny 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /dunst/.config/dunst/dunstrc: -------------------------------------------------------------------------------- 1 | ; vim:ft=dosini 2 | 3 | [global] 4 | dmenu = ~/.config/fzfmenu/fzfmenu -p dunst: 5 | history_length = 100 6 | idle_threshold = 120 7 | 8 | # Limit notifications displayed at once and indicate hidden ones 9 | notification_limit = 5 10 | indicate_hidden = yes 11 | 12 | # Position on screen 13 | offset = (10, 10) 14 | follow = keyboard 15 | 16 | # Navigation 17 | mouse_left_click = do_action, close_current 18 | mouse_right_click = close_current 19 | mouse_middle_click = close_all 20 | 21 | # UI 22 | enable_recursive_icon_lookup = true 23 | markup = full 24 | font = monospace 12 25 | padding = 5 26 | horizontal_padding = 5 27 | frame_color = "#268bd2" 28 | frame_width = 1 29 | separator_color = frame 30 | separator_height = 1 31 | 32 | [play_sound] 33 | summary = "*" 34 | script = ~/.config/dunst/alert.sh 35 | msg_urgency = critical 36 | 37 | [urgency_low] 38 | background = "#002b36" 39 | foreground = "#839496" 40 | timeout = 10 41 | 42 | [urgency_normal] 43 | background = "#073642" 44 | foreground = "#93a1a1" 45 | timeout = 10 46 | 47 | [urgency_critical] 48 | background = "#268bd2" 49 | foreground = "#eee8d5" 50 | timeout = 0 51 | -------------------------------------------------------------------------------- /k9s/.config/k9s/plugins.yaml: -------------------------------------------------------------------------------- 1 | plugins: 2 | logs-follow: 3 | shortCut: Shift-L 4 | description: logs -f 5 | scopes: 6 | - po 7 | command: kubectl 8 | background: false 9 | args: 10 | - logs 11 | - -f 12 | - $NAME 13 | - -n 14 | - $NAMESPACE 15 | - --context 16 | - $CONTEXT 17 | - --kubeconfig 18 | - $KUBECONFIG 19 | log-less: 20 | shortCut: Shift-G 21 | description: "logs|less" 22 | scopes: 23 | - po 24 | command: bash 25 | background: false 26 | args: 27 | - -c 28 | - '"$@" | less' 29 | - dummy-arg 30 | - kubectl 31 | - logs 32 | - $NAME 33 | - -n 34 | - $NAMESPACE 35 | - --context 36 | - $CONTEXT 37 | - --kubeconfig 38 | log-copy: 39 | shortCut: Shift-Y 40 | description: "logs|copy" 41 | scopes: 42 | - po 43 | command: bash 44 | background: false 45 | args: 46 | - -c 47 | - '"$@" | wl-copy' 48 | - dummy-arg 49 | - kubectl 50 | - logs 51 | - $NAME 52 | - -n 53 | - $NAMESPACE 54 | - --context 55 | - $CONTEXT 56 | - --kubeconfig 57 | - $KUBECONFIG - $KUBECONFIG 58 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | SUBMODULES := $(shell git config --file .gitmodules --get-regexp path | awk '{ print $$2 }') 2 | 3 | default:update link install 4 | 5 | clean: 6 | rm -r /home/deathbeam/.cache/nvim/tree-sitter-* 7 | rm -r ~/.local/share/nvim/site/ 8 | rm -r nvim/.config/nvim/pack/bundle/start/nvim-treesitter 9 | find ~ -xtype l -print -delete || true 10 | 11 | link: 12 | mkdir -p ~/.local/bin 13 | stow --target ~ --restow `ls -d */` 14 | 15 | update: 16 | git submodule sync --recursive 17 | for sub in $(SUBMODULES); do \ 18 | echo "Updating submodule $$sub"; \ 19 | if [ "$$sub" != "zsh/.fzf" ]; then \ 20 | git submodule update --init --recursive "$$sub"; \ 21 | git submodule update --remote "$$sub"; \ 22 | fi; \ 23 | done 24 | 25 | install: 26 | zsh/.fzf/install --all --no-update-rc --no-completion --no-bash --no-fish 27 | zsh -ic 'fast-theme base16' 28 | npm install -g mcp-hub@latest 29 | nvim --headless \ 30 | +MasonUpdateSync \ 31 | +TSUpdateSync \ 32 | +UpdateRemotePlugins \ 33 | +'helptags ALL' \ 34 | +qall 35 | python scripts/generate-cheatsheet.py 36 | python scripts/generate-menu.py 37 | 38 | uninstall: 39 | zsh/.fzf/uninstall 40 | stow --target ~ --delete `ls -d */` 41 | -------------------------------------------------------------------------------- /bin/.local/bin/menu-switch: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | scriptpath=$(dirname "$(readlink -f "$0")") 3 | 4 | # Start mpv in background 5 | mpv_socket="/tmp/mpv-preview-socket" 6 | placeholder_path="/tmp/window_preview.png" 7 | touch $placeholder_path 8 | mpv --input-ipc-server=$mpv_socket \ 9 | --no-terminal \ 10 | --background=none \ 11 | --background-color='#00FFFFFF' \ 12 | --no-border \ 13 | --no-osd-bar \ 14 | --no-osc \ 15 | --no-input-default-bindings \ 16 | --image-display-duration=inf \ 17 | $placeholder_path & 18 | viewer_pid=$! 19 | 20 | cleanup() { 21 | kill $viewer_pid 2>/dev/null 22 | rm -f /tmp/window_preview_*.png 23 | } 24 | trap cleanup HUP INT QUIT TERM EXIT 25 | 26 | # Prepare window list: addresstitle 27 | windows=$(hyprctl -j clients | jq -r 'sort_by(.focusHistoryID) | .[] | select(.workspace.id >= 0) | "\(.address)\t\(.title)"') 28 | 29 | # Run fzfmenu with preview 30 | selected=$(printf '%s\n' "$windows" | \ 31 | "$scriptpath/fzfmenu" "$@" \ 32 | --with-nth "2.." \ 33 | --preview "previewwindow $mpv_socket {1}" \ 34 | | awk -F'\t' '{print $1}') 35 | 36 | # Focus selected window 37 | [ -n "$selected" ] && hyprctl dispatch focuswindow address:"$selected" 38 | -------------------------------------------------------------------------------- /git/.gitmessage: -------------------------------------------------------------------------------- 1 | 2 | 3 | # Summarize changes in around 50 characters or less 4 | # 5 | # More detailed explanatory text, if necessary. Wrap it to about 72 6 | # characters or so. In some contexts, the first line is treated as the 7 | # subject of the commit and the rest of the text as the body. The 8 | # blank line separating the summary from the body is critical (unless 9 | # you omit the body entirely); various tools like `log`, `shortlog` 10 | # and `rebase` can get confused if you run the two together. 11 | # 12 | # Explain the problem that this commit is solving. Focus on why you 13 | # are making this change as opposed to how (the code explains that). 14 | # Are there side effects or other unintuitive consequences of this 15 | # change? Here's the place to explain them. 16 | # 17 | # Further paragraphs come after blank lines. 18 | # 19 | # - Bullet points are okay, too 20 | # 21 | # - Typically a hyphen or asterisk is used for the bullet, preceded 22 | # by a single space, with blank lines in between, but conventions 23 | # vary here 24 | # 25 | # If you use an issue tracker, put references to them at the bottom, 26 | # like this 27 | # 28 | # Resolves: #123 29 | # See also: #456, #789 30 | 31 | # vim: set ft=gitcommit: 32 | -------------------------------------------------------------------------------- /nvim/.config/nvim/after/lsp/vtsls.lua: -------------------------------------------------------------------------------- 1 | return { 2 | settings = { 3 | -- See: https://github.com/typescript-language-server/typescript-language-server/blob/master/docs/configuration.md 4 | -- See: https://github.com/yioneko/vtsls/blob/main/packages/service/conjfiguration.schema.json 5 | ['js/ts'] = { 6 | implicitProjectConfig = { 7 | checkJs = true, 8 | target = 'ES2022', 9 | }, 10 | }, 11 | javascript = { 12 | inlayHints = { 13 | parameterNames = { enabled = 'literals' }, 14 | parameterTypes = { enabled = true }, 15 | variableTypes = { enabled = true }, 16 | propertyDeclarationTypes = { enabled = true }, 17 | functionLikeReturnTypes = { enabled = true }, 18 | enumMemberValues = { enabled = true }, 19 | }, 20 | }, 21 | typescript = { 22 | inlayHints = { 23 | parameterNames = { enabled = 'literals' }, 24 | parameterTypes = { enabled = true }, 25 | variableTypes = { enabled = true }, 26 | propertyDeclarationTypes = { enabled = true }, 27 | functionLikeReturnTypes = { enabled = true }, 28 | enumMemberValues = { enabled = true }, 29 | }, 30 | }, 31 | }, 32 | } 33 | -------------------------------------------------------------------------------- /scripts/generate-menu.py: -------------------------------------------------------------------------------- 1 | from pathlib import Path 2 | import re 3 | 4 | SCRIPT_DIR = Path(__file__).parent.parent.resolve() 5 | CONFIG_PATH = SCRIPT_DIR / "hyprland" / ".config" / "hypr" / "hyprland.conf" 6 | OUTPUT_PATH = SCRIPT_DIR / "bin" / ".local" / "bin" / "menu-actions.conf" 7 | 8 | SKIP_BINDINGS = [ "print" ] 9 | 10 | with open(CONFIG_PATH) as f, open(OUTPUT_PATH, "w") as out: 11 | def write_action(name, cmd, comment): 12 | action_name = comment if comment else name 13 | out.write(f"{action_name}:{cmd}\n") 14 | 15 | pattern = re.compile( 16 | r'bind\s*=\s*SUPER(?:_SHIFT)?,\s*([^\s,]+),\s*(exec|togglespecialworkspace),\s*(.+)' 17 | ) 18 | 19 | for line in f: 20 | comment = "" 21 | if "#" in line: 22 | split = line.split("#", 1) 23 | line = split[0].strip() 24 | comment = split[1].strip() 25 | 26 | m = pattern.match(line) 27 | if m: 28 | key, action, value = m.groups() 29 | if action == "exec": 30 | if key.lower() in SKIP_BINDINGS: 31 | continue 32 | cmd = f"{value.strip()}" 33 | write_action(key, cmd, comment) 34 | elif action == "togglespecialworkspace": 35 | cmd = f"hyprctl dispatch togglespecialworkspace {value.strip()}" 36 | write_action(value, cmd, comment) 37 | -------------------------------------------------------------------------------- /nvim/.config/nvim/after/lsp/pylance.lua: -------------------------------------------------------------------------------- 1 | return { 2 | filetypes = { 'python' }, 3 | cmd = { 'pylance', '--stdio' }, 4 | root_markers = { 'pyproject.toml', 'setup.py', 'setup.cfg', 'requirements.txt', 'Pipfile' }, 5 | single_file_support = true, 6 | settings = { 7 | -- See: https://github.com/microsoft/pyright/blob/main/docs/settings.md 8 | -- See: https://code.visualstudio.com/docs/python/settings-reference 9 | python = { 10 | pythonPath = vim.fn.exepath('python'), 11 | analysis = { 12 | inlayHints = { 13 | variableTypes = true, 14 | functionReturnTypes = true, 15 | callArgumentNames = true, 16 | pytestParameters = true, 17 | }, 18 | typeCheckingMode = 'basic', 19 | diagnosticMode = 'openFilesOnly', 20 | autoImportCompletions = true, 21 | diagnosticSeverityOverrides = { 22 | reportOptionalSubscript = 'none', 23 | reportOptionalMemberAccess = 'none', 24 | reportOptionalCall = 'none', 25 | reportOptionalIterable = 'none', 26 | reportOptionalContextManager = 'none', 27 | reportOptionalOperand = 'none', 28 | }, 29 | }, 30 | }, 31 | }, 32 | } 33 | -------------------------------------------------------------------------------- /readline/.inputrc: -------------------------------------------------------------------------------- 1 | # Use Emacs style editing 2 | set editing-mode emacs 3 | set keymap emacs 4 | 5 | # Show all completions as soon as I press tab, even if there's more than one 6 | set show-all-if-ambiguous on 7 | 8 | # Ignore case 9 | set completion-ignore-case on 10 | 11 | # Autocomplete hidden files 12 | set match-hidden-files on 13 | 14 | # Immediately add a trailing slash when autocompleting symlinks to directories 15 | set mark-symlinked-directories on 16 | 17 | # Show extra file information when completing, like `ls -F` does 18 | set visible-stats on 19 | 20 | # Show all autocomplete results at once 21 | set page-completions off 22 | 23 | # Use the text that has already been typed as the prefix for searching through 24 | # commands (i.e. more intelligent Up/Down behavior) 25 | "\e[B": history-search-forward 26 | "\e[A": history-search-backward 27 | "^N": history-search-forward 28 | "^P": history-search-backward 29 | 30 | # Be more intelligent when autocompleting by also looking at the text after 31 | # the cursor. For example, when the current line is "cd ~/src/mozil", and 32 | # the cursor is on the "z", pressing Tab will not autocomplete it to "cd 33 | # ~/src/mozillail", but to "cd ~/src/mozilla". (This is supported by the 34 | # Readline used by Bash 4.) 35 | set skip-completed-text on 36 | 37 | # Allow UTF-8 input and output, instead of showing stuff like $'\0123\0456' 38 | set input-meta on 39 | set output-meta on 40 | set convert-meta off 41 | -------------------------------------------------------------------------------- /quickshell/.config/quickshell/bar/GpuWidget.qml: -------------------------------------------------------------------------------- 1 | import Quickshell 2 | import Quickshell.Io 3 | import QtQuick 4 | 5 | Text { 6 | id: root 7 | property int utilization: -1 8 | property int temperature: -1 9 | 10 | visible: utilization >= 0 && temperature >= 0 11 | text: Theme.iconGpu + " " + utilization + "%|" + temperature + "°C" 12 | color: (utilization >= 80 || temperature >= 80) ? Theme.colorUrgent : 13 | (utilization >= 65 || temperature >= 65) ? Theme.colorWarning : Theme.colorFg 14 | font.family: Theme.fontFamily 15 | font.pixelSize: Theme.fontSize 16 | leftPadding: Theme.margin 17 | rightPadding: Theme.margin 18 | 19 | Process { 20 | id: gpuProc 21 | command: ["sh", "-c", "nvidia-smi --query-gpu=utilization.gpu,temperature.gpu --format=csv,noheader,nounits 2>/dev/null || echo '-1,-1'"] 22 | running: false 23 | stdout: SplitParser { 24 | onRead: data => { 25 | var parts = data.trim().split(',') 26 | if (parts.length === 2) { 27 | root.utilization = parseInt(parts[0].trim()) 28 | root.temperature = parseInt(parts[1].trim()) 29 | } 30 | } 31 | } 32 | } 33 | 34 | Timer { 35 | interval: 1000 36 | running: true 37 | repeat: true 38 | triggeredOnStart: true 39 | onTriggered: gpuProc.running = true 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /nvim/.config/nvim/after/ftplugin/python.lua: -------------------------------------------------------------------------------- 1 | local dap = require('dap') 2 | 3 | dap.adapters.python = function(callback, config) 4 | if config.request == 'launch' then 5 | callback({ 6 | type = 'executable', 7 | command = 'debugpy-adapter', 8 | }) 9 | else 10 | callback({ 11 | type = 'server', 12 | port = config.connect.port, 13 | host = config.connect.host, 14 | options = { 15 | source_filetype = 'python', 16 | }, 17 | }) 18 | end 19 | end 20 | 21 | dap.configurations.python = { 22 | { 23 | type = 'python', 24 | request = 'launch', 25 | console = 'integratedTerminal', 26 | name = 'Launch', 27 | program = '${file}', 28 | pythonPath = 'python', 29 | args = function() 30 | local input = vim.fn.input('CLI args: ') 31 | return vim.split(input, ' ') 32 | end, 33 | }, 34 | { 35 | type = 'python', 36 | request = 'attach', 37 | console = 'integratedTerminal', 38 | name = 'Attach to remote', 39 | connect = function() 40 | local host = vim.fn.input('Host [127.0.0.1]: ') 41 | host = host ~= '' and host or '127.0.0.1' 42 | local port = tonumber(vim.fn.input('Port [5678]: ')) or 5678 43 | return { host = host, port = port } 44 | end, 45 | }, 46 | } 47 | -------------------------------------------------------------------------------- /nvim/.config/nvim/after/ftplugin/javascript.lua: -------------------------------------------------------------------------------- 1 | local dap = require('dap') 2 | local dap_utils = require('dap.utils') 3 | local dap_vscode_js = require('dap-vscode-js') 4 | 5 | if not vim.g.js_adapter then 6 | dap_vscode_js.setup({ 7 | debugger_cmd = 'js-debug-adapter', 8 | adapters = { 9 | 'pwa-node', 10 | 'pwa-chrome', 11 | 'pwa-msedge', 12 | 'node-terminal', 13 | 'pwa-extensionHost', 14 | }, 15 | }) 16 | 17 | vim.g.js_adapter = true 18 | end 19 | 20 | for _, language in ipairs({ 'typescript', 'javascript', 'typescriptreact', 'javascriptreact' }) do 21 | dap.configurations[language] = { 22 | { 23 | type = 'pwa-node', 24 | request = 'launch', 25 | name = 'Launch file', 26 | program = '${file}', 27 | cwd = '${workspaceFolder}', 28 | }, 29 | { 30 | type = 'pwa-node', 31 | request = 'attach', 32 | name = 'Attach process', 33 | processId = dap_utils.pick_process, 34 | cwd = '${workspaceFolder}', 35 | }, 36 | { 37 | type = 'pwa-chrome', 38 | request = 'launch', 39 | name = 'Start Chrome with "localhost"', 40 | url = 'http://localhost:3000', 41 | webRoot = '${workspaceFolder}', 42 | userDataDir = '${workspaceFolder}/.vscode/debug', 43 | }, 44 | } 45 | end 46 | -------------------------------------------------------------------------------- /quickshell/.config/quickshell/bar/CpuWidget.qml: -------------------------------------------------------------------------------- 1 | import Quickshell 2 | import Quickshell.Io 3 | import QtQuick 4 | 5 | Text { 6 | id: root 7 | property int utilization: 0 8 | property int temperature: 0 9 | 10 | text: Theme.iconCpu + " " + utilization + "%|" + temperature + "°C" 11 | color: (utilization >= 80 || temperature >= 80) ? Theme.colorUrgent : 12 | (utilization >= 65 || temperature >= 65) ? Theme.colorWarning : Theme.colorFg 13 | font.family: Theme.fontFamily 14 | font.pixelSize: Theme.fontSize 15 | leftPadding: Theme.margin 16 | rightPadding: Theme.margin 17 | 18 | Process { 19 | id: cpuProc 20 | command: ["sh", "-c", "top -bn2 | grep 'Cpu(s)' | tail -n1 | awk '{print 100 - $8}' | cut -d. -f1"] 21 | running: false 22 | stdout: SplitParser { 23 | onRead: data => root.utilization = parseInt(data.trim()) 24 | } 25 | } 26 | 27 | Process { 28 | id: tempProc 29 | command: ["sh", "-c", "sensors | awk '/Package id 0:/ {print int($4)}' | tr -d '+°C'"] 30 | running: false 31 | stdout: SplitParser { 32 | onRead: data => root.temperature = parseInt(data.trim()) 33 | } 34 | } 35 | 36 | Timer { 37 | interval: 2000 38 | running: true 39 | repeat: true 40 | triggeredOnStart: true 41 | onTriggered: { 42 | cpuProc.running = true 43 | tempProc.running = true 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /quickshell/.config/quickshell/bar/shell.qml: -------------------------------------------------------------------------------- 1 | import Quickshell 2 | import Quickshell.Wayland 3 | import QtQuick 4 | import QtQuick.Layouts 5 | 6 | ShellRoot { 7 | Variants { 8 | model: Quickshell.screens 9 | 10 | PanelWindow { 11 | property var modelData 12 | screen: modelData 13 | anchors { 14 | top: true 15 | left: true 16 | right: true 17 | } 18 | 19 | implicitHeight: Theme.barHeight 20 | 21 | color: Theme.colorBg 22 | 23 | // Left side 24 | RowLayout { 25 | anchors.left: parent.left 26 | anchors.top: parent.top 27 | anchors.bottom: parent.bottom 28 | spacing: 0 29 | 30 | TopLevelWidget {} 31 | } 32 | 33 | // Right side 34 | RowLayout { 35 | anchors.right: parent.right 36 | anchors.top: parent.top 37 | anchors.bottom: parent.bottom 38 | spacing: 0 39 | 40 | NetworkWidget {} 41 | MemoryWidget {} 42 | CpuWidget {} 43 | GpuWidget {} 44 | VolumeWidget { mixer: "Master" } 45 | VolumeWidget { mixer: "Capture"; isMic: true } 46 | BrightnessWidget {} 47 | BatteryWidget {} 48 | ClockWidget {} 49 | NotificationsWidget {} 50 | } 51 | } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /quickshell/.config/quickshell/bar/VolumeWidget.qml: -------------------------------------------------------------------------------- 1 | import Quickshell 2 | import Quickshell.Io 3 | import QtQuick 4 | 5 | Text { 6 | id: root 7 | property string mixer: "Master" 8 | property bool isMic: false 9 | property int percent: 0 10 | property bool muted: false 11 | 12 | text: muted ? (isMic ? Theme.iconMicMuted : Theme.iconVolumeMuted) : (isMic ? Theme.iconMic + " " + percent + "%" : Theme.iconVolume + " " + percent + "%") 13 | color: muted ? Theme.colorUrgent : Theme.colorFg 14 | font.family: Theme.fontFamily 15 | font.pixelSize: Theme.fontSize 16 | leftPadding: Theme.margin 17 | rightPadding: Theme.margin 18 | 19 | Process { 20 | id: volProc 21 | command: ["sh", "-c", "amixer -c PCH get " + root.mixer + " | grep -oP '\\[\\d+%\\]' | head -n1 | tr -d '[]%'"] 22 | running: false 23 | stdout: SplitParser { 24 | onRead: data => root.percent = parseInt(data.trim()) 25 | } 26 | } 27 | 28 | Process { 29 | id: muteProc 30 | command: ["sh", "-c", "amixer -c PCH get " + root.mixer + " | grep -oP '\\[(on|off)\\]' | head -n1"] 31 | running: false 32 | stdout: SplitParser { 33 | onRead: data => root.muted = data.trim() === "[off]" 34 | } 35 | } 36 | 37 | Timer { 38 | interval: 1000 39 | running: true 40 | repeat: true 41 | triggeredOnStart: true 42 | onTriggered: { 43 | volProc.running = true 44 | muteProc.running = true 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /nvim/.config/nvim/lua/config/myplugins.lua: -------------------------------------------------------------------------------- 1 | local icons = require('config.icons') 2 | local utils = require('config.utils') 3 | local nmap = utils.nmap 4 | 5 | require('myplugins').setup({ 6 | lspdocs = {}, 7 | lspecho = { 8 | attach_log = true, 9 | }, 10 | lspsignature = {}, 11 | diagnostics = {}, 12 | 13 | bigfile = {}, 14 | rooter = {}, 15 | session = {}, 16 | zoom = {}, 17 | wiki = { 18 | dir = vim.fn.expand('~/Wiki'), 19 | }, 20 | }) 21 | 22 | local bookmarks = require('myplugins.bookmarks') 23 | nmap('mm', bookmarks.select, 'Bookmarks Select') 24 | nmap('mq', bookmarks.quickfix, 'Bookmarks Quickfix') 25 | nmap('md', bookmarks.delete_buffer, 'Bookmarks Delete Buffer') 26 | nmap('mD', bookmarks.delete_all, 'Bookmarks Delete All') 27 | nmap("'", function() 28 | bookmarks.jump_to_mark(vim.fn.getcharstr()) 29 | end, 'Bookmarks Jump to Mark') 30 | nmap('m', function() 31 | bookmarks.toggle_mark(vim.fn.getcharstr()) 32 | end, 'Bookmarks Toggle Mark') 33 | 34 | local wiki = require('myplugins.wiki') 35 | nmap('wt', wiki.today, 'Wiki Today') 36 | nmap('wd', wiki.list_diary, 'Wiki Diary List') 37 | nmap('ww', wiki.list_wiki, 'Wiki List') 38 | nmap('wn', wiki.new, 'Wiki New') 39 | 40 | local zoom = require('myplugins.zoom') 41 | nmap('z', zoom.toggle, 'Zoom') 42 | 43 | local http = require('myplugins.httpyac') 44 | nmap('ho', http.toggle, 'HTTP Toggle') 45 | nmap('hh', http.run, 'HTTP Run') 46 | nmap('hH', http.run_all, 'HTTP Run All') 47 | nmap('he', http.select_env, 'HTTP Environment') 48 | -------------------------------------------------------------------------------- /nvim/.config/nvim/lua/config/utils.lua: -------------------------------------------------------------------------------- 1 | local group = vim.api.nvim_create_augroup('NeoVimRc', { clear = true }) 2 | 3 | local M = {} 4 | 5 | M.dot = function(callback) 6 | return function() 7 | _G.dot_repeat_callback = callback 8 | vim.go.operatorfunc = 'v:lua.dot_repeat_callback' 9 | vim.cmd('normal! g@l') 10 | end 11 | end 12 | 13 | M.map = function(mode, keys, func, desc, buffer, dot) 14 | if dot then 15 | if func then 16 | local f = func 17 | func = M.dot(function() 18 | f() 19 | end) 20 | end 21 | if desc then 22 | desc = desc .. ' [R]' 23 | end 24 | end 25 | 26 | vim.keymap.set(mode, keys, func, { buffer = buffer, desc = desc, remap = true, nowait = true }) 27 | end 28 | 29 | M.nmap = function(keys, func, desc, buffer) 30 | M.map('n', keys, func, desc, buffer) 31 | end 32 | 33 | M.rnmap = function(keys, func, desc, buffer) 34 | M.map('n', keys, func, desc, buffer, true) 35 | end 36 | 37 | M.vmap = function(keys, func, desc, buffer) 38 | M.map('v', keys, func, desc, buffer) 39 | end 40 | 41 | M.rvmap = function(keys, func, desc, buffer) 42 | M.map('v', keys, func, desc, buffer, true) 43 | end 44 | 45 | M.nvmap = function(keys, func, desc, buffer) 46 | M.map({ 'n', 'v' }, keys, func, desc, buffer) 47 | end 48 | 49 | M.rnvmap = function(keys, func, desc, buffer) 50 | M.map({ 'n', 'v' }, keys, func, desc, buffer, true) 51 | end 52 | 53 | M.au = function(event, opts) 54 | opts['group'] = group 55 | return vim.api.nvim_create_autocmd(event, opts) 56 | end 57 | 58 | return M 59 | -------------------------------------------------------------------------------- /nvim/.config/nvim/lua/config/registry/pylance.lua: -------------------------------------------------------------------------------- 1 | return { 2 | name = 'pylance', 3 | description = 'Fast, feature-rich language support for Python', 4 | categories = { 'LSP' }, 5 | homepage = 'https://github.com/microsoft/pylance', 6 | languages = { 'python' }, 7 | licenses = { 'Proprietary' }, 8 | source = { 9 | id = 'pkg:mason/pylance', 10 | ---@param ctx InstallContext 11 | install = function(ctx) 12 | ctx.spawn.bash({ 13 | '-c', 14 | [[ 15 | curl -s -c cookies.txt 'https://marketplace.visualstudio.com/items?itemName=ms-python.vscode-pylance' > /dev/null && 16 | curl -s "https://marketplace.visualstudio.com/_apis/public/gallery/publishers/ms-python/vsextensions/vscode-pylance/latest/vspackage" -j -b cookies.txt --compressed --output "pylance.vsix" 17 | ]], 18 | }) 19 | ctx.spawn.unzip({ 'pylance.vsix' }) 20 | ctx.spawn.bash({ 21 | '-c', 22 | [[ 23 | perl -pe 's/if\(!process.*?\)return!\[\];/if(false)return false;/g; s/throw new//g' extension/dist/server.bundle.js > extension/dist/server_nvim.js 24 | ]], 25 | }) 26 | ctx.fs:mkdir('bin') 27 | ctx.fs:write_file( 28 | 'bin/pylance', 29 | [[ 30 | #!/usr/bin/env bash 31 | node "$(dirname "$0")/../packages/pylance/extension/dist/server_nvim.js" "$@" 32 | ]] 33 | ) 34 | ctx.fs:chmod_exec('bin/pylance') 35 | end, 36 | }, 37 | bin = { 38 | ['pylance'] = 'bin/pylance', 39 | }, 40 | } 41 | -------------------------------------------------------------------------------- /qutebrowser/.config/qutebrowser/greasemonkey/youtube.js: -------------------------------------------------------------------------------- 1 | // ==UserScript== 2 | // @name Youtube Enhancements 3 | // @match *://*.youtube.com/* 4 | // ==/UserScript== 5 | 6 | (function() { 7 | 'use strict'; 8 | 9 | function skipAds() { 10 | const skipBtn = document.querySelector('.videoAdUiSkipButton, .ytp-ad-skip-button-modern, .ytp-skip-ad-button'); 11 | if (skipBtn) { 12 | setTimeout(() => skipBtn.click(), 500 + Math.random() * 1000); // 0.5-1.5s delay 13 | } 14 | const adVideo = document.querySelector('.ad-showing .video-stream'); 15 | if (adVideo && adVideo.duration > 0 && adVideo.currentTime < adVideo.duration) { 16 | // Fast-forward in small steps 17 | let interval = setInterval(() => { 18 | if (adVideo.currentTime < adVideo.duration - 0.5) { 19 | adVideo.currentTime += 2; 20 | } else { 21 | adVideo.currentTime = adVideo.duration; 22 | clearInterval(interval); 23 | } 24 | }, 200 + Math.random() * 200); // 0.2-0.4s interval 25 | } 26 | } 27 | 28 | function removeSponsored() { 29 | document.querySelectorAll('ytd-in-feed-ad-layout-renderer').forEach(el => el.remove()); 30 | document.querySelectorAll('ytd-engagement-panel-section-list-renderer[target-id="engagement-panel-ads"]').forEach(el => el.remove()); 31 | } 32 | 33 | function observer() { 34 | // skipAds(); 35 | removeSponsored(); 36 | } 37 | 38 | window.addEventListener('load', observer); 39 | new MutationObserver(observer).observe(document.body, { childList: true, subtree: true }); 40 | })(); 41 | -------------------------------------------------------------------------------- /mpv/.config/mpv/shaders/Anime4K_AutoDownscalePre_x2.glsl: -------------------------------------------------------------------------------- 1 | // This is free and unencumbered software released into the public domain. 2 | 3 | // Anyone is free to copy, modify, publish, use, compile, sell, or 4 | // distribute this software, either in source code form or as a compiled 5 | // binary, for any purpose, commercial or non-commercial, and by any 6 | // means. 7 | 8 | // In jurisdictions that recognize copyright laws, the author or authors 9 | // of this software dedicate any and all copyright interest in the 10 | // software to the public domain. We make this dedication for the benefit 11 | // of the public at large and to the detriment of our heirs and 12 | // successors. We intend this dedication to be an overt act of 13 | // relinquishment in perpetuity of all present and future rights to this 14 | // software under copyright law. 15 | 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | // IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR 20 | // OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 21 | // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | // OTHER DEALINGS IN THE SOFTWARE. 23 | 24 | // For more information, please refer to 25 | 26 | //!DESC Anime4K-v4.0-AutoDownscalePre-x2 27 | //!HOOK MAIN 28 | //!BIND HOOKED 29 | //!BIND NATIVE 30 | //!WHEN OUTPUT.w NATIVE.w / 2.0 < OUTPUT.h NATIVE.h / 2.0 < * OUTPUT.w NATIVE.w / 1.2 > OUTPUT.h NATIVE.h / 1.2 > * * 31 | //!WIDTH OUTPUT.w 32 | //!HEIGHT OUTPUT.h 33 | 34 | vec4 hook() { 35 | return HOOKED_tex(HOOKED_pos); 36 | } 37 | -------------------------------------------------------------------------------- /mpv/.config/mpv/shaders/Anime4K_AutoDownscalePre_x4.glsl: -------------------------------------------------------------------------------- 1 | // This is free and unencumbered software released into the public domain. 2 | 3 | // Anyone is free to copy, modify, publish, use, compile, sell, or 4 | // distribute this software, either in source code form or as a compiled 5 | // binary, for any purpose, commercial or non-commercial, and by any 6 | // means. 7 | 8 | // In jurisdictions that recognize copyright laws, the author or authors 9 | // of this software dedicate any and all copyright interest in the 10 | // software to the public domain. We make this dedication for the benefit 11 | // of the public at large and to the detriment of our heirs and 12 | // successors. We intend this dedication to be an overt act of 13 | // relinquishment in perpetuity of all present and future rights to this 14 | // software under copyright law. 15 | 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | // IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR 20 | // OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 21 | // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | // OTHER DEALINGS IN THE SOFTWARE. 23 | 24 | // For more information, please refer to 25 | 26 | //!DESC Anime4K-v3.2-AutoDownscalePre-x4 27 | //!HOOK MAIN 28 | //!BIND HOOKED 29 | //!BIND NATIVE 30 | //!WHEN OUTPUT.w NATIVE.w / 4.0 < OUTPUT.h NATIVE.h / 4.0 < * OUTPUT.w NATIVE.w / 2.4 > OUTPUT.h NATIVE.h / 2.4 > * * 31 | //!WIDTH OUTPUT.w 2 / 32 | //!HEIGHT OUTPUT.h 2 / 33 | 34 | vec4 hook() { 35 | return HOOKED_tex(HOOKED_pos); 36 | } 37 | -------------------------------------------------------------------------------- /nvim/.config/nvim/lua/config/icons.lua: -------------------------------------------------------------------------------- 1 | return { 2 | fold = { 3 | Closed = '', 4 | Open = '', 5 | }, 6 | ui = { 7 | User = ' ', 8 | Bot = ' ', 9 | Tool = '󰊳 ', 10 | Wiki = '󰈙', 11 | Git = '', 12 | Perf = '󰒪', 13 | Bookmark = '󰏚', 14 | }, 15 | dap = { 16 | Stopped = { '󰁕 ', 'DiagnosticWarn' }, 17 | Breakpoint = ' ', 18 | BreakpointCondition = ' ', 19 | BreakpointRejected = { ' ', 'DiagnosticError' }, 20 | LogPoint = '.>', 21 | }, 22 | diagnostics = { 23 | Error = ' ', 24 | Warn = ' ', 25 | Hint = ' ', 26 | Info = ' ', 27 | }, 28 | kinds = { 29 | Array = ' ', 30 | Boolean = '󰨙 ', 31 | Class = ' ', 32 | Codeium = '󰘦 ', 33 | Color = ' ', 34 | Control = ' ', 35 | Collapsed = ' ', 36 | Constant = '󰏿 ', 37 | Constructor = ' ', 38 | Enum = ' ', 39 | EnumMember = ' ', 40 | Event = ' ', 41 | Field = ' ', 42 | File = ' ', 43 | Folder = ' ', 44 | Function = '󰊕 ', 45 | Interface = ' ', 46 | Key = ' ', 47 | Keyword = ' ', 48 | Method = '󰊕 ', 49 | Module = ' ', 50 | Namespace = '󰦮 ', 51 | Null = ' ', 52 | Number = '󰎠 ', 53 | Object = ' ', 54 | Operator = ' ', 55 | Package = ' ', 56 | Property = ' ', 57 | Reference = ' ', 58 | Snippet = ' ', 59 | String = ' ', 60 | Struct = '󰆼 ', 61 | TabNine = '󰏚 ', 62 | Text = ' ', 63 | TypeParameter = ' ', 64 | Unit = ' ', 65 | Value = ' ', 66 | Variable = '󰀫 ', 67 | }, 68 | } 69 | -------------------------------------------------------------------------------- /bin/.local/bin/poenotifier: -------------------------------------------------------------------------------- 1 | #!/bin/python3 2 | 3 | from watchdog.observers import Observer 4 | from watchdog.events import FileSystemEventHandler 5 | from pathlib import Path 6 | import subprocess 7 | import time 8 | import os 9 | 10 | home = str(Path.home()) 11 | txt_file = os.path.join(home, ".local", "share", "Steam", "steamapps", "common", "Path of Exile", "logs", "Client.txt") 12 | 13 | notifiactions = [ 14 | "reflecting mist", 15 | "nameless seer" 16 | ] 17 | 18 | class LogHandler(FileSystemEventHandler): 19 | def __init__(self, file_path, keywords): 20 | self.file_path = file_path 21 | self.keywords = keywords 22 | print(f"[INFO] Monitoring file: {self.file_path}") 23 | print(f"[INFO] Keywords: {self.keywords}") 24 | self._seek_end() 25 | 26 | def _seek_end(self): 27 | self.f = open(self.file_path, 'r', encoding='utf-8', errors='ignore') 28 | self.f.seek(0, os.SEEK_END) 29 | print("[INFO] Seeked to end of file.") 30 | 31 | def on_modified(self, event): 32 | if event.src_path != self.file_path: 33 | return 34 | for line in self.f: 35 | for keyword in self.keywords: 36 | if keyword.lower() in line.lower(): 37 | print(f"[INFO] Found keyword '{keyword}' in line: {line.strip()}") 38 | subprocess.run(['notify-send', 'PoE Notifier', f"Found: {keyword}\n{line.strip()}"]) 39 | 40 | if __name__ == "__main__": 41 | event_handler = LogHandler(txt_file, notifiactions) 42 | observer = Observer() 43 | observer.schedule(event_handler, os.path.dirname(txt_file), recursive=False) 44 | observer.start() 45 | try: 46 | while True: 47 | time.sleep(1) 48 | except KeyboardInterrupt: 49 | observer.stop() 50 | observer.join() 51 | -------------------------------------------------------------------------------- /scripts/install-desktop.sh: -------------------------------------------------------------------------------- 1 | log "Installing desktop packages" 2 | packages=( 3 | alsa-utils 4 | vulkan-tools 5 | libva-utils 6 | brightnessctl 7 | gcr 8 | fonts-meta-base terminus-font terminus-font-ttf ttf-terminus-nerd 9 | udiskie 10 | imagemagick imv 11 | gammastep geoclue 12 | jamesdsp 13 | gpu-screen-recorder-git 14 | dunst 15 | cava 16 | zathura zathura-pdf-mupdf libreoffice-fresh gimp krita kdenlive # viewers and editors 17 | qutebrowser python-adblock python-readability-lxml # browser 18 | mpv subliminal yt-dlp # video player and downloader 19 | gamescope steam steamtinkerlaunch-git wine winetricks umu-launcher lutris # gaming 20 | stremio-enhanced-bin youtube-music-bin # media streaming 21 | vesktop-bin # discord 22 | calibre # ebook management 23 | ) 24 | install_pkgs "${packages[@]}" 25 | 26 | packages=( 27 | protonge 28 | ) 29 | install_asdf_pkgs "${packages[@]}" 30 | 31 | log "Configuring desktop" 32 | 33 | # Enable ntsync 34 | echo ntsync | sudo tee /etc/modules-load.d/ntsync.conf 35 | 36 | # Add steamtinkerlaunch compat 37 | steamtinkerlaunch compat add 38 | 39 | # Enable bitmap fonts (we need them to correctly render Terminus) 40 | if [ -f "/etc/fonts/conf.d/70-no-bitmaps.conf" ]; then 41 | sudo rm -f /etc/fonts/conf.d/70-no-bitmaps.conf 42 | fc-cache -f 43 | fi 44 | 45 | # pipewire crackling sometimes 46 | sudo mkdir -p /etc/pipewire/pipewire.conf.d 47 | echo 'context.properties = { 48 | default.clock.quantum = 2048 49 | default.clock.min-quantum = 1024 50 | default.clock.max-quantum = 4096 51 | }' | sudo tee /etc/pipewire/pipewire.conf.d/99-quantum.conf > /dev/null 52 | systemctl --user restart pipewire pipewire-pulse || true 53 | 54 | # Set default browser 55 | xdg-settings set default-web-browser qutebrowser.desktop || true 56 | -------------------------------------------------------------------------------- /tridactyl/.config/tridactyl/themes/solarized.css: -------------------------------------------------------------------------------- 1 | :root { 2 | --tridactyl-font-family: monospace; 3 | --tridactyl-font-family-sans: monospace; 4 | --tridactyl-font-size: 16pt; 5 | --tridactyl-small-font-size: calc(var(--tridactyl-font-size) * 0.75); 6 | 7 | --tridactyl-bg: #002b36; 8 | --tridactyl-fg: #839496; 9 | --tridactyl-logo: none; 10 | --tridactyl-scrollbar-color: #073642; 11 | 12 | --tridactyl-status-bg: #073642; 13 | --tridactyl-status-fg: #839496; 14 | --tridactyl-status-border: 1px #586e75 solid; 15 | 16 | --tridactyl-search-highlight-color: #b58900; 17 | 18 | --tridactyl-hintspan-bg: #b58900; 19 | --tridactyl-hintspan-fg: #002b36; 20 | --tridactyl-hintspan-border-color: #586e75; 21 | 22 | --tridactyl-hint-active-bg: #268bd2; 23 | --tridactyl-hint-active-fg: #002b36; 24 | --tridactyl-hint-active-outline: 1px solid #dc322f; 25 | 26 | --tridactyl-hint-bg: #073642; 27 | --tridactyl-hint-outline: 1px solid #b58900; 28 | 29 | --tridactyl-vs-bg: #002b36; 30 | --tridactyl-vs-fg: #839496; 31 | 32 | --tridactyl-cmdl-bg: #073642; 33 | --tridactyl-cmdl-fg: #839496; 34 | 35 | --tridactyl-cmplt-bg: #002b36; 36 | --tridactyl-cmplt-fg: #839496; 37 | --tridactyl-cmplt-border-top: 1px solid #586e75; 38 | 39 | --tridactyl-header-first-bg: #073642; 40 | --tridactyl-header-second-bg: #002b36; 41 | --tridactyl-header-third-bg: #073642; 42 | --tridactyl-header-font-weight: bold; 43 | --tridactyl-header-border-bottom: 1px solid #586e75; 44 | 45 | --tridactyl-url-fg: #268bd2; 46 | --tridactyl-url-bg: #002b36; 47 | 48 | --tridactyl-of-bg: #586e75; 49 | --tridactyl-of-fg: #839496; 50 | 51 | --tridactyl-highlight-box-bg: #073642; 52 | --tridactyl-highlight-box-fg: #839496; 53 | 54 | --tridactyl-externaledit-bg: none; 55 | } 56 | -------------------------------------------------------------------------------- /quickshell/.config/quickshell/bar/Theme.qml: -------------------------------------------------------------------------------- 1 | pragma Singleton 2 | import Quickshell 3 | import QtQuick 4 | 5 | QtObject { 6 | // Colors from yambar config 7 | readonly property string colorBg: "#002B36" 8 | readonly property string colorFg: "#93A1A1" 9 | readonly property string colorFgInv: "#002B36" 10 | readonly property string colorSuccess: "#859900" 11 | readonly property string colorActive: "#268BD2" 12 | readonly property string colorInactive: "#073642" 13 | readonly property string colorUrgent: "#CB4B16" 14 | readonly property string colorWarning: "#B58900" 15 | 16 | // Spacing 17 | readonly property int margin: 8 18 | 19 | // Font and bar settings 20 | readonly property string fontFamily: "monospace" 21 | readonly property int fontSize: Number(Quickshell.env("BAR_FONT_SIZE") || 12) 22 | readonly property int barHeight: Number(Quickshell.env("BAR_HEIGHT") || 30) 23 | 24 | // Icons 25 | readonly property string iconNetwork: " " 26 | readonly property string iconNetworkWired: " " 27 | readonly property string iconMemory: " " 28 | readonly property string iconCpu: " " 29 | readonly property string iconGpu: " " 30 | readonly property string iconVolume: " " 31 | readonly property string iconVolumeMuted: " " 32 | readonly property string iconMic: " " 33 | readonly property string iconMicMuted: " " 34 | readonly property string iconBrightness: " " 35 | readonly property string iconBattery: " " 36 | readonly property string iconClock: " " 37 | readonly property string iconPackages: " " 38 | readonly property string iconGithub: " " 39 | readonly property string iconFullscreen: " " 40 | readonly property string iconMinimized: " " 41 | readonly property string iconMaximized: " " 42 | readonly property string iconTiled: " " 43 | } 44 | -------------------------------------------------------------------------------- /nvim/.config/nvim/lua/config/copilot_extensions.lua: -------------------------------------------------------------------------------- 1 | require('CopilotChat.config').providers.gemini = { 2 | prepare_input = require('CopilotChat.config.providers').copilot.prepare_input, 3 | prepare_output = require('CopilotChat.config.providers').copilot.prepare_output, 4 | 5 | get_headers = function() 6 | local api_key = assert(os.getenv('GEMINI_API_KEY'), 'GEMINI_API_KEY env not set') 7 | return { 8 | Authorization = 'Bearer ' .. api_key, 9 | ['Content-Type'] = 'application/json', 10 | } 11 | end, 12 | 13 | get_models = function(headers) 14 | local response, err = 15 | require('CopilotChat.utils.curl').get('https://generativelanguage.googleapis.com/v1beta/openai/models', { 16 | headers = headers, 17 | json_response = true, 18 | }) 19 | 20 | if err then 21 | error(err) 22 | end 23 | 24 | return vim.tbl_map(function(model) 25 | local id = model.id:gsub('^models/', '') 26 | return { 27 | id = id, 28 | name = id, 29 | streaming = true, 30 | tools = true, 31 | } 32 | end, response.body.data) 33 | end, 34 | 35 | get_url = function() 36 | return 'https://generativelanguage.googleapis.com/v1beta/openai/chat/completions' 37 | end, 38 | } 39 | 40 | require('CopilotChat.config').functions.keymaps = { 41 | description = 'Show all globally defined keymaps', 42 | uri = 'neovim://keymaps', 43 | resolve = function() 44 | local maps = vim.api.nvim_get_keymap('n') 45 | local lines = {} 46 | 47 | for _, map in ipairs(maps) do 48 | table.insert(lines, string.format('%-10s -> %s [%s]', map.lhs, map.rhs or '', map.desc or '')) 49 | end 50 | 51 | return { 52 | { 53 | data = table.concat(lines, '\n'), 54 | uri = 'neovim://keymaps', 55 | }, 56 | } 57 | end, 58 | } 59 | -------------------------------------------------------------------------------- /mpv/.config/mpv/input.conf: -------------------------------------------------------------------------------- 1 | # Anime4K 2 | CTRL+1 no-osd change-list glsl-shaders set "~~/shaders/Anime4K_Clamp_Highlights.glsl:~~/shaders/Anime4K_Restore_CNN_VL.glsl:~~/shaders/Anime4K_Upscale_CNN_x2_VL.glsl:~~/shaders/Anime4K_AutoDownscalePre_x2.glsl:~~/shaders/Anime4K_AutoDownscalePre_x4.glsl:~~/shaders/Anime4K_Upscale_CNN_x2_M.glsl"; show-text "Anime4K: Mode A (HQ)" 3 | CTRL+2 no-osd change-list glsl-shaders set "~~/shaders/Anime4K_Clamp_Highlights.glsl:~~/shaders/Anime4K_Restore_CNN_Soft_VL.glsl:~~/shaders/Anime4K_Upscale_CNN_x2_VL.glsl:~~/shaders/Anime4K_AutoDownscalePre_x2.glsl:~~/shaders/Anime4K_AutoDownscalePre_x4.glsl:~~/shaders/Anime4K_Upscale_CNN_x2_M.glsl"; show-text "Anime4K: Mode B (HQ)" 4 | CTRL+3 no-osd change-list glsl-shaders set "~~/shaders/Anime4K_Clamp_Highlights.glsl:~~/shaders/Anime4K_Upscale_Denoise_CNN_x2_VL.glsl:~~/shaders/Anime4K_AutoDownscalePre_x2.glsl:~~/shaders/Anime4K_AutoDownscalePre_x4.glsl:~~/shaders/Anime4K_Upscale_CNN_x2_M.glsl"; show-text "Anime4K: Mode C (HQ)" 5 | CTRL+4 no-osd change-list glsl-shaders set "~~/shaders/Anime4K_Clamp_Highlights.glsl:~~/shaders/Anime4K_Restore_CNN_VL.glsl:~~/shaders/Anime4K_Upscale_CNN_x2_VL.glsl:~~/shaders/Anime4K_Restore_CNN_M.glsl:~~/shaders/Anime4K_AutoDownscalePre_x2.glsl:~~/shaders/Anime4K_AutoDownscalePre_x4.glsl:~~/shaders/Anime4K_Upscale_CNN_x2_M.glsl"; show-text "Anime4K: Mode A+A (HQ)" 6 | CTRL+5 no-osd change-list glsl-shaders set "~~/shaders/Anime4K_Clamp_Highlights.glsl:~~/shaders/Anime4K_Restore_CNN_Soft_VL.glsl:~~/shaders/Anime4K_Upscale_CNN_x2_VL.glsl:~~/shaders/Anime4K_AutoDownscalePre_x2.glsl:~~/shaders/Anime4K_AutoDownscalePre_x4.glsl:~~/shaders/Anime4K_Restore_CNN_Soft_M.glsl:~~/shaders/Anime4K_Upscale_CNN_x2_M.glsl"; show-text "Anime4K: Mode B+B (HQ)" 7 | CTRL+6 no-osd change-list glsl-shaders set "~~/shaders/Anime4K_Clamp_Highlights.glsl:~~/shaders/Anime4K_Upscale_Denoise_CNN_x2_VL.glsl:~~/shaders/Anime4K_AutoDownscalePre_x2.glsl:~~/shaders/Anime4K_AutoDownscalePre_x4.glsl:~~/shaders/Anime4K_Restore_CNN_M.glsl:~~/shaders/Anime4K_Upscale_CNN_x2_M.glsl"; show-text "Anime4K: Mode C+A (HQ)" 8 | CTRL+0 no-osd change-list glsl-shaders clr ""; show-text "GLSL shaders cleared" 9 | -------------------------------------------------------------------------------- /nvim/.config/nvim/after/ftplugin/cs.lua: -------------------------------------------------------------------------------- 1 | local dap = require('dap') 2 | local dap_utils = require('dap.utils') 3 | 4 | local function dotnet_build_project(callback) 5 | local path = vim.fn.getcwd() .. '/' 6 | local cmd = { 'dotnet', 'build', '-c', 'Debug', path } 7 | 8 | vim.api.nvim_out_write('Building project: ' .. table.concat(cmd, ' ') .. '\n') 9 | 10 | local function on_exit(result) 11 | if result.code == 0 then 12 | vim.api.nvim_out_write('Build: ✔️\n') 13 | else 14 | vim.api.nvim_out_write('Build: ❌ (code: ' .. result.code .. ')\n') 15 | end 16 | 17 | if callback then 18 | callback(result.code) 19 | end 20 | end 21 | 22 | vim.system(cmd, { 23 | text = true, 24 | stdout = vim.schedule_wrap(function(_, data) 25 | if data then 26 | vim.api.nvim_out_write(data) 27 | end 28 | end), 29 | stderr = vim.schedule_wrap(function(_, data) 30 | if data then 31 | vim.api.nvim_out_write(data) 32 | end 33 | end), 34 | }, vim.schedule_wrap(on_exit)) 35 | end 36 | 37 | local function dotnet_get_dll_paths() 38 | return vim.fn.glob(vim.fn.getcwd() .. '/bin/Debug/**/*.dll', false, true) 39 | end 40 | 41 | dap.adapters.coreclr = function(callback, _) 42 | dotnet_build_project(function() 43 | callback({ 44 | type = 'executable', 45 | command = 'netcoredbg', 46 | args = { '--interpreter=vscode' }, 47 | }) 48 | end) 49 | end 50 | 51 | dap.configurations.cs = { 52 | { 53 | type = 'coreclr', 54 | request = 'attach', 55 | console = 'integratedTerminal', 56 | name = 'Attach to process', 57 | processId = dap_utils.pick_process, 58 | }, 59 | } 60 | 61 | for _, dll_path in ipairs(dotnet_get_dll_paths()) do 62 | table.insert(dap.configurations.cs, { 63 | type = 'coreclr', 64 | request = 'launch', 65 | console = 'integratedTerminal', 66 | name = 'Launch - ' .. dll_path, 67 | program = dll_path, 68 | }) 69 | end 70 | -------------------------------------------------------------------------------- /quickshell/.config/quickshell/bar/NetworkWidget.qml: -------------------------------------------------------------------------------- 1 | import Quickshell 2 | import Quickshell.Io 3 | import QtQuick 4 | 5 | Text { 6 | id: root 7 | property string netInterface: "" 8 | property string ssid: "" 9 | property string ipv4: "" 10 | property bool isWlan: false 11 | 12 | text: isWlan ? Theme.iconNetwork + " " + ssid : Theme.iconNetworkWired + " " + ipv4 13 | color: Theme.colorFg 14 | font.family: Theme.fontFamily 15 | font.pixelSize: Theme.fontSize 16 | leftPadding: Theme.margin 17 | rightPadding: Theme.margin 18 | 19 | Process { 20 | id: ifaceProc 21 | command: ["sh", "-c", "ip -j addr show | jq -r '.[] | select(.operstate == \"UP\" and .ifname != \"lo\") | .ifname' | head -n1"] 22 | running: false 23 | stdout: SplitParser { 24 | onRead: (data) => { 25 | var iface = data.trim() 26 | if (!iface) return 27 | 28 | root.netInterface = iface 29 | root.isWlan = iface.startsWith("wl") 30 | 31 | if (root.isWlan) { 32 | ipProc.running = false 33 | ssidProc.running = true 34 | } else { 35 | ipProc.running = true 36 | ssidProc.running = false 37 | } 38 | } 39 | } 40 | } 41 | 42 | Process { 43 | id: ssidProc 44 | command: ["sh", "-c", "iw dev " + root.netInterface + " link | grep 'SSID:' | awk '{print $2}'"] 45 | running: false 46 | stdout: SplitParser { 47 | onRead: data => root.ssid = data.trim() 48 | } 49 | } 50 | 51 | Process { 52 | id: ipProc 53 | command: ["sh", "-c", "ip -4 addr show " + root.netInterface + " | grep -oP '(?<=inet\\s)\\d+(\\.\\d+){3}'"] 54 | running: false 55 | stdout: SplitParser { 56 | onRead: data => root.ipv4 = data.trim() 57 | } 58 | } 59 | 60 | Timer { 61 | interval: 5000 62 | running: true 63 | repeat: true 64 | triggeredOnStart: true 65 | onTriggered: ifaceProc.running = true 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /qutebrowser/.config/qutebrowser/greasemonkey/cookie-skip.js: -------------------------------------------------------------------------------- 1 | // ==UserScript== 2 | // @name Auto Cookie Reject 3 | // @match *://*/* 4 | // ==/UserScript== 5 | 6 | (function() { 7 | 'use strict'; 8 | 9 | const handleCookieBanners = () => { 10 | // First, try to find and click reject buttons 11 | const rejectTexts = [ 12 | "Refuser", "Refuser tous les cookies", "Refuser les cookies", "Rejeter", 13 | "Refuse", "Reject all cookies", "Reject cookies", "Decline", 14 | "Continuer sans accepter", "Continue without accepting", "Tout refuser", "Decline all" 15 | ]; 16 | 17 | const buttons = Array.from(document.querySelectorAll('button, input[type="button"], input[type="submit"]')); 18 | let buttonClicked = false; 19 | 20 | buttons.forEach(btn => { 21 | if (buttonClicked) return; 22 | const text = btn.textContent.trim() || btn.value?.trim(); 23 | if (text && rejectTexts.some(t => text.includes(t))) { 24 | btn.click(); 25 | buttonClicked = true; 26 | } 27 | }); 28 | 29 | // If no reject button was found, hide cookie banners 30 | if (!buttonClicked) { 31 | const selectors = [ 32 | '[class*="cookie"]', '[id*="cookie"]', 33 | '[class*="gdpr"]', '[id*="gdpr"]', 34 | '[class*="consent"]', '[id*="consent"]', 35 | '[class*="privacy"]', '[id*="privacy"]', 36 | '#eu-cookie-policy', '.cookie-infobar', 37 | '.cookie-banner', '.cookie-notice', '.cookie-bar', 38 | '.gdpr-banner', '.consent-banner', '.privacy-banner' 39 | ]; 40 | 41 | selectors.forEach(selector => { 42 | document.querySelectorAll(selector).forEach(el => { 43 | const text = el.textContent.toLowerCase(); 44 | if (text.includes('cookie') || text.includes('privacy') || 45 | text.includes('consent') || text.includes('gdpr')) { 46 | el.style.display = 'none'; 47 | } 48 | }); 49 | }); 50 | } 51 | }; 52 | 53 | window.addEventListener('load', handleCookieBanners); 54 | })(); 55 | -------------------------------------------------------------------------------- /quickshell/.config/quickshell/bar/NotificationsWidget.qml: -------------------------------------------------------------------------------- 1 | import Quickshell 2 | import Quickshell.Io 3 | import QtQuick 4 | import QtQuick.Layouts 5 | 6 | RowLayout { 7 | id: root 8 | spacing: 0 9 | 10 | property int officialUpdates: 0 11 | property int aurUpdates: 0 12 | property int github: 0 13 | 14 | Text { 15 | visible: (root.officialUpdates + root.aurUpdates) > 0 16 | text: Theme.iconPackages + " " + (root.officialUpdates + root.aurUpdates) 17 | color: Theme.colorUrgent 18 | font.family: Theme.fontFamily 19 | font.pixelSize: Theme.fontSize 20 | leftPadding: Theme.margin 21 | rightPadding: Theme.margin 22 | } 23 | 24 | Text { 25 | visible: root.github > 0 26 | text: Theme.iconGithub + " " + root.github 27 | color: Theme.colorActive 28 | font.family: Theme.fontFamily 29 | font.pixelSize: Theme.fontSize 30 | leftPadding: Theme.margin 31 | rightPadding: Theme.margin 32 | } 33 | 34 | Process { 35 | id: officialProc 36 | command: ["sh", "-c", "checkupdates 2>/dev/null | wc -l"] 37 | running: false 38 | stdout: SplitParser { 39 | onRead: data => root.officialUpdates = parseInt(data.trim()) 40 | } 41 | } 42 | 43 | Process { 44 | id: aurProc 45 | command: ["sh", "-c", "yay -Qum 2>/dev/null | wc -l"] 46 | running: false 47 | stdout: SplitParser { 48 | onRead: data => root.aurUpdates = parseInt(data.trim()) 49 | } 50 | } 51 | 52 | Process { 53 | id: ghProc 54 | command: ["gh", "api", "notifications", "--jq", "length"] 55 | running: false 56 | stdout: SplitParser { 57 | onRead: data => root.github = parseInt(data.trim()) 58 | } 59 | } 60 | 61 | Timer { 62 | interval: 600000 63 | running: true 64 | repeat: true 65 | triggeredOnStart: true 66 | onTriggered: { 67 | officialProc.running = true 68 | aurProc.running = true 69 | } 70 | } 71 | 72 | Timer { 73 | interval: 60000 74 | running: true 75 | repeat: true 76 | triggeredOnStart: true 77 | onTriggered: ghProc.running = true 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /bin/.local/bin/fzfmenu: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | scriptpath=$(dirname "$(readlink -f "$0")") 3 | 4 | FILE_ARGS=$(mktemp /tmp/fzfmenu_args.XXXXXX) 5 | FILE_CHOICES=$(mktemp /tmp/fzfmenu_choices.XXXXXX) 6 | TITLE="" 7 | TERM_CLASS="--class" 8 | if [ "$TERMINAL" = "st" ]; then 9 | TERM_CLASS="-n" 10 | elif [ "$TERMINAL" = "foot" ] || [ "$TERMINAL" = "footclient" ]; then 11 | TERM_CLASS="-a" 12 | fi 13 | 14 | kill_old() { 15 | mypid=$$ 16 | same="" 17 | others="" 18 | while read -r pid cmdline; do 19 | [ "$pid" = "$mypid" ] && continue 20 | if echo "$cmdline" | grep -q -- "-p $TITLE"; then 21 | same="$pid" 22 | else 23 | others="$others $pid" 24 | fi 25 | done < <(pgrep -af fzfmenu) 26 | [ -n "$same" ] && kill "$same" && exit 0 27 | [ -n "$others" ] && kill $others 28 | } 29 | 30 | scan_args() { 31 | while IFS= read -r line; do echo "$line"; done 32 | [ -n "$line" ] && echo "$line" 33 | } 34 | 35 | show() { 36 | while IFS= read -r line; do echo "$line"; done < "$FILE_CHOICES"; 37 | } 38 | 39 | run_menu() { 40 | scan_args > "$FILE_ARGS" 41 | kill_old 42 | prompt "$@" 43 | show 44 | } 45 | 46 | prompt() { 47 | : > "$FILE_CHOICES" 48 | $TERMINAL $TERM_CLASS shellmenu -T "$TITLE" \ 49 | -e "$SHELL" -c " 50 | exec fzf \ 51 | --no-border \ 52 | --margin 0,0 \ 53 | --preview-window=border-sharp:wrap \ 54 | --no-separator \ 55 | --info=inline-right \ 56 | --cycle \ 57 | --print-query \ 58 | --no-multi \ 59 | --reverse \ 60 | --bind 'ctrl-y:execute(echo {} | wl-copy)+abort' \ 61 | --header='Enter: select Ctrl-Y: copy to clipboard' \ 62 | $PROMPT $QUERY $@ < $FILE_ARGS | tail -n 1 >! $FILE_CHOICES 63 | " & 64 | pid=$! 65 | trap "kill -TERM $pid" SIGTERM 66 | wait $pid 67 | [ -s "$FILE_CHOICES" ] || exit 1 68 | } 69 | 70 | main() { 71 | while :; do 72 | case $1 in 73 | -l) shift ;; 74 | -p) shift && TITLE="$1" && PROMPT="--prompt \"$1 > \"" ;; 75 | -q) shift && QUERY="-q \"$1\"" ;; 76 | *) break ;; 77 | esac 78 | shift 79 | done 80 | quoted_args="" 81 | if [ $# -gt 0 ]; then 82 | quoted_args="$(printf "%q " "$@")" 83 | fi 84 | run_menu "$quoted_args" 85 | } 86 | 87 | trap 'rm -f "$FILE_ARGS" "$FILE_CHOICES"' EXIT 88 | main "$@" 89 | -------------------------------------------------------------------------------- /nvim/.config/nvim/lua/config/treesitter.lua: -------------------------------------------------------------------------------- 1 | local packages = vim.iter(require('config.languages')) 2 | :map(function(server) 3 | return server.treesitter 4 | end) 5 | :filter(function(server) 6 | return server 7 | end) 8 | :flatten() 9 | :totable() 10 | 11 | vim.api.nvim_create_user_command('TSUpdateSync', function() 12 | vim.notify('Syncing treesitter parsers...', vim.log.levels.INFO) 13 | local ts = require('nvim-treesitter') 14 | local installed = ts.get_installed() 15 | local to_install = vim.tbl_filter(function(lang) 16 | return not vim.tbl_contains(installed, lang) 17 | end, packages) 18 | local to_uninstall = vim.tbl_filter(function(lang) 19 | return not vim.tbl_contains(packages, lang) 20 | end, installed) 21 | if #to_uninstall > 0 then 22 | ts.uninstall(to_uninstall):wait() 23 | end 24 | if #to_install > 0 then 25 | ts.install(to_install):wait() 26 | end 27 | 28 | ts.update():wait() 29 | vim.notify('Successfully synced ' .. #packages .. ' parsers.', vim.log.levels.INFO) 30 | end, {}) 31 | 32 | vim.api.nvim_create_autocmd('FileType', { 33 | pattern = '*', 34 | callback = function(ev) 35 | local ft = ev.match 36 | local lang = vim.treesitter.language.get_lang(ft) 37 | if not lang or not vim.treesitter.language.add(lang) then 38 | return 39 | end 40 | 41 | vim.notify('Starting treesitter for ' .. lang, vim.log.levels.INFO) 42 | vim.treesitter.start(ev.buf) 43 | vim.bo.syntax = 'on' 44 | 45 | -- NOTE: indent forces a re-parse, which negates the benefit of async 46 | -- parsing see https://github.com/nvim-treesitter/nvim-treesitter/issues/7840 47 | -- if lang and vim.treesitter.query.get(lang, 'folds') then 48 | -- vim.wo.foldexpr = 'v:lua.vim.treesitter.foldexpr()' 49 | -- end 50 | -- 51 | -- if lang and vim.treesitter.query.get(lang, 'indents') then 52 | -- vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()" 53 | -- end 54 | 55 | -- Treehopper mappings 56 | vim.cmd([[ 57 | omap m :lua require('tsht').nodes() 58 | xnoremap m :lua require('tsht').nodes() 59 | ]]) 60 | end, 61 | }) 62 | 63 | vim.treesitter.language.register('bash', 'zsh') 64 | -------------------------------------------------------------------------------- /quickshell/.config/quickshell/bar/TopLevelWidget.qml: -------------------------------------------------------------------------------- 1 | import Quickshell 2 | import Quickshell.Wayland 3 | import QtQuick 4 | import QtQuick.Layouts 5 | 6 | RowLayout { 7 | spacing: 0 8 | 9 | property var activeWindow: ToplevelManager.activeToplevel 10 | 11 | Rectangle { 12 | Layout.preferredWidth: modeText.visible ? modeText.implicitWidth + Theme.margin * 2 : 0 13 | Layout.fillHeight: true 14 | visible: activeWindow 15 | color: Theme.colorActive 16 | 17 | Text { 18 | id: modeText 19 | anchors.centerIn: parent 20 | text: activeWindow.fullScreen ? Theme.iconFullscreen : 21 | activeWindow.minimized ? Theme.iconMinimized : 22 | activeWindow.maximized ? Theme.iconMaximized : 23 | Theme.iconTiled 24 | color: Theme.colorFgInv 25 | font.family: Theme.fontFamily 26 | font.pixelSize: Theme.fontSize 27 | } 28 | } 29 | 30 | Rectangle { 31 | Layout.preferredWidth: classText.visible ? classText.implicitWidth + Theme.margin * 2 : 0 32 | Layout.fillHeight: true 33 | visible: (activeWindow?.appId ?? "") !== "" 34 | color: Theme.colorInactive 35 | 36 | Text { 37 | id: classText 38 | anchors.centerIn: parent 39 | text: { 40 | let id = activeWindow.appId; 41 | let idx = id.lastIndexOf("."); 42 | return idx !== -1 ? id.substring(idx + 1) : id; 43 | } 44 | color: Theme.colorFg 45 | font.family: Theme.fontFamily 46 | font.pixelSize: Theme.fontSize 47 | } 48 | } 49 | 50 | Rectangle { 51 | Layout.preferredWidth: Math.min(titleText.implicitWidth + Theme.margin * 2, 600) 52 | Layout.fillHeight: true 53 | visible: (activeWindow?.title ?? "") !== "" 54 | color: "transparent" 55 | 56 | Text { 57 | id: titleText 58 | anchors.fill: parent 59 | anchors.leftMargin: Theme.margin 60 | anchors.rightMargin: Theme.margin 61 | verticalAlignment: Text.AlignVCenter 62 | text: activeWindow.title 63 | color: Theme.colorFg 64 | font.family: Theme.fontFamily 65 | font.pixelSize: Theme.fontSize 66 | elide: Text.ElideRight 67 | } 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # dotfiles 2 | 3 | These are my configuration files for Linux. It is still work in 4 | progress, so expect a lot of changes, but I think it is stable enough to be 5 | usable. 6 | My NeoVim configuration is great for Java, Typescript and Python development when 7 | running Vim in Tmux and using Git. So, if you are doing all of this, then feel 8 | free to steal some stuff from here. 9 | 10 | See [CHEATSHEET.md](/CHEATSHEET.md) for more details about included stuff. 11 | 12 | ![Screenshot](/screenshot.png) 13 | 14 | ## Requirements 15 | 16 | * [git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) - Most of 17 | the installation process is managed via Git, so you need this one. 18 | * [stow](https://www.gnu.org/software/stow/) - Stow is used for dotfile 19 | installation (creating symlinks) 20 | 21 | ## How to install? 22 | 23 | It is simple, just use `make` 24 | 25 | git clone git://github.com/deathbeam/dotfiles ~/.dotfiles 26 | cd ~/.dotfiles 27 | make 28 | 29 | ## How to update? 30 | 31 | Pull latest changes and run `make`: 32 | 33 | cd ~/.dotfiles 34 | git pull --rebase 35 | make 36 | 37 | ## How to uninstall? 38 | 39 | Just use `make`: 40 | 41 | cd ~/.dotfiles 42 | make uninstall 43 | 44 | ## How to inlude your own stuff? 45 | 46 | After you have installed dotfiles, you can start including your own stuff by 47 | creating appropriate `.local` dotfiles in home directory: 48 | 49 | $EDITOR ~/.gitconfig.local 50 | $EDITOR ~/.vimrc.local 51 | $EDITOR ~/.profile.local 52 | $EDITOR ~/.zshrc.local 53 | $EDITOR ~/.tmux.conf.local 54 | 55 | To add your own Vim, Tmux or Zsh plugin you can just clone it to proper 56 | `pack/local/start` directory: 57 | 58 | # Add SuperTab vim plugin 59 | git clone git://github.com/ervandew/supertab \ 60 | ~/.config/nvim/pack/local/start/supertab 61 | 62 | # Add Tmux sessionist plugin 63 | git clone git://github.com/tmux-plugins/tmux-sessionist \ 64 | ~/.tmux/pack/local/start/tmux-sessionist 65 | 66 | # Add zsh-autoenv zsh plugin 67 | git clone git://github.com/Tarrasch/zsh-autoenv \ 68 | ~/.zsh/pack/local/start/zsh-autoenv 69 | 70 | ## Included stuff 71 | 72 | - [/zsh/.zsh/pack/bundle/start](/zsh/.zsh/pack/bundle/start) ZSH plugins 73 | - [/tmux/.tmux/pack/bundle/start](/tmux/.tmux/pack/bundle/start) TMUX plugins 74 | - [/nvim/.config/nvim/pack/bundle/start](/nvim/.config/nvim/pack/bundle/start) Neovim plugins 75 | -------------------------------------------------------------------------------- /tmux/.tmux/switch-session.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | tmux_sessions=$(tmux list-sessions -F '#S') 4 | project_directories=$( 5 | find -L ~/git ~/git-work -mindepth 1 -maxdepth 1 -type d 6 | find -L ~ -mindepth 1 -maxdepth 1 -type d -name '[A-Z]*' 7 | ) 8 | 9 | function session_name() { 10 | basename $1 | tr . _ 11 | } 12 | 13 | function directory_name() { 14 | basename $1 | tr _ . 15 | } 16 | 17 | function get_marked_sessions() { 18 | current_session=$(tmux display-message -p '#S') 19 | 20 | # First, handle existing tmux sessions that don't have corresponding directories 21 | while IFS= read -r session; do 22 | dir_name="$(directory_name "$session")" 23 | if ! echo "$project_directories" | grep -q "$dir_name"; then 24 | if [[ "$session" == "$current_session" ]]; then 25 | echo -e "\033[0;32m$session\033[0m" 26 | else 27 | echo -e "\033[0;36m$session\033[0m" 28 | fi 29 | fi 30 | done <<< "$tmux_sessions" 31 | 32 | # Then, handle directories, marking those that have sessions 33 | while IFS= read -r directory; do 34 | sess_name="$(session_name "$directory")" 35 | if echo "$tmux_sessions" | grep -q "^${sess_name}$"; then 36 | if [[ "$sess_name" == "$current_session" ]]; then 37 | echo -e "\033[0;32m$directory\033[0m" 38 | else 39 | echo -e "\033[0;36m$directory\033[0m" 40 | fi 41 | else 42 | echo "$directory" 43 | fi 44 | done <<< "$project_directories" 45 | } 46 | 47 | selected_project=$(get_marked_sessions | sort | fzf-tmux \ 48 | --ansi -p100%,100% -m --reverse \ 49 | --prompt='Open session > ' \ 50 | --bind="ctrl-s:print-query" \ 51 | --header=' to use query' \ 52 | --preview=' 53 | session_name=$(basename {} | tr . _) 54 | if tmux has-session -t=$session_name 2>/dev/null; then 55 | # -e captures SGR escape sequences (colors) 56 | # -J disables word-wrap 57 | tmux capture-pane -e -J -t $session_name:1.1 -p 58 | else 59 | ls --group-directories-first --color=always -lahG {} 60 | fi 61 | ') 62 | 63 | if [[ -z $selected_project ]]; then 64 | exit 0 65 | fi 66 | 67 | selected_name=$(session_name "$selected_project") 68 | 69 | if ! tmux has-session -t=$selected_name 2> /dev/null; then 70 | tmux new-session -ds $selected_name -c $selected_project 71 | fi 72 | 73 | tmux switch-client -t $selected_name 74 | -------------------------------------------------------------------------------- /nvim/.config/nvim/lua/config/languages.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | treesitter = { 'javascript', 'typescript' }, 4 | mason = { 'vtsls', 'js-debug-adapter' }, 5 | lsp = { 'vtsls' }, 6 | }, 7 | { 8 | treesitter = { 'python' }, 9 | -- mason = { 'ty' }, 10 | -- lsp = { 'ty' }, 11 | mason = { 'pylance', 'debugpy' }, 12 | lsp = { 'pylance' }, 13 | }, 14 | { 15 | treesitter = { 'java' }, 16 | mason = { 'jdtls', 'java-debug-adapter', 'java-test', 'vscode-spring-boot-tools' }, 17 | lsp = { 'jdtls' }, 18 | }, 19 | { 20 | treesitter = { 'c_sharp' }, 21 | mason = { 'roslyn', 'netcoredbg' }, 22 | lsp = { 'roslyn' }, 23 | }, 24 | { 25 | treesitter = { 'c' }, 26 | mason = { 'clangd' }, 27 | lsp = { 'clangd' }, 28 | }, 29 | { 30 | treesitter = { 'nim' }, 31 | -- needs manual install, choosenim-bin, nimlangserver-git 32 | -- mason = { 'nimlangserver' }, 33 | lsp = { 'nim_langserver' }, 34 | }, 35 | { 36 | treesitter = { 'lua' }, 37 | -- mason = { 'emmylua_ls' }, 38 | -- lsp = { 'emmylua_ls' }, 39 | mason = { 'lua-language-server' }, 40 | lsp = { 'lua_ls' }, 41 | }, 42 | { 43 | treesitter = { 'bash' }, 44 | mason = { 'bash-language-server' }, 45 | lsp = { 'bashls' }, 46 | }, 47 | { 48 | treesitter = { 'vim', 'vimdoc' }, 49 | mason = { 'vim-language-server' }, 50 | lsp = { 'vimls' }, 51 | }, 52 | { 53 | treesitter = { 'yaml' }, 54 | mason = { 'yaml-language-server' }, 55 | lsp = { 'yamlls' }, 56 | }, 57 | { 58 | treesitter = { 'css' }, 59 | mason = { 'css-lsp' }, 60 | lsp = { 'cssls' }, 61 | }, 62 | { 63 | treesitter = { 'html' }, 64 | mason = { 'html-lsp' }, 65 | lsp = { 'html' }, 66 | }, 67 | { 68 | treesitter = { 'markdown', 'markdown_inline' }, 69 | mason = { 'marksman' }, 70 | lsp = { 'marksman' }, 71 | }, 72 | { 73 | treesitter = { 'json' }, 74 | }, 75 | { 76 | treesitter = { 'xml' }, 77 | }, 78 | { 79 | treesitter = { 'diff', 'gitcommit' }, 80 | }, 81 | { 82 | treesitter = { 'http' }, 83 | }, 84 | { 85 | mason = { 'harper-ls' }, 86 | lsp = { 'harper_ls' }, 87 | }, 88 | { 89 | mason = { 'copilot-language-server' }, 90 | lsp = { 'copilot' }, 91 | }, 92 | } 93 | -------------------------------------------------------------------------------- /scripts/install-av.sh: -------------------------------------------------------------------------------- 1 | log "Installing ClamAV" 2 | install_pkgs clamav 3 | 4 | log "Updating virus database" 5 | sudo freshclam 6 | 7 | log "Ensuring required clamd.conf options" 8 | CLAMD_CONF="/etc/clamav/clamd.conf" 9 | append_config "LogTime yes" "$CLAMD_CONF" 10 | append_config "ExtendedDetectionInfo yes" "$CLAMD_CONF" 11 | append_config "User clamav" "$CLAMD_CONF" 12 | append_config "MaxDirectoryRecursion 20" "$CLAMD_CONF" 13 | append_config "DetectPUA yes" "$CLAMD_CONF" 14 | append_config "HeuristicAlerts yes" "$CLAMD_CONF" 15 | append_config "ScanPE yes" "$CLAMD_CONF" 16 | append_config "ScanELF yes" "$CLAMD_CONF" 17 | append_config "ScanOLE2 yes" "$CLAMD_CONF" 18 | append_config "ScanPDF yes" "$CLAMD_CONF" 19 | append_config "ScanSWF yes" "$CLAMD_CONF" 20 | append_config "ScanXMLDOCS yes" "$CLAMD_CONF" 21 | append_config "ScanHWP3 yes" "$CLAMD_CONF" 22 | append_config "ScanOneNote yes" "$CLAMD_CONF" 23 | append_config "ScanMail yes" "$CLAMD_CONF" 24 | append_config "ScanHTML yes" "$CLAMD_CONF" 25 | append_config "ScanArchive yes" "$CLAMD_CONF" 26 | append_config "Bytecode yes" "$CLAMD_CONF" 27 | append_config "OnAccessExcludeUname clamav" "$CLAMD_CONF" 28 | append_config "OnAccessMountPath /" "$CLAMD_CONF" 29 | append_config "OnAccessPrevention no" "$CLAMD_CONF" 30 | append_config "OnAccessExtraScanning yes" "$CLAMD_CONF" 31 | append_config "VirusEvent /etc/clamav/virus-event.bash" "$CLAMD_CONF" 32 | 33 | log "Creating virus-event.bash" 34 | sudo tee /etc/clamav/virus-event.bash > /dev/null <<'EOF' 35 | #!/bin/bash 36 | PATH=/usr/bin 37 | ALERT="Signature detected by clamav: $CLAM_VIRUSEVENT_VIRUSNAME in $CLAM_VIRUSEVENT_FILENAME" 38 | for ADDRESS in /run/user/*; do 39 | USERID=${ADDRESS#/run/user/} 40 | /usr/bin/sudo -u "#$USERID" DBUS_SESSION_BUS_ADDRESS="unix:path=$ADDRESS/bus" PATH=${PATH} \ 41 | /usr/bin/notify-send -u critical -i dialog-warning "Virus found!" "$ALERT" 42 | done 43 | EOF 44 | sudo chmod +x /etc/clamav/virus-event.bash 45 | 46 | log "Configuring sudoers for clamav notifications" 47 | append_config "clamav ALL = (ALL) NOPASSWD: SETENV: /usr/bin/notify-send" "/etc/sudoers.d/clamav" 48 | 49 | log "Configuring clamonacc systemd override" 50 | sudo mkdir -p /etc/systemd/system/clamav-clamonacc.service.d 51 | sudo tee /etc/systemd/system/clamav-clamonacc.service.d/override.conf >/dev/null <dP', debugprint_printtag_operations.show_debug_prints_fuzzy_finder, 'Debug Prints') 18 | 19 | -- Dap 20 | local dap = require('dap') 21 | local widgets = require('dap.ui.widgets') 22 | local autocompl = require('dap.ext.autocompl') 23 | local terminal = require('config.dap.terminal') 24 | dap.defaults.fallback.terminal_win_cmd = ':lua require("config.dap.terminal").open()' 25 | 26 | require('nvim-dap-virtual-text').setup({}) 27 | au('FileType', { 28 | pattern = { 'dap-repl' }, 29 | desc = 'Setup dap repl', 30 | callback = function() 31 | autocompl.attach() 32 | end, 33 | }) 34 | 35 | -- General workflow 36 | rnmap('dd', dap.continue, 'Debug Continue') 37 | rnmap('dj', dap.step_over, 'Debug Step Over (down)') 38 | rnmap('dk', dap.step_back, 'Debug Step Back (up)') 39 | rnmap('dl', dap.step_into, 'Debug Step Into (right)') 40 | rnmap('dh', dap.step_out, 'Debug Step Out (left)') 41 | 42 | -- Widgets 43 | nmap('d', dap.repl.toggle, 'Debug REPL') 44 | nmap('dc', terminal.toggle, 'Debug Console') 45 | nmap('ds', widgets.sidebar(widgets.scopes).toggle, 'Debug Scopes') 46 | nmap('df', widgets.sidebar(widgets.frames).toggle, 'Debug Frames') 47 | nmap('dt', widgets.sidebar(widgets.threads).toggle, 'Debug Threads') 48 | nvmap('de', widgets.sidebar(widgets.expression).toggle, 'Debug Expression') 49 | nmap('dp', fzf_lua.dap_breakpoints, 'Breakpoints') 50 | 51 | -- Debugging 52 | nmap('dx', function() 53 | dap.terminate() 54 | terminal.close() 55 | dap.repl.close() 56 | end, 'Debug Exit') 57 | nmap('dr', dap.restart, 'Debug Restart') 58 | nmap('db', dap.toggle_breakpoint, 'Debug Breakpoint') 59 | nmap('dB', function() 60 | dap.set_breakpoint(vim.fn.input('Condition: ')) 61 | end, 'Debug Conditional Breakpoint') 62 | nmap('dL', function() 63 | dap.set_breakpoint(nil, nil, vim.fn.input('Log: ')) 64 | end, 'Debug Log Point') 65 | -------------------------------------------------------------------------------- /nvim/.config/nvim/lua/config/mason.lua: -------------------------------------------------------------------------------- 1 | require('mason').setup({ 2 | ui = { 3 | border = 'single', 4 | }, 5 | registries = { 6 | 'github:mason-org/mason-registry', 7 | 'github:Crashdummyy/mason-registry', 8 | 'lua:config.registry', 9 | }, 10 | }) 11 | 12 | vim.api.nvim_create_user_command('MasonUpdateSync', function() 13 | vim.notify('Syncing packages...', vim.log.levels.INFO) 14 | 15 | local a = require('mason-core.async') 16 | local registry = require('mason-registry') 17 | local packages = vim.iter(require('config.languages')) 18 | :map(function(server) 19 | return server.mason 20 | end) 21 | :filter(function(server) 22 | return server 23 | end) 24 | :flatten() 25 | :totable() 26 | 27 | a.run_blocking(function() 28 | vim.notify('Updating registry...', vim.log.levels.INFO) 29 | a.wait(function(resolve) 30 | registry.update(resolve) 31 | end) 32 | 33 | for _, name in ipairs(packages) do 34 | local pkg = registry.get_package(name) 35 | if not pkg:is_installed() then 36 | a.scheduler() 37 | vim.notify('Installing ' .. name, vim.log.levels.INFO) 38 | a.wait(function(resolve) 39 | pkg:install():once('closed', resolve) 40 | end) 41 | else 42 | local installed_version = pkg:get_installed_version() or '' 43 | local latest_version = pkg:get_latest_version() 44 | if latest_version and installed_version ~= latest_version then 45 | a.scheduler() 46 | vim.notify( 47 | 'Updating ' .. name .. ' from ' .. installed_version .. ' to ' .. latest_version, 48 | vim.log.levels.INFO 49 | ) 50 | a.wait(function(resolve) 51 | pkg:install({ version = latest_version }, resolve) 52 | end) 53 | end 54 | end 55 | end 56 | 57 | for _, name in ipairs(registry.get_installed_package_names()) do 58 | local pkg = registry.get_package(name) 59 | if not vim.tbl_contains(packages, name) then 60 | a.scheduler() 61 | vim.notify('Uninstalling ' .. name, vim.log.levels.INFO) 62 | a.wait(function(resolve) 63 | pkg:uninstall(nil, resolve) 64 | end) 65 | end 66 | end 67 | end) 68 | 69 | vim.notify('Succesfully synced ' .. #packages .. ' packages.', vim.log.levels.INFO) 70 | end, { force = true }) 71 | -------------------------------------------------------------------------------- /nvim/.config/nvim/lua/config/statuscolumn.lua: -------------------------------------------------------------------------------- 1 | local function icon(sign, len) 2 | sign = sign or {} 3 | len = len or 2 4 | local text = vim.fn.strcharpart(sign.text or '', 0, len) 5 | text = text .. string.rep(' ', len - vim.fn.strchars(text)) 6 | return sign.texthl and ('%#' .. sign.texthl .. '#' .. text .. '%*') or text 7 | end 8 | 9 | local function get_sign(buf, lnum) 10 | local signs = {} 11 | local extmarks = vim.api.nvim_buf_get_extmarks( 12 | buf, 13 | -1, 14 | { lnum - 1, 0 }, 15 | { lnum - 1, -1 }, 16 | { details = true, type = 'sign' } 17 | ) 18 | for _, extmark in pairs(extmarks) do 19 | signs[#signs + 1] = { 20 | name = extmark[4].sign_hl_group or '', 21 | text = extmark[4].sign_text, 22 | texthl = extmark[4].sign_hl_group, 23 | priority = extmark[4].priority, 24 | } 25 | end 26 | 27 | table.sort(signs, function(a, b) 28 | return (a.priority or 0) < (b.priority or 0) 29 | end) 30 | 31 | if signs then 32 | return signs[#signs] 33 | end 34 | 35 | return nil 36 | end 37 | 38 | local function get_mark(buf, lnum) 39 | local marks = vim.fn.getmarklist(buf) 40 | vim.list_extend(marks, vim.fn.getmarklist()) 41 | for _, mark in ipairs(marks) do 42 | if mark.pos[1] == buf and mark.pos[2] == lnum and mark.mark:match('[a-zA-Z]') then 43 | return { text = mark.mark:sub(2), texthl = 'DiagnosticHint' } 44 | end 45 | end 46 | end 47 | 48 | local function get_fold(win, lnum) 49 | local fold = nil 50 | vim.api.nvim_win_call(win, function() 51 | if vim.fn.foldclosed(lnum) >= 0 then 52 | fold = { text = vim.opt.fillchars:get().foldclose, texthl = 'FoldColumn' } 53 | elseif vim.fn.foldlevel(lnum) > vim.fn.foldlevel(lnum - 1) then 54 | fold = { text = vim.opt.fillchars:get().foldopen } 55 | end 56 | end) 57 | return fold 58 | end 59 | 60 | function StatusColumn() 61 | local components = { '', '', '' } -- left, middle, right 62 | 63 | local win = vim.g.statusline_winid 64 | local show_signs = vim.wo[win].signcolumn ~= 'no' 65 | 66 | -- Line numbers 67 | components[1] = '%=%l' 68 | 69 | -- Merged signs 70 | if show_signs and vim.v.virtnum == 0 then 71 | local buf = vim.api.nvim_win_get_buf(win) 72 | local sign = get_sign(buf, vim.v.lnum) 73 | local fold = get_fold(win, vim.v.lnum) 74 | local mark = get_mark(buf, vim.v.lnum) 75 | components[2] = icon(sign or mark or fold) 76 | end 77 | 78 | return table.concat(components) 79 | end 80 | 81 | vim.opt.statuscolumn = [[%!v:lua.StatusColumn()]] 82 | -------------------------------------------------------------------------------- /scripts/install-core.sh: -------------------------------------------------------------------------------- 1 | log "Enabling multilib repository" 2 | if ! grep -q '^\[multilib\]' /etc/pacman.conf; then 3 | sudo sed -i "/^#\[multilib\]/,/^#Include/ s/^#//" /etc/pacman.conf 4 | fi 5 | 6 | log "Installing core packages" 7 | packages=( 8 | xdg-utils xdg-user-dirs # xdg tools 9 | dosfstools fuse2 gdu # filesystem tools 10 | stoken openvpn vpn-slice openconnect tinyproxy mitmproxy # VPN/proxy tools 11 | stow zsh starship tmux # shell tools 12 | ripgrep mlocate man-db tldr # man/search tools 13 | net-tools systemd-resolvconf iw sshpass wget socat traceroute aria2c # network tools/downloaders 14 | bc unzip p7zip # archive tools 15 | rate-mirrors pacman-contrib arch-update # arch tools 16 | pass pass-otp # password manager 17 | power-profiles-daemon # power management 18 | keyd # keyboard remapping daemon 19 | syncthing # file synchronization 20 | tree-sitter-git tree-sitter-cli-git neovim-git fswatch ctags less bat lynx # neovim/text stuff 21 | jq yq jnv # json/yaml processors 22 | btop # system monitor 23 | glow # markdown viewer 24 | onefetch # git repository summary 25 | fastfetch # system information 26 | ) 27 | install_pkgs "${packages[@]}" 28 | 29 | log "Configuring system" 30 | 31 | # Increase inotify watches 32 | append_config "fs.inotify.max_user_watches=1000000" /etc/sysctl.d/40-inotify.conf 33 | append_config "fs.inotify.max_queued_events=1000000" /etc/sysctl.d/40-inotify.conf 34 | 35 | # Symlink configs 36 | sudo ln -sf ${dot_dir}/keyd/default.conf /etc/keyd/default.conf 37 | 38 | # Enable services 39 | services=( 40 | keyd 41 | power-profiles-daemon 42 | ) 43 | enable_services "${services[@]}" 44 | 45 | services=( 46 | syncthing 47 | ) 48 | enable_user_services "${services[@]}" 49 | 50 | # Alter pacman options 51 | append_pacman_option "Color" 52 | append_pacman_option "ILoveCandy" 53 | append_pacman_option "ParallelDownloads = 10" 54 | 55 | # Modify systemd-networkd-wait-online.service to use --any parameter instead of waiting for all interfaces 56 | if grep -q "ExecStart=/usr/lib/systemd/systemd-networkd-wait-online$" /etc/systemd/system/network-online.target.wants/systemd-networkd-wait-online.service; then 57 | sudo sed -i 's|ExecStart=/usr/lib/systemd/systemd-networkd-wait-online|ExecStart=/usr/lib/systemd/systemd-networkd-wait-online --any|' /etc/systemd/system/network-online.target.wants/systemd-networkd-wait-online.service 58 | fi 59 | 60 | # Modify groups 61 | groups=( 62 | # nogroup 63 | # video 64 | # input 65 | keyd 66 | ) 67 | enable_groups "${groups[@]}" 68 | 69 | # Update XDG 70 | xdg-user-dirs-update 71 | 72 | # Disable power save 73 | sudo iw dev wlan0 set power_save off 74 | 75 | # Change default shell 76 | chsh -s /bin/zsh "$USER" 77 | -------------------------------------------------------------------------------- /nvim/.config/nvim/lua/config/finder.lua: -------------------------------------------------------------------------------- 1 | local utils = require('config.utils') 2 | local nmap = utils.nmap 3 | local nvmap = utils.nvmap 4 | 5 | local fzf = require('fzf-lua') 6 | fzf.setup({ 7 | 'fzf-tmux', 8 | file_icon_padding = ' ', 9 | winopts = { 10 | border = 'none', 11 | preview = { 12 | border = 'single', 13 | }, 14 | }, 15 | fzf_opts = { 16 | ['--info'] = false, 17 | ['--border'] = false, 18 | ['--tmux'] = '100%,100%', 19 | }, 20 | defaults = { 21 | formatter = 'path.filename_first', 22 | multiline = 1, 23 | }, 24 | files = { 25 | rg_opts = ' --files --hidden --ignore --glob "!.git" --sortr=modified', 26 | fzf_opts = { 27 | ['--scheme'] = 'path', 28 | ['--tiebreak'] = 'index', 29 | -- ["--schema"] = "history" 30 | }, 31 | }, 32 | grep = { 33 | rg_opts = ' --hidden --ignore --glob "!.git/" --column --line-number --no-heading --color=always --smart-case --max-columns=4096 -e', 34 | prompt = 'Grep❯ ', 35 | no_column_hide = true, 36 | }, 37 | lsp = { 38 | code_actions = { 39 | fzf_opts = { 40 | ['--tmux'] = 'bottom,50%', 41 | }, 42 | }, 43 | }, 44 | dap = { 45 | configurations = { 46 | fzf_opts = { 47 | ['--tmux'] = 'bottom,50%', 48 | }, 49 | }, 50 | }, 51 | oldfiles = { 52 | include_current_session = true, 53 | cwd_only = true, 54 | stat_file = true, 55 | }, 56 | }) 57 | 58 | fzf.register_ui_select({ 59 | fzf_opts = { 60 | ['--tmux'] = 'bottom,50%', 61 | }, 62 | }) 63 | 64 | nmap('', fzf.resume, 'Find Resume') 65 | nmap('fg', fzf.live_grep, 'Find Grep') 66 | nmap('ff', fzf.files, 'Find Files') 67 | nmap('fa', fzf.commands, 'Find Actions') 68 | nmap('fb', fzf.buffers, 'Find Buffers') 69 | nmap('fh', fzf.oldfiles, 'Find History') 70 | nmap('fk', fzf.keymaps, 'Find Keymaps') 71 | nmap('fq', fzf.quickfix, 'Find Quickfix') 72 | nmap('f?', fzf.helptags, 'Find Help') 73 | nmap('fj', fzf.jumps, 'Find Jumps') 74 | nmap('fm', fzf.marks, 'Find Marks') 75 | 76 | -- Git 77 | nmap('fG', function() 78 | fzf.live_grep({ 79 | prompt = 'GitGrep❯ ', 80 | cmd = 'git grep --line-number --column --color=always', 81 | }) 82 | end, 'Find Git Grep') 83 | nmap('fF', fzf.git_files, 'Find Git Files') 84 | nvmap('fc', fzf.git_bcommits, 'Find Buffer Git Commits') 85 | nmap('fC', fzf.git_commits, 'Find All Git Commits') 86 | 87 | -- LSP 88 | nmap('fd', fzf.lsp_document_diagnostics, 'Find Diagnostics') 89 | nmap('fD', fzf.lsp_workspace_diagnostics, 'Find All Diagnostics') 90 | nmap('fs', fzf.lsp_document_symbols, 'Find Symbols') 91 | nmap('fS', fzf.lsp_live_workspace_symbols, 'Find All Symbols') 92 | -------------------------------------------------------------------------------- /nvim/.config/nvim/after/lsp/jdtls.lua: -------------------------------------------------------------------------------- 1 | local function get_mason_bundles() 2 | local function jars(path, pattern) 3 | return vim.split(vim.fn.glob(vim.fn.expand(path) .. '/' .. pattern), '\n') 4 | end 5 | 6 | local bundles = {} 7 | vim.list_extend(bundles, jars('$MASON/share/java-test', '*.jar')) 8 | vim.list_extend(bundles, jars('$MASON/share/java-debug-adapter', 'com.microsoft.java.debug.plugin-*.jar')) 9 | vim.list_extend(bundles, jars('$MASON/share/vscode-spring-boot-tools', 'jdtls/*.jar')) 10 | 11 | local excluded = { 12 | -- java-test 13 | 'com.microsoft.java.test.runner-jar-with-dependencies.jar', 14 | 'jacocoagent.jar', 15 | -- spring-boot 16 | 'commons-lsp-extensions.jar', 17 | 'xml-ls-extension.jar', 18 | } 19 | 20 | bundles = vim.tbl_filter(function(bundle) 21 | if not bundle then 22 | return false 23 | end 24 | local filename = vim.fn.fnamemodify(bundle, ':t') 25 | for _, ex in ipairs(excluded) do 26 | if filename == ex then 27 | return false 28 | end 29 | end 30 | return true 31 | end, bundles) 32 | 33 | return bundles 34 | end 35 | 36 | return { 37 | on_attach = function(_, bufnr) 38 | local jdtls = require('jdtls') 39 | vim.keymap.set('n', 'dt', jdtls.test_nearest_method, { 40 | buffer = bufnr, 41 | desc = 'Debug Test Method', 42 | }) 43 | vim.keymap.set('n', 'dT', jdtls.test_class, { 44 | buffer = bufnr, 45 | desc = 'Debug Test Class', 46 | }) 47 | end, 48 | 49 | settings = { 50 | -- See: https://github.com/eclipse-jdtls/eclipse.jdt.ls/wiki/Running-the-JAVA-LS-server-from-the-command-line#initialize-request 51 | -- Also see: https://github.com/redhat-developer/vscode-java/blob/d3bcbaa3f5a3097dc21b5d94132d6858a0452a7c/package.json#L273 52 | java = { 53 | configuration = { 54 | updateBuildConfiguration = 'automatic', 55 | }, 56 | eclipse = { 57 | downloadSources = true, 58 | }, 59 | maven = { 60 | downloadSources = true, 61 | }, 62 | format = { 63 | enabled = true, 64 | }, 65 | signatureHelp = { 66 | enabled = true, 67 | }, 68 | contentProvider = { 69 | preferred = 'fernflower', 70 | }, 71 | sources = { 72 | organizeImports = { 73 | starThreshold = 9999, 74 | staticStarThreshold = 9999, 75 | }, 76 | }, 77 | codeGeneration = { 78 | useBlocks = true, 79 | generateComments = false, 80 | }, 81 | }, 82 | }, 83 | 84 | init_options = { 85 | bundles = get_mason_bundles(), 86 | }, 87 | } 88 | -------------------------------------------------------------------------------- /scripts/install.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/bash -l 2 | set -e 3 | shopt -s nullglob globstar 4 | 5 | log() { 6 | echo -e "\033[1;32m==> $*\033[0m" 7 | } 8 | 9 | install_pkgs() { 10 | if ! command -v yay &> /dev/null; then 11 | git clone "https://aur.archlinux.org/yay.git" "/tmp/yay" 12 | pushd "/tmp/yay" 13 | makepkg -si --noconfirm 14 | popd 15 | fi 16 | 17 | installed=$(yay -Qi "$@" 2>/dev/null | awk '/^Name/{print $3}') 18 | for pkg in "$@"; do 19 | if ! grep -qx "$pkg" <<< "$installed"; then 20 | to_install+=("$pkg") 21 | fi 22 | done 23 | 24 | if [ ${#to_install[@]} -gt 0 ]; then 25 | yay -Sy --noconfirm --mflags --skipinteg "${to_install[@]}" 26 | fi 27 | } 28 | 29 | install_flatpak_pkgs() { 30 | if ! command -v flatpak &> /dev/null; then 31 | install_pkgs flatpak 32 | fi 33 | for pkg in "$@"; do 34 | if ! flatpak list | grep -qx "$pkg"; then 35 | flatpak install -y "$pkg" 36 | fi 37 | done 38 | } 39 | 40 | install_python_pkgs() { 41 | if ! command -v pip3 &> /dev/null; then 42 | install_pkgs python-pip 43 | fi 44 | pip3 install --user --break-system-packages "${@}" 45 | } 46 | 47 | install_npm_pkgs() { 48 | if ! command -v npm &> /dev/null; then 49 | install_pkgs npm 50 | fi 51 | mkdir -p ~/.npm-global 52 | npm config set prefix "$HOME/.npm-global" 53 | npm install -g "${@}" 54 | } 55 | 56 | install_asdf_pkgs() { 57 | if ! command -v asdf &> /dev/null; then 58 | install_pkgs asdf-vm 59 | fi 60 | for pkg in "$@"; do 61 | asdf plugin add "$pkg" || true 62 | asdf plugin update "$pkg" || true 63 | asdf install "$pkg" latest || true 64 | done 65 | } 66 | 67 | enable_services() { 68 | sudo systemctl enable "${@}" 69 | } 70 | 71 | enable_user_services() { 72 | systemctl --user enable "${@}" 73 | } 74 | 75 | enable_groups() { 76 | for group in "$@"; do 77 | sudo groupadd -f "$group" 78 | sudo usermod -aG "$group" "$USER" 79 | done 80 | } 81 | 82 | append_config() { 83 | local line="$1" 84 | local file="$2" 85 | grep -qxF "$line" "$file" || echo "$line" | sudo tee -a "$file" > /dev/null 86 | } 87 | 88 | append_pacman_option() { 89 | local option="$1" 90 | if ! grep -q "^$option" /etc/pacman.conf; then 91 | sudo sed -i "/^\[options\]/a $option" /etc/pacman.conf 92 | fi 93 | } 94 | 95 | dot_dir="$(cd "$(dirname "$0")/.." && pwd)" 96 | pushd "$dot_dir" || exit 1 97 | script_dir="$dot_dir/scripts" 98 | profile_scripts=("$script_dir"/install-*.sh) 99 | 100 | if [ "$#" -eq 0 ]; then 101 | log "Available profiles:" 102 | for script in "${profile_scripts[@]}"; do 103 | echo " $(basename "$script" .sh | sed 's/install-//')" 104 | done 105 | exit 0 106 | fi 107 | 108 | set -x 109 | 110 | for arg in "$@"; do 111 | match="$script_dir/install-$arg.sh" 112 | if [ -f "$match" ]; then 113 | log "Running profile: $arg" 114 | source "$match" 115 | else 116 | log "Profile not found: $arg" 117 | exit 1 118 | fi 119 | done 120 | -------------------------------------------------------------------------------- /mpv/.config/mpv/shaders/Anime4K_Denoise_Bilateral_Mean.glsl: -------------------------------------------------------------------------------- 1 | // MIT License 2 | 3 | // Copyright (c) 2019-2021 bloc97 4 | // All rights reserved. 5 | 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | 13 | // The above copyright notice and this permission notice shall be included in all 14 | // copies or substantial portions of the Software. 15 | 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | // SOFTWARE. 23 | 24 | //!DESC Anime4K-v3.2-Denoise-Bilateral-Mean 25 | //!HOOK MAIN 26 | //!BIND HOOKED 27 | 28 | #define INTENSITY_SIGMA 0.1 //Intensity window size, higher is stronger denoise, must be a positive real number 29 | #define SPATIAL_SIGMA 1.0 //Spatial window size, higher is stronger denoise, must be a positive real number. 30 | 31 | #define INTENSITY_POWER_CURVE 1.0 //Intensity window power curve. Setting it to 0 will make the intensity window treat all intensities equally, while increasing it will make the window narrower in darker intensities and wider in brighter intensities. 32 | 33 | #define KERNELSIZE (max(int(ceil(SPATIAL_SIGMA * 2.0)), 1) * 2 + 1) //Kernel size, must be an positive odd integer. 34 | #define KERNELHALFSIZE (int(KERNELSIZE/2)) //Half of the kernel size without remainder. Must be equal to trunc(KERNELSIZE/2). 35 | #define KERNELLEN (KERNELSIZE * KERNELSIZE) //Total area of kernel. Must be equal to KERNELSIZE * KERNELSIZE. 36 | 37 | #define GETOFFSET(i) vec2((i % KERNELSIZE) - KERNELHALFSIZE, (i / KERNELSIZE) - KERNELHALFSIZE) 38 | 39 | vec4 gaussian_vec(vec4 x, vec4 s, vec4 m) { 40 | vec4 scaled = (x - m) / s; 41 | return exp(-0.5 * scaled * scaled); 42 | } 43 | 44 | float gaussian(float x, float s, float m) { 45 | float scaled = (x - m) / s; 46 | return exp(-0.5 * scaled * scaled); 47 | } 48 | 49 | vec4 hook() { 50 | vec4 sum = vec4(0.0); 51 | vec4 n = vec4(0.0); 52 | 53 | vec4 vc = HOOKED_tex(HOOKED_pos); 54 | 55 | vec4 is = pow(vc + 0.0001, vec4(INTENSITY_POWER_CURVE)) * INTENSITY_SIGMA; 56 | float ss = SPATIAL_SIGMA; 57 | 58 | for (int i=0; iRGB matrix has 1 for every row... (which is the case for BT.709) 88 | //Otherwise we would need to convert RGB to YUV, modify Y then convert back to RGB. 89 | return HOOKED_tex(HOOKED_pos) - (current_luma - new_luma); 90 | } -------------------------------------------------------------------------------- /git/.gitconfig: -------------------------------------------------------------------------------- 1 | # Core 2 | [apply] 3 | whitespace = fix 4 | 5 | [core] 6 | excludesfile = ~/.gitignore 7 | whitespace = space-before-tab,-indent-with-non-tab,trailing-space 8 | autocrlf = input 9 | 10 | # UI stuff 11 | [color] 12 | ui = auto 13 | [column] 14 | ui = auto 15 | [branch] 16 | sort = -committerdate 17 | [tag] 18 | sort = version:refname 19 | [commit] 20 | template = ~/.gitmessage 21 | verbose = true 22 | 23 | # Diff and merge 24 | [diff] 25 | algorithm = histogram 26 | colorMoved = true 27 | colorMovedWS = allow-indentation-change 28 | mnemonicPrefix = true 29 | 30 | tool = nvim_difftool 31 | submodule = diff 32 | 33 | [diff "bin"] 34 | textconv = hexdump -v -C 35 | 36 | [difftool] 37 | prompt = true 38 | trustExitCode = true 39 | 40 | [difftool "nvim_difftool"] 41 | cmd = nvim -c \"DiffTool $LOCAL $REMOTE\" 42 | 43 | [merge] 44 | log = true 45 | tool = nvimdiff1 46 | 47 | [mergetool] 48 | prompt = true 49 | trustExitCode = true 50 | hideResolved = true 51 | 52 | # Push/pull/rebase 53 | 54 | [push] 55 | autoSetupRemote = true 56 | followTags = true 57 | 58 | [pull] 59 | rebase = true 60 | 61 | [fetch] 62 | prune = true 63 | all = true 64 | 65 | [rebase] 66 | autoSquash = true 67 | autoStash = true 68 | updateRefs = true 69 | 70 | [rerere] 71 | enabled = true 72 | autoupdate = true 73 | 74 | # [credential] 75 | # helper = store 76 | [credential "https://github.com"] 77 | helper = 78 | helper = !/usr/bin/gh auth git-credential 79 | [credential "https://gist.github.com"] 80 | helper = 81 | helper = !/usr/bin/gh auth git-credential 82 | 83 | [http] 84 | postBuffer = 524288000 85 | 86 | [filter "lfs"] 87 | required = true 88 | clean = git-lfs clean -- %f 89 | smudge = git-lfs smudge -- %f 90 | process = git-lfs filter-process 91 | 92 | [alias] 93 | review = "!git fetch origin && git difftool -d origin/HEAD...HEAD" 94 | addw = "!f() { git diff -U0 -w --no-color \"$@\" | git apply --cached --ignore-whitespace --unidiff-zero; }; f" 95 | # Worktree stuff 96 | wt = worktree 97 | wtl = worktree list 98 | wtc = worktree prune 99 | wtb = "!f() { root=$(git rev-parse --show-toplevel); name=$(basename \"$root\"); dir=$(dirname \"$root\"); git worktree add \"$dir/${name}-$1\" \"$1\"; }; f" 100 | wtp = "!f() { root=$(git rev-parse --show-toplevel); name=$(basename \"$root\"); dir=$(dirname \"$root\"); git fetch origin pull/$1/head:pr/$1 && git worktree add \"$dir/${name}-pr-$1\" pr/$1; }; f" 101 | wtr = "!f() { root=$(git rev-parse --show-toplevel); name=$(basename \"$root\"); dir=$(dirname \"$root\"); git worktree remove \"$dir/${name}-$1\" && rm -rf \"$dir/${name}-$1\"; }; f" 102 | # Branch cleanup 103 | branch-cleanup = "!git-branch-cleanup" 104 | # Sync current branch with upstream remote (e.g., reset --hard to upstream/) 105 | sync-upstream = "!f() { git fetch upstream && git reset --hard upstream/$(git rev-parse --abbrev-ref HEAD); }; f" 106 | 107 | [include] 108 | path = ~/.gitconfig.local 109 | 110 | [includeIf "gitdir:~/git-work/"] 111 | path = ~/.gitconfig.work 112 | -------------------------------------------------------------------------------- /nvim/.config/nvim/lua/config/copilot.lua: -------------------------------------------------------------------------------- 1 | local utils = require('config.utils') 2 | local icons = require('config.icons') 3 | 4 | -- Copilot autosuggestions 5 | -- vim.g.copilot_no_tab_map = true 6 | -- vim.g.copilot_hide_during_completion = false 7 | -- vim.g.copilot_proxy_strict_ssl = false 8 | -- vim.keymap.set('i', '', 'copilot#Accept("\\")', { expr = true, replace_keycodes = false }) 9 | 10 | -- Copilot chat 11 | local chat = require('CopilotChat') 12 | chat.setup({ 13 | debug = false, 14 | temperature = 0, 15 | sticky = { 16 | '#buffer:listed', 17 | '#selection', 18 | '#gitdiff' 19 | }, 20 | diff = 'block', 21 | chat_autocomplete = false, 22 | auto_fold = true, 23 | headers = { 24 | user = icons.ui.User, 25 | assistant = icons.ui.Bot, 26 | tool = icons.ui.Tool, 27 | }, 28 | mappings = { 29 | reset = false, 30 | complete = { 31 | insert = '', 32 | }, 33 | }, 34 | prompts = { 35 | Explain = { 36 | mapping = 'ae', 37 | description = 'AI Explain', 38 | }, 39 | Review = { 40 | mapping = 'ar', 41 | description = 'AI Review', 42 | }, 43 | Tests = { 44 | mapping = 'at', 45 | description = 'AI Tests', 46 | }, 47 | Fix = { 48 | mapping = 'af', 49 | description = 'AI Fix', 50 | }, 51 | Optimize = { 52 | mapping = 'ao', 53 | description = 'AI Optimize', 54 | }, 55 | Docs = { 56 | mapping = 'ad', 57 | description = 'AI Documentation', 58 | }, 59 | Commit = { 60 | mapping = 'ac', 61 | description = 'AI Generate Commit', 62 | }, 63 | }, 64 | providers = { 65 | github_models = { 66 | disabled = true, 67 | }, 68 | }, 69 | }) 70 | 71 | -- Setup extensions 72 | require('config.copilot_extensions') 73 | 74 | -- Setup buffer 75 | utils.au('BufEnter', { 76 | pattern = 'copilot-*', 77 | callback = function() 78 | vim.opt_local.relativenumber = false 79 | vim.opt_local.number = false 80 | end, 81 | }) 82 | 83 | -- Setup keymaps 84 | vim.keymap.set({ 'n' }, 'aa', chat.toggle, { desc = 'AI Toggle' }) 85 | vim.keymap.set({ 'v' }, 'aa', chat.open, { desc = 'AI Open' }) 86 | vim.keymap.set({ 'n' }, 'ax', chat.reset, { desc = 'AI Reset' }) 87 | vim.keymap.set({ 'n' }, 'as', chat.stop, { desc = 'AI Stop' }) 88 | vim.keymap.set({ 'n' }, 'am', chat.select_model, { desc = 'AI Models' }) 89 | vim.keymap.set({ 'n', 'v' }, 'ap', chat.select_prompt, { desc = 'AI Prompts' }) 90 | vim.keymap.set({ 'n', 'v' }, 'aq', function() 91 | vim.ui.input({ 92 | prompt = 'AI Question> ', 93 | }, function(input) 94 | if input ~= '' then 95 | chat.ask(input) 96 | end 97 | end) 98 | end, { desc = 'AI Question' }) 99 | 100 | -- MCP hub 101 | require('mcphub').setup({ 102 | extensions = { 103 | copilotchat = { 104 | enabled = true, 105 | convert_tools_to_functions = true, 106 | convert_resources_to_functions = true, 107 | add_mcp_prefix = false, 108 | }, 109 | }, 110 | }) 111 | -------------------------------------------------------------------------------- /nvim/.config/nvim/lua/config/ui.lua: -------------------------------------------------------------------------------- 1 | local utils = require('config.utils') 2 | local au = utils.au 3 | local nmap = utils.nmap 4 | local icons = require('config.icons') 5 | 6 | -- Set win border 7 | vim.o.winborder = 'single' 8 | vim.o.pumborder = 'single' 9 | 10 | -- Enable help stuff 11 | vim.g.helpful = 1 12 | 13 | -- Ext ui native 14 | require('vim._extui').enable({ 15 | msg = { 16 | target = 'cmd', 17 | timeout = 1000, 18 | }, 19 | }) 20 | 21 | -- Set base16 colorscheme 22 | au('ColorScheme', { 23 | desc = 'Adjust colors', 24 | callback = function() 25 | local base16 = require('tinted-colorscheme') 26 | local bright_black = base16.colors.base03 27 | vim.api.nvim_set_hl(0, 'StatusLine', { fg = bright_black }) 28 | vim.api.nvim_set_hl(0, 'StatusLineNC', { fg = bright_black }) 29 | vim.api.nvim_set_hl(0, 'LineNr', { fg = bright_black }) 30 | vim.api.nvim_set_hl(0, 'VertSplit', { fg = bright_black }) 31 | vim.api.nvim_set_hl(0, 'WinSeparator', { fg = bright_black }) 32 | 33 | local function blend_color(color_name, blend) 34 | local color_int = vim.api.nvim_get_hl(0, { name = color_name }).fg 35 | local bg_int = vim.api.nvim_get_hl(0, { name = 'Normal' }).bg 36 | 37 | if not color_int or not bg_int then 38 | return 39 | end 40 | 41 | local color = { (color_int / 65536) % 256, (color_int / 256) % 256, color_int % 256 } 42 | local bg = { (bg_int / 65536) % 256, (bg_int / 256) % 256, bg_int % 256 } 43 | local r = math.floor((color[1] * blend + bg[1] * (100 - blend)) / 100) 44 | local g = math.floor((color[2] * blend + bg[2] * (100 - blend)) / 100) 45 | local b = math.floor((color[3] * blend + bg[3] * (100 - blend)) / 100) 46 | vim.api.nvim_set_hl(0, color_name, { bg = string.format('#%02x%02x%02x', r, g, b) }) 47 | end 48 | 49 | blend_color('DiffAdd', 20) 50 | blend_color('DiffDelete', 20) 51 | blend_color('DiffChange', 20) 52 | blend_color('DiffText', 20) 53 | end, 54 | }) 55 | 56 | vim.opt.termguicolors = true 57 | vim.g.tinted_live_reload_registered = true 58 | vim.cmd('colorscheme base16-' .. os.getenv('BASE16_THEME_DEFAULT')) 59 | 60 | -- Load icons 61 | require('nvim-web-devicons').setup() 62 | 63 | -- Set fold icons 64 | vim.opt.fillchars = { foldclose = icons.fold.Closed, foldopen = icons.fold.Open } 65 | 66 | -- File browser 67 | local oil = require('oil') 68 | oil.setup({ 69 | view_options = { 70 | show_hidden = true, 71 | is_always_hidden = function(name) 72 | return name == '..' 73 | end, 74 | }, 75 | win_options = { 76 | number = false, 77 | relativenumber = false, 78 | }, 79 | keymaps = { 80 | [''] = false, 81 | [''] = false, 82 | [''] = false, 83 | [''] = false, 84 | [''] = false, 85 | [''] = false, 86 | }, 87 | }) 88 | 89 | -- This causes following error: 90 | -- grid_alloc: Assertion `rows >= 0 && columns >= 0' failed. 91 | -- when opening nvim ., then using :h and then : with extui enabled probably? 92 | -- Possibly other messages + cmdline autocomplete can cause this too, but this one im sure of 93 | -- See: https://github.com/neovim/neovim/issues/35517 94 | -- au('User', { 95 | -- pattern = 'OilEnter', 96 | -- callback = function() 97 | -- oil.open_preview() 98 | -- end, 99 | -- }) 100 | 101 | nmap('-', oil.open, 'Open parent directory') 102 | 103 | -- Tmux bindings 104 | require('tmux').setup({ 105 | copy_sync = { 106 | enable = false, 107 | }, 108 | }) 109 | 110 | -- Remove HL after im done searching 111 | au('InsertEnter', { 112 | callback = function() 113 | vim.schedule(function() 114 | vim.cmd('nohlsearch') 115 | end) 116 | end, 117 | }) 118 | 119 | -- Undotree 120 | vim.cmd.packadd('nvim.undotree') 121 | nmap('u', require('undotree').open, 'Open undotree') 122 | -------------------------------------------------------------------------------- /nvim/.config/nvim/lua/config/git.lua: -------------------------------------------------------------------------------- 1 | local gitsigns = require('gitsigns') 2 | local fzf = require('fzf-lua') 3 | local utils = require('config.utils') 4 | local map = utils.map 5 | local nmap = utils.nmap 6 | local vmap = utils.vmap 7 | 8 | -- GitHub permalink command 9 | local function github_permalink() 10 | local api = vim.api 11 | local file = api.nvim_buf_get_name(0) 12 | if file == "" then 13 | print("No file") 14 | return 15 | end 16 | local cwd = vim.fn.getcwd() 17 | local git_root = vim.fn.systemlist("git rev-parse --show-toplevel")[1] 18 | local relpath = vim.fn.fnamemodify(file, ":.") 19 | if git_root and git_root ~= "" then 20 | relpath = vim.fn.fnamemodify(file, ":~:.") 21 | relpath = vim.fn.systemlist("realpath --relative-to=" .. git_root .. " " .. file)[1] 22 | end 23 | local branch = vim.fn.systemlist("git rev-parse --abbrev-ref HEAD")[1] 24 | local line = api.nvim_win_get_cursor(0)[1] 25 | local repo_url = vim.fn.systemlist("gh repo view --json url -q .url")[1] 26 | if not repo_url or repo_url == "" then 27 | print("Not a GitHub repo or gh not installed") 28 | return 29 | end 30 | local url = string.format("%s/blob/%s/%s#L%d", repo_url, branch, relpath, line) 31 | vim.fn.setreg("+", url) 32 | print("GitHub permalink copied to clipboard:\n" .. url) 33 | end 34 | 35 | vim.api.nvim_create_user_command("GitHubLink", github_permalink, {}) 36 | 37 | -- Enable difftool 38 | vim.cmd.packadd('nvim.difftool') 39 | 40 | -- Enable diffmode replacement 41 | -- vim.g.difftool_replace_diff_mode = true 42 | 43 | gitsigns.setup({ 44 | signcolumn = false, 45 | numhl = true, 46 | watch_gitdir = { 47 | enable = false, 48 | }, 49 | on_attach = function(bufnr) 50 | -- Finder 51 | nmap('gt', fzf.git_status, 'Status', bufnr) 52 | nmap('gz', fzf.git_stash, 'Stash', bufnr) 53 | 54 | -- Navigation 55 | nmap(']c', function() 56 | if vim.wo.diff then 57 | vim.cmd.normal({ ']c', bang = true }) 58 | else 59 | gitsigns.nav_hunk('next') 60 | end 61 | end, 'Goto next hunk', bufnr) 62 | 63 | nmap('[c', function() 64 | if vim.wo.diff then 65 | vim.cmd.normal({ '[c', bang = true }) 66 | else 67 | gitsigns.nav_hunk('prev') 68 | end 69 | end, 'Goto previous hunk', bufnr) 70 | map({ 'o', 'x' }, 'ig', ':Gitsigns select_hunk', 'Select hunk', bufnr) 71 | 72 | -- Actions 73 | nmap('gs', gitsigns.stage_hunk, 'Stage hunk', bufnr) 74 | vmap('gs', function() 75 | gitsigns.stage_hunk({ vim.fn.line('.'), vim.fn.line('v') }) 76 | end, 'Stage hunk', bufnr) 77 | nmap('gS', gitsigns.stage_buffer, 'Stage buffer', bufnr) 78 | nmap('gr', gitsigns.reset_hunk, 'Reset hunk', bufnr) 79 | vmap('gr', function() 80 | gitsigns.reset_hunk({ vim.fn.line('.'), vim.fn.line('v') }) 81 | end, 'Reset hunk', bufnr) 82 | nmap('gR', gitsigns.reset_buffer, 'Reset buffer', bufnr) 83 | nmap('gp', gitsigns.preview_hunk, 'Preview hunk', bufnr) 84 | nmap('gb', function() 85 | gitsigns.blame_line({ full = true }) 86 | end, 'Blame line', bufnr) 87 | nmap('gB', gitsigns.blame, 'Blame', bufnr) 88 | nmap('gd', gitsigns.diffthis, 'Diff this', bufnr) 89 | nmap('gD', function() 90 | gitsigns.diffthis('~') 91 | end, 'Diff this (cached)', bufnr) 92 | nmap('gw', function() 93 | local diffopt = vim.opt.diffopt:get() 94 | local has_iwhite = vim.tbl_contains(diffopt, 'iwhite') 95 | if has_iwhite then 96 | vim.opt.diffopt:remove('iwhite') 97 | vim.notify("Whitespace will be shown in diff", vim.log.levels.INFO) 98 | else 99 | vim.opt.diffopt:append('iwhite') 100 | vim.notify("Whitespace will be ignored in diff", vim.log.levels.INFO) 101 | end 102 | end, 'Toggle ignore whitespace in diff') 103 | end, 104 | }) 105 | -------------------------------------------------------------------------------- /tmux/.tmux.conf: -------------------------------------------------------------------------------- 1 | # vim:foldmethod=marker:set ft=tmux: 2 | 3 | # General {{{ 4 | 5 | # Renumber windows sequentially after closing any of them 6 | set -g renumber-windows on 7 | 8 | # Start window numbers at 1 to match keyboard order with tmux window order 9 | set -g base-index 1 10 | setw -g pane-base-index 1 11 | 12 | # Vi mode 13 | set -g status-keys vi 14 | setw -g mode-keys vi 15 | 16 | # Enable focus events 17 | set -g focus-events on 18 | 19 | # Enable clipboard for everything 20 | set -g set-clipboard on 21 | 22 | # Do not detach on destroy 23 | set -g detach-on-destroy off 24 | 25 | # Vim mode switch delay 26 | set -s escape-time 0 27 | 28 | # Increase scrollback buffer size 29 | set -g history-limit 50000 30 | 31 | # Set default terminal to 256 colors 32 | set -g default-terminal "tmux-256color" 33 | 34 | # }}} 35 | 36 | # Mappings {{{ 37 | 38 | # Use ^Space as prefix (do not interfere with Vim) 39 | unbind C-b 40 | set-option -g prefix C-space 41 | bind C-space send-prefix 42 | 43 | # Open new windows/sessions and tabs with current path 44 | bind c new-window -c "#{pane_current_path}" 45 | bind C new-session -c "#{pane_current_path}" 46 | bind '"' split-window -h -c "#{pane_current_path}" 47 | bind % split-window -v -c "#{pane_current_path}" 48 | 49 | # Kill without asking 50 | bind & kill-window 51 | bind x kill-pane 52 | bind X kill-session 53 | 54 | # Vim "visual" mode in copy mode 55 | bind -T copy-mode-vi v send-keys -X begin-selection 56 | bind -T copy-mode-vi y send-keys -X copy-selection-and-cancel 57 | bind -T copy-mode-vi Escape send-keys -X cancel 58 | 59 | # BSPWM-like pane opening 60 | bind -n M-Enter if-shell "[ $(($(tmux display -p '8*#{pane_width}-20*#{pane_height}'))) -lt 0 ]" "splitw -v -c '#{pane_current_path}'" "splitw -h -c '#{pane_current_path}' " 61 | 62 | # Edit tmux buffer in nvim 63 | bind v capture-pane -S - \; save-buffer /tmp/tmux_buffer.txt \; split-window "nvim '+ normal G\$?.' /tmp/tmux_buffer.txt && rm /tmp/tmux_buffer.txt" 64 | 65 | # }}} 66 | 67 | # User interface {{{ 68 | 69 | # Fix colors in vim 70 | set -ag terminal-overrides ",$TERM:Tc" 71 | 72 | # Allow passthrough 73 | set -g allow-passthrough on 74 | 75 | # Disable annoying notifications 76 | set -g visual-bell off 77 | set -g visual-silence off 78 | set -g bell-action none 79 | 80 | # Display tmux messages for longer 81 | set -g display-time 4000 82 | 83 | # Refresh status more often 84 | set -g status-interval 1 85 | 86 | # Aggressive resizing 87 | set -g aggressive-resize on 88 | 89 | # Command bar 90 | set -g message-command-style bg=colour0,fg=colour7 91 | set -g message-style fg=colour7,bg=colour0 92 | 93 | # Titles 94 | set -g set-titles on 95 | set -g set-titles-string '[#{pane_current_command}] #T' 96 | 97 | # Panes 98 | set -g pane-border-status bottom 99 | set -g pane-border-format '#{?pane_active,#[bg=4]#[fg=0],} [#{pane_current_command}] #T ' 100 | set -g pane-border-style fg=colour8,bg=colour0 101 | set -g pane-active-border-style fg=colour4 102 | 103 | # Popups 104 | set -g popup-border-style fg=colour4,bg=colour0 105 | set -g popup-border-lines none 106 | 107 | # Status bar 108 | set -g status on 109 | set -g status-style bg=default,fg=colour8 110 | 111 | set -g status-left '#{?client_prefix,#[fg=green]#[bold]-- PREFIX -- ,}#{?pane_in_mode,#[fg=green]#[bold]-- VISUAL -- ,}#[fg=blue][#S] ' 112 | set -g status-left-length 0 113 | set -g status-right '' 114 | set -g status-right-length 0 115 | set -g window-status-format '#W#F' 116 | set -g window-status-current-format '#[fg=cyan]#W#F' 117 | 118 | # }}} 119 | 120 | # Plugins {{{ 121 | 122 | # Session switcher 123 | bind s run-shell -b "$HOME/.tmux/switch-session.sh" 124 | 125 | # Session save and restore stuff 126 | set -g @resurrect-strategy-vim 'session' 127 | set -g @resurrect-strategy-nvim 'session' 128 | set -g @resurrect-capture-pane-contents 'on' 129 | set -g @continuum-restore 'on' 130 | set -g @continuum-save-interval '10' 131 | 132 | # Pathogen-like loader for plugins 133 | run-shell 'find -L ~/.tmux/pack/*/start -type f -name "*.tmux" | sort | while read f; do bash $f >/dev/null 2>&1; done' 134 | 135 | # }}} 136 | 137 | # User configuration {{{ 138 | 139 | run-shell "[ -e ~/.tmux.conf.local ] && tmux source-file ~/.tmux.conf.local; true" 140 | 141 | # }}} 142 | -------------------------------------------------------------------------------- /mpv/.config/mpv/shaders/Anime4K_Denoise_Bilateral_Mode.glsl: -------------------------------------------------------------------------------- 1 | // MIT License 2 | 3 | // Copyright (c) 2019-2021 bloc97 4 | // All rights reserved. 5 | 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | 13 | // The above copyright notice and this permission notice shall be included in all 14 | // copies or substantial portions of the Software. 15 | 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | // SOFTWARE. 23 | 24 | //!DESC Anime4K-v3.2-Denoise-Bilateral-Mode-Luma 25 | //!HOOK MAIN 26 | //!BIND HOOKED 27 | //!SAVE LINELUMA 28 | //!COMPONENTS 1 29 | 30 | float get_luma(vec4 rgba) { 31 | return dot(vec4(0.299, 0.587, 0.114, 0.0), rgba); 32 | } 33 | 34 | vec4 hook() { 35 | return vec4(get_luma(HOOKED_tex(HOOKED_pos)), 0.0, 0.0, 0.0); 36 | } 37 | 38 | //!DESC Anime4K-v3.1-Denoise-Bilateral-Mode-Apply 39 | //!HOOK MAIN 40 | //!BIND HOOKED 41 | //!BIND LINELUMA 42 | 43 | #define INTENSITY_SIGMA 0.1 //Intensity window size, higher is stronger denoise, must be a positive real number 44 | #define SPATIAL_SIGMA 1.0 //Spatial window size, higher is stronger denoise, must be a positive real number. 45 | #define HISTOGRAM_REGULARIZATION 0.2 //Histogram regularization window size, higher values approximate a bilateral "closest-to-mean" filter. 46 | 47 | #define INTENSITY_POWER_CURVE 1.0 //Intensity window power curve. Setting it to 0 will make the intensity window treat all intensities equally, while increasing it will make the window narrower in darker intensities and wider in brighter intensities. 48 | 49 | #define KERNELSIZE int(max(int(SPATIAL_SIGMA), 1) * 2 + 1) //Kernel size, must be an positive odd integer. 50 | #define KERNELHALFSIZE (int(KERNELSIZE/2)) //Half of the kernel size without remainder. Must be equal to trunc(KERNELSIZE/2). 51 | #define KERNELLEN (KERNELSIZE * KERNELSIZE) //Total area of kernel. Must be equal to KERNELSIZE * KERNELSIZE. 52 | 53 | #define GETOFFSET(i) vec2((i % KERNELSIZE) - KERNELHALFSIZE, (i / KERNELSIZE) - KERNELHALFSIZE) 54 | 55 | float gaussian(float x, float s, float m) { 56 | float scaled = (x - m) / s; 57 | return exp(-0.5 * scaled * scaled); 58 | } 59 | 60 | vec4 getMode(vec4 v[KERNELLEN], float w[KERNELLEN]) { 61 | vec4 maxv = vec4(0); 62 | float maxw = 0.0; 63 | 64 | for (int i=0; i= maxw) { 66 | maxw = w[i]; 67 | maxv = v[i]; 68 | } 69 | } 70 | 71 | return maxv; 72 | } 73 | 74 | vec4 hook() { 75 | vec4 histogram_v[KERNELLEN]; 76 | float histogram_l[KERNELLEN]; 77 | float histogram_w[KERNELLEN]; 78 | float histogram_wn[KERNELLEN]; 79 | 80 | float vc = LINELUMA_tex(HOOKED_pos).x; 81 | 82 | float is = pow(vc + 0.0001, INTENSITY_POWER_CURVE) * INTENSITY_SIGMA; 83 | float ss = SPATIAL_SIGMA; 84 | 85 | for (int i=0; i OUTPUT.h MAIN.h / 1.200 > * 40 | //!HOOK MAIN 41 | //!BIND HOOKED 42 | //!BIND LINELUMA 43 | //!SAVE GAUSS_X2 44 | //!COMPONENTS 3 45 | 46 | #define L_tex LINELUMA_tex 47 | 48 | float max3v(float a, float b, float c) { 49 | return max(max(a, b), c); 50 | } 51 | float min3v(float a, float b, float c) { 52 | return min(min(a, b), c); 53 | } 54 | 55 | vec2 minmax3(vec2 pos, vec2 d) { 56 | float a = L_tex(pos - d).x; 57 | float b = L_tex(pos).x; 58 | float c = L_tex(pos + d).x; 59 | 60 | return vec2(min3v(a, b, c), max3v(a, b, c)); 61 | } 62 | 63 | float lumGaussian7(vec2 pos, vec2 d) { 64 | float g = (L_tex(pos - (d + d)).x + L_tex(pos + (d + d)).x) * 0.06136; 65 | g = g + (L_tex(pos - d).x + L_tex(pos + d).x) * 0.24477; 66 | g = g + (L_tex(pos).x) * 0.38774; 67 | 68 | return g; 69 | } 70 | 71 | 72 | vec4 hook() { 73 | return vec4(lumGaussian7(HOOKED_pos, vec2(HOOKED_pt.x, 0)), minmax3(HOOKED_pos, vec2(HOOKED_pt.x, 0)), 0); 74 | } 75 | 76 | 77 | //!DESC Anime4K-v3.2-Upscale-DoG-x2-Kernel-Y 78 | //!WHEN OUTPUT.w MAIN.w / 1.200 > OUTPUT.h MAIN.h / 1.200 > * 79 | //!HOOK MAIN 80 | //!BIND HOOKED 81 | //!BIND GAUSS_X2 82 | //!SAVE GAUSS_X2 83 | //!COMPONENTS 3 84 | 85 | #define L_tex GAUSS_X2_tex 86 | 87 | float max3v(float a, float b, float c) { 88 | return max(max(a, b), c); 89 | } 90 | float min3v(float a, float b, float c) { 91 | return min(min(a, b), c); 92 | } 93 | 94 | vec2 minmax3(vec2 pos, vec2 d) { 95 | float a0 = L_tex(pos - d).y; 96 | float b0 = L_tex(pos).y; 97 | float c0 = L_tex(pos + d).y; 98 | 99 | float a1 = L_tex(pos - d).z; 100 | float b1 = L_tex(pos).z; 101 | float c1 = L_tex(pos + d).z; 102 | 103 | return vec2(min3v(a0, b0, c0), max3v(a1, b1, c1)); 104 | } 105 | 106 | float lumGaussian7(vec2 pos, vec2 d) { 107 | float g = (L_tex(pos - (d + d)).x + L_tex(pos + (d + d)).x) * 0.06136; 108 | g = g + (L_tex(pos - d).x + L_tex(pos + d).x) * 0.24477; 109 | g = g + (L_tex(pos).x) * 0.38774; 110 | 111 | return g; 112 | } 113 | 114 | 115 | vec4 hook() { 116 | return vec4(lumGaussian7(HOOKED_pos, vec2(0, HOOKED_pt.y)), minmax3(HOOKED_pos, vec2(0, HOOKED_pt.y)), 0); 117 | } 118 | 119 | //!DESC Anime4K-v3.2-Upscale-DoG-x2-Apply 120 | //!WHEN OUTPUT.w MAIN.w / 1.200 > OUTPUT.h MAIN.h / 1.200 > * 121 | //!HOOK MAIN 122 | //!BIND HOOKED 123 | //!BIND LINELUMA 124 | //!BIND GAUSS_X2 125 | //!WIDTH MAIN.w 2 * 126 | //!HEIGHT MAIN.h 2 * 127 | 128 | #define STRENGTH 0.8 //De-blur proportional strength, higher is sharper. 129 | 130 | #define L_tex LINELUMA_tex 131 | 132 | vec4 hook() { 133 | 134 | float c = (L_tex(HOOKED_pos).x - GAUSS_X2_tex(HOOKED_pos).x) * STRENGTH; 135 | float cc = clamp(c + L_tex(HOOKED_pos).x, GAUSS_X2_tex(HOOKED_pos).y, GAUSS_X2_tex(HOOKED_pos).z) - L_tex(HOOKED_pos).x; 136 | 137 | //This trick is only possible if the inverse Y->RGB matrix has 1 for every row... (which is the case for BT.709) 138 | //Otherwise we would need to convert RGB to YUV, modify Y then convert back to RGB. 139 | return HOOKED_tex(HOOKED_pos) + cc; 140 | } 141 | 142 | 143 | 144 | -------------------------------------------------------------------------------- /nvim/.config/nvim/lua/config/lsp.lua: -------------------------------------------------------------------------------- 1 | local fzf = require('fzf-lua') 2 | local languages = require('config.languages') 3 | local icons = require('config.icons') 4 | local utils = require('config.utils') 5 | local nmap = utils.nmap 6 | local au = utils.au 7 | 8 | local function w(fn) 9 | return function(...) 10 | return fn({ 11 | ignore_current_line = true, 12 | jump1 = true, 13 | includeDeclaration = false, 14 | }, ...) 15 | end 16 | end 17 | 18 | vim.diagnostic.config({ 19 | severity_sort = true, 20 | -- virtual_text = false, 21 | -- virtual_lines = { 22 | -- current_line = true, 23 | -- }, 24 | float = { 25 | border = 'single', 26 | focusable = false, 27 | }, 28 | jump = { 29 | _highest = true, 30 | }, 31 | signs = { 32 | text = { 33 | [vim.diagnostic.severity.ERROR] = icons.Error, 34 | [vim.diagnostic.severity.WARN] = icons.Warn, 35 | [vim.diagnostic.severity.INFO] = icons.Info, 36 | [vim.diagnostic.severity.HINT] = icons.Hint, 37 | }, 38 | }, 39 | }) 40 | 41 | vim.lsp.semantic_tokens.enable(false) 42 | 43 | require("tiny-inline-diagnostic").setup({ 44 | preset = "classic", 45 | options = { 46 | multilines = { 47 | enabled = true 48 | }, 49 | use_icons_from_diagnostic = true 50 | } 51 | }) 52 | 53 | -- Setup LSP mappings 54 | -- :h lsp-defaults 55 | au('LspAttach', { 56 | desc = 'LSP actions', 57 | callback = function(event) 58 | local client = vim.lsp.get_client_by_id(event.data.client_id) 59 | if not client then 60 | return 61 | end 62 | 63 | -- disable semantic tokens 64 | client.server_capabilities.semanticTokensProvider = nil 65 | 66 | -- enable lsp folding 67 | if client:supports_method('textDocument/foldingRange') then 68 | vim.wo.foldexpr = 'v:lua.vim.lsp.foldexpr()' 69 | end 70 | 71 | -- enable lsp completion 72 | if client:supports_method('textDocument/completion') then 73 | vim.bo[event.buf].omnifunc = 'v:lua.vim.lsp.omnifunc' 74 | vim.lsp.completion.enable(true, client.id, event.buf, { 75 | convert = function(item) 76 | local kind = vim.lsp.protocol.CompletionItemKind[item.kind] or 'Unknown' 77 | local icon = icons.kinds[kind] 78 | return { 79 | kind = icon and icon .. ' ' .. kind or kind, 80 | } 81 | end, 82 | }) 83 | end 84 | 85 | -- enable inline completion 86 | if client:supports_method('textDocument/inlineCompletion') then 87 | vim.lsp.inline_completion.enable(true) 88 | vim.keymap.set('i', '', function() 89 | if not vim.lsp.inline_completion.get() then 90 | return '' 91 | end 92 | end, { expr = true, desc = 'Accept Inline Completion' }) 93 | end 94 | 95 | -- lsp mappings 96 | nmap('cr', vim.lsp.buf.rename, 'Rename', event.buf) 97 | nmap('ch', function() 98 | vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled()) 99 | end, 'Inlay Hints', event.buf) 100 | nmap('ca', fzf.lsp_code_actions, 'Code Action', event.buf) 101 | 102 | nmap('gr', w(fzf.lsp_references), 'References', event.buf) 103 | nmap('gi', w(fzf.lsp_implementations), 'Implementation', event.buf) 104 | nmap('gd', w(fzf.lsp_definitions), 'Definition', event.buf) 105 | nmap('gD', w(fzf.lsp_declarations), 'Declaration', event.buf) 106 | nmap('gy', w(fzf.lsp_typedefs), 'Type Definition', event.buf) 107 | end, 108 | }) 109 | 110 | -- Setup LSP servers 111 | vim.lsp.enable(vim.iter(languages) 112 | :filter(function(lang) 113 | return lang.lsp 114 | end) 115 | :map(function(lang) 116 | return lang.lsp 117 | end) 118 | :flatten() 119 | :totable()) 120 | 121 | vim.lsp.config('*', { 122 | capabilities = { 123 | textDocument = { 124 | completion = { 125 | completionItem = { 126 | snippetSupport = false, 127 | -- Fetch additional info for completion items 128 | resolveSupport = { 129 | properties = { 130 | 'documentation', 131 | 'detail', 132 | }, 133 | }, 134 | }, 135 | }, 136 | }, 137 | }, 138 | }) 139 | -------------------------------------------------------------------------------- /mpv/.config/mpv/shaders/Anime4K_Denoise_Bilateral_Median.glsl: -------------------------------------------------------------------------------- 1 | // MIT License 2 | 3 | // Copyright (c) 2019-2021 bloc97 4 | // All rights reserved. 5 | 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | 13 | // The above copyright notice and this permission notice shall be included in all 14 | // copies or substantial portions of the Software. 15 | 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | // SOFTWARE. 23 | 24 | //!DESC Anime4K-v3.2-Denoise-Bilateral-Median-Luma 25 | //!HOOK MAIN 26 | //!BIND HOOKED 27 | //!SAVE LINELUMA 28 | //!COMPONENTS 1 29 | 30 | float get_luma(vec4 rgba) { 31 | return dot(vec4(0.299, 0.587, 0.114, 0.0), rgba); 32 | } 33 | 34 | vec4 hook() { 35 | return vec4(get_luma(HOOKED_tex(HOOKED_pos)), 0.0, 0.0, 0.0); 36 | } 37 | 38 | //!DESC Anime4K-v3.2-Denoise-Bilateral-Median-Apply 39 | //!HOOK MAIN 40 | //!BIND HOOKED 41 | //!BIND LINELUMA 42 | 43 | #define INTENSITY_SIGMA 0.1 //Intensity window size, higher is stronger denoise, must be a positive real number 44 | #define SPATIAL_SIGMA 1.0 //Spatial window size, higher is stronger denoise, must be a positive real number. 45 | #define HISTOGRAM_REGULARIZATION 0.0 //Histogram regularization window size, higher values approximate a bilateral "closest-to-mean" filter. 46 | 47 | #define INTENSITY_POWER_CURVE 1.0 //Intensity window power curve. Setting it to 0 will make the intensity window treat all intensities equally, while increasing it will make the window narrower in darker intensities and wider in brighter intensities. 48 | 49 | #define KERNELSIZE int(max(int(SPATIAL_SIGMA), 1) * 2 + 1) //Kernel size, must be an positive odd integer. 50 | #define KERNELHALFSIZE (int(KERNELSIZE/2)) //Half of the kernel size without remainder. Must be equal to trunc(KERNELSIZE/2). 51 | #define KERNELLEN (KERNELSIZE * KERNELSIZE) //Total area of kernel. Must be equal to KERNELSIZE * KERNELSIZE. 52 | 53 | #define GETOFFSET(i) vec2((i % KERNELSIZE) - KERNELHALFSIZE, (i / KERNELSIZE) - KERNELHALFSIZE) 54 | 55 | float gaussian(float x, float s, float m) { 56 | float scaled = (x - m) / s; 57 | return exp(-0.5 * scaled * scaled); 58 | } 59 | 60 | vec4 getMedian(vec4 v[KERNELLEN], float w[KERNELLEN], float n) { 61 | 62 | for (int i=0; i v[i].x) { 67 | w_above += w[j]; 68 | } else if (v[j].x < v[i].x) { 69 | w_below += w[j]; 70 | } 71 | } 72 | 73 | if ((n - w_above) / n >= 0.5 && w_below / n <= 0.5) { 74 | return v[i]; 75 | } 76 | } 77 | } 78 | 79 | vec4 hook() { 80 | vec4 histogram_v[KERNELLEN]; 81 | float histogram_l[KERNELLEN]; 82 | float histogram_w[KERNELLEN]; 83 | float n = 0.0; 84 | 85 | float vc = LINELUMA_tex(HOOKED_pos).x; 86 | 87 | float is = pow(vc + 0.0001, INTENSITY_POWER_CURVE) * INTENSITY_SIGMA; 88 | float ss = SPATIAL_SIGMA; 89 | 90 | for (int i=0; i 0.0) { 99 | float histogram_wn[KERNELLEN]; 100 | n = 0.0; 101 | 102 | for (int i=0; i wildmenumode() ? "\\" : "\" 108 | cnoremap wildmenumode() ? "\\" : "\" 109 | 110 | " Buffer autocomplete 111 | set completeopt=menuone,noinsert,fuzzy,popup 112 | set completeitemalign=kind,abbr,menu 113 | set complete=.,o 114 | set autocomplete 115 | inoremap pumvisible() ? "\" : "\" 116 | inoremap pumvisible() ? "\" : "\" 117 | 118 | " Better file browser 119 | let g:netrw_banner=0 120 | nmap - Explore 121 | 122 | " Automatically rebalance windows on vim resize 123 | autocmd VimRc VimResized * wincmd = 124 | 125 | " Restore cursor position on buf enter 126 | autocmd VimRc BufRead * autocmd FileType ++once 127 | \ if &ft !~# 'commit\|rebase' && line("'\"") > 1 && line("'\"") <= line("$") | exe 'normal! g`"' | endif 128 | 129 | " Disable numbers in quickfix 130 | autocmd VimRc BufWinEnter quickfix set norelativenumber 131 | autocmd VimRc BufWinEnter quickfix set nonumber 132 | 133 | " Sync system clipboard and vim clipboard 134 | autocmd VimRc FocusGained,VimEnter * let @"=getreg('+') 135 | autocmd VimRc TextYankPost * if v:event.operator ==# 'y' | let @+=getreg('"') | endif 136 | 137 | " }}} 138 | 139 | " Text, tab and indent related {{{ 140 | 141 | " Use spaces instead of tabs 142 | set expandtab 143 | 144 | " 1 tab == 2 spaces 145 | set shiftwidth=2 146 | set tabstop=2 147 | 148 | " Text width is 80 characters 149 | set textwidth=80 150 | 151 | " Better automatic indentation 152 | " set smartindent 153 | 154 | " Use Unix as the standard file type 155 | set fileformats=unix,dos,mac 156 | 157 | " Better jumplist 158 | if has('nvim') 159 | set jumpoptions=stack 160 | endif 161 | 162 | " Auto comments are annoying, disable them 163 | autocmd VimRc FileType * set formatoptions-=cro 164 | 165 | " Very magic 166 | vnoremap / /\%V 167 | "nnoremap / /\v 168 | "vnoremap / /\v 169 | "cnoremap s/ smagic/ 170 | 171 | " }}} 172 | 173 | " Mappings and commands {{{ 174 | 175 | " With a map leader it's possible to do extra key combinations 176 | let mapleader = ' ' 177 | let maplocalleader = ' ' 178 | let g:mapleader = ' ' 179 | 180 | " Stupid highlight 181 | nmap noh 182 | 183 | " why shift???? 184 | noremap ; : 185 | 186 | " Navigation 187 | nmap " vsplit 188 | nmap % split 189 | nmap x close 190 | 191 | " Emacs like keybindings for the command line (:) and insert mode are better 192 | noremap! 193 | noremap! 194 | "noremap! 195 | "noremap! 196 | 197 | " }}} 198 | 199 | " User configuration {{{ 200 | if filereadable(expand("~/.vimrc.local")) 201 | source ~/.vimrc.local 202 | endif 203 | 204 | " }}} 205 | -------------------------------------------------------------------------------- /mpv/.config/mpv/shaders/Anime4K_Deblur_DoG.glsl: -------------------------------------------------------------------------------- 1 | // MIT License 2 | 3 | // Copyright (c) 2019-2021 bloc97 4 | // All rights reserved. 5 | 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | 13 | // The above copyright notice and this permission notice shall be included in all 14 | // copies or substantial portions of the Software. 15 | 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | // SOFTWARE. 23 | 24 | //!DESC Anime4K-v3.2-Deblur-DoG-(HQ)-Luma 25 | //!HOOK MAIN 26 | //!BIND HOOKED 27 | //!SAVE LINELUMA 28 | //!COMPONENTS 1 29 | 30 | float get_luma(vec4 rgba) { 31 | return dot(vec4(0.299, 0.587, 0.114, 0.0), rgba); 32 | } 33 | 34 | vec4 hook() { 35 | return vec4(get_luma(HOOKED_tex(HOOKED_pos)), 0.0, 0.0, 0.0); 36 | } 37 | 38 | //!DESC Anime4K-v3.2-Deblur-DoG-Kernel-X 39 | //!HOOK MAIN 40 | //!BIND HOOKED 41 | //!BIND LINELUMA 42 | //!SAVE MMKERNEL 43 | //!COMPONENTS 3 44 | 45 | #define L_tex LINELUMA_tex 46 | 47 | float max3v(float a, float b, float c) { 48 | return max(max(a, b), c); 49 | } 50 | float min3v(float a, float b, float c) { 51 | return min(min(a, b), c); 52 | } 53 | 54 | vec2 minmax3(vec2 pos, vec2 d) { 55 | float a = L_tex(pos - d).x; 56 | float b = L_tex(pos).x; 57 | float c = L_tex(pos + d).x; 58 | 59 | return vec2(min3v(a, b, c), max3v(a, b, c)); 60 | } 61 | 62 | float lumGaussian7(vec2 pos, vec2 d) { 63 | float g = (L_tex(pos - (d + d)).x + L_tex(pos + (d + d)).x) * 0.06136; 64 | g = g + (L_tex(pos - d).x + L_tex(pos + d).x) * 0.24477; 65 | g = g + (L_tex(pos).x) * 0.38774; 66 | 67 | return g; 68 | } 69 | 70 | 71 | vec4 hook() { 72 | return vec4(lumGaussian7(HOOKED_pos, vec2(HOOKED_pt.x, 0.0)), minmax3(HOOKED_pos, vec2(HOOKED_pt.x, 0.0)), 0.0); 73 | } 74 | 75 | 76 | //!DESC Anime4K-v3.2-Deblur-DoG-Kernel-Y 77 | //!HOOK MAIN 78 | //!BIND HOOKED 79 | //!BIND MMKERNEL 80 | //!SAVE MMKERNEL 81 | //!COMPONENTS 3 82 | 83 | #define L_tex MMKERNEL_tex 84 | 85 | float max3v(float a, float b, float c) { 86 | return max(max(a, b), c); 87 | } 88 | float min3v(float a, float b, float c) { 89 | return min(min(a, b), c); 90 | } 91 | 92 | vec2 minmax3(vec2 pos, vec2 d) { 93 | float a0 = L_tex(pos - d).y; 94 | float b0 = L_tex(pos).y; 95 | float c0 = L_tex(pos + d).y; 96 | 97 | float a1 = L_tex(pos - d).z; 98 | float b1 = L_tex(pos).z; 99 | float c1 = L_tex(pos + d).z; 100 | 101 | return vec2(min3v(a0, b0, c0), max3v(a1, b1, c1)); 102 | } 103 | 104 | float lumGaussian7(vec2 pos, vec2 d) { 105 | float g = (L_tex(pos - (d + d)).x + L_tex(pos + (d + d)).x) * 0.06136; 106 | g = g + (L_tex(pos - d).x + L_tex(pos + d).x) * 0.24477; 107 | g = g + (L_tex(pos).x) * 0.38774; 108 | 109 | return g; 110 | } 111 | 112 | 113 | vec4 hook() { 114 | return vec4(lumGaussian7(HOOKED_pos, vec2(0.0, HOOKED_pt.y)), minmax3(HOOKED_pos, vec2(0.0, HOOKED_pt.y)), 0.0); 115 | } 116 | 117 | //!DESC Anime4K-v3.2-Deblur-DoG-Apply 118 | //!HOOK MAIN 119 | //!BIND HOOKED 120 | //!BIND LINELUMA 121 | //!BIND MMKERNEL 122 | 123 | #define STRENGTH 0.6 //De-blur proportional strength, higher is sharper. However, it is better to tweak BLUR_CURVE instead to avoid ringing. 124 | #define BLUR_CURVE 0.6 //De-blur power curve, lower is sharper. Good values are between 0.3 - 1. Values greater than 1 softens the image; 125 | #define BLUR_THRESHOLD 0.1 //Value where curve kicks in, used to not de-blur already sharp edges. Only de-blur values that fall below this threshold. 126 | #define NOISE_THRESHOLD 0.001 //Value where curve stops, used to not sharpen noise. Only de-blur values that fall above this threshold. 127 | 128 | #define L_tex LINELUMA_tex 129 | 130 | vec4 hook() { 131 | float c = (L_tex(HOOKED_pos).x - MMKERNEL_tex(HOOKED_pos).x) * STRENGTH; 132 | 133 | float t_range = BLUR_THRESHOLD - NOISE_THRESHOLD; 134 | 135 | float c_t = abs(c); 136 | if (c_t > NOISE_THRESHOLD) { 137 | c_t = (c_t - NOISE_THRESHOLD) / t_range; 138 | c_t = pow(c_t, BLUR_CURVE); 139 | c_t = c_t * t_range + NOISE_THRESHOLD; 140 | c_t = c_t * sign(c); 141 | } else { 142 | c_t = c; 143 | } 144 | 145 | float cc = clamp(c_t + L_tex(HOOKED_pos).x, MMKERNEL_tex(HOOKED_pos).y, MMKERNEL_tex(HOOKED_pos).z) - L_tex(HOOKED_pos).x; 146 | 147 | //This trick is only possible if the inverse Y->RGB matrix has 1 for every row... (which is the case for BT.709) 148 | //Otherwise we would need to convert RGB to YUV, modify Y then convert back to RGB. 149 | return HOOKED_tex(HOOKED_pos) + cc; 150 | } 151 | 152 | 153 | 154 | -------------------------------------------------------------------------------- /mpv/.config/mpv/shaders/Anime4K_Upscale_Deblur_DoG_x2.glsl: -------------------------------------------------------------------------------- 1 | // MIT License 2 | 3 | // Copyright (c) 2019-2021 bloc97 4 | // All rights reserved. 5 | 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | 13 | // The above copyright notice and this permission notice shall be included in all 14 | // copies or substantial portions of the Software. 15 | 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | // SOFTWARE. 23 | 24 | //!DESC Anime4K-v3.2-Upscale-Deblur-DoG-x2-Luma 25 | //!HOOK MAIN 26 | //!BIND HOOKED 27 | //!SAVE LINELUMA 28 | //!COMPONENTS 1 29 | 30 | float get_luma(vec4 rgba) { 31 | return dot(vec4(0.299, 0.587, 0.114, 0.0), rgba); 32 | } 33 | 34 | vec4 hook() { 35 | return vec4(get_luma(HOOKED_tex(HOOKED_pos)), 0.0, 0.0, 0.0); 36 | } 37 | 38 | //!DESC Anime4K-v3.2-Upscale-Deblur-DoG-x2-Kernel-X 39 | //!WHEN OUTPUT.w MAIN.w / 1.200 > OUTPUT.h MAIN.h / 1.200 > * 40 | //!HOOK MAIN 41 | //!BIND HOOKED 42 | //!BIND LINELUMA 43 | //!SAVE GAUSS_X2 44 | //!COMPONENTS 3 45 | 46 | #define L_tex LINELUMA_tex 47 | 48 | float max3v(float a, float b, float c) { 49 | return max(max(a, b), c); 50 | } 51 | float min3v(float a, float b, float c) { 52 | return min(min(a, b), c); 53 | } 54 | 55 | vec2 minmax3(vec2 pos, vec2 d) { 56 | float a = L_tex(pos - d).x; 57 | float b = L_tex(pos).x; 58 | float c = L_tex(pos + d).x; 59 | 60 | return vec2(min3v(a, b, c), max3v(a, b, c)); 61 | } 62 | 63 | float lumGaussian7(vec2 pos, vec2 d) { 64 | float g = (L_tex(pos - (d + d)).x + L_tex(pos + (d + d)).x) * 0.06136; 65 | g = g + (L_tex(pos - d).x + L_tex(pos + d).x) * 0.24477; 66 | g = g + (L_tex(pos).x) * 0.38774; 67 | 68 | return g; 69 | } 70 | 71 | 72 | vec4 hook() { 73 | return vec4(lumGaussian7(HOOKED_pos, vec2(HOOKED_pt.x, 0)), minmax3(HOOKED_pos, vec2(HOOKED_pt.x, 0)), 0); 74 | } 75 | 76 | 77 | //!DESC Anime4K-v3.2-Upscale-Deblur-DoG-x2-Kernel-Y 78 | //!WHEN OUTPUT.w MAIN.w / 1.200 > OUTPUT.h MAIN.h / 1.200 > * 79 | //!HOOK MAIN 80 | //!BIND HOOKED 81 | //!BIND GAUSS_X2 82 | //!SAVE GAUSS_X2 83 | //!COMPONENTS 3 84 | 85 | #define L_tex GAUSS_X2_tex 86 | 87 | float max3v(float a, float b, float c) { 88 | return max(max(a, b), c); 89 | } 90 | float min3v(float a, float b, float c) { 91 | return min(min(a, b), c); 92 | } 93 | 94 | vec2 minmax3(vec2 pos, vec2 d) { 95 | float a0 = L_tex(pos - d).y; 96 | float b0 = L_tex(pos).y; 97 | float c0 = L_tex(pos + d).y; 98 | 99 | float a1 = L_tex(pos - d).z; 100 | float b1 = L_tex(pos).z; 101 | float c1 = L_tex(pos + d).z; 102 | 103 | return vec2(min3v(a0, b0, c0), max3v(a1, b1, c1)); 104 | } 105 | 106 | float lumGaussian7(vec2 pos, vec2 d) { 107 | float g = (L_tex(pos - (d + d)).x + L_tex(pos + (d + d)).x) * 0.06136; 108 | g = g + (L_tex(pos - d).x + L_tex(pos + d).x) * 0.24477; 109 | g = g + (L_tex(pos).x) * 0.38774; 110 | 111 | return g; 112 | } 113 | 114 | 115 | vec4 hook() { 116 | return vec4(lumGaussian7(HOOKED_pos, vec2(0, HOOKED_pt.y)), minmax3(HOOKED_pos, vec2(0, HOOKED_pt.y)), 0); 117 | } 118 | 119 | //!DESC Anime4K-v3.2-Upscale-Deblur-DoG-x2-Apply 120 | //!WHEN OUTPUT.w MAIN.w / 1.200 > OUTPUT.h MAIN.h / 1.200 > * 121 | //!HOOK MAIN 122 | //!BIND HOOKED 123 | //!BIND LINELUMA 124 | //!BIND GAUSS_X2 125 | //!WIDTH MAIN.w 2 * 126 | //!HEIGHT MAIN.h 2 * 127 | 128 | #define STRENGTH 0.6 //De-blur proportional strength, higher is sharper. However, it is better to tweak BLUR_CURVE instead to avoid ringing. 129 | #define BLUR_CURVE 0.6 //De-blur power curve, lower is sharper. Good values are between 0.3 - 1. Values greater than 1 softens the image; 130 | #define BLUR_THRESHOLD 0.1 //Value where curve kicks in, used to not de-blur already sharp edges. Only de-blur values that fall below this threshold. 131 | #define NOISE_THRESHOLD 0.001 //Value where curve stops, used to not sharpen noise. Only de-blur values that fall above this threshold. 132 | 133 | #define L_tex LINELUMA_tex 134 | 135 | vec4 hook() { 136 | float c = (L_tex(HOOKED_pos).x - GAUSS_X2_tex(HOOKED_pos).x) * STRENGTH; 137 | 138 | float t_range = BLUR_THRESHOLD - NOISE_THRESHOLD; 139 | 140 | float c_t = abs(c); 141 | if (c_t > NOISE_THRESHOLD && c_t < BLUR_THRESHOLD) { 142 | c_t = (c_t - NOISE_THRESHOLD) / t_range; 143 | c_t = pow(c_t, BLUR_CURVE); 144 | c_t = c_t * t_range + NOISE_THRESHOLD; 145 | c_t = c_t * sign(c); 146 | } else { 147 | c_t = c; 148 | } 149 | 150 | float cc = clamp(c_t + L_tex(HOOKED_pos).x, GAUSS_X2_tex(HOOKED_pos).y, GAUSS_X2_tex(HOOKED_pos).z) - L_tex(HOOKED_pos).x; 151 | 152 | //This trick is only possible if the inverse Y->RGB matrix has 1 for every row... (which is the case for BT.709) 153 | //Otherwise we would need to convert RGB to YUV, modify Y then convert back to RGB. 154 | return HOOKED_tex(HOOKED_pos) + cc; 155 | } 156 | 157 | 158 | 159 | -------------------------------------------------------------------------------- /mpv/.config/mpv/shaders/Anime4K_Darken_HQ.glsl: -------------------------------------------------------------------------------- 1 | // MIT License 2 | 3 | // Copyright (c) 2019-2021 bloc97 4 | // All rights reserved. 5 | 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | 13 | // The above copyright notice and this permission notice shall be included in all 14 | // copies or substantial portions of the Software. 15 | 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | // SOFTWARE. 23 | 24 | //!DESC Anime4K-v3.2-Darken-DoG-(HQ)-Luma 25 | //!HOOK MAIN 26 | //!BIND HOOKED 27 | //!SAVE LINELUMA 28 | //!COMPONENTS 1 29 | 30 | float get_luma(vec4 rgba) { 31 | return dot(vec4(0.299, 0.587, 0.114, 0.0), rgba); 32 | } 33 | 34 | vec4 hook() { 35 | return vec4(get_luma(HOOKED_tex(HOOKED_pos)), 0.0, 0.0, 0.0); 36 | } 37 | 38 | //!DESC Anime4K-v3.2-Darken-DoG-(HQ)-Difference-X 39 | //!HOOK MAIN 40 | //!BIND HOOKED 41 | //!BIND LINELUMA 42 | //!SAVE LINEKERNEL 43 | //!COMPONENTS 1 44 | 45 | #define SPATIAL_SIGMA (1.0 * float(HOOKED_size.y) / 1080.0) //Spatial window size, must be a positive real number. 46 | 47 | #define KERNELSIZE (max(int(ceil(SPATIAL_SIGMA * 2.0)), 1) * 2 + 1) //Kernel size, must be an positive odd integer. 48 | #define KERNELHALFSIZE (int(KERNELSIZE/2)) //Half of the kernel size without remainder. Must be equal to trunc(KERNELSIZE/2). 49 | #define KERNELLEN (KERNELSIZE * KERNELSIZE) //Total area of kernel. Must be equal to KERNELSIZE * KERNELSIZE. 50 | 51 | float gaussian(float x, float s, float m) { 52 | float scaled = (x - m) / s; 53 | return exp(-0.5 * scaled * scaled); 54 | } 55 | 56 | float comp_gaussian_x() { 57 | 58 | float g = 0.0; 59 | float gn = 0.0; 60 | 61 | for (int i=0; iRGB matrix has 1 for every row... (which is the case for BT.709) 195 | //Otherwise we would need to convert RGB to YUV, modify Y then convert back to RGB. 196 | return HOOKED_tex(HOOKED_pos) + (comp_gaussian_y() * STRENGTH); 197 | } 198 | 199 | -------------------------------------------------------------------------------- /zsh/.zshrc: -------------------------------------------------------------------------------- 1 | # General {{{ 2 | 3 | # Source .profile 4 | if [ -f ~/.profile ]; then 5 | source ~/.profile 6 | fi 7 | 8 | # History file configuration 9 | [ -z "$HISTFILE" ] && HISTFILE="$HOME/.zhistory" 10 | HISTSIZE=100000 11 | SAVEHIST=50000 12 | setopt HIST_FIND_NO_DUPS 13 | setopt HIST_IGNORE_DUPS 14 | setopt HIST_IGNORE_ALL_DUPS 15 | setopt HIST_SAVE_NO_DUPS 16 | setopt HIST_REDUCE_BLANKS 17 | setopt HIST_IGNORE_SPACE 18 | setopt HIST_VERIFY 19 | setopt SHARE_HISTORY 20 | 21 | # Input configuration 22 | setopt EMACS 23 | setopt INTERACTIVE_COMMENTS 24 | setopt GLOB_DOTS 25 | setopt EXTENDED_GLOB 26 | WORDCHARS=${WORDCHARS//[\/]} 27 | 28 | # Directory configuration 29 | setopt AUTO_CD 30 | setopt AUTO_PUSHD 31 | setopt CD_SILENT 32 | setopt PUSHD_IGNORE_DUPS 33 | 34 | # Job configuration 35 | setopt LONG_LIST_JOBS 36 | setopt NO_BG_NICE 37 | setopt NO_CHECK_JOBS 38 | setopt NO_HUP 39 | 40 | # GPG configuration 41 | # export GPG_TTY=$(tty) 42 | 43 | # Set terminal title to current directory 44 | precmd() { print -Pn "\e]2;${PWD}\a" } 45 | 46 | # }}} 47 | 48 | # Mappings {{{ 49 | 50 | autoload -z edit-command-line 51 | zle -N edit-command-line 52 | bindkey '^[' edit-command-line 53 | 54 | # }}} 55 | 56 | # Aliases & functions {{{ 57 | 58 | # Alias nvim 59 | if command -v nvim >/dev/null 2>&1; then 60 | alias vim=nvim 61 | alias vimdiff='nvim -d' 62 | alias nvimf='nvim -c "FzfLua files"' 63 | alias nviml='nvim --listen /tmp/nvim.pipe' 64 | alias vimf='nvimf' 65 | alias viml='nviml' 66 | fi 67 | 68 | # Alias copy/paste 69 | function vcopy { 70 | if command -v wl-copy >/dev/null 2>&1 && [ "$XDG_SESSION_TYPE" = "wayland" ]; then 71 | wl-copy 72 | elif command -v xsel >/dev/null 2>&1; then 73 | xsel --clipboard --input 74 | elif command -v xclip >/dev/null 2>&1; then 75 | xclip -selection clipboard 76 | fi 77 | } 78 | function vpaste { 79 | if command -v wl-paste >/dev/null 2>&1 && [ "$XDG_SESSION_TYPE" = "wayland" ]; then 80 | wl-paste 81 | elif command -v xsel >/dev/null 2>&1; then 82 | xsel --clipboard --output 83 | elif command -v xclip >/dev/null 2>&1; then 84 | xclip -selection clipboard -o 85 | fi 86 | } 87 | 88 | # Arch aliases 89 | # Show unnecessary packages 90 | alias pan='yay -Qqd | yay -Rsu --print -' 91 | # Upadte mirrors 92 | alias pam='rate-mirrors arch | sudo tee /etc/pacman.d/mirrorlist' 93 | # Remove orphaned packages 94 | alias pac='yay -Rns $(yay -Qtdq)' 95 | # Update system 96 | alias pau='yay -Syu' 97 | alias pauu='yay -Syu --noconfirm' 98 | # Remove package 99 | alias par='yay -Rnsu' 100 | alias parr='yay -Rnsu --noconfirm' 101 | # Install package 102 | alias pai='yay -Sy' 103 | alias paii='yay -Sy --noconfirm' 104 | 105 | # Set proxy 106 | function setproxy { 107 | export no_proxy="localhost,127.0.0.1,localaddress,.localdomain.com" 108 | 109 | local reversed_proxy=$(echo $1 | rev) 110 | local host=$(echo $reversed_proxy | cut -d: -f2- | rev) 111 | local port=$(echo $reversed_proxy | cut -d: -f1 | rev) 112 | 113 | if [ -n "$2" ] && [ -n "$3" ]; then 114 | local user=$2 115 | local password=$3 116 | export http_proxy="http://$user:$password@$1" 117 | export JDK_JAVA_OPTIONS="-Dhttp.proxyHost='$host' -Dhttp.proxyPort='$port' -Dhttps.proxyHost='$host' -Dhttps.proxyPort='$port' -Dhttp.nonProxyHosts='$no_proxy' -Dhttp.proxyUser='$user' -Dhttp.proxyPassword='$password' -Dhttps.proxyUser='$user' -Dhttps.proxyPassword='$password'" 118 | else 119 | export http_proxy="http://$1" 120 | export JDK_JAVA_OPTIONS="-Dhttp.proxyHost='$host' -Dhttp.proxyPort='$port' -Dhttps.proxyHost='$host' -Dhttps.proxyPort='$port' -Dhttp.nonProxyHosts='$no_proxy'" 121 | fi 122 | 123 | export https_proxy=$http_proxy 124 | export ftp_proxy=$http_proxy 125 | export rsync_proxy=$http_proxy 126 | export HTTP_PROXY=$http_proxy 127 | export HTTPS_PROXY=$http_proxy 128 | export FTP_PROXY=$http_proxy 129 | export RSYNC_PROXY=$http_proxy 130 | } 131 | 132 | # Unset proxy 133 | function unsetproxy { 134 | unset http_proxy https_proxy ftp_proxy rsync_proxy \ 135 | HTTP_PROXY HTTPS_PROXY FTP_PROXY RSYNC_PROXY \ 136 | JDK_JAVA_OPTIONS 137 | } 138 | 139 | # }}} 140 | 141 | # Plugins {{{ 142 | 143 | # Set git alias prefix 144 | zstyle ':zim:git' aliases-prefix g 145 | 146 | # Enable colors for ls 147 | zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS} 148 | 149 | # Configure autocomplete 150 | zstyle ':autocomplete:*' delay 0.5 151 | 152 | # Pathogen-like loader for plugins 153 | if [ -z "$PLUGINS_LOADED" ]; then 154 | PLUGINS_LOADED=() 155 | for filename in ~/.zsh/pack/*/start/**/*(.N); do 156 | case "$filename" in 157 | (*.plugin.zsh|*init.zsh|*.zsh-theme) 158 | plugindir="${filename:h}" 159 | functiondir="$plugindir/functions" 160 | if [ -d "$functiondir" ]; then 161 | fpath=( "$functiondir" "${fpath[@]}" ) 162 | for pluginfunction in $functiondir/*(.N); do 163 | functionname="${pluginfunction:t}" 164 | autoload -Uz $functionname 165 | done 166 | fi 167 | source "$filename" >/dev/null 2>&1 168 | PLUGINS_LOADED+=("$filename") 169 | ;; 170 | esac 171 | done 172 | export PLUGINS_LOADED 173 | fi 174 | 175 | # Bind c-n and c-p to navigate in completion menu properly 176 | bindkey -M menuselect '^N' menu-complete 177 | bindkey -M menuselect '^P' reverse-menu-complete 178 | 179 | # Bind shift-tab to accept autosuggestions 180 | bindkey '^[[Z' autosuggest-accept 181 | 182 | # Configure prompt 183 | if command -v starship >/dev/null 2>&1; then 184 | eval "$(starship init zsh)" 185 | fi 186 | 187 | # Initialize mise if installed 188 | if command -v mise >/dev/null 2>&1; then 189 | eval "$(mise activate zsh)" 190 | fi 191 | 192 | # Configure FZF 193 | [ -f ~/.fzf.zsh ] && source ~/.fzf.zsh 194 | export FZF_DEFAULT_OPTS="--no-hscroll --color=border:#268bd2 --border=none --margin 0,0 --preview-window=border-sharp:wrap --no-separator --info=inline-right" 195 | export FZF_DEFAULT_COMMAND='rg --files --hidden --follow' 196 | export FZF_CTRL_T_COMMAND=$FZF_DEFAULT_COMMAND 197 | export FZF_ALT_C_COMMAND='rg --files --hidden --follow --null | xargs -0 dirname | uniq' 198 | 199 | # Adjust git aliases 200 | unalias gh 2>/dev/null # Conflict with github-cli 201 | unalias gdu 2>/dev/null # Conflict with gdu 202 | alias gc='git commit --signoff --verbose' 203 | alias gca='git commit --signoff --verbose --all' 204 | alias gcA='git commit --signoff --verbose --patch' 205 | alias gcm='git commit --signoff --message' 206 | 207 | # Set theme last 208 | source ~/.zsh/pack/bundle/start/tinted-shell/scripts/base16-$BASE16_THEME_DEFAULT.sh; 209 | source ~/.zsh/pack/bundle/start/tinted-fzf/sh/base16-$BASE16_THEME_DEFAULT.sh; 210 | export BAT_THEME="base16-256" 211 | 212 | # }}} 213 | 214 | # User configuration {{{ 215 | 216 | # Load user config 217 | [ -f "$HOME/.zshrc.local" ] && source "$HOME/.zshrc.local" 218 | [ -f "$HOME/.zshrc.work" ] && source "$HOME/.zshrc.work" 219 | 220 | # }}} 221 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "tmux/.tmux/bundle/tmux-continuum"] 2 | path = tmux/.tmux/pack/bundle/start/tmux-continuum 3 | url = https://github.com/tmux-plugins/tmux-continuum 4 | [submodule "tmux/.tmux/bundle/tmux-resurrect"] 5 | path = tmux/.tmux/pack/bundle/start/tmux-resurrect 6 | url = https://github.com/tmux-plugins/tmux-resurrect 7 | [submodule "zsh/.fzf"] 8 | path = zsh/.fzf 9 | url = https://github.com/junegunn/fzf 10 | [submodule "zsh/.zsh/bundle/zsh-kubernetes"] 11 | path = zsh/.zsh/pack/bundle/start/zsh-kubernetes 12 | url = https://github.com/Dbz/zsh-kubernetes 13 | [submodule "zsh/.zsh/bundle/utility"] 14 | path = zsh/.zsh/pack/bundle/start/utility 15 | url = https://github.com/zimfw/utility 16 | [submodule "zsh/.zsh/bundle/archive"] 17 | path = zsh/.zsh/pack/bundle/start/archive 18 | url = https://github.com/zimfw/archive 19 | [submodule "zsh/.zsh/bundle/zsh-autosuggestions"] 20 | path = zsh/.zsh/pack/bundle/start/zsh-autosuggestions 21 | url = https://github.com/zsh-users/zsh-autosuggestions 22 | [submodule "zsh/.zsh/bundle/git"] 23 | path = zsh/.zsh/pack/bundle/start/git 24 | url = https://github.com/zimfw/git 25 | [submodule "zsh/.zsh/bundle/zsh-completions"] 26 | path = zsh/.zsh/pack/bundle/start/zsh-completions 27 | url = https://github.com/zsh-users/zsh-completions 28 | [submodule "vim/.vim/pack/bundle/start/nvim-treesitter"] 29 | path = nvim/.config/nvim/pack/bundle/start/nvim-treesitter 30 | url = https://github.com/nvim-treesitter/nvim-treesitter 31 | branch = main 32 | [submodule "vim/.vim/pack/bundle/start/nvim-lspconfig"] 33 | path = nvim/.config/nvim/pack/bundle/start/nvim-lspconfig 34 | url = https://github.com/neovim/nvim-lspconfig 35 | [submodule "vim/.vim/pack/bundle/start/mason.nvim"] 36 | path = nvim/.config/nvim/pack/bundle/start/mason.nvim 37 | url = https://github.com/williamboman/mason.nvim 38 | [submodule "vim/.vim/pack/bundle/start/fzf-lua"] 39 | path = nvim/.config/nvim/pack/bundle/start/fzf-lua 40 | url = https://github.com/ibhagwan/fzf-lua 41 | [submodule "zsh/.zsh/pack/bundle/start/base16-fzf"] 42 | path = zsh/.zsh/pack/bundle/start/tinted-fzf 43 | url = https://github.com/tinted-theming/tinted-fzf 44 | [submodule "vim/.vim/pack/bundle/start/nvim-web-devicons"] 45 | path = nvim/.config/nvim/pack/bundle/start/nvim-web-devicons 46 | url = https://github.com/nvim-tree/nvim-web-devicons 47 | [submodule "zsh/.zsh/pack/bundle/start/base16-shell"] 48 | path = zsh/.zsh/pack/bundle/start/tinted-shell 49 | url = https://github.com/tinted-theming/tinted-shell 50 | [submodule "vim/.vim/pack/bundle/start/tmux.nvim"] 51 | path = nvim/.config/nvim/pack/bundle/start/tmux.nvim 52 | url = https://github.com/aserowy/tmux.nvim 53 | [submodule "zsh/.zsh/pack/bundle/start/fast-syntax-highlighting"] 54 | path = zsh/.zsh/pack/bundle/start/fast-syntax-highlighting 55 | url = https://github.com/zdharma-continuum/fast-syntax-highlighting 56 | [submodule "zsh/.zsh/pack/bundle/start/zsh-expand-all"] 57 | path = zsh/.zsh/pack/bundle/start/zsh-expand-all 58 | url = https://github.com/simnalamburt/zsh-expand-all 59 | [submodule "vim/.vim/pack/bundle/start/nvim-jdtls"] 60 | path = nvim/.config/nvim/pack/bundle/start/nvim-jdtls 61 | url = https://github.com/mfussenegger/nvim-jdtls 62 | [submodule "zsh/.zsh/pack/bundle/start/zsh-autoswitch-virtualenv"] 63 | path = zsh/.zsh/pack/bundle/start/zsh-autoswitch-virtualenv 64 | url = https://github.com/MichaelAquilina/zsh-autoswitch-virtualenv 65 | [submodule "vim/.vim/pack/bundle/start/nvim-dap"] 66 | path = nvim/.config/nvim/pack/bundle/start/nvim-dap 67 | url = https://github.com/mfussenegger/nvim-dap 68 | [submodule "vim/.vim/pack/bundle/start/nvim-dap-virtual-text"] 69 | path = nvim/.config/nvim/pack/bundle/start/nvim-dap-virtual-text 70 | url = https://github.com/theHamsta/nvim-dap-virtual-text 71 | [submodule "vim/.vim/pack/bundle/start/nvim-dap-vscode-js"] 72 | path = nvim/.config/nvim/pack/bundle/start/nvim-dap-vscode-js 73 | url = https://github.com/mxsdev/nvim-dap-vscode-js 74 | [submodule "zsh/.zsh/pack/bundle/start/_zsh-autocomplete"] 75 | path = zsh/.zsh/pack/bundle/start/1_zsh-autocomplete 76 | url = https://github.com/marlonrichert/zsh-autocomplete 77 | [submodule "nvim/.config/nvim/pack/bundle/start/plenary.nvim"] 78 | path = nvim/.config/nvim/pack/bundle/start/plenary.nvim 79 | url = https://github.com/nvim-lua/plenary.nvim 80 | [submodule "nvim/.config/nvim/pack/bundle/start/CopilotChat.nvim"] 81 | path = nvim/.config/nvim/pack/bundle/start/CopilotChat.nvim 82 | url = https://github.com/CopilotC-Nvim/CopilotChat.nvim 83 | branch = main 84 | [submodule "nvim/.config/nvim/pack/bundle/start/gitsigns.nvim"] 85 | path = nvim/.config/nvim/pack/bundle/start/gitsigns.nvim 86 | url = https://github.com/lewis6991/gitsigns.nvim 87 | [submodule "nvim/.config/nvim/pack/bundle/start/roslyn.nvim"] 88 | path = nvim/.config/nvim/pack/bundle/start/roslyn.nvim 89 | url = https://github.com/seblyng/roslyn.nvim 90 | [submodule "nvim/.config/nvim/pack/bundle/start/nvim-treesitter-context"] 91 | path = nvim/.config/nvim/pack/bundle/start/nvim-treesitter-context 92 | url = https://github.com/nvim-treesitter/nvim-treesitter-context 93 | [submodule "nvim/.config/nvim/pack/bundle/start/myplugins.nvim"] 94 | path = nvim/.config/nvim/pack/bundle/start/myplugins.nvim 95 | url = https://github.com/deathbeam/myplugins.nvim 96 | [submodule "nvim/.config/nvim/pack/bundle/start/nvim-treehopper"] 97 | path = nvim/.config/nvim/pack/bundle/start/nvim-treehopper 98 | url = https://github.com/mfussenegger/nvim-treehopper 99 | [submodule "nvim/.config/nvim/pack/bundle/start/mcphub.nvim"] 100 | path = nvim/.config/nvim/pack/bundle/start/mcphub.nvim 101 | url = https://github.com/ravitemer/mcphub.nvim 102 | [submodule "nvim/.config/nvim/pack/bundle/start/helpful.vim"] 103 | path = nvim/.config/nvim/pack/bundle/start/helpful.vim 104 | url = https://github.com/tweekmonster/helpful.vim 105 | [submodule "nvim/.config/nvim/pack/bundle/start/debugprint.nvim"] 106 | path = nvim/.config/nvim/pack/bundle/start/debugprint.nvim 107 | url = https://github.com/andrewferrier/debugprint.nvim 108 | [submodule "nvim/.config/nvim/pack/bundle/start/oil.nvim"] 109 | path = nvim/.config/nvim/pack/bundle/start/oil.nvim 110 | url = https://github.com/stevearc/oil.nvim 111 | [submodule "nvim/.config/nvim/pack/bundle/start/tinted-nvim"] 112 | path = nvim/.config/nvim/pack/bundle/start/tinted-nvim 113 | url = https://github.com/tinted-theming/tinted-nvim 114 | [submodule "quickshell/.config/quickshell/hyprquickshot"] 115 | path = quickshell/.config/quickshell/hyprquickshot 116 | url = https://github.com/JamDon2/hyprquickshot 117 | [submodule "nvim/.config/nvim/pack/bundle/start/which-key.nvim"] 118 | path = nvim/.config/nvim/pack/bundle/start/which-key.nvim 119 | url = https://github.com/folke/which-key.nvim 120 | [submodule "nvim/.config/nvim/pack/bundle/start/tiny-inline-diagnostic.nvim"] 121 | path = nvim/.config/nvim/pack/bundle/start/tiny-inline-diagnostic.nvim 122 | url = https://github.com/rachartier/tiny-inline-diagnostic.nvim 123 | -------------------------------------------------------------------------------- /mpv/.config/mpv/shaders/Anime4K_Thin_HQ.glsl: -------------------------------------------------------------------------------- 1 | // MIT License 2 | 3 | // Copyright (c) 2019-2021 bloc97 4 | // All rights reserved. 5 | 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | 13 | // The above copyright notice and this permission notice shall be included in all 14 | // copies or substantial portions of the Software. 15 | 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | // SOFTWARE. 23 | 24 | //!DESC Anime4K-v3.2-Thin-(HQ)-Luma 25 | //!HOOK MAIN 26 | //!BIND HOOKED 27 | //!SAVE LINELUMA 28 | //!COMPONENTS 1 29 | 30 | float get_luma(vec4 rgba) { 31 | return dot(vec4(0.299, 0.587, 0.114, 0.0), rgba); 32 | } 33 | 34 | vec4 hook() { 35 | return vec4(get_luma(HOOKED_tex(HOOKED_pos)), 0.0, 0.0, 0.0); 36 | } 37 | 38 | //!DESC Anime4K-v3.2-Thin-(HQ)-Sobel-X 39 | //!HOOK MAIN 40 | //!BIND LINELUMA 41 | //!SAVE LINESOBEL 42 | //!COMPONENTS 2 43 | 44 | vec4 hook() { 45 | float l = LINELUMA_texOff(vec2(-1.0, 0.0)).x; 46 | float c = LINELUMA_tex(LINELUMA_pos).x; 47 | float r = LINELUMA_texOff(vec2(1.0, 0.0)).x; 48 | 49 | float xgrad = (-l + r); 50 | float ygrad = (l + c + c + r); 51 | 52 | return vec4(xgrad, ygrad, 0.0, 0.0); 53 | } 54 | 55 | 56 | //!DESC Anime4K-v3.2-Thin-(HQ)-Sobel-Y 57 | //!HOOK MAIN 58 | //!BIND LINESOBEL 59 | //!SAVE LINESOBEL 60 | //!COMPONENTS 1 61 | 62 | vec4 hook() { 63 | float tx = LINESOBEL_texOff(vec2(0.0, -1.0)).x; 64 | float cx = LINESOBEL_tex(LINESOBEL_pos).x; 65 | float bx = LINESOBEL_texOff(vec2(0.0, 1.0)).x; 66 | 67 | float ty = LINESOBEL_texOff(vec2(0.0, -1.0)).y; 68 | float by = LINESOBEL_texOff(vec2(0.0, 1.0)).y; 69 | 70 | float xgrad = (tx + cx + cx + bx) / 8.0; 71 | 72 | float ygrad = (-ty + by) / 8.0; 73 | 74 | //Computes the luminance's gradient 75 | float norm = sqrt(xgrad * xgrad + ygrad * ygrad); 76 | return vec4(pow(norm, 0.7)); 77 | } 78 | 79 | 80 | //!DESC Anime4K-v3.2-Thin-(HQ)-Gaussian-X 81 | //!HOOK MAIN 82 | //!BIND HOOKED 83 | //!BIND LINESOBEL 84 | //!SAVE LINESOBEL 85 | //!COMPONENTS 1 86 | 87 | #define SPATIAL_SIGMA (2.0 * float(HOOKED_size.y) / 1080.0) //Spatial window size, must be a positive real number. 88 | 89 | #define KERNELSIZE (max(int(ceil(SPATIAL_SIGMA * 2.0)), 1) * 2 + 1) //Kernel size, must be an positive odd integer. 90 | #define KERNELHALFSIZE (int(KERNELSIZE/2)) //Half of the kernel size without remainder. Must be equal to trunc(KERNELSIZE/2). 91 | #define KERNELLEN (KERNELSIZE * KERNELSIZE) //Total area of kernel. Must be equal to KERNELSIZE * KERNELSIZE. 92 | 93 | float gaussian(float x, float s, float m) { 94 | float scaled = (x - m) / s; 95 | return exp(-0.5 * scaled * scaled); 96 | } 97 | 98 | float comp_gaussian_x() { 99 | 100 | float g = 0.0; 101 | float gn = 0.0; 102 | 103 | for (int i=0; i