From b487984ecc61c6229cf92550030745c192fd3d0b Mon Sep 17 00:00:00 2001 From: Arnold Sommerfeld Date: Wed, 17 May 2023 18:44:48 +0100 Subject: first commit --- .editorconfig | 16 + README.md | 3 + barscripts/gpu-memory | 3 + barscripts/gpu-temp | 3 + barscripts/gpu-usage | 3 + create-efi.sh | 57 + etc/modules-load.d/tcp_bbr.conf | 1 + etc/pacman.d/hooks/orphans.hook | 12 + etc/sysctl.d/99-sysctl.conf | 19 + etc/systemd/system.conf.d/timeout.conf | 3 + etc2/xdg/reflector/reflector.conf | 39 + firefox/chrome/userChrome.css | 3 + firefox/user-overrides.js | 78 ++ home/.alsoftrc | 4 + home/.bash_logout | 7 + home/.bashrc | 52 + home/.config/MangoHud/MangoHud.conf | 117 ++ home/.config/X11/Xmodmap | 1 + home/.config/X11/Xresources | 67 ++ home/.config/X11/xinitrc | 7 + home/.config/X11/xprofile | 18 + home/.config/alacritty/alacritty.yml | 62 ++ home/.config/bat/config | 25 + home/.config/bspwm/bspwmrc | 49 + home/.config/clangd/config.yaml | 8 + home/.config/dunst/dunstrc | 466 ++++++++ home/.config/fakecam/config.ini | 11 + home/.config/fontconfig/fonts.conf | 35 + home/.config/gamemode.ini | 97 ++ home/.config/git/config | 119 +++ home/.config/git/ignore | 558 ++++++++++ home/.config/git/noattributes | 389 +++++++ home/.config/gtk-2.0/gtkfilechooser.ini | 11 + home/.config/gtk-2.0/gtkrc-2.0 | 18 + home/.config/gtk-3.0/gtk.css | 41 + home/.config/gtk-3.0/settings.ini | 20 + home/.config/htop/htoprc | 63 ++ .../ipython/profile_default/ipython_config.py | 625 +++++++++++ home/.config/lf/lfrc | 113 ++ home/.config/lsd/config.yaml | 19 + home/.config/mimeapps.list | 100 ++ home/.config/mpv/input.conf | 96 ++ home/.config/mpv/mpv.conf | 111 ++ home/.config/mpv/scripts/webtorrent-hook.lua | 138 +++ home/.config/neofetch/config.conf | 764 +++++++++++++ home/.config/npm/npmrc | 4 + home/.config/nvim/after/ftplugin/c.lua | 1 + home/.config/nvim/after/ftplugin/cfg.lua | 3 + home/.config/nvim/after/ftplugin/cpp.lua | 2 + home/.config/nvim/after/ftplugin/dosini.lua | 3 + home/.config/nvim/after/ftplugin/gitcommit.lua | 5 + home/.config/nvim/after/ftplugin/gitrebase.lua | 20 + home/.config/nvim/after/ftplugin/help.lua | 3 + home/.config/nvim/after/ftplugin/json.lua | 1 + home/.config/nvim/after/ftplugin/mail.lua | 2 + home/.config/nvim/after/ftplugin/markdown.lua | 2 + home/.config/nvim/after/ftplugin/tex.lua | 4 + home/.config/nvim/after/ftplugin/text.lua | 5 + home/.config/nvim/after/ftplugin/tmux.lua | 1 + home/.config/nvim/after/ftplugin/xdefaults.lua | 9 + home/.config/nvim/after/ftplugin/xmodmap.lua | 4 + home/.config/nvim/after/plugin/autocmds.lua | 137 +++ home/.config/nvim/after/plugin/mappings.lua | 58 + home/.config/nvim/filetype.lua | 7 + home/.config/nvim/init.lua | 26 + home/.config/nvim/lua/cfg/lsp.lua | 64 ++ home/.config/nvim/lua/cfg/options.lua | 124 +++ home/.config/nvim/lua/cfg/utils.lua | 24 + home/.config/nvim/lua/custom/plugins/init.lua | 1117 ++++++++++++++++++++ home/.config/nvim/lua/mapper.lua | 84 ++ home/.config/pacman/makepkg.conf | 11 + home/.config/pam-gnupg | 7 + home/.config/paru/paru.conf | 25 + .../pipewire/media-session.d/bluez-monitor.conf | 130 +++ home/.config/polybar/config | 463 ++++++++ home/.config/pulse/client.conf | 36 + home/.config/pulse/daemon.conf | 90 ++ home/.config/pulse/default.pa | 6 + home/.config/pulse/system.pa | 57 + home/.config/ripgrep/ripgreprc | 4 + home/.config/rofi/config.rasi | 16 + home/.config/sh/aliases | 73 ++ home/.config/sh/envrc | 220 ++++ home/.config/sh/inputrc | 20 + home/.config/sh/shinit | 41 + home/.config/streamlink/config | 5 + home/.config/sx/sxrc | 1 + home/.config/sxhkd/sxhkdrc | 199 ++++ home/.config/sxiv/exec/key-handler | 21 + .../systemd/user/bridge.service.d/override.conf | 3 + .../systemd/user/dirmngr.socket.d/override.conf | 3 + home/.config/systemd/user/fakecam.service | 14 + .../user/gpg-agent-browser.socket.d/override.conf | 3 + .../user/gpg-agent-extra.socket.d/override.conf | 3 + .../user/gpg-agent-ssh.socket.d/override.conf | 3 + .../systemd/user/gpg-agent.service.d/override.conf | 2 + .../systemd/user/gpg-agent.socket.d/override.conf | 3 + home/.config/systemd/user/noisetorch.service | 14 + .../systemd/user/spotifyd.service.d/override.conf | 10 + .../user/vdirsyncer.service.d/override.conf | 3 + home/.config/tmux/tmux.conf | 87 ++ home/.config/user-dirs.dirs | 8 + home/.config/user-dirs.locale | 1 + home/.config/wget/wgetrc | 1 + home/.config/yt-dlp/config | 9 + home/.config/zathura/zathurarc | 9 + home/.config/zsh/.zprofile | 1 + home/.config/zsh/.zshrc | 192 ++++ home/.hushlogin | 0 home/.local/bin/automute | 123 +++ home/.local/bin/display-setup | 22 + home/.local/bin/input-setup | 50 + home/.local/bin/launch-polybar | 17 + home/.local/bin/linkhandler | 49 + home/.local/bin/locknpause | 4 + home/.local/bin/record | 86 ++ home/.local/bin/rqr | 6 + home/.local/bin/stop | 7 + home/.local/bin/stream | 94 ++ home/.local/bin/terminal-benchmark | 61 ++ home/.local/bin/terminal-testdrive | 66 ++ home/.local/bin/tokodi | 13 + home/.local/bin/videowrapper | 7 + home/.local/bin/wqr | 11 + .../csgo/cfg/aim1v1.cfg | 27 + .../csgo/cfg/autoexec.cfg | 257 +++++ .../csgo/cfg/practice.cfg | 63 ++ .../Left 4 Dead 2/left4dead2/cfg/autoexec.cfg | 121 +++ home/.local/share/applications/mail.desktop | 19 + home/.local/share/applications/mimeapps.list | 1 + home/.local/share/gnupg/gpg-agent.conf | 8 + home/.local/share/gnupg/gpg.conf | 9 + home/.local/share/gnupg/sshcontrol | 15 + home/.pam_environment | 2 + home/.profile | 24 + home/.ssh/config | 31 + home/.ssh/nym.pub | 1 + home/.ssh/personal.pub | 1 + home/.ssh/work.pub | 1 + home/.urlview | 33 + home/.zprofile | 1 + lists/caps2esc.map | 2 + meta/base/PKGBUILD | 69 ++ meta/bt/PKGBUILD | 15 + meta/btc/PKGBUILD | 19 + meta/cpp/PKGBUILD | 25 + meta/dev/PKGBUILD | 23 + meta/extra/PKGBUILD | 16 + meta/fonts/PKGBUILD | 19 + meta/gaming/PKGBUILD | 27 + meta/intel/PKGBUILD | 20 + meta/mail/PKGBUILD | 17 + meta/media/PKGBUILD | 15 + meta/nvidia/PKGBUILD | 21 + meta/python/PKGBUILD | 18 + meta/sound/PKGBUILD | 22 + meta/work/PKGBUILD | 31 + meta/x-base/PKGBUILD | 20 + meta/x-de/PKGBUILD | 32 + meta/x-extra/PKGBUILD | 21 + 160 files changed, 9617 insertions(+) create mode 100644 .editorconfig create mode 100644 README.md create mode 100755 barscripts/gpu-memory create mode 100755 barscripts/gpu-temp create mode 100755 barscripts/gpu-usage create mode 100755 create-efi.sh create mode 100644 etc/modules-load.d/tcp_bbr.conf create mode 100644 etc/pacman.d/hooks/orphans.hook create mode 100644 etc/sysctl.d/99-sysctl.conf create mode 100644 etc/systemd/system.conf.d/timeout.conf create mode 100644 etc2/xdg/reflector/reflector.conf create mode 100644 firefox/chrome/userChrome.css create mode 100644 firefox/user-overrides.js create mode 100644 home/.alsoftrc create mode 100644 home/.bash_logout create mode 100644 home/.bashrc create mode 100644 home/.config/MangoHud/MangoHud.conf create mode 100644 home/.config/X11/Xmodmap create mode 100644 home/.config/X11/Xresources create mode 100755 home/.config/X11/xinitrc create mode 100644 home/.config/X11/xprofile create mode 100644 home/.config/alacritty/alacritty.yml create mode 100644 home/.config/bat/config create mode 100755 home/.config/bspwm/bspwmrc create mode 100644 home/.config/clangd/config.yaml create mode 100644 home/.config/dunst/dunstrc create mode 100644 home/.config/fakecam/config.ini create mode 100644 home/.config/fontconfig/fonts.conf create mode 100644 home/.config/gamemode.ini create mode 100644 home/.config/git/config create mode 100644 home/.config/git/ignore create mode 100644 home/.config/git/noattributes create mode 100644 home/.config/gtk-2.0/gtkfilechooser.ini create mode 100644 home/.config/gtk-2.0/gtkrc-2.0 create mode 100644 home/.config/gtk-3.0/gtk.css create mode 100644 home/.config/gtk-3.0/settings.ini create mode 100644 home/.config/htop/htoprc create mode 100644 home/.config/ipython/profile_default/ipython_config.py create mode 100644 home/.config/lf/lfrc create mode 100644 home/.config/lsd/config.yaml create mode 100644 home/.config/mimeapps.list create mode 100644 home/.config/mpv/input.conf create mode 100644 home/.config/mpv/mpv.conf create mode 100644 home/.config/mpv/scripts/webtorrent-hook.lua create mode 100644 home/.config/neofetch/config.conf create mode 100644 home/.config/npm/npmrc create mode 120000 home/.config/nvim/after/ftplugin/c.lua create mode 100644 home/.config/nvim/after/ftplugin/cfg.lua create mode 100644 home/.config/nvim/after/ftplugin/cpp.lua create mode 100644 home/.config/nvim/after/ftplugin/dosini.lua create mode 100644 home/.config/nvim/after/ftplugin/gitcommit.lua create mode 100644 home/.config/nvim/after/ftplugin/gitrebase.lua create mode 100644 home/.config/nvim/after/ftplugin/help.lua create mode 100644 home/.config/nvim/after/ftplugin/json.lua create mode 100644 home/.config/nvim/after/ftplugin/mail.lua create mode 100644 home/.config/nvim/after/ftplugin/markdown.lua create mode 100644 home/.config/nvim/after/ftplugin/tex.lua create mode 100644 home/.config/nvim/after/ftplugin/text.lua create mode 100644 home/.config/nvim/after/ftplugin/tmux.lua create mode 100644 home/.config/nvim/after/ftplugin/xdefaults.lua create mode 100644 home/.config/nvim/after/ftplugin/xmodmap.lua create mode 100644 home/.config/nvim/after/plugin/autocmds.lua create mode 100644 home/.config/nvim/after/plugin/mappings.lua create mode 100644 home/.config/nvim/filetype.lua create mode 100644 home/.config/nvim/init.lua create mode 100644 home/.config/nvim/lua/cfg/lsp.lua create mode 100644 home/.config/nvim/lua/cfg/options.lua create mode 100644 home/.config/nvim/lua/cfg/utils.lua create mode 100644 home/.config/nvim/lua/custom/plugins/init.lua create mode 100644 home/.config/nvim/lua/mapper.lua create mode 100644 home/.config/pacman/makepkg.conf create mode 100644 home/.config/pam-gnupg create mode 100644 home/.config/paru/paru.conf create mode 100644 home/.config/pipewire/media-session.d/bluez-monitor.conf create mode 100644 home/.config/polybar/config create mode 100644 home/.config/pulse/client.conf create mode 100644 home/.config/pulse/daemon.conf create mode 100644 home/.config/pulse/default.pa create mode 100644 home/.config/pulse/system.pa create mode 100644 home/.config/ripgrep/ripgreprc create mode 100644 home/.config/rofi/config.rasi create mode 100644 home/.config/sh/aliases create mode 100644 home/.config/sh/envrc create mode 100644 home/.config/sh/inputrc create mode 100644 home/.config/sh/shinit create mode 100644 home/.config/streamlink/config create mode 120000 home/.config/sx/sxrc create mode 100644 home/.config/sxhkd/sxhkdrc create mode 100755 home/.config/sxiv/exec/key-handler create mode 100644 home/.config/systemd/user/bridge.service.d/override.conf create mode 100644 home/.config/systemd/user/dirmngr.socket.d/override.conf create mode 100644 home/.config/systemd/user/fakecam.service create mode 100644 home/.config/systemd/user/gpg-agent-browser.socket.d/override.conf create mode 100644 home/.config/systemd/user/gpg-agent-extra.socket.d/override.conf create mode 100644 home/.config/systemd/user/gpg-agent-ssh.socket.d/override.conf create mode 100644 home/.config/systemd/user/gpg-agent.service.d/override.conf create mode 100644 home/.config/systemd/user/gpg-agent.socket.d/override.conf create mode 100644 home/.config/systemd/user/noisetorch.service create mode 100644 home/.config/systemd/user/spotifyd.service.d/override.conf create mode 100644 home/.config/systemd/user/vdirsyncer.service.d/override.conf create mode 100644 home/.config/tmux/tmux.conf create mode 100644 home/.config/user-dirs.dirs create mode 100644 home/.config/user-dirs.locale create mode 100644 home/.config/wget/wgetrc create mode 100644 home/.config/yt-dlp/config create mode 100644 home/.config/zathura/zathurarc create mode 120000 home/.config/zsh/.zprofile create mode 100644 home/.config/zsh/.zshrc create mode 100644 home/.hushlogin create mode 100755 home/.local/bin/automute create mode 100755 home/.local/bin/display-setup create mode 100755 home/.local/bin/input-setup create mode 100755 home/.local/bin/launch-polybar create mode 100755 home/.local/bin/linkhandler create mode 100755 home/.local/bin/locknpause create mode 100755 home/.local/bin/record create mode 100755 home/.local/bin/rqr create mode 100755 home/.local/bin/stop create mode 100755 home/.local/bin/stream create mode 100755 home/.local/bin/terminal-benchmark create mode 100755 home/.local/bin/terminal-testdrive create mode 100755 home/.local/bin/tokodi create mode 100755 home/.local/bin/videowrapper create mode 100755 home/.local/bin/wqr create mode 100644 home/.local/share/Steam/steamapps/common/Counter-Strike Global Offensive/csgo/cfg/aim1v1.cfg create mode 100644 home/.local/share/Steam/steamapps/common/Counter-Strike Global Offensive/csgo/cfg/autoexec.cfg create mode 100644 home/.local/share/Steam/steamapps/common/Counter-Strike Global Offensive/csgo/cfg/practice.cfg create mode 100755 home/.local/share/Steam/steamapps/common/Left 4 Dead 2/left4dead2/cfg/autoexec.cfg create mode 100644 home/.local/share/applications/mail.desktop create mode 120000 home/.local/share/applications/mimeapps.list create mode 100644 home/.local/share/gnupg/gpg-agent.conf create mode 100644 home/.local/share/gnupg/gpg.conf create mode 100644 home/.local/share/gnupg/sshcontrol create mode 100644 home/.pam_environment create mode 100755 home/.profile create mode 100644 home/.ssh/config create mode 100644 home/.ssh/nym.pub create mode 100644 home/.ssh/personal.pub create mode 100644 home/.ssh/work.pub create mode 100644 home/.urlview create mode 120000 home/.zprofile create mode 100644 lists/caps2esc.map create mode 100644 meta/base/PKGBUILD create mode 100644 meta/bt/PKGBUILD create mode 100644 meta/btc/PKGBUILD create mode 100644 meta/cpp/PKGBUILD create mode 100644 meta/dev/PKGBUILD create mode 100644 meta/extra/PKGBUILD create mode 100644 meta/fonts/PKGBUILD create mode 100644 meta/gaming/PKGBUILD create mode 100644 meta/intel/PKGBUILD create mode 100644 meta/mail/PKGBUILD create mode 100644 meta/media/PKGBUILD create mode 100644 meta/nvidia/PKGBUILD create mode 100644 meta/python/PKGBUILD create mode 100644 meta/sound/PKGBUILD create mode 100644 meta/work/PKGBUILD create mode 100644 meta/x-base/PKGBUILD create mode 100644 meta/x-de/PKGBUILD create mode 100644 meta/x-extra/PKGBUILD diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..26a2d87 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,16 @@ +root = true + +[*] +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true +charset = utf-8 + +[*.lua] +indent_style = space +indent_size = 2 +enable_check_codestyle = true +max_line_length = 80 + +[Makefile] +indent_style = tab diff --git a/README.md b/README.md new file mode 100644 index 0000000..9a5992c --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# dotfiles + +My linux config and rc files diff --git a/barscripts/gpu-memory b/barscripts/gpu-memory new file mode 100755 index 0000000..6c8aeca --- /dev/null +++ b/barscripts/gpu-memory @@ -0,0 +1,3 @@ +#!/usr/bin/env sh + +command -v nvidia-smi > /dev/null 2>&1 && nvidia-smi > /dev/null 2>&1 && printf "VRAM:%s%%" "$(nvidia-smi --query-gpu=utilization.memory --format=csv,noheader,nounits 2> /dev/null)" diff --git a/barscripts/gpu-temp b/barscripts/gpu-temp new file mode 100755 index 0000000..6f49029 --- /dev/null +++ b/barscripts/gpu-temp @@ -0,0 +1,3 @@ +#!/usr/bin/env sh + +command -v nvidia-smi > /dev/null 2>&1 && nvidia-smi > /dev/null 2>&1 && printf "%sยฐC" "$(nvidia-smi --query-gpu=temperature.gpu --format=csv,noheader 2> /dev/null)" diff --git a/barscripts/gpu-usage b/barscripts/gpu-usage new file mode 100755 index 0000000..67ae7e0 --- /dev/null +++ b/barscripts/gpu-usage @@ -0,0 +1,3 @@ +#!/usr/bin/env sh + +command -v nvidia-smi > /dev/null 2>&1 && nvidia-smi > /dev/null 2>&1 && printf "GPU:%s%%" "$(nvidia-smi --query-gpu=utilization.gpu --format=csv,noheader,nounits 2> /dev/null)" diff --git a/create-efi.sh b/create-efi.sh new file mode 100755 index 0000000..2c4c3d2 --- /dev/null +++ b/create-efi.sh @@ -0,0 +1,57 @@ +#!/usr/bin/env sh +set -e + +lsblk + +printf "Boot disk [sda]: " && read -r boot_disk +if [ -z "$boot_disk" ]; then + boot_disk='sda' +fi + +printf "Boot partition number [1]: " && read -r boot_partition_number +if [ -z "$boot_partition_number" ]; then + boot_partition_number='1' +fi + +printf "Root partition [sda2]: " && read -r root_partition +if [ -z "$root_partition" ]; then + root_partition='sda2' +fi +root_uuid=$(blkid /dev/"$root_partition" | cut -f 2 -d " ") + +printf "Kernel name [linux]: " && read -r kernel_name +if [ -z "$kernel_name" ]; then + kernel_name='linux' +fi + +printf "CPU vendor (intel/amd) [intel]: " && read -r cpu_vendor +if [ -z "$cpu_vendor" ]; then + cpu_vendor='intel' +fi + +printf "ESP (boot/efi) [boot]: " && read -r esp +if [ -z "$esp" ]; then + esp='boot' +fi + +printf "extra kernel parameters (e.g. mitigations=off): " && read -r extra_kernel_params + +printf "label [archlinux]: " && read -r label +if [ -z "$label" ]; then + label='archlinux' +fi + +rel_path="" +rel_path2="" +if [ "$esp" = "efi" ]; then + rel_path="\\EFI\\arch" + rel_path2="/EFI/arch" +fi + + +unicode_arg="cryptdevice=$root_uuid:root root=/dev/mapper/root rw initrd=$rel_path\\$cpu_vendor-ucode.img initrd=$rel_path\\initramfs-$kernel_name.img quiet $extra_kernel_params" + +set -x +pacman -S --needed "$cpu_vendor"-ucode +pacman -S --asdeps --needed efibootmgr +efibootmgr --disk /dev/"$boot_disk" --part "$boot_partition_number" --create --label "$label" --loader "$rel_path2"/vmlinuz-"$kernel_name" --unicode "$unicode_arg" diff --git a/etc/modules-load.d/tcp_bbr.conf b/etc/modules-load.d/tcp_bbr.conf new file mode 100644 index 0000000..0e83071 --- /dev/null +++ b/etc/modules-load.d/tcp_bbr.conf @@ -0,0 +1 @@ +tcp_bbr diff --git a/etc/pacman.d/hooks/orphans.hook b/etc/pacman.d/hooks/orphans.hook new file mode 100644 index 0000000..48c1d8d --- /dev/null +++ b/etc/pacman.d/hooks/orphans.hook @@ -0,0 +1,12 @@ +[Trigger] +Operation = Install +Operation = Upgrade +Operation = Remove +Type = Package +Target = * + +[Action] +Description = Searching for orphaned packages... +When = PostTransaction +Exec = /usr/bin/bash -c "/usr/bin/pacman -Qtd || /usr/bin/echo '==> no orphans found.'" +#Exec = /usr/bin/bash -c "[[ if $(/usr/bin/pacman -Qtdq) = 0 ]] && /usr/bin/pacman -Rns $(/usr/bin/pacman -Qtdq) || /usr/bin/echo '==> No orphaned packages found.'" diff --git a/etc/sysctl.d/99-sysctl.conf b/etc/sysctl.d/99-sysctl.conf new file mode 100644 index 0000000..c6fde05 --- /dev/null +++ b/etc/sysctl.d/99-sysctl.conf @@ -0,0 +1,19 @@ +kernel.sysrq = 1 +kernel.dmesg_restrict = 0 +kernel.yama.ptrace_scope = 0 +kernel.perf_event_paranoid = 0 +net.core.netdev_max_backlog = 16384 +net.core.somaxconn = 8192 +net.ipv4.tcp_fastopen = 3 +net.ipv4.tcp_max_syn_backlog = 8192 +net.ipv4.tcp_max_tw_buckets = 2000000 +net.ipv4.tcp_tw_reuse = 1 +net.ipv4.tcp_fin_timeout = 10 +net.ipv4.tcp_slow_start_after_idle = 0 +net.ipv4.tcp_keepalive_time = 60 +net.ipv4.tcp_keepalive_intvl = 10 +net.ipv4.tcp_keepalive_probes = 6 +net.ipv4.tcp_mtu_probing = 1 +net.core.default_qdisc = cake +net.ipv4.tcp_congestion_control = bbr +vm.vfs_cache_pressure = 50 diff --git a/etc/systemd/system.conf.d/timeout.conf b/etc/systemd/system.conf.d/timeout.conf new file mode 100644 index 0000000..b48f3bb --- /dev/null +++ b/etc/systemd/system.conf.d/timeout.conf @@ -0,0 +1,3 @@ +[Manager] +DefaultTimeoutStartSec=10s +DefaultTimeoutStopSec=10s diff --git a/etc2/xdg/reflector/reflector.conf b/etc2/xdg/reflector/reflector.conf new file mode 100644 index 0000000..64767b9 --- /dev/null +++ b/etc2/xdg/reflector/reflector.conf @@ -0,0 +1,39 @@ +# Reflector configuration file for the systemd service. +# +# Empty lines and lines beginning with "#" are ignored. All other lines should +# contain valid reflector command-line arguments. The lines are parsed with +# Python's shlex modules so standard shell syntax should work. All arguments are +# collected into a single argument list. +# +# See "reflector --help" for details. + +# Recommended Options + +# Set the output path where the mirrorlist will be saved (--save). +--save /etc/pacman.d/mirrorlist + +# Select the transfer protocol (--protocol). +# --protocol https + +# Select the country (--country). +# Consult the list of available countries with "reflector --list-countries" and +# select the countries nearest to you or the ones that you trust. For example: +--country Spain,Portugal,France,Switzerland,Germany,Netherlands + +# Use only the most recently synchronized mirrors (--latest). +# --latest 12 + +# Sort the mirrors by synchronization time (--sort). +# --sort age + +--age 12 + +--completion-percent 100 + +--sort score + +#--connection-timeout 2 + +--fastest 10 + +--threads 12 diff --git a/firefox/chrome/userChrome.css b/firefox/chrome/userChrome.css new file mode 100644 index 0000000..3f2dfe7 --- /dev/null +++ b/firefox/chrome/userChrome.css @@ -0,0 +1,3 @@ +#webrtcIndicator { + display: none; +} diff --git a/firefox/user-overrides.js b/firefox/user-overrides.js new file mode 100644 index 0000000..dfebba9 --- /dev/null +++ b/firefox/user-overrides.js @@ -0,0 +1,78 @@ +/* override recipe: enable session restore ***/ +user_pref("browser.startup.page", 3); // 0102 +user_pref("browser.sessionstore.privacy_level", 0); // 1003 optional to restore cookies/formdata +user_pref("privacy.clearOnShutdown.history", false); // 2811 +user_pref("privacy.cpd.history", false); // 2820 optional to match when you use Ctrl-Shift-Del + +/* 1601: control when to send a cross-origin referer + * 0=always (default), 1=only if base domains match, 2=only if hosts match + * [SETUP-WEB] Breakage: older modems/routers and some sites e.g banks, vimeo, icloud, instagram + * If "2" is too strict, then override to "0" and use Smart Referer extension (Strict mode + add exceptions) ***/ +user_pref("network.http.referer.XOriginPolicy", 0); + +/** SANITIZE ON SHUTDOWN: IGNORES "ALLOW" SITE EXCEPTIONS ***/ +/* 2811: set/enforce what items to clear on shutdown (if 2810 is true) [SETUP-CHROME] + * [NOTE] If "history" is true, downloads will also be cleared + * [NOTE] "sessions": Active Logins: refers to HTTP Basic Authentication [1], not logins via cookies + * [1] https://en.wikipedia.org/wiki/Basic_access_authentication ***/ +user_pref("privacy.clearOnShutdown.downloads", false); // [DEFAULT: true] +user_pref("privacy.clearOnShutdown.history", false); // [DEFAULT: true] +user_pref("privacy.clearOnShutdown.sessions", false); // [DEFAULT: true] + +/* 0801: disable location bar using search + * Don't leak URL typos to a search engine, give an error message instead + * Examples: "secretplace,com", "secretplace/com", "secretplace com", "secret place.com" + * [NOTE] This does not affect explicit user action such as using search buttons in the + * dropdown, or using keyword search shortcuts you configure in options (e.g. "d" for DuckDuckGo) + * [SETUP-CHROME] Override this if you trust and use a privacy respecting search engine ***/ +user_pref("keyword.enabled", true); + +/* 2620: enforce PDFJS, disable PDFJS scripting + * This setting controls if the option "Display in Firefox" is available in the setting below + * and by effect controls whether PDFs are handled in-browser or externally ("Ask" or "Open With") + * [WHY] pdfjs is lightweight, open source, and secure: the last exploit was June 2015 [1] + * It doesn't break "state separation" of browser content (by not sharing with OS, independent apps). + * It maintains disk avoidance and application data isolation. It's convenient. You can still save to disk. + * [NOTE] JS can still force a pdf to open in-browser by bundling its own code + * [SETUP-CHROME] You may prefer a different pdf reader for security/workflow reasons + * [SETTING] General>Applications>Portable Document Format (PDF) + * [1] https://cve.mitre.org/cgi-bin/cvekey.cgi?keyword=pdf.js+firefox ***/ +user_pref("pdfjs.disabled", true); // [DEFAULT: false] + +/* 5003: disable saving passwords + * [NOTE] This does not clear any passwords already saved + * [SETTING] Privacy & Security>Logins and Passwords>Ask to save logins and passwords for websites ***/ +user_pref("signon.rememberSignons", false); + +/* 5017: disable Form Autofill + * If .supportedCountries includes your region (browser.search.region) and .supported + * is "detect" (default), then the UI will show. Stored data is not secure, uses JSON + * [NOTE] Heuristics controls Form Autofill on forms without @autocomplete attributes + * [SETTING] Privacy & Security>Forms and Autofill>Autofill addresses + * [1] https://wiki.mozilla.org/Firefox/Features/Form_Autofill ***/ +user_pref("extensions.formautofill.addresses.enabled", false); // [FF55+] +user_pref("extensions.formautofill.creditCards.enabled", false); // [FF56+] +user_pref("extensions.formautofill.heuristics.enabled", false); // [FF55+] + +/* 2022: disable all DRM content (EME: Encryption Media Extension) + * Optionally hide the setting which also disables the DRM prompt + * [SETUP-WEB] e.g. Netflix, Amazon Prime, Hulu, HBO, Disney+, Showtime, Starz, DirectTV + * [SETTING] General>DRM Content>Play DRM-controlled content + * [TEST] https://bitmovin.com/demos/drm + * [1] https://www.eff.org/deeplinks/2017/10/drms-dead-canary-how-we-just-lost-web-what-we-learned-it-and-what-we-need-do-next ***/ +// user_pref("media.eme.enabled", false); // already disabled +user_pref("browser.eme.ui.enabled", false); + +/* 0701: disable IPv6 + * IPv6 can be abused, especially with MAC addresses, and can leak with VPNs: assuming + * your ISP and/or router and/or website is IPv6 capable. Most sites will fall back to IPv4 + * [SETUP-WEB] PR_CONNECT_RESET_ERROR: this pref *might* be the cause + * [STATS] Firefox telemetry (Sept 2022) shows ~8% of successful connections are IPv6 + * [NOTE] This is an application level fallback. Disabling IPv6 is best done at an + * OS/network level, and/or configured properly in VPN setups. If you are not masking your IP, + * then this won't make much difference. If you are masking your IP, then it can only help. + * [NOTE] PHP defaults to IPv6 with "localhost". Use "php -S 127.0.0.1:PORT" + * [TEST] https://ipleak.org/ + * [1] https://www.internetsociety.org/tag/ipv6-security/ (Myths 2,4,5,6) ***/ +// user_pref("network.dns.disableIPv6", true); +user_pref("network.dns.disableIPv6", false); diff --git a/home/.alsoftrc b/home/.alsoftrc new file mode 100644 index 0000000..04de22d --- /dev/null +++ b/home/.alsoftrc @@ -0,0 +1,4 @@ +hrtf = true + +[pulse] +allow-moves=true diff --git a/home/.bash_logout b/home/.bash_logout new file mode 100644 index 0000000..de4f5f7 --- /dev/null +++ b/home/.bash_logout @@ -0,0 +1,7 @@ +# ~/.bash_logout: executed by bash(1) when login shell exits. + +# when leaving the console clear the screen to increase privacy + +if [ "$SHLVL" = 1 ]; then + [ -x /usr/bin/clear_console ] && /usr/bin/clear_console -q +fi diff --git a/home/.bashrc b/home/.bashrc new file mode 100644 index 0000000..a6df0cd --- /dev/null +++ b/home/.bashrc @@ -0,0 +1,52 @@ +# ~/.bashrc: executed by bash(1) for non-login shells. +# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) +# for examples +case $- in + *i*) stty -ixon + ;; + *) return + ;; +esac + +# shellcheck source=/dev/null +[ -r ~/.config/sh/shinit ] && . ~/.config/sh/shinit + +safesource /usr/share/git/completion/git-prompt.sh + +PS1="\[\033[38;1;32m\]\u\[$(tput sgr0)\]\[\033[38;1;37m\]@\[$(tput sgr0)\]\[\033[38;1;36m\]\h\[$(tput sgr0)\]\[\033[38;1;37m\]:\[$(tput sgr0)\]\[\033[38;0;33m\]\w\[$(tput sgr0)\]$(__git_ps1 " (%s)")[\[\033[38;0;31m\]\$?\[$(tput sgr0)\]]\$ " +export PS1 + + +HISTFILE="$XDG_CACHE_HOME"/bash_history +# don't put duplicate lines or lines starting with space in the history. +# See bash(1) for more options +HISTCONTROL=ignoreboth + +# append to the history file, don't overwrite it +shopt -s histappend + +# for setting history length see HISTSIZE and HISTFILESIZE in bash(1) +HISTSIZE=50000 +HISTFILESIZE=50000 + +# check the window size after each command and, if necessary, +# update the values of LINES and COLUMNS. +shopt -s checkwinsize + +# If set, the pattern "**" used in a pathname expansion context will +# match all files and zero or more directories and subdirectories. +#shopt -s globstar + +# enable programmable completion features (you don't need to enable +# this, if it's already enabled in /etc/bash.bashrc and /etc/profile +# sources /etc/bash.bashrc). +if ! shopt -oq posix; then + safesource /usr/share/bash-completion/bash_completion +fi + +shopt -s autocd + +bind '"\eh": "\C-a\eb\ed\C-y\e#man \C-y\C-m\C-p\C-p\C-a\C-d\C-e"' + +safesource /usr/share/bash-completion/completions/fzf || safesource /usr/share/fzf/completion.bash +safesource /etc/profile.d/fzf.bash || safesource /usr/share/fzf/key-bindings.bash diff --git a/home/.config/MangoHud/MangoHud.conf b/home/.config/MangoHud/MangoHud.conf new file mode 100644 index 0000000..67fe027 --- /dev/null +++ b/home/.config/MangoHud/MangoHud.conf @@ -0,0 +1,117 @@ +### MangoHud configuration file +### Uncomment any options you wish to enable. Default options are left uncommented +### Use some_parameter=0 to disable a parameter (only works with on/off parameters) +### Everything below can be used / overridden with the environment variable MANGOHUD_CONFIG instead + +################ PERFORMANCE ################# + +### Limit the application FPS +# fps_limit= + +### VSYNC [0-3] 0 = adaptive; 1 = off; 2 = mailbox; 3 = on +# vsync= + +### OpenGL VSYNC [0-N] 0 = off; >=1 = wait for N v-blanks, N > 1 acts as a fps limiter (fps = display refresh rate / N) +# gl_vsync= + +################### VISUAL ################### + +### Display the current CPU information +cpu_stats +cpu_temp + +### Display the current GPU information +gpu_stats +gpu_temp +# gpu_core_clock +# gpu_mem_clock + +### Display loaded MangoHud architecture +# arch + +### Display the frametime line graph +frame_timing +# histogram + +### Display the current system time +# time + +### Time formatting examples +# time_format = %H:%M +# time_format = [ %T %F ] +# time_format = %X # locally formatted time, because of limited glyph range, missing characters may show as '?' (e.g. japanese) + +### Change the hud font size (default is 24) +font_size=16 +# font_scale_media_player = 0.55 + +### Change the hud position (default is top-left) +position=bottom-right + +### Display the current CPU load & frequency for each core +# core_load + +### IO read and write for the app (not system) +# io_read +# io_write + +### Display system ram / vram usage +ram +vram + +### Disable / hide the hud by deafult +# no_display + +### Hud position offset +# offset_x= +# offset_y= + +### Hud dimensions +# width= +# height= + +### Hud transparency / alpha +background_alpha=0.8 +# alpha= + +### Color customization +# text_color=FFFFFF +# gpu_color=2E9762 +# cpu_color=2E97CB +# vram_color=AD64C1 +# ram_color=C26693 +# engine_color=EB5B5B +# io_color=A491D3 +# frametime_color=00FF00 +# background_color=020202 +# media_player_color=FFFFFF + +### Change default font (set location to .TTF/.OTF file ) +# font_file + +### Crosshair overlay (default size is 30) +# crosshair +# crosshair_size= +# crosshair_color=RRGGBB + +### Show media player metadata +# media_player +# media_player_name = spotify + +### Specify gpu with pci bus id for amdgpu and NVML stats. +### Set to 'domain:bus:slot.function' +# pci_dev = 0:0a:0.0 + +################## INTERACTION ################# + +### Change toggle keybinds for the hud & logging +#toggle_hud=Shift_R+F12 +#toggle_logging=F2 +#reload_cfg=Shift_L+F4 + +################## LOG ################# + +### Set amount of time in second that the logging will run for +# log_duration +### Define name and location of the output file (Required for logging) +# output_file diff --git a/home/.config/X11/Xmodmap b/home/.config/X11/Xmodmap new file mode 100644 index 0000000..8b62265 --- /dev/null +++ b/home/.config/X11/Xmodmap @@ -0,0 +1 @@ +keycode 9 = grave asciitilde grave asciitilde diff --git a/home/.config/X11/Xresources b/home/.config/X11/Xresources new file mode 100644 index 0000000..f0b4a4a --- /dev/null +++ b/home/.config/X11/Xresources @@ -0,0 +1,67 @@ +*.font: mono:size=17:antialias=true:autohint=true + +! gruvbox-dark theme +! hard contrast: +*background: #1d2021 +! medium +! *background: ##282828 +! soft contrast: +! *background: #32302f +*foreground: #ebdbb2 +*cursorColor: #ebdbb2 +! Black + DarkGrey +*color0: #1d2021 +*color8: #928374 +! DarkRed + Red +*color1: #cc241d +*color9: #fb4934 +! DarkGreen + Green +*color2: #98971a +*color10: #b8bb26 +! DarkYellow + Yellow +*color3: #d79921 +*color11: #fabd2f +! DarkBlue + Blue +*color4: #458588 +*color12: #83a598 +! DarkMagenta + Magenta +*color5: #b16286 +*color13: #d3869b +! DarkCyan + Cyan +*color6: #689d6a +*color14: #8ec07c +! LightGrey + White +*color7: #a89984 +*color15: #ebdbb2 + +! Others +*color24: #076678 +*color66: #427b58 +*color88: #9d0006 +*color96: #8f3f71 +*color100: #79740e +*color108: #8ec07c +*color109: #83a598 +*color130: #af3a03 +*color136: #b57614 +*color142: #b8bb26 +*color167: #fb4934 +*color175: #d3869b +*color208: #fe8019 +*color214: #fabd2f +*color223: #ebdbb2 +*color228: #f2e5bc +*color229: #fbf1c7 +*color230: #f9f5d7 +*color234: #1d2021 +*color235: #282828 +*color236: #32302f +*color237: #3c3836 +*color239: #504945 +*color241: #665c54 +*color243: #7c6f64 +*color244: #928374 +*color245: #928374 +*color246: #a89984 +*color248: #bdae93 +*color250: #d5c4a1 diff --git a/home/.config/X11/xinitrc b/home/.config/X11/xinitrc new file mode 100755 index 0000000..907b6b6 --- /dev/null +++ b/home/.config/X11/xinitrc @@ -0,0 +1,7 @@ +#!/usr/bin/env sh +# xinitrc file, used by all X sessions started by xinit (startx) +# shellcheck source=/dev/null +[ -r ~/.config/X11/xprofile ] && . ~/.config/X11/xprofile & +if [ "$(uname -n)" != "tau" ]; then + exec bspwm +fi diff --git a/home/.config/X11/xprofile b/home/.config/X11/xprofile new file mode 100644 index 0000000..54e04b3 --- /dev/null +++ b/home/.config/X11/xprofile @@ -0,0 +1,18 @@ +#!/usr/bin/env sh +# shellcheck source=/dev/null +[ -r ~/.config/sh/envrc ] && . ~/.config/sh/envrc +display-setup + +systemctl --user import-environment PATH DISPLAY XAUTHORITY + +[ -r ~/.config/X11/Xresources ] && xrdb ~/.config/X11/Xresources + +xsetroot -cursor_name left_ptr & +input-setup & +unclutter & +keynav & +if [ "$(uname -n)" != "tau" ]; then + launch-polybar & + dunst & + sxhkd & +fi diff --git a/home/.config/alacritty/alacritty.yml b/home/.config/alacritty/alacritty.yml new file mode 100644 index 0000000..65185e8 --- /dev/null +++ b/home/.config/alacritty/alacritty.yml @@ -0,0 +1,62 @@ +# Colors (Gruvbox dark) +colors: + # Default colors + primary: + background: '0x1d2021' + # medium contrast: background: '0x282828' + # soft contrast: background: '0x32302f' + foreground: '0xebdbb2' + + # Normal colors + normal: + black: '0x282828' + red: '0xcc241d' + green: '0x98971a' + yellow: '0xd79921' + blue: '0x458588' + magenta: '0xb16286' + cyan: '0x689d6a' + white: '0xa89984' + + # Bright colors + bright: + black: '0x928374' + red: '0xfb4934' + green: '0xb8bb26' + yellow: '0xfabd2f' + blue: '0x83a598' + magenta: '0xd3869b' + cyan: '0x8ec07c' + white: '0xebdbb2' + +key_bindings: + - { key: Return, mods: Control|Shift, action: SpawnNewInstance } + - { key: K, mods: Alt, action: ScrollLineUp } + - { key: J, mods: Alt, action: ScrollLineDown } + - { key: U, mods: Alt, action: ScrollPageUp } + - { key: D, mods: Alt, action: ScrollPageDown } + - { key: G, mods: Alt, action: ScrollToTop } + - { key: G, mods: Alt|Shift, action: ScrollToBottom } + +cursor: + # Cursor style + style: + # Cursor blinking state + # + # Values for `blinking`: + # - Never: Prevent the cursor from ever blinking + # - Off: Disable blinking by default + # - On: Enable blinking by default + # - Always: Force the cursor to always blink + blinking: On + + # Cursor blinking interval in milliseconds. + blink_interval: 500 + + # Time after which cursor stops blinking, in seconds. + # + # Specifying '0' will disable timeout for blinking. + blink_timeout: 0 + +# Live config reload (changes require restart) +live_config_reload: false diff --git a/home/.config/bat/config b/home/.config/bat/config new file mode 100644 index 0000000..c0afe26 --- /dev/null +++ b/home/.config/bat/config @@ -0,0 +1,25 @@ +# This is `bat`s configuration file. Each line either contains a comment or +# a command-line option that you want to pass to `bat` by default. You can +# run `bat --help` to get a list of all possible configuration options. + +# Specify desired highlighting theme (e.g. "TwoDark"). Run `bat --list-themes` +# for a list of all available themes +--theme="gruvbox-dark" + +# Enable this to use italic text on the terminal. This is not supported on all +# terminal emulators (like tmux, by default): +#--italic-text=always + +# Uncomment the following line to disable automatic paging: +#--paging=never + +# Uncomment the following line if you are using less version >= 551 and want to +# enable mouse scrolling support in `bat` when running inside tmux. This might +# disable text selection, unless you press shift. +#--pager="less --RAW-CONTROL-CHARS --quit-if-one-screen --mouse" + +# Syntax mappings: map a certain filename pattern to a language. +# Example 1: use the C++ syntax for .ino files +# Example 2: Use ".gitignore"-style highlighting for ".ignore" files +#--map-syntax "*.ino:C++" +#--map-syntax ".ignore:Git Ignore" diff --git a/home/.config/bspwm/bspwmrc b/home/.config/bspwm/bspwmrc new file mode 100755 index 0000000..c0b7ba3 --- /dev/null +++ b/home/.config/bspwm/bspwmrc @@ -0,0 +1,49 @@ +#!/usr/bin/env sh + +# If refreshing bspwm, remove all previous rules to prevent doubling up. +bspc rule -r "*" + +if [ "$(uname -n)" = "garry" ] && xrandr --query | grep "HDMI-0 connected"; then + bspc monitor 'eDP-1-1' --remove + bspc config pointer_motion_interval 7 +elif [ "$(uname -n)" = "hercules" ] && xrandr --query | grep "HDMI-0 connected"; then + bspc monitor 'eDP-1-1' --remove +fi + +bspc config border_width 1 +bspc config window_gap 0 +# top_padding I set equal to polybar's height +bspc config top_padding 24 +bspc config right_padding 0 + +bspc config focus_follows_pointer true +bspc config pointer_follows_focus true +bspc config pointer_follows_monitor true +bspc config borderless_monocle true +bspc config gapless_monocle true +bspc config removal_adjustment true +bspc config remove_disabled_monitors true +bspc config remove_unplugged_monitors true +bspc config merge_overlapping_monitors true +bspc config presel_feedback true + +# bspc rule -a mpv sticky=on +bspc rule -a Zathura state=tiled +bspc rule -a "Tor Browser" state=floating +bspc rule -a "feh" state=floating +# bspc rule -a Steam desktop="9" +# bspc rule -a discord desktop="9" +bspc rule -a csgo_linux64 desktop="10" +bspc rule -a hl2_linux desktop="10" +bspc rule -a "origin.exe" state=floating desktop="10" +bspc rule -a "fifa19_demo.exe" desktop="10" +bspc rule -a "fifa20_demo.exe" desktop="10" +bspc rule -a "fifa19.exe" desktop="10" +bspc rule -a "Wine" state=floating desktop="10" +bspc rule -a "fifaconfig.exe" state=floating desktop="10" +bspc rule -a "launcher.exe" state=floating desktop="10" +bspc rule -a "socialclubhelper.exe" state=floating desktop="10" +bspc rule -a "gta5.exe" desktop="10" +bspc rule -a "*.exe" desktop="10" + +bspc monitor -d 1 2 3 4 5 6 7 8 9 10 diff --git a/home/.config/clangd/config.yaml b/home/.config/clangd/config.yaml new file mode 100644 index 0000000..2fc7c59 --- /dev/null +++ b/home/.config/clangd/config.yaml @@ -0,0 +1,8 @@ +Diagnostics: + UnusedIncludes: Strict +InlayHints: + Enabled: Yes + ParameterNames: Yes + DeducedTypes: Yes +Hover: + ShowAKA: Yes diff --git a/home/.config/dunst/dunstrc b/home/.config/dunst/dunstrc new file mode 100644 index 0000000..fba44e9 --- /dev/null +++ b/home/.config/dunst/dunstrc @@ -0,0 +1,466 @@ +[global] + ### Display ### + + # Which monitor should the notifications be displayed on. + monitor = 0 + + # Display notification on focused monitor. Possible modes are: + # mouse: follow mouse pointer + # keyboard: follow window with keyboard focus + # none: don't follow anything + # + # "keyboard" needs a window manager that exports the + # _NET_ACTIVE_WINDOW property. + # This should be the case for almost all modern window managers. + # + # If this option is set to mouse or keyboard, the monitor option + # will be ignored. + follow = mouse + + # The geometry of the window: + # [{width}]x{height}[+/-{x}+/-{y}] + # The geometry of the message window. + # The height is measured in number of notifications everything else + # in pixels. If the width is omitted but the height is given + # ("-geometry x2"), the message window expands over the whole screen + # (dmenu-like). If width is 0, the window expands to the longest + # message displayed. A positive x is measured from the left, a + # negative from the right side of the screen. Y is measured from + # the top and down respectively. + # The width can be negative. In this case the actual width is the + # screen width minus the width defined in within the geometry option. + geometry = "300x5-30+20" + + # Turn on the progess bar + progress_bar = true + + # Set the progress bar height. This includes the frame, so make sure + # it's at least twice as big as the frame width. + progress_bar_height = 10 + + # Set the frame width of the progress bar + progress_bar_frame_width = 1 + + # Set the minimum width for the progress bar + progress_bar_min_width = 150 + + # Set the maximum width for the progress bar + progress_bar_max_width = 300 + + + # Show how many messages are currently hidden (because of geometry). + indicate_hidden = yes + + # Shrink window if it's smaller than the width. Will be ignored if + # width is 0. + shrink = yes + + # The transparency of the window. Range: [0; 100]. + # This option will only work if a compositing window manager is + # present (e.g. xcompmgr, compiz, etc.). + transparency = 0 + + # The height of the entire notification. If the height is smaller + # than the font height and padding combined, it will be raised + # to the font height and padding. + notification_height = 0 + + # Draw a line of "separator_height" pixel height between two + # notifications. + # Set to 0 to disable. + separator_height = 2 + + # Padding between text and separator. + padding = 8 + + # Horizontal padding. + horizontal_padding = 8 + + # Padding between text and icon. + text_icon_padding = 0 + + # Defines width in pixels of frame around the notification window. + # Set to 0 to disable. + frame_width = 3 + + # Defines color of the frame around the notification window. + frame_color = "#aaaaaa" + + # Define a color for the separator. + # possible values are: + # * auto: dunst tries to find a color fitting to the background; + # * foreground: use the same color as the foreground; + # * frame: use the same color as the frame; + # * anything else will be interpreted as a X color. + separator_color = frame + + # Sort messages by urgency. + sort = yes + + # Don't remove messages, if the user is idle (no mouse or keyboard input) + # for longer than idle_threshold seconds. + # Set to 0 to disable. + # A client can set the 'transient' hint to bypass this. See the rules + # section for how to disable this if necessary + idle_threshold = 120 + + ### Text ### + + font = Monospace 8 + + # The spacing between lines. If the height is smaller than the + # font height, it will get raised to the font height. + line_height = 0 + + # Possible values are: + # full: Allow a small subset of html markup in notifications: + # bold + # italic + # strikethrough + # underline + # + # For a complete reference see + # . + # + # strip: This setting is provided for compatibility with some broken + # clients that send markup even though it's not enabled on the + # server. Dunst will try to strip the markup but the parsing is + # simplistic so using this option outside of matching rules for + # specific applications *IS GREATLY DISCOURAGED*. + # + # no: Disable markup parsing, incoming notifications will be treated as + # plain text. Dunst will not advertise that it has the body-markup + # capability if this is set as a global setting. + # + # It's important to note that markup inside the format option will be parsed + # regardless of what this is set to. + markup = full + + # The format of the message. Possible variables are: + # %a appname + # %s summary + # %b body + # %i iconname (including its path) + # %I iconname (without its path) + # %p progress value if set ([ 0%] to [100%]) or nothing + # %n progress value if set without any extra characters + # %% Literal % + # Markup is allowed + format = "%s\n%b" + + # Alignment of message text. + # Possible values are "left", "center" and "right". + alignment = left + + # Vertical alignment of message text and icon. + # Possible values are "top", "center" and "bottom". + vertical_alignment = center + + # Show age of message if message is older than show_age_threshold + # seconds. + # Set to -1 to disable. + show_age_threshold = 60 + + # Split notifications into multiple lines if they don't fit into + # geometry. + word_wrap = yes + + # When word_wrap is set to no, specify where to make an ellipsis in long lines. + # Possible values are "start", "middle" and "end". + ellipsize = middle + + # Ignore newlines '\n' in notifications. + ignore_newline = no + + # Stack together notifications with the same content + stack_duplicates = true + + # Hide the count of stacked notifications with the same content + hide_duplicate_count = false + + # Display indicators for URLs (U) and actions (A). + show_indicators = yes + + ### Icons ### + + # Align icons left/right/off + icon_position = left + + # Scale small icons up to this size, set to 0 to disable. Helpful + # for e.g. small files or high-dpi screens. In case of conflict, + # max_icon_size takes precedence over this. + min_icon_size = 0 + + # Scale larger icons down to this size, set to 0 to disable + max_icon_size = 32 + + # Paths to default icons. + icon_path = /usr/share/icons/Adwaita/16x16/status/:/usr/share/icons/Adwaita/16x16/devices/ + + ### History ### + + # Should a notification popped up from history be sticky or timeout + # as if it would normally do. + sticky_history = yes + + # Maximum amount of notifications kept in history + history_length = 20 + + ### Misc/Advanced ### + + # dmenu path. + dmenu = /usr/bin/dmenu -p dunst: + + # Browser for opening urls in context menu. + browser = /usr/bin/librewolf -new-tab + + # Always run rule-defined scripts, even if the notification is suppressed + always_run_script = true + + # Define the title of the windows spawned by dunst + title = Dunst + + # Define the class of the windows spawned by dunst + class = Dunst + + # Print a notification on startup. + # This is mainly for error detection, since dbus (re-)starts dunst + # automatically after a crash. + startup_notification = false + + # Manage dunst's desire for talking + # Can be one of the following values: + # crit: Critical features. Dunst aborts + # warn: Only non-fatal warnings + # mesg: Important Messages + # info: all unimportant stuff + # debug: all less than unimportant stuff + verbosity = mesg + + # Define the corner radius of the notification window + # in pixel size. If the radius is 0, you have no rounded + # corners. + # The radius will be automatically lowered if it exceeds half of the + # notification height to avoid clipping text and/or icons. + corner_radius = 0 + + # Ignore the dbus closeNotification message. + # Useful to enforce the timeout set by dunst configuration. Without this + # parameter, an application may close the notification sent before the + # user defined timeout. + ignore_dbusclose = false + + ### Wayland ### + # These settings are Wayland-specific. They have no effect when using X11 + + # Uncomment this if you want to let notications appear under fullscreen + # applications (default: overlay) + # layer = top + + # Set this to true to use X11 output on Wayland. + force_xwayland = false + + ### Legacy + + # Use the Xinerama extension instead of RandR for multi-monitor support. + # This setting is provided for compatibility with older nVidia drivers that + # do not support RandR and using it on systems that support RandR is highly + # discouraged. + # + # By enabling this setting dunst will not be able to detect when a monitor + # is connected or disconnected which might break follow mode if the screen + # layout changes. + force_xinerama = false + + ### mouse + + # Defines list of actions for each mouse event + # Possible values are: + # * none: Don't do anything. + # * do_action: If the notification has exactly one action, or one is marked as default, + # invoke it. If there are multiple and no default, open the context menu. + # * close_current: Close current notification. + # * close_all: Close all notifications. + # These values can be strung together for each mouse event, and + # will be executed in sequence. + mouse_left_click = close_current + mouse_middle_click = do_action, close_current + mouse_right_click = close_all + +# Experimental features that may or may not work correctly. Do not expect them +# to have a consistent behaviour across releases. +[experimental] + # Calculate the dpi to use on a per-monitor basis. + # If this setting is enabled the Xft.dpi value will be ignored and instead + # dunst will attempt to calculate an appropriate dpi value for each monitor + # using the resolution and physical size. This might be useful in setups + # where there are multiple screens with very different dpi values. + per_monitor_dpi = false + +# The internal keyboard shortcut support in dunst is now considered deprecated +# and should be replaced by dunstctl calls. You can use the configuration of your +# WM or DE to bind these to shortcuts of your choice. +# Check the dunstctl manual page for more info. +[shortcuts] + + # Shortcuts are specified as [modifier+][modifier+]...key + # Available modifiers are "ctrl", "mod1" (the alt-key), "mod2", + # "mod3" and "mod4" (windows-key). + # Xev might be helpful to find names for keys. + + # Close notification. Equivalent dunstctl command: + # dunstctl close + # close = ctrl+space + + # Close all notifications. Equivalent dunstctl command: + # dunstctl close-all + # close_all = ctrl+shift+space + + # Redisplay last message(s). Equivalent dunstctl command: + # dunstctl history-pop + # history = ctrl+grave + + # Context menu. Equivalent dunstctl command: + # dunstctl context + # context = ctrl+shift+period + +[urgency_low] + # IMPORTANT: colors have to be defined in quotation marks. + # Otherwise the "#" and following would be interpreted as a comment. + background = "#282828" + foreground = "#ebdbb2" + timeout = 10 + # Icon for notifications with low urgency, uncomment to enable + #icon = /path/to/icon + +[urgency_normal] + background = "#282828" + foreground = "#ebdbb2" + timeout = 10 + # Icon for notifications with normal urgency, uncomment to enable + #icon = /path/to/icon + +[urgency_critical] + background = "#282828" + foreground = "#ebdbb2" + frame_color = "#ff0000" + timeout = 0 + # Icon for notifications with critical urgency, uncomment to enable + #icon = /path/to/icon + +# Every section that isn't one of the above is interpreted as a rules to +# override settings for certain messages. +# +# Messages can be matched by +# appname (discouraged, see desktop_entry) +# body +# category +# desktop_entry +# icon +# match_transient +# msg_urgency +# stack_tag +# summary +# +# and you can override the +# background +# foreground +# format +# frame_color +# fullscreen +# new_icon +# set_stack_tag +# set_transient +# timeout +# urgency +# +# Shell-like globbing will get expanded. +# +# Instead of the appname filter, it's recommended to use the desktop_entry filter. +# GLib based applications export their desktop-entry name. In comparison to the appname, +# the desktop-entry won't get localized. +# +# SCRIPTING +# You can specify a script that gets run when the rule matches by +# setting the "script" option. +# The script will be called as follows: +# script appname summary body icon urgency +# where urgency can be "LOW", "NORMAL" or "CRITICAL". +# +# NOTE: if you don't want a notification to be displayed, set the format +# to "". +# NOTE: It might be helpful to run dunst -print in a terminal in order +# to find fitting options for rules. + +# Disable the transient hint so that idle_threshold cannot be bypassed from the +# client +#[transient_disable] +# match_transient = yes +# set_transient = no +# +# Make the handling of transient notifications more strict by making them not +# be placed in history. +#[transient_history_ignore] +# match_transient = yes +# history_ignore = yes + +# fullscreen values +# show: show the notifications, regardless if there is a fullscreen window opened +# delay: displays the new notification, if there is no fullscreen window active +# If the notification is already drawn, it won't get undrawn. +# pushback: same as delay, but when switching into fullscreen, the notification will get +# withdrawn from screen again and will get delayed like a new notification +#[fullscreen_delay_everything] +# fullscreen = delay +#[fullscreen_show_critical] +# msg_urgency = critical +# fullscreen = show + +#[espeak] +# summary = "*" +# script = dunst_espeak.sh + +#[script-test] +# summary = "*script*" +# script = dunst_test.sh + +#[ignore] +# # This notification will not be displayed +# summary = "foobar" +# format = "" + +#[history-ignore] +# # This notification will not be saved in history +# summary = "foobar" +# history_ignore = yes + +#[skip-display] +# # This notification will not be displayed, but will be included in the history +# summary = "foobar" +# skip_display = yes + +#[signed_on] +# appname = Pidgin +# summary = "*signed on*" +# urgency = low +# +#[signed_off] +# appname = Pidgin +# summary = *signed off* +# urgency = low +# +#[says] +# appname = Pidgin +# summary = *says* +# urgency = critical +# +#[twitter] +# appname = Pidgin +# summary = *twitter.com* +# urgency = normal +# +#[stack-volumes] +# appname = "some_volume_notifiers" +# set_stack_tag = "volume" +# +# vim: ft=cfg diff --git a/home/.config/fakecam/config.ini b/home/.config/fakecam/config.ini new file mode 100644 index 0000000..2bfe41c --- /dev/null +++ b/home/.config/fakecam/config.ini @@ -0,0 +1,11 @@ +; width = 1280 +; height = 720 +; fps = 30 +; no-background = yes +background-image = ~/pics/03_background-abstract.jpg +; background-keep-aspect = no +no-foreground = yes +; webcam-path = /dev/video3 +threshold = 50 +select-model = 0 +no-ondemand = yes diff --git a/home/.config/fontconfig/fonts.conf b/home/.config/fontconfig/fonts.conf new file mode 100644 index 0000000..63eac54 --- /dev/null +++ b/home/.config/fontconfig/fonts.conf @@ -0,0 +1,35 @@ + + + + + + monospace + + Fira Code + DejaVu Sans Mono + Inconsolata + + + + + sans-serif + + DejaVu Sans + Droid Sans + Ubuntu + Helvetica + + + + + serif + + Latin Modern Math + DejaVu Serif + CMU Serif + Latin Modern Roman + Computer Modern + + + + diff --git a/home/.config/gamemode.ini b/home/.config/gamemode.ini new file mode 100644 index 0000000..899cc4c --- /dev/null +++ b/home/.config/gamemode.ini @@ -0,0 +1,97 @@ +[general] +; The reaper thread will check every 5 seconds for exited clients, for config file changes, and for the CPU/iGPU power balance +reaper_freq=5 + +; The desired governor is used when entering GameMode instead of "performance" +desiredgov=performance +; The default governer is used when leaving GameMode instead of restoring the original value +defaultgov=performance + +; The iGPU desired governor is used when the integrated GPU is under heavy load +; igpu_desiredgov=powersave +; Threshold to use to decide when the integrated GPU is under heavy load. +; This is a ratio of iGPU Watts / CPU Watts which is used to determine when the +; integraged GPU is under heavy enough load to justify switching to +; igpu_desiredgov. Set this to -1 to disable all iGPU checking and always +; use desiredgov for games. +; igpu_power_threshold=0.3 + +; GameMode can change the scheduler policy to SCHED_ISO on kernels which support it (currently +; not supported by upstream kernels). Can be set to "auto", "on" or "off". "auto" will enable +; with 4 or more CPU cores. "on" will always enable. Defaults to "off". +softrealtime=off + +; GameMode can renice game processes. You can put any value between 0 and 20 here, the value +; will be negated and applied as a nice value (0 means no change). Defaults to 0. +renice=0 + +; By default, GameMode adjusts the iopriority of clients to BE/0, you can put any value +; between 0 and 7 here (with 0 being highest priority), or one of the special values +; "off" (to disable) or "reset" (to restore Linux default behavior based on CPU priority), +; currently, only the best-effort class is supported thus you cannot set it here +ioprio=0 + +; Sets whether gamemode will inhibit the screensaver when active +; Defaults to 1 +; inhibit_screensaver=1 + +[filter] +; If "whitelist" entry has a value(s) +; gamemode will reject anything not in the whitelist +;whitelist=RiseOfTheTombRaider + +; Gamemode will always reject anything in the blacklist +;blacklist=HalfLife3 +; glxgears + +[gpu] +; Here Be Dragons! +; Warning: Use these settings at your own risk +; Any damage to hardware incurred due to this feature is your responsibility and yours alone +; It is also highly recommended you try these settings out first manually to find the sweet spots + +; Setting this to the keyphrase "accept-responsibility" will allow gamemode to apply GPU optimisations such as overclocks +;apply_gpu_optimisations=0 + +; The DRM device number on the system (usually 0), ie. the number in /sys/class/drm/card0/ +;gpu_device=0 + +; Nvidia specific settings +; Requires the coolbits extension activated in nvidia-xconfig +; This corresponds to the desired GPUPowerMizerMode +; "Adaptive"=0 "Prefer Maximum Performance"=1 and "Auto"=2 +; See NV_CTRL_GPU_POWER_MIZER_MODE and friends in https://github.com/NVIDIA/nvidia-settings/blob/master/src/libXNVCtrl/NVCtrl.h +;nv_powermizer_mode=1 + +; These will modify the core and mem clocks of the highest perf state in the Nvidia PowerMizer +; They are measured as Mhz offsets from the baseline, 0 will reset values to default, -1 or unset will not modify values +;nv_core_clock_mhz_offset=0 +;nv_mem_clock_mhz_offset=0 + +; AMD specific settings +; Requires a relatively up to date AMDGPU kernel module +; See: https://dri.freedesktop.org/docs/drm/gpu/amdgpu.html#gpu-power-thermal-controls-and-monitoring +; It is also highly recommended you use lm-sensors (or other available tools) to verify card temperatures +; This corresponds to power_dpm_force_performance_level, "manual" is not supported for now +;amd_performance_level=high + +[supervisor] +; This section controls the new gamemode functions gamemode_request_start_for and gamemode_request_end_for +; The whilelist and blacklist control which supervisor programs are allowed to make the above requests +;supervisor_whitelist= +;supervisor_blacklist= + +; In case you want to allow a supervisor to take full control of gamemode, this option can be set +; This will only allow gamemode clients to be registered by using the above functions by a supervisor client +;require_supervisor=0 + +[custom] +; Custom scripts (executed using the shell) when gamemode starts and ends +;start=notify-send "GameMode started" +; /home/me/bin/stop_ethmining.sh + +;end=notify-send "GameMode ended" +; /home/me/bin/start_ethmining.sh + +; Timeout for scripts (seconds). Scripts will be killed if they do not complete within this time. +;script_timeout=10 diff --git a/home/.config/git/config b/home/.config/git/config new file mode 100644 index 0000000..d3c55dd --- /dev/null +++ b/home/.config/git/config @@ -0,0 +1,119 @@ +[user] + email = sommerfeld@strisemarx.com + name = Arnold Sommerfeld + signingkey = 47C5F04AC8C65531 +[push] + autoSetupRemote = true + followTags = false + gpgSign = if-asked +[core] + whitespace = fix,trailing-space,cr-at-eol + autocrlf = input + pager = delta +[branch] + autoSetupMerge = false + sort=-committerdate +[web] + browser = librewolf +[diff] + tool = nvimdiff + algorithm = histogram + colorMoved = default + mnemonicPrefix = true + relative = true + renameLimit = 10000 +[difftool] + prompt = false + trustExitCode = true +[difftool "nvimdiff"] + cmd = $EDITOR -d $LOCAL $REMOTE +[rebase] + autoStash = true +[fetch] + recurseSubmodules = on-demand + prune = true +[pull] + ff = only +[merge] + tool = conflictmarker + conflictstyle = diff3 +[mergetool "conflictmarker"] + cmd = $EDITOR "$MERGED" +[commit] + gpgsign = true +[status] + showUntrackedFiles = all + submoduleSummary = true +[help] + autocorrect = 1 +[log] + abbrevCommit = true +[interactive] + singleKey = true + diffFilter = delta --color-only +#[remote "origin"] +# fetch = +refs/pull/*/head:refs/remotes/origin/pr/* +[sendemail] + smtpServer = localhost + smtpUser = sommerfeld@strisemarx.com + smtpEncryption = tls + smtpServerPort = 1025 + annotate = true +[format] + signOff = true +[advice] + detachedHead = false + skippedCherryPicks = false +[delta] + navigate = true + syntax-theme = gruvbox-dark + relative-paths = true +[alias] + cl = clone + br = branch -vv + c = commit + ca = commit --amend --no-edit + cp = cherry-pick + sw = switch --recurse-submodules + swc = switch --recurse-submodules -c + swd = switch --recurse-submodules -d + rt = restore + res = reset + s = status --branch --short + m = merge + mt = mergetool + ff = merge --ff-only + r = rebase + rb = rebase + ri = rebase -i + p = push + fp = push --force-with-lease + f = fetch + fa = fetch --all + d = diff + staged = diff --cached + dt = difftool + a = add + stage = add + st = add + sub = submodule + subf = submodule foreach + re = remote -v + ra = remote add + rs = remote set-url + rr = remote remove + st = stash + sp = stash pop + sd = stash drop + sl = stash list + ss = stash show + del = branch -D + unstage = reset HEAD -- + last = log -1 HEAD + undo = reset --hard + l = log --abbrev-commit -200 --graph --date=short --pretty=oneline + update=!git fetch && git merge --ff-only + fr=!git fetch && git rebase + find-merge = "!sh -c 'commit=$0 && branch=${1:-HEAD} && (git rev-list $commit..$branch --ancestry-path | cat -n; git rev-list $commit..$branch --first-parent | cat -n) | sort -k2 -s | uniq -f1 -d | sort -n | tail -1 | cut -f2'" + gone = !git for-each-ref --format '%(refname:short) %(upstream:track)' | awk '$2 == \"[gone]\" {print $1}' | xargs -r git branch -D + ab=absorb --and-rebase diff --git a/home/.config/git/ignore b/home/.config/git/ignore new file mode 100644 index 0000000..aece5c8 --- /dev/null +++ b/home/.config/git/ignore @@ -0,0 +1,558 @@ +# perf +perf.data* + +# Vim +.exrc +.doit.lua + +# Swap +[._]*.s[a-v][a-z] +[._]*.sw[a-p] +[._]s[a-rt-v][a-z] +[._]ss[a-gi-z] +[._]sw[a-p] + +# Session +Session.vim + +# Temporary +.netrwhist +*~ +# Auto-generated tag files +tags +tags.* +# Persistent undo +[._]*.un~ + +# Tags +# Ignore tags created by etags, ctags, gtags (GNU global) and cscope +TAGS +.TAGS +tags +.tags +gtags.files +GTAGS +GRTAGS +GPATH +GSYMS +cscope.files +cscope.out +cscope.in.out +cscope.po.out + +# C++ + +# Compiled Object files +*.slo +*.lo +*.o +*.obj + +# Precompiled Headers +*.gch +*.pch + +# Compiled Dynamic libraries +*.so +*.dylib +*.dll + +# Fortran module files +*.mod +*.smod + +# Compiled Static libraries +*.lai +*.la +*.a +*.lib + +# Executables +*.out +*.app + +# C + +# Object files +*.o +*.ko +*.obj +*.elf + +# Linker output +*.ilk +# *.map +*.exp + +# Precompiled Headers +*.gch +*.pch + +# Libraries +*.lib +*.a +*.la +*.lo + +# Shared objects (inc. Windows DLLs) +*.dll +*.so +*.so.* +*.dylib + +# Executables +*.out +*.app +*.i*86 +*.x86_64 +*.hex + +# Debug files +*.dSYM/ +*.su +*.idb +*.pdb + +# Kernel Module Compile Results +*.mod* +*.cmd +.tmp_versions/ +modules.order +Module.symvers +Mkfile.old +dkms.conf + +# archive files + +# It's better to unpack these files and commit the raw source because +# git has its own built in compression methods. +*.7z +*.jar +*.rar +*.zip +*.gz +*.tgz +*.bzip +*.bz2 +*.xz +*.lzma +*.cab + +# Packing-only formats +*.iso +*.tar + +# Package management formats +*.dmg +*.xpi +*.gem +*.egg +*.deb +*.rpm +*.msi +*.msm +*.msp + +# Diff +*.patch +*.diff + +# Clion +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm +# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 + +# User-specific stuff +.idea/ + +# CMake +cmake-build-*/ +build*/ +build +build-release +build-reldbg + +# File-based project format +*.iws + +# IntelliJ +out/ + +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# Crashlytics plugin (for Android Studio and IntelliJ) +com_crashlytics_export_strings.xml +crashlytics.properties +crashlytics-build.properties +fabric.properties + +# Linux +*~ + +# temporary files which can be created if a process still has a handle open of a deleted file +.fuse_hidden* + +# KDE directory preferences +.directory + +# Linux trash folder which might appear on any partition or disk +.Trash-* + +# .nfs files are created when an open file is removed but is still being accessed +.nfs* + +# LibreOffice locks +.~lock.*# + +# backup +*.bak +*.gho +*.ori +*.tmp + +# Cmake +CMakeLists.txt.user +CMakeCache.txt +CMakeFiles +CMakeScripts +Testing +# Makefile +cmake_install.cmake +install_manifest.txt +compile_commands.json +CTestTestfile.cmake + +# CUDA +*.i +*.ii +*.gpu +*.ptx +*.cubin +*.fatbin + +# Python +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +# lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +share/python-wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.nox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +.hypothesis/ +.pytest_cache/ + +# Translations +*.mo +*.pot + +# PyBuilder +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# IPython +# profile_default/ +# ipython_config.py + +# pyenv +.python-version + +# Environments +.env +.venv +# env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# Latex +## Core latex/pdflatex auxiliary files: +*.aux +*.lof +*.log +*.lot +*.fls +*.out +*.toc +*.fmt +*.fot +*.cb +*.cb2 +.*.lb + +## Intermediate documents: +*.dvi +*.xdv +*-converted-to.* +# these rules might exclude image files for figures etc. +# *.ps +# *.eps +# *.pdf + +## Generated if empty string is given at "Please type another file name for output:" +.pdf + +## Bibliography auxiliary files (bibtex/biblatex/biber): +*.bbl +*.bcf +*.blg +*-blx.aux +*-blx.bib +*.run.xml + +## Build tool auxiliary files: +*.fdb_latexmk +*.synctex +*.synctex(busy) +*.synctex.gz +*.synctex.gz(busy) +*.pdfsync + +## Build tool directories for auxiliary files +# latexrun +latex.out/ + +## Auxiliary and intermediate files from other packages: +# algorithms +*.alg +*.loa + +# achemso +acs-*.bib + +# amsthm +*.thm + +# beamer +*.nav +*.pre +*.snm +*.vrb + +# changes +*.soc + +# comment +*.cut + +# cprotect +*.cpt + +# elsarticle (documentclass of Elsevier journals) +*.spl + +# endnotes +*.ent + +# fixme +*.lox + +# feynmf/feynmp +*.mf +*.mp +*.t[1-9] +*.t[1-9][0-9] +*.tfm + +# glossaries +*.acn +*.acr +*.glg +*.glo +*.gls +*.glsdefs + +# gnuplottex +*-gnuplottex-* + +# gregoriotex +*.gaux +*.gtex + +# htlatex +*.4ct +*.4tc +*.idv +*.lg +*.trc +*.xref + +# hyperref +*.brf + +# knitr +*-concordance.tex +# TODO Comment the next line if you want to keep your tikz graphics files +*.tikz +*-tikzDictionary + +# listings +*.lol + +# makeidx +*.idx +*.ilg +*.ind +*.ist + +# minitoc +*.maf +*.mlf +*.mlt +*.mtc[0-9]* +*.slf[0-9]* +*.slt[0-9]* +*.stc[0-9]* + +# minted +_minted* +*.pyg + +# morewrites +*.mw + +# nomencl +*.nlg +*.nlo +*.nls + +# pax +*.pax + +# pdfpcnotes +*.pdfpc + +# sagetex +*.sagetex.sage +*.sagetex.py +*.sagetex.scmd + +# scrwfile +*.wrt + +# sympy +*.sout +*.sympy +sympy-plots-for-*.tex/ + +# pdfcomment +*.upa +*.upb + +# pythontex +*.pytxcode +pythontex-files-*/ + +# tcolorbox +*.listing + +# thmtools +*.loe + +# TikZ & PGF +*.dpth +*.md5 +*.auxlock + +# todonotes +*.tdo + +# vhistory +*.hst +*.ver + +# easy-todo +*.lod + +# xcolor +*.xcp + +# xmpincl +*.xmpi + +# xindy +*.xdy + +# xypic precompiled matrices +*.xyc + +# endfloat +*.ttt +*.fff + +## Editors: +# WinEdt +*.bak +*.sav + +# Kile +*.backup + +# KBibTeX +*~[0-9]* + +# auto folder when using emacs and auctex +./auto/* +*.el + +# expex forward references with \gathertags +*-tags.tex + +# standalone packages +*.sta + +# ccls +.ccls-cache + +# clangd +.clangd + +# pkgs + +.SRCINFO +*.tar.gz +*.zip +*.tar.zst diff --git a/home/.config/git/noattributes b/home/.config/git/noattributes new file mode 100644 index 0000000..2fe1baf --- /dev/null +++ b/home/.config/git/noattributes @@ -0,0 +1,389 @@ +# Sources +*.c text diff=c +*.cc text diff=cpp +*.cxx text diff=cpp +*.cpp text diff=cpp +*.c++ text diff=cpp +*.hpp text diff=cpp +*.h text diff=c +*.h++ text diff=cpp +*.hh text diff=cpp +*.hxx text diff=cpp +*.def text diff=c + +# Compiled Object files +*.slo binary +*.lo binary +*.o binary +*.obj binary + +# Precompiled Headers +*.gch binary +*.pch binary + +# Compiled Dynamic libraries +*.so binary +*.dylib binary +*.dll binary + +# Compiled Static libraries +*.lai binary +*.la binary +*.a binary +*.lib binary + +# Executables +*.exe binary +*.out binary +*.app binary +# Common settings that generally should always be used with your language specific settings + +# Auto detect text files and perform LF normalization +# https://www.davidlaing.com/2012/09/19/customise-your-gitattributes-to-become-a-git-ninja/ +* text=auto + +# +# The above will handle all files NOT found below +# + +# Documents +*.bibtex text diff=bibtex +*.doc diff=astextplain +*.DOC diff=astextplain +*.docx diff=astextplain +*.DOCX diff=astextplain +*.dot diff=astextplain +*.DOT diff=astextplain +*.pdf diff=astextplain +*.PDF diff=astextplain +*.rtf diff=astextplain +*.RTF diff=astextplain +*.md text +*.tex text diff=tex +*.adoc text +*.textile text +*.mustache text +*.csv text +*.tab text +*.tsv text +*.txt text +*.sql text + +# Graphics +*.png binary +*.jpg binary +*.jpeg binary +*.gif binary +*.tif binary +*.tiff binary +*.ico binary +# SVG treated as an asset (binary) by default. +*.svg text +# If you want to treat it as binary, +# use the following line instead. +# *.svg binary +*.eps binary + +# Scripts +*.bash text eol=lf +*.fish text eol=lf +*.sh text eol=lf +# These are explicitly windows files and should use crlf +*.bat text eol=crlf +*.cmd text eol=crlf +*.ps1 text eol=crlf + +# Serialisation +*.json text +*.toml text +*.xml text +*.yaml text +*.yml text + +# Archives +*.7z binary +*.gz binary +*.tar binary +*.tgz binary +*.zip binary + +# Text files where line endings should be preserved +*.patch -text + +# +# Exclude files from exporting +# + +.gitattributes export-ignore +.gitignore export-ignore +# Treat all Go files in this repo as binary, with no git magic updating +# line endings. Windows users contributing to Go will need to use a +# modern version of git and editors capable of LF line endings. + +*.go -text diff=golang +# Basic .gitattributes for a Lua repo. + +# Source files +# ============ +*.lua text + +# Luadoc output +# ============= +*.html text diff=html +*.css text diff=css +# Basic .gitattributes for a MATLAB repo. +# This template includes Simulink and MuPAD extensions, in addition +# to the MATLAB extensions. + +# Source files +# ============ +*.m text diff=matlab +*.mu text diff=matlab + +# Caution: *.m also matches Mathematica packages. + +# Binary files +# ============ +*.p binary +*.mex* binary +*.fig binary +*.mat binary +*.mdl binary +*.slx binary +*.mdlp binary +*.slxp binary +*.sldd binary +*.mltbx binary +*.mlappinstall binary +*.mlpkginstall binary +*.mn binary +# Basic .gitattributes for a perl repo. + +# Source files +# ============ +*.pl text diff=perl +*.pm text diff=perl +# Basic .gitattributes for a python repo. + +# Source files +# ============ +*.pxd text diff=python +*.py text diff=python +*.py3 text diff=python +*.pyw text diff=python +*.pyx text diff=python +*.pyz text diff=python + +# Binary files +# ============ +*.db binary +*.p binary +*.pkl binary +*.pickle binary +*.pyc binary +*.pyd binary +*.pyo binary + +# Jupyter notebook +*.ipynb text + +# Note: .db, .p, and .pkl files are associated +# with the python modules ``pickle``, ``dbm.*``, +# ``shelve``, ``marshal``, ``anydbm``, & ``bsddb`` +# (among others). +## GITATTRIBUTES FOR WEB PROJECTS +# +# These settings are for any web project. +# +# Details per file setting: +# text These files should be normalized (i.e. convert CRLF to LF). +# binary These files are binary and should be left untouched. +# +# Note that binary is a macro for -text -diff. +###################################################################### + +# Auto detect +## Handle line endings automatically for files detected as +## text and leave all files detected as binary untouched. +## This will handle all files NOT defined below. +* text=auto + +# Source code +*.bash text eol=lf +*.bat text eol=crlf +*.cmd text eol=crlf +*.coffee text +*.css text +*.htm text diff=html +*.html text diff=html +*.inc text +*.ini text +*.js text +*.json text +*.jsx text +*.less text +*.ls text +*.map text -diff +*.od text +*.onlydata text +*.php text diff=php +*.pl text +*.ps1 text eol=crlf +*.py text diff=python +*.rb text diff=ruby +*.sass text +*.scm text +*.scss text diff=css +*.sh text eol=lf +*.sql text +*.styl text +*.tag text +*.ts text +*.tsx text +*.xml text +*.xhtml text diff=html + +# Docker +Dockerfile text + +# Documentation +*.ipynb text +*.markdown text +*.md text +*.mdwn text +*.mdown text +*.mkd text +*.mkdn text +*.mdtxt text +*.mdtext text +*.txt text +AUTHORS text +CHANGELOG text +CHANGES text +CONTRIBUTING text +COPYING text +copyright text +*COPYRIGHT* text +INSTALL text +license text +LICENSE text +NEWS text +readme text +*README* text +TODO text + +# Templates +*.dot text +*.ejs text +*.haml text +*.handlebars text +*.hbs text +*.hbt text +*.jade text +*.latte text +*.mustache text +*.njk text +*.phtml text +*.tmpl text +*.tpl text +*.twig text +*.vue text + +# Configs +*.cnf text +*.conf text +*.config text +.editorconfig text +.env text +.gitattributes text +.gitconfig text +.htaccess text +*.lock text -diff +package-lock.json text -diff +*.toml text +*.yaml text +*.yml text +browserslist text +Makefile text +makefile text + +# Heroku +Procfile text + +# Graphics +*.ai binary +*.bmp binary +*.eps binary +*.gif binary +*.gifv binary +*.ico binary +*.jng binary +*.jp2 binary +*.jpg binary +*.jpeg binary +*.jpx binary +*.jxr binary +*.pdf binary +*.png binary +*.psb binary +*.psd binary +# SVG treated as an asset (binary) by default. +*.svg text +# If you want to treat it as binary, +# use the following line instead. +# *.svg binary +*.svgz binary +*.tif binary +*.tiff binary +*.wbmp binary +*.webp binary + +# Audio +*.kar binary +*.m4a binary +*.mid binary +*.midi binary +*.mp3 binary +*.ogg binary +*.ra binary + +# Video +*.3gpp binary +*.3gp binary +*.as binary +*.asf binary +*.asx binary +*.fla binary +*.flv binary +*.m4v binary +*.mng binary +*.mov binary +*.mp4 binary +*.mpeg binary +*.mpg binary +*.ogv binary +*.swc binary +*.swf binary +*.webm binary + +# Archives +*.7z binary +*.gz binary +*.jar binary +*.rar binary +*.tar binary +*.zip binary + +# Fonts +*.ttf binary +*.eot binary +*.otf binary +*.woff binary +*.woff2 binary + +# Executables +*.exe binary +*.pyc binary + +# RC files (like .babelrc or .eslintrc) +*.*rc text diff --git a/home/.config/gtk-2.0/gtkfilechooser.ini b/home/.config/gtk-2.0/gtkfilechooser.ini new file mode 100644 index 0000000..3de31bf --- /dev/null +++ b/home/.config/gtk-2.0/gtkfilechooser.ini @@ -0,0 +1,11 @@ +[Filechooser Settings] +LocationMode=path-bar +ShowHidden=false +ShowSizeColumn=true +GeometryX=0 +GeometryY=0 +GeometryWidth=780 +GeometryHeight=585 +SortColumn=name +SortOrder=ascending +StartupMode=recent diff --git a/home/.config/gtk-2.0/gtkrc-2.0 b/home/.config/gtk-2.0/gtkrc-2.0 new file mode 100644 index 0000000..f6ec1f2 --- /dev/null +++ b/home/.config/gtk-2.0/gtkrc-2.0 @@ -0,0 +1,18 @@ +gtk-theme-name="Adwaita" +gtk-icon-theme-name="Adwaita" +gtk-font-name="Sans 11" +gtk-cursor-theme-name="Adwaita" +gtk-cursor-theme-size=0 +gtk-toolbar-style=GTK_TOOLBAR_TEXT +gtk-toolbar-icon-size=GTK_ICON_SIZE_LARGE_TOOLBAR +gtk-button-images=0 +gtk-menu-images=0 +gtk-enable-event-sounds=0 +gtk-enable-input-feedback-sounds=0 +gtk-menu-popup-delay = 0 +gtk-xft-antialias=1 +gtk-menu-popup-delay = 0 +gtk-xft-hinting=1 +gtk-xft-hintstyle="hintfull" +gtk-xft-rgba="rgb" +gtk-decoration-layout="menu:" diff --git a/home/.config/gtk-3.0/gtk.css b/home/.config/gtk-3.0/gtk.css new file mode 100644 index 0000000..300f8fc --- /dev/null +++ b/home/.config/gtk-3.0/gtk.css @@ -0,0 +1,41 @@ +.window-frame, .window-frame:backdrop { + box-shadow: 0 0 0 black; + border-style: none; + margin: 0; + border-radius: 0; +} + +.titlebar { + border-radius: 0; +} + +.window-frame.csd.popup { + box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(0, 0, 0, 0.13); +} + +.header-bar { + background-image: none; + background-color: #ededed; + box-shadow: none; +} +GtkLabel.title { + opacity: 0; +} +/* Always use background color */ +GtkWindow { + background-color: @theme_bg_color; +} + +/* Fix tooltip background override */ +.tooltip { + background-color: rgba(0, 0, 0, 0.8); +} + +.tooltip * { + background-color: transparent; +} + +/* Fix Nautilus desktop window background override */ +NautilusWindow { + background-color: transparent; +} diff --git a/home/.config/gtk-3.0/settings.ini b/home/.config/gtk-3.0/settings.ini new file mode 100644 index 0000000..2f11428 --- /dev/null +++ b/home/.config/gtk-3.0/settings.ini @@ -0,0 +1,20 @@ +[Settings] +gtk-theme-name=Adwaita +gtk-icon-theme-name=Adwaita +gtk-font-name=Sans 11 +gtk-cursor-theme-name=Adwaita +gtk-cursor-theme-size=0 +gtk-toolbar-style=GTK_TOOLBAR_TEXT +gtk-toolbar-icon-size=GTK_ICON_SIZE_LARGE_TOOLBAR +gtk-button-images=0 +gtk-menu-images=0 +gtk-enable-event-sounds=0 +gtk-enable-input-feedback-sounds=0 +gtk-enable-primary-paste=false +gtk-xft-antialias=1 +gtk-menu-popup-delay = 0 +gtk-xft-hinting=1 +gtk-xft-hintstyle=hintfull +gtk-xft-rgba=rgb +gtk-decoration-layout=menu: +gtk-application-prefer-dark-theme=1 diff --git a/home/.config/htop/htoprc b/home/.config/htop/htoprc new file mode 100644 index 0000000..c4bf0fc --- /dev/null +++ b/home/.config/htop/htoprc @@ -0,0 +1,63 @@ +# Beware! This file is rewritten by htop when settings are changed in the interface. +# The parser is also very primitive, and not human-friendly. +htop_version=3.2.2 +config_reader_min_version=3 +fields=0 17 18 20 48 2 50 113 46 47 39 1 +hide_kernel_threads=1 +hide_userland_threads=1 +hide_running_in_container=0 +shadow_other_users=1 +show_thread_names=0 +show_program_path=0 +highlight_base_name=1 +highlight_deleted_exe=1 +shadow_distribution_path_prefix=0 +highlight_megabytes=1 +highlight_threads=1 +highlight_changes=1 +highlight_changes_delay_secs=5 +find_comm_in_cmdline=1 +strip_exe_from_cmdline=1 +show_merged_command=0 +header_margin=0 +screen_tabs=0 +detailed_cpu_time=1 +cpu_count_from_one=1 +show_cpu_usage=1 +show_cpu_frequency=1 +show_cpu_temperature=1 +degree_fahrenheit=0 +update_process_names=1 +account_guest_in_cpu_meter=1 +color_scheme=5 +enable_mouse=0 +delay=15 +hide_function_bar=2 +header_layout=two_50_50 +column_meters_0=Uptime Systemd Tasks LoadAverage Load CPU AllCPUs2 CPU +column_meter_modes_0=2 2 2 1 3 1 1 3 +column_meters_1=Memory Swap Memory DiskIO DiskIO NetworkIO NetworkIO +column_meter_modes_1=1 2 3 2 3 2 3 +tree_view=1 +sort_key=46 +tree_sort_key=0 +sort_direction=-1 +tree_sort_direction=1 +tree_view_always_by_pid=0 +all_branches_collapsed=0 +screen:Main=PID PRIORITY NICE STARTTIME USER STATE NLWP OOM PERCENT_CPU PERCENT_MEM M_RESIDENT Command +.sort_key=PERCENT_CPU +.tree_sort_key=PID +.tree_view=1 +.tree_view_always_by_pid=0 +.sort_direction=-1 +.tree_sort_direction=1 +.all_branches_collapsed=0 +screen:I/O=PID USER IO_PRIORITY IO_RATE IO_READ_RATE IO_WRITE_RATE PERCENT_SWAP_DELAY PERCENT_IO_DELAY Command +.sort_key=IO_RATE +.tree_sort_key=PID +.tree_view=0 +.tree_view_always_by_pid=0 +.sort_direction=-1 +.tree_sort_direction=1 +.all_branches_collapsed=0 diff --git a/home/.config/ipython/profile_default/ipython_config.py b/home/.config/ipython/profile_default/ipython_config.py new file mode 100644 index 0000000..59fcd64 --- /dev/null +++ b/home/.config/ipython/profile_default/ipython_config.py @@ -0,0 +1,625 @@ +# Configuration file for ipython. + +#------------------------------------------------------------------------------ +# InteractiveShellApp(Configurable) configuration +#------------------------------------------------------------------------------ + +## A Mixin for applications that start InteractiveShell instances. +# +# Provides configurables for loading extensions and executing files as part of +# configuring a Shell environment. +# +# The following methods should be called by the :meth:`initialize` method of the +# subclass: +# +# - :meth:`init_path` +# - :meth:`init_shell` (to be implemented by the subclass) +# - :meth:`init_gui_pylab` +# - :meth:`init_extensions` +# - :meth:`init_code` + +## Execute the given command string. +#c.InteractiveShellApp.code_to_run = '' + +## Run the file referenced by the PYTHONSTARTUP environment variable at IPython +# startup. +#c.InteractiveShellApp.exec_PYTHONSTARTUP = True + +## List of files to run at IPython startup. +#c.InteractiveShellApp.exec_files = [] + +## lines of code to run at IPython startup. +#c.InteractiveShellApp.exec_lines = [] + +## A list of dotted module names of IPython extensions to load. +#c.InteractiveShellApp.extensions = [] + +## dotted module name of an IPython extension to load. +#c.InteractiveShellApp.extra_extension = '' + +## A file to be run +#c.InteractiveShellApp.file_to_run = '' + +## Enable GUI event loop integration with any of ('asyncio', 'glut', 'gtk', +# 'gtk2', 'gtk3', 'osx', 'pyglet', 'qt', 'qt4', 'qt5', 'tk', 'wx', 'gtk2', +# 'qt4'). +#c.InteractiveShellApp.gui = None + +## Should variables loaded at startup (by startup files, exec_lines, etc.) be +# hidden from tools like %who? +#c.InteractiveShellApp.hide_initial_ns = True + +## If True, IPython will not add the current working directory to sys.path. When +# False, the current working directory is added to sys.path, allowing imports of +# modules defined in the current directory. +#c.InteractiveShellApp.ignore_cwd = False + +## Configure matplotlib for interactive use with the default matplotlib backend. +# c.InteractiveShellApp.matplotlib = 'auto' + +## Run the module as a script. +#c.InteractiveShellApp.module_to_run = '' + +## Pre-load matplotlib and numpy for interactive use, selecting a particular +# matplotlib backend and loop integration. +#c.InteractiveShellApp.pylab = None + +## If true, IPython will populate the user namespace with numpy, pylab, etc. and +# an ``import *`` is done from numpy and pylab, when using pylab mode. +# +# When False, pylab mode should not import any names into the user namespace. +#c.InteractiveShellApp.pylab_import_all = True + +## Reraise exceptions encountered loading IPython extensions? +#c.InteractiveShellApp.reraise_ipython_extension_failures = False + +#------------------------------------------------------------------------------ +# Application(SingletonConfigurable) configuration +#------------------------------------------------------------------------------ + +## This is an application. + +## The date format used by logging formatters for %(asctime)s +#c.Application.log_datefmt = '%Y-%m-%d %H:%M:%S' + +## The Logging format template +#c.Application.log_format = '[%(name)s]%(highlevel)s %(message)s' + +## Set the log level by value or name. +#c.Application.log_level = 30 + +#------------------------------------------------------------------------------ +# BaseIPythonApplication(Application) configuration +#------------------------------------------------------------------------------ + +## IPython: an enhanced interactive Python shell. + +## Whether to create profile dir if it doesn't exist +# c.BaseIPythonApplication.auto_create = True + +## Whether to install the default config files into the profile dir. If a new +# profile is being created, and IPython contains config files for that profile, +# then they will be staged into the new directory. Otherwise, default config +# files will be automatically generated. +#c.BaseIPythonApplication.copy_config_files = False + +## Path to an extra config file to load. +# +# If specified, load this config file in addition to any other IPython config. +#c.BaseIPythonApplication.extra_config_file = '' + +## The name of the IPython directory. This directory is used for logging +# configuration (through profiles), history storage, etc. The default is usually +# $HOME/.ipython. This option can also be specified through the environment +# variable IPYTHONDIR. +#c.BaseIPythonApplication.ipython_dir = '' + +## Whether to overwrite existing config files when copying +#c.BaseIPythonApplication.overwrite = False + +## The IPython profile to use. +#c.BaseIPythonApplication.profile = 'default' + +## Create a massive crash report when IPython encounters what may be an internal +# error. The default is to append a short message to the usual traceback +#c.BaseIPythonApplication.verbose_crash = False + +#------------------------------------------------------------------------------ +# TerminalIPythonApp(BaseIPythonApplication,InteractiveShellApp) configuration +#------------------------------------------------------------------------------ + +## Whether to display a banner upon starting IPython. +#c.TerminalIPythonApp.display_banner = True + +## If a command or file is given via the command-line, e.g. 'ipython foo.py', +# start an interactive shell after executing the file or command. +#c.TerminalIPythonApp.force_interact = False + +## Class to use to instantiate the TerminalInteractiveShell object. Useful for +# custom Frontends +#c.TerminalIPythonApp.interactive_shell_class = 'IPython.terminal.interactiveshell.TerminalInteractiveShell' + +## Start IPython quickly by skipping the loading of config files. +#c.TerminalIPythonApp.quick = False + +#------------------------------------------------------------------------------ +# InteractiveShell(SingletonConfigurable) configuration +#------------------------------------------------------------------------------ + +## An enhanced, interactive shell for Python. + +## 'all', 'last', 'last_expr' or 'none', 'last_expr_or_assign' specifying which +# nodes should be run interactively (displaying output from expressions). +#c.InteractiveShell.ast_node_interactivity = 'last_expr' + +## A list of ast.NodeTransformer subclass instances, which will be applied to +# user input before code is run. +#c.InteractiveShell.ast_transformers = [] + +## Automatically run await statement in the top level repl. +#c.InteractiveShell.autoawait = True + +## Make IPython automatically call any callable object even if you didn't type +# explicit parentheses. For example, 'str 43' becomes 'str(43)' automatically. +# The value can be '0' to disable the feature, '1' for 'smart' autocall, where +# it is not applied if there are no more arguments on the line, and '2' for +# 'full' autocall, where all callable objects are automatically called (even if +# no arguments are present). +#c.InteractiveShell.autocall = 0 + +## Autoindent IPython code entered interactively. +#c.InteractiveShell.autoindent = True + +## Enable magic commands to be called without the leading %. +#c.InteractiveShell.automagic = True + +## The part of the banner to be printed before the profile +#c.InteractiveShell.banner1 = "Python 3.8.2 (default, Apr 8 2020, 14:31:25) \nType 'copyright', 'credits' or 'license' for more information\nIPython 7.14.0 -- An enhanced Interactive Python. Type '?' for help.\n" +c.InteractiveShell.banner1 = "" + +## The part of the banner to be printed after the profile +#c.InteractiveShell.banner2 = '' + +## Set the size of the output cache. The default is 1000, you can change it +# permanently in your config file. Setting it to 0 completely disables the +# caching system, and the minimum value accepted is 3 (if you provide a value +# less than 3, it is reset to 0 and a warning is issued). This limit is defined +# because otherwise you'll spend more time re-flushing a too small cache than +# working +#c.InteractiveShell.cache_size = 1000 + +## Use colors for displaying information about objects. Because this information +# is passed through a pager (like 'less'), and some pagers get confused with +# color codes, this capability can be turned off. +#c.InteractiveShell.color_info = True + +## Set the color scheme (NoColor, Neutral, Linux, or LightBG). +#c.InteractiveShell.colors = 'Neutral' +c.InteractiveShell.colors = 'Linux' + +## +#c.InteractiveShell.debug = False + +## Don't call post-execute functions that have failed in the past. +#c.InteractiveShell.disable_failing_post_execute = False + +## If True, anything that would be passed to the pager will be displayed as +# regular output instead. +#c.InteractiveShell.display_page = False + +## (Provisional API) enables html representation in mime bundles sent to pagers. +c.InteractiveShell.enable_html_pager = True + +## Total length of command history +#c.InteractiveShell.history_length = 10000 + +## The number of saved history entries to be loaded into the history buffer at +# startup. +#c.InteractiveShell.history_load_length = 1000 + +## +#c.InteractiveShell.ipython_dir = '' + +## Start logging to the given file in append mode. Use `logfile` to specify a log +# file to **overwrite** logs to. +#c.InteractiveShell.logappend = '' + +## The name of the logfile to use. +#c.InteractiveShell.logfile = '' + +## Start logging to the default log file in overwrite mode. Use `logappend` to +# specify a log file to **append** logs to. +#c.InteractiveShell.logstart = False + +## Select the loop runner that will be used to execute top-level asynchronous +# code +#c.InteractiveShell.loop_runner = 'IPython.core.interactiveshell._asyncio_runner' + +## +#c.InteractiveShell.object_info_string_level = 0 + +## Automatically call the pdb debugger after every exception. +#c.InteractiveShell.pdb = False + +## Deprecated since IPython 4.0 and ignored since 5.0, set +# TerminalInteractiveShell.prompts object directly. +#c.InteractiveShell.prompt_in1 = 'In [\\#]: ' + +## Deprecated since IPython 4.0 and ignored since 5.0, set +# TerminalInteractiveShell.prompts object directly. +#c.InteractiveShell.prompt_in2 = ' .\\D.: ' + +## Deprecated since IPython 4.0 and ignored since 5.0, set +# TerminalInteractiveShell.prompts object directly. +#c.InteractiveShell.prompt_out = 'Out[\\#]: ' + +## Deprecated since IPython 4.0 and ignored since 5.0, set +# TerminalInteractiveShell.prompts object directly. +#c.InteractiveShell.prompts_pad_left = True + +## +#c.InteractiveShell.quiet = False + +## +#c.InteractiveShell.separate_in = '\n' + +## +#c.InteractiveShell.separate_out = '' + +## +#c.InteractiveShell.separate_out2 = '' + +## Show rewritten input, e.g. for autocall. +#c.InteractiveShell.show_rewritten_input = True + +## Enables rich html representation of docstrings. (This requires the docrepr +# module). +#c.InteractiveShell.sphinxify_docstring = False + +## +#c.InteractiveShell.wildcards_case_sensitive = True + +## Switch modes for the IPython exception handlers. +#c.InteractiveShell.xmode = 'Context' + +#------------------------------------------------------------------------------ +# TerminalInteractiveShell(InteractiveShell) configuration +#------------------------------------------------------------------------------ + +## Autoformatter to reformat Terminal code. Can be `'black'` or `None` +#c.TerminalInteractiveShell.autoformatter = None + +## Set to confirm when you try to exit IPython with an EOF (Control-D in Unix, +# Control-Z/Enter in Windows). By typing 'exit' or 'quit', you can force a +# direct exit without any confirmation. +c.TerminalInteractiveShell.confirm_exit = False + +## Options for displaying tab completions, 'column', 'multicolumn', and +# 'readlinelike'. These options are for `prompt_toolkit`, see `prompt_toolkit` +# documentation for more information. +#c.TerminalInteractiveShell.display_completions = 'multicolumn' + +## Shortcut style to use at the prompt. 'vi' or 'emacs'. +#c.TerminalInteractiveShell.editing_mode = 'emacs' + +## Set the editor used by IPython (default to $EDITOR/vi/notepad). +#c.TerminalInteractiveShell.editor = 'nvim' + +## Allows to enable/disable the prompt toolkit history search +#c.TerminalInteractiveShell.enable_history_search = True + +## Enable vi (v) or Emacs (C-X C-E) shortcuts to open an external editor. This is +# in addition to the F2 binding, which is always enabled. +c.TerminalInteractiveShell.extra_open_editor_shortcuts = True + +## Provide an alternative handler to be called when the user presses Return. This +# is an advanced option intended for debugging, which may be changed or removed +# in later releases. +#c.TerminalInteractiveShell.handle_return = None + +## Highlight matching brackets. +#c.TerminalInteractiveShell.highlight_matching_brackets = True + +## The name or class of a Pygments style to use for syntax highlighting. To see +# available styles, run `pygmentize -L styles`. +#c.TerminalInteractiveShell.highlighting_style = traitlets.Undefined + +## Override highlighting format for specific tokens +#c.TerminalInteractiveShell.highlighting_style_overrides = {} + +## +#c.TerminalInteractiveShell.mime_renderers = {} + +## Enable mouse support in the prompt (Note: prevents selecting text with the +# mouse) +#c.TerminalInteractiveShell.mouse_support = False + +## Display the current vi mode (when using vi editing mode). +#c.TerminalInteractiveShell.prompt_includes_vi_mode = True + +## Class used to generate Prompt token for prompt_toolkit +#c.TerminalInteractiveShell.prompts_class = 'IPython.terminal.prompts.Prompts' + +## Use `raw_input` for the REPL, without completion and prompt colors. +# +# Useful when controlling IPython as a subprocess, and piping STDIN/OUT/ERR. +# Known usage are: IPython own testing machinery, and emacs inferior-shell +# integration through elpy. +# +# This mode default to `True` if the `IPY_TEST_SIMPLE_PROMPT` environment +# variable is set, or the current terminal is not a tty. +#c.TerminalInteractiveShell.simple_prompt = False + +## Number of line at the bottom of the screen to reserve for the completion menu +#c.TerminalInteractiveShell.space_for_menu = 6 + +## Automatically set the terminal title +#c.TerminalInteractiveShell.term_title = True + +## Customize the terminal title format. This is a python format string. +# Available substitutions are: {cwd}. +#c.TerminalInteractiveShell.term_title_format = 'IPython: {cwd}' + +## Use 24bit colors instead of 256 colors in prompt highlighting. If your +# terminal supports true color, the following command should print 'TRUECOLOR' +# in orange: printf "\x1b[38;2;255;100;0mTRUECOLOR\x1b[0m\n" +#c.TerminalInteractiveShell.true_color = False + +#------------------------------------------------------------------------------ +# HistoryAccessor(HistoryAccessorBase) configuration +#------------------------------------------------------------------------------ + +## Access the history database without adding to it. +# +# This is intended for use by standalone history tools. IPython shells use +# HistoryManager, below, which is a subclass of this. + +## Options for configuring the SQLite connection +# +# These options are passed as keyword args to sqlite3.connect when establishing +# database connections. +#c.HistoryAccessor.connection_options = {} + +## enable the SQLite history +# +# set enabled=False to disable the SQLite history, in which case there will be +# no stored history, no SQLite connection, and no background saving thread. +# This may be necessary in some threaded environments where IPython is embedded. +#c.HistoryAccessor.enabled = True + +## Path to file to use for SQLite history database. +# +# By default, IPython will put the history database in the IPython profile +# directory. If you would rather share one history among profiles, you can set +# this value in each, so that they are consistent. +# +# Due to an issue with fcntl, SQLite is known to misbehave on some NFS mounts. +# If you see IPython hanging, try setting this to something on a local disk, +# e.g:: +# +# ipython --HistoryManager.hist_file=/tmp/ipython_hist.sqlite +# +# you can also use the specific value `:memory:` (including the colon at both +# end but not the back ticks), to avoid creating an history file. +#c.HistoryAccessor.hist_file = '' + +#------------------------------------------------------------------------------ +# HistoryManager(HistoryAccessor) configuration +#------------------------------------------------------------------------------ + +## A class to organize all history-related functionality in one place. + +## Write to database every x commands (higher values save disk access & power). +# Values of 1 or less effectively disable caching. +#c.HistoryManager.db_cache_size = 0 + +## Should the history database include output? (default: no) +#c.HistoryManager.db_log_output = False + +#------------------------------------------------------------------------------ +# ProfileDir(LoggingConfigurable) configuration +#------------------------------------------------------------------------------ + +## An object to manage the profile directory and its resources. +# +# The profile directory is used by all IPython applications, to manage +# configuration, logging and security. +# +# This object knows how to find, create and manage these directories. This +# should be used by any code that wants to handle profiles. + +## Set the profile location directly. This overrides the logic used by the +# `profile` option. +#c.ProfileDir.location = '' + +#------------------------------------------------------------------------------ +# BaseFormatter(Configurable) configuration +#------------------------------------------------------------------------------ + +## A base formatter class that is configurable. +# +# This formatter should usually be used as the base class of all formatters. It +# is a traited :class:`Configurable` class and includes an extensible API for +# users to determine how their objects are formatted. The following logic is +# used to find a function to format an given object. +# +# 1. The object is introspected to see if it has a method with the name +# :attr:`print_method`. If is does, that object is passed to that method +# for formatting. +# 2. If no print method is found, three internal dictionaries are consulted +# to find print method: :attr:`singleton_printers`, :attr:`type_printers` +# and :attr:`deferred_printers`. +# +# Users should use these dictionaries to register functions that will be used to +# compute the format data for their objects (if those objects don't have the +# special print methods). The easiest way of using these dictionaries is through +# the :meth:`for_type` and :meth:`for_type_by_name` methods. +# +# If no function/callable is found to compute the format data, ``None`` is +# returned and this format type is not used. + +## +#c.BaseFormatter.deferred_printers = {} + +## +#c.BaseFormatter.enabled = True + +## +#c.BaseFormatter.singleton_printers = {} + +## +#c.BaseFormatter.type_printers = {} + +#------------------------------------------------------------------------------ +# PlainTextFormatter(BaseFormatter) configuration +#------------------------------------------------------------------------------ + +## The default pretty-printer. +# +# This uses :mod:`IPython.lib.pretty` to compute the format data of the object. +# If the object cannot be pretty printed, :func:`repr` is used. See the +# documentation of :mod:`IPython.lib.pretty` for details on how to write pretty +# printers. Here is a simple example:: +# +# def dtype_pprinter(obj, p, cycle): +# if cycle: +# return p.text('dtype(...)') +# if hasattr(obj, 'fields'): +# if obj.fields is None: +# p.text(repr(obj)) +# else: +# p.begin_group(7, 'dtype([') +# for i, field in enumerate(obj.descr): +# if i > 0: +# p.text(',') +# p.breakable() +# p.pretty(field) +# p.end_group(7, '])') + +## +#c.PlainTextFormatter.float_precision = '' + +## Truncate large collections (lists, dicts, tuples, sets) to this size. +# +# Set to 0 to disable truncation. +#c.PlainTextFormatter.max_seq_length = 1000 + +## +#c.PlainTextFormatter.max_width = 79 + +## +#c.PlainTextFormatter.newline = '\n' + +## +#c.PlainTextFormatter.pprint = True + +## +#c.PlainTextFormatter.verbose = False + +#------------------------------------------------------------------------------ +# Completer(Configurable) configuration +#------------------------------------------------------------------------------ + +## Enable unicode completions, e.g. \alpha . Includes completion of latex +# commands, unicode names, and expanding unicode characters back to latex +# commands. +#c.Completer.backslash_combining_completions = True + +## Enable debug for the Completer. Mostly print extra information for +# experimental jedi integration. +#c.Completer.debug = False + +## Activate greedy completion PENDING DEPRECTION. this is now mostly taken care +# of with Jedi. +# +# This will enable completion on elements of lists, results of function calls, +# etc., but can be unsafe because the code is actually evaluated on TAB. +#c.Completer.greedy = False + +## Experimental: restrict time (in milliseconds) during which Jedi can compute +# types. Set to 0 to stop computing types. Non-zero value lower than 100ms may +# hurt performance by preventing jedi to build its cache. +#c.Completer.jedi_compute_type_timeout = 400 + +## Experimental: Use Jedi to generate autocompletions. Default to True if jedi is +# installed. +#c.Completer.use_jedi = True + +#------------------------------------------------------------------------------ +# IPCompleter(Completer) configuration +#------------------------------------------------------------------------------ + +## Extension of the completer class with IPython-specific features + +## DEPRECATED as of version 5.0. +# +# Instruct the completer to use __all__ for the completion +# +# Specifically, when completing on ``object.``. +# +# When True: only those names in obj.__all__ will be included. +# +# When False [default]: the __all__ attribute is ignored +#c.IPCompleter.limit_to__all__ = False + +## Whether to merge completion results into a single list +# +# If False, only the completion results from the first non-empty completer will +# be returned. +#c.IPCompleter.merge_completions = True + +## Instruct the completer to omit private method names +# +# Specifically, when completing on ``object.``. +# +# When 2 [default]: all names that start with '_' will be excluded. +# +# When 1: all 'magic' names (``__foo__``) will be excluded. +# +# When 0: nothing will be excluded. +#c.IPCompleter.omit__names = 2 + +#------------------------------------------------------------------------------ +# ScriptMagics(Magics) configuration +#------------------------------------------------------------------------------ + +## Magics for talking to scripts +# +# This defines a base `%%script` cell magic for running a cell with a program in +# a subprocess, and registers a few top-level magics that call %%script with +# common interpreters. + +## Extra script cell magics to define +# +# This generates simple wrappers of `%%script foo` as `%%foo`. +# +# If you want to add script magics that aren't on your path, specify them in +# script_paths +#c.ScriptMagics.script_magics = [] + +## Dict mapping short 'ruby' names to full paths, such as '/opt/secret/bin/ruby' +# +# Only necessary for items in script_magics where the default path will not find +# the right interpreter. +#c.ScriptMagics.script_paths = {} + +#------------------------------------------------------------------------------ +# LoggingMagics(Magics) configuration +#------------------------------------------------------------------------------ + +## Magics related to all logging machinery. + +## Suppress output of log state when logging is enabled +#c.LoggingMagics.quiet = False + +#------------------------------------------------------------------------------ +# StoreMagics(Magics) configuration +#------------------------------------------------------------------------------ + +## Lightweight persistence for python variables. +# +# Provides the %store magic. + +## If True, any %store-d variables will be automatically restored when IPython +# starts. +#c.StoreMagics.autorestore = False diff --git a/home/.config/lf/lfrc b/home/.config/lf/lfrc new file mode 100644 index 0000000..6094d16 --- /dev/null +++ b/home/.config/lf/lfrc @@ -0,0 +1,113 @@ +# interpreter for shell commands (needs to be POSIX compatible) +set shell bash + +# set '-eu' options for shell commands +# These options are used to have safer shell commands. Option '-e' is used to +# exit on error and option '-u' is used to give error for unset variables. +# Option '-f' disables pathname expansion which can be useful when $f, $fs, and +# $fx variables contain names with '*' or '?' characters. However, this option +# is used selectively within individual commands as it can be limiting at +# times. +set shellopts '-eu' + +# set internal field separator (IFS) to "\n" for shell commands +# This is useful to automatically split file names in $fs and $fx properly +# since default file separator used in these variables (i.e. 'filesep' option) +# is newline. You need to consider the values of these options and create your +# commands accordingly. +set ifs "\n" + +# leave some space at the top and the bottom of the screen +set scrolloff 10 + +# use enter for shell commands +map shell + +# execute current file (must be executable) +map x $$f +map X !$f + +# dedicated keys for file opener actions +map o &linkhandler "$f" + +# define a custom 'open' command +# This command is called when current file is not a directory. You may want to +# use either file extensions and/or mime types here. Below uses an editor for +# text files and a file opener for the rest. +cmd open &linkhandler "$f" + +# define a custom 'rename' command without prompt for overwrite +cmd rename %[ -e $1 ] && printf "file exists" || mv $f $1 +map r push :rename + +# make sure trash folder exists +# %mkdir -p ~/.trash + +# move current file or selected files to trash folder +# (also see 'man mv' for backup/overwrite options) +# cmd trash %set -f; mv $fx ~/.trash + +# define a custom 'delete' command +# cmd delete ${{ +# set -f +# printf "$fx\n" +# printf "delete?[y/n]" +# read ans +# [ $ans = "y" ] && rm -rf $fx +# }} + +# use '' key for either 'trash' or 'delete' command +# map trash +map D delete + +# extract the current file with the right command +# (xkcd link: https://xkcd.com/1168/) +cmd extract ${{ + set -f + case $f in + *.tar.bz|*.tar.bz2|*.tbz|*.tbz2) tar xjvf $f;; + *.tar.gz|*.tgz) tar xzvf $f;; + *.tar.xz|*.txz) tar xJvf $f;; + *.zip) unzip $f;; + *.rar) unrar x $f;; + *.7z) 7z x $f;; + esac +}} + +# compress current file or selected files with tar and gunzip +cmd tar ${{ + set -f + mkdir $1 + cp -r $fx $1 + tar czf $1.tar.gz $1 + rm -rf $1 +}} + +# compress current file or selected files with zip +cmd zip ${{ + set -f + mkdir $1 + cp -r $fx $1 + zip -r $1.zip $1 + rm -rf $1 +}} + +map f $lf -remote "send $id select '$(fzf)'" + +cmd recol &{{ + w=$(tput cols) + if [ $w -le 80 ]; then + lf -remote "send $id set ratios 1:2" + elif [ $w -le 160 ]; then + lf -remote "send $id set ratios 1:2:3" + else + lf -remote "send $id set ratios 1:2:3:5" + fi +}} + +recol + +map H :set hidden true +map S $$SHELL + +set period 1 diff --git a/home/.config/lsd/config.yaml b/home/.config/lsd/config.yaml new file mode 100644 index 0000000..4862521 --- /dev/null +++ b/home/.config/lsd/config.yaml @@ -0,0 +1,19 @@ +# == Blocks == +# This specifies the columns and their order when using the long and the tree +# layout. +# Possible values: permission, user, group, size, size_value, date, name, inode +blocks: + - permission + - user + - size + - date + - name + +# == Icons == +icons: + # When to use icons. + # When "classic" is set, this is set to "never". + # Possible values: always, auto, never + when: never + +layout: oneline diff --git a/home/.config/mimeapps.list b/home/.config/mimeapps.list new file mode 100644 index 0000000..f3290b8 --- /dev/null +++ b/home/.config/mimeapps.list @@ -0,0 +1,100 @@ +[Default Applications] +audio/x-vorbis+ogg=mpv.desktop +audio/aac=mpv.desktop +audio/x-aac=mpv.desktop +audio/m4a=mpv.desktop +audio/x-m4a=mpv.desktop +audio/mp1=mpv.desktop +audio/x-mp1=mpv.desktop +audio/mp2=mpv.desktop +audio/x-mp2=mpv.desktop +audio/mp3=mpv.desktop +audio/x-mp3=mpv.desktop +audio/mpeg=mpv.desktop +audio/x-mpeg=mpv.desktop +audio/mpegurl=mpv.desktop +audio/x-mpegurl=mpv.desktop +audio/mpg=mpv.desktop +audio/x-mpg=mpv.desktop +audio/rn-mpeg=mpv.desktop +audio/ogg=mpv.desktop +audio/scpls=mpv.desktop +audio/x-scpls=mpv.desktop +audio/vnd.rn-realaudio=mpv.desktop +audio/wav=mpv.desktop +audio/x-pn-windows-pcm=mpv.desktop +audio/x-realaudio=mpv.desktop +audio/x-pn-realaudio=mpv.desktop +audio/x-ms-wma=mpv.desktop +audio/x-pls=mpv.desktop +audio/x-wav=mpv.desktop +audio/x-flac=mpv.desktop +audio/x-shorten=mpv.desktop +audio/x-ape=mpv.desktop +audio/x-wavpack=mpv.desktop +audio/x-tta=mpv.desktop +audio/AMR=mpv.desktop +audio/ac3=mpv.desktop +audio/flac=mpv.desktop +audio/mp4=mpv.desktop +video/x-ogm+ogg=mpv.desktop +video/mpeg=mpv.desktop +video/x-mpeg=mpv.desktop +video/x-mpeg2=mpv.desktop +video/mp4=mpv.desktop +video/msvideo=mpv.desktop +video/x-msvideo=mpv.desktop +video/ogg=mpv.desktop +video/quicktime=mpv.desktop +video/vnd.rn-realvideo=mpv.desktop +video/x-ms-afs=mpv.desktop +video/x-ms-asf=mpv.desktop +video/x-ms-wmv=mpv.desktop +video/x-ms-wmx=mpv.desktop +video/x-ms-wvxvideo=mpv.desktop +video/x-avi=mpv.desktop +video/x-fli=mpv.desktop +video/x-flv=mpv.desktop +video/x-theora=mpv.desktop +video/x-matroska=mpv.desktop +video/webm=mpv.desktop +video/mp2t=mpv.desktop +image/x-nikon-nef=sxiv.desktop +image/jpeg=sxiv.desktop +image/png=sxiv.desktop +image/gif=mpv.desktop +text/markdown=nvim.desktop +text/plain=nvim.desktop +text/x-python=nvim.desktop +text/x-chdr=nvim.desktop +text/x-tex=nvim.desktop +application/x-shellscript=nvim.desktop +application/x-bittorrent=transmission.desktop +application/pdf=org.pwmt.zathura-pdf-mupdf.desktop +application/postscript=zathura-pdf-poppler.desktop;org.pwmt.zathura-pdf-mupdf.desktop +application/rss+xml=rss.desktop +x-scheme-handler/magnet=transmission.desktop +x-scheme-handler/mailto=mail.desktop +application/msword-template=xdot.desktop +x-scheme-handler/http=librewolf.desktop +x-scheme-handler/https=librewolf.desktop +x-scheme-handler/chrome=librewolf.desktop +text/html=librewolf.desktop +application/x-extension-htm=librewolf.desktop +application/x-extension-html=librewolf.desktop +application/x-extension-shtml=librewolf.desktop +application/xhtml+xml=librewolf.desktop +application/x-extension-xhtml=librewolf.desktop +application/x-extension-xht=librewolf.desktop + +[Added Associations] +x-scheme-handler/http=librewolf.desktop; +x-scheme-handler/https=librewolf.desktop; +x-scheme-handler/chrome=librewolf.desktop; +text/html=librewolf.desktop; +application/x-extension-htm=librewolf.desktop; +application/x-extension-html=librewolf.desktop; +application/x-extension-shtml=librewolf.desktop; +application/xhtml+xml=librewolf.desktop; +application/x-extension-xhtml=librewolf.desktop; +application/x-extension-xht=librewolf.desktop; diff --git a/home/.config/mpv/input.conf b/home/.config/mpv/input.conf new file mode 100644 index 0000000..679c4a2 --- /dev/null +++ b/home/.config/mpv/input.conf @@ -0,0 +1,96 @@ +# mpv keybindings +# +# Location of user-defined bindings: ~/.config/mpv/input.conf +# +# Lines starting with # are comments. Use SHARP to assign the # key. +# Copy this file and uncomment and edit the bindings you want to change. +# +# List of commands and further details: DOCS/man/input.rst +# List of special keys: --input-keylist +# Keybindings testing mode: mpv --input-test --force-window --idle +# +# Use 'ignore' to unbind a key fully (e.g. 'ctrl+a ignore'). +# +# Strings need to be quoted and escaped: +# KEY show-text "This is a single backslash: \\ and a quote: \" !" +# +# You can use modifier-key combinations like Shift+Left or Ctrl+Alt+x with +# the modifiers Shift, Ctrl, Alt and Meta (may not work on the terminal). +# +# The default keybindings are hardcoded into the mpv binary. +# You can disable them completely with: --no-input-default-bindings + +# Mouse wheels, touchpad or other input devices that have axes +# if the input devices supports precise scrolling it will also scale the +# numeric value accordingly +WHEEL_UP ignore +WHEEL_DOWN ignore +WHEEL_LEFT ignore +WHEEL_RIGHT ignore + +## Seek units are in seconds, but note that these are limited by keyframes +RIGHT seek 5 +LEFT seek -5 +UP seek 60 +DOWN seek -60 +# Do smaller, always exact (non-keyframe-limited), seeks with shift. +# Don't show them on the OSD (no-osd). +Shift+RIGHT no-osd seek 1 exact +Shift+LEFT no-osd seek -1 exact +Shift+UP no-osd seek 5 exact +Shift+DOWN no-osd seek -5 exact +# Skip to previous/next subtitle (subject to some restrictions; see manpage) +Ctrl+LEFT no-osd sub-seek -1 +Ctrl+RIGHT no-osd sub-seek 1 +# Adjust timing to previous/next subtitle +#Ctrl+Shift+LEFT sub-step -1 +#Ctrl+Shift+RIGHT sub-step 1 +[ multiply speed 1/1.1 # scale playback speed +] multiply speed 1.1 +{ multiply speed 0.5 +} multiply speed 2.0 +BS set speed 1.0 # reset speed to normal +Shift+BS revert-seek # undo previous (or marked) seek +q quit +Q quit-watch-later +ESC set fullscreen no +f cycle fullscreen # toggle fullscreen +p cycle pause # toggle pause/playback mode +> frame-step # advance one frame and pause +< frame-back-step # go back by one frame and pause +SPACE cycle pause +O no-osd cycle-values osd-level 3 1 # cycle through OSD mode +o show-progress +P show-progress +i script-binding stats/display-stats +I script-binding stats/display-stats-toggle +` script-binding console/enable +. script-binding console/enable +# z add sub-delay -0.1 # subtract 100 ms delay from subs +# Z add sub-delay +0.1 # add +#ctrl++ add audio-delay 0.100 # this changes audio/video sync +#ctrl+- add audio-delay -0.100 +9 add volume -2 +0 add volume 2 +m cycle mute +v cycle sub-visibility +s cycle sub # cycle through subtitles +S cycle sub down # ...backwards +PLAY cycle pause +PAUSE cycle pause +PLAYPAUSE cycle pause +PLAYONLY set pause no +PAUSEONLY set pause yes +STOP quit +FORWARD seek 60 +REWIND seek -60 +NEXT playlist-next +PREV playlist-prev +VOLUME_UP add volume 2 +VOLUME_DOWN add volume -2 +MUTE cycle mute +CLOSE_WIN quit +CLOSE_WIN {encode} quit 4 +L cycle-values loop-file "inf" "no" # toggle infinite looping +ctrl+c quit 4 +DEL script-binding osc/visibility # cycle OSC display diff --git a/home/.config/mpv/mpv.conf b/home/.config/mpv/mpv.conf new file mode 100644 index 0000000..0113894 --- /dev/null +++ b/home/.config/mpv/mpv.conf @@ -0,0 +1,111 @@ +# vim: syntax=config + + +########### +# General # +########### + +input-ipc-server=/tmp/mpvsocket # listen for IPC on this socket +load-stats-overlay=no # use local stats.lua +save-position-on-quit # handled by a script + +# no-border # no window title bar +msg-module # prepend module name to log messages +msg-color # color log messages on terminal +term-osd-bar # display a progress bar on the terminal +use-filedir-conf # look for additional config files in the directory of the opened file +#pause # no autoplay +keep-open # keep the player open when a file's end is reached +cursor-autohide=100 # autohide the curser after 1s +prefetch-playlist=yes +force-seekable=yes + +hls-bitrate=max # use max quality for HLS streams +# not interested in getting videos with a resolution higher than 1080p +ytdl-format=bv*[height<=1080]+ba/b[height<=1080] +no-input-default-bindings +script-opts=ytdl_hook-ytdl_path=yt-dlp + +[default] + +#########c +# Cache # +######### + +# Configure the cache to be really big (multiple GBs) +# We have a lot of memory, so why not use it for something + +cache=yes +# cache-default=1000000 # size in KB +# cache-backbuffer=250000 # size in KB +demuxer-max-bytes=1147483647 # ~1 GiB in bytes + +############# +# Subtitles # +############# + +sub-auto=fuzzy # external subs don't have to match the file name exactly to autoload +sub-file-paths-append=ass # search for external subs in these relative subdirectories +sub-file-paths-append=srt +sub-file-paths-append=sub +sub-file-paths-append=subs +sub-file-paths-append=subtitles +sub-file-paths-append=subtitle +sub-file-paths-append=Ass # search for external subs in these relative subdirectories +sub-file-paths-append=ASS # search for external subs in these relative subdirectories +sub-file-paths-append=Srt +sub-file-paths-append=SRT +sub-file-paths-append=Sub +sub-file-paths-append=SUB +sub-file-paths-append=Subs +sub-file-paths-append=SUBS +sub-file-paths-append=Subtitles +sub-file-paths-append=SUBTITLES +sub-file-paths-append=Subtitle +sub-file-paths-append=SUBTITLE + + +#demuxer-mkv-subtitle-preroll # try to correctly show embedded subs when seeking +#embeddedfonts=yes # use embedded fonts for SSA/ASS subs +#sub-fix-timing=no # do not try to fix gaps (which might make it worse in some cases) +#sub-ass-force-style=Kerning=yes # allows you to override style parameters of ASS scripts +#sub-use-margins +#sub-ass-force-margins + +############# +# Languages # +############# + +slang=en,eng # automatically select these subtitles (decreasing priority) +# lang=en,eng # automatically select these audio tracks (decreasing priority) + + +######### +# Audio # +######### + +audio-file-auto=fuzzy # external audio doesn't has to match the file name exactly to autoload +audio-pitch-correction=yes # automatically insert scaletempo when playing with higher speed +volume-max=200 # maximum volume in %, everything above 100 results in amplification +volume=100 # default volume, 100 = unchanged + + +################ +# Video Output # +################ + +hwdec=auto-safe + +[no-spoiler] +osd-level=0 +no-osc +no-osd-bar +no-term-osd-bar +quiet +sub-auto=no + +[hq] +profile=gpu-hq +video-sync=display-resample +interpolation +tscale=oversample diff --git a/home/.config/mpv/scripts/webtorrent-hook.lua b/home/.config/mpv/scripts/webtorrent-hook.lua new file mode 100644 index 0000000..80d991f --- /dev/null +++ b/home/.config/mpv/scripts/webtorrent-hook.lua @@ -0,0 +1,138 @@ +-- TODO prefetch if next in playlist? +-- TODO handle torrent with multiple video files (if webtorrent can print json) +-- - don't close kill webtorrent while still videos unplayed? or in playlist? +-- - store titles/info when starting webtorrent and check stream-open-filename +-- for any item in playlist to see if it matches stored entry + +local settings = { + close_webtorrent = true, + remove_files = true, + download_directory = "/tmp/webtorrent", + webtorrent_flags = "", + webtorrent_verbosity = "speed" +} + +(require "mp.options").read_options(settings, "webtorrent-hook") + +local open_videos = {} + +-- http://lua-users.org/wiki/StringRecipes +local function ends_with(str, ending) + return ending == "" or str:sub(-#ending) == ending +end + +-- https://stackoverflow.com/questions/132397/get-back-the-output-of-os-execute-in-lua +function os.capture(cmd, decolorize, raw) + if decolorize then + -- https://github.com/webtorrent/webtorrent-cli/issues/132 + -- TODO webtorrent should have a way to just print json information with + -- no colors + -- https://stackoverflow.com/questions/19296667/remove-ansi-color-codes-from-a-text-file-using-bash/30938702#30938702 + cmd = cmd .. " | sed -r 's/\\x1B\\[(([0-9]{1,2})?(;)?([0-9]{1,2})?)?[m,K,H,f,J]//g'" + end + local f = assert(io.popen(cmd, 'r')) + local s = assert(f:read('*a')) + f:close() + if raw then return s end + s = string.gsub(s, '^%s+', '') + s = string.gsub(s, '%s+$', '') + -- s = string.gsub(s, '[\n\r]+', ' ') + return s +end + +function read_file(file) + local fh = assert(io.open(file, "rb")) + local contents = fh:read("*all") + fh:close() + return contents +end + +function play_torrent() + local url = mp.get_property("stream-open-filename") + if (url:find("magnet:") == 1 or url:find("peerflix://") == 1 + or url:find("webtorrent://") == 1 or ends_with(url, "torrent")) then + if url:find("webtorrent://") == 1 then + url = url:sub(14) + end + if url:find("peerflix://") == 1 then + url = url:sub(12) + end + + os.execute("mkdir -p " .. settings.download_directory) + -- don't reuse files (so multiple mpvs works) + local output_file = settings.download_directory + .. "/webtorrent-output-" .. mp.get_time() .. ".log" + -- --keep-seeding is to prevent webtorrent from quitting once the download + -- is done + local webtorrent_command = "webtorrent " + .. settings.webtorrent_flags + .. " --out '" .. settings.download_directory .. "' --keep-seeding \"" + .. url .. "\" > " .. output_file .. " 2>&1 & echo $!" + mp.msg.info("Starting webtorrent server") + mp.msg.info(webtorrent_command) + local pid = os.capture(webtorrent_command) + mp.msg.info("Waiting for webtorrent server") + + local url_command = "tail -f " .. output_file + .. " | awk '/Server running at:/ {print $4; exit}'" + local url = os.capture(url_command, true) + mp.msg.info("Webtorrent server is up") + + local title_command = "awk '/(Seeding|Downloading): / " + .. "{gsub(/(Seeding|Downloading): /, \"\"); print; exit}' " + .. output_file + local title = os.capture(title_command, true) + mp.msg.info("Setting media title to: " .. title) + mp.set_property("force-media-title", title) + + local path + if title then + path = settings.download_directory .. "/\"" .. title .. "\"" + end + open_videos[url] = {title=title,path=path,pid=pid} + + mp.set_property("stream-open-filename", url) + + if settings.webtorrent_verbosity == "speed" then + local printer_pid + local printer_pid_file = settings.download_directory + .. "/webtorrent-printer-" .. mp.get_time() .. ".pid" + os.execute("tail -f " .. output_file + .. " | awk '/Speed:/' ORS='\r' & echo -n $! > " + .. printer_pid_file) + printer_pid = read_file(printer_pid_file) + mp.register_event("file-loaded", + function() + os.execute("kill " .. printer_pid) + end + ) + end + end +end + +function webtorrent_cleanup() + local url = mp.get_property("stream-open-filename") + if settings.close_webtorrent and open_videos[url] then + local title = open_videos[url].title + local path = open_videos[url].path + local pid = open_videos[url].pid + + if pid then + mp.msg.info("Closing webtorrent for " .. title .. " with pid " .. pid) + os.execute("kill " .. pid) + end + + if settings.remove_files then + if path then + mp.msg.info("Removing media file for " .. title .. " with path " .. path) + os.execute("rm -r " .. path) + end + end + + open_videos[url] = {} + end +end + +mp.add_hook("on_load", 50, play_torrent) + +mp.add_hook("on_unload", 10, webtorrent_cleanup) diff --git a/home/.config/neofetch/config.conf b/home/.config/neofetch/config.conf new file mode 100644 index 0000000..6b39dc8 --- /dev/null +++ b/home/.config/neofetch/config.conf @@ -0,0 +1,764 @@ +# See this wiki page for more info: +# https://github.com/dylanaraps/neofetch/wiki/Customizing-Info +print_info() { + info title + info underline + + info "OS" distro + info "Host" model + info "Kernel" kernel + info "Uptime" uptime + info "Packages" packages + info "Shell" shell + info "Resolution" resolution + info "DE" de + info "WM" wm + info "WM Theme" wm_theme + info "Theme" theme + info "Icons" icons + info "Terminal" term + info "Terminal Font" term_font + info "CPU" cpu + info "GPU" gpu + info "Memory" memory + + # info "GPU Driver" gpu_driver # Linux/macOS only + info "CPU Usage" cpu_usage + info "Disk" disk + info "Battery" battery + info "Font" font + # info "Song" song + # [[ "$player" ]] && prin "Music Player" "$player" + # info "Local IP" local_ip + # info "Public IP" public_ip + # info "Users" users + info "Locale" locale # This only works on glibc systems. + + info cols +} + + +# Kernel + + +# Shorten the output of the kernel function. +# +# Default: 'on' +# Values: 'on', 'off' +# Flag: --kernel_shorthand +# Supports: Everything except *BSDs (except PacBSD and PC-BSD) +# +# Example: +# on: '4.8.9-1-ARCH' +# off: 'Linux 4.8.9-1-ARCH' +kernel_shorthand="off" + + +# Distro + + +# Shorten the output of the distro function +# +# Default: 'off' +# Values: 'on', 'tiny', 'off' +# Flag: --distro_shorthand +# Supports: Everything except Windows and Haiku +distro_shorthand="off" + +# Show/Hide OS Architecture. +# Show 'x86_64', 'x86' and etc in 'Distro:' output. +# +# Default: 'on' +# Values: 'on', 'off' +# Flag: --os_arch +# +# Example: +# on: 'Arch Linux x86_64' +# off: 'Arch Linux' +os_arch="on" + + +# Uptime + + +# Shorten the output of the uptime function +# +# Default: 'on' +# Values: 'on', 'tiny', 'off' +# Flag: --uptime_shorthand +# +# Example: +# on: '2 days, 10 hours, 3 mins' +# tiny: '2d 10h 3m' +# off: '2 days, 10 hours, 3 minutes' +uptime_shorthand="tiny" + + +# Memory + + +# Show memory pecentage in output. +# +# Default: 'off' +# Values: 'on', 'off' +# Flag: --memory_percent +# +# Example: +# on: '1801MiB / 7881MiB (22%)' +# off: '1801MiB / 7881MiB' +memory_percent="on" + + +# Packages + + +# Show/Hide Package Manager names. +# +# Default: 'tiny' +# Values: 'on', 'tiny' 'off' +# Flag: --package_managers +# +# Example: +# on: '998 (pacman), 8 (flatpak), 4 (snap)' +# tiny: '908 (pacman, flatpak, snap)' +# off: '908' +package_managers="on" + + +# Shell + + +# Show the path to $SHELL +# +# Default: 'off' +# Values: 'on', 'off' +# Flag: --shell_path +# +# Example: +# on: '/bin/bash' +# off: 'bash' +shell_path="on" + +# Show $SHELL version +# +# Default: 'on' +# Values: 'on', 'off' +# Flag: --shell_version +# +# Example: +# on: 'bash 4.4.5' +# off: 'bash' +shell_version="on" + + +# CPU + + +# CPU speed type +# +# Default: 'bios_limit' +# Values: 'scaling_cur_freq', 'scaling_min_freq', 'scaling_max_freq', 'bios_limit'. +# Flag: --speed_type +# Supports: Linux with 'cpufreq' +# NOTE: Any file in '/sys/devices/system/cpu/cpu0/cpufreq' can be used as a value. +speed_type="bios_limit" + +# CPU speed shorthand +# +# Default: 'off' +# Values: 'on', 'off'. +# Flag: --speed_shorthand +# NOTE: This flag is not supported in systems with CPU speed less than 1 GHz +# +# Example: +# on: 'i7-6500U (4) @ 3.1GHz' +# off: 'i7-6500U (4) @ 3.100GHz' +speed_shorthand="off" + +# Enable/Disable CPU brand in output. +# +# Default: 'on' +# Values: 'on', 'off' +# Flag: --cpu_brand +# +# Example: +# on: 'Intel i7-6500U' +# off: 'i7-6500U (4)' +cpu_brand="on" + +# CPU Speed +# Hide/Show CPU speed. +# +# Default: 'on' +# Values: 'on', 'off' +# Flag: --cpu_speed +# +# Example: +# on: 'Intel i7-6500U (4) @ 3.1GHz' +# off: 'Intel i7-6500U (4)' +cpu_speed="on" + +# CPU Cores +# Display CPU cores in output +# +# Default: 'logical' +# Values: 'logical', 'physical', 'off' +# Flag: --cpu_cores +# Support: 'physical' doesn't work on BSD. +# +# Example: +# logical: 'Intel i7-6500U (4) @ 3.1GHz' (All virtual cores) +# physical: 'Intel i7-6500U (2) @ 3.1GHz' (All physical cores) +# off: 'Intel i7-6500U @ 3.1GHz' +cpu_cores="logical" + +# CPU Temperature +# Hide/Show CPU temperature. +# Note the temperature is added to the regular CPU function. +# +# Default: 'off' +# Values: 'C', 'F', 'off' +# Flag: --cpu_temp +# Supports: Linux, BSD +# NOTE: For FreeBSD and NetBSD-based systems, you'll need to enable +# coretemp kernel module. This only supports newer Intel processors. +# +# Example: +# C: 'Intel i7-6500U (4) @ 3.1GHz [27.2ยฐC]' +# F: 'Intel i7-6500U (4) @ 3.1GHz [82.0ยฐF]' +# off: 'Intel i7-6500U (4) @ 3.1GHz' +cpu_temp="C" + + +# GPU + + +# Enable/Disable GPU Brand +# +# Default: 'on' +# Values: 'on', 'off' +# Flag: --gpu_brand +# +# Example: +# on: 'AMD HD 7950' +# off: 'HD 7950' +gpu_brand="on" + +# Which GPU to display +# +# Default: 'all' +# Values: 'all', 'dedicated', 'integrated' +# Flag: --gpu_type +# Supports: Linux +# +# Example: +# all: +# GPU1: AMD HD 7950 +# GPU2: Intel Integrated Graphics +# +# dedicated: +# GPU1: AMD HD 7950 +# +# integrated: +# GPU1: Intel Integrated Graphics +gpu_type="all" + + +# Resolution + + +# Display refresh rate next to each monitor +# Default: 'off' +# Values: 'on', 'off' +# Flag: --refresh_rate +# Supports: Doesn't work on Windows. +# +# Example: +# on: '1920x1080 @ 60Hz' +# off: '1920x1080' +refresh_rate="on" + + +# Gtk Theme / Icons / Font + + +# Shorten output of GTK Theme / Icons / Font +# +# Default: 'off' +# Values: 'on', 'off' +# Flag: --gtk_shorthand +# +# Example: +# on: 'Numix, Adwaita' +# off: 'Numix [GTK2], Adwaita [GTK3]' +gtk_shorthand="off" + + +# Enable/Disable gtk2 Theme / Icons / Font +# +# Default: 'on' +# Values: 'on', 'off' +# Flag: --gtk2 +# +# Example: +# on: 'Numix [GTK2], Adwaita [GTK3]' +# off: 'Adwaita [GTK3]' +gtk2="on" + +# Enable/Disable gtk3 Theme / Icons / Font +# +# Default: 'on' +# Values: 'on', 'off' +# Flag: --gtk3 +# +# Example: +# on: 'Numix [GTK2], Adwaita [GTK3]' +# off: 'Numix [GTK2]' +gtk3="on" + + +# IP Address + + +# Website to ping for the public IP +# +# Default: 'http://ident.me' +# Values: 'url' +# Flag: --ip_host +public_ip_host="http://ident.me" + +# Public IP timeout. +# +# Default: '2' +# Values: 'int' +# Flag: --ip_timeout +public_ip_timeout=2 + + +# Disk + + +# Which disks to display. +# The values can be any /dev/sdXX, mount point or directory. +# NOTE: By default we only show the disk info for '/'. +# +# Default: '/' +# Values: '/', '/dev/sdXX', '/path/to/drive'. +# Flag: --disk_show +# +# Example: +# disk_show=('/' '/dev/sdb1'): +# 'Disk (/): 74G / 118G (66%)' +# 'Disk (/mnt/Videos): 823G / 893G (93%)' +# +# disk_show=('/'): +# 'Disk (/): 74G / 118G (66%)' +# +disk_show=('/') + +# Disk subtitle. +# What to append to the Disk subtitle. +# +# Default: 'mount' +# Values: 'mount', 'name', 'dir' +# Flag: --disk_subtitle +# +# Example: +# name: 'Disk (/dev/sda1): 74G / 118G (66%)' +# 'Disk (/dev/sdb2): 74G / 118G (66%)' +# +# mount: 'Disk (/): 74G / 118G (66%)' +# 'Disk (/mnt/Local Disk): 74G / 118G (66%)' +# 'Disk (/mnt/Videos): 74G / 118G (66%)' +# +# dir: 'Disk (/): 74G / 118G (66%)' +# 'Disk (Local Disk): 74G / 118G (66%)' +# 'Disk (Videos): 74G / 118G (66%)' +disk_subtitle="mount" + + +# Song + + +# Manually specify a music player. +# +# Default: 'auto' +# Values: 'auto', 'player-name' +# Flag: --music_player +# +# Available values for 'player-name': +# +# amarok +# audacious +# banshee +# bluemindo +# clementine +# cmus +# deadbeef +# deepin-music +# dragon +# elisa +# exaile +# gnome-music +# gmusicbrowser +# gogglesmm +# guayadeque +# iTunes +# juk +# lollypop +# mocp +# mopidy +# mpd +# netease-cloud-music +# pogo +# pragha +# qmmp +# quodlibet +# rhythmbox +# sayonara +# smplayer +# spotify +# strawberry +# tomahawk +# vlc +# xmms2d +# xnoise +# yarock +music_player="auto" + +# Format to display song information. +# +# Default: '%artist% - %album% - %title%' +# Values: '%artist%', '%album%', '%title%' +# Flag: --song_format +# +# Example: +# default: 'Song: Jet - Get Born - Sgt Major' +song_format="%artist% - %album% - %title%" + +# Print the Artist, Album and Title on separate lines +# +# Default: 'off' +# Values: 'on', 'off' +# Flag: --song_shorthand +# +# Example: +# on: 'Artist: The Fratellis' +# 'Album: Costello Music' +# 'Song: Chelsea Dagger' +# +# off: 'Song: The Fratellis - Costello Music - Chelsea Dagger' +song_shorthand="off" + +# 'mpc' arguments (specify a host, password etc). +# +# Default: '' +# Example: mpc_args=(-h HOST -P PASSWORD) +mpc_args=() + + +# Text Colors + + +# Text Colors +# +# Default: 'distro' +# Values: 'distro', 'num' 'num' 'num' 'num' 'num' 'num' +# Flag: --colors +# +# Each number represents a different part of the text in +# this order: 'title', '@', 'underline', 'subtitle', 'colon', 'info' +# +# Example: +# colors=(distro) - Text is colored based on Distro colors. +# colors=(4 6 1 8 8 6) - Text is colored in the order above. +colors=(distro) + + +# Text Options + + +# Toggle bold text +# +# Default: 'on' +# Values: 'on', 'off' +# Flag: --bold +bold="on" + +# Enable/Disable Underline +# +# Default: 'on' +# Values: 'on', 'off' +# Flag: --underline +underline_enabled="on" + +# Underline character +# +# Default: '-' +# Values: 'string' +# Flag: --underline_char +underline_char="-" + + +# Info Separator +# Replace the default separator with the specified string. +# +# Default: ':' +# Flag: --separator +# +# Example: +# separator="->": 'Shell-> bash' +# separator=" =": 'WM = dwm' +separator=":" + + +# Color Blocks + + +# Color block range +# The range of colors to print. +# +# Default: '0', '15' +# Values: 'num' +# Flag: --block_range +# +# Example: +# +# Display colors 0-7 in the blocks. (8 colors) +# neofetch --block_range 0 7 +# +# Display colors 0-15 in the blocks. (16 colors) +# neofetch --block_range 0 15 +block_range=(0 15) + +# Toggle color blocks +# +# Default: 'on' +# Values: 'on', 'off' +# Flag: --color_blocks +color_blocks="on" + +# Color block width in spaces +# +# Default: '3' +# Values: 'num' +# Flag: --block_width +block_width=3 + +# Color block height in lines +# +# Default: '1' +# Values: 'num' +# Flag: --block_height +block_height=1 + + +# Progress Bars + + +# Bar characters +# +# Default: '-', '=' +# Values: 'string', 'string' +# Flag: --bar_char +# +# Example: +# neofetch --bar_char 'elapsed' 'total' +# neofetch --bar_char '-' '=' +bar_char_elapsed="-" +bar_char_total="=" + +# Toggle Bar border +# +# Default: 'on' +# Values: 'on', 'off' +# Flag: --bar_border +bar_border="on" + +# Progress bar length in spaces +# Number of chars long to make the progress bars. +# +# Default: '15' +# Values: 'num' +# Flag: --bar_length +bar_length=15 + +# Progress bar colors +# When set to distro, uses your distro's logo colors. +# +# Default: 'distro', 'distro' +# Values: 'distro', 'num' +# Flag: --bar_colors +# +# Example: +# neofetch --bar_colors 3 4 +# neofetch --bar_colors distro 5 +bar_color_elapsed="distro" +bar_color_total="distro" + + +# Info display +# Display a bar with the info. +# +# Default: 'off' +# Values: 'bar', 'infobar', 'barinfo', 'off' +# Flags: --cpu_display +# --memory_display +# --battery_display +# --disk_display +# +# Example: +# bar: '[---=======]' +# infobar: 'info [---=======]' +# barinfo: '[---=======] info' +# off: 'info' +cpu_display="info" +memory_display="info" +battery_display="info" +disk_display="info" + + +# Backend Settings + + +# Image backend. +# +# Default: 'ascii' +# Values: 'ascii', 'caca', 'chafa', 'jp2a', 'iterm2', 'off', +# 'termpix', 'pixterm', 'tycat', 'w3m', 'kitty' +# Flag: --backend +image_backend="ascii" + +# Image Source +# +# Which image or ascii file to display. +# +# Default: 'auto' +# Values: 'auto', 'ascii', 'wallpaper', '/path/to/img', '/path/to/ascii', '/path/to/dir/' +# 'command output (neofetch --ascii "$(fortune | cowsay -W 30)")' +# Flag: --source +# +# NOTE: 'auto' will pick the best image source for whatever image backend is used. +# In ascii mode, distro ascii art will be used and in an image mode, your +# wallpaper will be used. +image_source="auto" + + +# Ascii Options + + +# Ascii distro +# Which distro's ascii art to display. +# +# Default: 'auto' +# Values: 'auto', 'distro_name' +# Flag: --ascii_distro +# +# NOTE: Arch and Ubuntu have 'old' logo variants. +# Change this to 'arch_old' or 'ubuntu_old' to use the old logos. +# NOTE: Ubuntu has flavor variants. +# Change this to 'Lubuntu', 'Xubuntu', 'Ubuntu-GNOME' or 'Ubuntu-Budgie' to use the flavors. +# NOTE: Arch, Crux and Gentoo have a smaller logo variant. +# Change this to 'arch_small', 'crux_small' or 'gentoo_small' to use the small logos. +ascii_distro="auto" + +# Ascii Colors +# +# Default: 'distro' +# Values: 'distro', 'num' 'num' 'num' 'num' 'num' 'num' +# Flag: --ascii_colors +# +# Example: +# ascii_colors=(distro) - Ascii is colored based on Distro colors. +# ascii_colors=(4 6 1 8 8 6) - Ascii is colored using these colors. +ascii_colors=(distro) + +# Bold ascii logo +# Whether or not to bold the ascii logo. +# +# Default: 'on' +# Values: 'on', 'off' +# Flag: --ascii_bold +ascii_bold="on" + + +# Image Options + + +# Image loop +# Setting this to on will make neofetch redraw the image constantly until +# Ctrl+C is pressed. This fixes display issues in some terminal emulators. +# +# Default: 'off' +# Values: 'on', 'off' +# Flag: --loop +image_loop="off" + +# Thumbnail directory +# +# Default: '~/.cache/thumbnails/neofetch' +# Values: 'dir' +thumbnail_dir="${XDG_CACHE_HOME:-${HOME}/.cache}/thumbnails/neofetch" + +# Crop mode +# +# Default: 'normal' +# Values: 'normal', 'fit', 'fill' +# Flag: --crop_mode +# +# See this wiki page to learn about the fit and fill options. +# https://github.com/dylanaraps/neofetch/wiki/What-is-Waifu-Crop%3F +crop_mode="normal" + +# Crop offset +# Note: Only affects 'normal' crop mode. +# +# Default: 'center' +# Values: 'northwest', 'north', 'northeast', 'west', 'center' +# 'east', 'southwest', 'south', 'southeast' +# Flag: --crop_offset +crop_offset="center" + +# Image size +# The image is half the terminal width by default. +# +# Default: 'auto' +# Values: 'auto', '00px', '00%', 'none' +# Flags: --image_size +# --size +image_size="auto" + +# Gap between image and text +# +# Default: '3' +# Values: 'num', '-num' +# Flag: --gap +gap=3 + +# Image offsets +# Only works with the w3m backend. +# +# Default: '0' +# Values: 'px' +# Flags: --xoffset +# --yoffset +yoffset=0 +xoffset=0 + +# Image background color +# Only works with the w3m backend. +# +# Default: '' +# Values: 'color', 'blue' +# Flag: --bg_color +background_color= + + +# Misc Options + +# Stdout mode +# Turn off all colors and disables image backend (ASCII/Image). +# Useful for piping into another command. +# Default: 'off' +# Values: 'on', 'off' +stdout="off" diff --git a/home/.config/npm/npmrc b/home/.config/npm/npmrc new file mode 100644 index 0000000..fc84b78 --- /dev/null +++ b/home/.config/npm/npmrc @@ -0,0 +1,4 @@ +prefix=${XDG_DATA_HOME}/npm +cache=${XDG_CACHE_HOME}/npm +tmp=${XDG_RUNTIME_DIR}/npm +init-module=${XDG_CONFIG_HOME}/npm/config/npm-init.js diff --git a/home/.config/nvim/after/ftplugin/c.lua b/home/.config/nvim/after/ftplugin/c.lua new file mode 120000 index 0000000..48a225a --- /dev/null +++ b/home/.config/nvim/after/ftplugin/c.lua @@ -0,0 +1 @@ +cpp.lua \ No newline at end of file diff --git a/home/.config/nvim/after/ftplugin/cfg.lua b/home/.config/nvim/after/ftplugin/cfg.lua new file mode 100644 index 0000000..3e79acd --- /dev/null +++ b/home/.config/nvim/after/ftplugin/cfg.lua @@ -0,0 +1,3 @@ +vim.bo.commentstring = "// %s" + +vim.b.undo_ftplugin = vim.b.undo_ftplugin .. "| setlocal commentstring<" diff --git a/home/.config/nvim/after/ftplugin/cpp.lua b/home/.config/nvim/after/ftplugin/cpp.lua new file mode 100644 index 0000000..e3d3a8c --- /dev/null +++ b/home/.config/nvim/after/ftplugin/cpp.lua @@ -0,0 +1,2 @@ +vim.bo.commentstring = "// %s" +vim.b.undo_ftplugin = vim.b.undo_ftplugin .. "| setlocal commentstring<" diff --git a/home/.config/nvim/after/ftplugin/dosini.lua b/home/.config/nvim/after/ftplugin/dosini.lua new file mode 100644 index 0000000..f6d7437 --- /dev/null +++ b/home/.config/nvim/after/ftplugin/dosini.lua @@ -0,0 +1,3 @@ +vim.bo.commentstring = "# %s" +vim.b.undo_ftplugin = vim.b.undo_ftplugin + .. "|setlocal commentstring" diff --git a/home/.config/nvim/after/ftplugin/gitcommit.lua b/home/.config/nvim/after/ftplugin/gitcommit.lua new file mode 100644 index 0000000..8525714 --- /dev/null +++ b/home/.config/nvim/after/ftplugin/gitcommit.lua @@ -0,0 +1,5 @@ +vim.wo.spell = true +vim.b.undo_ftplugin = vim.b.undo_ftplugin .. "|setlocal spell<" +vim.cmd([[match ErrorMsg /\%1l.\%>50v/]]) +local bufnr = vim.api.nvim_buf_get_number(0) +require("mapper").ncmd("gd", "DiffGitCached", nil, bufnr) diff --git a/home/.config/nvim/after/ftplugin/gitrebase.lua b/home/.config/nvim/after/ftplugin/gitrebase.lua new file mode 100644 index 0000000..98fd264 --- /dev/null +++ b/home/.config/nvim/after/ftplugin/gitrebase.lua @@ -0,0 +1,20 @@ +local map = require("mapper") +local ncmd = map.ncmd +local vcmd = map.vcmd +local bufnr = vim.api.nvim_buf_get_number(0) + +ncmd("gc", "Cycle", nil, bufnr) +ncmd("gp", "Pick", nil, bufnr) +ncmd("ge", "Edit", nil, bufnr) +ncmd("gf", "Fixup", nil, bufnr) +ncmd("gd", "Drop", nil, bufnr) +ncmd("gs", "Squash", nil, bufnr) +ncmd("gr", "Reword", nil, bufnr) + +vcmd("gc", "Cycle", nil, bufnr) +vcmd("gp", "Pick", nil, bufnr) +vcmd("ge", "Edit", nil, bufnr) +vcmd("gf", "Fixup", nil, bufnr) +vcmd("gd", "Drop", nil, bufnr) +vcmd("gs", "Squash", nil, bufnr) +vcmd("gr", "Reword", nil, bufnr) diff --git a/home/.config/nvim/after/ftplugin/help.lua b/home/.config/nvim/after/ftplugin/help.lua new file mode 100644 index 0000000..63147a6 --- /dev/null +++ b/home/.config/nvim/after/ftplugin/help.lua @@ -0,0 +1,3 @@ +vim.keymap.set("n", "q", function() + vim.api.nvim_win_close(0, false) +end, { buffer = true }) diff --git a/home/.config/nvim/after/ftplugin/json.lua b/home/.config/nvim/after/ftplugin/json.lua new file mode 100644 index 0000000..726acd0 --- /dev/null +++ b/home/.config/nvim/after/ftplugin/json.lua @@ -0,0 +1 @@ +vim.cmd([[syntax match Comment +\/\/.\+$+]]) diff --git a/home/.config/nvim/after/ftplugin/mail.lua b/home/.config/nvim/after/ftplugin/mail.lua new file mode 100644 index 0000000..538c10b --- /dev/null +++ b/home/.config/nvim/after/ftplugin/mail.lua @@ -0,0 +1,2 @@ +vim.wo.spell = true +vim.b.undo_ftplugin = vim.b.undo_ftplugin .. "|setlocal spell<" diff --git a/home/.config/nvim/after/ftplugin/markdown.lua b/home/.config/nvim/after/ftplugin/markdown.lua new file mode 100644 index 0000000..538c10b --- /dev/null +++ b/home/.config/nvim/after/ftplugin/markdown.lua @@ -0,0 +1,2 @@ +vim.wo.spell = true +vim.b.undo_ftplugin = vim.b.undo_ftplugin .. "|setlocal spell<" diff --git a/home/.config/nvim/after/ftplugin/tex.lua b/home/.config/nvim/after/ftplugin/tex.lua new file mode 100644 index 0000000..b1dbce0 --- /dev/null +++ b/home/.config/nvim/after/ftplugin/tex.lua @@ -0,0 +1,4 @@ +vim.wo.spell = true +vim.bo.formatoptions = vim.bo.formatoptions .. "t" +vim.b.undo_ftplugin = vim.b.undo_ftplugin + .. "|setlocal spell< |setlocal formatoptions<" diff --git a/home/.config/nvim/after/ftplugin/text.lua b/home/.config/nvim/after/ftplugin/text.lua new file mode 100644 index 0000000..8c72f6f --- /dev/null +++ b/home/.config/nvim/after/ftplugin/text.lua @@ -0,0 +1,5 @@ +vim.wo.spell = true +vim.bo.formatoptions = vim.bo.formatoptions .. "t" +vim.bo.commentstring = "# %s" +vim.b.undo_ftplugin = vim.b.undo_ftplugin + .. "|setlocal spell< |setlocal formatoptions< |setlocal commentstring" diff --git a/home/.config/nvim/after/ftplugin/tmux.lua b/home/.config/nvim/after/ftplugin/tmux.lua new file mode 100644 index 0000000..590a12e --- /dev/null +++ b/home/.config/nvim/after/ftplugin/tmux.lua @@ -0,0 +1 @@ +vim.api.nvim_create_autocmd("BufWritePost", { buffer = 0, command = "make" }) diff --git a/home/.config/nvim/after/ftplugin/xdefaults.lua b/home/.config/nvim/after/ftplugin/xdefaults.lua new file mode 100644 index 0000000..0f4ec99 --- /dev/null +++ b/home/.config/nvim/after/ftplugin/xdefaults.lua @@ -0,0 +1,9 @@ +vim.bo.commentstring = "! %s" +vim.api.nvim_create_augroup("xdefaults", {}) +vim.api.nvim_create_autocmd( + "BufWritePost", + { group = "xdefaults", buffer = 0, command = "!xrdb %" } +) + +vim.b.undo_ftplugin = vim.b.undo_ftplugin + .. "| setlocal commentstring< diff --git a/home/.config/nvim/after/ftplugin/xmodmap.lua b/home/.config/nvim/after/ftplugin/xmodmap.lua new file mode 100644 index 0000000..75c9f8a --- /dev/null +++ b/home/.config/nvim/after/ftplugin/xmodmap.lua @@ -0,0 +1,4 @@ +vim.api.nvim_create_autocmd( + "BufWritePost", + { buffer = 0, command = "!xmodmap %" } +) diff --git a/home/.config/nvim/after/plugin/autocmds.lua b/home/.config/nvim/after/plugin/autocmds.lua new file mode 100644 index 0000000..7ab937f --- /dev/null +++ b/home/.config/nvim/after/plugin/autocmds.lua @@ -0,0 +1,137 @@ +local function augroup(name) + return vim.api.nvim_create_augroup(name, {}) +end + +local autocmd = vim.api.nvim_create_autocmd + +-- adapted from https://github.com/ethanholz/nvim-lastplace/blob/main/lua/nvim-lastplace/init.lua +local ignore_buftype = { "quickfix", "nofile", "help" } +local ignore_filetype = { "gitcommit", "gitrebase", "svn", "hgcommit" } + +local function run() + if vim.tbl_contains(ignore_buftype, vim.bo.buftype) then + return + end + + if vim.tbl_contains(ignore_filetype, vim.bo.filetype) then + -- reset cursor to first line + vim.cmd [[normal! gg]] + return + end + + -- If a line has already been specified on the command line, we are done + -- nvim file +num + if vim.fn.line(".") > 1 then + return + end + + local last_line = vim.fn.line([['"]]) + local buff_last_line = vim.fn.line("$") + + -- If the last line is set and the less than the last line in the buffer + if last_line > 0 and last_line <= buff_last_line then + local win_last_line = vim.fn.line("w$") + local win_first_line = vim.fn.line("w0") + -- Check if the last line of the buffer is the same as the win + if win_last_line == buff_last_line then + -- Set line to last line edited + vim.cmd [[normal! g`"]] + -- Try to center + elseif buff_last_line - last_line > + ((win_last_line - win_first_line) / 2) - 1 then + vim.cmd [[normal! g`"zz]] + else + vim.cmd [[normal! G'"]] + end + end +end + +augroup("restore position") +autocmd("BufReadPost", { + once = true, + group = "restore position", + callback = run +}) + +augroup("postwrite") +autocmd("BufWritePost", { + group = "postwrite", + pattern = ".Xkeymap", + command = "!xkbcomp % $DISPLAY", +}) +autocmd("BufWritePost", { + group = "postwrite", + pattern = "*bspwmrc", + command = "!bspc wm --restart", +}) +autocmd("BufWritePost", { + group = "postwrite", + pattern = "*/polybar/config", + command = "!polybar-msg cmd restart", +}) +autocmd("BufWritePost", { + group = "postwrite", + pattern = "user-dirs.dirs,user-dirs.locale", + command = "!xdg-user-dirs-update", +}) +autocmd("BufWritePost", { + group = "postwrite", + pattern = "plugins.lua", + command = "source % | PackerSync", +}) +autocmd("BufWritePost", { + group = "postwrite", + pattern = "dunstrc", + command = "!killall -SIGUSR2 dunst", +}) +autocmd( + "BufWritePost", + { group = "postwrite", pattern = "fonts.conf", command = "!fc-cache" } +) + +augroup("autocomplete") +autocmd("CompleteDone", { + group = "autocomplete", + command = "if pumvisible() == 0 | silent! pclose | endif", +}) + +augroup("reload") +autocmd("CompleteDone", { + group = "reload", + command = "if getcmdwintype() == '' | checktime | endif", +}) + +augroup("highlightyank") +autocmd( + "TextYankPost", + { group = "highlightyank", callback = vim.highlight.on_yank } +) + +augroup("quitro") +autocmd("BufReadPost", { + group = "quitro", + callback = function() + if vim.opt.readonly:get() then + vim.keymap.set("n", "q", "q") + end + end, +}) + +augroup("localinit") +autocmd("VimEnter", { + group = "localinit", + callback = function() + local settings = vim.fn.findfile(".doit.lua", ".;") + if settings ~= "" then + print("sourcing local config") + dofile(settings) + end + end, +}) + +augroup("restore guicursor") +autocmd("VimLeave", { + once = true, + group = "restore guicursor", + command = 'set guicursor= | call chansend(v:stderr, "\x1b[ q")' +}) diff --git a/home/.config/nvim/after/plugin/mappings.lua b/home/.config/nvim/after/plugin/mappings.lua new file mode 100644 index 0000000..7fd0f03 --- /dev/null +++ b/home/.config/nvim/after/plugin/mappings.lua @@ -0,0 +1,58 @@ +local map = require("mapper") + +map.n("", "") + +-- make an accidental ; press also enter command mode +-- temporarily disabled to to vim-sneak plugin +map.n(";", ":") + +-- highlight last inserted text +map.n("gV", "`[v`]") + +map.n("", "") +map.n("", "") + +-- go to first non-blank character of current line +map.n("", "^") +map.v("", "^") +map.n("", "$") +map.v("", "$") + +-- This extends p in visual mode (note the noremap), so that if you paste from +-- the unnamed (ie. default) register, that register content is not replaced by +-- the visual selection you just pasted overโ€“which is the default behavior. +-- This enables the user to yank some text and paste it over several places in +-- a row, without using a named register +-- map.v('p', "p:if v:register == '"'let @@=@0endif") +map.v("p", 'p:let @+=@0:let @"=@0') + +map.v("p", '"_dP') +map.n("d", '"_d') +map.n("D", '"_D') +map.map("", "c", '"_c') +map.map("", "C", '"_C') + +-- Find and Replace binds +map.ncmdi("s", "%s/") +map.vcmdi("s", "s/") +map.ncmdi("gs", '%s/"/') +map.vcmdi("gs", 's/"/') +map.ncmdi("S", "%s//") + +map.ncmd("x", "wall") +map.ncmd("z", "wqall") +map.ncmd("q", "quitall") +map.ncmd("x", "update") + +map.t("", "", { silent = true, noremap = true, expr = true }) + +map.n("gw", vim.diagnostic.open_float) +map.n("gW", vim.diagnostic.setloclist) +map.n("[w", vim.diagnostic.goto_prev) +map.n("]w", vim.diagnostic.goto_next) +map.n("[e", function() + vim.diagnostic.goto_prev({ severity = vim.diagnostic.severity.ERROR }) +end) +map.n("]e", function() + vim.diagnostic.goto_next({ severity = vim.diagnostic.severity.ERROR }) +end) diff --git a/home/.config/nvim/filetype.lua b/home/.config/nvim/filetype.lua new file mode 100644 index 0000000..b13afe0 --- /dev/null +++ b/home/.config/nvim/filetype.lua @@ -0,0 +1,7 @@ +vim.filetype.add({ + extension = { + eml = "mail", + inc = "cpp", + def = "cpp", + }, +}) diff --git a/home/.config/nvim/init.lua b/home/.config/nvim/init.lua new file mode 100644 index 0000000..8326c43 --- /dev/null +++ b/home/.config/nvim/init.lua @@ -0,0 +1,26 @@ +vim.loader.enable() + +function docfg(name) + dofile(vim.fn.stdpath("config") .. "/lua/cfg/" .. name .. ".lua") +end + +docfg("options") + +function P(v) + print(vim.inspect(v)) + return v +end + +local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" +if not vim.loop.fs_stat(lazypath) then + vim.fn.system({ + "git", + "clone", + "--filter=blob:none", + "https://github.com/folke/lazy.nvim.git", + "--branch=stable", -- latest stable release + lazypath, + }) +end +vim.opt.rtp:prepend(lazypath) +require("lazy").setup("custom.plugins") diff --git a/home/.config/nvim/lua/cfg/lsp.lua b/home/.config/nvim/lua/cfg/lsp.lua new file mode 100644 index 0000000..5767ff6 --- /dev/null +++ b/home/.config/nvim/lua/cfg/lsp.lua @@ -0,0 +1,64 @@ +return { + on_attach_wrapper = function(client, bufnr, opts) + local map = require("mapper") + local autocmd = vim.api.nvim_create_autocmd + + opts = vim.tbl_extend("force", { auto_format = false }, opts or {}) + + if client.supports_method("textDocument/codeLens") then + require("virtualtypes").on_attach(client, bufnr) + autocmd( + { "CursorHold", "CursorHoldI", "InsertLeave" }, + { buffer = bufnr, callback = vim.lsp.codelens.refresh } + ) + map.n("gl", vim.lsp.codelens.run, { buffer = bufnr }) + end + + if client.supports_method("textDocument/definition") then + map.n("", vim.lsp.buf.definition, { buffer = bufnr }) + end + if client.supports_method("textDocument/declaration") then + map.n("gD", vim.lsp.buf.declaration, { buffer = bufnr }) + end + if client.supports_method("textDocument/signatureHelp") then + require("lsp_signature").on_attach(client, bufnr) + map.n("gs", vim.lsp.buf.signature_help, { buffer = bufnr }) + end + if client.supports_method("textDocument/rename") then + map.n("gR", vim.lsp.buf.rename, { buffer = bufnr }) + end + if client.supports_method("textDocument/codeAction") then + map.n("ga", vim.lsp.buf.code_action, { buffer = bufnr }) + map.v("ga", vim.lsp.buf.code_action, { buffer = bufnr }) + end + + local buf_async_format = function() + vim.lsp.buf.format( + { bufnr = bufnr, async = true, id = client.id }) + end + local buf_sync_format = function() + vim.lsp.buf.format( + { bufnr = bufnr, async = false, id = client.id }) + end + local buf_async_format_hunks = function() + require("cfg.utils").format_hunks( + { bufnr = bufnr, async = true, id = client.id }) + end + + if client.supports_method("textDocument/formatting") then + map.n("f", buf_async_format, { buffer = bufnr }) + if opts.auto_format then + autocmd( + "BufWritePre", + { buffer = bufnr, callback = buf_sync_format } + ) + end + end + if client.supports_method("textDocument/rangeFormatting") then + map.v("f", buf_async_format, { buffer = bufnr }) + map.n("hf", buf_async_format_hunks, { buffer = bufnr }) + end + + require("lsp-inlayhints").on_attach(client, bufnr, false) + end +} diff --git a/home/.config/nvim/lua/cfg/options.lua b/home/.config/nvim/lua/cfg/options.lua new file mode 100644 index 0000000..1529121 --- /dev/null +++ b/home/.config/nvim/lua/cfg/options.lua @@ -0,0 +1,124 @@ +local opt = vim.opt + +opt.undofile = true +opt.swapfile = false +vim.opt.shadafile = "NONE" +vim.g.ts_highlight_lua = true +vim.g.ts_highlight_c = true +vim.g.ts_highlight_vim = true + +opt.showmode = true +opt.number = true +opt.cursorline = true +opt.signcolumn = "auto:2" +opt.showtabline = 2 +opt.showmatch = true + +opt.expandtab = true +opt.shiftround = true +opt.shiftwidth = 0 +opt.softtabstop = -1 +opt.tabstop = 4 + +opt.foldenable = false + +opt.splitbelow = true +opt.splitright = true + +opt.linebreak = true +opt.breakindent = true +opt.textwidth = 80 +opt.colorcolumn = "+1" +opt.formatoptions:remove("t") + +opt.spelllang:append({ "pt_pt", "es_es" }) +opt.spellfile = vim.fn.stdpath("config") .. "/spell/en.utf-8.add" + +opt.cmdheight = 2 +opt.updatetime = 300 + +opt.shortmess:append({ a = true }) + +opt.gdefault = true +opt.synmaxcol = 500 + +opt.completeopt = { "menu", "menuone", "noselect" } +opt.scrolloff = 999 +opt.sidescrolloff = 5 + +opt.clipboard = "unnamedplus" + +opt.wildmode = { "longest", "full" } + +opt.cpoptions:remove({ "_" }) + +opt.listchars = { + tab = "> ", + trail = "ยท", + extends = ">", + precedes = "<", + nbsp = "+", +} +opt.list = true + +opt.virtualedit = "block" +opt.spelloptions = "camel" + +vim.g.is_posix = 1 +vim.g.python_host_prog = 0 +vim.g.python3_host_prog = 0 +vim.g.netrw_home = vim.fn.stdpath("data") + +vim.g.loaded_netrw = 1 +vim.g.loaded_netrwPlugin = 1 +vim.g.loaded_netrwSettings = 1 +vim.g.loaded_netrwFileHandlers = 1 +vim.g.loaded_gzip = 1 +vim.g.loaded_zip = 1 +vim.g.loaded_zipPlugin = 1 +vim.g.loaded_tar = 1 +vim.g.loaded_tarPlugin = 1 +vim.g.loaded_zipPlugin = 1 +vim.g.loaded_getscript = 1 +vim.g.loaded_getscriptPlugin = 1 +vim.g.loaded_vimball = 1 +vim.g.loaded_vimballPlugin = 1 +vim.g.loaded_2html_plugin = 1 +vim.g.loaded_logipat = 1 +vim.g.loaded_rrhelper = 1 +vim.g.loaded_matchparen = 1 +vim.g.loaded_spec = 1 + +opt.diffopt:append({ + ["indent-heuristic"] = true, + hiddenoff = true, + iblank = true, + iwhiteall = true, + algorithm = "histogram", +}) + +if vim.fn.executable("rg") then + opt.grepprg = "rg\\ --vimgrep" + opt.grepformat:append("f:%l:%c:%m") +end + +opt.termguicolors = true +opt.pumblend = 20 + +opt.foldmethod = "expr" +opt.foldexpr = "nvim_treesitter#foldexpr()" +opt.foldenable = false + +opt.laststatus = 2 +vim.g.mapleader = " " +vim.g.maplocalleader = "," + +vim.diagnostic.config({ + virtual_text = { + source = "if_many", + severity = vim.diagnostic.severity.ERROR, + }, + signs = true, + underline = true, + update_in_insert = false, +}) diff --git a/home/.config/nvim/lua/cfg/utils.lua b/home/.config/nvim/lua/cfg/utils.lua new file mode 100644 index 0000000..abda35d --- /dev/null +++ b/home/.config/nvim/lua/cfg/utils.lua @@ -0,0 +1,24 @@ +local M = {} +local gitsigns = require("gitsigns") + +function M.format_hunks(options) + local hunks = require("gitsigns").get_hunks() + if not hunks or vim.tbl_isempty(hunks) then + return + end + for _, hunk in ipairs(hunks) do + local added = hunk.added + if added then + local start_line = added.start + local count = added.count + if start_line and count and start_line > 0 and count > 0 then + local end_line = start_line + added.count - 1 + local range = { start = { start_line, 0 }, ["end"] = { end_line, 0 } } + options = vim.tbl_extend("force", { range = range }, options or {}) + vim.lsp.buf.format(options) + end + end + end +end + +return M diff --git a/home/.config/nvim/lua/custom/plugins/init.lua b/home/.config/nvim/lua/custom/plugins/init.lua new file mode 100644 index 0000000..eb720e6 --- /dev/null +++ b/home/.config/nvim/lua/custom/plugins/init.lua @@ -0,0 +1,1117 @@ +local map = require("mapper") + +return { + { "nvim-lua/plenary.nvim", lazy = true }, + { "tpope/vim-repeat", event = "VeryLazy" }, + 'tpope/vim-sleuth', + { + "numToStr/Comment.nvim", + config = true, + }, + { + "tpope/vim-unimpaired", + keys = { "]", "[", "yo" }, + }, + { "folke/which-key.nvim", lazy = true }, + { "kylechui/nvim-surround", config = true }, + { + "dstein64/vim-startuptime", + cmd = "StartupTime", + }, + { + "folke/persistence.nvim", + config = true, + event = "BufReadPre", + keys = { + { + "qs", + require("persistence").load, + desc = + "Restore Session" + }, + { + "ql", + function() require("persistence").load({ last = true }) end, + desc = + "Restore Last Session" + }, + { + "qd", + require("persistence").stop, + desc = + "Don't Save Current Session" + }, + }, + }, + "xiyaowong/nvim-cursorword", + { + "sainnhe/gruvbox-material", + priority = 1000, + config = function() + vim.g.gruvbox_material_background = "hard" + vim.g.gruvbox_material_enable_bold = 1 + vim.g.gruvbox_material_enable_italic = 1 + vim.g.gruvbox_material_better_performance = 1 + vim.g.gruvbox_material_palette = "original" + + vim.cmd([[ colorscheme gruvbox-material]]) + end + }, + { + "aserowy/tmux.nvim", + config = true, + }, + { + "Julian/vim-textobj-variable-segment", + dependencies = { "kana/vim-textobj-user" }, + }, + { "mzlogin/vim-markdown-toc", ft = "markdown" }, + { + "norcalli/nvim-colorizer.lua", + event = "BufRead", + config = true + }, + { + "lewis6991/hover.nvim", + keys = { { "K", require "hover".hover }, { "gK", require "hover" + .hover_select }, { "gh", require "hover".hover }, + { "gH", require "hover".hover_select } }, + opts = { + init = function() + require("hover.providers.lsp") + require('hover.providers.gh') + require('hover.providers.man') + -- require('hover.providers.dictionary') + end, + }, + }, + { 'akinsho/git-conflict.nvim', config = true }, + { + "lukas-reineke/indent-blankline.nvim", + config = function() + local highlight = { + "RainbowRed", + "RainbowYellow", + "RainbowBlue", + "RainbowOrange", + "RainbowGreen", + "RainbowViolet", + "RainbowCyan", + } + local hooks = require "ibl.hooks" + -- create the highlight groups in the highlight setup hook, so they are reset + -- every time the colorscheme changes + hooks.register(hooks.type.HIGHLIGHT_SETUP, function() + vim.api.nvim_set_hl(0, "RainbowRed", { fg = "#E06C75" }) + vim.api.nvim_set_hl(0, "RainbowYellow", { fg = "#E5C07B" }) + vim.api.nvim_set_hl(0, "RainbowBlue", { fg = "#61AFEF" }) + vim.api.nvim_set_hl(0, "RainbowOrange", { fg = "#D19A66" }) + vim.api.nvim_set_hl(0, "RainbowGreen", { fg = "#98C379" }) + vim.api.nvim_set_hl(0, "RainbowViolet", { fg = "#C678DD" }) + vim.api.nvim_set_hl(0, "RainbowCyan", { fg = "#56B6C2" }) + end) + + vim.g.rainbow_delimiters = { highlight = highlight } + require("ibl").setup { scope = { highlight = highlight } } + + hooks.register(hooks.type.SCOPE_HIGHLIGHT, + hooks.builtin.scope_highlight_from_extmark) + end + }, + { + "monaqa/dial.nvim", + config = function() + map.n("]i", require("dial.map").inc_normal()) + map.n("[i", require("dial.map").dec_normal()) + map.v("]i", require("dial.map").inc_visual()) + map.v("[i", require("dial.map").dec_visual()) + end + }, + { + "iamcco/markdown-preview.nvim", + build = "cd app && yarn install", + ft = "markdown", + config = function() + vim.api.nvim_command([[ + function! g:OpenNewWindow(url) + silent exec "Start! librewolf --new-window " . a:url + endfunction + ]]) + vim.g.mkdp_browserfunc = "g:OpenNewWindow" + end, + }, + "gpanders/editorconfig.nvim", + { + "kwkarlwang/bufresize.nvim", + config = true + }, + "kovetskiy/sxhkd-vim", + "tmux-plugins/vim-tmux", + "chrisbra/csv.vim", + "martinda/Jenkinsfile-vim-syntax", + "rhysd/vim-llvm", + "MTDL9/vim-log-highlighting", + "raimon49/requirements.txt.vim", + "wgwoods/vim-systemd-syntax", + { + "NeogitOrg/neogit", + dependencies = { + "nvim-lua/plenary.nvim", + }, + config = function() + require("neogit").setup({ + disable_commit_confirmation = true, + kind = "split", + console_timeout = 5000, + auto_show_console = false, + }) + map.n("ng", require "neogit".open) + end, + }, + { + "ruifm/gitlinker.nvim", + keys = { + { "gy", function() require 'gitlinker'.get_buf_range_url("n") end }, + { + "gy", + function() + require 'gitlinker'.get_buf_range_url("v") + end, + mode = "v" + }, + }, + dependencies = { + "nvim-lua/plenary.nvim", + }, + config = function() + require "gitlinker".setup({ + callbacks = { + ["personal"] = function(url_data) + url_data.host = "github.com" + return require "gitlinker.hosts".get_github_type_url(url_data) + end, + ["work"] = function(url_data) + url_data.host = "github.com" + return require "gitlinker.hosts".get_github_type_url(url_data) + end, + ["git.strisemarx.com"] = function(url_data) + local url = require "gitlinker.hosts".get_base_https_url(url_data) + url = url .. "/tree/" .. url_data.file .. "?id=" .. url_data.rev + if url_data.lstart then + url = url .. "#n" .. url_data.lstart + end + return url + end + }, + }) + end, + }, + { + "lewis6991/gitsigns.nvim", + event = "BufRead", + opts = { + signs = { + change = { show_count = true }, + delete = { show_count = true }, + topdelete = { show_count = true }, + changedelete = { show_count = true }, + }, + numhl = true, + _extmark_signs = true, + _threaded_diff = true, + _signs_staged_enable = true, + on_attach = function(bufnr) + local gs = package.loaded.gitsigns + + -- Navigation + map.n(']c', function() + if vim.wo.diff then return ']c' end + vim.schedule(function() gs.next_hunk() end) + return '' + end, { expr = true }, bufnr) + + map.n('[c', function() + if vim.wo.diff then return '[c' end + vim.schedule(function() gs.prev_hunk() end) + return '' + end, { expr = true }, bufnr) + + -- Actions + map.nvcmd('hs', "Gitsigns stage_hunk", nil, bufnr) + map.nvcmd('hr', "Gitsigns reset_hunk", nil, bufnr) + map.n('hS', gs.stage_buffer, nil, bufnr) + map.n('hu', gs.undo_stage_hunk, nil, bufnr) + map.n('hR', gs.reset_buffer, nil, bufnr) + map.n('hp', gs.preview_hunk, nil, bufnr) + map.n('hb', function() gs.blame_line { full = true } end, nil, + bufnr) + map.n('tb', gs.toggle_current_line_blame, nil, bufnr) + map.n('hd', gs.diffthis, nil, bufnr) + map.n('hD', function() gs.diffthis('~') end, nil, bufnr) + map.n('hc', gs.change_base, nil, bufnr) + map.n('hC', function() gs.change_base('~') end, nil, bufnr) + map.n('td', gs.toggle_deleted, nil, bufnr) + map.n('tw', gs.toggle_word_diff, nil, bufnr) + map.n('tl', gs.toggle_linehl, nil, bufnr) + + -- Text object + map.map({ 'o', 'x' }, 'ih', ':Gitsigns select_hunk', nil, bufnr) + end + }, + dependencies = { + "nvim-lua/plenary.nvim", + }, + }, + { + "nvim-telescope/telescope.nvim", + config = function() + local actions = require("telescope.actions") + require("telescope").setup({ + defaults = { + sorting_strategy = "ascending", + layout_config = { + prompt_position = "top", + }, + scroll_strategy = "cycle", + selection_strategy = "follow", + color_devicons = false, + mappings = { + i = { + [""] = actions.move_selection_next, + [""] = actions.move_selection_previous, + }, + }, + extensions = { + fzf = { + fuzzy = true, -- false will only do exact matching + override_generic_sorter = true, -- override the generic sorter + override_file_sorter = true, -- override the file sorter + case_mode = "smart_case", -- or "ignore_case" or "respect_case" + }, + ["ui-select"] = { + require("telescope.themes").get_dropdown({ + -- even more opts + }), + }, + }, + }, + }) + require("telescope").load_extension("fzf") + require("telescope").load_extension("ui-select") + + local b = require("telescope.builtin") + + map.n("p", b.planets) + map.n("B", b.builtin) + map.n("/", b.live_grep) + map.n("?", b.grep_string) + map.n("f", function() + b.find_files({ + find_command = { + "fd", + "--type", + "file", + "--follow", + "--hidden", + "--exclude", + ".git", + }, + }) + end) + map.n("b", function() + b.buffers({ sort_lastused = true, initial_mode = "normal" }) + end) + + map.n("t", b.treesitter) + + map.n("c", b.commands) + map.n("h", b.help_tags) + map.n("m", b.man_pages) + map.n("k", b.keymaps) + map.n("Q", function() + b.quickfix({ initial_mode = "normal" }) + end) + map.n("L", function() + b.loclist({ initial_mode = "normal" }) + end) + map.n("R", function() + b.registers({ initial_mode = "normal" }) + end) + map.n("A", b.autocommands) + + map.n("gd", function() + b.lsp_definitions({ initial_mode = "normal" }) + end) + map.n("gvd", function() + b.lsp_definitions({ initial_mode = "normal", jump_type = "vsplit" }) + end) + map.n("gxd", function() + b.lsp_definitions({ initial_mode = "normal", jump_type = "split" }) + end) + map.n("gtd", function() + b.lsp_definitions({ initial_mode = "normal", jump_type = "tab" }) + end) + map.n("gi", function() + b.lsp_implementations({ initial_mode = "normal" }) + end) + map.n("gvi", function() + b.lsp_implementations({ initial_mode = "normal", jump_type = "vsplit" }) + end) + map.n("gxi", function() + b.lsp_implementations({ initial_mode = "normal", jump_type = "split" }) + end) + map.n("gti", function() + b.lsp_implementations({ initial_mode = "normal", jump_type = "tab" }) + end) + map.n("go", b.lsp_document_symbols) + map.n("gS", b.lsp_dynamic_workspace_symbols) + map.n("ge", function() + b.lsp_document_diagnostics({ initial_mode = "normal" }) + end) + map.n("gE", function() + b.lsp_workspace_diagnostics({ initial_mode = "normal" }) + end) + map.n("gr", function() + b.lsp_references({ initial_mode = "normal" }) + end) + map.n("gic", function() + b.lsp_incoming_calls({ initial_mode = "normal" }) + end) + map.n("goc", function() + b.lsp_outgoing_calls({ initial_mode = "normal" }) + end) + end, + dependencies = { + "nvim-lua/plenary.nvim", + { + "nvim-telescope/telescope-fzf-native.nvim", + build = "make", + }, + "nvim-telescope/telescope-ui-select.nvim", + }, + }, + { + "mfussenegger/nvim-dap", + config = function() + local dap = require("dap") + + dap.defaults.fallback.force_external_terminal = true + dap.defaults.fallback.external_terminal = { + command = "/usr/bin/st", + args = { "-e" }, + } + + dap.defaults.fallback.terminal_win_cmd = "50vsplit new" + + local function get_env_vars() + local variables = {} + for k, v in pairs(vim.fn.environ()) do + table.insert(variables, string.format("%s=%s", k, v)) + end + return variables + end + + dap.adapters.lldb = { + type = "executable", + command = "/usr/bin/lldb-vscode", + name = "lldb", + } + + local function str_split(inputstr, sep) + sep = sep or "%s" + local t = {} + for str in inputstr:gmatch("([^" .. sep .. "]+)") do + table.insert(t, str) + end + return t + end + + local _cmd = nil + + local function get_cmd() + if _cmd then + return _cmd + end + local clipboard_cmd = vim.fn.getreg("+") + _cmd = vim.fn.input({ + prompt = "Command to execute: ", + default = clipboard_cmd + }) + return _cmd + end + + local function get_program() + return str_split(get_cmd())[1] + end + + local function get_args() + local argv = str_split(get_cmd()) + local args = {} + + if #argv < 2 then + return {} + end + + for i = 2, #argv do + args[#args + 1] = argv[i] + end + + return args + end + + dap.configurations.cpp = { + { + name = "Launch", + type = "lldb", + request = "launch", + cwd = "${workspaceFolder}", + program = get_program, + stopOnEntry = true, + args = get_args, + env = get_env_vars, + runInTerminal = true, + }, + { + -- If you get an "Operation not permitted" error using this, try disabling YAMA: + -- echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope + name = "Attach to process", + type = "lldb", + request = "attach", + pid = require('dap.utils').pick_process, + }, + } + + dap.configurations.c = dap.configurations.cpp + dap.configurations.rust = dap.configurations.cpp + + local get_python_path = function() + local venv_path = os.getenv("VIRTUAL_ENV") + if venv_path then + return venv_path .. "/bin/python" + end + return "/usr/bin/python" + end + + require("dap-python").setup(get_python_path()) + + dap.adapters.nlua = function(callback, config) + callback({ type = "server", host = config.host, port = config.port }) + end + + dap.configurations.lua = { + { + type = "nlua", + request = "attach", + name = "Attach to running Neovim instance", + host = function() + local value = vim.fn.input("Host [127.0.0.1]: ") + if value ~= "" then + return value + end + return "127.0.0.1" + end, + port = function() + local val = tonumber(vim.fn.input("Port: ")) + assert(val, "Please provide a port number") + return val + end, + }, + } + + dap.repl.commands = vim.tbl_extend("force", dap.repl.commands, { + continue = { "continue", "c" }, + next_ = { "next", "n" }, + back = { "back", "b" }, + reverse_continue = { "reverse-continue", "rc" }, + into = { "into" }, + into_target = { "into_target" }, + out = { "out" }, + scopes = { "scopes" }, + threads = { "threads" }, + frames = { "frames" }, + exit = { "exit", "quit", "q" }, + up = { "up" }, + down = { "down" }, + goto_ = { "goto" }, + capabilities = { "capabilities", "cap" }, + -- add your own commands + custom_commands = { + ["echo"] = function(text) + dap.repl.append(text) + end, + }, + }) + + map.n("", dap.close) + map.n("", dap.continue) + map.n("", dap.step_over) + map.n("", dap.step_into) + map.n("", dap.step_out) + map.n("b", dap.toggle_breakpoint) + map.n("B", function() + dap.set_breakpoint(vim.fn.input("Breakpoint condition: ")) + end) + map.n("lp", function() + dap.set_breakpoint(nil, nil, vim.fn.input("Log point message: ")) + end) + map.n("dr", dap.repl.open) + map.n("dl", dap.run_last) + map.n("", dap.list_breakpoints) + + local dapui = require("dapui") + dap.listeners.after.event_initialized["dapui_config"] = function() + dapui.open() + end + dap.listeners.before.event_terminated["dapui_config"] = function() + dapui.close() + end + dap.listeners.before.event_exited["dapui_config"] = function() + dapui.close() + end + map.n("du", dapui.toggle) + map.v("de", dapui.eval) + end, + dependencies = { + { + "rcarriga/nvim-dap-ui", + opts = { + icons = { expanded = "-", collapsed = "+", current_frame = "*" }, + controls = { enabled = false }, + layouts = { + { + elements = { + -- Elements can be strings or table with id and size keys. + "scopes", + "breakpoints", + "stacks", + "watches", + }, + size = 40, + position = "left", + }, + { + elements = { + "repl", + }, + size = 0.25, -- 25% of total lines + position = "bottom", + }, + }, + }, + }, + { + "mfussenegger/nvim-dap-python", + keys = { + { "gm", function() + require("dap-python").test_method() + end }, + { + "g", + function() + require("dap-python").debug_selection() + end, + mode = "v" + }, + }, + }, + "jbyuki/one-small-step-for-vimkind", + { + "theHamsta/nvim-dap-virtual-text", + config = true, + dependencies = { "nvim-treesitter/nvim-treesitter" } + } + }, + }, + { + 'nvim-treesitter/nvim-treesitter', + dependencies = { + 'nvim-treesitter/nvim-treesitter-textobjects', + "nvim-treesitter/nvim-treesitter-refactor", + "RRethy/nvim-treesitter-textsubjects", + "theHamsta/nvim-treesitter-pairs", + "RRethy/nvim-treesitter-endwise", + }, + build = ":TSUpdate", + config = function() + require("nvim-treesitter.configs").setup({ + ensure_installed = { + "bash", + "c", + "cmake", + "comment", + "cpp", + "css", + "cuda", + "diff", + "dockerfile", + "fortran", + "git_rebase", + "gitattributes", + "gitcommit", + "gitignore", + "go", + "html", + "javascript", + "jsdoc", + "json", + "llvm", + "lua", + "make", + "markdown", + "markdown_inline", + "ninja", + "python", + "regex", + "rust", + "sql", + "todotxt", + "toml", + "typescript", + "vim", + "vimdoc", + "yaml" + }, + -- ignore_install = { "phpdoc" }, + highlight = { + enable = true, -- false will disable the whole extension + additional_vim_regex_highlighting = false, + }, + incremental_selection = { + enable = true, + keymaps = { + init_selection = "gnn", + node_incremental = "grn", + scope_incremental = "grc", + node_decremental = "grm", + }, + }, + indent = { enable = true }, + refactor = { + highlight_definitions = { enable = true }, + highlight_current_scope = { enable = true }, + smart_rename = { enable = true, keymaps = { smart_rename = "grr" } }, + navigation = { + enable = true, + keymaps = { + goto_definition = "gnd", + list_definitions = "gnD", + list_definitions_toc = "gO", + goto_next_usage = "", + goto_previous_usage = "", + }, + }, + }, + textobjects = { + select = { + enable = true, + -- Automatically jump forward to textobj, similar to targets.vim + lookahead = true, + keymaps = { + -- You can use the capture groups defined in textobjects.scm + ["af"] = "@function.outer", + ["if"] = "@function.inner", + ["ac"] = "@class.outer", + ["ic"] = "@class.inner", + }, + }, + swap = { + enable = true, + swap_next = { ["a"] = "@parameter.inner" }, + swap_previous = { ["A"] = "@parameter.inner" }, + }, + move = { + enable = true, + set_jumps = true, -- whether to set jumps in the jumplist + goto_next_start = { + ["]m"] = "@function.outer", + ["]]"] = "@class.outer", + }, + goto_next_end = { + ["]M"] = "@function.outer", + ["]["] = "@class.outer", + }, + goto_previous_start = { + ["[m"] = "@function.outer", + ["[["] = "@class.outer", + }, + goto_previous_end = { + ["[M"] = "@function.outer", + ["[]"] = "@class.outer", + }, + }, + lsp_interop = { + enable = true, + peek_definition_code = { + ["df"] = "@function.outer", + ["dF"] = "@class.outer", + }, + }, + }, + matchup = { + enable = true, + }, + pairs = { + enable = true, + goto_right_end = false, + keymaps = { goto_partner = "%" }, + }, + textsubjects = { + enable = true, + keymaps = { ["."] = "textsubjects-smart", [";"] = "textsubjects-big" }, + }, + tree_docs = { + enable = true, + }, + endwise = { + enable = true, + }, + }) + end + }, + { + "hrsh7th/nvim-cmp", + event = "InsertEnter", + config = function() + local cmp = require("cmp") + + local has_words_before = function() + local line, col = unpack(vim.api.nvim_win_get_cursor(0)) + return col ~= 0 + and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1] + :sub(col, col) + :match("%s") + == nil + end + + local luasnip = require("luasnip") + + cmp.setup({ + snippet = { + expand = function(args) + require("luasnip").lsp_expand(args.body) + end, + }, + mapping = { + [""] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_next_item() + elseif luasnip.expand_or_jumpable() then + luasnip.expand_or_jump() + elseif has_words_before() then + cmp.complete() + else + fallback() + end + end, { + "i", + "s", + }), + [""] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_prev_item() + elseif luasnip.jumpable(-1) then + luasnip.jump(-1) + else + fallback() + end + end, { + "i", + "s", + }), + [""] = cmp.mapping.confirm({ + behavior = cmp.ConfirmBehavior.Replace, + select = true, + }), + }, + formatting = { + format = function(entry, vim_item) + -- set a name for each source + vim_item.menu = ({ + path = "[Path]", + nvim_lsp = "[LSP]", + luasnip = "[LuaSnip]", + dap = "[dap]", + })[entry.source.name] + return vim_item + end, + }, + sources = { + { name = "nvim_lsp" }, + { name = "luasnip" }, + { name = "path" }, + { name = "nvim_lsp_signature_help" }, + }, + }) + + require "cmp".setup.filetype( + { "dap-repl", "dapui_watches", "dapui_hover" }, { + sources = { + { name = "dap" }, + }, + }) + end, + dependencies = { + "hrsh7th/cmp-nvim-lsp", + "hrsh7th/cmp-path", + "hrsh7th/cmp-nvim-lsp-signature-help", + "rcarriga/cmp-dap", + { + "saadparwaiz1/cmp_luasnip", + dependencies = { + { + "L3MON4D3/LuaSnip", + event = "InsertCharPre", + keys = { + { "", function() require "luasnip".jump(1) end, mode = "i" }, + { "", function() require "luasnip".jump(-1) end, mode = "i" }, + }, + config = function() + require("luasnip/loaders/from_vscode").lazy_load() + end, + dependencies = { + "kitagry/vs-snippets", + "rafamadriz/friendly-snippets", + "kkonghao/snippet-dog", + }, + } + }, + }, + }, + }, + { + 'neovim/nvim-lspconfig', + config = function() + local lspconfig = require("lspconfig") + -- Enable (broadcasting) snippet capability for completion + local capabilities = vim.lsp.protocol.make_client_capabilities() + capabilities.textDocument.completion.completionItem.snippetSupport = true + capabilities.workspace.didChangeWatchedFiles.dynamicRegistration = true + capabilities = require("cmp_nvim_lsp").default_capabilities(capabilities) + + lspconfig.util.default_config = vim.tbl_extend( + "force", + lspconfig.util.default_config, + { + on_attach = require "cfg.lsp".on_attach_wrapper, + capabilities = capabilities, + flags = { + debounce_text_changes = 150, + }, + } + ) + + local function switch_source_header_splitcmd(bufnr, splitcmd) + bufnr = lspconfig.util.validate_bufnr(bufnr) + local clangd_client = lspconfig.util.get_active_client_by_name( + bufnr, + "clangd" + ) + local params = { uri = vim.uri_from_bufnr(bufnr) } + if clangd_client then + clangd_client.request( + "textDocument/switchSourceHeader", + params, + function(err, result) + if err then + error(tostring(err)) + end + if not result then + print("Corresponding file cannot be determined") + return + end + vim.api.nvim_command(splitcmd .. " " .. vim.uri_to_fname(result)) + end, + bufnr + ) + else + print( + "method textDocument/switchSourceHeader is not supported by any servers active on the current buffer" + ) + end + end + + local servers = { + bashls = {}, + fortls = {}, + lua_ls = { + on_attach = function(client, bufnr) + require("cfg.lsp").on_attach_wrapper( + client, + bufnr, + { auto_format = true } + ) + end, + settings = { + Lua = { + completion = { + callSnippet = "Both", + displayContext = 1, + }, + hint = { + enable = true, + } + } + }, + }, + ruff_lsp = {}, + pyright = {}, + clangd = { + cmd = { + "clangd", + "--enable-config", + "--completion-parse=auto", + "--completion-style=bundled", + "--header-insertion=iwyu", + "--header-insertion-decorators", + "--inlay-hints", + "--suggest-missing-includes", + "--folding-ranges", + "--function-arg-placeholders", + "--pch-storage=memory", + }, + commands = { + ClangdSwitchSourceHeader = { + function() + switch_source_header_splitcmd(0, "edit") + end, + description = "Open source/header in current buffer", + }, + ClangdSwitchSourceHeaderVSplit = { + function() + switch_source_header_splitcmd(0, "vsplit") + end, + description = "Open source/header in a new vsplit", + }, + ClangdSwitchSourceHeaderSplit = { + function() + switch_source_header_splitcmd(0, "split") + end, + description = "Open source/header in a new split", + }, + ClangdSwitchSourceHeaderTab = { + function() + switch_source_header_splitcmd(0, "tabedit") + end, + description = "Open source/header in a new tab", + }, + }, + on_attach = function(client, bufnr) + require("cfg.lsp").on_attach_wrapper(client, bufnr) + local cmpconfig = require("cmp.config") + local compare = require("cmp.config.compare") + cmpconfig.set_buffer({ + sorting = { + comparators = { + compare.offset, + compare.exact, + -- compare.scopes, + require("clangd_extensions.cmp_scores"), + compare.recently_used, + compare.locality, + compare.kind, + compare.sort_text, + compare.length, + compare.order, + }, + }, + }, bufnr) + vim.api.nvim_create_augroup("clang-format", {}) + vim.api.nvim_create_autocmd("BufWritePre", { + group = "clang-format", + buffer = bufnr, + callback = function() + if vim.fn.expand('%:p:h'):find("test") then + return + end + require("cfg.utils").format_hunks({ + bufnr = bufnr, + async = false, + id = client.id + }) + end, + }) + map.ncmd("gH", "ClangdSwitchSourceHeader") + map.ncmd("gvH", "ClangdSwitchSourceHeaderVSplit") + map.ncmd("gxH", "ClangdSwitchSourceHeaderSplit") + map.ncmd("gtH", "ClangdSwitchSourceHeaderSplit") + + require("clangd_extensions.inlay_hints").setup_autocmd() + require("clangd_extensions.inlay_hints").set_inlay_hints() + end, + init_options = { + usePlaceholders = true, + completeUnimported = true, + clangdFileStatus = true, + }, + }, + } + + for server, config in pairs(servers) do + local default_config = lspconfig[server].default_config or + lspconfig[server].document_config.default_config + local cmd = config.cmd or default_config.cmd + if vim.fn.executable(cmd[1]) == 1 then lspconfig[server].setup(config) end + end + end, + dependencies = { + "hrsh7th/cmp-nvim-lsp", + "ray-x/lsp_signature.nvim", + "jubnzv/virtual-types.nvim", + { 'folke/neodev.nvim', opts = {} }, + { "lvimuser/lsp-inlayhints.nvim", config = true }, + { + "p00f/clangd_extensions.nvim", + config = function() + require("clangd_extensions").setup({ + }) + end + }, + }, + }, + { + 'nvim-lualine/lualine.nvim', + opts = { + options = { + icons_enabled = false, + theme = 'gruvbox_dark', + component_separators = '', + section_separators = '|', + }, + sections = { + lualine_a = { 'filetype', { 'filename', path = 1 } }, + lualine_b = { '%l/%L:%c:%o' }, + lualine_c = { 'diff' }, + lualine_x = { 'searchcount, selectioncount' }, + lualine_y = {}, + lualine_z = { 'diagnostics' } + }, + inactive_sections = { + lualine_a = { 'filename' }, + lualine_b = {}, + lualine_c = {}, + lualine_x = {}, + lualine_y = {}, + lualine_z = {} + }, + }, + }, + { + "nvimtools/none-ls.nvim", + config = function() + local nls = require("null-ls") + nls.setup({ + on_attach = function(client, bufnr) + require("cfg.lsp").on_attach_wrapper( + client, + bufnr, + { auto_format = true } + ) + end, + sources = { + nls.builtins.formatting.black, + } + }) + end, + }, + "https://gitlab.com/HiPhish/rainbow-delimiters.nvim", +} diff --git a/home/.config/nvim/lua/mapper.lua b/home/.config/nvim/lua/mapper.lua new file mode 100644 index 0000000..c31aeca --- /dev/null +++ b/home/.config/nvim/lua/mapper.lua @@ -0,0 +1,84 @@ +local M = {} + +M.map = function(mode, keys, action, opts, bufnr) + opts = vim.tbl_extend("force", { silent = true, buffer = bufnr }, opts or {}) + vim.keymap.set(mode, keys, action, opts) +end + +M.cmdi = function(mode, keys, action, opts, bufnr) + opts = vim.tbl_extend("force", { silent = false }, opts or {}) + M.map(mode, keys, ":" .. action, opts, bufnr) +end + +M.cmd = function(mode, keys, action, opts, bufnr) + M.map(mode, keys, "" .. action .. "", opts, bufnr) +end + +M.plug = function(mode, keys, action, opts, bufnr) + M.map(mode, keys, "" .. action, opts, bufnr) +end + +M.n = function(keys, action, opts, bufnr) + M.map("n", keys, action, opts, bufnr) +end +M.ncmdi = function(keys, action, opts, bufnr) + M.cmdi("n", keys, action, opts, bufnr) +end +M.ncmd = function(keys, action, opts, bufnr) + M.cmd("n", keys, action, opts, bufnr) +end +M.nplug = function(keys, action, opts, bufnr) + M.plug("n", keys, "(" .. action .. ")", opts, bufnr) +end + +M.v = function(keys, action, opts, bufnr) + M.map("v", keys, action, opts, bufnr) +end +M.vcmdi = function(keys, action, opts, bufnr) + opts = vim.tbl_extend("force", { silent = false }, opts or {}) + M.v(keys, ":" .. action, opts, bufnr) +end +M.vcmd = function(keys, action, opts, bufnr) + M.vcmdi(keys, action .. "", opts, bufnr) +end +M.vplug = function(keys, action, opts, bufnr) + M.plug("v", keys, "(" .. action .. ")", opts, bufnr) +end + +M.nv = function(keys, action, opts, bufnr) + M.map({ "n", "v" }, keys, action, opts, bufnr) +end +M.nvcmdi = function(keys, action, opts, bufnr) + M.ncmdi(keys, action, opts, bufnr) + M.vcmdi(keys, action, opts, bufnr) +end +M.nvcmd = function(keys, action, opts, bufnr) + M.ncmd(keys, action, opts, bufnr) + M.vcmd(keys, action, opts, bufnr) +end +M.nvplug = function(keys, action, opts, bufnr) + M.plug({ "n", "v" }, keys, "(" .. action .. ")", opts, bufnr) +end + +M.i = function(keys, action, opts, bufnr) + M.map("i", keys, action, opts, bufnr) +end +M.iplug = function(keys, action, opts, bufnr) + opts = vim.tbl_extend("force", { silent = false }, opts or {}) + M.plug("i", keys, action, opts, bufnr) +end + +M.t = function(keys, action, opts, bufnr) + M.map("t", keys, action, opts, bufnr) +end +M.tcmdi = function(keys, action, opts, bufnr) + M.cmdi("t", keys, action, opts, bufnr) +end +M.tcmd = function(keys, action, opts, bufnr) + M.cmd("t", keys, action, opts, bufnr) +end +M.tplug = function(keys, action, opts, bufnr) + M.plug("t", keys, action, opts, bufnr) +end + +return M diff --git a/home/.config/pacman/makepkg.conf b/home/.config/pacman/makepkg.conf new file mode 100644 index 0000000..5c452e9 --- /dev/null +++ b/home/.config/pacman/makepkg.conf @@ -0,0 +1,11 @@ +CFLAGS="-march=native -Ofast -pipe -fomit-frame-pointer" +RUSTFLAGS="-C opt-level=2 -C target-cpu=native" +MAKEFLAGS="-j$(nproc)" +BUILDDIR=/tmp/makepkg +COMPRESSGZ=(pzip -c -f -n) +COMPRESSBZ2=(pzip2 -c -f) +COMPRESSGZ=(pigz -c -f -n) +COMPRESSBZ2=(pbzip2 -c -f) +COMPRESSXZ=(xz -c -z - --threads=0) +COMPRESSZST=(zstd -c -z -q - --threads=0) +PKGEXT='.pkg.tar.zst' diff --git a/home/.config/pam-gnupg b/home/.config/pam-gnupg new file mode 100644 index 0000000..0664d7c --- /dev/null +++ b/home/.config/pam-gnupg @@ -0,0 +1,7 @@ +91191A4A6E86279A901A7D38A7512EC126518FA5 +22747ABA1B4502F186654CD84DC353B0C3BD353F +9F3FCCA0F99AE1C5D05B834F0E89C79970A7B74A + +613F4BBF6E877E8CF55E18C24A429474B2F1A6AD +3D9578DBF76FC0D4272965CE8B3B04B7521AAD66 +23F3B67A62967CE2538EF1748CC3D4321A08F6BC diff --git a/home/.config/paru/paru.conf b/home/.config/paru/paru.conf new file mode 100644 index 0000000..fc0f9a9 --- /dev/null +++ b/home/.config/paru/paru.conf @@ -0,0 +1,25 @@ +# +# /etc/paru.conf +# ~/.config/paru/paru.conf +# +# See the paru.conf(5) manpage for options + +# +# GENERAL OPTIONS +# +[options] +PgpFetch +Devel +Provides +DevelSuffixes = -git -cvs -svn -bzr -darcs -always +# BottomUp +RemoveMake +SudoLoop +#UseAsk +CombinedUpgrade +BatchInstall +# UpgradeMenu +NewsOnUpgrade +CleanAfter +SaveChanges +NoWarn = strisemarx-* diff --git a/home/.config/pipewire/media-session.d/bluez-monitor.conf b/home/.config/pipewire/media-session.d/bluez-monitor.conf new file mode 100644 index 0000000..1752508 --- /dev/null +++ b/home/.config/pipewire/media-session.d/bluez-monitor.conf @@ -0,0 +1,130 @@ +# Bluez monitor config file for PipeWire version "0.3.34" # +# +# Copy and edit this file in /etc/pipewire/media-session.d/ +# for systemwide changes or in +# ~/.config/pipewire/media-session.d/ for local changes. + +properties = { + # These features do not work on all headsets, so they are enabled + # by default based on the hardware database. They can also be + # forced on/off for all devices by the following options: + + #bluez5.enable-sbc-xq = true + #bluez5.enable-msbc = true + #bluez5.enable-hw-volume = true + + # See bluez-hardware.conf for the hardware database. + + # Enabled headset roles (default: [ hsp_hs hfp_ag ]), this + # property only applies to native backend. Currently some headsets + # (Sony WH-1000XM3) are not working with both hsp_ag and hfp_ag + # enabled, disable either hsp_ag or hfp_ag to work around it. + # + # Supported headset roles: hsp_hs (HSP Headset), + # hsp_ag (HSP Audio Gateway), + # hfp_hf (HFP Hands-Free), + # hfp_ag (HFP Audio Gateway) + #bluez5.headset-roles = [ hsp_hs hsp_ag hfp_hf hfp_ag ] + + # Enabled A2DP codecs (default: all). + #bluez5.codecs = [ sbc sbc_xq aac ldac aptx aptx_hd aptx_ll aptx_ll_duplex faststream faststream_duplex ] + + # Properties for the A2DP codec configuration + #bluez5.default.rate = 48000 + #bluez5.default.channels = 2 +} + +rules = [ + # An array of matches/actions to evaluate. + { + # Rules for matching a device or node. It is an array of + # properties that all need to match the regexp. If any of the + # matches work, the actions are executed for the object. + matches = [ + { + # This matches all cards. + device.name = "~bluez_card.*" + } + ] + actions = { + # Actions can update properties on the matched object. + update-props = { + + # Auto-connect device profiles on start up or when only partial + # profiles have connected. Disabled by default if the property + # is not specified. + #bluez5.auto-connect = [ + # hfp_hf + # hsp_hs + # a2dp_sink + # hfp_ag + # hsp_ag + # a2dp_source + #] + bluez5.auto-connect = [ hfp_hf hsp_hs a2dp_sink ] + + # Hardware volume control (default: all) + #bluez5.hw-volume = [ + # hfp_hf + # hsp_hs + # a2dp_sink + # hfp_ag + # hsp_ag + # a2dp_source + #] + + # LDAC encoding quality + # Available values: auto (Adaptive Bitrate, default) + # hq (High Quality, 990/909kbps) + # sq (Standard Quality, 660/606kbps) + # mq (Mobile use Quality, 330/303kbps) + #bluez5.a2dp.ldac.quality = auto + + # AAC variable bitrate mode + # Available values: 0 (cbr, default), 1-5 (quality level) + #bluez5.a2dp.aac.bitratemode = 0 + + # Profile connected first + # Available values: a2dp-sink (default), headset-head-unit + #device.profile = a2dp-sink + + # A2DP <-> HFP profile auto-switching (when device is default output) + # Available values: false, role (default), true + # 'role' will switch the profile if the recording application + # specifies Communication (or "phone" in PA) as the stream role. + bluez5.autoswitch-profile = true + } + } + } + { + matches = [ + { + # Matches all sources. + node.name = "~bluez_input.*" + } + { + # Matches all sinks. + node.name = "~bluez_output.*" + } + ] + actions = { + update-props = { + #node.nick = "My Node" + #node.nick = null + #priority.driver = 100 + #priority.session = 100 + node.pause-on-idle = false + #resample.quality = 4 + #channelmix.normalize = false + #channelmix.mix-lfe = false + #session.suspend-timeout-seconds = 5 # 0 disables suspend + #monitor.channel-volumes = false + + # A2DP source role, "input" or "playback" + # Defaults to "playback", playing stream to speakers + # Set to "input" to use as an input for apps + #bluez5.a2dp-source-role = input + } + } + } +] diff --git a/home/.config/polybar/config b/home/.config/polybar/config new file mode 100644 index 0000000..c7fa364 --- /dev/null +++ b/home/.config/polybar/config @@ -0,0 +1,463 @@ +;========================================================== +; +; +; โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— +; โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•”โ•โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘ โ•šโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•— +; โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘ โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ• โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ• +; โ–ˆโ–ˆโ•”โ•โ•โ•โ• โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘ โ•šโ–ˆโ–ˆโ•”โ• โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•— +; โ–ˆโ–ˆโ•‘ โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ +; โ•šโ•โ• โ•šโ•โ•โ•โ•โ•โ• โ•šโ•โ•โ•โ•โ•โ•โ•โ•šโ•โ• โ•šโ•โ•โ•โ•โ•โ• โ•šโ•โ• โ•šโ•โ•โ•šโ•โ• โ•šโ•โ• +; +; +; To learn more about how to configure Polybar +; go to https://github.com/polybar/polybar +; +; The README contains a lot of information +; +;========================================================== + +[colors] +background = ${xrdb:color0:#1d2021} +background-alt = ${xrdb:color8:#928374} +foreground = ${xrdb:color15:#ebdbb2} +foreground-alt = ${xrdb:color7:#a89984} +primary = ${xrdb:color11:#fabd2f} +primary-alt = ${xrdb:color3:#d79921} +secondary = ${xrdb:color14:#8ec07c} +secondary-alt = ${xrdb:color6:#689d6a} +alert = ${xrdb:color9:#fb4934} +alert-alt = ${xrdb:color9:#cc241d} + +[bar/mybar] +monitor = ${env:MONITOR:} +width = 100% +height = 24 +;offset-x = 1% +;offset-y = 1% +radius = 0 +fixed-center = false + +background = ${colors.background} +foreground = ${colors.foreground} + +line-size = 3 +line-color = ${colors.alert-alt} + +border-size = 0 +border-color = ${colors.background-alt} + +padding-left = 0 +padding-right = 1 + +module-margin-left = 1 +module-margin-right = 1 + +font-0 = mono:size=8;1 +font-1 = unifont:fontformat=truetype:size=8:antialias=false;0 +font-2 = siji:pixelsize=10;1 +font-3 = NotoMono Nerd Font Mono:size=10;2 + +modules-left = bspwm +modules-center = xwindow +modules-right = filesystem pulseaudio cpu memory temperature gpu-usage gpu-memory gpu-temp wlan eth battery date + +tray-position = right +tray-padding = 1 +;tray-background = #0063ff + +wm-restack = bspwm +;wm-restack = i3 + +;override-redirect = true + +;scroll-up = bspwm-desknext +;scroll-down = bspwm-deskprev + +;scroll-up = i3wm-wsnext +;scroll-down = i3wm-wsprev + +cursor-click = pointer +cursor-scroll = ns-resize +enable-ipc = true + +[module/xwindow] +type = internal/xwindow +label = %title:0:15:...% + +[module/xkeyboard] +type = internal/xkeyboard +blacklist-0 = num lock + +format-prefix = "๎‰ฏ " +format-prefix-foreground = ${colors.foreground-alt} +format-prefix-underline = ${colors.secondary} + +label-layout = %layout% +label-layout-underline = ${colors.secondary} + +label-indicator-padding = 2 +label-indicator-margin = 1 +label-indicator-background = ${colors.secondary} +label-indicator-underline = ${colors.secondary} + +[module/filesystem] +type = internal/fs +interval = 25 + +mount-0 = / + +label-mounted = %{F#0a81f5}%mountpoint%%{F-}: %percentage_used%% +label-unmounted = %mountpoint% not mounted +label-unmounted-foreground = ${colors.foreground-alt} + +[module/bspwm] +type = internal/bspwm + +pin-workspaces = true +format = +label-focused = %index% +label-focused-background = ${colors.background-alt} +label-focused-underline= ${colors.primary} +label-focused-padding = 2 + +label-occupied = %index% +label-occupied-padding = 2 + +label-urgent = %index%! +label-urgent-background = ${colors.alert} +label-urgent-padding = 2 + +label-empty = %index% +label-empty-foreground = ${colors.foreground-alt} +label-empty-padding = 2 + +label-monocle = monocle +label-fullscreen = fullscreen +label-floating = floating +label-pseudotiled = pseudo +label-locked = locked +label-locked-foreground = ${colors.alert} +label-sticky = sticky +label-sticky-foreground = ${colors.alert} +label-private = private +label-private-foreground =${colors.alert} +label-marked = marked + +; Separator in between workspaces +; label-separator = | + +[module/i3] +type = internal/i3 +format = +index-sort = true +wrapping-scroll = false + +; Only show workspaces on the same output as the bar +;pin-workspaces = true + +label-mode-padding = 2 +label-mode-foreground = {colors.background} +label-mode-background = ${colors.primary} + +; focused = Active workspace on focused monitor +label-focused = %index% +label-focused-background = ${colors.background-alt} +label-focused-underline= ${colors.primary} +label-focused-padding = 2 + +; unfocused = Inactive workspace on any monitor +label-unfocused = %index% +label-unfocused-padding = 2 + +; visible = Active workspace on unfocused monitor +label-visible = %index% +label-visible-background = ${self.label-focused-background} +label-visible-underline = ${self.label-focused-underline} +label-visible-padding = ${self.label-focused-padding} + +; urgent = Workspace with urgency hint set +label-urgent = %index% +label-urgent-background = ${colors.alert} +label-urgent-padding = 2 + +; Separator in between workspaces +; label-separator = | + + +[module/mpd] +type = internal/mpd +format-online = + +icon-prev = ๎‚– +icon-stop = ๎‚™ +icon-play = ๎‚š +icon-pause = ๎‚› +icon-next = ๎‚œ + +label-song-maxlen = 25 +label-song-ellipsis = true + +[module/xbacklight] +type = internal/xbacklight + +format =