commit 5255ea5c2be24c8898e8adc9bd18cede034d9852 Author: FollieHiyuki Date: Sat Feb 13 19:28:59 2021 +0300 Initial commit diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..5c09818 --- /dev/null +++ b/LICENSE @@ -0,0 +1,19 @@ +MIT License Copyright (c) 2021 FollieHiyuki + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice (including the next +paragraph) shall be included in all copies or substantial portions of the +Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS +OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF +OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..cb5c611 --- /dev/null +++ b/README.md @@ -0,0 +1,69 @@ +

+ dotfiles_icon +

+ +### :question: What can you find here + +AnimuThinku + + **My personal dotfiles, which:** + + => is bloated (I use a lot of programs, sometimes just to try out) + => yet clean (follow XDG base directory specification) + => for [bspwm](https://github.com/baskerville/bspwm), [spectrwm](https://github.com/conformal/spectrwm), [sway](https://github.com/swaywm/sway), [wayfire](https://github.com/WayfireWM/wayfire), [river](https://github.com/ifreund/river), [hikari](https://hikari.acmelabs.space/) + => and features [Nord](https://github.com/arcticicestudio/nord) and [OneDark](https://github.com/joshdick/onedark.vim) colorschemes + +![sway](https://git.disroot.org/FollieHiyuki/dotfiles/raw/branch/master/assets/sway.png) + +### :package: Installation + +- Fonts: **[Sarasa Gothic](https://github.com/be5invis/Sarasa-Gothic)** + **Iosevka Nerd Font** + +- Other dependencies: + - jq, sysstat, psmisc, wireless_tools (status on spectrwm's bar) + - [light](https://github.com/haikarainen/light) / [brightnessctl](https://github.com/Hummer12007/brightnessctl) + - [bottom](https://github.com/clementtsang/bottom) + - [fzf](https://github.com/junegunn/fzf), [fd](https://github.com/sharkdp/fd), [ripgrep](https://github.com/BurntSushi/ripgrep) + - [greenclip](https://github.com/erebe/greenclip) / [clipman](https://github.com/yory8/clipman) + - [mpDris2](https://github.com/eonpatapon/mpDris2), [mpv-mpris](https://github.com/hoyon/mpv-mpris), [playerctl](https://github.com/altdesktop/playerctl) + - [delta](https://github.com/dandavison/delta), [bat](https://github.com/sharkdp/bat), [glow](https://github.com/charmbracelet/glow) (or [mdcat](https://github.com/lunaryorn/mdcat)), [exa](https://github.com/ogham/exa), pandoc (previewing in terminal) + - [starship](https://starship.rs/) + - [gallery-dl](https://github.com/mikf/gallery-dl) / [mangadl-bash](https://github.com/Akianonymus/mangadl-bash) + - [translate-shell](https://github.com/soimort/translate-shell) + - [pulsemixer](https://github.com/GeorgeFilipkin/pulsemixer) + - [nwg-launchers](https://github.com/nwg-piotr/nwg-launchers) / [wofi](https://hg.sr.ht/~scoopta/wofi) + - [rofi](https://github.com/davatorium/rofi) / [dmenu](https://git.disroot.org/FollieHiyuki/dmenu) + +- Run `deploy.sh` to deploy the dotfiles + +> zsh requires adding `export ZDOTDIR=$HOME/.config/zsh` to **/etc/zsh/zshenv** + +> Refer to [this gist](https://gist.github.com/st3r4g/6c681a28b0403b3b02636f510ff68039) for making `pipewire` work on Void Linux. The dotfiles works with `alsa` and `pulseaudio` too with some slightly changes. + +### :clipboard: TODO + +- [ ] ~~[Material](https://material-theme.site/) / [Ayu](https://github.com/ayu-theme/ayu-colors) palette~~ +- [ ] ~~[dotdrop](https://github.com/deadc0de6/dotdrop)~~ +- [x] Migrate zsh to [zinit](https://github.com/zdharma/zinit) +- [x] Wayland compositors +- [ ] ion / oksh / nushell / osh / xonsh / elvish / oh +- [ ] NixOS / Guix / Gentoo / FreeBSD +- [ ] New Neovim's config in Lua +- [ ] My own ~/.emacs.d + +### :star2: Credits & License + +- [@ChristianChiarulli](https://github.com/ChristianChiarulli) for the Neovim's config + +- [@hlissner](https://github.com/hlissner) for a detailed zsh config (and Doom Emacs) + +- My Waybar config is heavily inspired by [@begs](https://git.sr.ht/~begs/dotfiles) + +- I use some scripts from other people: + - [some fzf scripts](https://github.com/DanielFGray/fzf-scripts) + - [colorscripts](https://gitlab.com/dwt1/shell-color-scripts) + - **farge**, **tmpsms** and **tmpmail** from [@sdushantha](https://github.com/sdushantha) + - **ytmenu** from [here](https://github.com/sayan01/scripts) + +- You want some more **kawaii** wallpapers? Here is the list of artists: [@rimuu](https://rimuu.com/), [@hiten](https://www.pixiv.net/users/490219/artworks), [@Tiv](https://www.pixiv.net/en/users/35081), [@mery](https://www.pixiv.net/en/users/2750098), [@Mashima_saki](https://www.pixiv.net/en/users/18403608), [@Yuuki_Tatsuya](https://www.pixiv.net/en/users/27691), [@Bison倉鼠](https://www.pixiv.net/en/users/333556/artworks), [@Dana](https://twitter.com/hapong07), [@gomzi](https://twitter.com/gcmzi), [@Rella](https://twitter.com/Rellakinoko), [@dnwls3010](https://twitter.com/dnwls3010), [@Shigure_Ui](https://www.pixiv.net/en/users/431873), [@QuAn_](https://www.pixiv.net/en/users/6657532/artworks), [@杉87](https://twitter.com/k_su_keke1121), [@fuzichoco](https://twitter.com/fuzichoco), [@Astero](https://twitter.com/asteroid_ill), [@shin556](https://www.pixiv.net/en/users/642762) +- Others are under MIT license diff --git a/assets/AnimuThinku.png b/assets/AnimuThinku.png new file mode 100644 index 0000000..c5b319a Binary files /dev/null and b/assets/AnimuThinku.png differ diff --git a/assets/dotfiles.png b/assets/dotfiles.png new file mode 100644 index 0000000..5583849 Binary files /dev/null and b/assets/dotfiles.png differ diff --git a/assets/palette-nord b/assets/palette-nord new file mode 100644 index 0000000..fb50927 --- /dev/null +++ b/assets/palette-nord @@ -0,0 +1,23 @@ +Polar Night: +#2e3440 +#3b4252 +#434c5e +#4c566a + +Snow Storm: +#d8dee9 +#e5e9f0 +#eceff4 + +Frost: +#8fbcbb +#88c0d0 +#81a1c1 +#5e81ac + +Aurora: +#bf616a +#d08770 +#ebcb8b +#a3be8c +#b48ead diff --git a/assets/palette-onedark b/assets/palette-onedark new file mode 100644 index 0000000..5a4a165 --- /dev/null +++ b/assets/palette-onedark @@ -0,0 +1,25 @@ +Original colors: Doom Emacs' variant: +#181a1f #1b2229 +#282c34 #1c1f24 +#2c323c #202328 +#3b4048 #21242b +#3e4452 #23272e +#4b5263 #282c34 +#5c6470 #3f444a +#abb2bf #5b6268 + #73797e + #9ca0a4 + #dfdfdf + #bbc2cf + +#e06c75 #be5046 #ff6c6b +#98c379 #98be56 +#e5c07b #ecbe7b +#d19a66 #da8548 +#61afef #51afef #2257a0 +#c678dd #c678dd #a9a1e1 +#56b6c2 #4db5bd #5699af #46d9ff + +Additional colors: +#979eab +#8c9cff diff --git a/assets/public.key b/assets/public.key new file mode 100644 index 0000000..6851236 --- /dev/null +++ b/assets/public.key @@ -0,0 +1,52 @@ +-----BEGIN PGP PUBLIC KEY BLOCK----- + +mQINBGAEfCwBEACe6K6KcgGazlDFm3j1o6hT8PaCy87NWyP35yW95nysag0Qq1XN +0XKvbu33cWTQUI9b1G+/NW7TsUGNSvS8fjvFOKmEZlcrsx8Ica3k180aFoL4uj88 +kL0mbzCXm/GlRzSTy1VC2DwqsKIbrKplL3bMTNus2bZKheGUyAwI3v/IOXQ0w7C/ +k3oHCO0+FaKLRHlQDmAuMy09c/uQH39PXdqen3ZgKi10We0BIqcDE4nPtiD2BtVz +WhHNCQ/dlEe7ncH14syAMoPmsFeFM8sTfZj949PWlCZ5fwweLUyTyN6xpXQ5tkSp +L4cA1AoOMTU2DwKLIqGpyIM//WwVOr1RvoLTQ3u9xiF4LLEOB292Xh0KEuA1YLKv +6N1XFL1ASRyZvmA0ZEoKy3bnzrePjKXvb6wcffYtzEqT45CGqtJGMiadX4C/QyYl +MgAtLBjTZoEUzo/Z2JFU8Ifw4Lc4eWFCb3EXpqDLQr7R2JL3qHU9r15uTdpn+Hng +96WVXpMuDAjlh/YC94OA3uhrPlWwK47ZgiHsO84rcGNttFz6DUg8YlqvMAVDULwp +7TTvTwJBMl8DQ3C8MlqTAk6FJjBTmC673IuynLoHpv/V+A6WWk+AJgVu6QbTLh9E +M0OvyqXplFMe8YRNZ+/zgbh9C+q6syHcoKkTXPrr45lrl/kqSB9gIYvVLwARAQAB +tCxGb2xsaWVIaXl1a2kgPGZvbGxpZWthemV0YW5pQHByb3Rvbm1haWwuY29tPokC +TgQTAQgAOBYhBJ+wHjjd1+FFmkw9rIE89IT0mTQZBQJgBHwsAhsDBQsJCAcCBhUK +CQgLAgQWAgMBAh4BAheAAAoJEIE89IT0mTQZsikP/As/REpidKJhcwiYbCQEdSGV +tKI4lQlnv/g4gNpfAAdS9ERqU0tGxvjhBwlgUyEVmvRwVXG+7Fm1FpNXEj3D/+vl +JL6v7wGIKfR2LX1sD+aTMitKOpmedGXORJ801NEkyr3Q+t9i8asHWys9uvgbH8TQ +Z0KC+o7T9Ehdqe397/TZC22nDGLVuOxm4sHraHmsFK9EDYk9sYZew7Gs49MrvPI6 +APNXlHYYGKrTHdbxrilN7D5B8INEG5T+N5wM4C19eAZgYfgeEepVJjJeAeACZ1G1 +P/bx39ob0ivNFvCJ54rRNVogXZzjLtsz1BVV46/kJf9Y4Hu9xJPS+HoCyueZloMj ++vKcba5DnIny4f+7BL3pIUasoxmunq1kPjsVrpHAcICkNzE0TI4fEgY2WcVbpGLb +UYNsIpE7zCNGBLucps7zZVxWt4IxkI9oU+gQCi0kScVITGw1IRfL7ABeGi3HItui +Rt7scqEQ7cv86Y2V+sFBwfUpTJnfBIfCT8xLKu9MOOs5ggEIlfRzCdr5Yovzhrp7 +RgrUibYPewinSs0u9EKfEqM1PGGVW2VvyWI0+gQgkGptvCOoMCkeIy9ngqJSye6w +AzM8/XnkNkVlqCksOp9AEJbSEGB5jPPwC9K4RmaqPgdBpVlDpZl3qxLlGgjZFux5 +mzSE8N20+UZjhpfKzgAluQINBGAEfCwBEAC2ucd8UQSFN9V6CY9AJlfyPaelp120 +HdzfJwkHHo4PbHS3XET0LVIKp0Dy8A2lxvtZHYnZAZBczf7dHMIXzaJqndLP4j5s +LywSnPQ0WSru0glqeOhUDPksHYxdJM7vQHLjA127SJiLOdvmtCdhWUqS6LyNiHnj +kbGXZbsxuX6OO38js6ZkJ1DkWaJcn3wDNQHIdw3zIa1+a6s77cB0Dd7dhCF4MBsL +kQ4VcI6619GtnaHzW9XvTKA/C38Znw4C2FaGKnF7nSLe643wf9N+VFW6ERzE81RB +vZtHlToAOfE2Bc+xyu9VxWDdffUGQTA8SYKZroIMdQYLTxBSEIrL5DOdgRK000uD +gbfQXis74zDvhfDm6kxJJxBCKBpKNDSJOPGrWJi3nYBw47Pxw5vEvBB4xMmwK3QZ +z7zn5wH2LKsSZig+ej+DIqU3SZWCkPPK5FwZtk2Wji57vghBn2t/QQune+EosTQe +LPhPd5IqrieW4anq5Z0WGLCe8F7ZxzDUuoWyO3DGlPT7Bv1Pea9yL17pXjo2B09P +yjTzbv86S/VhdTeglj9W42kvXbZ7/iLPdS+l+YsmF4Ukq67q6vudMx2zi+YNHsXW +h/n8M/H0Ex1Qz2CpAMgjjo8dUzg47NA/8AKvkHGOnElGSV3aXL2fo105nYoy1yMN +R6drGaadYgtCIQARAQABiQI2BBgBCAAgFiEEn7AeON3X4UWaTD2sgTz0hPSZNBkF +AmAEfCwCGwwACgkQgTz0hPSZNBlLaw/+M0DDktb7Ioq93WNy0UwfbIZauqesjDKp +81IyUfRRWNtSHwXdZ1k0bz70h/bmNxqDKpFW2AjGGnr3zG8CTLSfsUZp8MbmaCzi +Hmn1ZCaPOSNsfCd2kAuXUjp8NoH5tshdYdmHZVc7K4nB6cFHVlUJiK1yFJQ4ZQtp +jL/V0e0whb89u/CX312Y6iwoYrElUn687qTPZCSYQ14AdeyiWi7Xq0b4O8TNuede +hbjnbQ0/7Ma2v2k/Lby/66HqKsbHn/qWkQE6XcJFlP4mLTKQy7v7SjtS4uCpzWcO +yyi/JXA1T2miDNLHFuQlNRB3hrsPTf6LkMR8NWvmbUlaZ4cnJMNDUVCCTG3hIu7c +b7k6A5hfV7myQvaKe+I6gysThfoGannF0OWQ1oAY82iKuuSAk+jgh+ShTnB+cLcN +a2KYAQL3jyS0a8T8QDetu/BoVwcXoL9MnoPuwheIHH5EXgbOE5lYdbqlvCE9oRup +v3bIiCP5gjx8AmnsTzXxuJLS4D1vk65s83wWTarNqvaNHtoSO3kKSV/u47QXG0xw +WHZeJOWYF5/orSj0h9LW/9kWBWlKVkRUpQkQqWZovKn0i3URBlF1lMmQ4V0ZSOw5 +NL+NaxnTomYJl/XKJN+8TxhmLXJORaZcuh5+PbgFCRhdhq+SBTzES+QbNJadOYy+ ++5tMxfcjYzE= +=ispU +-----END PGP PUBLIC KEY BLOCK----- diff --git a/assets/sway.png b/assets/sway.png new file mode 100644 index 0000000..11a75c0 Binary files /dev/null and b/assets/sway.png differ diff --git a/deploy.sh b/deploy.sh new file mode 100755 index 0000000..48f34c9 --- /dev/null +++ b/deploy.sh @@ -0,0 +1,135 @@ +#!/bin/sh + +echo "Shell (bash/zsh/fish): " +read -r shell +if [ -z "${shell}" ] +then exit +fi + +echo "Display server (wayland/x11): " +read -r server +if [ -z "${server}" ] +then exit +fi + +echo " +~~~ Installing shell config ~~~ +" +case ${shell} in + bash) + cp -rfv ./home/.bashrc-bloated ~/.bashrc + cp -rfv ./home/.bash_profile ~/.bash_profile + ;; + zsh) + cp -rfv ./home/.bashrc ~/.bashrc + cp -rfv ./home/.bash_profile ~/.bash_profile + cp -rfv ./home/.config/zsh/ ~/.config/zsh/ + cp -rfv ./home/.local/share/zsh/ ~/.local/share/zsh/ + ;; + fish) + cp -rfv ./home/.bashrc ~/.bashrc + cp -rfv ./home/.bash_profile ~/.bash_profile + cp -rfv ./home/.config/fish/ ~/.config/fish/ + mkdir -pv ~/.config/fish/completions + ;; + *) + exit ;; +esac + +echo " +~~~ Installing ${server} specified config ~~~ +" +case ${server} in + wayland) + cp -rfv ./home/.config/foot/ ~/.config/foot/ + cp -rfv ./home/.config/hikari/ ~/.config/hikari/ + cp -rfv ./home/.config/mako/ ~/.config/mako/ + cp -rfv ./home/.config/nwg-launchers/ ~/.config/nwg-launchers/ + cp -rfv ./home/.config/river/ ~/.config/river/ + cp -rfv ./home/.config/sway/ ~/.config/sway/ + cp -rfv ./home/.config/swaylock/ ~/.config/swaylock/ + cp -rfv ./home/.config/waybar/ ~/.config/waybar/ + cp -rfv ./home/.config/wofi/ ~/.config/wofi/ + cp -rfv ./home/.config/imv/ ~/.config/imv/ + cp -rfv ./home/.config/wayfire.ini ~/.config/wayfire.ini + ;; + x11) + cp -rfv ./home/.config/bsp-layout/ ~/.config/bsp-layout/ + cp -rfv ./home/.config/bspwm/ ~/.config/bspwm/ + cp -rfv ./home/.config/dunst/ ~/.config/dunst/ + cp -rfv ./home/.config/kitty/ ~/.config/kitty/ + cp -rfv ./home/.config/polybar/ ~/.config/polybar/ + cp -rfv ./home/.config/rofi/ ~/.config/rofi/ + cp -rfv ./home/.config/spectrwm/ ~/.config/spectrwm/ + cp -rfv ./home/.config/sxhkd/ ~/.config/sxhkd/ + cp -rfv ./home/.config/X11/ ~/.config/X11/ + cp -rfv ./home/.config/greenclip.cfg ~/.config/greenclip.cfg + cp -rfv ./home/.config/picom.conf ~/.config/picom.conf + ;; + *) + exit ;; +esac + +echo " +~~~ Installing standard config ~~~ +" +# Assests +mkdir -pv ~/Pictures +cp -rfv ./home/Pictures/Animated/ ~/Pictures/Animated/ +cp -rfv ./home/Pictures/Wallpapers/ ~/Pictures/Wallpapers/ +cp -rfv ./home/.local/share/fonts/ ~/.local/share/fonts/ +# Scripts +cp -rfv ./home/.local/bin/ ~/.local/bin/ +# The bloated dotfiles itself +cp -rfv ./home/.config/alacritty/ ~/.config/alacritty/ +cp -rfv ./home/.config/amfora/ ~/.config/amfora/ +cp -rfv ./home/.config/bottom/ ~/.config/bottom/ +cp -rfv ./home/.config/cava/ ~/.config/cava/ +cp -rfv ./home/.config/cointop/ ~/.config/cointop/ +cp -rfv ./home/.config/doom/ ~/.config/doom/ +cp -rfv ./home/.config/gallery-dl/ ~/.config/gallery-dl/ +cp -rfv ./home/.config/GIMP/ ~/.config/GIMP/ +cp -rfv ./home/.config/git/ ~/.config/git/ +cp -rfv ./home/.config/gtk-3.0/ ~/.config/gtk-3.0/ +cp -rfv ./home/.config/mpd/ ~/.config/mpd/ +cp -rfv ./home/.config/mpDris2/ ~/.config/mpDris2/ +cp -rfv ./home/.config/ncmpcpp/ ~/.config/ncmpcpp/ +cp -rfv ./home/.config/neofetch/ ~/.config/neofetch/ +cp -rfv ./home/.config/newsboat/ ~/.config/newsboat/ +cp -rfv ./home/.config/npm/ ~/.config/npm/ +cp -rfv ./home/.config/nvim/ ~/.config/nvim/ +cp -rfv ./home/.config/qutebrowser/ ~/.config/qutebrowser/ +cp -rfv ./home/.config/ranger/ ~/.config/ranger/ +cp -rfv ./home/.config/tmux/ ~/.config/tmux/ +cp -rfv ./home/.config/translate-shell/ ~/.config/translate-shell/ +cp -rfv ./home/.config/tridactyl/ ~/.config/tridactyl/ +cp -rfv ./home/.config/vifm/ ~/.config/vifm/ +cp -rfv ./home/.config/youtube-dl/ ~/.config/youtube-dl/ +cp -rfv ./home/.config/zathura/ ~/.config/zathura/ +cp -rfv ./home/.config/mimeapps.list ~/.config/mimeapps.list +cp -rfv ./home/.config/pulsemixer.cfg ~/.config/pulsemixer.cfg +cp -rfv ./home/.config/starship.toml ~/.config/starship.toml + +echo " +~~~ Cloning submodules ~~~ +" +[ -d ~/.config/emacs ] || git clone https://github.com/hlissner/doom-emacs ~/.config/emacs +[ -d ~/.config/tmux/plugins/tpm ] || git clone https://github.com/tmux-plugins/tpm ~/.config/tmux/plugins/tpm +[ -d ~/.config/ranger/plugins/ranger_devicons ] || git clone https://github.com/FollieHiyuki/ranger_devicons ~/.config/ranger/plugins/ranger_devicons + +# Post deployment +mkdir -pv ~/.local/share/bash +mkdir -pv ~/.local/share/mpd/playlists +mkdir -pv ~/.local/share/gallery-dl +# tridactyl needs `tridactylrc` to exist +touch ~/.config/tridactyl/tridactylrc + +mkdir -pv ~/.local/share/gnupg +chmod -v 700 ~/.local/share/gnupg +cp -rfv ./home/.local/share/gnupg/gpg-agent.conf ~/.local/share/gnupg/ +chmod -v 600 ~/.local/share/gnupg/* + +# chsh -s /usr/bin/${shell} ${USER} + +echo " +~~~ Finished ~~~" diff --git a/home/.bash_profile b/home/.bash_profile new file mode 100644 index 0000000..c6ce55a --- /dev/null +++ b/home/.bash_profile @@ -0,0 +1,7 @@ +#!/bin/bash + +[ -f $HOME/.bashrc ] && . $HOME/.bashrc + +# if [[ "$(tty)" = "/dev/tty1" ]]; then +# exec startx $HOME/.config/X11/xinitrc +# fi diff --git a/home/.bashrc b/home/.bashrc new file mode 100644 index 0000000..589f0d0 --- /dev/null +++ b/home/.bashrc @@ -0,0 +1,85 @@ +#!/usr/bin/env bash + +# a minimal approach when bash is not a default shell + +export BASH_COMPLETION_USER_DIR="$HOME/.local/share/bash" +export HISTFILE="$HOME/.local/share/bash/bash_history" + +# ________ _______________ +# __ ___/______ /__ /___(_)_____________ ________ +# _____ \_ _ \ __/ __/_ /__ __ \_ __ `/_ ___/ +# ____/ // __/ /_ / /_ _ / _ / / / /_/ /_(__ ) +# /____/ \___/\__/ \__/ /_/ /_/ /_/_\__, / /____/ +# /____/ +# vi mode +set -o vi + +# ignore upper and lowercase when TAB completion +bind "set completion-ignore-case on" + +# Shell options +shopt -s autocd +shopt -s cdspell +shopt -s cmdhist +shopt -s dotglob +shopt -s checkwinsize +shopt -s expand_aliases +shopt -s histappend + +# ________ _____ +# ___ __ \___________________ _____________ /_ +# __ /_/ /_ ___/ __ \_ __ `__ \__ __ \ __/ +# _ ____/_ / / /_/ / / / / / /_ /_/ / /_ +# /_/ /_/ \____//_/ /_/ /_/_ .___/\__/ +# /_/ +# +# get current branch in git repo +parse_git_branch() { + BRANCH=$(git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/') + if [ ! "${BRANCH}" = "" ] + then + STAT=$(parse_git_dirty) + echo "${BRANCH}${STAT}" + else + echo "" + fi +} + +# get current status of git repo +parse_git_dirty() { + status=$(git status 2>&1 | tee) + dirty=$(echo -n "${status}" 2> /dev/null | grep "modified:" &> /dev/null; echo "$?") + untracked=$(echo -n "${status}" 2> /dev/null | grep "Untracked files" &> /dev/null; echo "$?") + ahead=$(echo -n "${status}" 2> /dev/null | grep "Your branch is ahead of" &> /dev/null; echo "$?") + newfile=$(echo -n "${status}" 2> /dev/null | grep "new file:" &> /dev/null; echo "$?") + renamed=$(echo -n "${status}" 2> /dev/null | grep "renamed:" &> /dev/null; echo "$?") + deleted=$(echo -n "${status}" 2> /dev/null | grep "deleted:" &> /dev/null; echo "$?") + bits='' + if [ "${ahead}" = "0" ]; then + bits="*${bits}" + fi + if [ "${renamed}" = "0" ]; then + bits=">${bits}" + fi + if [ "${newfile}" = "0" ]; then + bits="+${bits}" + fi + if [ "${untracked}" = "0" ]; then + bits="?${bits}" + fi + if [ "${deleted}" = "0" ]; then + bits="x${bits}" + fi + if [ "${dirty}" = "0" ]; then + bits="!${bits}" + fi + if [ ! "${bits}" = "" ]; then + echo " ${bits}" + else + echo "" + fi +} + +# Prompt +export PS1="\[$(tput bold)\]\[$(tput setaf 1)\]╭─[\[$(tput setaf 3)\]\u\[$(tput setaf 2)\]@\[$(tput setaf 4)\]\h \$(if [[ \$? == 0 ]]; then echo \"\[$(tput setaf 2)\]\342\234\223\"; else echo \"\[$(tput setaf 1)\]\342\234\227\"; fi)\[$(tput setaf 1)\]] \[$(tput setaf 5)\]\w \[$(tput setaf 2)\]\`parse_git_branch\`\n\[$(tput setaf 1)\]╰\[$(tput sgr0)\] " +export PS2="\[\e[1;31m\]> " diff --git a/home/.bashrc-bloated b/home/.bashrc-bloated new file mode 100644 index 0000000..192033b --- /dev/null +++ b/home/.bashrc-bloated @@ -0,0 +1,767 @@ +#!/usr/bin/env bash + +# __________ +# ___ ____/_________ __ +# __ __/ __ __ \_ | / / +# _ /___ _ / / /_ |/ / +# /_____/ /_/ /_/_____/ +# +# XDG thingy +export XDG_CONFIG_HOME=$HOME/.config +export XDG_CACHE_HOME=$HOME/.cache +export XDG_DATA_HOME=$HOME/.local/share +export XDG_DATA_DIRS=$HOME/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share:/usr/share +# alternate paths +export HISTFILE="$XDG_DATA_HOME/bash/bash_history" +export BASH_COMPLETION_USER_DIR="$XDG_DATA_HOME/bash" +export LESSHISTFILE=- +export MOST_INITFILE=$XDG_CONFIG_HOME/mostrc +export GTK2_RC_FILES=$XDG_CONFIG_HOME/gtk-2.0/gtkrc +export TERMINFO="$XDG_DATA_HOME/terminfo" +export TERMINFO_DIRS="$XDG_DATA_HOME/terminfo:/usr/share/terminfo" +export GOPATH=$XDG_DATA_HOME/go +export GRADLE_USER_HOME=$XDG_DATA_HOME/gradle +export _JAVA_OPTIONS=-Djava.util.prefs.userRoot=$XDG_CONFIG_HOME/java +export NODE_REPL_HISTORY=$XDG_CACHE_HOME/node_repl_history +export NPM_CONFIG_USERCONFIG="$XDG_CONFIG_HOME/npm/npmrc" +export NPM_CONFIG_PREFIX="$XDG_DATA_HOME/npm-global" +export CARGO_HOME=$XDG_DATA_HOME/cargo +export RUSTUP_HOME=$XDG_DATA_HOME/rustup +export BUNDLE_USER_CONFIG=$XDG_CONFIG_HOME/bundle +export BUNDLE_USER_CACHE=$XDG_CACHE_HOME/bundle +export BUNDLE_USER_PLUGIN=$XDG_DATA_HOME/bundle +export GEM_HOME=$XDG_DATA_HOME/gem +export GEM_SPEC_CACHE=$XDG_CACHE_HOME/gem +export DOCKER_CONFIG=$XDG_CONFIG_HOME/docker +export GNUPGHOME=$XDG_DATA_HOME/gnupg +export JUPYTER_CONFIG_DIR=$XDG_CONFIG_HOME/jupyter +export IPYTHONDIR=$XDG_CONFIG_HOME/ipython +export XAUTHORITY=$XDG_RUNTIME_DIR/Xauthority +export XINITRC=$XDG_CONFIG_HOME/X11/xinitrc +export XSERVERRC=$XDG_CONFIG_HOME/X11/xserverrc + +# env +export PAGER=less +export VISUAL=nvim +export EDITOR=nvim +export SVDIR=$HOME/.local/share/service +export _JAVA_AWT_WM_NONREPARENTING=1 +export GPG_TTY="$(tty)" +# bat +export BAT_THEME="base16" +# pfetch +export PF_INFO="ascii title kernel wm shell uptime pkgs memory" +# fzf +export FZF_DEFAULT_OPTS="--multi --layout=reverse --inline-info + --color fg:#D8DEE9,bg:#2E3440,hl:#A3BE8C,fg+:#D8DEE9,bg+:#434C5E,hl+:#A3BE8C + --color pointer:#BF616A,info:#4C566A,spinner:#4C566A,header:#4C566A,prompt:#81A1C1,marker:#EBCB8B" +# export FZF_DEFAULT_OPTS="--multi --layout=reverse --inline-info +# --color dark +# --color fg:-1,bg:-1,hl:#c678dd,fg+:#ffffff,bg+:#4b5263,hl+:#d858fe +# --color info:#98c379,prompt:#61afef,pointer:#be5046,marker:#e5c07b,spinner:#61afef,header:#61afef" +export FZF_DEFAULT_COMMAND="fd --type f --follow --hidden --exclude .git" +export FZF_CTRL_T_OPTS="--no-height --preview-window 'left:60%' --preview '$HOME/.local/bin/garbage/preview {} 2>/dev/null'" +export FZF_CTRL_T_COMMAND="fd --follow --hidden --exclude .git" +export FZF_ALT_C_OPTS="--preview 'tree -La 1 -C --dirsfirst {} 2>/dev/null'" +export FZF_ALT_C_COMMAND="fd --type d --follow --hidden --exclude .git" +export FZF_TMUX=1 +# ibus +export GTK_IM_MODULE=ibus +export XMODIFIERS=@im=ibus +export QT_IM_MODULE=ibus +# qt5ct +export QT_QPA_PLATFORMTHEME=qt5ct +export QT_PLATFORM_PLUGIN=qt5ct +# .NET +export DOTNET_CLI_TELEMETRY_OPTOUT=1 +# z.lua +export _ZL_DATA="$HOME/.local/share/zlua/zlua" +export _ZL_HYPHEN=1 +export _ZL_MATCH_MODE=1 +export _ZL_FZF_FLAG="-e" +export _ZL_INT_SORT=1 +export _ZL_ROOT_MARKERS=".git,.svn,.hg,.root,package.json,.projectile,.pro" +export RANGER_ZLUA="$HOME/.local/share/bash/z.lua" +# Basher +export BASHER_ROOT="$HOME/.local/share/bash/basher" +# nodenv +export NODENV_ROOT="$HOME/.local/share/nodenv" +# pyenv +export PYENV_ROOT="$HOME/.local/share/pyenv" +# poetry +export POETRY_HOME="$HOME/.local/share/poetry" +# nnn +if command -v nnn >/dev/null +then + export TERMINAL=alacritty # for the preview script + export NNN_PLUG='t:preview-tui;m:nmount;f:fzcd;c:chksum;n:nuke;z:fzz;b:bulknew;d:dups:h:hexview;o:organize;p:pdfview;s:suedit' + export NNN_FIFO="/tmp/nnn.fifo" + export NNN_ARCHIVE='\\.(7z|a|ace|alz|arc|arj|bz|bz2|cab|cpio|deb|gz|jar|lha|lz|lzh|lzma|lzo|rar|rpm|rz|t7z|tar|tbz|tbz2|tgz|tlz|txz|tZ|tzo|war|xpi|xz|Z|zip)$' + export NNN_OPENER="$XDG_CONFIG_HOME/nnn/plugins/nuke" + export USE_SCOPE=1 + export NNN_COLORS='2345' + export NNN_FCOLORS='c1e2272e006033f7c6d6abc4' + export NNN_BMS="h:~;C:~/Code;D:~/Downloads;P:~/Pictures;V:~/Videos;A:~/Media;U:~/Music;f:~/.config;l:~/.local/share;e:/etc;u:/usr/share;o:/opt;b:/boot;m:/media;M:/mnt;i:/run/media/$USER;v:/var;t:/tmp;d:/dev;s:/srv;r:/;k:/bedrock/strata" + export NNN_SSHFS="sshfs -o reconnect,idmap=user,follow_symlinks" +fi +# lf +if command -v lf >/dev/null +then + export LF_ICONS="\ + tw=:\ + st=:\ + ow=:\ + dt=:\ + di=:\ + fi=:\ + ln=:\ + or=:\ + ex=:\ + *.7z=:\ + *.a=:\ + *.ace=:\ + *.alz=:\ + *.ai=:\ + *.apk=:\ + *.arc=:\ + *.arj=:\ + *.asm=:\ + *.asp=:\ + *.aup=:\ + *.avi=:\ + *.awk=:\ + *.bash=:\ + *.bat=:\ + *.bmp=:\ + *.bz=:\ + *.bz2=:\ + *.c=:\ + *.c++=:\ + *.cab=:\ + *.cbr=:\ + *.cbz=:\ + *.cc=:\ + *.class=:\ + *.clj=:\ + *.cljc=:\ + *.cljs=:\ + *.cmake=:\ + *.cmd=:\ + *.coffee=:\ + *.conf=:\ + *.cp=:\ + *.cpio=:\ + *.cpp=:\ + *.cs=:\ + *.csh=:\ + *.css=:\ + *.cue=:\ + *.cvs=:\ + *.cxx=:\ + *.d=:\ + *.dart=:\ + *.db=:\ + *.deb=:\ + *.diff=:\ + *.dll=:\ + *.doc=:\ + *.docx=:\ + *.dump=:\ + *.dwm=:\ + *.dz=:\ + *.edn=:\ + *.eex=:\ + *.efi=:\ + *.ejs=:\ + *.elf=:\ + *.elm=:\ + *.epub=:\ + *.ear=:\ + *.erl=:\ + *.esd=:\ + *.ex=:\ + *.exe=:\ + *.exs=:\ + *.f#=:\ + *.fifo=|:\ + *.fish=:\ + *.flac=:\ + *.flv=:\ + *.fs=:\ + *.fsi=:\ + *.fsscript=:\ + *.fsx=:\ + *.gem=:\ + *.gemspec=:\ + *.gif=:\ + *.go=:\ + *.gz=:\ + *.gzip=:\ + *.h=:\ + *.haml=:\ + *.hbs=:\ + *.hh=:\ + *.hpp=:\ + *.hrl=:\ + *.hs=:\ + *.htaccess=:\ + *.htm=:\ + *.html=:\ + *.htpasswd=:\ + *.hxx=:\ + *.ico=:\ + *.img=:\ + *.ini=:\ + *.iso=:\ + *.jar=:\ + *.java=:\ + *.jl=:\ + *.jpeg=:\ + *.jpg=:\ + *.js=:\ + *.json=:\ + *.jsx=:\ + *.key=:\ + *.ksh=:\ + *.leex=:\ + *.less=:\ + *.lha=:\ + *.lhs=:\ + *.log=:\ + *.lrz=:\ + *.lua=:\ + *.lz=:\ + *.lz4=:\ + *.lzh=:\ + *.lzma=:\ + *.lzo=:\ + *.m2v=:\ + *.m4a=:\ + *.m4v=:\ + *.markdown=:\ + *.md=:\ + *.mdx=:\ + *.mjpeg=:\ + *.mjpg=:\ + *.mjs=:\ + *.mkv=:\ + *.ml=λ:\ + *.mli=λ:\ + *.mng=:\ + *.mov=:\ + *.mp3=:\ + *.mp4=:\ + *.mp4v=:\ + *.mpeg=:\ + *.mpg=:\ + *.msi=:\ + *.mustache=:\ + *.nix=:\ + *.o=:\ + *.odt=:\ + *.ods=:\ + *.odp=:\ + *.ogg=:\ + *.pdf=:\ + *.php=:\ + *.pl=:\ + *.pm=:\ + *.png=:\ + *.pp=:\ + *.ppt=:\ + *.pptx=:\ + *.pro=:\ + *.ps1=:\ + *.psb=:\ + *.pub=:\ + *.py=:\ + *.pyc=:\ + *.pyd=:\ + *.pyo=:\ + *.r=ﳒ:\ + *.rake=:\ + *.rar=:\ + *.rb=:\ + *.rc=:\ + *.rlib=:\ + *.rmd=:\ + *.rom=:\ + *.rpm=:\ + *.rproj=鉶:\ + *.rs=:\ + *.rss=:\ + *.rtf=:\ + *.rz=:\ + *.s=:\ + *.sar=:\ + *.sass=:\ + *.scala=:\ + *.scss=:\ + *.sh=:\ + *.slim=:\ + *.sln=:\ + *.so=:\ + *.sql=:\ + *.styl=:\ + *.suo=:\ + *.svg=:\ + *.swift=:\ + *.swm=:\ + *.t=:\ + *.t7z=:\ + *.tar=:\ + *.taz=:\ + *.tbz=:\ + *.tbz2=:\ + *.tex=ﭨ:\ + *.tgz=:\ + *.tif=:\ + *.tiff=:\ + *.tlz=:\ + *.toml=:\ + *.ts=:\ + *.tsx=:\ + *.txz=:\ + *.tz=:\ + *.tzo=:\ + *.tzst=:\ + *.twig=:\ + *.vifm=:\ + *.vim=:\ + *.vimrc=:\ + *.vob=:\ + *.vue=﵂:\ + *.wav=:\ + *.war=:\ + *.webm=:\ + *.webmanifest=:\ + *.webp=:\ + *.wim=:\ + *.xbm=:\ + *.xbps=:\ + *.xcplayground=:\ + *.xhtml=:\ + *.xls=:\ + *.xlsx=:\ + *.xml=:\ + *.xpm=:\ + *.xul=:\ + *.xz=:\ + *.yaml=:\ + *.yml=:\ + *.z=:\ + *.zip=:\ + *.zoo=:\ + *.zsh=:\ + *.zip=:\ + *.zst=:\ + " +fi + +# PATH +export PATH=$HOME/.local/bin:$HOME/.local/bin/fzf:$HOME/.local/share/bash/basher/bin:$NODENV_ROOT/bin:$PYENV_ROOT/bin:$POETRY_HOME/bin:$CARGO_HOME/bin:$NPM_CONFIG_PREFIX/bin:$PATH + +# _________________ +# ___ |__ /__(_)_____ ________ +# __ /| |_ /__ /_ __ `/_ ___/ +# _ ___ | / _ / / /_/ /_(__ ) +# /_/ |_/_/ /_/ \__,_/ /____/ +# +# remap +alias doas="doas --" +alias p="pulsemixer" +alias ls="exa -lF --icons --sort=type" +alias la="exa -laF --icons --sort=type" +alias lt="exa --tree" +alias cp="cp -vir" +alias mv="mv -vir" +alias rm="rm -vr" +alias mkdir="mkdir -pv" +alias no="grep -viP" +alias wttr="curl wttr.in" +alias myip="curl ipinfo.io/geo" +alias latest_pkg="expac --timefmt='%Y-%m-%d %T' '%l\t%n' | sort | tail -n 30" +alias yarn="yarn --use-yarnrc $XDG_CONFIG_HOME/yarn/config" +alias tmux="TERM=screen-256color tmux" +alias cat="bat --style plain --color=always" +alias startx="startx $HOME/.config/X11/xinitrc" +alias fehwpp="feh --no-fehbg --bg-fill --randomize ~/Pictures/Wallpapers/*" +# colorizing +alias grep="grep --color=auto" +alias fgrep="fgrep --color=auto" +alias egrep="egrep --color=auto" +alias diff="diff --color=auto" +alias ncdu="ncdu --color=dark" +alias ip="ip -color=always" +# vim +alias v="nvim" +alias vi='nvim -o "$(fzf)"' +# emacs +alias doom="$HOME/.config/emacs/bin/doom" +alias e="emacs -nw" +alias emacs="emacsclient -c -a 'emacs'" +# rsync +alias rsyncdir="rsync -uavP --delete-after" +alias rsyncfile="rsync -avP" +# youtube-dl +alias yoump3="youtube-dl --extract-audio --audio-format mp3 --embed-thumbnail" +alias youflac="youtube-dl --extract-audio --audio-format flac" +alias youbest="youtube-dl -f bestvideo+bestaudio" +alias youlist="youtube-dl -f bestvideo+bestaudio --yes-playlist" +# z.lua +alias zz='z -c' # restrict matches to subdirs of $PWD +alias zi='z -i' # cd with interactive selection +alias zf='z -I' # use fzf to select in multiple matches +alias zb='z -b' # quickly cd to the parent directory +# nnn +alias nnn="nnn -Hc" +alias ncp="cat ${NNN_SEL:-${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.selection} | tr '\0' '\n'" + +# Lazy cd-ing +alias ..='cd ..' +alias ...='cd ../..' +alias ....='cd ../../..' + +# colorize man pages +man() { + LESS_TERMCAP_mb=$'\e[01;31m' \ + LESS_TERMCAP_md=$'\e[01;36m' \ + LESS_TERMCAP_me=$'\e[0m' \ + LESS_TERMCAP_se=$'\e[0m' \ + LESS_TERMCAP_so=$'\e[01;44;33m' \ + LESS_TERMCAP_ue=$'\e[0m' \ + LESS_TERMCAP_us=$'\e[01;32m' \ + command man $@ +} + +alias x=extract +extract() { + local remove_archive + local success + local extract_dir + + if (( $# == 0 )); then + cat <<-'EOF' >&2 + Usage: extract [-option] [file ...] + Options: + -r, --remove Remove archive after unpacking. + EOF + fi + + remove_archive=1 + if [[ "$1" == "-r" ]] || [[ "$1" == "--remove" ]]; then + remove_archive=0 + shift + fi + + while (( $# > 0 )); do + if [[ ! -f "$1" ]]; then + echo "extract: '$1' is not a valid file" >&2 + shift + continue + fi + + success=0 + extract_dir="${1:t:r}" + case "${1:l}" in + *.tar.gz|*.tgz) tar zxvf "$1" ;; + *.tar.bz2|*.tbz|*.tbz2) tar xvjf "$1" ;; + *.tar.xz|*.txz) + tar --xz -xvf "$1" || xzcat "$1" | tar xvf - ;; + *.tar.zma|*.tlz) + tar --lzma -xvf "$1" || lzcat "$1" | tar xvf - ;; + *.tar.zst|*.tzst) + tar --zstd -xvf "$1" || zstdcat "$1" | tar xvf - ;; + *.tar) tar xvf "$1" ;; + *.tar.lz) tar xvf "$1" ;; + *.tar.lz4) lz4 -c -d "$1" | tar xvf - ;; + *.tar.lrz) lrzuntar "$1" ;; + *.gz) gunzip -k "$1" ;; + *.bz2) bunzip2 "$1" ;; + *.xz) unxz "$1" ;; + *.lrz) lrunzip "$1" ;; + *.lz4) lz4 -d "$1" ;; + *.lzma) unlzma "$1" ;; + *.z) uncompress "$1" ;; + *.zip|*.war|*.jar|*.sublime-package|*.ipa|*.ipsw|*.xpi|*.apk|*.aar|*.whl) unzip "$1" -d "$extract_dir" ;; + *.rar) unrar x -ad "$1" ;; + *.rpm) mkdir "$extract_dir" && cd "$extract_dir" && rpm2cpio "../$1" | cpio --quiet -id && cd .. ;; + *.7z) 7za x "$1" ;; + *.deb) + mkdir -p "$extract_dir/control" + mkdir -p "$extract_dir/data" + cd "$extract_dir"; ar vx "../${1}" > /dev/null + cd control; tar xzvf ../control.tar.gz + cd ../data; extract ../data.tar.* + cd ..; rm *.tar.* debian-binary + cd .. + ;; + *.zst) unzstd "$1" ;; + *) + echo "extract: '$1' cannot be extracted" >&2 + success=1 + ;; + esac + + (( success = $success > 0 ? $success : $? )) + (( $success == 0 )) && (( $remove_archive == 0 )) && rm "$1" + shift + done +} + +# update Basher +basher_update() { + pushd $HOME/.local/share/bash/basher >/dev/null || exit + git pull + echo -e "\e[01;34mFinished updating Basher\e[0m" + popd >/dev/null || exit +} + +# upgrade Basher's packages +basherpacks_update() { + packages=$(basher list) + for pack in $packages + do + echo -e "\e[01;34mUpgrading $pack\e[0m" + basher upgrade "$pack" >/dev/null 2>&1 + done +} + +# nnn with cd on quit +n () +{ + # Block nesting of nnn in subshells + if [[ -n $NNNLVL ]] && [ "${NNNLVL:-0}" -ge 1 ]; then + echo "nnn is already running" + return + fi + + # The default behaviour is to cd on quit (nnn checks if NNN_TMPFILE is set) + # To cd on quit only on ^G, remove the "export" as in: + # NNN_TMPFILE="${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.lastd" + # NOTE: NNN_TMPFILE is fixed, should not be modified + export NNN_TMPFILE="${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.lastd" + + # Unmask ^Q (, ^V etc.) (if required, see `stty -a`) to Quit nnn + # stty start undef + # stty stop undef + # stty lwrap undef + # stty lnext undef + + nnn "$@" + + if [ -f "$NNN_TMPFILE" ]; then + . "$NNN_TMPFILE" + rm -f "$NNN_TMPFILE" > /dev/null + fi +} + +# nnn in dual pane mode (tmux) +n2() { + tmux new-session -d -s nnn -n nnn "nnn -Hc" + tmux split-window -h "nnn -Hc" + TERM=screen-256color tmux attach -t nnn:nnn +} + +# typing speed testing +tt() { + iconv -f UTF-8 -t ASCII "$1" | sed 's/--/-/g' \ + | sed '/^$/d' | sed 's/^[ \t]*//' | sed 's/\(^.\{1,80\}\).*/\1/' \ + > /tmp/tt.txt + command tt /tmp/tt.txt +} + +# ________ ______ +# ___ __ )_____ __________ /______________ +# __ __ | __ `/_ ___/_ __ \ _ \_ ___/ +# _ /_/ // /_/ /_(__ )_ / / / __/ / +# /_____/ \__,_/ /____/ /_/ /_/\___//_/ +# +# Install Basher if missing +if [[ ! -d $HOME/.local/share/bash/basher ]]; then + git clone https://github.com/basherpm/basher.git $HOME/.local/share/bash/basher +fi +eval "$(basher init - bash)" +# Plugins +# [[ -d $HOME/.local/share/bash/basher/cellar/packages/kazhala/dotbare ]] || basher install kazhala/dotbare +[[ -d $HOME/.local/share/bash/basher/cellar/packages/wfxr/forgit ]] || basher install wfxr/forgit +[[ -d $HOME/.local/share/bash/basher/cellar/packages/holman/spark ]] || basher install holman/spark +[[ -d $HOME/.local/share/bash/basher/cellar/packages/unixorn/git-extra-commands ]] || basher install unixorn/git-extra-commands + +# Plugins' init +# include kazhala/dotbare dotbare.plugin.bash && _dotbare_completion_cmd +include wfxr/forgit forgit.plugin.sh + +# ________ _______________ +# __ ___/______ /__ /___(_)_____________ ________ +# _____ \_ _ \ __/ __/_ /__ __ \_ __ `/_ ___/ +# ____/ // __/ /_ / /_ _ / _ / / / /_/ /_(__ ) +# /____/ \___/\__/ \__/ /_/ /_/ /_/_\__, / /____/ +# /____/ +# +mkdir -p "$BASH_COMPLETION_USER_DIR/completions" + +# github cli completion +if command -v gh >/dev/null && [ ! -f "$BASH_COMPLETION_USER_DIR/completions/gh" ]; then + gh completion -s bash > "$BASH_COMPLETION_USER_DIR/completions/gh" +fi +# kitten from kitty +if command -v kitty > /dev/null; then + source <(kitty + complete setup bash) +fi +# Starship prompt +if command -v starship > /dev/null; then + eval "$(starship init bash --print-full-init)" +fi +# direnv +if command -v direnv >/dev/null ; then + eval "$(direnv hook bash)" +fi +# poetry +# if [ ! -d "$POETRY_HOME" ]; then +# curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python - +# fi +# if [[ ! -f $BASH_COMPLETION_USER_DIR/completions/poetry ]]; then +# poetry completions bash > "$BASH_COMPLETION_USER_DIR/completions/poetry" +# fi +# pyenv +# if [[ ! -d $PYENV_ROOT ]]; then +# git clone https://github.com/pyenv/pyenv.git $PYENV_ROOT +# git clone https://github.com/pyenv/pyenv-virtualenv.git $PYENV_ROOT/plugins/pyenv-virtualenv +# git clone https://github.com/pyenv/pyenv-update.git $PYENV_ROOT/plugins/pyenv-update +# fi +# eval "$(pyenv init -)" +# eval "$(pyenv virtualenv-init -)" +# nodenv +# if [[ ! -d $NODENV_ROOT ]]; then +# git clone https://github.com/nodenv/nodenv.git $NODENV_ROOT +# mkdir -p $NODENV_ROOT/plugins +# git clone https://github.com/nodenv/node-build.git $NODENV_ROOT/plugins/node-build +# git clone https://github.com/nodenv/nodenv-env.git $NODENV_ROOT/plugins/nodenv-env +# git clone https://github.com/nodenv/nodenv-man.git $NODENV_ROOT/plugins/nodenv-man +# git clone https://github.com/nodenv/nodenv-aliases.git $NODENV_ROOT/plugins/nodenv-aliases +# git clone https://github.com/nodenv/nodenv-each.git $NODENV_ROOT/plugins/nodenv-each +# git clone https://github.com/nodenv/nodenv-update.git $NODENV_ROOT/plugins/nodenv-update +# git clone https://github.com/nodenv/nodenv-vars.git $NODENV_ROOT/plugins/nodenv-vars +# fi +# eval "$(nodenv init -)" +# z.lua +if [[ ! -f "$HOME/.local/share/bash/z.lua" ]]; then + curl -sfLo $HOME/.local/share/bash/z.lua https://raw.githubusercontent.com/skywind3000/z.lua/master/z.lua + mkdir -p $HOME/.local/share/zlua +fi +eval "$(lua $HOME/.local/share/bash/z.lua --init bash fzf)" +# autostart gpg-agent at login +if ! pgrep -u "$USER" gpg-agent >/dev/null; then + gpg-agent --daemon --enable-ssh-support >/dev/null +fi +if [[ -z "$SSH_AUTH_SOCK" ]]; then + export SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)" +fi +gpg-connect-agent updatestartuptty /bye >/dev/null + +# vi mode +set -o vi +bind 'set show-mode-in-prompt on' +bind 'set vi-cmd-mode-string "\e[01;32mN "' +bind 'set vi-ins-mode-string "\e[01;32mI "' + +# ignore upper and lowercase when TAB completion +bind "set completion-ignore-case on" + +# Shell options +shopt -s autocd +shopt -s cdspell +shopt -s cmdhist +shopt -s dotglob +shopt -s checkwinsize +shopt -s expand_aliases +shopt -s histappend + +# this is overkilled but it works conveniently +[[ -d $HOME/.local/share/bash/basher/cellar/packages/junegunn/fzf ]] || basher install junegunn/fzf +include junegunn/fzf shell/key-bindings.bash +include junegunn/fzf shell/completion.bash +export FZF_COMPLETION_OPTS='-x' + +# Use fd instead of find for fzf_completion +_fzf_compgen_path() { + fd --hidden --follow --exclude ".git" . "$1" +} + +_fzf_compgen_dir() { + fd --type d --hidden --follow --exclude ".git" . "$1" +} + +# Some more completions with fzf +_fzf_setup_completion path ag kubectl +_fzf_setup_completion dir tree + +# ^X^R +bind "$(bind -s | grep '^"\\C-r"' | sed 's/"/"\\C-x/' | sed 's/"$/\\C-m"/')" + +# ________ _____ +# ___ __ \___________________ _____________ /_ +# __ /_/ /_ ___/ __ \_ __ `__ \__ __ \ __/ +# _ ____/_ / / /_/ / / / / / /_ /_/ / /_ +# /_/ /_/ \____//_/ /_/ /_/_ .___/\__/ +# /_/ +# +# get current branch in git repo +parse_git_branch() { + BRANCH=$(git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/') + if [ ! "${BRANCH}" = "" ] + then + STAT=$(parse_git_dirty) + echo "${BRANCH}${STAT}" + else + echo "" + fi +} + +# get current status of git repo +parse_git_dirty() { + status=$(git status 2>&1 | tee) + dirty=$(echo -n "${status}" 2> /dev/null | grep "modified:" &> /dev/null; echo "$?") + untracked=$(echo -n "${status}" 2> /dev/null | grep "Untracked files" &> /dev/null; echo "$?") + ahead=$(echo -n "${status}" 2> /dev/null | grep "Your branch is ahead of" &> /dev/null; echo "$?") + newfile=$(echo -n "${status}" 2> /dev/null | grep "new file:" &> /dev/null; echo "$?") + renamed=$(echo -n "${status}" 2> /dev/null | grep "renamed:" &> /dev/null; echo "$?") + deleted=$(echo -n "${status}" 2> /dev/null | grep "deleted:" &> /dev/null; echo "$?") + bits='' + if [ "${ahead}" = "0" ]; then + bits="*${bits}" + fi + if [ "${renamed}" = "0" ]; then + bits=">${bits}" + fi + if [ "${newfile}" = "0" ]; then + bits="+${bits}" + fi + if [ "${untracked}" = "0" ]; then + bits="?${bits}" + fi + if [ "${deleted}" = "0" ]; then + bits="x${bits}" + fi + if [ "${dirty}" = "0" ]; then + bits="!${bits}" + fi + if [ ! "${bits}" = "" ]; then + echo " ${bits}" + else + echo "" + fi +} + +# Prompt +export PS1="\[$(tput bold)\]\[$(tput setaf 1)\]╭─[\[$(tput setaf 3)\]\u\[$(tput setaf 2)\]@\[$(tput setaf 4)\]\h \$(if [[ \$? == 0 ]]; then echo \"\[$(tput setaf 2)\]\342\234\223\"; else echo \"\[$(tput setaf 1)\]\342\234\227\"; fi)\[$(tput setaf 1)\]] \[$(tput setaf 5)\]\w \[$(tput setaf 2)\]\`parse_git_branch\`\n\[$(tput setaf 1)\]╰\[$(tput sgr0)\] " +export PS2="\[\e[1;31m\]> " + +# _________ __________ +# __ ____/__________________ /___(_)_____________ _ +# _ / __ __ ___/ _ \ _ \ __/_ /__ __ \_ __ `/ +# / /_/ / _ / / __/ __/ /_ _ / _ / / / /_/ / +# \____/ /_/ \___/\___/\__/ /_/ /_/ /_/_\__, / +# /____/ +$HOME/.local/bin/bunny diff --git a/home/.config/GIMP/2.10/splashes/splash.png b/home/.config/GIMP/2.10/splashes/splash.png new file mode 100644 index 0000000..7f01d62 Binary files /dev/null and b/home/.config/GIMP/2.10/splashes/splash.png differ diff --git a/home/.config/X11/Xresources b/home/.config/X11/Xresources new file mode 100644 index 0000000..9256662 --- /dev/null +++ b/home/.config/X11/Xresources @@ -0,0 +1,118 @@ +! general +Xft.dpi: 96 +Xft.autohint: 1 +Xft.lcdfilter: lcddefault +Xft.hintstyle: hintslight +Xft.hinting: 1 +Xft.antialias: 1 +Xft.rgba: rgb + +! --- Nord --- ! +*.foreground: #d8dee9 +*.background: #2e3440 +*.cursorColor: #d8dee9 +*.color0: #3b4252 +*.color8: #4c566a +*.color1: #bf616a +*.color9: #bf616a +*.color2: #a3be8c +*.color10: #a3be8c +*.color3: #ebcb8b +*.color11: #ebcb8b +*.color4: #81a1c1 +*.color12: #81a1c1 +*.color5: #b48ead +*.color13: #b48ead +*.color6: #88c0d0 +*.color14: #8fbcbb +*.color7: #e5e9f0 +*.color15: #eceff4 +! -- OneDark -- ! +! *.foreground: #abb2bf +! *.background: #282c34 +! *.cursorColor: #bbc2cf +! *.color0: #282c34 +! *.color8: #3e4452 +! *.color1: #be5046 +! *.color9: #e06c75 +! *.color2: #98c379 +! *.color10: #98c379 +! *.color3: #d19a66 +! *.color11: #e5c07b +! *.color4: #61afef +! *.color12: #61afef +! *.color5: #c678dd +! *.color13: #c678dd +! *.color6: #56b6c2 +! *.color14: #56b6c2 +! *.color7: #abb2bf +! *.color15: #bbc2cf + +! _____ _________ _____ +! __ / / /__ __ \___ ____ ___ /_ +! _ / / /__ /_/ /_ |/_/_ | / / __/ +! / /_/ / _ _, _/__> < __ |/ // /_ +! \____/ /_/ |_| /_/|_| _____/ \__/ + +! font +URxvt.font: xft:Iosevka Nerd Font:size=12 +URxvt.boldFont: xft:Iosevka Nerd Font:style=Bold:size=12 +URxvt.italicFont: xft:Iosevka Nerd Font:style=Italic:size=12 +URxvt.boldItalicFont: xft:Iosevka Nerd Font:style=Bold Italic:size=12 +! spacing +URxvt.letterSpace: -1 +URxvt.lineSpace: 0 +! do not scroll with output +URxvt*scrollTtyOutput: false +! scroll in relation to buffer (with mouse scroll or Shift+Page Up) +URxvt*scrollWithBuffer: true +! scroll back to the bottom on keypress +URxvt*scrollTtyKeypress: true +! no scrollbar +URxvt.scrollBar: false +URxvt.scrollBar_right: false +URxvt.scrollBar_floating: false +URxvt.scrollstyle: rxvt +! no scrollback buffer in secondary screen +URxvt.secondaryScreen: 1 +URxvt.secondaryScroll: 0 +! no output when pressing Print +URxvt.print-pipe: "cat > /dev/null" +! ring +URxvt.urgentOnBell: false +! transparency +URxvt.depth: 32 +! ibus +URxvt.inputMethod: ibus +URxvt.preeditType: OverTheSpot + +! perl extensions +URxvt.perl-ext-common:default,matcher,tabbed,clipboard,resize-font + +! urls +URxvt.url-launcher: /usr/bin/firefox +URxvt.matcher.button: 1 +URxvt.matcher.rend.0: Uline Bold fg3 +URxvt.underlineURLs: true +URxvt.keysym.C-Delete: perl:matcher:last +URxvt.keysym.M-Delete: perl:matcher:list + +! tabs +URxvt.tabbed.tabbar-fg: 4 +URxvt.tabbed.tabbar-bg: 0 +URxvt.tabbed.tab-fg: 0 +URxvt.tabbed.tab-bg: 4 + +! let Ctrl+Shift work +URxvt.iso14755: false +URxvt.iso14755_52: false +! clipboard +URxvt.clipboard.autocopy: false +URxvt.keysym.C-Shift-C: perl:clipboard:copy +URxvt.keysym.C-Shift-V: perl:clipboard:paste +URxvt.keysym.C-M-v: perl:clipboard:paste_escaped + +! resize-font +URxvt.keysym.C-minus:resize-font:smaller +URxvt.keysym.C-equal:resize-font:bigger +URxvt.keysym.C-0:resize-font:reset diff --git a/home/.config/X11/xinitrc b/home/.config/X11/xinitrc new file mode 100644 index 0000000..4cd3b9c --- /dev/null +++ b/home/.config/X11/xinitrc @@ -0,0 +1,57 @@ +#!/bin/sh + +userresources=$HOME/.config/X11/Xresources +usermodmap=$HOME/.config/X11/Xmodmap +sysresources=/etc/X11/xinit/.Xresources +sysmodmap=/etc/X11/xinit/.Xmodmap + +# merge in defaults and keymaps +if [ -f $sysresources ]; then + xrdb -merge $sysresources +fi + +if [ -f $sysmodmap ]; then + xmodmap $sysmodmap +fi + +if [ -f "$userresources" ]; then + xrdb -merge "$userresources" +fi + +if [ -f "$usermodmap" ]; then + xmodmap "$usermodmap" +fi + +# start some nice programs +if [ -d /etc/X11/xinit/xinitrc.d ] ; then + for f in /etc/X11/xinit/xinitrc.d/?*.sh ; do + [ -x "$f" ] && . "$f" + done + unset f +fi + +pipewire & +if ! pgrep -f mpd > /dev/null ; +then + mpd & +fi +dunst & +greenclip daemon & +ibus-daemon -drx & +emacs --daemon & +picom -b & +# xrandr --output eDP-1 --primary --auto --output DP-2 --left-of eDP-1 --auto --output HDMI-2 --right-of eDP-1 --auto & +# $HOME/.local/bin/garbage/off_touch & +# animatedwall --full ~/Pictures/Animated/fubuki.mp4 & +feh --no-fehbg --bg-fill --randomize ~/Pictures/Wallpapers/* & + +export XDG_SESSION_TYPE=x11 +export PATH=$HOME/.local/bin/X11:$PATH + +session=${1:-spectrwm} + +case $session in + bspwm ) exec bspwm ;; + spectrwm ) exec spectrwm -c ~/.config/spectrwm/spectrwm-nord.conf ;; + * ) exec "$1" ;; +esac diff --git a/home/.config/alacritty/alacritty.yml b/home/.config/alacritty/alacritty.yml new file mode 100644 index 0000000..e89a9dc --- /dev/null +++ b/home/.config/alacritty/alacritty.yml @@ -0,0 +1,408 @@ +# Configuration for Alacritty, the GPU enhanced terminal emulator. + +env: + TERM: alacritty + +window: + padding: + x: 2 + y: 2 + + dynamic_padding: false + + decorations: none + + title: Alacritty + + class: + instance: Alacritty + general: Alacritty + + gtk_theme_variant: dark + + dynamic_title: true + +scrolling: + history: 50000 + + multiplier: 5 + +font: + normal: + family: Iosevka Nerd Font + style: Regular + + bold: + family: Iosevka Nerd Font + style: Bold + + italic: + family: Iosevka Nerd Font + style: Italic + + bold_italic: + family: Iosevka Nerd Font + style: Bold Italic + + size: 12 + + offset: + x: 0 + y: 0 + + glyph_offset: + x: 0 + y: 0 + +draw_bold_text_with_bright_colors: false + +colors: + + # --- Nord --- # + primary: + background: '#2e3440' + foreground: '#d8dee9' + + cursor: + text: '#2e3440' + cursor: '#d8dee9' + + selection: + text: '#2e3440' + background: '#d8dee9' + + normal: + black: '#3b4252' + red: '#bf616a' + green: '#a3be8c' + yellow: '#ebcb8b' + blue: '#81a1c1' + magenta: '#b48ead' + cyan: '#88c0d0' + white: '#e5e9f0' + + bright: + black: '#4c566a' + red: '#bf616a' + green: '#a3be8c' + yellow: '#ebcb8b' + blue: '#81a1c1' + magenta: '#b48ead' + cyan: '#8fbcbb' + white: '#eceff4' + + # -- OneDark -- # + # primary: + # background: '#282c34' + # foreground: '#abb2bf' + + # cursor: + # text: '#282c34' + # cursor: '#bbc2cf' + + # selection: + # text: '#282c34' + # background: '#abb2bf' + + # normal: + # black: '#282c34' + # red: '#be5046' + # green: '#98c379' + # yellow: '#d19a66' + # blue: '#61afef' + # magenta: '#c678dd' + # cyan: '#56b6c2' + # white: '#abb2bf' + + # bright: + # black: '#3e4452' + # red: '#e06c75' + # green: '#98c379' + # yellow: '#e5c07b' + # blue: '#61afef' + # magenta: '#c678dd' + # cyan: '#56b6c2' + # white: '#bbc2cf' + +background_opacity: 1.0 + +selection: + #semantic_escape_chars: ",│`|:\"' ()[]{}<>\t" + + # When set to `true`, selected text will be copied to the primary clipboard. + save_to_clipboard: false + +cursor: + # Cursor style + # + # Values for `style`: + # - ▇ Block + # - _ Underline + # - | Beam + style: Block + #vi_mode_style: None + + # If this is `true`, the cursor will be rendered as a hollow box when the + # window is not focused. + unfocused_hollow: true + +# Live config reload (changes require restart) +live_config_reload: false + +#shell: +# program: /bin/bash +# args: +# - --login + +# Startup directory +# +# Directory the shell is started in. If this is unset, or `None`, the working +# directory of the parent process will be used. +working_directory: None + +# Send ESC (\x1b) before characters when alt is pressed. +#alt_send_esc: true + +mouse: +# Click settings +# +# The `double_click` and `triple_click` settings control the time +# alacritty should wait for accepting multiple clicks as one double +# or triple click. + double_click: { threshold: 300 } + triple_click: { threshold: 300 } + + # If this is `true`, the cursor is temporarily hidden when typing. + hide_when_typing: true + +url: +# URL launcher +# +# This program is executed when clicking on a text which is recognized as a URL. +# The URL is always added to the command as the last parameter. +# +# When set to `None`, URL launching will be disabled completely. +# +# Default: +# - (macOS) open +# - (Linux/BSD) xdg-open +# - (Windows) explorer + launcher: + program: xdg-open + args: [] + + # URL modifiers + # + # These are the modifiers that need to be held down for opening URLs when clicking + # on them. The available modifiers are documented in the key binding section. + modifiers: None + +# Mouse bindings +# +# Mouse bindings are specified as a list of objects, much like the key +# bindings further below. +# +# To trigger mouse bindings when an application running within Alacritty captures the mouse, the +# `Shift` modifier is automatically added as a requirement. +# +# Each mouse binding will specify a: +# +# - `mouse`: +# +# - Middle +# - Left +# - Right +# - Numeric identifier such as `5` +# +# - `action` (see key bindings) +# +# And optionally: +# +# - `mods` (see key bindings) +mouse_bindings: + - { mouse: Middle, action: PasteSelection } + +# Key bindings +# +# Key bindings are specified as a list of objects. For example, this is the +# default paste binding: +# +# `- { key: V, mods: Control|Shift, action: Paste }` +# +# Each key binding will specify a: +# +# - `key`: Identifier of the key pressed +# +# - A-Z +# - F1-F24 +# - Key0-Key9 +# +# A full list with available key codes can be found here: +# https://docs.rs/glutin/*/glutin/event/enum.VirtualKeyCode.html#variants +# +# Instead of using the name of the keys, the `key` field also supports using +# the scancode of the desired key. Scancodes have to be specified as a +# decimal number. This command will allow you to display the hex scancodes +# for certain keys: +# +# `showkey --scancodes`. +# +# Then exactly one of: +# +# - `chars`: Send a byte sequence to the running application +# +# The `chars` field writes the specified string to the terminal. This makes +# it possible to pass escape sequences. To find escape codes for bindings +# like `PageUp` (`"\x1b[5~"`), you can run the command `showkey -a` outside +# of tmux. Note that applications use terminfo to map escape sequences back +# to keys. It is therefore required to update the terminfo when changing an +# escape sequence. +# +# - `action`: Execute a predefined action +# +# - Copy +# - Paste +# - PasteSelection +# - IncreaseFontSize +# - DecreaseFontSize +# - ResetFontSize +# - ScrollPageUp +# - ScrollPageDown +# - ScrollLineUp +# - ScrollLineDown +# - ScrollToTop +# - ScrollToBottom +# - ClearHistory +# - Hide +# - Minimize +# - Quit +# - ToggleFullscreen +# - SpawnNewInstance +# - ClearLogNotice +# - ReceiveChar +# - None +# +# (macOS only): +# - ToggleSimpleFullscreen: Enters fullscreen without occupying another space +# +# - `command`: Fork and execute a specified command plus arguments +# +# The `command` field must be a map containing a `program` string and an +# `args` array of command line parameter strings. For example: +# `{ program: "alacritty", args: ["-e", "vttest"] }` +# +# And optionally: +# +# - `mods`: Key modifiers to filter binding actions +# +# - Command +# - Control +# - Option +# - Super +# - Shift +# - Alt +# +# Multiple `mods` can be combined using `|` like this: +# `mods: Control|Shift`. +# Whitespace and capitalization are relevant and must match the example. +# +# - `mode`: Indicate a binding for only specific terminal reported modes +# +# This is mainly used to send applications the correct escape sequences +# when in different modes. +# +# - AppCursor +# - AppKeypad +# - Alt +# +# A `~` operator can be used before a mode to apply the binding whenever +# the mode is *not* active, e.g. `~Alt`. +# +# Bindings are always filled by default, but will be replaced when a new +# binding with the same triggers is defined. To unset a default binding, it can +# be mapped to the `ReceiveChar` action. Alternatively, you can use `None` for +# a no-op if you do not wish to receive input characters for that binding. +# +# If the same trigger is assigned to multiple actions, all of them are executed +# at once. +key_bindings: + - { key: V, mods: Control|Shift, action: Paste } + - { key: C, mods: Control|Shift, action: Copy } + - { key: Insert, mods: Shift, action: PasteSelection } + - { key: Key0, mods: Control, action: ResetFontSize } + - { key: Equals, mods: Control, action: IncreaseFontSize } + - { key: Minus, mods: Control, action: DecreaseFontSize } + + - { key: Paste, action: Paste } + - { key: Copy, action: Copy } + - { key: L, mods: Control, action: ClearLogNotice } + - { key: L, mods: Control, chars: "\x0c" } + - { key: PageUp, mods: Shift, action: ScrollPageUp, mode: ~Alt } + - { key: PageDown, mods: Shift, action: ScrollPageDown, mode: ~Alt } + - { key: Home, mods: Shift, action: ScrollToTop, mode: ~Alt } + - { key: End, mods: Shift, action: ScrollToBottom, mode: ~Alt } + + # Vi Mode + - { key: Space, mods: Shift|Control, mode: Vi, action: ScrollToBottom } + - { key: Space, mods: Shift|Control, action: ToggleViMode } + - { key: Escape, mode: Vi, action: ClearSelection } + - { key: I, mode: Vi, action: ScrollToBottom } + - { key: I, mode: Vi, action: ToggleViMode } + - { key: Y, mods: Control, mode: Vi, action: ScrollLineUp } + - { key: E, mods: Control, mode: Vi, action: ScrollLineDown } + - { key: G, mode: Vi, action: ScrollToTop } + - { key: G, mods: Shift, mode: Vi, action: ScrollToBottom } + - { key: B, mods: Control, mode: Vi, action: ScrollPageUp } + - { key: F, mods: Control, mode: Vi, action: ScrollPageDown } + - { key: U, mods: Control, mode: Vi, action: ScrollHalfPageUp } + - { key: D, mods: Control, mode: Vi, action: ScrollHalfPageDown } + - { key: Y, mode: Vi, action: Copy } + - { key: Y, mode: Vi, action: ClearSelection } + - { key: Copy, mode: Vi, action: ClearSelection } + - { key: V, mode: Vi, action: ToggleNormalSelection } + - { key: V, mods: Shift, mode: Vi, action: ToggleLineSelection } + - { key: V, mods: Control, mode: Vi, action: ToggleBlockSelection } + - { key: V, mods: Alt, mode: Vi, action: ToggleSemanticSelection } + - { key: Return, mode: Vi, action: Open } + - { key: K, mode: Vi, action: Up } + - { key: J, mode: Vi, action: Down } + - { key: H, mode: Vi, action: Left } + - { key: L, mode: Vi, action: Right } + - { key: Up, mode: Vi, action: Up } + - { key: Down, mode: Vi, action: Down } + - { key: Left, mode: Vi, action: Left } + - { key: Right, mode: Vi, action: Right } + - { key: Key0, mode: Vi, action: First } + - { key: Key4, mods: Shift, mode: Vi, action: Last } + - { key: Key6, mods: Shift, mode: Vi, action: FirstOccupied } + - { key: H, mods: Shift, mode: Vi, action: High } + - { key: M, mods: Shift, mode: Vi, action: Middle } + - { key: L, mods: Shift, mode: Vi, action: Low } + - { key: B, mode: Vi, action: SemanticLeft } + - { key: W, mode: Vi, action: SemanticRight } + - { key: E, mode: Vi, action: SemanticRightEnd } + - { key: B, mods: Shift, mode: Vi, action: WordLeft } + - { key: W, mods: Shift, mode: Vi, action: WordRight } + - { key: E, mods: Shift, mode: Vi, action: WordRightEnd } + - { key: Key5, mods: Shift, mode: Vi, action: Bracket } + - { key: Slash, mode: Vi, action: SearchForward } + - { key: Slash, mods: Shift, mode: Vi, action: SearchBackward } + - { key: N, mode: Vi, action: SearchNext } + - { key: N, mods: Shift, mode: Vi, action: SearchPrevious } + +debug: + render_timer: false + persistent_logging: false + + # Log level + # + # Values for `log_level`: + # - None + # - Error + # - Warn + # - Info + # - Debug + # - Trace + log_level: Warn + + print_events: false diff --git a/home/.config/amfora/config.toml b/home/.config/amfora/config.toml new file mode 100644 index 0000000..44f34de --- /dev/null +++ b/home/.config/amfora/config.toml @@ -0,0 +1,340 @@ +# This is the default config file. +# It also shows all the default values, if you don't create the file. + +# All URL values may omit the scheme and/or port, as well as the beginning double slash +# Valid URL examples: +# gemini://example.com +# //example.com +# example.com +# example.com:123 + + +[a-general] +# Press Ctrl-H to access it +home = "gemini://gemini.circumlunar.space" + +# Follow up to 5 Gemini redirects without prompting. +# A prompt is always shown after the 5th redirect and for redirects to protocols other than Gemini. +# If set to false, a prompt will be shown before following redirects. +auto_redirect = false + +# What command to run to open a HTTP(S) URL. +# Set to "default" to try to guess the browser, or set to "off" to not open HTTP(S) URLs. +# If a command is set, than the URL will be added (in quotes) to the end of the command. +# A space will be prepended to the URL. +# +# The best to define a command is using a string array. +# Examples: +# http = ['firefox'] +# http = ['custom-browser', '--flag', '--option=2'] +# http = ['/path/with spaces/in it/firefox'] +# +# Note the use of single quotes, so that backslashes will not be escaped. +# Using just a string will also work, but it is deprecated, and will degrade if +# you use paths with spaces. + +http = 'firefox --new-tab' + +# Any URL that will accept a query string can be put here +search = "gemini://gus.guru/search" + +# Whether colors will be used in the terminal +color = true + +# Whether ANSI color codes from the page content should be rendered +ansi = true + +# Whether to replace list asterisks with unicode bullets +bullets = true + +# Whether to show link after link text +show_link = true + +# A number from 0 to 1, indicating what percentage of the terminal width the left margin should take up. +left_margin = 0.1 + +# The max number of columns to wrap a page's text to. Preformatted blocks are not wrapped. +max_width = 100 + +# 'downloads' is the path to a downloads folder. +# An empty value means the code will find the default downloads folder for your system. +# If the path does not exist it will be created. +# Note the use of single quotes, so that backslashes will not be escaped. +downloads = '' + +# Max size for displayable content in bytes - after that size a download window pops up +page_max_size = 2097152 # 2 MiB +# Max time it takes to load a page in seconds - after that a download window pops up +page_max_time = 10 + +# Whether to replace tab numbers with emoji favicons, which are cached. +emoji_favicons = false + + +[auth] +# Authentication settings +# Note the use of single quotes for values, so that backslashes will not be escaped. + +[auth.certs] +# Client certificates +# Set domain name equal to path to client cert +# "example.com" = 'mycert.crt' + +[auth.keys] +# Client certificate keys +# Set domain name equal to path to key for the client cert above +# "example.com" = 'mycert.key' + + +[keybindings] +# In the future there will be more settings here. + +# Hold down shift and press the numbers on your keyboard (1,2,3,4,5,6,7,8,9,0) to set this up. +# It is default set to be accurate for US keyboards. +shift_numbers = "!@#$%^&*()" + + +[url-handlers] +# Allows setting the commands to run for various URL schemes. +# E.g. to open FTP URLs with FileZilla set the following key: +# ftp = 'filezilla' +# You can set any scheme to "off" or "" to disable handling it, or +# just leave the key unset. +# +# DO NOT use this for setting the HTTP command. +# Use the http setting in the "a-general" section above. +# +# NOTE: These settings are overrided by the ones in the proxies section. +# Note the use of single quotes, so that backslashes will not be escaped. + +# This is a special key that defines the handler for all URL schemes for which +# no handler is defined. +other = 'off' + + +[cache] +# Options for page cache - which is only for text pages +# Increase the cache size to speed up browsing at the expense of memory +# Zero values mean there is no limit + +max_size = 0 # Size in bytes +max_pages = 30 # The maximum number of pages the cache will store + +# How long a page will stay in cache, in seconds. +timeout = 1800 # 30 mins + +[proxies] +# Allows setting a Gemini proxy for different schemes. +# The settings are similar to the url-handlers section above. +# E.g. to open a gopher page by connecting to a Gemini proxy server: +# gopher = "example.com:123" +# +# Port 1965 is assumed if no port is specified. +# +# NOTE: These settings override any external handlers specified in +# the url-handlers section. +# +# Note that HTTP and HTTPS are treated as separate protocols here. + + +[subscriptions] +# For tracking feeds and pages + +# Whether a pop-up appears when viewing a potential feed +popup = true + +# How often to check for updates to subscriptions in the background, in seconds. +# Set it to 0 to disable this feature. You can still update individual feeds +# manually, or restart the browser. +# +# Note Amfora will check for updates on browser start no matter what this setting is. +update_interval = 1800 # 30 mins + +# How many subscriptions can be checked at the same time when updating. +# If you have many subscriptions you may want to increase this for faster +# update times. Any value below 1 will be corrected to 1. +workers = 3 + +# The number of subscription updates displayed per page. +entries_per_page = 20 + + +[theme] +# This section is for changing the COLORS used in Amfora. +# These colors only apply if 'color' is enabled above. +# Colors can be set using a W3C color name, or a hex value such as "#ffffff". + +# Note that not all colors will work on terminals that do not have truecolor support. +# If you want to stick to the standard 16 or 256 colors, you can get +# a list of those here: https://jonasjacek.github.io/colors/ +# DO NOT use the names from that site, just the hex codes. + +# Definitions: +# bg = background +# fg = foreground +# dl = download +# btn = button +# hdg = heading +# bkmk = bookmark +# modal = a popup window/box in the middle of the screen + +# EXAMPLES: +# hdg_1 = "green" +# hdg_2 = "#5f0000" + +# Available keys to set: + +# bg: background for pages, tab row, app in general +# tab_num: The number/highlight of the tabs at the top +# tab_divider: The color of the divider character between tab numbers: | +# bottombar_label: The color of the prompt that appears when you press space +# bottombar_text: The color of the text you type +# bottombar_bg + +# hdg_1 +# hdg_2 +# hdg_3 +# amfora_link: A link that Amfora supports viewing. For now this is only gemini:// +# foreign_link: HTTP(S), Gopher, etc +# link_number: The silver number that appears to the left of a link +# regular_text: Normal gemini text, and plaintext documents +# quote_text +# preformatted_text +# list_text + +# btn_bg: The bg color for all modal buttons +# btn_text: The text color for all modal buttons + +# dl_choice_modal_bg +# dl_choice_modal_text +# dl_modal_bg +# dl_modal_text +# info_modal_bg +# info_modal_text +# error_modal_bg +# error_modal_text +# yesno_modal_bg +# yesno_modal_text +# tofu_modal_bg +# tofu_modal_text +# subscription_modal_bg +# subscription_modal_text + +# input_modal_bg +# input_modal_text +# input_modal_field_bg: The bg of the input field, where you type the text +# input_modal_field_text: The color of the text you type + +# bkmk_modal_bg +# bkmk_modal_text +# bkmk_modal_label +# bkmk_modal_field_bg +# bkmk_modal_field_text + +# _____ __ _________ +# ___ | / /__________________ / +# __ |/ /_ __ \_ ___/ __ / +# _ /| / / /_/ / / / /_/ / +# /_/ |_/ \____//_/ \__,_/ +# +bg = "#2e3440" +tab_num = "#88c0d0" +tab_divider = "#4c566a" +bottombar_label = "#88c0d0" +bottombar_text = "#eceff4" +bottombar_bg = "#3b4252" + +hdg_1 = "#5e81ac" +hdg_2 = "#81a1c1" +hdg_3 = "#8fbcbb" +amfora_link = "#88c0d0" +foreign_link = "#b48ead" +link_number = "#a3be8c" +regular_text = "#eceff4" +quote_text = "#81a1c1" +preformatted_text = "#8fbcbb" +list_text = "#d8dee9" + +btn_bg = "#4c566a" +btn_text = "#eceff4" + +dl_choice_modal_bg = "#3b4252" +dl_choice_modal_text = "#eceff4" +dl_modal_bg = "#3b4252" +dl_modal_text = "#eceff4" +info_modal_bg = "#3b4252" +info_modal_text = "#eceff4" +error_modal_bg = "#bf616a" +error_modal_text = "#eceff4" +yesno_modal_bg = "#3b4252" +yesno_modal_text = "#eceff4" +tofu_modal_bg = "#3b4252" +tofu_modal_text = "#eceff4" +subscription_modal_bg = "#3b4252" +subscription_modal_text = "#eceff4" + +input_modal_bg = "#3b4252" +input_modal_text = "#eceff4" +input_modal_field_bg = "#4c566a" +input_modal_field_text = "#eceff4" + +bkmk_modal_bg = "#3b4252" +bkmk_modal_text = "#eceff4" +bkmk_modal_label = "#eceff4" +bkmk_modal_field_bg = "#4c566a" +bkmk_modal_field_text = "#eceff4" + +# _______ ________ ______ +# __ __ \______________ __ \_____ __________ /__ +# _ / / /_ __ \ _ \_ / / / __ `/_ ___/_ //_/ +# / /_/ /_ / / / __/ /_/ // /_/ /_ / _ ,< +# \____/ /_/ /_/\___//_____/ \__,_/ /_/ /_/|_| +# +# bg = "#282c34" +# fg = "#abb2bf" +# tab_num = "#abb2bf" +# tab_divider = "#abb2bf" +# bottombar_bg = "#abb2bf" +# bottombar_text = "#282c34" +# bottombar_label = "#282c34" + +# hdg_1 = "#e06c75" +# hdg_2 = "#c678dd" +# hdg_3 = "#c678dd" +# amfora_link = "#61afef" +# foreign_link = "#56b6c2" +# link_number = "#abb2bf" +# regular_text = "#abb2bf" +# quote_text = "#98c379" +# preformatted_text = "#e5c07b" +# list_text = "#abb2bf" + +# btn_bg = "#282c34" +# btn_text = "#abb2bf" + +# dl_choice_modal_bg = "#98c379" +# dl_choice_modal_text = "#282c34" +# dl_modal_bg = "#98c379" +# dl_modal_text = "#282c34" +# info_modal_bg = "#98c379" +# info_modal_text = "#282c34" +# error_modal_bg = "#e06c75" +# error_modal_text = "#282c34" +# yesno_modal_bg = "#e5c07b" +# yesno_modal_text = "#282c34" +# tofu_modal_bg = "#e5c07b" +# tofu_modal_text = "#282c34" + +# input_modal_bg = "#98c379" +# input_modal_text = "#282c34" +# input_modal_field_bg = "#282c34" +# input_modal_field_text = "#abb2bf" + +# bkmk_modal_bg = "#98c379" +# bkmk_modal_text = "#282c34" +# bkmk_modal_label = "#282c34" +# bkmk_modal_field_bg = "#282c34" +# bkmk_modal_field_text = "#abb2bf" + +# subscription_modal_bg = "#c678dd" +# subscription_modal_text = "#282c34" diff --git a/home/.config/bottom/bottom.toml b/home/.config/bottom/bottom.toml new file mode 100644 index 0000000..e5ddd5a --- /dev/null +++ b/home/.config/bottom/bottom.toml @@ -0,0 +1,96 @@ +# Do something +[flags] + +# Hide avg_cpu (doesn't work though) +hide_avg_cpu = true + +dot_marker = true + +rate = 1000 + +left_legend = true + +current_usage = true + +group_processes = true + +case_sensitive = false + +whole_word = false + +regex = false + +show_disabled_data = false + +temperature_type = "c" + +default_time_value = 60000 + +time_delta = 15000 + +default_widget_type = "proc" + +default_widget_count = 1 + +basic = false + +use_old_network_legend = false + +hide_table_count = false + +# Colors +[colors] + +table_header_color="LightBlue" + +widget_title_color="White" + +avg_cpu_color="Red" + +cpu_core_colors=["LightMagenta", "LightYellow", "White", "LightGreen", "LightBlue", "LightRed", "Cyan", "Yellow"] + +ram_color="Green" + +swap_color="Yellow" + +rx_color="Green" + +tx_color="Yellow" + +border_color="Blue" + +highlighted_border_color="Green" + +text_color="Gray" + +selected_text_color="Black" + +selected_bg_color="LightBlue" + +graph_color="Blue" + +battery_colors = ["red", "yellow", "yellow", "green", "green", "green"] + +# The default widget layout: +#[[row]] +# ratio=30 +# [[row.child]] +# type="cpu" +#[[row]] +# ratio=40 +# [[row.child]] +# ratio=4 +# type="mem" +# [[row.child]] +# ratio=3 +# [[row.child.child]] +# type="temp" +# [[row.child.child]] +# type="disk" +#[[row]] +# ratio=30 +# [[row.child]] +# type="net" +# [[row.child]] +# type="proc" +# default=true diff --git a/home/.config/broot/conf.toml b/home/.config/broot/conf.toml new file mode 100644 index 0000000..76c371f --- /dev/null +++ b/home/.config/broot/conf.toml @@ -0,0 +1,301 @@ +############################################################### +# Default flags +# You can set up flags you want broot to start with by +# default, for example `default_flags="ihp"` if you usually want +# to see hidden and gitignored files and the permissions (then +# if you don't want the hidden files you can launch `br -H`) +# A popular flag is the `g` one which displays git related info. +# +default_flags = "ghis" + +############################################################### +# Special paths +# If some paths must be handled specially, uncomment (and change +# this section as per the examples +# +# [special-paths] +# "/media/slow-backup-disk" = "no-enter" +# "/home/dys/useless" = "hide" +# "/home/dys/my-link-I-want-to-explore" = "enter" + +############################################################### +# Date/Time format +# If you want to change the format for date/time, uncomment the +# following line and change it according to +# https://docs.rs/chrono/0.4.11/chrono/format/strftime/index.html +# +# date_time_format = "%Y/%m/%d %R" + +############################################################### +# Whether to mark the selected line with a triangle +# +show_selection_mark = true + +############################################################### +# Column order +# cols_order, if specified, must be a permutation of the following +# array. You should keep the name at the end as it has a variable +# length. +# +# cols_order = [ +# "mark", +# "git", +# "branch", +# "permission", +# "date", +# "size", +# "count", +# "name", +# ] + +############################################################### +# True Colors +# If this parameter isn't set, broot tries to automatically +# determine whether true colors (24 bits) are available. +# As this process is unreliable, you may uncomment this setting +# and set it to false or true if you notice the colors in +# previewed images are too off. +# true_colors = false + +############################################################### +# Icons +# If you want to display icons in broot, uncomment this line +# (see https://dystroy.org/broot/icons for installation and +# troubleshooting) +icon_theme = "vscode" + +############################################################### +# Verbs and shortcuts +# You can define your own commands which would be applied to +# the selection. + +[[verbs]] +name = "touch" +invocation = "touch {new_file}" +execution = "touch {directory}/{new_file}" +leave_broot = false + +[[verbs]] +invocation = "edit" +shortcut = "e" +execution = "$EDITOR {file}" +leave_broot = false + +[[verbs]] +invocation = "create {subpath}" +execution = "$EDITOR {directory}/{subpath}" +leave_broot = false + +# If $PAGER isn't set on your computer, you should either set it +# or just replace it with your viewer of choice in the 'execution' +# pattern. +# Example: +# execution = "less {file}" +[[verbs]] +name = "view" +invocation = "view" +execution = "$PAGER {file}" +leave_broot = false + +# uncomment if you want to launch a terminal on ctrl-T +# (on exit you'll be back in broot) +[[verbs]] +invocation = "terminal" +key = "ctrl-t" +execution = "$SHELL" +set_working_dir = true +leave_broot = false + +# A popular set of shorctuts for going up and down: +# +[[verbs]] +key = "ctrl-j" +execution = ":line_down" + +[[verbs]] +key = "ctrl-k" +execution = ":line_up" + +[[verbs]] +key = "ctrl-h" +execution = ":parent" + +[[verbs]] +key = "ctrl-l" +execution = ":focus" + +[[verbs]] +key = "ctrl-d" +execution = ":page_down" + +[[verbs]] +key = "ctrl-u" +execution = ":page_up" + +[[verbs]] +key = "ctrl-c" +execution = ":quit" + +# Bookmarks for better navigation +[[verbs]] +shortcut = "fh" +execution = ":focus ~" + +[[verbs]] +shortcut = "fC" +execution = ":focus ~/Code" + +[[verbs]] +shortcut = "fD" +execution = ":focus ~/Downloads" + +[[verbs]] +shortcut = "fP" +execution = ":focus ~/Pictures" + +[[verbs]] +shortcut = "fV" +execution = ":focus ~/Videos" + +[[verbs]] +shortcut = "fA" +execution = ":focus ~/Media" + +[[verbs]] +shortcut = "fU" +execution = ":focus ~/Music" + +[[verbs]] +shortcut = "ff" +execution = ":focus ~/.config" + +[[verbs]] +shortcut = "fl" +execution = ":focus ~/.local/share" + +[[verbs]] +shortcut = "fe" +execution = ":focus /etc" + +[[verbs]] +shortcut = "fu" +execution = ":focus /usr/share" + +[[verbs]] +shortcut = "fo" +execution = ":focus /opt" + +[[verbs]] +shortcut = "fb" +execution = ":focus /boot" + +[[verbs]] +shortcut = "fm" +execution = ":focus /media" + +[[verbs]] +shortcut = "fM" +execution = ":focus /mnt" + +[[verbs]] +shortcut = "fi" +execution = ":focus /run/media" + +[[verbs]] +shortcut = "fv" +execution = ":focus /var" + +[[verbs]] +shortcut = "ft" +execution = ":focus /tmp" + +[[verbs]] +shortcut = "fd" +execution = ":focus /dev" + +[[verbs]] +shortcut = "fS" +execution = ":focus /srv" + +[[verbs]] +shortcut = "fr" +execution = ":focus /" + +############################################################### +# Skin +# If you want to change the colors of broot, +# uncomment the following bloc and start messing +# with the various values. +# +[skin] +default = "None None" +tree = "ansi(94) None None" +file = "gray(20) None / gray(15) None" +directory = "None Bold None bold" +exe = "Cyan None" +link = "Magenta None" +pruning = "gray(12) None Italic" +perm__ = "gray(5) None" +perm_r = "ansi(94) None" +perm_w = "ansi(132) None" +perm_x = "ansi(65) None" +owner = "ansi(138) None" +group = "ansi(131) None" +count = "ansi(136) gray(3)" +dates = "ansi(66) None" +sparse = "ansi(214) None" +content_extract = "ansi(29) None" +content_match = "ansi(34) None" +git_branch = "ansi(229) None" +git_insertions = "ansi(28) None" +git_deletions = "ansi(160) None" +git_status_current = "gray(5) None" +git_status_modified = "ansi(28) None" +git_status_new = "ansi(94) None Bold" +git_status_ignored = "gray(17) None" +git_status_conflicted = "ansi(88) None" +git_status_other = "ansi(88) None" +selected_line = "None gray(6)" +char_match = "Yellow None" +file_error = "Red None" +flag_label = "gray(15) None" +flag_value = "ansi(208) None Bold" +input = "White None" +status_error = "gray(22) ansi(124)" +status_job = "ansi(220) gray(5)" +status_normal = "gray(20) gray(3) / gray(2) gray(2)" +status_italic = "ansi(208) gray(3) / gray(2) gray(2)" +status_bold = "ansi(208) gray(3) Bold / gray(2) gray(2)" +status_code = "ansi(229) gray(3) / gray(2) gray(2)" +status_ellipsis = "gray(19) gray(1) / gray(2) gray(2)" +purpose_normal = "gray(20) gray(2)" +purpose_italic = "ansi(178) gray(2)" +purpose_bold = "ansi(178) gray(2) Bold" +purpose_ellipsis = "gray(20) gray(2)" +scrollbar_track = "gray(7) None / gray(4) None" +scrollbar_thumb = "gray(22) None / gray(14) None" +help_paragraph = "gray(20) None" +help_bold = "ansi(208) None Bold" +help_italic = "ansi(166) None" +help_code = "gray(21) gray(3)" +help_headers = "ansi(208) None" +help_table_border = "ansi(239) None" +preview = "gray(20) gray(1) / gray(18) gray(2)" +preview_line_number = "gray(12) gray(3)" +preview_match = "None ansi(29)" +hex_null = "gray(11) None" +hex_ascii_graphic = "gray(18) None" +hex_ascii_whitespace = "ansi(143) None" +hex_ascii_other = "ansi(215) None" +hex_non_ascii = "ansi(167) None" + +############################################################### +# File Extension Colors +# +# uncomment and modify the next section if you want to color +# file name depending on their extension +# +# [ext-colors] +# png = "rgb(255, 128, 75)" +# rs = "yellow" + diff --git a/home/.config/bsp-layout/layoutrc b/home/.config/bsp-layout/layoutrc new file mode 100644 index 0000000..5521164 --- /dev/null +++ b/home/.config/bsp-layout/layoutrc @@ -0,0 +1,2 @@ +TALL_RATIO=0.52; +WIDE_RATIO=0.52; diff --git a/home/.config/bspwm/bspwmrc b/home/.config/bspwm/bspwmrc new file mode 100755 index 0000000..44ec13a --- /dev/null +++ b/home/.config/bspwm/bspwmrc @@ -0,0 +1,59 @@ +#!/bin/sh + +# Startup applications +sxhkd & +mpDris2 & +xsetroot -cursor_name left_ptr & +$HOME/.config/polybar/run_polybar.sh & + +# Workspaces +bspc monitor eDP -d 1 2 3 4 5 6 7 8 +bspc monitor HDMI-A-0 -d 9 10 + +# Modes +bspc config top_padding 0 +bspc config bottom_padding 0 +bspc config left_padding 0 +bspc config right_padding 0 +bspc config border_width 2 +bspc config window_gap 10 + +bspc config split_ratio 0.52 +bspc config borderless_monocle false +bspc config gapless_monocle false +bspc config single_monocle true +bspc config click_to_focus none +bspc config focus_follows_pointer true + +bspc config pointer_modifier super +bspc config pointer_action1 move +bspc config pointer_action2 resize_side +bspc config pointer_action3 resize_corner + +bspc config remove_disabled_monitors true +bspc config remove_unplugged_monitors true +bspc config merge_overlapping_monitors true + +# --- Nord --- # +bspc config normal_border_color "#2e3440" +bspc config active_border_color "#ebcb8b" +bspc config focused_border_color "#81a1c1" +bspc config presel_feedback_color "#d8dee9" +# -- OneDark -- # +# bspc config normal_border_color "#282c34" +# bspc config active_border_color "#e5c07b" +# bspc config focused_border_color "#61afef" +# bspc config presel_feedback_color "#abb2bf" + +# Program rules +bspc rule -a "Gimp-2.10" state=floating follow=on +bspc rule -a "Gimp" state=floating follow=on +bspc rule -a "Thunderbird" desktop='^3' follow=on +bspc rule -a "Inkscape" state=floating follow=on +bspc rule -a "krita" state=floating follow=on +bspc rule -a "mpv" desktop='^6' state=tiled follow=on +bspc rule -a "Zathura" desktop='^4' follow=on +bspc rule -a "Element" desktop='^7' follow=on +bspc rule -a "TelegramDesktop" desktop='^7' follow=on +bspc rule -a "Emacs" state=tiled +bspc rule -a "Komikku" state=floating follow=on diff --git a/home/.config/cava/config b/home/.config/cava/config new file mode 100644 index 0000000..34624db --- /dev/null +++ b/home/.config/cava/config @@ -0,0 +1,165 @@ +## Configuration file for CAVA. Default values are commented out. Use either ';' or '#' for commenting. + + +[general] + +# Smoothing mode. Can be 'normal', 'scientific' or 'waves'. DEPRECATED as of 0.6.0 +; mode = normal + +# Accepts only non-negative values. +framerate = 60 + +# 'autosens' will attempt to decrease sensitivity if the bars peak. 1 = on, 0 = off +# new as of 0.6.0 autosens of low values (dynamic range) +# 'overshoot' allows bars to overshoot (in % of terminal height) without initiating autosens. DEPRECATED as of 0.6.0 +autosens = 1 +; overshoot = 20 + +# Manual sensitivity in %. Autosens must be turned off for this to take effect. +# 200 means double height. Accepts only non-negative values. +; sensitivity = 100 + +# The number of bars (0-200). 0 sets it to auto (fill up console). +# Bars' width and space between bars in number of characters. +bars = 0 +bar_width = 1 +bar_spacing = 1 + + +# Lower and higher cutoff frequencies for lowest and highest bars +# the bandwidth of the visualizer. +# Note: there is a minimum total bandwidth of 43Mhz x number of bars. +# Cava will automatically increase the higher cutoff if a too low band is specified. +; lower_cutoff_freq = 50 +; higher_cutoff_freq = 10000 + +# FFT buffer is set in the exponent of 2 and must be between 8 - 16, 8 = 256, 16 = 65536 +# this is the audio buffer used to create the spectrum +# increasing the will improve the accuracy of the visualization, +# but will also make it slower and increase CPU usage +# anything below 10 and above 13 is considered experimental. +FFTbufferSize = 12; + + + +[input] + +# Audio capturing method. Possible methods are: 'pulse', 'alsa', 'fifo', 'sndio' or 'shmem' +# Defaults to 'pulse', 'alsa' or 'fifo', in that order, dependent on what support cava was built with. +# +# All input methods uses the same config variable 'source' +# to define where it should get the audio. +# +# For pulseaudio 'source' will be the source. Default: 'auto', which uses the monitor source of the default sink +# (all pulseaudio sinks(outputs) have 'monitor' sources(inputs) associated with them). +# +# For alsa 'source' will be the capture device. +# For fifo 'source' will be the path to fifo-file. +# For shmem 'source' will be /squeezelite-AA:BB:CC:DD:EE:FF where 'AA:BB:CC:DD:EE:FF' will be squeezelite's MAC address +method = fifo +source = /tmp/mpd.fifo +sample_rate = 44100 +sample_bits = 16 + + +[output] + +# Output method. Can be 'ncurses', 'noncurses' or 'raw'. +# 'noncurses' uses a custom framebuffer technique and draws only changes +# from frame to frame. As of version 0.7.0 'noncurses' is default. +# +# 'raw' is an 8 or 16 bit (configurable via the 'bit_format' option) data +# stream of the bar heights that can be used to send to other applications. +# 'raw' defaults to 200 bars, which can be adjusted in the 'bars' option above. +method = ncurses + +# Visual channels. Can be 'stereo' or 'mono'. +# 'stereo' mirrors both channels with low frequencies in center. +# 'mono' outputs left to right lowest to highest frequencies. +# 'mono_option' set mono to either take input from 'left', 'right' or 'average'. +channels = stereo +mono_option = average + +# Raw output target. A fifo will be created if target does not exist. +; raw_target = /dev/stdout + +# Raw data format. Can be 'binary' or 'ascii'. +; data_format = binary + +# Binary bit format, can be '8bit' (0-255) or '16bit' (0-65530). +; bit_format = 16bit + +# Ascii max value. In 'ascii' mode range will run from 0 to value specified here +; ascii_max_range = 1000 + +# Ascii delimiters. In ascii format each bar and frame is separated by a delimiters. +# Use decimal value in ascii table (i.e. 59 = ';' and 10 = '\n' (line feed)). +; bar_delimiter = 59 +; frame_delimiter = 10 + + + +[color] + +# Colors can be one of seven predefined: black, blue, cyan, green, magenta, red, white, yellow. +# Or defined by hex code '#xxxxxx' (hex code must be within ''). User defined colors requires +# ncurses output method and a terminal that can change color definitions such as Gnome-terminal or rxvt. +# default is to keep current terminal color +background = default +foreground = default + +# Gradient mode, only hex defined colors (and thereby ncurses mode) are supported, +# background must also be defined in hex or remain commented out. 1 = on, 0 = off. +# You can define as many as 8 different colors. They range from bottom to top of screen +gradient = 1 +gradient_count = 8 +# --- Nord --- # +gradient_color_1 = '#b48ead' +gradient_color_2 = '#81a1c1' +gradient_color_3 = '#88c0d0' +gradient_color_4 = '#8fbcbb' +gradient_color_5 = '#a3be8c' +gradient_color_6 = '#ebcb8b' +gradient_color_7 = '#d08770' +gradient_color_8 = '#bf616a' +# -- OneDark -- # +; gradient_color_1 = '#8c9cff' +; gradient_color_2 = '#61afef' +; gradient_color_3 = '#56b6c2' +; gradient_color_4 = '#98c379' +; gradient_color_5 = '#e5c07b' +; gradient_color_6 = '#d19a66' +; gradient_color_7 = '#e06c75' +; gradient_color_8 = '#be5046' + + + +[smoothing] + +# Percentage value for integral smoothing. Takes values from 0 - 100. +# Higher values means smoother, but less precise. 0 to disable. +integral = 0 + +# Disables or enables the so-called "Monstercat smoothing" with or without "waves". Set to 0 to disable. +monstercat = 0 +waves = 0 + +# Set gravity percentage for "drop off". Higher values means bars will drop faster. +# Accepts only non-negative values. 50 means half gravity, 200 means double. Set to 0 to disable "drop off". +gravity = 100 + + +# In bar height, bars that would have been lower that this will not be drawn. +; ignore = 0 + + +[eq] + +# This one is tricky. You can have as much keys as you want. +# Remember to uncomment more then one key! More keys = more precision. +# Look at readme.md on github for further explanations and examples. +1 = 2 # bass +2 = 2 +3 = 1 # midtone +4 = 1 +5 = 0.5 # treble diff --git a/home/.config/cointop/config.toml b/home/.config/cointop/config.toml new file mode 100644 index 0000000..c1484c5 --- /dev/null +++ b/home/.config/cointop/config.toml @@ -0,0 +1,88 @@ +currency = "USD" +default_view = "default" +api = "coingecko" +colorscheme = "cointop" +refresh_rate = 60 + +[shortcuts] + "$" = "last_page" + "/" = "open_search" + 0 = "first_page" + 1 = "sort_column_1h_change" + 2 = "sort_column_24h_change" + 7 = "sort_column_7d_change" + "?" = "help" + C = "show_currency_convert_menu" + E = "show_portfolio_edit_menu" + F = "toggle_show_favorites" + F1 = "help" + F5 = "refresh" + G = "move_to_page_last_row" + H = "move_to_page_visible_first_row" + L = "move_to_page_visible_last_row" + M = "move_to_page_visible_middle_row" + O = "open_link" + P = "toggle_portfolio" + Q = "quit_view" + "[" = "previous_chart_range" + "\\" = "toggle_table_fullscreen" + "]" = "next_chart_range" + a = "sort_column_available_supply" + "alt+down" = "sort_column_desc" + "alt+left" = "sort_left_column" + "alt+right" = "sort_right_column" + "alt+up" = "sort_column_asc" + b = "sort_column_balance" + c = "show_currency_convert_menu" + "ctrl+C" = "quit" + "ctrl+R" = "refresh" + "ctrl+S" = "save" + "ctrl+c" = "quit" + "ctrl+d" = "page_down" + "ctrl+f" = "open_search" + "ctrl+j" = "enlarge_chart" + "ctrl+k" = "shorten_chart" + "ctrl+n" = "next_page" + "ctrl+p" = "previous_page" + "ctrl+r" = "refresh" + "ctrl+s" = "save" + "ctrl+u" = "page_up" + down = "move_down" + e = "show_portfolio_edit_menu" + end = "move_to_page_last_row" + enter = "toggle_row_chart" + esc = "quit_view" + f = "toggle_favorite" + g = "move_to_page_first_row" + h = "previous_page" + home = "move_to_page_first_row" + j = "move_down" + k = "move_up" + l = "next_page" + left = "previous_page" + m = "sort_column_market_cap" + n = "sort_column_name" + o = "open_link" + p = "sort_column_price" + pagedown = "page_down" + pageup = "page_up" + q = "quit_view" + r = "sort_column_rank" + right = "next_page" + s = "sort_column_symbol" + space = "toggle_favorite" + t = "sort_column_total_supply" + tab = "move_down_or_next_page" + u = "sort_column_last_updated" + up = "move_up" + v = "sort_column_24h_volume" + "{" = "first_chart_range" + "}" = "last_chart_range" + +[favorites] + names = ["Ethereum", "XRP", "LBRY Credits", "Monero", "Basic Attention Token", "Bitcoin"] + +[portfolio] + +[coinmarketcap] + pro_api_key = "" diff --git a/home/.config/doom/config.el b/home/.config/doom/config.el new file mode 100644 index 0000000..9b0dc0d --- /dev/null +++ b/home/.config/doom/config.el @@ -0,0 +1,149 @@ +;;; $DOOMDIR/config.el -*- lexical-binding: t; -*- + +;; Some functionality uses this to identify you +(setq user-full-name "FollieHiyuki" + user-mail-address "folliekazetani@protonmail.com") + +;; Font settings +(setq doom-font (font-spec :family "Iosevka Nerd Font" :size 15) + doom-variable-pitch-font (font-spec :family "sans" :size 15) + doom-big-font (font-spec :family "Iosevka Nerd Font" :size 24) + doom-unicode-font (font-spec :family "Symbola" :size 14)) +(custom-set-faces! + '(font-lock-comment-face :slant italic)) + +;; Might speedup all-the-icons +(setq inhibit-compacting-font-caches t) + +;; Emoji +(setq emojify-display-style 'unicode) + +;; Theme +(setq doom-theme 'doom-nord) +(setq doom-themes-enable-bold t + doom-themes-enable-italic t) +(setq doom-themes-treemacs-theme 'doom-colors + doom-themes-treemacs-enable-variable-pitch nil) + +;; Pick an image for dashboard +;;(defun random-choice (items) +;; (let* ((size (length items)) +;; (index (random size))) +;; (nth index items))) +;;(defvar *kawaii* (random-choice (delete "." +;; (delete ".." (directory-files (expand-file-name "images" doom-private-dir)))))) +(setq +doom-dashboard-banner-file "yukino.png" + +doom-dashboard-banner-dir (expand-file-name "images" doom-private-dir) + +doom-dashboard-banner-padding '(0 . 2)) + +;; Line number +(setq display-line-numbers-type 'relative) + +;; Indent +(setq-default + indent-tabs-mode nil + tab-width 2 + evil-shift-width 2 + standard-indent 2 + line-spacing 2) +(after! highlight-indent-guides + (setq highlight-indent-guides-method 'character + highlight-indent-guides-responsive t)) + +;; Use ranger.el instead of default dired +(after! ranger + (setq ranger-override-dired-mode t + ranger-parent-depth 0 + ranger-cleanup-eagerly t + ranger-show-hidden t + ranger-max-preview-size 20 + ranger-dont-show-binary t)) + +;; Projectile +(setq projectile-project-search-path '("~/Code/") + projectile-auto-discover nil) + +;; lsp +(after! company + (setq company-idle-delay 0.5 + company-minimum-prefix-length 2) + (setq company-show-numbers nil)) +(setq lsp-clients-clangd-args '("-j=2" + "--background-index" + "--clang-tidy" + "--completion-style=detailed" + "--pch-storage=memory" + "--header-insertion=iwyu" + "--header-insertion-decorators")) +(after! lsp-clangd (set-lsp-priority! 'clangd 2)) ;; Use clangd instead of default ccls + +;; Quicker which-key +(setq which-key-idle-delay 0.5) + +;; Org mode +(setq org-directory "~/Documents/Org/" + org-agenda-files '("~/Documents/Org/agenda.org") + org-default-notes-file (expand-file-name "notes.org" org-directory) + org-journal-dir "~/Documents/Org/Journal/" + org-hide-emphasis-markers t) + +;; Elfeed +(setq rmh-elfeed-org-files (list (expand-file-name "elfeed.org" doom-private-dir))) +;;(add-hook! 'elfeed-search-mode-hook 'elfeed-update) + +;; EMMS +;;(emms-all) +;;(emms-default-players) +;;(emms-playing-time 1) +;;(setq emms-source-file-default-directory "~/Music/" +;; emms-info-asynchronously 1 +;; emms-playlist-buffer-name "*Music*" +;; emms-source-file-directory-tree-function 'emms-source-file-directory-tree-find +;; emms-browser-covers 'emms-browser-cache-thumbnail-async) +;;(setq emms-player-mpd-server-name "localhost" +;; emms-player-mpd-server-port "6600" +;; emms-player-mpd-music-directory "~/Music") +;;(add-to-list 'emms-info-functions 'emms-info-mpd 'emms-info-exiftool) +;;(add-to-list 'emms-player-list 'emms-player-mpd) +;;(map! :leader +;; :desc "Emms playlist" +;; "e a" #'emms-playlist-mode-go +;; :leader +;; :desc "Emms browse by album" +;; "e b" #'emms-browse-by-album +;; :leader +;; :desc "Emms pause track" +;; "e x" #'emms-pause +;; :leader +;; :desc "Emms stop track" +;; "e s" #'emms-stop +;; :leader +;; :desc "Emms previous track" +;; "e p" #'emms-previous +;; :leader +;; :desc "Emms next track" +;; "e n" #'emms-next) + +;; Modeline +;;(display-time-mode 1) +;;(if (not (equal "Battery status not available" (battery))) +;; (display-battery-mode 1)) +;;(emms-mode-line 1) +(setq doom-modeline-unicode-fallback t) + +;; Here are some additional functions/macros that could help you configure Doom: +;; +;; - `load!' for loading external *.el files relative to this one +;; - `use-package!' for configuring packages +;; - `after!' for running code after a package has loaded +;; - `add-load-path!' for adding directories to the `load-path', relative to +;; this file. Emacs searches the `load-path' when you load packages with +;; `require' or `use-package'. +;; - `map!' for binding new keys +;; +;; To get information about any of these functions/macros, move the cursor over +;; the highlighted symbol at press 'K' (non-evil users must press 'C-c c k'). +;; This will open documentation for it, including demos of how they are used. +;; +;; You can also try 'gd' (or 'C-c c d') to jump to their definition and see how +;; they are implemented. diff --git a/home/.config/doom/elfeed.org b/home/.config/doom/elfeed.org new file mode 100644 index 0000000..d883d90 --- /dev/null +++ b/home/.config/doom/elfeed.org @@ -0,0 +1,65 @@ +#+TITLE: Elfeed + +* root :elfeed: +** Programming :programming: +*** [[https://this-week-in-rust.org/rss.xml][This Week in Rust]] +*** Reddit :reddit: +**** [[https://www.reddit.com/r/learnprogramming/new.rss][r/learnprogramming]] +**** [[https://www.reddit.com/r/programming/new.rss][r/programming]] +**** [[https://www.reddit.com/r/dailyprogrammer/new.rss][r/dailyprogrammer]] +**** [[https://www.reddit.com/r/badcode/new.rss][r/badcode]] +** Technology :tech: +*** [[https://news.ycombinator.com/rss][Hacker News]] +*** [[https://www.phoronix.com/rss.php][Phoronix]] +*** Reddit :reddit: +**** [[https://www.reddit.com/r/privacytoolsIO/new.rss][r/privacytoolsIO]] +**** [[https://www.reddit.com/r/privacy/new.rss][r/privacy]] +**** [[https://www.reddit.com/r/TOR/new.rss][r/TOR]] +**** [[https://www.reddit.com/r/Monero/new.rss][r/Monero]] +** Reddit :reddit: +*** Linux/BSD :unix: +**** [[https://www.reddit.com/r/linux/new.rss][r/linux]] +**** [[https://www.reddit.com/r/linuxquestions/new.rss][r/linuxquestions]] +**** [[https://www.reddit.com/r/linux_gaming/new.rss][r/linux_gaming]] +**** [[https://www.reddit.com/r/openbsd/new.rss][r/openbsd]] +**** [[https://www.reddit.com/r/freebsd/new.rss][r/freebsd]] +**** [[https://www.reddit.com/r/Gentoo/new.rss][r/Gentoo]] +**** [[https://www.reddit.com/r/archlinux/new.rss][r/archlinux]] +**** [[https://www.reddit.com/r/voidlinux/new.rss][r/voidlinux]] +**** [[https://www.reddit.com/r/NixOS/new.rss][r/NixOS]] +**** [[https://www.reddit.com/r/bedrocklinux/new.rss][r/bedrocklinux]] +**** [[https://www.reddit.com/r/Fedora/new.rss][r/Fedora]] +**** [[https://www.reddit.com/r/gnome/new.rss][r/gnome]] +**** [[https://www.reddit.com/r/kde/new.rss][r/kde]] +**** [[https://www.reddit.com/r/swaywm/new.rss][r/swaywm]] +**** [[https://www.reddit.com/r/flatpak/new.rss][r/flatpak]] +**** [[https://www.reddit.com/r/emacs/new.rss][r/emacs]] +**** [[https://www.reddit.com/r/neovim/new.rss][r/neovim]] +**** [[https://www.reddit.com/r/GnuPG/new.rss][r/GnuPG]] +**** [[https://www.reddit.com/r/commandline/new.rss][r/commandline]] +*** Fluff :fluff: +**** [[https://www.reddit.com/r/unixporn/new.rss][r/unixporn]] +**** [[https://www.reddit.com/r/Rainmeter/new.rss][r/Rainmeter]] +**** [[https://www.reddit.com/r/FirefoxCSS/new.rss][r/FirefoxCSS]] +**** [[https://www.reddit.com/r/startpages/new.rss][r/startpages]] +**** [[https://www.reddit.com/r/wallpaper/new.rss][r/wallpaper]] +**** [[https://www.reddit.com/r/Animewallpaper/new.rss][r/Animewallpaper]] +**** [[https://www.reddit.com/r/AnimewallpapersSFW/new.rss][r/AnimewallpapersSFW]] +**** [[https://www.reddit.com/r/awwnime/new.rss][r/awwnime]] +**** [[https://www.reddit.com/r/Lolirefugees/new.rss][r/Lolirefugees]] +**** [[https://www.reddit.com/r/AnimeGirlsInKimonos/new.rss][r/AnimeGirlsInKimonos]] +**** [[https://www.reddit.com/r/fatestaynight/new.rss][r/fatestaynight]] +**** [[https://www.reddit.com/r/Saber/new.rss][r/Saber]] +**** [[https://www.reddit.com/r/OneTrueTohsaka/new.rss][r/OneTrueTohsaka]] +**** [[https://www.reddit.com/r/formalwaifus/new.rss][r/formalwaifus]] +**** [[https://www.reddit.com/r/LightNovels/new.rss][r/LightNovels]] +**** [[https://www.reddit.com/r/PixelArt/new.rss][r/PixelArt]] +**** [[https://www.reddit.com/r/riprequests/new.rss][r/riprequests]] +** News :news: +*** [[http://feeds.bbci.co.uk/news/rss.xml][BBC News]] +*** [[https://www.theguardian.com/world/rss][The Guardian]] +*** [[http://rss.cnn.com/rss/edition_world.rss][CNN World]] +*** [[https://www.nytimes.com/svc/collections/v1/publish/https://www.nytimes.com/section/world/rss.xml][The NewYork Times]] +*** [[http://feeds.washingtonpost.com/rss/world][Washington Post]] +*** [[https://www.cbsnews.com/latest/rss/world][CBS News]] +*** [[http://www.independent.co.uk/news/world/rss][The Independent]] diff --git a/home/.config/doom/images/asuna.png b/home/.config/doom/images/asuna.png new file mode 100644 index 0000000..f206c32 Binary files /dev/null and b/home/.config/doom/images/asuna.png differ diff --git a/home/.config/doom/images/chiyo.png b/home/.config/doom/images/chiyo.png new file mode 100644 index 0000000..6b3cfc7 Binary files /dev/null and b/home/.config/doom/images/chiyo.png differ diff --git a/home/.config/doom/images/emilia.png b/home/.config/doom/images/emilia.png new file mode 100644 index 0000000..1bb3394 Binary files /dev/null and b/home/.config/doom/images/emilia.png differ diff --git a/home/.config/doom/images/girl.png b/home/.config/doom/images/girl.png new file mode 100644 index 0000000..5b4badf Binary files /dev/null and b/home/.config/doom/images/girl.png differ diff --git a/home/.config/doom/images/miku.png b/home/.config/doom/images/miku.png new file mode 100644 index 0000000..c427886 Binary files /dev/null and b/home/.config/doom/images/miku.png differ diff --git a/home/.config/doom/images/miku2.png b/home/.config/doom/images/miku2.png new file mode 100644 index 0000000..33990c5 Binary files /dev/null and b/home/.config/doom/images/miku2.png differ diff --git a/home/.config/doom/images/rem.png b/home/.config/doom/images/rem.png new file mode 100644 index 0000000..2b139ea Binary files /dev/null and b/home/.config/doom/images/rem.png differ diff --git a/home/.config/doom/images/rin.png b/home/.config/doom/images/rin.png new file mode 100644 index 0000000..c27f6c0 Binary files /dev/null and b/home/.config/doom/images/rin.png differ diff --git a/home/.config/doom/images/yui.png b/home/.config/doom/images/yui.png new file mode 100644 index 0000000..ed310c1 Binary files /dev/null and b/home/.config/doom/images/yui.png differ diff --git a/home/.config/doom/images/yukino.png b/home/.config/doom/images/yukino.png new file mode 100644 index 0000000..b59ffc9 Binary files /dev/null and b/home/.config/doom/images/yukino.png differ diff --git a/home/.config/doom/init.el b/home/.config/doom/init.el new file mode 100644 index 0000000..6472196 --- /dev/null +++ b/home/.config/doom/init.el @@ -0,0 +1,209 @@ +;;; init.el -*- lexical-binding: t; -*- + +;; This file controls what Doom modules are enabled and what order they load +;; in. Remember to run 'doom sync' after modifying it! + +;; NOTE Press 'SPC h d h' (or 'C-h d h' for non-vim users) to access Doom's +;; documentation. There you'll find a "Module Index" link where you'll find +;; a comprehensive list of Doom's modules and what flags they support. + +;; NOTE Move your cursor over a module's name (or its flags) and press 'K' (or +;; 'C-c c k' for non-vim users) to view its documentation. This works on +;; flags as well (those symbols that start with a plus). +;; +;; Alternatively, press 'gd' (or 'C-c c d') on a module to browse its +;; directory (for easy access to its source code). + +(doom! :input + ;;chinese + japanese + ;;layout ; auie,ctsrnm is the superior home row + + :completion + (company ; the ultimate code completion backend + +childframe) + ;;helm ; the *other* search engine for love and life + ;;ido ; the other *other* search engine... + (ivy ; a search engine for love and life + +fuzzy + +prescient + +icons) + + :ui + ;;deft ; notational velocity for Emacs + doom ; what makes DOOM look the way it does + doom-dashboard ; a nifty splash screen for Emacs + doom-quit ; DOOM quit-message prompts when you quit Emacs + (emoji ; :) + +unicode + +github + +ascii) + ;;fill-column ; a `fill-column' indicator + hl-todo ; highlight TODO/FIXME/NOTE/DEPRECATED/HACK/REVIEW + ;;hydra + indent-guides ; highlighted indent columns + (ligatures +extra); ligatures and symbols to make your code pretty again + ;;minimap ; show a map of the code on the side + modeline ; snazzy, Atom-inspired modeline, plus API + nav-flash ; blink cursor line after big motions + ;;neotree ; a project drawer, like NERDTree for vim + ophints ; highlight the region an operation acts on + (popup ; tame sudden yet inevitable temporary windows + +all + +defaults) + tabs ; a tab bar for Emacs + treemacs ; a project drawer, like neotree but cooler + unicode ; extended unicode support for various languages + vc-gutter ; vcs diff in the fringe + ;;vi-tilde-fringe ; fringe tildes to mark beyond EOB + ;;window-select ; visually switch windows + workspaces ; tab emulation, persistence & separate workspaces + ;;zen ; distraction-free coding or writing + + :editor + (evil +everywhere); come to the dark side, we have cookies + file-templates ; auto-snippets for empty files + fold ; (nigh) universal code folding + ;;(format +onsave) ; automated prettiness + ;;god ; run Emacs commands without modifier keys + ;;lispy ; vim for lisp, for people who don't like vim + multiple-cursors ; editing in many places at once + ;;objed ; text object editing for the innocent + ;;parinfer ; turn lisp into python, sort of + ;;rotate-text ; cycle region at point between text candidates + snippets ; my elves. They type so I don't have to + ;;word-wrap ; soft wrapping with language-aware indent + + :emacs + (dired ; making dired pretty [functional] + +ranger + +icons) + electric ; smarter, keyword-based electric-indent + (ibuffer +icons) ; interactive buffer management + (undo +tree) ; persistent, smarter undo for your inevitable mistakes + vc ; version-control and Emacs, sitting in a tree + + :term + eshell ; the elisp shell that works everywhere + ;;shell ; simple shell REPL for Emacs + ;;term ; basic terminal emulator for Emacs + vterm ; the best terminal emulation in Emacs + + :checkers + syntax ; tasing you for every semicolon you forget + ;;spell ; tasing you for misspelling mispelling + ;;grammar ; tasing grammar mistake every you make + + :tools + ;;ansible + debugger ; FIXME stepping through code, to help you add bugs + direnv + ;;docker + editorconfig ; let someone else argue about tabs vs spaces + ;;ein ; tame Jupyter notebooks with emacs + (eval +overlay) ; run code, run (also, repls) + ;;gist ; interacting with github gists + lookup ; navigate your code and its documentation + lsp + (magit +forge) ; a git porcelain for Emacs + make ; run make tasks from Emacs + ;;pass ; password manager for nerds + ;;pdf ; pdf enhancements + ;;prodigy ; FIXME managing external services & code builders + rgb ; creating color strings + ;;taskrunner ; taskrunner for all your projects + ;;terraform ; infrastructure as code + ;;tmux ; an API for interacting with tmux + ;;upload ; map local to remote projects via ssh/ftp + + :os + ;;(:if IS-MAC macos); improve compatibility with macOS + ;;tty ; improve the terminal Emacs experience + + :lang + ;;agda ; types of types of types of types... + (cc +lsp) ; C/C++/Obj-C madness + ;;clojure ; java with a lisp + ;;common-lisp ; if you've seen one lisp, you've seen them all + ;;coq ; proofs-as-programs + ;;crystal ; ruby at the speed of c + ;;csharp ; unity, .NET, and mono shenanigans + ;;data ; config/data formats + ;;(dart +flutter) ; paint ui and not much else + ;;elixir ; erlang done right + ;;elm ; care for a cup of TEA? + emacs-lisp ; drown in parentheses + ;;erlang ; an elegant language for a more civilized age + ;;ess ; emacs speaks statistics + ;;faust ; dsp, but you get to keep your soul + ;;fsharp ; ML stands for Microsoft's Language + ;;fstar ; (dependent) types and (monadic) effects and Z3 + ;;gdscript ; the language you waited for + ;;(go +lsp) ; the hipster dialect + ;;(haskell +dante) ; a language that's lazier than I am + ;;hy ; readability of scheme w/ speed of python + ;;idris ; + json ; At least it ain't XML + ;;(java +meghanada) ; the poster child for carpal tunnel syndrome + (javascript +lsp) ; all(hope(abandon(ye(who(enter(here)))))) + ;;julia ; a better, faster MATLAB + ;;kotlin ; a better, slicker Java(Script) + (latex ; writing papers in Emacs has never been so fun + +latexmk + +cdlatex + +fold) + ;;lean + ;;factor + ;;ledger ; an accounting system in Emacs + lua ; one-based indices? one-based indices + markdown ; writing docs for people to ignore + ;;nim ; python + lisp at the speed of c + ;;nix ; I hereby declare "nix geht mehr!" + ;;ocaml ; an objective camel + (org ; organize your plain life in plain text + +pretty + +dragndrop + ;;+gnuplot + ;;+jupyter + +journal + +present + +pandoc) + ;;php ; perl's insecure younger brother + ;;plantuml ; diagrams for confusing people more + ;;purescript ; javascript, but functional + (python ; beautiful is better than ugly + +lsp + +pyenv + +poetry + +pyright) + ;;qt ; the 'cutest' gui framework ever + ;;racket ; a DSL for DSLs + ;;raku ; the artist formerly known as perl6 + ;;rest ; Emacs as a REST client + ;;rst ; ReST in peace + ;;(ruby +rails) ; 1.step {|i| p "Ruby is #{i.even? ? 'love' : 'life'}"} + ;;rust ; Fe2O3.unwrap().unwrap().unwrap().unwrap() + ;;scala ; java, but good + ;;scheme ; a fully conniving family of lisps + sh ; she sells {ba,z,fi}sh shells on the C xor + ;;sml + ;;solidity ; do you need a blockchain? No. + ;;swift ; who asked for emoji variables? + ;;terra ; Earth and Moon in alignment for performance. + web ; the tubes + yaml ; JSON, but readable + + :email + (mu4e +gmail) + ;;notmuch + ;;(wanderlust +gmail) + + :app + calendar + irc ; how neckbeards socialize + (rss +org) ; emacs as an RSS reader + ;;twitter ; twitter client https://twitter.com/vnought + + :config + ;;literate + (default +bindings +smartparens)) diff --git a/home/.config/doom/packages.el b/home/.config/doom/packages.el new file mode 100644 index 0000000..7a2b8ab --- /dev/null +++ b/home/.config/doom/packages.el @@ -0,0 +1,61 @@ +;; -*- no-byte-compile: t; -*- +;;; $DOOMDIR/packages.el + +;; To install a package with Doom you must declare them here and run 'doom sync' +;; on the command line, then restart Emacs for the changes to take effect -- or +;; use 'M-x doom/reload'. + + +;; To install SOME-PACKAGE from MELPA, ELPA or emacsmirror: +;(package! some-package) + +;; To install a package directly from a remote git repo, you must specify a +;; `:recipe'. You'll find documentation on what `:recipe' accepts here: +;; https://github.com/raxod502/straight.el#the-recipe-format +;(package! another-package +; :recipe (:host github :repo "username/repo")) + +;; If the package you are trying to install does not contain a PACKAGENAME.el +;; file, or is located in a subdirectory of the repo, you'll need to specify +;; `:files' in the `:recipe': +;(package! this-package +; :recipe (:host github :repo "username/repo" +; :files ("some-file.el" "src/lisp/*.el"))) + +;; If you'd like to disable a package included with Doom, you can do so here +;; with the `:disable' property: +;(package! builtin-package :disable t) + +;; You can override the recipe of a built in package without having to specify +;; all the properties for `:recipe'. These will inherit the rest of its recipe +;; from Doom or MELPA/ELPA/Emacsmirror: +;(package! builtin-package :recipe (:nonrecursive t)) +;(package! builtin-package-2 :recipe (:repo "myfork/package")) + +;; Specify a `:branch' to install a package from a particular branch or tag. +;; This is required for some packages whose default branch isn't 'master' (which +;; our package manager can't deal with; see raxod502/straight.el#279) +;(package! builtin-package :recipe (:branch "develop")) + +;; Use `:pin' to specify a particular commit to install. +;(package! builtin-package :pin "1a2b3c4d5e") + + +;; Doom's packages are pinned to a specific commit and updated from release to +;; release. The `unpin!' macro allows you to unpin single packages... +;(unpin! pinned-package) +;; ...or multiple packages +;(unpin! pinned-package another-pinned-package) +;; ...Or *all* packages (NOT RECOMMENDED; will likely break things) +;(unpin! t) + +;; Emacs is an OS +;;(package! emms) + +;; Syntax +(package! vimrc-mode) +(package! fish-mode) + +;; Improvements +(package! magit-delta) +;; (package! mixed-pitch) diff --git a/home/.config/dunst/clipboard.png b/home/.config/dunst/clipboard.png new file mode 100644 index 0000000..0011c48 Binary files /dev/null and b/home/.config/dunst/clipboard.png differ diff --git a/home/.config/dunst/dunstrc b/home/.config/dunst/dunstrc new file mode 100644 index 0000000..227dc1e --- /dev/null +++ b/home/.config/dunst/dunstrc @@ -0,0 +1,429 @@ +[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 = "0x0-5+30" + + # 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 = no + + # 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 = 5 + + # 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 = 4 + + # Horizontal padding. + horizontal_padding = 8 + + # Defines width in pixels of frame around the notification window. + # Set to 0 to disable. + frame_width = 2 + + # Defines color of the frame around the notification window. + frame_color = "#81a1c1" + # frame_color = "#61afef" + + # 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 = "#4c566a" + # separator_color = "#4b5263" + + # 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 = 0 + + ### Text ### + + font = Sarasa Fixed J 11 + + # 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 = 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 larger icons down to this size, set to 0 to disable + max_icon_size = 64 + + # Paths to default icons. + icon_path = /usr/share/icons/Papirus-Dark/16x16/status/:/usr/share/icons/Papirus-Dark/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 = 7 + + ### Misc/Advanced ### + + # dmenu path. + #dmenu = /usr/bin/dmenu -p dunst: + + # Browser for opening urls in context menu. + browser = /usr/bin/firefox --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 = 10 + + ### 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 action of 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. + mouse_left_click = do_action + mouse_middle_click = close_all + mouse_right_click = close_current + +# 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 + +[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. + close = ctrl+space + + # Close all notifications. + close_all = ctrl+shift+space + + # Redisplay last message(s). + # On the US keyboard layout "grave" is normally above TAB and left + # of "1". Make sure this key actually exists on your keyboard layout, + # e.g. check output of 'xmodmap -pke' + history = ctrl+grave + + # Context menu. + 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. + # --- Nord --- # + background = "#2e3440" + foreground = "#81a1c1" + # -- OneDark -- # + # background = "#282c34" + # foreground = "#61afef" + timeout = 10 + # Icon for notifications with low urgency, uncomment to enable + icon = ~/.config/dunst/penguin.png + +[urgency_normal] + # --- Nord --- # + background = "#2e3440" + foreground = "#ebcb8b" + # -- OneDark -- # + # background = "#282c34" + # foreground = "#e5c07b" + timeout = 10 + # Icon for notifications with normal urgency, uncomment to enable + icon = ~/.config/dunst/penguin.png + +[urgency_critical] + # --- Nord --- # + background = "#bf616a" + foreground = "#2e3440" + frame_color = "#ebcb8b" + # -- OneDark -- # + # background = "#e06c75" + # foreground = "#282c34" + # frame_color = "#e5c07b" + timeout = 0 + # Icon for notifications with critical urgency, uncomment to enable + icon = ~/.config/dunst/penguin_red.png + +# 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/dunst/headphones.png b/home/.config/dunst/headphones.png new file mode 100644 index 0000000..acd5325 Binary files /dev/null and b/home/.config/dunst/headphones.png differ diff --git a/home/.config/dunst/idea.png b/home/.config/dunst/idea.png new file mode 100644 index 0000000..34a863b Binary files /dev/null and b/home/.config/dunst/idea.png differ diff --git a/home/.config/dunst/microphone.png b/home/.config/dunst/microphone.png new file mode 100644 index 0000000..24472e0 Binary files /dev/null and b/home/.config/dunst/microphone.png differ diff --git a/home/.config/dunst/mute.png b/home/.config/dunst/mute.png new file mode 100644 index 0000000..d35b2b7 Binary files /dev/null and b/home/.config/dunst/mute.png differ diff --git a/home/.config/dunst/notrackpad.png b/home/.config/dunst/notrackpad.png new file mode 100644 index 0000000..14e6731 Binary files /dev/null and b/home/.config/dunst/notrackpad.png differ diff --git a/home/.config/dunst/penguin.png b/home/.config/dunst/penguin.png new file mode 100644 index 0000000..02901d1 Binary files /dev/null and b/home/.config/dunst/penguin.png differ diff --git a/home/.config/dunst/penguin_red.png b/home/.config/dunst/penguin_red.png new file mode 100755 index 0000000..ef6938c Binary files /dev/null and b/home/.config/dunst/penguin_red.png differ diff --git a/home/.config/dunst/photograph.png b/home/.config/dunst/photograph.png new file mode 100644 index 0000000..be1ed84 Binary files /dev/null and b/home/.config/dunst/photograph.png differ diff --git a/home/.config/dunst/speaker.png b/home/.config/dunst/speaker.png new file mode 100644 index 0000000..eda4e6e Binary files /dev/null and b/home/.config/dunst/speaker.png differ diff --git a/home/.config/dunst/trackpad.png b/home/.config/dunst/trackpad.png new file mode 100644 index 0000000..85efa5a Binary files /dev/null and b/home/.config/dunst/trackpad.png differ diff --git a/home/.config/fish/conf.d/aliases.fish b/home/.config/fish/conf.d/aliases.fish new file mode 100644 index 0000000..cb390ee --- /dev/null +++ b/home/.config/fish/conf.d/aliases.fish @@ -0,0 +1,70 @@ +# _________________ +# ___ |__ /__(_)_____ ________ +# __ /| |_ /__ /_ __ `/_ ___/ +# _ ___ | / _ / / /_/ /_(__ ) +# /_/ |_/_/ /_/ \__,_/ /____/ +# +# remap +alias doas='doas --' +abbr p pulsemixer +alias startx='startx $HOME/.config/X11/xinitrc' +alias fehwpp="feh --no-fehbg --bg-fill --randomize ~/Pictures/Wallpapers/*" +alias ls='exa -lF --icons --sort=type' +alias la='exa -laF --icons --sort=type' +alias lt='exa --tree' +alias cp='cp -vir' +alias mv='mv -vir' +alias rm='rm -vr' +alias mkdir='mkdir -pv' +abbr no 'grep -viP' +abbr latest_pkg "expac --timefmt='%Y-%m-%d %T' '%l\t%n' | sort | tail -n 30" +alias yarn='yarn --use-yarnrc $HOME/.config/yarn/config' +abbr tmux 'TERM=screen-256color command tmux' +alias cat='bat --style plain --color=always' +alias myip='curl ipinfo.io/geo' +# colorizing +alias grep='grep --color=auto' +alias fgrep='fgrep --color=auto' +alias egrep='egrep --color=auto' +alias diff='diff --color=auto' +alias ncdu='ncdu --color=dark' +alias ip='ip -color=always' +# vim +abbr v nvim +abbr vi 'nvim -o (fzf)' +# emacs +alias doom='$HOME/.config/emacs/bin/doom' +abbr e 'emacs -nw' +alias emacs="emacsclient -c -a 'emacs'" +# rsync +abbr rsyncdir "rsync -uavP --delete-after" +abbr rsyncfile "rsync -avP" +# youtube-dl +abbr yoump3 'youtube-dl --extract-audio --audio-format mp3 --embed-thumbnail' +abbr youflac 'youtube-dl --extract-audio --audio-format flac' +abbr youbest 'youtube-dl -f bestvideo+bestaudio' +abbr youlist 'youtube-dl -f bestvideo+bestaudio --yes-playlist' +# nnn +abbr nnn 'nnn -Hc' +alias ncp="cat $XDG_CONFIG_HOME/nnn/.selection | tr '\0' '\n'" +# zlua +alias zc='z -c' # restrict matches to subdirs of $PWD +alias zz='z -i' # cd with interactive selection +alias zf='z -I' # use fzf to select in multiple matches +alias zb='z -b' # quickly cd to the parent directory +alias zbi='z -b -i' # interactive jump backward +alias zbf='z -b -I' # interactive jump backward with fzf + +# Lazy cd-ing +function .. ; cd .. ; end +function ... ; cd ../.. ; end +function .... ; cd ../../.. ; end + +# Bad hands +abbr gti git +abbr ragner ranger +abbr claer clear +abbr sduo sudo +abbr duso sudo +abbr daso doas +abbr daos doas diff --git a/home/.config/fish/conf.d/env.fish b/home/.config/fish/conf.d/env.fish new file mode 100644 index 0000000..2330650 --- /dev/null +++ b/home/.config/fish/conf.d/env.fish @@ -0,0 +1,363 @@ +# __________ +# ___ ____/_________ __ +# __ __/ __ __ \_ | / / +# _ /___ _ / / /_ |/ / +# /_____/ /_/ /_/_____/ + +# cursor shapes +set -g fish_cursor_default block +set -g fish_cursor_insert line +set -g fish_cursor_replace_one underscore +set -g fish_cursor_visual block + +# no greeting +set -g fish_greeting + +# XDG thingy +set -gx XDG_CONFIG_HOME $HOME/.config +set -gx XDG_CACHE_HOME $HOME/.cache +set -gx XDG_DATA_HOME $HOME/.local/share +set -gx XDG_DATA_DIRS $HOME/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share:/usr/share +# alternate paths +set -gx LESSHISTFILE - +set -gx MOST_INITFILE $XDG_CONFIG_HOME/mostrc +set -gx GTK2_RC_FILES $XDG_CONFIG_HOME/gtk-2.0/gtkrc +set -gx TERMINFO $XDG_DATA_HOME/terminfo +set -gx TERMINFO_DIRS $XDG_DATA_HOME/terminfo:/usr/share/terminfo +set -gx GOPATH $XDG_DATA_HOME/go +set -gx GRADLE_USER_HOME $XDG_DATA_HOME/gradle +set -gx _JAVA_OPTIONS -Djava.util.prefs.userRoot=$XDG_CONFIG_HOME/java +set -gx NODE_REPL_HISTORY $XDG_CACHE_HOME/node_repl_history +set -gx NPM_CONFIG_USERCONFIG $XDG_CONFIG_HOME/npm/npmrc +set -gx NPM_CONFIG_PREFIX $XDG_DATA_HOME/npm-global +set -gx CARGO_HOME $XDG_DATA_HOME/cargo +set -gx RUSTUP_HOME $XDG_DATA_HOME/rustup +set -gx BUNDLE_USER_CONFIG $XDG_CONFIG_HOME/bundle +set -gx BUNDLE_USER_CACHE $XDG_CACHE_HOME/bundle +set -gx BUNDLE_USER_PLUGIN $XDG_DATA_HOME/bundle +set -gx GEM_HOME $XDG_DATA_HOME/gem +set -gx GEM_SPEC_CACHE $XDG_CACHE_HOME/gem +set -gx DOCKER_CONFIG $XDG_CONFIG_HOME/docker +set -gx GNUPGHOME $XDG_DATA_HOME/gnupg +set -gx IPYTHONDIR $XDG_CONFIG_HOME/ipython +set -gx JUPYTER_CONFIG_DIR $XDG_CONFIG_HOME/jupyter +set -gx XAUTHORITY $XDG_RUNTIME_DIR/Xauthority +set -gx XINITRC $XDG_CONFIG_HOME/X11/xinitrc +set -gx XSERVERRC $XDG_CONFIG_HOME/X11/xserverrc + +# env +set -gx EDITOR nvim +set -gx VISUAL nvim +set -gx PAGER less +set -gx SVDIR $HOME/.local/share/service +set -gx _JAVA_AWT_WM_NONREPARENTING 1 +set -gx GPG_TTY (tty) +# bat +set -gx BAT_THEME "base16" +# pfetch +set -gx PF_INFO "ascii title kernel wm shell uptime pkgs memory" +# fzf +set -gx FZF_DEFAULT_OPTS "--multi --layout=reverse --inline-info + --color fg:#D8DEE9,bg:#2E3440,hl:#A3BE8C,fg+:#D8DEE9,bg+:#434C5E,hl+:#A3BE8C + --color pointer:#BF616A,info:#4C566A,spinner:#4C566A,header:#4C566A,prompt:#81A1C1,marker:#EBCB8B" +# set -gx FZF_DEFAULT_OPTS "--multi --layout=reverse --inline-info +# --color dark +# --color fg:-1,bg:-1,hl:#c678dd,fg+:#ffffff,bg+:#4b5263,hl+:#d858fe +# --color info:#98c379,prompt:#61afef,pointer:#be5046,marker:#e5c07b,spinner:#61afef,header:#61afef" +set -gx FZF_DEFAULT_COMMAND "fd --type f --follow --hidden --exclude .git" +set -gx FZF_CTRL_T_OPTS "--no-height --preview-window 'left:60%' --preview '$HOME/.local/bin/garbage/preview {} 2>/dev/null'" +set -gx FZF_CTRL_T_COMMAND "fd --follow --hidden --exclude .git" +set -gx FZF_ALT_C_OPTS "--preview 'tree -La 1 -C --dirsfirst {} 2>/dev/null'" +set -gx FZF_ALT_C_COMMAND "fd --type d --follow --hidden --exclude .git" +set -gx FZF_TMUX 1 +# ibus +set -gx GTK_IM_MODULE ibus +set -gx XMODIFIERS @im=ibus +set -gx QT_IM_MODULE ibus +# qt5ct +set -gx QT_QPA_PLATFORMTHEME qt5ct +set -gx QT_PLATFORM_PLUGIN qt5ct +# .NET +set -gx DOTNET_CLI_TELEMETRY_OPTOUT 1 +# nodenv +set -gx NODENV_ROOT $XDG_DATA_HOME/nodenv +# pyenv +set -gx PYENV_ROOT $XDG_DATA_HOME/pyenv +# poetry +set -gx POETRY_HOME $XDG_DATA_HOME/poetry +# z.lua +set -gx _ZL_DATA $HOME/.local/share/zlua/zlua +set -gx _ZL_HYPHEN 1 +set -gx _ZL_MATCH_MODE 1 +set -gx _ZL_FZF_FLAG '-e' +set -gx _ZL_INT_SORT 1 +set -gx _ZL_ROOT_MARKERS ".git,.svn,.hg,.root,package.json,.projectile,.pro" +set -gx RANGER_ZLUA $HOME/.config/fish/z.lua +# nnn +if command -v nnn >/dev/null + set -gx TERMINAL alacritty + set -gx NNN_PLUG 't:preview-tui;m:nmount;f:fzcd;c:chksum;n:nuke;z:fzz;b:bulknew;d:dups:h:hexview;o:organize;p:pdfview;s:suedit' + set -gx NNN_FIFO /tmp/nnn.fifo + set -gx NNN_ARCHIVE '\\.(7z|a|ace|alz|arc|arj|bz|bz2|cab|cpio|deb|gz|jar|lha|lz|lzh|lzma|lzo|rar|rpm|rz|t7z|tar|tbz|tbz2|tgz|tlz|txz|tZ|tzo|war|xpi|xz|Z|zip)$' + set -gx NNN_OPENER $XDG_CONFIG_HOME/nnn/plugins/nuke + set -gx USE_SCOPE 1 + set -gx NNN_FCOLORS 'c1e2272e006033f7c6d6abc4' + set -gx NNN_COLORS '2345' + set -gx NNN_BMS "h:~;C:~/Code;D:~/Downloads;P:~/Pictures;V:~/Videos;A:~/Media;U:~/Music;f:~/.config;l:~/.local/share;e:/etc;u:/usr/share;o:/opt;b:/boot;m:/media;M:/mnt;i:/run/media/$USER;v:/var;t:/tmp;d:/dev;s:/srv;r:/;k:/bedrock/strata" + set -gx NNN_SSHFS "sshfs -o reconnect,idmap=user,follow_symlinks" +end +# lf +if command -v lf >/dev/null + set -gx LF_ICONS "\ + tw=:\ + st=:\ + ow=:\ + dt=:\ + di=:\ + fi=:\ + ln=:\ + or=:\ + ex=:\ + *.7z=:\ + *.a=:\ + *.ace=:\ + *.alz=:\ + *.ai=:\ + *.apk=:\ + *.arc=:\ + *.arj=:\ + *.asm=:\ + *.asp=:\ + *.aup=:\ + *.avi=:\ + *.awk=:\ + *.bash=:\ + *.bat=:\ + *.bmp=:\ + *.bz=:\ + *.bz2=:\ + *.c=:\ + *.c++=:\ + *.cab=:\ + *.cbr=:\ + *.cbz=:\ + *.cc=:\ + *.class=:\ + *.clj=:\ + *.cljc=:\ + *.cljs=:\ + *.cmake=:\ + *.cmd=:\ + *.coffee=:\ + *.conf=:\ + *.cp=:\ + *.cpio=:\ + *.cpp=:\ + *.cs=:\ + *.csh=:\ + *.css=:\ + *.cue=:\ + *.cvs=:\ + *.cxx=:\ + *.d=:\ + *.dart=:\ + *.db=:\ + *.deb=:\ + *.diff=:\ + *.dll=:\ + *.doc=:\ + *.docx=:\ + *.dump=:\ + *.dwm=:\ + *.dz=:\ + *.edn=:\ + *.eex=:\ + *.efi=:\ + *.ejs=:\ + *.elf=:\ + *.elm=:\ + *.epub=:\ + *.ear=:\ + *.erl=:\ + *.esd=:\ + *.ex=:\ + *.exe=:\ + *.exs=:\ + *.f#=:\ + *.fifo=|:\ + *.fish=:\ + *.flac=:\ + *.flv=:\ + *.fs=:\ + *.fsi=:\ + *.fsscript=:\ + *.fsx=:\ + *.gem=:\ + *.gemspec=:\ + *.gif=:\ + *.go=:\ + *.gz=:\ + *.gzip=:\ + *.h=:\ + *.haml=:\ + *.hbs=:\ + *.hh=:\ + *.hpp=:\ + *.hrl=:\ + *.hs=:\ + *.htaccess=:\ + *.htm=:\ + *.html=:\ + *.htpasswd=:\ + *.hxx=:\ + *.ico=:\ + *.img=:\ + *.ini=:\ + *.iso=:\ + *.jar=:\ + *.java=:\ + *.jl=:\ + *.jpeg=:\ + *.jpg=:\ + *.js=:\ + *.json=:\ + *.jsx=:\ + *.key=:\ + *.ksh=:\ + *.leex=:\ + *.less=:\ + *.lha=:\ + *.lhs=:\ + *.log=:\ + *.lrz=:\ + *.lua=:\ + *.lz=:\ + *.lz4=:\ + *.lzh=:\ + *.lzma=:\ + *.lzo=:\ + *.m2v=:\ + *.m4a=:\ + *.m4v=:\ + *.markdown=:\ + *.md=:\ + *.mdx=:\ + *.mjpeg=:\ + *.mjpg=:\ + *.mjs=:\ + *.mkv=:\ + *.ml=λ:\ + *.mli=λ:\ + *.mng=:\ + *.mov=:\ + *.mp3=:\ + *.mp4=:\ + *.mp4v=:\ + *.mpeg=:\ + *.mpg=:\ + *.msi=:\ + *.mustache=:\ + *.nix=:\ + *.o=:\ + *.odt=:\ + *.ods=:\ + *.odp=:\ + *.ogg=:\ + *.pdf=:\ + *.php=:\ + *.pl=:\ + *.pm=:\ + *.png=:\ + *.pp=:\ + *.ppt=:\ + *.pptx=:\ + *.pro=:\ + *.ps1=:\ + *.psb=:\ + *.pub=:\ + *.py=:\ + *.pyc=:\ + *.pyd=:\ + *.pyo=:\ + *.r=ﳒ:\ + *.rake=:\ + *.rar=:\ + *.rb=:\ + *.rc=:\ + *.rlib=:\ + *.rmd=:\ + *.rom=:\ + *.rpm=:\ + *.rproj=鉶:\ + *.rs=:\ + *.rss=:\ + *.rtf=:\ + *.rz=:\ + *.s=:\ + *.sar=:\ + *.sass=:\ + *.scala=:\ + *.scss=:\ + *.sh=:\ + *.slim=:\ + *.sln=:\ + *.so=:\ + *.sql=:\ + *.styl=:\ + *.suo=:\ + *.svg=:\ + *.swift=:\ + *.swm=:\ + *.t=:\ + *.t7z=:\ + *.tar=:\ + *.taz=:\ + *.tbz=:\ + *.tbz2=:\ + *.tex=ﭨ:\ + *.tgz=:\ + *.tif=:\ + *.tiff=:\ + *.tlz=:\ + *.toml=:\ + *.ts=:\ + *.tsx=:\ + *.txz=:\ + *.tz=:\ + *.tzo=:\ + *.tzst=:\ + *.twig=:\ + *.vifm=:\ + *.vim=:\ + *.vimrc=:\ + *.vob=:\ + *.vue=﵂:\ + *.wav=:\ + *.war=:\ + *.webm=:\ + *.webmanifest=:\ + *.webp=:\ + *.wim=:\ + *.xbm=:\ + *.xbps=:\ + *.xcplayground=:\ + *.xhtml=:\ + *.xls=:\ + *.xlsx=:\ + *.xml=:\ + *.xpm=:\ + *.xul=:\ + *.xz=:\ + *.yaml=:\ + *.yml=:\ + *.z=:\ + *.zip=:\ + *.zoo=:\ + *.zsh=:\ + *.zip=:\ + *.zst=:\ + " +end + +# PATH +set -gx fish_user_paths $HOME/.local/bin $HOME/.local/bin/fzf $NODENV_ROOT/bin $PYENV_ROOT/bin $POETRY_HOME/bin $CARGO_HOME/bin $NPM_CONFIG_PREFIX/bin diff --git a/home/.config/fish/conf.d/evaluate.fish b/home/.config/fish/conf.d/evaluate.fish new file mode 100644 index 0000000..2aca6a2 --- /dev/null +++ b/home/.config/fish/conf.d/evaluate.fish @@ -0,0 +1,66 @@ +# Github cli completion +if command -v gh > /dev/null; and not test -f $HOME/.config/fish/completions/gh.fish + gh completion -s fish > $HOME/.config/fish/completions/gh.fish +end + +# kitten from kitty +if command -v kitty > /dev/null + kitty + complete setup fish | source +end + +# Starship prompt +if command -v starship > /dev/null + starship init fish --print-full-init | source +end + +# direnv +if command -v direnv > /dev/null + eval (direnv hook fish) +end + +# poetry +# if not test -d "$POETRY_HOME" +# curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python - +# end +# if not test -f "$HOME/.config/fish/completions/poetry.fish" +# poetry completions fish > $HOME/.config/fish/completions/poetry.fish +# end + +# pyenv +# if not test -d "$PYENV_ROOT" +# git clone https://github.com/pyenv/pyenv.git $PYENV_ROOT +# git clone https://github.com/pyenv/pyenv-update.git $PYENV_ROOT/plugins/pyenv-update +# git clone https://github.com/pyenv/pyenv-virtualenv.git $PYENV_ROOT/plugins/pyenv-virtualenv +# end +# pyenv init - | source +# pyenv virtualenv-init - | source + +# nodenv +# if not test -d "$NODENV_ROOT" +# git clone https://github.com/nodenv/nodenv.git $NODENV_ROOT +# mkdir -p $NODENV_ROOT/plugins +# git clone https://github.com/nodenv/node-build.git $NODENV_ROOT/plugins/node-build +# git clone https://github.com/nodenv/nodenv-env.git $NODENV_ROOT/plugins/nodenv-env +# git clone https://github.com/nodenv/nodenv-man.git $NODENV_ROOT/plugins/nodenv-man +# git clone https://github.com/nodenv/nodenv-aliases.git $NODENV_ROOT/plugins/nodenv-aliases +# git clone https://github.com/nodenv/nodenv-each.git $NODENV_ROOT/plugins/nodenv-each +# git clone https://github.com/nodenv/nodenv-update.git $NODENV_ROOT/plugins/nodenv-update +# git clone https://github.com/nodenv/nodenv-vars.git $NODENV_ROOT/plugins/nodenv-vars +# end +# nodenv init - | source + +# vi key bindings +fish_vi_key_bindings + +# fzf +if not test -f "$HOME/.config/fish/functions/fzf_key_bindings.fish" + curl -sfLo $HOME/.config/fish/functions/fzf_key_bindings.fish https://raw.githubusercontent.com/junegunn/fzf/master/shell/key-bindings.fish +end +fzf_key_bindings + +# z.lua +if not test -f "$HOME/.config/fish/z.lua" + curl -sfLo $HOME/.config/fish/z.lua https://raw.githubusercontent.com/skywind3000/z.lua/master/z.lua + mkdir -p $HOME/.local/share/zlua +end +lua $HOME/.config/fish/z.lua --init fish | source diff --git a/home/.config/fish/conf.d/gpg-agent.fish b/home/.config/fish/conf.d/gpg-agent.fish new file mode 100644 index 0000000..f6ac092 --- /dev/null +++ b/home/.config/fish/conf.d/gpg-agent.fish @@ -0,0 +1,26 @@ +# --- Deprecated ssh-agent --- # +# ---------------------------- # +# if test -z "$XDG_RUNTIME_DIR" +# set -gx SSH_ENV $HOME/.ssh/environment +# else +# set -gx SSH_ENV $XDG_RUNTIME_DIR/ssh-agent.env +# end +# +# if not pgrep -u "$USER" ssh-agent >/dev/null +# ssh-agent -c -t 2h > "$SSH_ENV" +# chmod 600 $SSH_ENV +# end +# +# if test -z "$SSH_AUTH_SOCK" +# source "$SSH_ENV" >/dev/null +# end + +if not pgrep -u "$USER" gpg-agent >/dev/null + gpg-agent --daemon --enable-ssh-support >/dev/null +end + +if test -z "$SSH_AUTH_SOCK" + set -gx SSH_AUTH_SOCK (gpgconf --list-dirs agent-ssh-socket) +end + +gpg-connect-agent updatestartuptty /bye >/dev/null diff --git a/home/.config/fish/conf.d/startwm.fish b/home/.config/fish/conf.d/startwm.fish new file mode 100644 index 0000000..0b96dd6 --- /dev/null +++ b/home/.config/fish/conf.d/startwm.fish @@ -0,0 +1,3 @@ +# if test (tty) = "/dev/tty1"; and test -z "$DISPLAY" +# exec startx $HOME/.config/X11/xinitrc +# end diff --git a/home/.config/fish/fish_plugins b/home/.config/fish/fish_plugins new file mode 100644 index 0000000..5a24c01 --- /dev/null +++ b/home/.config/fish/fish_plugins @@ -0,0 +1,9 @@ +jorgebucaran/fisher +jorgebucaran/spark.fish +oakninja/MakeMeFish +jorgebucaran/bax.fish +laughedelic/pisces +wfxr/forgit +oh-my-fish/plugin-wttr +jorgebucaran/gitio.fish +oh-my-fish/plugin-license diff --git a/home/.config/fish/functions/extract.fish b/home/.config/fish/functions/extract.fish new file mode 100644 index 0000000..86a511c --- /dev/null +++ b/home/.config/fish/functions/extract.fish @@ -0,0 +1,86 @@ +function extract -d "Extract archives" + set -l remove_archive + set -l success + set -l extract_dir + + if test -z "$argv[1]" + echo -e "\e[1;34mUsage:\e[0m extract [-option] [file...] +\e[1;33mOptions:\e[0m + -r, --remove Remove archive after unpacking." + end + + set remove_archive 1 + if [ "$argv[1]" = "-r" ] || [ "$argv[1]" = "--remove" ] + set remove_archive 0 + set --erase argv[1] + end + + while test -n "$argv[1]" + if not test -f "$argv[1]" + echo "extract: '$argv[1]' is not a valid file" >&2 + set --erase argv[1] + continue + end + + set success 0 + set extract_dir (echo "$argv[1]" | cut -d'.' -f1) + switch "$argv[1]" + case "*.tar.gz" or "*.tgz" + tar zxvf "$argv[1]" + case "*.tar.bz2" or "*.tbz" or "*.tbz2" + tar xvjf "$argv[1]" + case "*.tar.xz" or "*.txz" + tar --xz -xvf "$argv[1]"; or xzcat "$argv[1]" | tar xvf - + case "*.tar.zma" or "*.tlz" + tar --lzma -xvf "$argv[1]"; or lzcat "$argv[1]" | tar xvf - + case "*.tar.zst" or "*.tzst" + tar --zstd -xvf "$argv[1]"; or zstdcat "$argv[1]" | tar xvf - + case "*.tar" or "*.tar.lz" + tar xvf "$argv[1]" + case "*.tar.lz4" + lz4 -c -d "$argv[1]" | tar xvf - + case "*.tar.lrz" + lrzuntar "$argv[1]" + case "*.gz" + gunzip -d "$argv[1]" + case "*.bz2" + bunzip2 "$argv[1]" + case "*.xz" + unxz "$argv[1]" + case "*.lrz" + lrunzip "$argv[1]" + case "*.lz4" + lz4 -d "$argv[1]" + case "*.lzma" + unlzma "$argv[1]" + case "*.z" + uncompress "$argv[1]" + case "*.zip" or "*.war" or "*.jar" or "*.sublime-package" or "*.ipa" or "*.ipsw" or "*.xpi" or "*.apk" or "*.aar" or "*.whl" + unzip "$argv[1]" -d "$extract_dir" + case "*.rar" + unrar x -ad "$argv[1]" + case "*.rpm" + mkdir "$extract_dir"; and cd "$extract_dir"; and rpm2cpio "../$argv[1]" | cpio --quiet -id; and cd .. + case "*.7z" + 7za x "$argv[1]" + case "*.deb" + mkdir -p "$extract_dir/control" + mkdir -p "$extract_dir/data" + cd "$extract_dir"; ar vx "../$argv[1]" > /dev/null + cd control; tar xzvf ../control.tar.gz + cd ../data; extract ../data.tar.* + cd ..; rm *.tar.* debian-binary + cd .. + case "*.zst" + unzstd "$argv[1]" + case "*" + echo "extract: '$argv[1]' cannot be extracted" >&2 + set success 1 + end + + if [ "$success" = 0 ] && [ "$remove_archive" = 0 ] + rm "$argv[1]" + end + set --erase argv[1] + end +end diff --git a/home/.config/fish/functions/fish_greeting.fish b/home/.config/fish/functions/fish_greeting.fish new file mode 100644 index 0000000..335bd45 --- /dev/null +++ b/home/.config/fish/functions/fish_greeting.fish @@ -0,0 +1,3 @@ +function fish_greeting -d "fish_greeting" + $HOME/.local/bin/bunny +end diff --git a/home/.config/fish/functions/fish_mode_prompt.fish b/home/.config/fish/functions/fish_mode_prompt.fish new file mode 100644 index 0000000..da3d0a0 --- /dev/null +++ b/home/.config/fish/functions/fish_mode_prompt.fish @@ -0,0 +1,3 @@ +function fish_mode_prompt -d "Vi-mode indicator" + echo "" +end diff --git a/home/.config/fish/functions/fish_user_key_bindings.fish b/home/.config/fish/functions/fish_user_key_bindings.fish new file mode 100644 index 0000000..e6611e1 --- /dev/null +++ b/home/.config/fish/functions/fish_user_key_bindings.fish @@ -0,0 +1,39 @@ +bind -M insert \cu backward-kill-line +bind -M insert \ck kill-line +bind -M insert \cw backward-kill-word +bind -M insert \cb backward-word +bind -M insert \cf forward-word +bind -M insert \cs complete-and-search +bind -M insert \ca beginning-of-line +bind -M insert \ce end-of-line +bind -M insert \co accept-autosuggestion +bind -M insert \cp history-search-backward +bind -M insert \cn history-search-forward + +bind -M default \cu backward-kill-line +bind -M default \ck kill-whole-line +bind -M default k history-search-backward +bind -M default j history-search-forward + +# Previous command ('!!') +function bind_bang + switch (commandline -t) + case "!" + commandline -t $history[1]; commandline -f repaint + case "*" + commandline -i '!' + end +end +bind -M insert '!' bind_bang + +# Token from previous command ('!$') +function bind_dollar + switch (commandline -t) + case "!" + commandline -t "" + commandline -f history-token-search-backward + case "*" + commandline -i '$' + end +end +bind -M insert '$' bind_dollar diff --git a/home/.config/fish/functions/fisher.fish b/home/.config/fish/functions/fisher.fish new file mode 100644 index 0000000..c79c60d --- /dev/null +++ b/home/.config/fish/functions/fisher.fish @@ -0,0 +1,206 @@ +set -g fisher_version 4.1.0 + +function fisher -a cmd -d "fish plugin manager" + set -q fisher_path || set -l fisher_path $__fish_config_dir + set -l fish_plugins $__fish_config_dir/fish_plugins + + switch "$cmd" + case -v --version + echo "fisher, version $fisher_version" + case "" -h --help + echo "usage: fisher install install plugins" + echo " fisher remove remove installed plugins" + echo " fisher update update installed plugins" + echo " fisher update update all installed plugins" + echo " fisher list [] list installed plugins matching regex" + echo "options:" + echo " -v or --version print fisher version" + echo " -h or --help print this help message" + case ls list + string match --entire --regex -- "$argv[2]" $_fisher_plugins + case install update remove + isatty || read -laz stdin && set -a argv $stdin + set -l install_plugins + set -l update_plugins + set -l remove_plugins + set -l arg_plugins $argv[2..-1] + set -l old_plugins $_fisher_plugins + set -l new_plugins + + if not set -q argv[2] + if test "$cmd" != update || test ! -e $fish_plugins + echo "fisher: not enough arguments for command: \"$cmd\"" >&2 && return 1 + end + set arg_plugins (string trim <$fish_plugins) + end + + for plugin in $arg_plugins + test -e "$plugin" && set plugin (realpath $plugin) + contains -- "$plugin" $new_plugins || set -a new_plugins $plugin + end + + if set -q argv[2] + for plugin in $new_plugins + if contains -- "$plugin" $old_plugins + if test "$cmd" = remove + set -a remove_plugins $plugin + else + set -a update_plugins $plugin + end + else if test "$cmd" != install + echo "fisher: plugin not installed: \"$plugin\"" >&2 && return 1 + else + set -a install_plugins $plugin + end + end + else + for plugin in $new_plugins + if contains -- "$plugin" $old_plugins + set -a update_plugins $plugin + else + set -a install_plugins $plugin + end + end + + for plugin in $old_plugins + if not contains -- "$plugin" $new_plugins + set -a remove_plugins $plugin + end + end + end + + set -l pid_list + set -l source_plugins + set -l fetch_plugins $update_plugins $install_plugins + echo -e "\x1b[1mfisher $cmd version $fisher_version\x1b[22m" + + for plugin in $fetch_plugins + set -l source (command mktemp -d) + set -a source_plugins $source + + command mkdir -p $source/{completions,conf.d,functions} + + fish -c " + if test -e $plugin + command cp -Rf $plugin/* $source + else + set temp (command mktemp -d) + set name (string split \@ $plugin) || set name[2] HEAD + set url https://codeload.github.com/\$name[1]/tar.gz/\$name[2] + set -q fisher_user_api_token && set opts -u $fisher_user_api_token + + echo -e \"fetching \x1b[4m\$url\x1b[24m\" + if command curl $opts -Ss -w \"\" \$url 2>&1 | command tar -xzf- -C \$temp 2>/dev/null + command cp -Rf \$temp/*/* $source + else + echo fisher: invalid plugin name or host unavailable: \\\"$plugin\\\" >&2 + command rm -rf $source + end + command rm -rf \$temp + end + + test ! -e $source && exit + command mv -f (string match --entire --regex -- \.fish\\\$ $source/*) $source/functions 2>/dev/null" & + + set -a pid_list (jobs --last --pid) + end + + wait $pid_list 2>/dev/null + + for plugin in $fetch_plugins + if set -l source $source_plugins[(contains --index -- "$plugin" $fetch_plugins)] && test ! -e $source + if set -l index (contains --index -- "$plugin" $install_plugins) + set -e install_plugins[$index] + else + set -e update_plugins[(contains --index -- "$plugin" $update_plugins)] + end + end + end + + for plugin in $update_plugins $remove_plugins + if set -l index (contains --index -- "$plugin" $_fisher_plugins) + set -l plugin_files_var _fisher_(string escape --style=var $plugin)_files + + if contains -- "$plugin" $remove_plugins && set --erase _fisher_plugins[$index] + for file in (string match --entire --regex -- "conf\.d/" $$plugin_files_var) + emit (string replace --all --regex -- '^.*/|\.fish$' "" $file)_uninstall + end + echo -es "removing \x1b[1m$plugin\x1b[22m" \n" "$$plugin_files_var + end + + command rm -rf $$plugin_files_var + functions --erase (string match --entire --regex -- "functions/" $$plugin_files_var \ + | string replace --all --regex -- '^.*/|\.fish$' "") + set --erase $plugin_files_var + end + end + + if set -q update_plugins[1] || set -q install_plugins[1] + command mkdir -p $fisher_path/{functions,conf.d,completions} + end + + for plugin in $update_plugins $install_plugins + set -l source $source_plugins[(contains --index -- "$plugin" $fetch_plugins)] + set -l files $source/{functions,conf.d,completions}/* + set -l plugin_files_var _fisher_(string escape --style=var $plugin)_files + set -q files[1] && set -U $plugin_files_var (string replace $source $fisher_path $files) + + for file in (string replace -- $source "" $files) + command cp -Rf $source/$file $fisher_path/$file + end + + contains -- $plugin $_fisher_plugins || set -Ua _fisher_plugins $plugin + contains -- $plugin $install_plugins && set -l event "install" || set -l event "update" + echo -es "installing \x1b[1m$plugin\x1b[22m" \n" "$$plugin_files_var + + for file in (string match --entire --regex -- "[functions/|conf\.d/].*fish\$" $$plugin_files_var) + source $file + if string match --quiet --regex -- "conf\.d/" $file + emit (string replace --all --regex -- '^.*/|\.fish$' "" $file)_$event + end + end + end + + command rm -rf $source_plugins + functions -q fish_prompt || source $__fish_data_dir/functions/fish_prompt.fish + + set -q _fisher_plugins[1] || set -e _fisher_plugins + set -q _fisher_plugins && printf "%s\n" $_fisher_plugins >$fish_plugins || command rm -f $fish_plugins + + set -l total (count $install_plugins) (count $update_plugins) (count $remove_plugins) + test "$total" != "0 0 0" && echo (string join ", " ( + test $total[1] = 0 || echo "installed $total[1]") ( + test $total[2] = 0 || echo "updated $total[2]") ( + test $total[3] = 0 || echo "removed $total[3]") + ) "plugin/s" + case \* + echo "fisher: unknown flag or command: \"$cmd\" (see `fisher -h`)" >&2 && return 1 + end +end + +## Migrations ## +if functions -q _fisher_self_update || test -e $__fish_config_dir/fishfile # 3.x + function _fisher_migrate + function _fisher_complete + fisher install jorgebucaran/fisher >/dev/null 2>/dev/null + functions --erase _fisher_complete + end + set -q XDG_DATA_HOME || set XDG_DATA_HOME ~/.local/share + set -q XDG_CACHE_HOME || set XDG_CACHE_HOME ~/.cache + set -q XDG_CONFIG_HOME || set XDG_CONFIG_HOME ~/.config + set -q fisher_path || set fisher_path $__fish_config_dir + test -e $__fish_config_dir/fishfile && command awk '/#|^gitlab|^ *$/ { next } $0' <$__fish_config_dir/fishfile >>$__fish_config_dir/fish_plugins + command rm -rf $__fish_config_dir/fishfile $fisher_path/{conf.d,completions}/fisher.fish {$XDG_DATA_HOME,$XDG_CACHE_HOME,$XDG_CONFIG_HOME}/fisher + functions --erase _fisher_migrate _fisher_copy_user_key_bindings _fisher_ls _fisher_fmt _fisher_self_update _fisher_self_uninstall _fisher_commit _fisher_parse _fisher_fetch _fisher_add _fisher_rm _fisher_jobs _fisher_now _fisher_help + fisher update + end + echo "upgrading to fisher $fisher_version -- learn more at" (set_color --bold --underline)"https://git.io/fisher-4"(set_color normal) + _fisher_migrate >/dev/null 2>/dev/null +else if functions -q _fisher_list # 4.0 + set -q XDG_DATA_HOME || set -l XDG_DATA_HOME ~/.local/share + test -e $XDG_DATA_HOME/fisher && command rm -rf $XDG_DATA_HOME/fisher + functions --erase _fisher_list _fisher_plugin_parse + echo -n "upgrading to fisher $fisher_version new in-memory state.." + fisher update >/dev/null 2>/dev/null + echo -ne "done\r\n" +end \ No newline at end of file diff --git a/home/.config/fish/functions/fzf-bcd-widget.fish b/home/.config/fish/functions/fzf-bcd-widget.fish new file mode 100644 index 0000000..6d3b3af --- /dev/null +++ b/home/.config/fish/functions/fzf-bcd-widget.fish @@ -0,0 +1,5 @@ +function fzf-bcd-widget -d 'cd backwards' + pwd | awk -v RS=/ '/\n/ {exit} {p=p $0 "/"; print p}' | tac | eval (__fzfcmd) +m --select-1 --exit-0 $FZF_BCD_OPTS | read -l result + [ "$result" ]; and cd $result + commandline -f repaint +end diff --git a/home/.config/fish/functions/fzf-select.fish b/home/.config/fish/functions/fzf-select.fish new file mode 100644 index 0000000..6d68a3d --- /dev/null +++ b/home/.config/fish/functions/fzf-select.fish @@ -0,0 +1,7 @@ +function fzf-select -d 'fzf commandline job and print unescaped selection back to commandline' + set -l cmd (commandline -j) + [ "$cmd" ]; or return + eval $cmd | eval (__fzfcmd) -m --tiebreak=index --select-1 --exit-0 | string join ' ' | read -l result + [ "$result" ]; and commandline -j -- $result + commandline -f repaint +end diff --git a/home/.config/fish/functions/fztmux.fish b/home/.config/fish/functions/fztmux.fish new file mode 100644 index 0000000..681c4a6 --- /dev/null +++ b/home/.config/fish/functions/fztmux.fish @@ -0,0 +1,3 @@ +function fztmux -d "Switch tmux session" + tmux list-sessions -F "#{session_name}" | fzf | read -l result; and tmux switch-client -t "$result" +end diff --git a/home/.config/fish/functions/man.fish b/home/.config/fish/functions/man.fish new file mode 100644 index 0000000..08904f1 --- /dev/null +++ b/home/.config/fish/functions/man.fish @@ -0,0 +1,10 @@ +function man -d "man with colors" + set -x LESS_TERMCAP_mb (printf "\e[01;31m") # begin blink + set -x LESS_TERMCAP_md (printf "\e[01;36m") # begin bold + set -x LESS_TERMCAP_me (printf "\e[0m") # reset bold/blink + set -x LESS_TERMCAP_se (printf "\e[0m") # reset reverse video + set -x LESS_TERMCAP_so (printf "\e[01;44;33m") # begin reverse video + set -x LESS_TERMCAP_ue (printf "\e[0m") # reset underline + set -x LESS_TERMCAP_us (printf "\e[01;32m") # begin underline + command man $argv +end diff --git a/home/.config/fish/functions/n.fish b/home/.config/fish/functions/n.fish new file mode 100644 index 0000000..47cda35 --- /dev/null +++ b/home/.config/fish/functions/n.fish @@ -0,0 +1,36 @@ +# Rename this file to match the name of the function +# e.g. ~/.config/fish/functions/n.fish +# or, add the lines to the 'config.fish' file. + +function n --wraps nnn --description 'support nnn quit and change directory' + # Block nesting of nnn in subshells + if test -n "$NNNLVL" + if [ (expr $NNNLVL + 0) -ge 1 ] + echo "nnn is already running" + return + end + end + + # The default behaviour is to cd on quit (nnn checks if NNN_TMPFILE is set) + # To cd on quit only on ^G, remove the "-x" as in: + # set NNN_TMPFILE "$XDG_CONFIG_HOME/nnn/.lastd" + # NOTE: NNN_TMPFILE is fixed, should not be modified + if test -n "$XDG_CONFIG_HOME" + set -x NNN_TMPFILE "$XDG_CONFIG_HOME/nnn/.lastd" + else + set -x NNN_TMPFILE "$HOME/.config/nnn/.lastd" + end + + # Unmask ^Q (, ^V etc.) (if required, see `stty -a`) to Quit nnn + # stty start undef + # stty stop undef + # stty lwrap undef + # stty lnext undef + + nnn $argv + + if test -e $NNN_TMPFILE + source $NNN_TMPFILE + rm $NNN_TMPFILE + end +end diff --git a/home/.config/fish/functions/n2.fish b/home/.config/fish/functions/n2.fish new file mode 100644 index 0000000..d652d11 --- /dev/null +++ b/home/.config/fish/functions/n2.fish @@ -0,0 +1,5 @@ +function n2 -d "Start nnn in dual pane (tmux)" + tmux new-session -d -s nnn -n nnn "nnn -Hc" + tmux split-window -h "nnn -Hc" + TERM=screen-256color command tmux attach -t nnn:nnn +end diff --git a/home/.config/fish/functions/pathclean.fish b/home/.config/fish/functions/pathclean.fish new file mode 100644 index 0000000..e9c9136 --- /dev/null +++ b/home/.config/fish/functions/pathclean.fish @@ -0,0 +1,3 @@ +function pathclean --description "Clean up PATH variable" + set PATH (printf "%s" "$PATH" | awk -v RS=':' '!a[$1]++ { if (NR > 1) printf RS; printf $1 }') +end diff --git a/home/.config/fish/functions/tt.fish b/home/.config/fish/functions/tt.fish new file mode 100644 index 0000000..1e5a010 --- /dev/null +++ b/home/.config/fish/functions/tt.fish @@ -0,0 +1,6 @@ +function tt -d "typing speed testing" + iconv -f UTF-8 -t ASCII "$argv" | sed 's/--/-/g' \ + | sed '/^$/d' | sed 's/^[ \t]*//' | sed 's/\(^.\{1,80\}\).*/\1/' \ + > /tmp/tt.txt + command tt /tmp/tt.txt +end diff --git a/home/.config/flashfocus/flashfocus.yml b/home/.config/flashfocus/flashfocus.yml new file mode 100644 index 0000000..cf9e1f8 --- /dev/null +++ b/home/.config/flashfocus/flashfocus.yml @@ -0,0 +1,77 @@ +## @@@@@@@@@@@@@@@@@@@@@@ +## Flashfocus config file +## @@@@@@@@@@@@@@@@@@@@@@ + +# Opacity of window during flash. +flash-opacity: 0.65 + +# Windows are restored to this opacity value at the end of a flash. +default-opacity: 0.95 + +# Length of flash in milliseconds. +time: 500 + +# If true, flashes are not faded out. This will improve performance but flashes +# won't be smooth. +simple: false + +# Number of animation frames in a flash. +ntimepoints: 10 + +# Set this to false if you don't want windows to flash on focus. +flash-on-focus: true + +# Set this to false if you don't want fullscreen windows to flash. +flash-fullscreen: true + +# Whether or not to flash windows if they are the only window on the desktop. +# Possible values: +# 'always': +# Always flash lone windows +# 'never': +# Never flash lone windows +# 'on_open_close': +# Lone windows will be flashed only if a) if they were just opened and b) +# if another window was just closed. +# 'on_switch': +# Lone windows will be flashed only upon switching desktops. +flash-lone-windows: 'always' + +# Defining window-specific flash rules +# +# X11-based window managers (e.g i3, bspwm) +# ----------------------------------------- +# Flash rules are defined by matching the WM_CLASS property of a window. To get +# the WM_CLASS property use 'xprop WM_CLASS' and click on a window. The +# property is a tuple of the form (window-id, window-class). The window-class +# is usually the name of the application, but not always. +# +# +# Say I'd like to set all 'termite' windows to 80% opacity but leave other +# windows at full opacity: +# +#rules: + #- window-class: Polybar + # flash-on-focus: false + #- window-id: rofi + # default-opacity: 0.9 + # flash-on-focus: false + +# Sway +# ---- +# Native wayland apps can be matched using the app_id and window name. These +# can be found using `swaymsg -t get_tree`. XWayland apps are matched with +# using WM_CLASS as above (this can also be found with `swaymsg`) +# +# Given that termite is wayland native and firefox is not, the rules above +# could instead be written: +# +# rules: +# - window-class: firefox +# flash-on-focus: False +# - app-id: termite +# default-opacity: 0.8 +# +# rules: +# - window-name: ^(?!termite)$ +# default-opacity: 0.8 diff --git a/home/.config/foot/foot.ini b/home/.config/foot/foot.ini new file mode 100644 index 0000000..4f16cbd --- /dev/null +++ b/home/.config/foot/foot.ini @@ -0,0 +1,138 @@ +# -*- conf -*- + +font=Iosevka Nerd Font:style=Regular:size=12, Sarasa Fixed J:style=Regular:size=12 +font-bold=Iosevka Nerd Font:style=Bold:size=12, Sarasa Fixed J:style=Bold:size=12 +font-italic=Iosevka Nerd Font:style=Italic:size=12, Sarasa Fixed J:style=Italic:size=12 +font-bold-italic=Iosevka Nerd Font:style=Bold Italic:size=12, Sarasa Fixed J:style=Bold Italic:size=12 +dpi-aware=no +initial-window-size-pixels=800x600 # Or, +# initial-window-size-chars= +# initial-window-mode=windowed +# pad=2x2 +# shell=$SHELL (if set, otherwise user's default shell from /etc/passwd) +# term=foot +# login-shell=no +# workers= +# bold-text-in-bright=no +# bell=none +# word-delimiters=,│`|:"'()[]{}<> +# notify=notify-send -a foot -i foot ${title} ${body} + +[scrollback] +lines=10000 +# multiplier=3.0 +# indicator-position=relative +# indicator-format= + +[cursor] +# style=block +color=2e3440 d8dee9 +# color=282c34 bbc2cf +# blink=no + +[mouse] +hide-when-typing=yes +# alternate-scroll-mode=yes + +[colors] +alpha=1.0 +# selection-foreground= +# selection-background= +# --- Nord --- # +foreground=d8dee9 +background=2e3440 +regular0=3b4252 # black +regular1=bf616a # red +regular2=a3be8c # green +regular3=ebcb8b # yellow +regular4=81a1c1 # blue +regular5=b48ead # magenta +regular6=88c0d0 # cyan +regular7=e5e9f0 # white +bright0=4c566a # bright black +bright1=bf616a # bright red +bright2=a3be8c # bright green +bright3=ebcb8b # bright yellow +bright4=81a1c1 # bright blue +bright5=b48ead # bright magenta +bright6=8fbcbb # bright cyan +bright7=eceff4 # bright white +# -- OneDark -- # +# foreground=abb2bf +# background=282c34 +# regular0=282c34 # black +# regular1=be5046 # red +# regular2=98c379 # green +# regular3=d19a66 # yellow +# regular4=61afef # blue +# regular5=c678dd # magenta +# regular6=56b6c2 # cyan +# regular7=abb2bf # white +# bright0=3e4452 # bright black +# bright1=e06c75 # bright red +# bright2=98c379 # bright green +# bright3=e5c07b # bright yellow +# bright4=61afef # bright blue +# bright5=c678dd # bright magenta +# bright6=56b6c2 # bright cyan +# bright7=bbc2cf # bright white + +[csd] +# preferred=server +# size=26 +# color= +# button-width=26 +# button-minimize-color=ff0000ff +# button-maximize-color=ff00ff00 +# button-close-color=ffff0000 + +[key-bindings] +# scrollback-up-page=Shift+Page_Up +# scrollback-up-half-page=none +# scrollback-up-line=none +# scrollback-down-page=Shift+Page_Down +# scrollback-down-half-page=none +# scrollback-down-line=none +# clipboard-copy=Control+Shift+C +# clipboard-paste=Control+Shift+V +# primary-paste=Shift+Insert +# search-start=Control+Shift+R +# font-increase=Control+plus Control+equal Control+KP_Add +# font-decrease=Control+minus Control+KP_Subtract +# font-reset=Control+0 Control+KP_0 +# spawn-terminal=Control+Shift+N +# minimize=none +# maximize=none +fullscreen=F11 +pipe-visible=[sh -c "xurls | wofi -d -i | xargs -r firefox"] none +pipe-scrollback=[sh -c "xurls | wofi -d -i | xargs -r firefox"] none +# pipe-selected=[xargs -r firefox] none + +[search-bindings] +# cancel=Control+g Escape +# commit=Return +# find-prev=Control+r +# find-next=Control+s +cursor-left=Left Shift+H +cursor-left-word=Control+Left Control+Shift+H +cursor-right=Right Shift+L +cursor-right-word=Control+Right Control+Shift+L +# cursor-home=Home Control+a +# cursor-end=End Control+e +# delete-prev=BackSpace +delete-prev-word=Control+BackSpace +# delete-next=Delete +delete-next-word=Control+Delete +# extend-to-word-boundary=Control+w +# extend-to-next-whitespace=Control+Shift+W +# clipboard-paste=Control+v Control+y +# primary-paste=Shift+Insert + +[mouse-bindings] +# primary-paste=BTN_MIDDLE +# select-begin=BTN_LEFT +# select-begin-block=Control+BTN_LEFT +# select-extend=BTN_RIGHT +# select-word=BTN_LEFT-2 +# select-word-whitespace=Control+BTN_LEFT-2 +# select-row=BTN_LEFT-3 diff --git a/home/.config/gallery-dl/config.json b/home/.config/gallery-dl/config.json new file mode 100644 index 0000000..00acf63 --- /dev/null +++ b/home/.config/gallery-dl/config.json @@ -0,0 +1,213 @@ +{ + "extractor": { + "archive": "~/.local/share/gallery-dl/archive.sqlite3", + "base-directory": "~/gallery-dl/", + "chapter-filter": "lang == 'en'", + "chapter-unique": true, + "cookies": null, + "date-format": "%Y-%m-%dT%H:%M:%S", + "image-unique": true, + "path-remove": "\u0000-\u001f\u007f", + "path-replace": "_", + "path-restrict": "unix", + "retries": 4, + "skip": true, + "user-agent": "Mozilla/5.0 (Windows NT 10.0; rv:78.0) Gecko/20100101 Firefox/78.0", + "pixiv": { + "filename": "{id}{num}.{extension}", + "directory": [ + "Pixiv", + "{user[username]}" + ], + "avatar": false, + "ugoira": true, + "username": "", + "password": "" + }, + "danbooru": { + "ugoira": false + }, + "artstation": { + "directory": [ + "ArtStation", + "{user[username]}" + ], + "external": false + }, + "deviantart": { + "directory": [ + "DeviantArt", + "{user[id]}" + ], + "flat": true, + "extra": false, + "include": "gallery,scraps,favorite", + "metadata": false, + "mature": true, + "journals": "text", + "original": true, + "quality": 100 + }, + "mangadex": { + "directory": [ + "Manga", + "{manga}", + "c{chapter} - {title}" + ], + "postprocessors": [ + { + "name": "zip", + "compression": "store", + "extension": "cbz", + "keep-files": false + } + ] + }, + "mangafox": { + "directory": [ + "Manga", + "{manga}", + "c{chapter} - {title}" + ], + "postprocessors": [ + { + "name": "zip", + "compression": "store", + "extension": "cbz", + "keep-files": false + } + ] + }, + "mangakakalot": { + "directory": [ + "Manga", + "{manga}", + "c{chapter} - {title}" + ], + "postprocessors": [ + { + "name": "zip", + "compression": "store", + "extension": "cbz", + "keep-files": false + } + ] + }, + "mangahere": { + "directory": [ + "Manga", + "{manga}", + "c{chapter} - {title}" + ], + "postprocessors": [ + { + "name": "zip", + "compression": "store", + "extension": "cbz", + "keep-files": false + } + ] + }, + "mangapark": { + "directory": [ + "Manga", + "{manga}", + "c{chapter} - {title}" + ], + "postprocessors": [ + { + "name": "zip", + "compression": "store", + "extension": "cbz", + "keep-files": false + } + ] + }, + "mangareader": { + "directory": [ + "Manga", + "{manga}", + "c{chapter} - {title}" + ], + "postprocessors": [ + { + "name": "zip", + "compression": "store", + "extension": "cbz", + "keep-files": false + } + ] + }, + "mangastream": { + "directory": [ + "Manga", + "{manga}", + "c{chapter} - {title}" + ], + "postprocessors": [ + { + "name": "zip", + "compression": "store", + "extension": "cbz", + "keep-files": false + } + ] + }, + "reddit": { + "comments": 0, + "morecomments": false, + "recursion": 0, + "videos": "ytdl" + }, + "twitter": { + "quoted": false, + "replies": false, + "retweets": false, + "twitpic": false, + "videos": "ytdl" + } + }, + "downloader": { + "mtime": true, + "part": true, + "part-directory": "/tmp/gallery-dl/.download/", + "retries": 4, + "timeout": 8.0, + "verify": true, + "ytdl": { + "format": "bestvideo+bestaudio/best", + "forward-cookies": false + }, + "http": { + "adjust-extensions": true + } + }, + "output": { + "mode": "color", + "progress": true, + "logfile": { + "path": "~/.local/share/gallery-dl/log.txt", + "mode": "w", + "level": "debug" + }, + "log": { + "level": "info", + "format": { + "debug": "\u001b[0;37m{name}: {message}\u001b[0m", + "info": "\u001b[1;37m{name}: {message}\u001b[0m", + "warning": "\u001b[1;33m{name}: {message}\u001b[0m", + "error": "\u001b[1;31m{name}: {message}\u001b[0m" + } + }, + "unsupportedfile": { + "path": "~/.local/share/gallery-dl/unsupported.txt", + "mode": "a", + "format": "{asctime} {message}", + "format-date": "%Y-%m-%d-%H-%M-%S" + } + }, + "cache": { + "file": "~/.cache/gallery-dl/cache.sqlite3" + }, + "netrc": false +} diff --git a/home/.config/git/config b/home/.config/git/config new file mode 100644 index 0000000..510a578 --- /dev/null +++ b/home/.config/git/config @@ -0,0 +1,56 @@ +[http] + sslverify = true +[gpg] + program = gpg2 +[commit] + gpgsign = true +[user] + name = FollieHiyuki + email = folliekazetani@protonmail.com + signingkey = 813CF484F4993419 +[core] + editor = nvim + pager = delta + whitespace = trailing-space +[delta] + features = side-by-side line-numbers decorations + zero-style = dim syntax + minus-style = red bold "#340001" + plus-style = green bold "#012800" + syntax-theme = base16 +[delta "line-numbers"] + line-numbers-left-format = "{nm:>4}┊" + line-numbers-right-format = "{np:>4}│" + line-numbers-left-style = blue + line-numbers-right-style = blue + line-numbers-minus-style = 1 + line-numbers-plus-style = 2 + line-numbers-zero-style = 7 +[delta "decorations"] + commit-decoration-style = bold yellow box ul + file-style = bold yellow ul + file-decoration-style = none + hunk-header-decoration-style = yellow box +[interactive] + diffFilter = delta --color-only +[filter "lfs"] + clean = git-lfs clean -- %f + smudge = git-lfs smudge -- %f + process = git-lfs filter-process + required = true +[rebase] + autosquash = true +[push] + followTags = true +[help] + autocorrect = 1 +[url "https://github.com/"] + insteadOf = gh: +[url "https://gitlab.com/"] + insteadOf = gl: +[url "https://git.disroot.org/"] + insteadOf = dr: +[url "https://gist.github.com/"] + insteadOf = gist: +[url "https://bitbucket.org/"] + insteadOf = bb: diff --git a/home/.config/greenclip.cfg b/home/.config/greenclip.cfg new file mode 100644 index 0000000..6ecbdbd --- /dev/null +++ b/home/.config/greenclip.cfg @@ -0,0 +1,9 @@ +Config { + maxHistoryLength = 1000, + historyPath = "~/.cache/greenclip/history", + staticHistoryPath = "~/.cache/greenclip/staticHistory", + imageCachePath = "/tmp/greenclip/", + usePrimarySelectionAsInput = False, + blacklistedApps = [], + trimSpaceFromSelection = True +} diff --git a/home/.config/gtk-3.0/settings.ini b/home/.config/gtk-3.0/settings.ini new file mode 100644 index 0000000..85f66a1 --- /dev/null +++ b/home/.config/gtk-3.0/settings.ini @@ -0,0 +1,9 @@ +[Settings] +gtk-theme-name=Arc-Dark +gtk-icon-theme-name=Papirus-Dark +gtk-application-prefer-dark-theme=true +gtk-cursor-theme-name=Breeze_Snow +gtk-cursor-theme-size=0 +gtk-enable-event-sounds=1 +gtk-enable-input-feedback-sounds=1 +gtk-decoration-layout=menu: diff --git a/home/.config/hikari/autostart b/home/.config/hikari/autostart new file mode 100755 index 0000000..dad0769 --- /dev/null +++ b/home/.config/hikari/autostart @@ -0,0 +1,16 @@ +#!/bin/sh + +# Theme +gsettings set org.gnome.desktop.interface gtk-theme 'Arc-Dark' & +gsettings set org.gnome.desktop.interface icon-theme 'Papirus-Dark' & +gsettings set org.gnome.desktop.interface cursor-theme 'Breeze_Snow' +gsettings set org.gnome.desktop.interface cursor-size '24' + +# Autostart +pipewire & +mpd & +mako -c ~/.config/mako/config & +wl-paste -t text --watch clipman store & +waybar -c ~/.config/waybar/config-generic -s ~/.config/waybar/style-generic.css & +mpDris2 & +# emacs --daemon & diff --git a/home/.config/hikari/hikari.conf b/home/.config/hikari/hikari.conf new file mode 100644 index 0000000..7333ec6 --- /dev/null +++ b/home/.config/hikari/hikari.conf @@ -0,0 +1,310 @@ +ui { + border = 2 + gap = 5 + step = 50 + font = "Sarasa Fixed J 13" + + colorscheme { + background = 0x2E3440 + foreground = 0x2E3440 + selected = 0xEBCB8B + grouped = 0xD08770 + first = 0xA3BE8C + conflict = 0xBF616A + insert = 0xB48EAD + active = 0xECEFF4 + inactive = 0x81A1C1 + } +} + +outputs { + "DP-2" { + position = { + x = -1920 + y = 0 + } + background = { + path = "/home/follie/Pictures/Wallpapers/9697jd.png" + fit = stretch + } + } + + "eDP-1" { + position = { + x = 0 + y = 0 + } + background = { + path = "/home/follie/Pictures/Wallpapers/Elan3.png" + fit = stretch + } + } + + "HDMI-A-1" { + position = { + x = 1920 + y = 0 + } + background = { + path = "/home/follie/Pictures/Wallpapers/i159.png" + fit = stretch + } + } +} + +inputs { + keyboards { + "*" = { + xkb = { + layout = "us,jp" + options = "grp:alt_shift_toggle" + } + repeat-rate = 25 + repeat-delay = 600 + } + } + + pointers { + "*" = { + tap = true + tap-drag = true + tap-drag-lock = true + disable-while-typing = true + } + } + + switches { + "Control Method Lid Switch" = lock + } +} + +layouts { + # main stack + s = { + scale = 0.55 + left = single + right = stack + } + + # main queue + q = { + scale = 0.55 + top = single + bottom = queue + } + + # nautilus + n = { + left = single + right = { + top = single + bottom = { + right = single + left = { + bottom = single + top = full + } + } + } + } + + f = full + h = stack + v = queue + g = grid +} + +actions { + # generals + terminal = alacritty + foot = foot + wofi = wofi --show=drun + run = wofi --show=run + searchmenu = searchmenu --wofi + bukumenu = bukumenu --wofi + manga = mangamenu --wofi + clipboard = clipboard --wofi + clearclip = clipboard --clear + clearclipwofi = clipman clear --tool wofi + emacs = emacsclient -c -a emacs + + # media + volumeup = volumecontrol increase && pkill -x -RTMIN+11 waybar + volumedown = volumecontrol decrease && pkill -x -RTMIN+11 waybar + mute = volumecontrol toggle && pkill -x -RTMIN+11 waybar + playpause = playerctl play-pause + nextsong = playerctl next + prevsong = playerctl previous + + # backlight + lightup = brightness up + lightdown = brightness down + + # screenshot + screenfull = screenshot --full + screenregion = screenshot --region + screencopy = screenshot --region-copy + screencopyfull = screenshot --full-copy +} + +bindings { + keyboard { + "L+0" = workspace-switch-to-sheet-0 + "L+1" = workspace-switch-to-sheet-1 + "L+2" = workspace-switch-to-sheet-2 + "L+3" = workspace-switch-to-sheet-3 + "L+4" = workspace-switch-to-sheet-4 + "L+5" = workspace-switch-to-sheet-5 + "L+6" = workspace-switch-to-sheet-6 + "L+7" = workspace-switch-to-sheet-7 + "L+8" = workspace-switch-to-sheet-8 + "L+9" = workspace-switch-to-sheet-9 + "L+numbersign" = workspace-switch-to-sheet-alternate + "L+Period" = workspace-switch-to-sheet-current + "L+j" = workspace-switch-to-sheet-next + "L+k" = workspace-switch-to-sheet-prev + "L+Comma" = workspace-switch-to-sheet-next-inhabited + "LS+Comma" = workspace-switch-to-sheet-prev-inhabited + "LSC+g" = workspace-show-group + "LSC+i" = workspace-show-invisible + "LSC+Period" = workspace-show-all + "LC+n" = workspace-cycle-next + "LC+p" = workspace-cycle-prev + + "LC+i" = sheet-show-invisible + "LC+Period" = sheet-show-all + "LC+g" = sheet-show-group + + "LA+r" = layout-reset + "LA+Return" = layout-restack-append + "LAS+Return" = layout-restack-prepend + "L+Home" = layout-cycle-view-first + "L+End" = layout-cycle-view-last + "L+n" = layout-cycle-view-next + "L+p" = layout-cycle-view-prev + "L+x" = layout-exchange-view-next + "LS+x" = layout-exchange-view-prev + "LA+x" = layout-exchange-view-main + + "LS+0" = view-pin-to-sheet-0 + "LS+1" = view-pin-to-sheet-1 + "LS+2" = view-pin-to-sheet-2 + "LS+3" = view-pin-to-sheet-3 + "LS+4" = view-pin-to-sheet-4 + "LS+5" = view-pin-to-sheet-5 + "LS+6" = view-pin-to-sheet-6 + "LS+7" = view-pin-to-sheet-7 + "LS+8" = view-pin-to-sheet-8 + "LS+9" = view-pin-to-sheet-9 + "LS+numbersign" = view-pin-to-sheet-alternate + "LS+Period" = view-pin-to-sheet-current + "LS+j" = view-pin-to-sheet-next + "LS+k" = view-pin-to-sheet-prev + + "L+u" = view-raise + "L+d" = view-lower + "L+o" = view-only + "L+h" = view-hide + "L+q" = view-quit + "LS+n" = view-cycle-next + "LS+p" = view-cycle-prev + + "L+Up" = view-move-up + "L+Down" = view-move-down + "L+Left" = view-move-left + "L+Right" = view-move-right + "LA+Up" = view-decrease-size-up + "LAS+Up" = view-increase-size-up + "LA+Down" = view-increase-size-down + "LAS+Down" = view-decrease-size-down + "LA+Left" = view-decrease-size-left + "LAS+Left" = view-increase-size-left + "LA+Right" = view-increase-size-right + "LAS+Right" = view-decrease-size-right + "LS+Up" = view-snap-up + "LS+Down" = view-snap-down + "LS+Left" = view-snap-left + "LS+Right" = view-snap-right + "L+r" = view-reset-geometry + + "L+minus" = view-toggle-maximize-vertical + "L+less" = view-toggle-maximize-horizontal + "L+f" = view-toggle-maximize-full + "L5+plus" = view-toggle-floating + "L+i" = view-toggle-invisible + "L5+p" = view-toggle-public + + "LS+o" = group-only + "LS+h" = group-hide + "LS+u" = group-raise + "LS+d" = group-lower + "L+Tab" = group-cycle-prev + "LS+Tab" = group-cycle-next + "L+asciicircum" = group-cycle-view-prev + "LS+asciicircum" = group-cycle-view-next + "LS+Home" = group-cycle-view-first + "LS+End" = group-cycle-view-last + + "L+l" = mode-enter-layout + "L+s" = mode-enter-sheet-assign + "L+g" = mode-enter-group-assign + "L+m" = mode-enter-mark-assign + "L+acute" = mode-enter-mark-select + "LS+acute" = mode-enter-mark-switch-select + "LCA+g" = mode-enter-input-grab + + "LS+Backspace" = lock + "LCA+q" = quit + "LCA+r" = reload + + "L+Return" = action-terminal + "LS+Return" = action-foot + "L+w" = action-wofi + "LC+w" = action-run + "LA+e" = action-emacs + "LA+w" = action-clipboard + "LA+s" = action-searchmenu + "LC+s" = action-bukumenu + "LA+m" = action-manga + "LA+c" = action-clearclip + "LC+c" = action-clearclipwofi + + "0+XF86AudioRaiseVolume" = action-volumeup + "0+XF86AudioLowerVolume" = action-volumedown + "0+XF86AudioMute" = action-mute + "0+XF86AudioPlay" = action-playpause + "0+XF86AudioNext" = action-nextsong + "0+XF86AudioPrev" = action-prevsong + + "0+XF86MonBrightnessDown" = action-lightdown + "0+XF86MonBrightnessUp" = action-lightup + + "0+Print" = action-screenregion + "L+Print" = action-screenfull + "C+Print" = action-screencopy + "A+Print" = action-screencopyfull + + "A+F1" = vt-switch-to-1 + "A+F2" = vt-switch-to-2 + "A+F3" = vt-switch-to-3 + "A+F4" = vt-switch-to-4 + "A+F5" = vt-switch-to-5 + "A+F6" = vt-switch-to-6 + "A+F7" = vt-switch-to-7 + "A+F8" = vt-switch-to-8 + "A+F9" = vt-switch-to-9 + + "CA+s" = layout-apply-s + "CA+q" = layout-apply-q + "CA+n" = layout-apply-n + "CA+f" = layout-apply-f + "CA+h" = layout-apply-h + "CA+v" = layout-apply-v + "CA+g" = layout-apply-g + } + + mouse { + "L+left" = mode-enter-move + "L+right" = mode-enter-resize + } +} diff --git a/home/.config/imv/config b/home/.config/imv/config new file mode 100644 index 0000000..b1e1ed5 --- /dev/null +++ b/home/.config/imv/config @@ -0,0 +1,77 @@ +# Default config for imv + +[options] + +# Suppress built-in key bindings, and specify them explicitly in this +# config file. +suppress_default_binds = true + +# Theme +background = 2e3440 +overlay_text_color = eceff4 +overlay_background_color = 2e3440 +# background = 282c34 +# overlay_text_color = bbc2cf +# overlay_background_color = 282c34 +overlay_background_alpha = c3 + +# Custom settings +initial_pan = 0 0 +scaling_mode = full +overlay = true +overlay_font = Sarasa Fixed J:20 +overlay_text = [$imv_current_index/$imv_file_count] $imv_current_file [${imv_width}x${imv_height}] [$imv_scaling_mode - $imv_scale%] + +[aliases] +# Define aliases here. Any arguments passed to an alias are appended to the +# command. +# alias = command to run + +[binds] +# Define some key bindings +q = quit +y = exec echo working! + +# Image navigation + = prev + = prev + = next + = next +gg = goto 1 + = goto -1 + +# Panning +j = pan 0 -50 +k = pan 0 50 +h = pan 50 0 +l = pan -50 0 + +# Zooming + = zoom 1 + = zoom 1 +i = zoom 1 + = zoom -1 + = zoom -1 +o = zoom -1 + +# Rotate Clockwise by 90 degrees + = rotate by 90 + +# Other commands +x = close +f = fullscreen +d = overlay +p = exec echo $imv_current_file +c = center +s = scaling next + = upscaling next +a = zoom actual +r = reset + +# Gif playback + = next_frame + = toggle_playing + +# Slideshow control +t = slideshow +1 + = slideshow -1 diff --git a/home/.config/ion/initrc b/home/.config/ion/initrc new file mode 100644 index 0000000..b18a6c2 --- /dev/null +++ b/home/.config/ion/initrc @@ -0,0 +1,3 @@ +eval $(starship init ion --print-full-init) + +~/.local/bin/bunny diff --git a/home/.config/jesseduffield/lazygit/config.yml b/home/.config/jesseduffield/lazygit/config.yml new file mode 100644 index 0000000..a33e58f --- /dev/null +++ b/home/.config/jesseduffield/lazygit/config.yml @@ -0,0 +1,143 @@ +confirmonquit: true +git: + autofetch: false + merging: + args: "" + manualcommit: true + paging: + colorarg: always + useconfig: true + skiphookprefix: WIP +gui: + commitlength: + show: true + mouseevents: false + scrollheight: 2 + scrollpastbottom: true + sidepanelwidth: 0.3333 + skipstashwarning: true + skipunstagelinewarning: false + theme: + activebordercolor: + - white + - bold + inactivebordercolor: + - blue + lighttheme: false + optionstextcolor: + - yellow + selectedlinebgcolor: + - default + selectedrangebgcolor: + - green +keybinding: + branches: + checkoutbranchbyname: c + createpullrequest: o + fastforward: f + fetchremote: f + forcecheckoutbranch: F + mergeintocurrentbranch: M + pushtag: P + rebasebranch: r + setupstream: u + viewgitflowoptions: i + commitfiles: + checkoutcommitfile: c + commits: + amendtocommit: A + checkoutcommit: + cherrypickcopy: c + cherrypickcopyrange: C + createfixupcommit: F + markcommitasfixup: f + movedowncommit: + moveupcommit: + pastecommits: v + pickcommit: p + renamecommit: r + renamecommitwitheditor: R + resetcherrypick: + revertcommit: t + squashabovecommits: S + squashdown: s + tagcommit: T + viewresetoptions: g + files: + amendlastcommit: A + commitchanges: c + commitchangeswitheditor: C + commitchangeswithouthook: w + fetch: f + ignorefile: i + refreshfiles: r + stashallchanges: s + togglestagedall: a + viewresetoptions: D + viewstashoptions: S + main: + pickbothhunks: b + toggledragselect: v + toggledragselect-alt: V + toggleselecthunk: a + stash: + popstash: g + status: + checkforupdate: u + recentrepos: + universal: + copytoclipboard: + createpatchoptionsmenu: + createrebaseoptionsmenu: m + diffingmenu: + edit: e + executecustomcommand: ':' + filteringmenu: + gointo: + gotobottom: '>' + gototop: < + new: "n" + nextblock: + nextblock-alt: l + nextitem: + nextitem-alt: j + nextmatch: "n" + nextpage: . + nextscreenmode: + + nexttab: ']' + openfile: o + optionmenu: x + optionmenu-alt1: '?' + prevblock: + prevblock-alt: h + previtem: + previtem-alt: k + prevmatch: "N" + prevpage: ',' + prevscreenmode: _ + prevtab: '[' + pullfiles: p + pushfiles: P + quit: q + quit-alt1: + quitwithoutchangingdirectory: Q + redo: + refresh: R + remove: d + return: + scrolldownmain: + scrolldownmain-alt1: J + scrolldownmain-alt2: + scrollupmain: + scrollupmain-alt1: K + scrollupmain-alt2: + select: + togglepanel: + undo: z +reporting: "off" +startuppopupversion: 1 +update: + days: 14 + method: never +os: + openCommand: 'sh -c "xdg-open {{filename}} >/dev/null"' diff --git a/home/.config/kitty/kitty.conf b/home/.config/kitty/kitty.conf new file mode 100644 index 0000000..fc21d36 --- /dev/null +++ b/home/.config/kitty/kitty.conf @@ -0,0 +1,88 @@ +# Font +font_family Iosevka Nerd Font +font_size 13.0 + +# url handler +url_color #ebcb8b +# url_color #e5c07b +url_style curly +open_url_modifiers kitty_mod +open_url_with default +url_prefixes http https file ftp + +# Ring +enable_audio_bell yes +bell_on_tab yes + +allow_remote_control yes + +remember_window_size no +raw_minimal_borders yes +tab_title_template "{index}:{title}" +initial_window_width 640 +initial_window_height 480 + +background_opacity 0.95 +background_image none +dim_opacity 0.65 + +# --- Nord --- # +cursor #d8dee9 +cursor_text_color #2e3440 +foreground #d8dee9 +background #2e3440 +selection_foreground #2e3440 +selection_background #d8dee9 +color0 #3b4252 +color8 #4c566a +color1 #bf616a +color9 #bf616a +color2 #a3be8c +color10 #a3be8c +color3 #ebcb8b +color11 #ebcb8b +color4 #81a1c1 +color12 #81a1c1 +color5 #b48ead +color13 #b48ead +color6 #88c0d0 +color14 #8fbcbb +color7 #e5e9f0 +color15 #eceff4 +# -- OneDark -- # +# cursor #bbc2cf +# cursor_text_color #282c34 +# foreground #abb2bf +# background #282c34 +# selection_foreground #282c34 +# selection_background #abb2bf +# color0 #282c34 +# color8 #3e4452 +# color1 #be5046 +# color9 #e06c75 +# color2 #98c379 +# color10 #98c379 +# color3 #d19a66 +# color11 #e5c07b +# color4 #61afef +# color12 #61afef +# color5 #c678dd +# color13 #c678dd +# color6 #56b6c2 +# color14 #56b6c2 +# color7 #abb2bf +# color15 #bbc2cf + +map shift+up move_window up +map shift+left move_window left +map shift+right move_window right +map shift+down move_window down + +map ctrl+left resize_window narrower +map ctrl+right resize_window wider +map ctrl+up resize_window taller +map ctrl+down resize_window shorter + +map ctrl+f2 detach_window +map ctrl+f3 detach_tab +map ctrl+f4 detach_window new-tab diff --git a/home/.config/lf/lfrc b/home/.config/lf/lfrc new file mode 100644 index 0000000..a5238a7 --- /dev/null +++ b/home/.config/lf/lfrc @@ -0,0 +1,272 @@ +# _______ __________ +# __ __ \_________ /___(_)____________________ +# _ / / /__ __ \ __/_ /_ __ \_ __ \_ ___/ +# / /_/ /__ /_/ / /_ _ / / /_/ / / / /(__ ) +# \____/ _ .___/\__/ /_/ \____//_/ /_//____/ +# /_/ +# Shell +set shell sh +set shellopts '-eu' +set ifs "\n" + +# Interface +set ratios '1:2' +set dircounts +set hidden +set info 'size' +set icons +set preview +set previewer '~/.config/lf/preview 2>/dev/null' + +# General +set globsearch +set incsearch +set ignorecase +set tabstop 4 +# set filesep ' ' + +# _________ _________ +# __ ____/____________ __________ _________ _____________ /_______ +# _ / _ __ \_ __ `__ \_ __ `__ \ __ `/_ __ \ __ /__ ___/ +# / /___ / /_/ / / / / / / / / / / / /_/ /_ / / / /_/ / _(__ ) +# \____/ \____//_/ /_/ /_//_/ /_/ /_/\__,_/ /_/ /_/\__,_/ /____/ +# +# 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 +cmd open ${{ + case $(file --mime-type $f -b) in + text/* | */xml) $EDITOR $fx;; + audio/*) ffplay -nodisp -autoexit $fx;; + video/*) mpv $fx;; + *) for f in $fx; do setsid $OPENER $f > /dev/null 2> /dev/null & done;; + esac +}} + +cmd open-with %{{ + printf "Open with: " + read ans + + for file in "$fx" + do + $ans $file >/dev/null 2>&1 & + done + + lf -remote 'send reload' +}} + +# 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 +}} +cmd atool %atool -xD "$f" + +# 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 +}} + +# fzf +cmd fzf_jump ${{ + res="$(find . -maxdepth 1 | fzf --no-multi --reverse --header='Jump to location')" + if [ -f "$res" ]; then + cmd="select" + elif [ -d "$res" ]; then + cmd="cd" + fi + lf -remote "send $id $cmd \"$res\"" +}} + +# selection +cmd select-files ${{ + { echo "$fs"; find -L "$(pwd)" -mindepth 1 -maxdepth 1 -type f; } | + if [ "$lf_hidden" = "false" ]; then + # remove any hidden files so you only select files you can see. + grep -v '/\.[^/]\+$' + else + cat + fi | + sed '/^$/d' | sort | uniq -u | + xargs -d '\n' -r -I{} lf -remote "send $id toggle {}" +}} +cmd select-dirs ${{ + { echo "$fs"; find -L "$(pwd)" -mindepth 1 -maxdepth 1 -type d; } | + if [ "$lf_hidden" = "false" ]; then + grep -v '/\.[^/]\+$' + else + cat + fi | + sed '/^$/d' | sort | uniq -u | + xargs -d '\n' -r -I{} lf -remote "send $id toggle {}" +}} + +# cp, mv with progression +cmd paste &{{ + load=$(lf -remote 'load') + mode=$(echo "$load" | sed -n '1p') + list=$(echo "$load" | sed '1d') + if [ $mode = 'copy' ]; then + rsync -av --ignore-existing --progress $list . \ + | stdbuf -i0 -o0 -e0 tr '\r' '\n' \ + | while read line; do + lf -remote "send $id echo $line" + done + elif [ $mode = 'move' ]; then + mv -n $list . + fi + lf -remote 'send load' + lf -remote 'send clear' +}} + +# basic stuff +cmd mkdir %mkdir "$@" +cmd touch %touch "$@" +cmd chmod %{{ + printf "Mode Bits: " + read ans + + for file in "$fx" + do + chmod $ans $file + done + + lf -remote 'send reload' +}} + +# bulk rename +cmd bulk-rename ${{ + old=$(mktemp) + new=$(mktemp) + [ -n $fs ] && fs=$(ls) + printf "$fs\n" > $old + printf "$fs\n" > $new + $EDITOR $new + [ $(cat $new | wc -l) -ne $(cat $old | wc -l) ] && exit + paste $old $new | while read names; do + src=$(printf $names | cut -f1) + dst=$(printf $names | cut -f2) + [ $src = $dst ] && continue + [ -e $dst ] && continue + mv $src $dst + done + rm $old $new + lf -remote "send $id unselect" +}} + +# symlink +cmd Link %{{ + for file in $(lf -remote 'load'); do + if [ ! -n "${mode+1}" ]; then + mode="$file" + continue + fi + files+=("$file") + done + if [ "${#files[@]}" -lt 1 ]; then + lf -remote "send $id echo no files to link files: ${files}" + exit 0 + fi + # symbolically copy mode is indicating a soft link + if [[ "$mode" == copy ]]; then + ln -sr $files -t . + # while a move mode is indicating a hard link + elif [[ "$mode" == move ]]; then + ln $files -t . + fi +}} + +# fzf + zlua +cmd zlua ${{ + sel=$(awk -F "|" '{print $1}' "$HOME/.local/share/zlua/zlua" | fzf | awk '{$1=$1};1') + lf -remote "send $id cd \"$sel\"" +}} + +# ______ ___ _____ +# ___ |/ /_____ ___________________(_)_____________ ________ +# __ /|_/ /_ __ `/__ __ \__ __ \_ /__ __ \_ __ `/_ ___/ +# _ / / / / /_/ /__ /_/ /_ /_/ / / _ / / / /_/ /_(__ ) +# /_/ /_/ \__,_/ _ .___/_ .___//_/ /_/ /_/_\__, / /____/ +# /_/ /_/ /____/ +# unmap +map d + +# general +map . set hidden! +map ; read +map open +map d delete +map x cut +map R reload +map b $vi $fx + +# put lf to background +map $ kill -STOP $PPID + +# dedicated key for file opener +map o open-with + +# fzf +map $vi $(fzf) +map zlua +map f :fzf_jump + +# archives +map ax extract +map aa atool +map az push :zip +map at push :tar + +# selection +map select-dirs +map select-files + +# symlink +# y (select for copy) and P to paste soft-link +# d (select for cut) and P to paste hard-link +map P :Link + +# bookmarks +map gh cd ~ +map gC cd ~/Code +map gD cd ~/Downloads +map gA cd ~/Media +map gU cd ~/Music +map gP cd ~/Pictures +map gV cd ~/Videos +map gf cd ~/.config +map gl cd ~/.local/share +map ge cd /etc +map gb cd /boot +map gu cd /usr/share +map gd cd /dev +map go cd /opt +map gv cd /var +map gm cd /media +map gi cd /run/media +map gM cd /mnt +map gt cd /tmp +map gr cd / +map gs cd /srv +# map gk cd /bedrock/strata diff --git a/home/.config/lf/preview b/home/.config/lf/preview new file mode 100755 index 0000000..9f205b9 --- /dev/null +++ b/home/.config/lf/preview @@ -0,0 +1,44 @@ +#!/bin/sh + +case "$1" in + # First check common extensions + *.png|*.jpg|*.bmp|*.jpeg|*.gif|*.xpm|*.svg) mediainfo "$1" || exiftool "$1" || identify "$1" ;; + *.wav|*.mp3|*.flac|*.m4a|*.ape|*.ac3|*.og[agx]|*.spx|*.dsf|*.opus|*.dff|*.wma|*.wvc?) mediainfo "$1" || exiftool "$1" ;; + *.avi|*.mp4|*.wmv|*.dat|*.3gp|*.vob|*.ogv|*.mkv|*.mpe?g|*.fl[icv]|*.m2v|*.webm|*.m?ts|*.r[am]|*.qt|*.divx|*.as[fx]|*.m4v|*.mov) mediainfo "$1" || exiftool "$1" || fprobe -pretty "$1" 2>&1 ;; + *.pdf) mutool draw -F txt -i -- "$1" 1-10 || pdftotext -l 10 -nopgbrk -q -- "$1" - || exiftool "$1" ;; + *.ps) pstotext "$1" || ps2ascii "$1" ;; + *.epub|*.fb2) pandoc -s -t markdown -- "$1" ;; + *.djvu) djvutxt "$1" || exiftool "$1" ;; + # *.ttf|*.otf) otfinfo --info "$1" ;; + *.html|*.xhtml|*.htm) pandoc -s -t markdown -- "$1" || lynx -dump -- "$1" ;; + *.mkd|*.md|*.markdown) glow -s dark "$1" || mdcat "$1" ;; + *.ipynb) notedown --from notebook "$1" --to markdown | pandoc -f markdown -t plain ;; + *.torrent) dumptorrent -v "$1" || transmission-show -- "$1" ;; + *.zip|*.war|*.ear|*.oxt|*.tar|*.tgz|*.tar.gz|*.tbz2|*.tar.bz2|*.tar.txz|*.txz|*.rar|*.7z|*.ace|*.rpm|*.deb|*.xbps|*.Z|*.lzo|*.lzma|*.lha|*.cpio|*.jar|*.lz|*.lzh) + atool -l -q "$1" | tail -n +3 | awk -F' ' '{print $NF}' ;; + *.iso) isoinfo -l -i "$1" ;; + *.doc) catdoc -- "$1" ;; + *.docx) pandoc -s -t markdown -- "$1" ;; + *.odt|*.ott|*.s[xt]w|*.sxc) pandoc -s -t markdown -- "$1" || odt2txt "$1" ;; + *.xls) xls2csv -- "$1" ;; + *.xlsx) xlsx2csv -- "$1" ;; + *.ods|*.odp|*.sxw) pandoc -s -t markdown -- "$1" ;; + *.json) jq --color-output . "$1" || python -m json.tool -- "$1" ;; + # Then fallback to mimetypes + *) + mimetype=$(file --dereference --brief --mime-type -- "$1") + case "$mimetype" in + application/zip | application/x-tar | application/x-rar | application/x-7z-compressed | application/x-xz | application/x-bzip2 | application/x-gzip) + atool -l -q "$1" | tail -n +3 | awk -F' ' '{print $NF}' ;; + image/vnd.djvu) + djvutxt "$1" || exiftool "$1" ;; + image/*) + mediainfo "$1" || exiftool "$1" || identify "$1" ;; + video/*) + mediainfo "$1" || exiftool "$1" || fprobe -pretty "$1" 2>&1 ;; + text/* | */xml) + bat --style=plain --color=always "$1" ;; + *) + echo '----- File Type Classification -----' && file --dereference --brief -- "$1" ;; + esac ;; +esac diff --git a/home/.config/luakit/theme.lua b/home/.config/luakit/theme.lua new file mode 100644 index 0000000..f1ab4d8 --- /dev/null +++ b/home/.config/luakit/theme.lua @@ -0,0 +1,247 @@ +-- +-- Base16 Nord +-- Author: arcticicestudio +-- + +function hex2rgb(hex) + local hex = hex:gsub("#","") + return string.format("%s, %s, %s",tonumber("0x"..hex:sub(1,2)), tonumber("0x"..hex:sub(3,4)), tonumber("0x"..hex:sub(5,6))) +end + +local base00 = "#2E3440" -- ---- +local base01 = "#3B4252" -- --- +local base02 = "#434C5E" -- -- +local base03 = "#4C566A" -- - +local base04 = "#D8DEE9" -- + +local base05 = "#E5E9F0" -- ++ +local base06 = "#ECEFF4" -- +++ +local base07 = "#8FBCBB" -- ++++ +local base08 = "#BF616A" -- red +local base09 = "#D08770" -- orange +local base0A = "#EBCB8B" -- yellow +local base0B = "#A3BE8C" -- green +local base0C = "#88C0D0" -- aqua/cyan +local base0D = "#81A1C1" -- blue +local base0E = "#B48EAD" -- purple +local base0F = "#5E81AC" -- brown + +local theme = {} + +-- Default settings +theme.fg = base00 +theme.bg = base07 + +-- Genaral colours +theme.success_fg = base0C +theme.loaded_fg = base0D +theme.error_fg = base00 +theme.error_bg = base08 + +-- Warning colours +theme.warning_fg = base00 +theme.warning_bg = base0E + +-- Notification colours +theme.notif_fg = base00 +theme.notif_bg = base05 + +-- Menu colours +theme.menu_fg = base05 +theme.menu_bg = base00 +theme.menu_selected_fg = base01 +theme.menu_selected_bg = base0A + +theme.menu_title_bg = base00 +theme.menu_primary_title_fg = base05 +theme.menu_secondary_title_fg = base04 + +theme.menu_disabled_fg = base03 +theme.menu_disabled_bg = theme.menu_bg +theme.menu_enabled_fg = theme.menu_fg +theme.menu_enabled_bg = theme.menu_bg +theme.menu_active_fg = base06 +theme.menu_active_bg = theme.menu_bg + +-- Proxy manager +theme.proxy_active_menu_fg = base05 +theme.proxy_active_menu_bg = base00 +theme.proxy_inactive_menu_fg = base03 +theme.proxy_inactive_menu_bg = base00 + +-- Statusbar specific +theme.sbar_fg = base05 +theme.sbar_bg = base00 + +-- Downloadbar specific +theme.dbar_fg = base00 +theme.dbar_bg = base0D +theme.dbar_error_fg = base08 + +-- Input bar specific +theme.ibar_fg = base05 +theme.ibar_bg = base00 + +-- Tab label +theme.tab_fg = base05 +theme.tab_bg = base00 +theme.tab_hover_bg = base03 +theme.tab_ntheme = base03 +theme.selected_fg = base05 +theme.selected_bg = base03 +theme.selected_ntheme = base00 +theme.loading_fg = base0D +theme.loading_bg = base00 + +theme.selected_private_tab_bg = base05 +theme.private_tab_bg = base03 + +-- Trusted/untrusted ssl colours +theme.trust_fg = base0B +theme.notrust_fg = base0D + +-- Follow mode hints +theme.hint_fg = base00 +theme.hint_bg = base0A +theme.hint_border = string.format("1px dashed %s", base0A) + +theme.hint_overlay_bg = string.format("rgba(%s, 0.3)", hex2rgb(base07)) +theme.hint_overlay_border = string.format("1px dotted %s", base07) + +theme.hint_overlay_selected_bg = string.format("rgba(%s, 0.3)", hex2rgb(base0B)) +theme.hint_overlay_selected_border = theme.hint_overlay_border + +-- General colour pairings +theme.ok = { fg = base05, bg = base00 } +theme.warn = { fg = base00, bg = base0E } +theme.error = { fg = base08, bg = base00 } + +-- Font +theme.font = "13pt Sarasa Fixed J" +theme.hint_font = "12pt Sarasa Fixed J" + +return theme + +-- +-- Base16 OneDark +-- Author: Lalit Magant (http://github.com/tilal6991) +-- + +-- function hex2rgb(hex) +-- local hex = hex:gsub("#","") +-- return string.format("%s, %s, %s",tonumber("0x"..hex:sub(1,2)), tonumber("0x"..hex:sub(3,4)), tonumber("0x"..hex:sub(5,6))) +-- end + +-- local base00 = "#282c34" -- ---- +-- local base01 = "#353b45" -- --- +-- local base02 = "#3e4451" -- -- +-- local base03 = "#545862" -- - +-- local base04 = "#565c64" -- + +-- local base05 = "#abb2bf" -- ++ +-- local base06 = "#b6bdca" -- +++ +-- local base07 = "#c8ccd4" -- ++++ +-- local base08 = "#e06c75" -- red +-- local base09 = "#d19a66" -- orange +-- local base0A = "#e5c07b" -- yellow +-- local base0B = "#98c379" -- green +-- local base0C = "#56b6c2" -- aqua/cyan +-- local base0D = "#61afef" -- blue +-- local base0E = "#c678dd" -- purple +-- local base0F = "#be5046" -- brown + +-- local theme = {} + +-- -- Default settings +-- theme.fg = base00 +-- theme.bg = base07 + +-- -- Genaral colours +-- theme.success_fg = base0C +-- theme.loaded_fg = base0D +-- theme.error_fg = base00 +-- theme.error_bg = base08 + +-- -- Warning colours +-- theme.warning_fg = base00 +-- theme.warning_bg = base0E + +-- -- Notification colours +-- theme.notif_fg = base00 +-- theme.notif_bg = base05 + +-- -- Menu colours +-- theme.menu_fg = base05 +-- theme.menu_bg = base00 +-- theme.menu_selected_fg = base01 +-- theme.menu_selected_bg = base0A + +-- theme.menu_title_bg = base00 +-- theme.menu_primary_title_fg = base05 +-- theme.menu_secondary_title_fg = base04 + +-- theme.menu_disabled_fg = base03 +-- theme.menu_disabled_bg = theme.menu_bg +-- theme.menu_enabled_fg = theme.menu_fg +-- theme.menu_enabled_bg = theme.menu_bg +-- theme.menu_active_fg = base06 +-- theme.menu_active_bg = theme.menu_bg + +-- -- Proxy manager +-- theme.proxy_active_menu_fg = base05 +-- theme.proxy_active_menu_bg = base00 +-- theme.proxy_inactive_menu_fg = base03 +-- theme.proxy_inactive_menu_bg = base00 + +-- -- Statusbar specific +-- theme.sbar_fg = base05 +-- theme.sbar_bg = base00 + +-- -- Downloadbar specific +-- theme.dbar_fg = base00 +-- theme.dbar_bg = base0D +-- theme.dbar_error_fg = base08 + +-- -- Input bar specific +-- theme.ibar_fg = base05 +-- theme.ibar_bg = base00 + +-- -- Tab label +-- theme.tab_fg = base05 +-- theme.tab_bg = base00 +-- theme.tab_hover_bg = base03 +-- theme.tab_ntheme = base03 +-- theme.selected_fg = base05 +-- theme.selected_bg = base03 +-- theme.selected_ntheme = base00 +-- theme.loading_fg = base0D +-- theme.loading_bg = base00 + +-- theme.selected_private_tab_bg = base05 +-- theme.private_tab_bg = base03 + +-- -- Trusted/untrusted ssl colours +-- theme.trust_fg = base0B +-- theme.notrust_fg = base0D + +-- -- Follow mode hints +-- theme.hint_fg = base00 +-- theme.hint_bg = base0A +-- theme.hint_border = string.format("1px dashed %s", base0A) + +-- theme.hint_overlay_bg = string.format("rgba(%s, 0.3)", hex2rgb(base07)) +-- theme.hint_overlay_border = string.format("1px dotted %s", base07) + +-- theme.hint_overlay_selected_bg = string.format("rgba(%s, 0.3)", hex2rgb(base0B)) +-- theme.hint_overlay_selected_border = theme.hint_overlay_border + +-- -- General colour pairings +-- theme.ok = { fg = base05, bg = base00 } +-- theme.warn = { fg = base00, bg = base0E } +-- theme.error = { fg = base08, bg = base00 } + +-- -- Font +-- theme.font = "13pt Sarasa Fixed J" +-- theme.hint_font = "12pt Sarasa Fixed J" + +-- return theme + +-- vim: et:sw=4:ts=8:sts=4:tw=80:ft=lua diff --git a/home/.config/luakit/userconf.lua b/home/.config/luakit/userconf.lua new file mode 100644 index 0000000..2ca4078 --- /dev/null +++ b/home/.config/luakit/userconf.lua @@ -0,0 +1,65 @@ +-- Settings +local settings = require "settings" + +settings.window.home_page = "file:///home/follie/Code/Startpage/index.html" +settings.completion.history.order = "title" +settings.webview.default_charset = "utf-8" +settings.webview.enable_caret_browsing = true +settings.webview.enable_developer_extras = true +settings.webview.user_agent = "Mozilla/5.0 (Windows NT 10.0; rv:78.0) Gecko/20100101 Firefox/78.0" + +local engines = settings.window.search_engines +engines.duckduckgo = "https://www.duckduckgo.com/?q=%s" +engines.searx0 = "https://search.disroot.org/?category_general=on&q=%s" +engines.searx1 = "https://searx.info/?category_general=on&q=%s" +engines.searx2 = "https://searx.fmac.xyz/?category_general=on&q=%s" +engines.searx3 = "https://searx.be/?category_general=on&q=%s" +engines.searx4 = "https://searx.monicz.pl/?category_general=on&q=%s" +engines.startpage = "https://startpage.com/do/search?query=%s" +engines.qwant = "https://www.qwant.com/?q=%s" +engines.stackoverflow = "http://stackoverflow.com/search?q=%s" +engines.github = "https://github.com/search?utf8=✓&q=%s" +engines.gitlab = "https://gitlab.com/explore?utf8=✓&sort=latest_activity_desc&name=%s" +engines.mdn = "https://developer.mozilla.org/en-US/search?q=%s" +engines.devhints = "https://devhints.io/%s" +engines.gentoowiki = "https://wiki.gentoo.org/index.php?title=Special%3ASearch&profile=default&fulltext=Search&search=%s" +engines.archwiki = "https://wiki.archlinux.org/index.php?search=%s" +engines.wiki = "https://en.wikipedia.org/wiki/%s" +engines.osm = "https://www.openstreetmap.org/search?query=%s" +engines.gi = "https://www.google.com/search?tbm=isch&q=%s" +engines.urban = "https://www.urbandictionary.com/define.php?term=%s" +engines.thesaurus = "https://www.thesaurus.com/browse/%s" +engines.vocab = "https://www.vocabulary.com/dictionary/%s" +engines.twitter = "https://twitter.com/search?q=%s" +engines.odysee = "https://odysee.com/$/search?q=%s" +engines.yt = "https://www.youtube.com/results?search_query=%s" +engines.archive = "https://archive.org/search.php?query=%s" +engines.alto = "https://archive.org/search.php?query=%s" +engines.default = engines.searx0 + +local downloads = require "downloads" +downloads.default_dir = os.getenv("HOME") .. "/Downloads" + +local noscript = require "noscript" +noscript.enable_scripts = false + +require_web_module("referer_control_wm") + +-- Bindings +local modes = require "modes" + +modes.add_binds("normal", {{ + "", + "Copy selected text.", + function () + luakit.selection.clipboard = luakit.selection.primary + end +}}) + +modes.add_binds("normal", {{ + "", + "Stop loading the current tab.", + function (w) + w.view:stop() + end +}}) diff --git a/home/.config/mako/clipboard.png b/home/.config/mako/clipboard.png new file mode 100644 index 0000000..0011c48 Binary files /dev/null and b/home/.config/mako/clipboard.png differ diff --git a/home/.config/mako/config b/home/.config/mako/config new file mode 100644 index 0000000..2840af5 --- /dev/null +++ b/home/.config/mako/config @@ -0,0 +1,44 @@ +font=Sarasa Fixed J 11 +border-size=4 +border-radius=10 +margin=10,10,10 +max-visible=10 +default-timeout=5000 +ignore-timeout=1 +layer=overlay + +# --- Nord --- # +background-color=#2e3440 +text-color=#81a1c1 +border-color=#81a1c1 +progress-color=source #d08770 + +[urgency=low] +text-color=#81a1c1 + +[urgency=normal] +text-color=#ebcb8b + +[urgency=high] +background-color=#bf616a +text-color=#2e3440 +border-color=#ebcb8b +default-timeout=0 + +# -- OneDark -- # +# background-color=#282c34 +# text-color=#61afef +# border-color=#61afef +# progress-color=source #d19a66 + +# [urgency=low] +# text-color=#61afef + +# [urgency=normal] +# text-color=#e5c07b + +# [urgency=high] +# background-color=#e06c75 +# text-color=#282c34 +# border-color=#e5c07b +# default-timeout=0 diff --git a/home/.config/mako/headphones.png b/home/.config/mako/headphones.png new file mode 100644 index 0000000..acd5325 Binary files /dev/null and b/home/.config/mako/headphones.png differ diff --git a/home/.config/mako/idea.png b/home/.config/mako/idea.png new file mode 100644 index 0000000..34a863b Binary files /dev/null and b/home/.config/mako/idea.png differ diff --git a/home/.config/mako/microphone.png b/home/.config/mako/microphone.png new file mode 100644 index 0000000..24472e0 Binary files /dev/null and b/home/.config/mako/microphone.png differ diff --git a/home/.config/mako/mute.png b/home/.config/mako/mute.png new file mode 100644 index 0000000..d35b2b7 Binary files /dev/null and b/home/.config/mako/mute.png differ diff --git a/home/.config/mako/notrackpad.png b/home/.config/mako/notrackpad.png new file mode 100644 index 0000000..14e6731 Binary files /dev/null and b/home/.config/mako/notrackpad.png differ diff --git a/home/.config/mako/penguin.png b/home/.config/mako/penguin.png new file mode 100644 index 0000000..02901d1 Binary files /dev/null and b/home/.config/mako/penguin.png differ diff --git a/home/.config/mako/penguin_red.png b/home/.config/mako/penguin_red.png new file mode 100755 index 0000000..ef6938c Binary files /dev/null and b/home/.config/mako/penguin_red.png differ diff --git a/home/.config/mako/photograph.png b/home/.config/mako/photograph.png new file mode 100644 index 0000000..be1ed84 Binary files /dev/null and b/home/.config/mako/photograph.png differ diff --git a/home/.config/mako/speaker.png b/home/.config/mako/speaker.png new file mode 100644 index 0000000..eda4e6e Binary files /dev/null and b/home/.config/mako/speaker.png differ diff --git a/home/.config/mako/trackpad.png b/home/.config/mako/trackpad.png new file mode 100644 index 0000000..85efa5a Binary files /dev/null and b/home/.config/mako/trackpad.png differ diff --git a/home/.config/mimeapps.list b/home/.config/mimeapps.list new file mode 100644 index 0000000..e6364b5 --- /dev/null +++ b/home/.config/mimeapps.list @@ -0,0 +1,10 @@ +[Default Applications] +text/html=firefox.desktop +x-scheme-handler/http=firefox.desktop +x-scheme-handler/https=firefox.desktop +x-scheme-handler/about=firefox.desktop +x-scheme-handler/unknown=firefox.desktop +video/*=mpv.desktop + +[Added Associations] +video/*=mpv.desktop; diff --git a/home/.config/mpDris2/mpDris2.conf b/home/.config/mpDris2/mpDris2.conf new file mode 100644 index 0000000..f19b820 --- /dev/null +++ b/home/.config/mpDris2/mpDris2.conf @@ -0,0 +1,12 @@ +[Connection] +host = 127.0.0.1 +port = 6600 + +[Library] +music_dir = ~/Music +cover_regex = ^(Album|album|Cover|cover|Folder|\.?folder|Front|front|Artwork|artwork).*\.(gif|jpeg|jpg|png|bmp)$ + +[Bling] +mmkeys = False +notify = True +notify_urgency = 0 diff --git a/home/.config/mpd/mpd.conf b/home/.config/mpd/mpd.conf new file mode 100644 index 0000000..501434a --- /dev/null +++ b/home/.config/mpd/mpd.conf @@ -0,0 +1,25 @@ +pid_file "~/.local/share/mpd/mpd.pid" +db_file "~/.local/share/mpd/mpd.db" +state_file "~/.local/share/mpd/mpdstate" +playlist_directory "~/.local/share/mpd/playlists" +log_file "~/.local/share/mpd/mpd.log" +music_directory "~/Music" + +audio_output { + type "fifo" + name "Visualizer feed" + path "/tmp/mpd.fifo" + format "44100:16:2" +} + +audio_output { + type "pulse" + name "PulseAudio" +} + +auto_update "yes" +bind_to_address "127.0.0.1" +port "6600" +follow_outside_symlinks "yes" +follow_inside_symlinks "yes" +filesystem_charset "UTF-8" diff --git a/home/.config/ncmpcpp/album_art.sh b/home/.config/ncmpcpp/album_art.sh new file mode 100755 index 0000000..500709e --- /dev/null +++ b/home/.config/ncmpcpp/album_art.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +MUSIC_DIR=$HOME/Music/ +COVER=/tmp/cover.jpg + +{ + file="$(mpc --format %file% current -p 6600)" + album_dir="${file%/*}" + [[ -z "$album_dir" ]] && exit 1 + album_dir="$MUSIC_DIR/$album_dir" + covers="$(find "$album_dir" -type d -exec find {} -maxdepth 1 -type f -iregex ".*/.*\(Album\|album\|Cover\|cover\|Folder\|folder\|Artwork\|artwork\|Front\|front\).*[.]\(jpe?g\|png\|gif\|bmp\)" \; )" + src="$(echo -n "$covers" 2>/dev/null | head -n1)" + rm -f "$COVER" + + # For Notifications + if [[ -n "$src" ]] ; then + # Resize the image's width to 64px + convert "$src" -resize 64x "$COVER" + if [[ -f "$COVER" ]] ; then + notify-send -u low -i ${COVER} " Now Playing" "$(mpc --format '%title% \n%artist% - %album%' current)" + fi + else + notify-send -u low -i $HOME/.config/dunst/headphones.png " Now Playing" "$(mpc --format '%title% \n%artist% - %album%' current)" + fi +} & diff --git a/home/.config/ncmpcpp/config b/home/.config/ncmpcpp/config new file mode 100644 index 0000000..5546b5e --- /dev/null +++ b/home/.config/ncmpcpp/config @@ -0,0 +1,60 @@ +# Basic setup +mpd_host = 127.0.0.1 +mpd_port = 6600 +mpd_music_dir = ~/Music +lyrics_directory = ~/.local/share/ncmpcpp +ncmpcpp_directory = ~/.config/ncmpcpp + +# Visualizer +visualizer_data_source = /tmp/mpd.fifo +visualizer_output_name = Visualizer feed +visualizer_in_stereo = yes +visualizer_type = spectrum +visualizer_look = ●┃ +visualizer_fps = 60 + +# Interface +colors_enabled = "yes" +browser_display_mode = "columns" +playlist_display_mode = "columns" +playlist_show_remaining_time = "no" +autocenter_mode = "yes" +centered_cursor = "yes" +user_interface = classic +ignore_leading_the = "yes" +display_bitrate = "no" +progressbar_look = "━━" +progressbar_elapsed_color = "blue" +progressbar_color = "black" +empty_tag_marker = "--" +song_columns_list_format = "(10)[yellow]{l} (30)[green]{a} (60)[blue]{t}" # "(55)[blue]{tr} (45)[green]{a}" +header_window_color = "blue" +volume_color = "yellow" +statusbar_color = "blue" +main_window_color = "blue" +state_flags_color = "blue" +state_line_color = "blue" +statusbar_time_color = "yellow" +alternative_ui_separator_color = "black" +alternative_header_first_line_format = "$5$9 {$5$b%t$/b$9}|{$8$b%f$/b$9} $5$9" +alternative_header_second_line_format = "{{$4$b%a$/b$9}{ - $7%b$9}{ ($4%y$9)}}|{%D}" +titles_visibility = "no" +header_visibility = "no" +enable_window_title = "no" +statusbar_visibility = "yes" +# now_playing_prefix = "-> " +# now_playing_suffix = " <-" +startup_screen = "playlist" +# startup_slave_screen = "visualizer" + +# Others +cyclic_scrolling = yes +system_encoding = utf-8 +regular_expressions = extended +# execute_on_song_change = ~/.config/ncmpcpp/album_art.sh +space_add_mode = add_remove +mouse_support = "no" +external_editor = /usr/bin/nvim +use_console_editor = "yes" +follow_now_playing_lyrics = "yes" +allow_for_physical_item_deletion = "no" diff --git a/home/.config/neofetch/config.conf b/home/.config/neofetch/config.conf new file mode 100644 index 0000000..da3664f --- /dev/null +++ b/home/.config/neofetch/config.conf @@ -0,0 +1,855 @@ +# Neofetch config +print_info() { + if [[ "$TERM" = "xterm-kitty" ]]; then + info cutie + info bestgirl + info "$(color 4) Distro" distro + info "$(color 4) Kernel" kernel + info "$(color 4)神Uptime" uptime + info "$(color 4) Packages" packages + info "$(color 4) WM" wm + info "$(color 4) Memory" memory + info cols + else + info "$(color 4) Distro" distro + info "$(color 4) Kernel" kernel + info "$(color 4)神Uptime" uptime + info "$(color 4) Packages" packages + info "$(color 4) WM" wm + info "$(color 4) Icons" icons + info "$(color 4) Terminal" term + info "$(color 4) Shell" shell + info "$(color 4) Font" term_font + info "$(color 4) CPU" cpu + info "$(color 4) GPU" gpu + info "$(color 4) Memory" memory + info cols + fi +} + +get_cutie() { + echo -e "$(color 1)$(tput bold) /) + /\___/\ (( + \\\`@_@'/ )) + {_:Y:.}_// + --------{_}^-'{_}-----------$(tput sgr0)" +} + +get_bestgirl() { + #bestgirl="Shinomiya Kaguya" + echo -e " $(color 1) $(tput bold)Shinomiya Kaguya  $(tput sgr0)" +} + +# Title + + +# Hide/Show Fully qualified domain name. +# +# Default: 'off' +# Values: 'on', 'off' +# Flag: --title_fqdn +title_fqdn="off" + + +# 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="on" + + +# 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="on" + +# 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="off" + + +# 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="off" + +# 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="on" + +# 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="off" + +# 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="off" + +# 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="physical" + +# 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="off" + + +# GPU + + +# Enable/Disable GPU Brand +# +# Default: 'on' +# Values: 'on', 'off' +# Flag: --gpu_brand +# +# Example: +# on: 'AMD HD 7950' +# off: 'HD 7950' +gpu_brand="off" + +# 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="off" + + +# 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="on" + + +# 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 + + +# Desktop Environment + + +# Show Desktop Environment version +# +# Default: 'off' +# Values: 'on', 'off' +# Flag: --de_version +de_version="off" + + +# 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', 'none' +# 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%)' +# +# none: 'Disk: 74G / 118G (66%)' +# 'Disk: 74G / 118G (66%)' +# 'Disk: 74G / 118G (66%)' +disk_subtitle="mount" + +# Disk percent. +# Show/Hide disk percent. +# +# Default: 'on' +# Values: 'on', 'off' +# Flag: --disk_percent +# +# Example: +# on: 'Disk (/): 74G / 118G (66%)' +# off: 'Disk (/): 74G / 118G' +disk_percent="on" + + +# 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 +# io.elementary.music +# iTunes +# juk +# lollypop +# mocp +# mopidy +# mpd +# muine +# 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="off" + +# 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 7) + +# 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 + +# Color Alignment +# +# Default: 'auto' +# Values: 'auto', 'num' +# Flag: --col_offset +# +# Number specifies how far from the left side of the terminal (in spaces) to +# begin printing the columns, in case you want to e.g. center them under your +# text. +# Example: +# col_offset="auto" - Default behavior of neofetch +# col_offset=7 - Leave 7 spaces then print the colors +col_offset="auto" + +# 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="off" + +# 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="off" +memory_display="off" +battery_display="off" +disk_display="off" + + +# Backend Settings + + +# Image backend. +# +# Default: 'ascii' +# Values: 'ascii', 'caca', 'chafa', 'jp2a', 'iterm2', 'off', +# 'termpix', 'pixterm', 'tycat', 'w3m', 'kitty' +# Flag: --backend +if [[ "$TERM" = "xterm-kitty" ]]; then + image_backend="kitty" +else + image_backend="ascii" +fi + +# 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="$HOME/.config/neofetch/kaguya.jpg" + +# Ascii Options + + +# Ascii distro +# Which distro's ascii art to display. +# +# Default: 'auto' +# Values: 'auto', 'distro_name' +# Flag: --ascii_distro +# NOTE: AIX, Alpine, Anarchy, Android, Antergos, antiX, AOSC, +# Apricity, ArcoLinux, ArchBox, ARCHlbs, ArchStrike, +# XFerience, ArchMerge, Arch, Artix, Arya, Bedrock, Bitrig, +# BlackArch, BLAG, BlankOn, BlueLight, bonsai, BSD, +# BunsenLabs, Calculate, Carbs, CentOS, Chakra, ChaletOS, +# Chapeau, Chrom*, Cleanjaro, ClearOS, Clear_Linux, Clover, +# Condres, Container_Linux, CRUX, Cucumber, Debian, Deepin, +# DesaOS, Devuan, DracOS, DragonFly, Drauger, Elementary, +# EndeavourOS, Endless, EuroLinux, Exherbo, Fedora, Feren, FreeBSD, +# FreeMiNT, Frugalware, Funtoo, GalliumOS, Gentoo, Pentoo, +# gNewSense, GNU, GoboLinux, Grombyang, Guix, Haiku, Huayra, +# Hyperbola, janus, Kali, KaOS, KDE_neon, Kibojoe, Kogaion, +# Korora, KSLinux, Kubuntu, LEDE, LFS, Linux_Lite, +# LMDE, Lubuntu, Lunar, macos, Mageia, MagpieOS, Mandriva, +# Manjaro, Maui, Mer, Minix, LinuxMint, MX_Linux, Namib, +# Neptune, NetBSD, Netrunner, Nitrux, NixOS, Nurunner, +# NuTyX, OBRevenge, OpenBSD, OpenIndiana, OpenMandriva, +# OpenWrt, osmc, Oracle, PacBSD, Parabola, Pardus, Parrot, +# Parsix, TrueOS, PCLinuxOS, Peppermint, popos, Porteus, +# PostMarketOS, Proxmox, Puppy, PureOS, Qubes, Radix, Raspbian, +# Reborn_OS, Redstar, Redcore, Redhat, Refracted_Devuan, Regata, +# Rosa, sabotage, Sabayon, Sailfish, SalentOS, Scientific, Septor, +# SharkLinux, Siduction, Slackware, SliTaz, SmartOS, Solus, +# Source_Mage, Sparky, Star, SteamOS, SunOS, openSUSE_Leap, +# openSUSE_Tumbleweed, openSUSE, SwagArch, Tails, Trisquel, +# Ubuntu-Budgie, Ubuntu-GNOME, Ubuntu-MATE, Ubuntu-Studio, Ubuntu, +# Void, Obarun, windows10, Windows7, Xubuntu, Zorin, and IRIX +# have ascii logos +# NOTE: Arch, Ubuntu, Redhat, and Dragonfly have 'old' logo variants. +# Use '{distro name}_old' to use the old logos. +# NOTE: Ubuntu has flavor variants. +# Change this to Lubuntu, Kubuntu, Xubuntu, Ubuntu-GNOME, +# Ubuntu-Studio, Ubuntu-Mate or Ubuntu-Budgie to use the flavors. +# NOTE: Arcolinux, Dragonfly, Fedora, Alpine, Arch, Ubuntu, +# CRUX, Debian, Gentoo, FreeBSD, Mac, NixOS, OpenBSD, android, +# Antrix, CentOS, Cleanjaro, ElementaryOS, GUIX, Hyperbola, +# Manjaro, MXLinux, NetBSD, Parabola, POP_OS, PureOS, +# Slackware, SunOS, LinuxLite, OpenSUSE, Raspbian, +# postmarketOS, and Void have a smaller logo variant. +# Use '{distro name}_small' to use the small variants. +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="fill" + +# 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="266px" + +# Gap between image and text +# +# Default: '3' +# Values: 'num', '-num' +# Flag: --gap +gap=4 + +# Image offsets +# Only works with the w3m backend. +# +# Default: '0' +# Values: 'px' +# Flags: --xoffset +# --yoffset +yoffset=0 +xoffset=1 + +# 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/neofetch/kaguya.jpg b/home/.config/neofetch/kaguya.jpg new file mode 100755 index 0000000..5b49b99 Binary files /dev/null and b/home/.config/neofetch/kaguya.jpg differ diff --git a/home/.config/newsboat/config b/home/.config/newsboat/config new file mode 100644 index 0000000..de599a5 --- /dev/null +++ b/home/.config/newsboat/config @@ -0,0 +1,53 @@ +auto-reload no +refresh-on-startup no +notify-program "notify-send" +notify-screen yes +notify-xterm yes + +unbind-key q +unbind-key Q +unbind-key j +unbind-key k +unbind-key g +unbind-key m +unbind-key f + +browser "firefox --new-tab %u" +macro m set browser "mpv %u" ; open-in-browser ; set browser "firefox --new-tab %u" +macro f set browser "firefox --new-tab %u" ; open-in-browser ; set browser "firefox --new-tab %u" + +bind-key , macro-prefix +bind-key j down +bind-key k up +bind-key G end +bind-key g home +bind-key d pagedown +bind-key u pageup +bind-key l open +bind-key h quit +bind-key BACKSPACE quit +bind-key q hard-quit +bind-key H prev-feed +bind-key L next-feed +bind-key c toggle-show-read-feeds + +color background default default +color listnormal blue default +color listnormal_unread blue default +color listfocus black yellow +color listfocus_unread black yellow +color info default black +color article default default +color info yellow black bold + +highlight all "---.*---" green +highlight article "(^Feed:.*|^Title:.*|^Author:.*)" blue default bold +highlight article "(^Link:.*|^Date:.*)" default default +highlight article "https?://[^ ]+" yellow default +highlight article "^(Title):.*$" cyan default +highlight article "\\[[0-9][0-9]*\\]" magenta default bold +highlight article "\\[image\\ [0-9]+\\]" yellow default bold +highlight article "\\[embedded flash: [0-9][0-9]*\\]" yellow default bold +highlight article ":.*\\(link\\)$" blue default +highlight article ":.*\\(image\\)$" cyan default +highlight article ":.*\\(embedded flash)$" magenta default diff --git a/home/.config/newsboat/urls b/home/.config/newsboat/urls new file mode 100644 index 0000000..4ca2147 --- /dev/null +++ b/home/.config/newsboat/urls @@ -0,0 +1,77 @@ +-------Linux/BSD------- +https://distrowatch.com/news/dw.xml "~DistroWatch" news +https://www.reddit.com/r/linux/new.rss "~r/linux" reddit +https://www.reddit.com/r/linuxquestions/new.rss "~r/linuxquestions" reddit +https://www.reddit.com/r/linux_gaming/new.rss "~r/linux_gaming" reddit +https://www.reddit.com/r/openbsd/new.rss "~r/openbsd" reddit +https://www.reddit.com/r/freebsd/new.rss "~r/freebsd" reddit +https://www.reddit.com/r/Gentoo/new.rss "~r/Gentoo" reddit +https://www.reddit.com/r/archlinux/new.rss "~r/archlinux" reddit +https://www.reddit.com/r/voidlinux/new.rss "~r/voidlinux" reddit +https://www.reddit.com/r/NixOS/new.rss "~r/NixOS" reddit +https://www.reddit.com/r/bedrocklinux/new.rss "~r/bedrocklinux" reddit +https://www.reddit.com/r/Fedora/new.rss "~r/Fedora" reddit +https://www.reddit.com/r/gnome/new.rss "~r/gnome" reddit +https://www.reddit.com/r/kde/new.rss "~r/kde" reddit +https://www.reddit.com/r/swaywm/new.rss "~r/swaywm" reddit +https://www.reddit.com/r/flatpak/new.rss "~r/flatpak" reddit +--------Software------- +https://www.reddit.com/r/emacs/new.rss "~r/emacs" reddit +https://www.reddit.com/r/neovim/new.rss "~r/neovim" reddit +https://www.reddit.com/r/GnuPG/new.rss "~r/GnuPG" reddit +https://www.reddit.com/r/commandline/new.rss "~r/commandline" reddit +--------Privacy-------- +https://www.reddit.com/r/privacytoolsIO/new.rss "~r/privacytoolsIO" reddit +https://www.reddit.com/r/privacy/new.rss "~r/privacy" reddit +https://www.reddit.com/r/TOR/new.rss "~r/TOR" reddit +https://www.reddit.com/r/Monero/new.rss "~r/Monero" reddit +---------Fluff--------- +https://www.reddit.com/r/unixporn/new.rss "~r/unixporn" reddit +https://www.reddit.com/r/Rainmeter/new.rss "~r/Rainmeter" reddit +https://www.reddit.com/r/FirefoxCSS/new.rss "~r/FirefoxCSS" reddit +https://www.reddit.com/r/startpages/new.rss "~r/startpages" reddit +https://www.reddit.com/r/wallpaper/new.rss "~r/wallpaper" reddit +https://www.reddit.com/r/Animewallpaper/new.rss "~r/Animewallpaper" reddit +https://www.reddit.com/r/AnimewallpapersSFW/new.rss "~r/AnimewallpaperSFW" reddit +https://www.reddit.com/r/awwnime/new.rss "~r/awwnime" reddit +https://www.reddit.com/r/Lolirefugees/new.rss "~r/Lolirefugees" reddit +https://www.reddit.com/r/AnimeGirlsInKimonos/new.rss "~r/AnimeGirlsInKimono" reddit +https://www.reddit.com/r/fatestaynight/new.rss "~r/fatestaynight" reddit +https://www.reddit.com/r/Saber/new.rss "~r/Saber" reddit +https://www.reddit.com/r/OneTrueTohsaka/new.rss "~r/OneTrueTohsaka" reddit +https://www.reddit.com/r/formalwaifus/new.rss "~r/formalwaifus" reddit +https://www.reddit.com/r/LightNovels/new.rss "~r/LightNovels" reddit +https://www.reddit.com/r/PixelArt/new.rss "~r/PixelArt" reddit +https://www.reddit.com/r/riprequests/new.rss "~r/riprequests" reddit +------Programming------ +https://www.reddit.com/r/learnprogramming/new.rss "~r/learnprogramming" reddit +https://www.reddit.com/r/programming/new.rss "~r/programming" reddit +https://www.reddit.com/r/dailyprogrammer/new.rss "~r/dailyprogrammer" reddit +https://www.reddit.com/r/badcode/new.rss "~r/badcode" reddit +---------News---------- +https://news.ycombinator.com/rss "~Hacker News" news +https://www.phoronix.com/rss.php "~Phoronix" news +https://www.nytimes.com/svc/collections/v1/publish/https://www.nytimes.com/section/world/rss.xml "~The NewYork Times" news +https://www.cbsnews.com/latest/rss/world "~CBS News" news +https://www.theguardian.com/world/rss "~The Guardian" news +-------Youtube--------- +https://www.youtube.com/feeds/videos.xml?channel_id=UCVls1GmFKf6WlTraIb_IaJg "~Youtube: DistroTube" youtube +https://www.youtube.com/feeds/videos.xml?channel_id=UCld68syR8Wi-GY_n4CaoJGA "~Youtube: Brodie Robertson" youtube +https://www.youtube.com/feeds/videos.xml?channel_id=UC7YOGHUfC1Tb6E4pudI9STA "~Youtube: Mental Outlaw" youtube +https://www.youtube.com/feeds/videos.xml?channel_id=UC2eYFnH61tmytImy1mTYvhA "~Youtube: Luke Smith" youtube +https://www.youtube.com/feeds/videos.xml?channel_id=UCZWadyLVO4ZnMgLrRVtS6VA "~Youtube: baby WOGUE" youtube +https://www.youtube.com/feeds/videos.xml?channel_id=UCgTNupxATBfWmfehv21ym-g "~Youtube: Null Byte" youtube +https://www.youtube.com/feeds/videos.xml?channel_id=UC3s0BtrBJpwNDaflRSoiieQ "~Youtube: Hak5" youtube +------ +https://www.youtube.com/feeds/videos.xml?channel_id=UCHnyfMqiRRG1u-2MsSQLbXA "~Youtube: Veritasium" youtube +https://www.youtube.com/feeds/videos.xml?channel_id=UC6nSFpj9HTCZ5t-N3Rm3-HA "~Youtube: Vsauce" youtube +https://www.youtube.com/feeds/videos.xml?channel_id=UCoxcjq-8xIDTYp3uz647V5A "~Youtube: Numberphile" youtube +https://www.youtube.com/feeds/videos.xml?channel_id=UC2C_jShtL725hvbm1arSV9w "~Youtube: CGP Grey" youtube +https://www.youtube.com/feeds/videos.xml?channel_id=UCOGeU-1Fig3rrDjhm9Zs_wg "~Youtube: Vihart" youtube +https://www.youtube.com/feeds/videos.xml?channel_id=UClq42foiSgl7sSpLupnugGA "~Youtube: D!NG" youtube +------ +https://www.youtube.com/feeds/videos.xml?channel_id=UC8butISFwT-Wl7EV0hUK0BQ "~Youtube: freeCodeCamp.org" youtube +https://www.youtube.com/feeds/videos.xml?channel_id=UCEbYhDd6c6vngsF5PQpFVWg "~Youtube: Tsoding" youtube +https://www.youtube.com/feeds/videos.xml?channel_id=UCd3dNckv1Za2coSaHGHl5aA "~Youtube: TJ DeVries" youtube +https://www.youtube.com/feeds/videos.xml?channel_id=UCAiiOTio8Yu69c3XnR7nQBQ "~Youtube: System Crafters" youtube +https://www.youtube.com/feeds/videos.xml?channel_id=UC5Qw7uMu8_QMJHBw3mQJ62w "~Youtube: Georges Basile Stavracas Neto" youtube diff --git a/home/.config/nnn/plugins/bulknew b/home/.config/nnn/plugins/bulknew new file mode 100755 index 0000000..4010662 --- /dev/null +++ b/home/.config/nnn/plugins/bulknew @@ -0,0 +1,32 @@ +#!/usr/bin/env sh + +# Description: Allows for creation of multiple files/directories at the same time. +# Plugin opens a temp file where each entry is to be written on a separate line +# +# Note: Only relative paths are supported. Absolute paths are ignored +# Leading and trailing whitespace in path names is also ignored +# +# Shell: POSIX compliant +# Author: KlzXS + +EDITOR="${EDITOR:-vi}" +TMPDIR="${TMPDIR:-/tmp}" + +printf "'f'ile / 'd'ir? " +read -r resp + +if [ "$resp" = "f" ]; then + #shellcheck disable=SC2016 + cmd='mkdir -p "$(dirname "{}")" && touch "{}"' +elif [ "$resp" = "d" ]; then + cmd='mkdir -p {}' +else + exit 1 +fi + +tmpfile=$(mktemp "$TMPDIR/.nnnXXXXXX") +$EDITOR "$tmpfile" + +sed "/^\//d" "$tmpfile" | xargs -n1 -I{} sh -c "$cmd" + +rm "$tmpfile" diff --git a/home/.config/nnn/plugins/chksum b/home/.config/nnn/plugins/chksum new file mode 100755 index 0000000..0a386e5 --- /dev/null +++ b/home/.config/nnn/plugins/chksum @@ -0,0 +1,66 @@ +#!/usr/bin/env sh + +# Description: Create and verify checksums +# +# For selection: it will generate one file containing the checksums with file names +# [and with paths if they are in another directory] +# the output checksum filename will be checksum_timestamp.checksum_type +# For file: if the file is a checksum, the plugin does the verification +# if the file is not a checksum, checksum will be generated for it +# the output checksum filename will be filename.checksum_type +# For directory: recursively calculates checksum for all the files in the directory +# the output checksum filename will be directory.checksum_type +# +# Shell: POSIX compliant +# Authors: ath3, Arun Prakash Jana + +selection=${NNN_SEL:-${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.selection} +resp=f +chsum=md5 + +checksum_type() +{ + echo "possible checksums: md5, sha1, sha224, sha256, sha384, sha512" + printf "create md5 (m), sha256 (s), sha512 (S) (or type one of the above checksums) [default=m]: " + read -r chsum_resp + for chks in md5 sha1 sha224 sha256 sha384 sha512 + do + if [ "$chsum_resp" = "$chks" ]; then + chsum=$chsum_resp + return + fi + done + if [ "$chsum_resp" = "s" ]; then + chsum=sha256 + elif [ "$chsum_resp" = "S" ]; then + chsum=sha512 + fi +} + +if [ -s "$selection" ]; then + printf "work with selection (s) or current file (f) [default=f]: " + read -r resp +fi + +if [ "$resp" = "s" ]; then + checksum_type + sed 's|'"$PWD/"'||g' < "$selection" | xargs -0 -I{} ${chsum}sum {} > "checksum_$(date '+%Y%m%d%H%M').$chsum" +elif [ -n "$1" ]; then + if [ -f "$1" ]; then + for chks in md5 sha1 sha224 sha256 sha384 sha512 + do + if echo "$1" | grep -q \.${chks}$; then + ${chks}sum -c < "$1" + read -r _ + return + fi + done + checksum_type + file=$(basename "$1").$chsum + ${chsum}sum "$1" > "$file" + elif [ -d "$1" ]; then + checksum_type + file=$(basename "$1").$chsum + find "$1" -type f -exec ${chsum}sum "{}" + > "$file" + fi +fi diff --git a/home/.config/nnn/plugins/dups b/home/.config/nnn/plugins/dups new file mode 100755 index 0000000..4f31fc6 --- /dev/null +++ b/home/.config/nnn/plugins/dups @@ -0,0 +1,15 @@ +#!/usr/bin/env sh + +# Description: List non-empty duplicate files in the current directory (based on size followed by MD5) +# +# Source: https://www.commandlinefu.com/commands/view/3555/find-duplicate-files-based-on-size-first-then-md5-hash +# +# Dependencies: find md5sum sort uniq xargs +# +# Shell: POSIX compliant +# Authors: syssyphus, KlzXS + +find . -size +0 -type f -printf "%s %p\n" | sort -rn | sed -n 'N; /^\([0-9]*\) .*\n\1.*$/p;$d;D' | awk '{printf("%s\0", substr($0, index($0, $2)))}' | xargs -0 md5sum | sort | uniq -w32 --all-repeated=separate + +printf "Press any key to exit" +read -r _ diff --git a/home/.config/nnn/plugins/fzcd b/home/.config/nnn/plugins/fzcd new file mode 100755 index 0000000..71d7cc1 --- /dev/null +++ b/home/.config/nnn/plugins/fzcd @@ -0,0 +1,22 @@ +#!/usr/bin/env sh + +# Description: Run fzf and go to the directory of the file selected +# +# Shell: POSIX compliant +# Author: Anna Arad + +. "$(dirname "$0")"/.nnn-plugin-helper + +if [ "$(cmd_exists fzf)" -eq "0" ]; then + sel=$(fd --type d --follow --hidden --exclude .git | fzf --preview 'tree -La 1 -C --dirsfirst {} 2>/dev/null') +else + exit 1 +fi + +if [ -n "$sel" ]; then + # Check if selected path returned by fzf command is absolute + case $sel in + /*) nnn_cd "$sel" ;; + *) nnn_cd "$PWD/$sel" ;; + esac +fi diff --git a/home/.config/nnn/plugins/fzz b/home/.config/nnn/plugins/fzz new file mode 100755 index 0000000..c715d00 --- /dev/null +++ b/home/.config/nnn/plugins/fzz @@ -0,0 +1,26 @@ +#!/usr/bin/env sh + +# Description: cd to any dir in the z database using an fzf pane +# +# Shell: POSIX compliant +# Author: Nick Waywood + +. "$(dirname "$0")"/.nnn-plugin-helper + +if which fzf >/dev/null 2>&1; then + fuzzy=fzf +else + exit 1 +fi + +datafile="${_ZL_DATA:-$HOME/.local/share/zlua/zlua}" +if [ -f "$datafile" ]; then + # I read the data from z's file instead of calling the z command so that the data doesn't need to be processed twice + sel=$(awk -F "|" '{print $1}' "$datafile" | "$fuzzy" | awk '{$1=$1};1') + # NOTE: Uncomment this line and comment out the line above if you want to see the weightings of the dir's in the fzf pane + # sel=$(awk -F "|" '{printf "%s %s\n", $2, $1}' "$datafile" | "$fuzzy" | sed 's/^[0-9,.]* *//' | awk '{$1=$1};1') +else + exit 1 +fi + +printf "%s" "0c$sel" > "$NNN_PIPE" diff --git a/home/.config/nnn/plugins/hexview b/home/.config/nnn/plugins/hexview new file mode 100755 index 0000000..ce17a60 --- /dev/null +++ b/home/.config/nnn/plugins/hexview @@ -0,0 +1,15 @@ +#!/usr/bin/env sh + +# Description: View a file in hex +# Dependencies: hx (https://github.com/krpors/hx)/xxd and $PAGER +# +# Shell: POSIX compliant +# Author: Arun Prakash Jana + +if ! [ -z "$1" ]; then + if which hx >/dev/null 2>&1; then + hx "$1" + else + xxd "$1" | $PAGER + fi +fi diff --git a/home/.config/nnn/plugins/nmount b/home/.config/nnn/plugins/nmount new file mode 100755 index 0000000..566119e --- /dev/null +++ b/home/.config/nnn/plugins/nmount @@ -0,0 +1,53 @@ +#!/usr/bin/env sh + +# Description: Toggle mount status of a device using pmount +# If the device is not mounted, it will be mounted. +# If the device is mounted, it will be unmounted and powered down. +# +# Runs `lsblk` if 'l' is entered, exits on 'Return`. +# +# Note: +# - The script uses Linux-specific lsblk to list block devices. Alternatives: +# macOS: "diskutil list" +# BSD: "geom disk list" +# - The script uses udisksctl (from udisks2) to pwoer down devices. This is also Linux-specific. +# Users on non-Linux platforms can comment it and use an alterntive to power-down disks. +# +# Shell: POSIX compliant +# Author: Arun Prakash Jana + +prompt="device name ['l' lists]: " + +lsblk + +printf "\nEnsure you aren't still in the mounted device.\n" +printf "%s" "$prompt" +read -r dev + +while ! [ -z "$dev" ] +do + if [ "$dev" = "l" ]; then + lsblk + elif [ "$dev" = "q" ]; then + exit + else + if grep -qs "$dev " /proc/mounts; then + sync + if pumount "$dev" + then + echo "$dev" unmounted. + if udisksctl power-off -b /dev/"$dev" + then + echo "$dev" ejected. + fi + fi + else + pmount "$dev" + echo "$dev" mounted to "$(lsblk -n /dev/"$dev" | rev | cut -d' ' -f1 | rev)". + fi + fi + + echo + printf "%s" "$prompt" + read -r dev +done diff --git a/home/.config/nnn/plugins/nuke b/home/.config/nnn/plugins/nuke new file mode 100755 index 0000000..f2abe65 --- /dev/null +++ b/home/.config/nnn/plugins/nuke @@ -0,0 +1,503 @@ +#!/usr/bin/env sh + +# ############################################################################# +# Description: Sample script to play files in apps by file type or mime +# +# Shell: POSIX compliant +# Usage: nuke filepath +# +# Integration with nnn: +# 1. Export the required config: +# export NNN_OPENER=/absolute/path/to/nuke +# # Otherwise, if nuke is in $PATH +# # export NNN_OPENER=nuke +# 2. Run nnn with the program option to indicate a CLI opener +# nnn -c +# # The -c program option overrides option -e +# 3. nuke can use nnn plugins (e.g. mocplay is used for audio), $PATH is updated. +# +# Details: +# Inspired by ranger's scope.sh, modified for usage with nnn. +# +# Guards against accidentally opening mime types like executables, shared libs etc. +# +# Tries to play 'file' (1st argument) in the following order: +# i. by extension +# ii. by mime (image, video, audio, pdf) +# iii. by mime (other file types) +# +# Modification tips: +# 1. Invokes CLI utilities by default. Set GUI to 1 to enable GUI apps. +# 2. PAGER is "less -R". +# 3. Start GUI apps in bg to unblock. Redirect stdout and strerr if required. +# 4. Some CLI utilities are piped to the $PAGER, to wait and quit uniformly. +# 5. If the output cannot be paged use "read -r _" to wait for user input. +# 6. On a DE, try 'xdg-open' or 'open' in handle_fallback() as last resort. +# +# Feel free to change the utilities to your favourites and add more mimes. +# +# Defaults: +# By extension (only the enabled ones): +# most archives: list with atool, bsdtar +# rar: list with unrar +# 7-zip: list with 7z +# pdf: zathura (GUI), pdftotext, mutool, exiftool +# audio: mocplay (nnn plugin using MOC), mpv, media_client (Haiku), mediainfo, exiftool +# avi|mkv|mp4: smplayer, mpv (GUI), ffmpegthumbnailer, mediainfo, exiftool +# log: vi +# torrent: rtorrent, transmission-show +# odt|ods|odp|sxw: odt2txt +# md: glow (https://github.com/charmbracelet/glow), lowdown (https://kristaps.bsd.lv/lowdown) +# htm|html|xhtml: w3m, lynx, elinks +# json: jq, python (json.tool module) +# Multimedia by mime: +# image/*: imv/sxiv (GUI), viu (https://github.com/atanunq/viu), img2txt, exiftool +# video/*: smplayer, mpv (GUI), ffmpegthumbnailer, mediainfo, exiftool +# audio/*: mocplay (nnn plugin using MOC), mpv, media_client (Haiku), mediainfo, exiftool +# application/pdf: zathura (GUI), pdftotext, mutool, exiftool +# Other mimes: +# text/troff: man -l +# text/* | */xml: vi +# image/vnd.djvu): djvutxt, exiftool +# +# ToDo: +# 1. Adapt, test and enable all mimes +# 2. Clean-up the unnecessary exit codes +# ############################################################################# + +# set to 1 to enable GUI apps +GUI="${GUI:-0}" + +set -euf -o noclobber -o noglob -o nounset +IFS="$(printf '%b_' '\n')"; IFS="${IFS%_}" # protect trailing \n + +PATH=$PATH:"${XDG_CONFIG_HOME:-$HOME/.config}/nnn/plugins" +IMAGE_CACHE_PATH="$(dirname "$1")"/.thumbs + +FPATH="$1" +FNAME=$(basename "$1") +EDITOR="${EDITOR:-vi}" +PAGER="${PAGER:-less -R}" +ext="${FNAME##*.}" +if ! [ -z "$ext" ]; then + ext="$(printf "%s" "${ext}" | tr '[:upper:]' '[:lower:]')" +fi + +handle_pdf() { + if [ "$GUI" -ne 0 ] && which zathura >/dev/null 2>&1; then + zathura "${FPATH}" >/dev/null 2>&1 & + exit 0 + elif which pdftotext >/dev/null 2>&1; then + ## Preview as text conversion + pdftotext -l 10 -nopgbrk -q -- "${FPATH}" - | eval "$PAGER" + exit 0 + elif which mutool >/dev/null 2>&1; then + mutool draw -F txt -i -- "${FPATH}" 1-10 | eval "$PAGER" + exit 0 + elif which exiftool >/dev/null 2>&1; then + exiftool "${FPATH}" | eval "$PAGER" + exit 0 + fi +} + +handle_audio() { + if which mocp >/dev/null 2>&1 && which mocplay >/dev/null 2>&1; then + mocplay "${FPATH}" "opener" >/dev/null 2>&1 + exit 0 + elif which mpv >/dev/null 2>&1; then + mpv "${FPATH}" >/dev/null 2>&1 & + exit 0 + elif which media_client >/dev/null 2>&1; then + media_client play "${FPATH}" >/dev/null 2>&1 & + exit 0 + elif which mediainfo >/dev/null 2>&1; then + mediainfo "${FPATH}" | eval "$PAGER" + exit 0 + elif which exiftool >/dev/null 2>&1; then + exiftool "${FPATH}"| eval "$PAGER" + exit 0 + fi +} + +handle_video() { + if [ "$GUI" -ne 0 ] && which smplayer >/dev/null 2>&1; then + smplayer "${FPATH}" >/dev/null 2>&1 & + exit 0 + elif [ "$GUI" -ne 0 ] && which mpv >/dev/null 2>&1; then + mpv "${FPATH}" >/dev/null 2>&1 & + exit 0 + elif which ffmpegthumbnailer >/dev/null 2>&1; then + # Thumbnail + [ -d "${IMAGE_CACHE_PATH}" ] || mkdir "${IMAGE_CACHE_PATH}" + ffmpegthumbnailer -i "${FPATH}" -o "${IMAGE_CACHE_PATH}/${FNAME}.jpg" -s 0 + viu -n "${IMAGE_CACHE_PATH}/${FNAME}.jpg" | eval "$PAGER" + exit 0 + elif which mediainfo >/dev/null 2>&1; then + mediainfo "${FPATH}" | eval "$PAGER" + exit 0 + elif which exiftool >/dev/null 2>&1; then + exiftool "${FPATH}"| eval "$PAGER" + exit 0 + fi +} + +# handle this extension and exit +handle_extension() { + case "${ext}" in + ## Archive + a|ace|alz|arc|arj|bz|bz2|cab|cpio|deb|gz|jar|lha|lz|lzh|lzma|lzo|\ + rpm|rz|t7z|tar|tbz|tbz2|tgz|tlz|txz|tZ|tzo|war|xpi|xz|Z|zip) + if which atool >/dev/null 2>&1; then + atool --list -- "${FPATH}" | eval "$PAGER" + exit 0 + elif which bsdtar >/dev/null 2>&1; then + bsdtar --list --file "${FPATH}" | eval "$PAGER" + exit 0 + fi + exit 1;; + rar) + if which unrar >/dev/null 2>&1; then + ## Avoid password prompt by providing empty password + unrar lt -p- -- "${FPATH}" | eval "$PAGER" + fi + exit 1;; + 7z) + if which 7z >/dev/null 2>&1; then + ## Avoid password prompt by providing empty password + 7z l -p -- "${FPATH}" | eval "$PAGER" + exit 0 + fi + exit 1;; + + ## PDF + pdf) + handle_pdf + exit 1;; + + ## Audio + aac|flac|m4a|mid|midi|mpa|mp2|mp3|ogg|wav|wma) + handle_audio + exit 1;; + + ## Video + avi|mkv|mp4) + handle_video + exit 1;; + + ## Log files + log) + "$EDITOR" "${FPATH}" + exit 0;; + + ## BitTorrent + torrent) + if which rtorrent >/dev/null 2>&1; then + rtorrent "${FPATH}" + exit 0 + elif which transmission-show >/dev/null 2>&1; then + transmission-show -- "${FPATH}" + exit 0 + fi + exit 1;; + + ## OpenDocument + odt|ods|odp|sxw) + if which odt2txt >/dev/null 2>&1; then + ## Preview as text conversion + odt2txt "${FPATH}" | eval "$PAGER" + exit 0 + fi + exit 1;; + + ## Markdown + md) + if which glow >/dev/null 2>&1; then + glow -sdark "${FPATH}" | eval "$PAGER" + exit 0 + elif which lowdown >/dev/null 2>&1; then + lowdown -Tterm "${FPATH}" | eval "$PAGER" + exit 0 + fi + ;; + + ## HTML + htm|html|xhtml) + ## Preview as text conversion + if which w3m >/dev/null 2>&1; then + w3m -dump "${FPATH}" | eval "$PAGER" + exit 0 + elif which lynx >/dev/null 2>&1; then + lynx -dump -- "${FPATH}" | eval "$PAGER" + exit 0 + elif which elinks >/dev/null 2>&1; then + elinks -dump "${FPATH}" | eval "$PAGER" + exit 0 + fi + ;; + + ## JSON + json) + if which jq >/dev/null 2>&1; then + jq --color-output . "${FPATH}" | eval "$PAGER" + exit 0 + elif which python >/dev/null 2>&1; then + python -m json.tool -- "${FPATH}" | eval "$PAGER" + exit 0 + fi + ;; + esac +} + +abspath() { + case "$1" in + /*) printf "%s\n" "$1";; + *) printf "%s\n" "$PWD/$1";; + esac +} + +listimages() { + find -L "$(dirname "$target")" -maxdepth 1 -type f -iregex \ + '.*\(jpe?g\|bmp\|webp\|png\|gif\)$' -print0 | sort -z +} + +load_dir() { + target="$(abspath "$2")" + count="$(listimages | grep -a -m 1 -ZznF "$target" | cut -d: -f1)" + + if [ -n "$count" ]; then + listimages | xargs -0 "$1" -n "$count" -- + else + shift + "$1" -- "$@" # fallback + fi +} + +handle_multimedia() { + ## Size of the preview if there are multiple options or it has to be + ## rendered from vector graphics. If the conversion program allows + ## specifying only one dimension while keeping the aspect ratio, the width + ## will be used. + # local DEFAULT_SIZE="1920x1080" + + mimetype="${1}" + case "${mimetype}" in + ## SVG + # image/svg+xml|image/svg) + # convert -- "${FPATH}" "${IMAGE_CACHE_PATH}" && exit 6 + # exit 1;; + + ## DjVu + # image/vnd.djvu) + # ddjvu -format=tiff -quality=90 -page=1 -size="${DEFAULT_SIZE}" \ + # - "${IMAGE_CACHE_PATH}" < "${FPATH}" \ + # && exit 6 || exit 1;; + + ## Image + image/*) + if [ "$GUI" -ne 0 ] && which imvr >/dev/null 2>&1; then + load_dir imvr "${FPATH}" >/dev/null 2>&1 & + exit 0 + elif [ "$GUI" -ne 0 ] && which sxiv >/dev/null 2>&1; then + load_dir sxiv "${FPATH}" >/dev/null 2>&1 & + exit 0 + elif which viu >/dev/null 2>&1; then + viu -n "${FPATH}" | eval "$PAGER" + exit 0 + elif which img2txt >/dev/null 2>&1; then + img2txt --gamma=0.6 -- "${FPATH}" | eval "$PAGER" + exit 0 + elif which exiftool >/dev/null 2>&1; then + exiftool "${FPATH}" | eval "$PAGER" + exit 0 + fi + # local orientation + # orientation="$( identify -format '%[EXIF:Orientation]\n' -- "${FPATH}" )" + ## If orientation data is present and the image actually + ## needs rotating ("1" means no rotation)... + # if [[ -n "$orientation" && "$orientation" != 1 ]]; then + ## ...auto-rotate the image according to the EXIF data. + # convert -- "${FPATH}" -auto-orient "${IMAGE_CACHE_PATH}" && exit 6 + # fi + + ## `w3mimgdisplay` will be called for all images (unless overridden + ## as above), but might fail for unsupported types. + exit 7;; + + ## PDF + application/pdf) + handle_pdf + exit 1;; + + ## Audio + audio/*) + handle_audio + exit 1;; + + ## Video + video/*) + handle_video + exit 1;; + + # pdftoppm -f 1 -l 1 \ + # -scale-to-x "${DEFAULT_SIZE%x*}" \ + # -scale-to-y -1 \ + # -singlefile \ + # -jpeg -tiffcompression jpeg \ + # -- "${FPATH}" "${IMAGE_CACHE_PATH%.*}" \ + # && exit 6 || exit 1;; + + + ## ePub, MOBI, FB2 (using Calibre) + # application/epub+zip|application/x-mobipocket-ebook|\ + # application/x-fictionbook+xml) + # # ePub (using https://github.com/marianosimone/epub-thumbnailer) + # epub-thumbnailer "${FPATH}" "${IMAGE_CACHE_PATH}" \ + # "${DEFAULT_SIZE%x*}" && exit 6 + # ebook-meta --get-cover="${IMAGE_CACHE_PATH}" -- "${FPATH}" \ + # >/dev/null && exit 6 + # exit 1;; + + ## Font + # application/font*|application/*opentype) + # preview_png="/tmp/$(basename "${IMAGE_CACHE_PATH%.*}").png" + # if fontimage -o "${preview_png}" \ + # --pixelsize "120" \ + # --fontname \ + # --pixelsize "80" \ + # --text " ABCDEFGHIJKLMNOPQRSTUVWXYZ " \ + # --text " abcdefghijklmnopqrstuvwxyz " \ + # --text " 0123456789.:,;(*!?') ff fl fi ffi ffl " \ + # --text " The quick brown fox jumps over the lazy dog. " \ + # "${FPATH}"; + # then + # convert -- "${preview_png}" "${IMAGE_CACHE_PATH}" \ + # && rm "${preview_png}" \ + # && exit 6 + # else + # exit 1 + # fi + # ;; + + ## Preview archives using the first image inside. + ## (Very useful for comic book collections for example.) + # application/zip|application/x-rar|application/x-7z-compressed|\ + # application/x-xz|application/x-bzip2|application/x-gzip|application/x-tar) + # local fn=""; local fe="" + # local zip=""; local rar=""; local tar=""; local bsd="" + # case "${mimetype}" in + # application/zip) zip=1 ;; + # application/x-rar) rar=1 ;; + # application/x-7z-compressed) ;; + # *) tar=1 ;; + # esac + # { [ "$tar" ] && fn=$(tar --list --file "${FPATH}"); } || \ + # { fn=$(bsdtar --list --file "${FPATH}") && bsd=1 && tar=""; } || \ + # { [ "$rar" ] && fn=$(unrar lb -p- -- "${FPATH}"); } || \ + # { [ "$zip" ] && fn=$(zipinfo -1 -- "${FPATH}"); } || return + # + # fn=$(echo "$fn" | python -c "import sys; import mimetypes as m; \ + # [ print(l, end='') for l in sys.stdin if \ + # (m.guess_type(l[:-1])[0] or '').startswith('image/') ]" |\ + # sort -V | head -n 1) + # [ "$fn" = "" ] && return + # [ "$bsd" ] && fn=$(printf '%b' "$fn") + # + # [ "$tar" ] && tar --extract --to-stdout \ + # --file "${FPATH}" -- "$fn" > "${IMAGE_CACHE_PATH}" && exit 6 + # fe=$(echo -n "$fn" | sed 's/[][*?\]/\\\0/g') + # [ "$bsd" ] && bsdtar --extract --to-stdout \ + # --file "${FPATH}" -- "$fe" > "${IMAGE_CACHE_PATH}" && exit 6 + # [ "$bsd" ] || [ "$tar" ] && rm -- "${IMAGE_CACHE_PATH}" + # [ "$rar" ] && unrar p -p- -inul -- "${FPATH}" "$fn" > \ + # "${IMAGE_CACHE_PATH}" && exit 6 + # [ "$zip" ] && unzip -pP "" -- "${FPATH}" "$fe" > \ + # "${IMAGE_CACHE_PATH}" && exit 6 + # [ "$rar" ] || [ "$zip" ] && rm -- "${IMAGE_CACHE_PATH}" + # ;; + esac +} + +handle_mime() { + mimetype="${1}" + case "${mimetype}" in + ## Manpages + text/troff) + man -l "${FPATH}" + exit 0;; + + ## Text + text/* | */xml) + "$EDITOR" "${FPATH}" + exit 0;; + ## Syntax highlight + # if [[ "$( stat --printf='%s' -- "${FPATH}" )" -gt "${HIGHLIGHT_SIZE_MAX}" ]]; then + # exit 2 + # fi + # if [[ "$( tput colors )" -ge 256 ]]; then + # local pygmentize_format='terminal256' + # local highlight_format='xterm256' + # else + # local pygmentize_format='terminal' + # local highlight_format='ansi' + # fi + # env HIGHLIGHT_OPTIONS="${HIGHLIGHT_OPTIONS}" highlight \ + # --out-format="${highlight_format}" \ + # --force -- "${FPATH}" && exit 5 + # pygmentize -f "${pygmentize_format}" -O "style=${PYGMENTIZE_STYLE}"\ + # -- "${FPATH}" && exit 5 + # exit 2;; + + ## DjVu + image/vnd.djvu) + if which djvutxt >/dev/null 2>&1; then + ## Preview as text conversion (requires djvulibre) + djvutxt "${FPATH}" | eval "$PAGER" + exit 0 + elif which exiftool >/dev/null 2>&1; then + exiftool "${FPATH}" | eval "$PAGER" + exit 0 + fi + exit 1;; + esac +} + +handle_fallback() { + if [ "$GUI" -ne 0 ] && which xdg-open >/dev/null 2>&1; then + xdg-open "${FPATH}" >/dev/null 2>&1 & + exit 0 + elif [ "$GUI" -ne 0 ] && which open >/dev/null 2>&1; then + open "${FPATH}" >/dev/null 2>&1 & + exit 0 + fi + + echo '----- File details -----' && file --dereference --brief -- "${FPATH}" + exit 1 +} + +handle_blocked() { + case "${MIMETYPE}" in + application/x-sharedlib) + exit 0;; + + application/x-shared-library-la) + exit 0;; + + application/x-executable) + exit 0;; + + application/x-shellscript) + exit 0;; + + application/octet-stream) + exit 0;; + esac +} + +MIMETYPE="$( file --dereference --brief --mime-type -- "${FPATH}" )" +handle_extension +handle_multimedia "${MIMETYPE}" +handle_mime "${MIMETYPE}" +handle_blocked "${MIMETYPE}" +handle_fallback + +exit 1 diff --git a/home/.config/nnn/plugins/organize b/home/.config/nnn/plugins/organize new file mode 100755 index 0000000..3fb34c1 --- /dev/null +++ b/home/.config/nnn/plugins/organize @@ -0,0 +1,53 @@ +#!/usr/bin/env sh + +# Description: Organize files in directories by category +# +# Shell: POSIX compliant +# Author: th3lusive + +organize() { + case "$(file -biL "$1")" in + *video*) + [ ! -d "Videos" ] && mkdir "Videos" + mv "$1" "Videos/$1" + printf "Moved %s to Videos\n" "$1" ;; + + *audio*) [ ! -d "Audio" ] && mkdir "Audio" + mv "$1" "Audio/$1" + printf "Moved %s to Audio\n" "$1" ;; + + *image*) + [ ! -d "Images" ] && mkdir "Images" + mv "$1" "Images/$1" + printf "Moved %s to Images\n" "$1" ;; + + *pdf*|*document*|*epub*|*djvu*|*cb*) + [ ! -d "Documents" ] && mkdir "Documents" + mv "$1" "Documents/$1" + printf "Moved %s to Documents\n" "$1" ;; + + *text*) + [ ! -d "Plaintext" ] && mkdir "Plaintext" + mv "$1" "Plaintext/$1" + printf "Moved %s to Plaintext\n" "$1" ;; + + *tar*|*xz*|*compress*|*7z*|*rar*|*zip*) + [ ! -d "Archives" ] && mkdir "Archives" + mv "$1" "Archives/$1" + printf "Moved %s to Archives\n" "$1" ;; + + *binary*) + [ ! -d "Binaries" ] && mkdir "Binaries" + mv "$1" "Binaries/$1" + printf "Moved %s to Binaries\n" "$1" ;; + esac +} + +main() { + for file in * + do + [ -f "$file" ] && organize "$file" + done +} + +main "$@" diff --git a/home/.config/nnn/plugins/pdfview b/home/.config/nnn/plugins/pdfview new file mode 100755 index 0000000..2b953b5 --- /dev/null +++ b/home/.config/nnn/plugins/pdfview @@ -0,0 +1,24 @@ +#!/usr/bin/env sh + +# Description: View a PDF file in pager +# +# Notes: +# - $PAGER must be 'less -R' or 'most' +# - To use mutool, uncomment the relevant lines and comment the pdftotext line +# +# Shell: POSIX compliant +# Author: Arun Prakash Jana + +if ! [ -z "$1" ]; then + if [ "$(head -c 4 "$1")" = "%PDF" ]; then + # Convert using pdftotext + pdftotext -nopgbrk -layout "$1" - | sed 's/\xe2\x80\x8b//g' | $PAGER + + # Convert using mutool + # file=`basename "$1"` + # txt=/tmp/"$file".txt + # mutool convert -o "$txt" "$1" + # eval $PAGER $txt + # rm "$txt" + fi +fi diff --git a/home/.config/nnn/plugins/preview-tui b/home/.config/nnn/plugins/preview-tui new file mode 100755 index 0000000..8dcdb3c --- /dev/null +++ b/home/.config/nnn/plugins/preview-tui @@ -0,0 +1,231 @@ +#!/usr/bin/env sh + +# Description: Terminal based file previewer +# +# Note: This plugin needs a "NNN_FIFO" to work. See man. +# +# Dependencies: +# - Supports 3 independent methods to preview with: +# - tmux (>=3.0), or +# - kitty with allow_remote_control on, or +# - $TERMINAL set to a terminal (it's xterm by default). +# - less or $PAGER +# - tree or exa or ls +# - mediainfo or file +# - mktemp +# - unzip +# - tar +# - man +# - optional: bat for code syntax highlighting +# - optional: kitty terminal or catimg for images +# - optional: scope.sh file viewer from ranger. +# To use: +# 1. drop scope.sh executable in $PATH +# 2. set/export $USE_SCOPE as 1 +# - optional: pistol file viewer (https://github.com/doronbehar/pistol). +# To use: +# 1. install pistol +# 2. set/export $USE_PISTOL as 1 +# +# Usage: +# You need to set a NNN_FIFO path and a key for the plugin with NNN_PLUG, +# then start `nnn`: +# +# $ nnn -a +# +# or +# +# $ NNN_FIFO=/tmp/nnn.fifo nnn +# +# Then in `nnn`, launch the `preview-tui` plugin. +# +# If you provide the same NNN_FIFO to all nnn instances, there will be a +# single common preview window. If you provide different FIFO path (e.g. +# with -a), they will be independent. +# +# The previews will be shown in a tmux split. If that isn't possible, it +# will try to use a kitty terminal split. And as a final fallback, a +# different terminal window will be used ($TERMINAL). +# +# Tmux and kitty users can configure $SPLIT to either "h" or "v" to set a +# 'h'orizontal split or a 'v'ertical split (as in, the line that splits the +# windows will be horizontal or vertical). +# +# Kitty users need `allow_remote_control` set to `yes`. To customize the +# window split, `enabled_layouts` has to be set to `all` or `splits` (the +# former is the default value). This terminal is also able to show images +# without extra dependencies. +# +# Shell: POSIX compliant +# Authors: Todd Yamakawa, Léo Villeveygoux, @Recidiviste, Mario Ortiz Manero + +SPLIT="$SPLIT" # you can set a permanent split here +TERMINAL="$TERMINAL" # same goes for the terminal +USE_SCOPE="${USE_SCOPE:-0}" +USE_PISTOL="${USE_PISTOL:-0}" +PAGER="${PAGER:-less -R}" +[ "$PAGER" = "most" ] && PAGER="less -R" + +if [ -e "${TMUX%%,*}" ] && tmux -V | grep -q '[ -][3456789]\.'; then + TERMINAL=tmux +elif [ -n "$KITTY_WINDOW_ID" ] && kitty @ ls >/dev/null 2>&1; then + TERMINAL=kitty +else + TERMINAL="${TERMINAL:-xterm}" +fi + +if [ -z "$SPLIT" ] && [ $(($(tput lines) * 2)) -gt "$(tput cols)" ]; then + SPLIT='h' +elif [ "$SPLIT" != 'h' ]; then + SPLIT='v' +fi + +exists() { + command -v "$1" >/dev/null 2>&1 +} + +fifo_pager() { + cmd="$1" + shift + + # We use a FIFO to access $PAGER PID in jobs control + tmpfifopath="${TMPDIR:-/tmp}/nnn-preview-tui-fifo.$$" + mkfifo "$tmpfifopath" || return + + $PAGER < "$tmpfifopath" & + + ( + exec > "$tmpfifopath" + "$cmd" "$@" & + ) + + rm "$tmpfifopath" +} + +# Binary file: show file info inside the pager +print_bin_info() { + printf -- "-------- \033[1;31mBinary file\033[0m --------\n" + if exists mediainfo; then + mediainfo "$1" 2>/dev/null + else + file -b "$1" + fi +} + +preview_file () { + kill %- %+ 2>/dev/null && wait %- %+ 2>/dev/null + clear + + # Trying to use pistol if it's available. + if [ "$USE_PISTOL" -ne 0 ] && exists pistol; then + fifo_pager pistol "$1" + return + fi + + # Trying to use scope.sh if it's available. + if [ "$USE_SCOPE" -ne 0 ] && exists scope.sh; then + fifo_pager scope.sh "$1" "$cols" "$lines" "$(mktemp -d)" \ + "True" 2>/dev/null + return + fi + + # Detecting the exact type of the file: the encoding, mime type, and + # extension in lowercase. + encoding="$(file -Lb --mime-encoding -- "$1")" + mimetype="$(file -Lb --mime-type -- "$1")" + ext="${1##*.}" + if [ -n "$ext" ]; then + ext="$(printf "%s" "${ext}" | tr '[:upper:]' '[:lower:]')" + fi + lines=$(($(tput lines)-1)) + cols=$(tput cols) + + # Otherwise, falling back to the defaults. + if [ -d "$1" ]; then + cd "$1" || return + if exists tree; then + fifo_pager tree -L 3 -F + elif exists exa; then + fifo_pager exa -G --colour=always 2>/dev/null + else + fifo_pager ls --color=always + fi + elif [ "$encoding" = "binary" ]; then + if [ "${mimetype%%/*}" = "image" ] ; then + if [ "$TERMINAL" = "kitty" ]; then + # Kitty terminal users can use the native image preview method. + kitty +kitten icat --silent --transfer-mode=stream --stdin=no \ + "$1" & + elif exists catimg; then + catimg "$1" + elif exists viu; then + viu -t "$1" + else + fifo_pager print_bin_info "$1" + fi + elif [ "$mimetype" = "application/zip" ] ; then + fifo_pager unzip -l "$1" + elif [ "$ext" = "gz" ] || [ "$ext" = "bz2" ] ; then + fifo_pager tar -tvf "$1" + else + fifo_pager print_bin_info "$1" + fi + elif [ "$mimetype" = "text/troff" ] ; then + fifo_pager man -Pcat -l "$1" + else + if exists bat; then + fifo_pager bat --terminal-width="$cols" --paging=never --decorations=always --color=always \ + "$1" 2>/dev/null + else + $PAGER "$1" & + fi + fi +} + +if [ "$PREVIEW_MODE" ] ; then + if [ ! -r "$NNN_FIFO" ] ; then + echo "No FIFO available! (\$NNN_FIFO='$NNN_FIFO')" >&2 + read -r + exit 1 + fi + + preview_file "$1" + + # use cat instead of 'exec <' to avoid issues with dash shell + # shellcheck disable=SC2002 + cat "$NNN_FIFO" |\ + while read -r selection ; do + preview_file "$selection" + done + + # Restoring the previous layout for kitty users. This will only work for + # kitty >= 0.18.0. + if [ "$TERMINAL" = "kitty" ]; then + kitty @ last-used-layout --no-response >/dev/null 2>&1 + fi + + exit 0 +fi + +if [ "$TERMINAL" = "tmux" ]; then + # tmux splits are inverted + if [ "$SPLIT" = "v" ]; then SPLIT="h"; else SPLIT="v"; fi + + tmux split-window -e "NNN_FIFO=$NNN_FIFO" -e "PREVIEW_MODE=1" -d"$SPLIT" "$0" "$1" +elif [ "$TERMINAL" = "kitty" ]; then + # Setting the layout for the new window. It will be restored after the + # script ends. + kitty @ goto-layout splits >/dev/null + + # Trying to use kitty's integrated window management as the split window. + # All environmental variables that will be used in the new window must + # be explicitly passed. + kitty @ launch --no-response --title "nnn preview" --keep-focus \ + --cwd "$PWD" --env "PATH=$PATH" --env "NNN_FIFO=$NNN_FIFO" \ + --env "PREVIEW_MODE=1" --env "PAGER=$PAGER" \ + --env "USE_SCOPE=$USE_SCOPE" --env "SPLIT=$SPLIT" \ + --env "USE_PISTOL=$USE_PISTOL" \ + --location "${SPLIT}split" "$0" "$1" >/dev/null +else + PREVIEW_MODE=1 $TERMINAL -e "$0" "$1" & +fi diff --git a/home/.config/nnn/plugins/suedit b/home/.config/nnn/plugins/suedit new file mode 100755 index 0000000..7598525 --- /dev/null +++ b/home/.config/nnn/plugins/suedit @@ -0,0 +1,21 @@ +#!/usr/bin/env sh + +# Description: Edit file as superuser +# +# Shell: POSIX compliant +# Author: Anna Arad + +EDITOR="${EDITOR:-vim}" + +is_cmd_exists () { + which "$1" > /dev/null 2>&1 + echo $? +} + +if [ "$(is_cmd_exists sudo)" -eq "0" ]; then + sudo "$EDITOR" "$1" +elif [ "$(is_cmd_exists sudoedit)" -eq "0" ]; then + sudoedit "$1" +elif [ "$(is_cmd_exists doas)" -eq "0" ]; then + doas "$EDITOR" "$1" +fi diff --git a/home/.config/npm/npmrc b/home/.config/npm/npmrc new file mode 100644 index 0000000..df79dd4 --- /dev/null +++ b/home/.config/npm/npmrc @@ -0,0 +1,3 @@ +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/coc-settings.json b/home/.config/nvim/coc-settings.json new file mode 100644 index 0000000..6312fef --- /dev/null +++ b/home/.config/nvim/coc-settings.json @@ -0,0 +1,120 @@ +{ + "diagnostic.displayByAle": true, + "suggest.noselect": false, + "suggest.echodocSupport": true, + "suggest.completionItemKindLabels": { + "function": " ", + "method": " ", + "variable": " ", + "field": " ", + "class": " ", + "struct": " ", + "interface": "謁", + "module": " ", + "property": " ", + "value": " ", + "enum": " ", + "enumMember": " ", + "reference": " ", + "keyword": " ", + "color": " ", + "unit": " ", + "snippet": " ", + "text": "荒", + "file": " ", + "event": " ", + "folder": " ", + "constant": " ", + "operator": " ", + "typeParameter": " ", + "default": " " + }, + "coc.preferences.hoverTarget": "float", + "coc.preferences.formatOnSaveFiletypes": [ + "markdown", + "html", + "yaml", + "css", + "javascript", + "typescript", + "typescriptreact", + "javascriptreact", + "json", + "java", + "graphql" + ], + "list.indicator": ">", + "list.selectedSignText": " ", + "emmet.includeLanguages": { + "vue-html": "html", + "javascript": "javascriptreact" + }, + "explorer.width": 30, + "explorer.icon.enableNerdfont": true, + "explorer.previewAction.onHover": false, + "explorer.icon.enableVimDevicons": false, + "explorer.file.showHiddenFiles": true, + "explorer.buffer.showHiddenBuffers": true, + "explorer.keyMappings.global": { + "": [ + "expandable?", + [ + "expanded?", + "collapse", + "expand" + ], + "open" + ], + "o": [ + "expandable?", + [ + "expanded?", + "collapse", + "expand" + ], + "open" + ] + }, + "coc-actions.useCursorLine": true, + "python.venvPath": "~/.local/share/pyenv/versions", + "python.pythonPath": "python3", + "python.linting.enabled": true, + "python.linting.banditEnabled": true, + "clangd.arguments": [ + "-j=3", + "--background-index", + "--clang-tidy", + "--completion-style=detailed", + "--pch-storage=memory", + "--header-insertion=iwyu", + "--header-insertion-decorators" + ], + "clangd.semanticHighlighting": true, + "languageserver": { + "ccls": { + "command": "ccls", + "filetypes": [ + "c", + "cc", + "cpp", + "c++", + "objc", + "objcpp" + ], + "rootPatterns": [ + ".ccls", + "compile_commands.json", + ".git/", + ".hg/" + ], + "initializationOptions": { + "cache": { + "directory": "/tmp/ccls" + }, + "highlight": { + "lsRanges": true + } + } + } + } +} diff --git a/home/.config/nvim/ftplugin/markdown.vim b/home/.config/nvim/ftplugin/markdown.vim new file mode 100644 index 0000000..265dd39 --- /dev/null +++ b/home/.config/nvim/ftplugin/markdown.vim @@ -0,0 +1,2 @@ +setlocal wrap +" setlocal nonumber norelativenumber diff --git a/home/.config/nvim/ftplugin/tex.vim b/home/.config/nvim/ftplugin/tex.vim new file mode 100644 index 0000000..265dd39 --- /dev/null +++ b/home/.config/nvim/ftplugin/tex.vim @@ -0,0 +1,2 @@ +setlocal wrap +" setlocal nonumber norelativenumber diff --git a/home/.config/nvim/ftplugin/vimwiki.vim b/home/.config/nvim/ftplugin/vimwiki.vim new file mode 100644 index 0000000..5dd7f57 --- /dev/null +++ b/home/.config/nvim/ftplugin/vimwiki.vim @@ -0,0 +1,10 @@ +" setlocal nonumber norelativenumber +setlocal wrap + +" Give me back my Tab and Return!! +inoremap + \ pumvisible() ? "\" : + \ coc#expandableOrJumpable() ? "\=coc#rpc#request('doKeymap', ['snippets-expand-jump',''])\" : + \ check_back_space() ? "\" : + \ coc#refresh() +inoremap pumvisible() ? "\" : "\" diff --git a/home/.config/nvim/general/basic-settings.vim b/home/.config/nvim/general/basic-settings.vim new file mode 100644 index 0000000..1b4ab85 --- /dev/null +++ b/home/.config/nvim/general/basic-settings.vim @@ -0,0 +1,59 @@ +" ______ _____ +" ___ /_______ __________(_)______ +" __ __ \ __ `/_ ___/_ /_ ___/ +" _ /_/ / /_/ /_(__ )_ / / /__ +" /_.___/\__,_/ /____/ /_/ \___/ +" +syntax on +filetype indent plugin on +if &term =~ '256color' + set t_ut= +endif +if has('termguicolors') + set termguicolors +else + set t_Co=256 +endif +set background=dark +set guifont=Iosevka\ Nerd\ Font +set noerrorbells +set noshowmode +set encoding=utf-8 +set fileencoding=utf-8 +set iskeyword+=- " treat - as part of a word +set formatoptions-=cro +set clipboard+=unnamedplus +set number relativenumber +" set cursorline +set tabstop=2 softtabstop=2 " 2 spaces for 1 tab +set shiftwidth=2 " 2 spaces for 1 indent +set smarttab +set expandtab " convert tabs to spaces +set smartindent +set autoindent +set splitbelow splitright +set nowrap +set whichwrap+=<,>,[,] ",h,l " wrap lines on h,l,arrows +set mouse=a +set ignorecase smartcase +set incsearch nohlsearch +set laststatus=2 +set ruler +set noswapfile +set showtabline=2 +set conceallevel=1 +set pumheight=12 " height for completion box +set wildmenu +set wildmode=full + +" POSIX compatible (bash is not truly ideal but ...) +if &shell =~# 'fish$' + set shell=bash +endif + +" Search files recursively +set path=.,,** + +let mapleader = "\" +let g:netrw_banner = 0 +let g:python3_host_prog = '/usr/bin/python3' diff --git a/home/.config/nvim/init.vim b/home/.config/nvim/init.vim new file mode 100644 index 0000000..45c2f46 --- /dev/null +++ b/home/.config/nvim/init.vim @@ -0,0 +1,49 @@ +" Basic settings +source $HOME/.config/nvim/general/basic-settings.vim + +" polyglot_disabled needs to be set before polyglot being loaded (-_-) +source $HOME/.config/nvim/plug-config/polyglot.vim + +" Now load plugins +source $HOME/.config/nvim/vim-plug/vim-plug.vim + +" Load vim plugins' settings +source $HOME/.config/nvim/plug-config/moving.vim " Quickscope colors need to be loaded before setting colorscheme +source $HOME/.config/nvim/plug-config/colorscheme.vim " Load theme first, then everything else +" source $HOME/.config/nvim/plug-config/airline.vim +source $HOME/.config/nvim/plug-config/ale.vim +source $HOME/.config/nvim/plug-config/cheat_sh.vim +source $HOME/.config/nvim/plug-config/choosewin.vim +source $HOME/.config/nvim/plug-config/closetag.vim +source $HOME/.config/nvim/plug-config/coc.vim +source $HOME/.config/nvim/plug-config/dashboard.vim +source $HOME/.config/nvim/plug-config/delimitMate.vim +source $HOME/.config/nvim/plug-config/doc.vim +source $HOME/.config/nvim/plug-config/doge.vim +source $HOME/.config/nvim/plug-config/easy-align.vim +source $HOME/.config/nvim/plug-config/emmet.vim +source $HOME/.config/nvim/plug-config/far.vim +source $HOME/.config/nvim/plug-config/floaterm.vim +source $HOME/.config/nvim/plug-config/fzf.vim +source $HOME/.config/nvim/plug-config/git.vim +source $HOME/.config/nvim/plug-config/goyo.vim +source $HOME/.config/nvim/plug-config/illuminate.vim +source $HOME/.config/nvim/plug-config/indentline.vim +" source $HOME/.config/nvim/plug-config/nerdtree.vim +" source $HOME/.config/nvim/plug-config/nnn.vim +source $HOME/.config/nvim/plug-config/rainbow.vim +source $HOME/.config/nvim/plug-config/rnvimr.vim +source $HOME/.config/nvim/plug-config/rooter.vim +source $HOME/.config/nvim/plug-config/spaceline.vim +" source $HOME/.config/nvim/plug-config/startify.vim +source $HOME/.config/nvim/plug-config/tablemode.vim +source $HOME/.config/nvim/plug-config/translator.vim +source $HOME/.config/nvim/plug-config/undo.vim +source $HOME/.config/nvim/plug-config/vim-buffet.vim +source $HOME/.config/nvim/plug-config/vimwiki.vim +source $HOME/.config/nvim/plug-config/vista.vim +source $HOME/.config/nvim/plug-config/which-key.vim +source $HOME/.config/nvim/plug-config/whitespace.vim + +" Load lua plugins' settings +lua require('_colorizer') diff --git a/home/.config/nvim/lua/_colorizer.lua b/home/.config/nvim/lua/_colorizer.lua new file mode 100644 index 0000000..a3bbfd3 --- /dev/null +++ b/home/.config/nvim/lua/_colorizer.lua @@ -0,0 +1,13 @@ +require 'colorizer'.setup( + {'*';}, + { + RGB = true; -- #RGB hex codes + RRGGBB = true; -- #RRGGBB hex codes + names = true; -- "Name" codes like Blue + RRGGBBAA = true; -- #RRGGBBAA hex codes + rgb_fn = true; -- CSS rgb() and rgba() functions + hsl_fn = true; -- CSS hsl() and hsla() functions + css = true; -- Enable all CSS features: rgb_fn, hsl_fn, names, RGB, RRGGBB + css_fn = true; -- Enable all CSS *functions*: rgb_fn, hsl_fn + mode = 'background'; -- Set the display mode. + }) diff --git a/home/.config/nvim/plug-config/airline.vim b/home/.config/nvim/plug-config/airline.vim new file mode 100644 index 0000000..b123b05 --- /dev/null +++ b/home/.config/nvim/plug-config/airline.vim @@ -0,0 +1,27 @@ +if g:colors_name == 'nord' + let g:airline_theme = 'nord' +elseif g:colors_name == 'onedark' + let g:airline_theme = 'onedark' +endif +let g:airline_powerline_fonts = 1 +let g:airline_left_sep = '' +let g:airline_right_sep = '' +let g:airline_right_alt_sep = '' +let g:airline#extensions#wordcount#enabled = 1 +let g:airline#extensions#hunks#non_zero_only = 1 +let g:airline#extensions#whitespace#enabled = 1 +" Tabline +let g:airline#extensions#tabline#enabled = 1 +let g:airline#extensions#tabline#fnamemod = ':t' +let g:airline#extensions#tabline#left_sep = '' +let g:airline#extensions#tabline#left_alt_sep = '' +let g:airline#extensions#tabline#right_sep = '' +let g:airline#extensions#tabline#right_alt_sep = '' +let g:airline#extensions#tabline#show_splits = 0 +let g:airline#extensions#tabline#formatter = 'unique_tail' +let g:airline#extensions#tabline#show_close_button = 0 +let g:airline#extensions#tabline#show_tab_type = 1 +let g:airline#extensions#tabline#show_tab_nr = 0 +let g:airline#extensions#tabline#fnamecollapse = 1 +" let g:airline#extensions#tabline#buffers_label = 'B' +" let g:airline#extensions#tabline#tabs_label = 'T' diff --git a/home/.config/nvim/plug-config/ale.vim b/home/.config/nvim/plug-config/ale.vim new file mode 100644 index 0000000..41d6ff9 --- /dev/null +++ b/home/.config/nvim/plug-config/ale.vim @@ -0,0 +1,32 @@ +let g:airline#extensions#ale#enabled = 0 +let g:ale_disable_lsp = 1 +let g:ale_warn_about_trailing_blank_lines = 1 +let g:ale_warn_about_trailing_whitespace = 1 +let g:ale_virtualtext_cursor = 0 +let g:ale_sign_highlight_linenrs = 0 +let g:ale_sign_error = ' ' +let g:ale_sign_warning = ' ' +let g:ale_sign_info = '' +let g:ale_sign_style_error = '>>' +let g:ale_sign_style_warning = '⚠ ' +let g:ale_sign_column_always = 0 +let g:ale_sign_priority = 10 +let g:ale_lint_on_enter = 1 +let g:ale_lint_on_save = 1 +let g:ale_lint_on_text_changed = 'never' +let g:ale_lint_on_insert_leave = 0 +" let g:ale_linters_explicit = 1 +let g:ale_linters = { +\ 'python': ['pyright', 'bandit', 'isort', 'yapf', 'autopep8', 'black'], +\} +let g:ale_fix_on_save = 0 +let g:ale_fixers = { +\ '*': ['remove_trailing_lines', 'trim_whitespace'], +\} +" let g:ale_echo_msg_error_str = 'E' +" let g:ale_echo_msg_warning_str = 'W' +" let g:ale_echo_msg_format = '[%linter%] %s [%severity%]' + +" Keybindings +nmap [g (ale_previous_wrap) +nmap ]g (ale_next_wrap) diff --git a/home/.config/nvim/plug-config/cheat_sh.vim b/home/.config/nvim/plug-config/cheat_sh.vim new file mode 100644 index 0000000..20fc212 --- /dev/null +++ b/home/.config/nvim/plug-config/cheat_sh.vim @@ -0,0 +1,51 @@ +" Vim command used to open new buffer +let g:CheatSheetReaderCmd='new"' + +" Cheat sheet file type +let g:CheatSheetFt='markdown' + +" Program used to retrieve cheat sheet with its arguments +let g:CheatSheetUrlGetter='curl --silent' + +" Flag to add cookie file to the query +let g:CheatSheetUrlGetterIdFlag='-b' + +" cheat sheet base url +let g:CheatSheetBaseUrl='https://cht.sh' + +" cheat sheet settings do not include style settings neiter comments, +" see other options below +let g:CheatSheetUrlSettings='q' + +" cheat sheet pager +let g:CheatPager='less -R' + +" pygmentize theme used for pager output, see :CheatPager :styles-demo +" let g:CheatSheetPagerStyle=rrt + +" Show comments in answers by default +" (setting this to 0 means giving ?Q to the server) +let g:CheatSheetShowCommentsByDefault=1 + +" cheat sheet buffer name +let g:CheatSheetBufferName="_cheat" + +" Default selection in normal mode (line for whole line, word for word under cursor) +let g:CheatSheetDefaultSelection="line" + +" Default query mode +" 0 => buffer +" 1 => replace (do not use or you might loose some lines of code) +" 2 => pager +" 3 => paste after query +" 4 => paste before query +let g:CheatSheetDefaultMode=0 + +" Path to cheat sheet cookie +let g:CheatSheetIdPath=expand('~/.local/share/nvim/cht.sh/id') + +" Make plugin silent by setting bellow variable to 1 +let g:CheatSheetSilent=1 + +" Disable replacement of man +" Let g:CheatDoNotReplaceKeywordPrg=1 diff --git a/home/.config/nvim/plug-config/choosewin.vim b/home/.config/nvim/plug-config/choosewin.vim new file mode 100644 index 0000000..5ac5832 --- /dev/null +++ b/home/.config/nvim/plug-config/choosewin.vim @@ -0,0 +1,7 @@ +nmap - (choosewin) + +let g:choosewin_overlay_enable = 0 +let g:choosewin_overlay_clear_multibyte = 1 +let g:choosewin_blink_on_land = 0 +let g:choosewin_statusline_replace = 1 +let g:choosewin_tabline_replace = 1 diff --git a/home/.config/nvim/plug-config/closetag.vim b/home/.config/nvim/plug-config/closetag.vim new file mode 100644 index 0000000..750012f --- /dev/null +++ b/home/.config/nvim/plug-config/closetag.vim @@ -0,0 +1,11 @@ +let g:closetag_filenames = '*.html,*.xhtml,*.phtml' +let g:closetag_xhtml_filenames = '*.xhtml,*.jsx' +let g:closetag_filetypes = 'html,xhtml,phtml' +let g:closetag_xhtml_filetypes = 'xhtml,jsx' +let g:closetag_emptyTags_caseSensitive = 1 +let g:closetag_regions = { + \ 'typescript.tsx': 'jsxRegion,tsxRegion', + \ 'javascript.jsx': 'jsxRegion', + \ } +let g:closetag_shortcut = '>' +let g:closetag_close_shortcut = '' diff --git a/home/.config/nvim/plug-config/coc.vim b/home/.config/nvim/plug-config/coc.vim new file mode 100644 index 0000000..cb598dc --- /dev/null +++ b/home/.config/nvim/plug-config/coc.vim @@ -0,0 +1,225 @@ +let g:coc_global_extensions = [ + \ 'coc-marketplace', + \ 'coc-explorer', + \ 'coc-actions', + \ 'coc-vimtex', + \ 'coc-vimlsp', + \ 'coc-tsserver', + \ 'coc-html', + \ 'coc-lit-html', + \ 'coc-emmet', + \ 'coc-yaml', + \ 'coc-xml', + \ 'coc-css', + \ 'coc-cssmodules', + \ 'coc-json', + \ 'coc-pyright', + \ 'coc-clangd', + \ 'coc-db', + \ 'coc-docker', + \ 'coc-cmake', + \ 'coc-snippets', + \ 'coc-lists', + \ 'coc-word', + \ 'coc-emoji', + \ 'coc-syntax', + \ 'coc-yank', + \ ] +" \ 'coc-go', +" \ 'coc-rls', +" \ 'coc-java', +" \ 'coc-java-debug', +" \ 'coc-highlight', +" \ 'coc-lua', +" \ 'coc-pairs', +" \ 'coc-spell-checker', +" \ 'coc-tabnine', +" \ 'coc-sh', +" \ 'coc-fish', +" \ 'coc-jest', +" \ 'coc-restclient', +" \ 'coc-vetur', + +" TextEdit might fail if hidden is not set. +set hidden + +" Some servers have issues with backup files, see #649. +set nobackup +set nowritebackup + +" Give more space for displaying messages. +set cmdheight=2 + +" Having longer updatetime (default is 4000 ms = 4 s) leads to noticeable +" delays and poor user experience. +set updatetime=300 + +" Don't pass messages to |ins-completion-menu|. +set shortmess+=c + +" Always show the signcolumn, otherwise it would shift the text each time +" diagnostics appear/become resolved. +if has("patch-8.1.1564") + " Recently vim can merge signcolumn and number column into one + set signcolumn=number +else + set signcolumn=yes +endif + +" Remap for doing codeAction of selected region +function! s:cocActionsOpenFromSelected(type) abort + execute 'CocCommand actions.open ' . a:type +endfunction +xmap la :execute 'CocCommand actions.open ' . visualmode() +nmap la :set operatorfunc=cocActionsOpenFromSelectedg@ + +" Use tab for trigger completion with characters ahead and navigate. +" NOTE: Use command ':verbose imap ' to make sure tab is not mapped by +" other plugin before putting this into your config. +inoremap + \ pumvisible() ? "\" : + \ coc#expandableOrJumpable() ? "\=coc#rpc#request('doKeymap', ['snippets-expand-jump',''])\" : + \ check_back_space() ? "\" : + \ coc#refresh() +inoremap pumvisible() ? "\" : "\" + +function! s:check_back_space() abort + let col = col('.') - 1 + return !col || getline('.')[col - 1] =~# '\s' +endfunction + +let g:coc_snippet_next = '' + +" Use to trigger completion. +if has('nvim') + inoremap coc#refresh() +else + inoremap coc#refresh() +endif + +" Make auto-select the first completion item and notify coc.nvim to +" format on enter, could be remapped by other vim plugin +inoremap pumvisible() ? coc#_select_confirm() + \: "\u\\=coc#on_enter()\" + +" Use to confirm completion, `u` means break undo chain at current +" position. Coc only does snippet and additional edit on confirm. +" could be remapped by other vim plugin, try `:verbose imap `. +if exists('*complete_info') + inoremap complete_info()["selected"] != "-1" ? "\" : "\u\" +else + inoremap pumvisible() ? "\" : "\u\" +endif + +" Use `[g` and `]g` to navigate diagnostics +" Use `:CocDiagnostics` to get all diagnostics of current buffer in location list. +" nmap [g (coc-diagnostic-prev) +" nmap ]g (coc-diagnostic-next) + +" GoTo code navigation. +nmap gd (coc-definition) +nmap gy (coc-type-definition) +nmap gi (coc-implementation) +nmap gr (coc-references) + +" CocSearch +nnoremap ? :CocSearch --follow --hidden =expand("") + +" Use K to show documentation in preview window. +nnoremap K :call show_documentation() + +function! s:show_documentation() + if (index(['vim','help'], &filetype) >= 0) + execute 'h '.expand('') + elseif (coc#rpc#ready()) + call CocActionAsync('doHover') + else + execute '!' . &keywordprg . " " . expand('') + endif +endfunction + +" Highlight the symbol and its references when holding the cursor. +" autocmd CursorHold * silent call CocActionAsync('highlight') + +augroup mygroup + autocmd! + " Setup formatexpr specified filetype(s). + autocmd FileType typescript,json setl formatexpr=CocAction('formatSelected') + " Update signature help on jump placeholder. + autocmd User CocJumpPlaceholder call CocActionAsync('showSignatureHelp') +augroup end + +" Map function and class text objects +" NOTE: Requires 'textDocument.documentSymbol' support from the language server. +xmap if (coc-funcobj-i) +omap if (coc-funcobj-i) +xmap af (coc-funcobj-a) +omap af (coc-funcobj-a) +xmap ic (coc-classobj-i) +omap ic (coc-classobj-i) +xmap ac (coc-classobj-a) +omap ac (coc-classobj-a) + +" Use CTRL-S for selections ranges. +" Requires 'textDocument/selectionRange' support of LS, ex: coc-tsserver +nmap (coc-range-select) +xmap (coc-range-select) + +" Add `:Format` command to format current buffer. +command! -nargs=0 Format :call CocAction('format') + +" Add `:Fold` command to fold current buffer. +command! -nargs=? Fold :call CocAction('fold', ) + +" Add `:OR` command for organize imports of the current buffer. +command! -nargs=0 OR :call CocAction('runCommand', 'editor.action.organizeImport') + +" Add `:Prettier` command for formatting current buffer +" command! -nargs=0 Prettier :CocCommand prettier.formatFile + +" coc-jest +command! -nargs=0 Jest :call CocAction('runCommand', 'jest.projectTest') +command! -nargs=0 JestCurrent :call CocAction('runCommand', 'jest.fileTest', ['%']) +command! -nargs=0 JestSingle :call CocAction('runCommand', 'jest.singleTest') +command! JestInit :call CocAction('runCommand', 'jest.init') + +" Add (Neo)Vim's native statusline support. +" NOTE: Please see `:h coc-status` for integrations with external plugins that +" provide custom statusline: lightline.vim, vim-airline. +set statusline^=%{coc#status()}%{get(b:,'coc_current_function','')} + +" Use for trigger snippet expand. +imap (coc-snippets-expand) + +" Use for select text for visual placeholder of snippet. +vmap (coc-snippets-select) + +" Use for jump to next placeholder, it's default of coc.nvim +let g:coc_snippet_next = '' + +" Use for jump to previous placeholder, it's default of coc.nvim +let g:coc_snippet_prev = '' + +" Use for both expand and jump (make expand higher priority.) +imap (coc-snippets-expand-jump) + +" Vimlsp +let g:markdown_fenced_languages = [ + \ 'vim', + \ 'help' + \] + +" coc-explorer auto-dir +function s:explorer_inited() + autocmd BufEnter * if (&filetype != 'coc-explorer') | exe 'silent! let dir = getcwd()' + autocmd BufEnter * call CocActionAsync("runCommand", "explorer.doAction", "closest", {"name": "cd", "args": [dir]}) +endfunction +autocmd User CocExplorerOpenPost call s:explorer_inited() +" Quit if only explorer exists +autocmd BufEnter * if (winnr("$") == 1 && &filetype == 'coc-explorer') | q | endif +" Startscreen +" autocmd StdinReadPre * let s:std_in=1 +" autocmd VimEnter * +" \ if argc() != 0 || exists("s:std_in") +" \| execute 'CocCommand explorer --no-focus ' . getcwd() +" \| endif diff --git a/home/.config/nvim/plug-config/colorscheme.vim b/home/.config/nvim/plug-config/colorscheme.vim new file mode 100644 index 0000000..d182efa --- /dev/null +++ b/home/.config/nvim/plug-config/colorscheme.vim @@ -0,0 +1,13 @@ +" Cleaner OneDark +let g:onedark_hide_endofbuffer = 1 +let g:onedark_terminal_italics = 1 +" Nord +let g:nord_cursor_line_number_background = 0 +let g:nord_uniform_diff_background = 1 +let g:nord_italic = 1 +let g:nord_italic_comments = 1 +let g:nord_bold = 1 +let g:nord_bold_vertical_split_line = 0 +let g:nord_underline = 1 + +colorscheme nord diff --git a/home/.config/nvim/plug-config/dashboard.vim b/home/.config/nvim/plug-config/dashboard.vim new file mode 100644 index 0000000..98add4f --- /dev/null +++ b/home/.config/nvim/plug-config/dashboard.vim @@ -0,0 +1,37 @@ +autocmd FileType dashboard set showtabline=0 | autocmd WinLeave set showtabline=2 + +let g:dashboard_custom_header = [ + \ "<-. (`-')_ (`-') _ (`-') _ <-. (`-') ", + \ " \\( OO) ) ( OO).-/ .-> _(OO ) (_) \\(OO )_ ", + \ ",--./ ,--/ (,------.(`-')----. ,--.(_/,-.\\ ,-(`-'),--./ ,-.)", + \ "| \\ | | | .---'( OO).-. '\\ \\ / (_/ | ( OO)| `.' |", + \ "| . '| |)(| '--. ( _) | | | \\ / / | | )| |'.'| |", + \ "| |\\ | | .--' \\| |)| |_ \\ /_)(| |_/ | | | |", + \ "| | \\ | | `---. ' '-' '\\-'\\ / | |'->| | | |", + \ "`--' `--' `------' `-----' `-' `--' `--' `--'", + \ ] +let g:dashboard_default_executive ='fzf' +let g:dashboard_fzf_float = 1 +let g:dashboard_fzf_engine = 'rg' +let g:dashboard_session_directory = '$HOME/.local/share/nvim/sessions' + +" Icons +let g:dashboard_custom_shortcut_icon={} +let g:dashboard_custom_shortcut_icon['last_session'] = ' ' +let g:dashboard_custom_shortcut_icon['find_history'] = ' ' +let g:dashboard_custom_shortcut_icon['find_file'] = ' ' +let g:dashboard_custom_shortcut_icon['new_file'] = ' ' +let g:dashboard_custom_shortcut_icon['change_colorscheme'] = ' ' +let g:dashboard_custom_shortcut_icon['find_word'] = ' ' +let g:dashboard_custom_shortcut_icon['book_marks'] = ' ' + +" Entries +let g:dashboard_custom_shortcut={ + \ 'new_file' : 'SPC b e', + \ 'last_session' : 'SPC s l', + \ 'book_marks' : 'SPC f m', + \ 'find_history' : 'SPC f h', + \ 'find_file' : 'SPC f f', + \ 'find_word' : 'SPC f t', + \ 'change_colorscheme' : 'SPC f S', + \ } diff --git a/home/.config/nvim/plug-config/delimitMate.vim b/home/.config/nvim/plug-config/delimitMate.vim new file mode 100644 index 0000000..aead912 --- /dev/null +++ b/home/.config/nvim/plug-config/delimitMate.vim @@ -0,0 +1,6 @@ +let delimitMate_jump_expansion = 1 +let delimitMate_expand_cr = 2 +let delimitMate_expand_space = 1 +let delimitMate_expand_inside_quotes = 0 +let delimitMate_balance_matchpairs = 1 +let delimitMate_insert_eol_marker = 1 diff --git a/home/.config/nvim/plug-config/doc.vim b/home/.config/nvim/plug-config/doc.vim new file mode 100644 index 0000000..92bd2a2 --- /dev/null +++ b/home/.config/nvim/plug-config/doc.vim @@ -0,0 +1,15 @@ +" Pandoc +let g:pandoc#filetypes#handled = ["pandoc", "markdown", "rst", "textile"] +let g:pandoc#filetypes#pandoc_markdown = 0 +let g:pandoc#modules#disabled = ["folding"] +" Vimtex +let g:vimtex_compiler_progname = 'nvr' +let g:tex_flavor = 'latex' +" Markdown TOC +let g:vmt_fence_text = 'TOC' +let g:vmt_fence_closing_text = '/TOC' +let g:vmt_include_headings_before = 0 +let g:vmt_list_item_char = '*' +" Markdown preview +let g:mkdp_refresh_slow = 1 +let g:mkdp_page_title = '「${name}」' diff --git a/home/.config/nvim/plug-config/doge.vim b/home/.config/nvim/plug-config/doge.vim new file mode 100644 index 0000000..787e655 --- /dev/null +++ b/home/.config/nvim/plug-config/doge.vim @@ -0,0 +1,10 @@ +let g:doge_enable_mappings=0 +let g:doge_mapping='d' +let g:doge_buffer_mappings=0 +let g:doge_mapping_comment_jump_forward='' +let g:doge_mapping_comment_jump_backward='' +let g:doge_comment_jump_modes = ['n', 'i', 's'] + +" Commands +" :DogeGenerate {doc_standard} +" :DogeCreateDocStandard {doc_standard} diff --git a/home/.config/nvim/plug-config/easy-align.vim b/home/.config/nvim/plug-config/easy-align.vim new file mode 100644 index 0000000..5869775 --- /dev/null +++ b/home/.config/nvim/plug-config/easy-align.vim @@ -0,0 +1,8 @@ +" Settings +let g:easy_align_ignore_groups = ['Comment', 'String'] +" let g:easy_align_bypass_fold = 1 + +" Start interactive EasyAlign in visual mode (e.g. vipga) +xmap aa (EasyAlign) +" Start interactive EasyAlign for a motion/text object (e.g. gaip) +nmap aa (EasyAlign) diff --git a/home/.config/nvim/plug-config/emmet.vim b/home/.config/nvim/plug-config/emmet.vim new file mode 100644 index 0000000..3c921ec --- /dev/null +++ b/home/.config/nvim/plug-config/emmet.vim @@ -0,0 +1,6 @@ +" Use emmet only in here +let g:user_emmet_install_global = 0 +autocmd FileType html,css EmmetInstall + +let g:user_emmet_mode = 'a' +let g:user_emmet_leader_key = '' diff --git a/home/.config/nvim/plug-config/far.vim b/home/.config/nvim/plug-config/far.vim new file mode 100644 index 0000000..4cb27ce --- /dev/null +++ b/home/.config/nvim/plug-config/far.vim @@ -0,0 +1,4 @@ +set lazyredraw " improve scrolling speed a bit + +let g:far#enable_undo=1 +let g:far#source='rgnvim' diff --git a/home/.config/nvim/plug-config/floaterm.vim b/home/.config/nvim/plug-config/floaterm.vim new file mode 100644 index 0000000..2f7d1ac --- /dev/null +++ b/home/.config/nvim/plug-config/floaterm.vim @@ -0,0 +1,5 @@ +let g:floaterm_gitcommit = 'floaterm' +let g:floaterm_autoinsert = 1 +let g:floaterm_width = 0.8 +let g:floaterm_height = 0.8 +let g:floaterm_autoclose = 0 diff --git a/home/.config/nvim/plug-config/fzf.vim b/home/.config/nvim/plug-config/fzf.vim new file mode 100644 index 0000000..6e3cb5c --- /dev/null +++ b/home/.config/nvim/plug-config/fzf.vim @@ -0,0 +1,19 @@ +command! -nargs=? -bang -complete=dir Files + \ call fzf#vim#files(, 0 ? fzf#vim#with_preview('up:70%') : fzf#vim#with_preview('right:70%'), 0) + +let g:fzf_colors = +\ { "fg": ["fg", "Normal"], + \ "bg": ["bg", "Normal"], + \ "hl": ["fg", "IncSearch"], + \ "fg+": ["fg", "CursorLine", "CursorColumn", "Normal"], + \ "bg+": ["bg", "CursorLine", "CursorColumn"], + \ "hl+": ["fg", "IncSearch"], + \ "info": ["fg", "IncSearch"], + \ "border": ["fg", "Ignore"], + \ "prompt": ["fg", "Comment"], + \ "pointer": ["fg", "IncSearch"], + \ "marker": ["fg", "IncSearch"], + \ "spinner": ["fg", "IncSearch"], + \ "header": ["fg", "WildMenu"] } +let g:fzf_buffers_jump = 1 +let g:fzf_history_dir = '$HOME/.local/share/nvim/fzf-history' diff --git a/home/.config/nvim/plug-config/git.vim b/home/.config/nvim/plug-config/git.vim new file mode 100644 index 0000000..6083756 --- /dev/null +++ b/home/.config/nvim/plug-config/git.vim @@ -0,0 +1,25 @@ +" Git-messenger +let g:git_messenger_no_default_mappings=1 +" Gitgutter +let g:gitgutter_enabled = 1 +let g:gitgutter_map_keys = 0 +let g:gitgutter_highlight_linenrs = 1 +let g:gitgutter_highlight_lines = 0 +let g:gitgutter_signs = 0 +let g:gitgutter_sign_priority = 10 +let g:gitgutter_sign_allow_clobber = 0 + +set foldtext=gitgutter#fold#is_changed() + +" OneDark/Nord +if g:colors_name == "onedark" + highlight GitGutterAddLineNr ctermfg=2 guifg=#98c379 + highlight GitGutterChangeLineNr ctermfg=3 guifg=#e5c07b + highlight GitGutterDeleteLineNr ctermfg=1 guifg=#e06c75 + highlight GitGutterChangeDeleteLineNr ctermfg=5 guifg=#c678dd +elseif g:colors_name == "nord" + highlight GitGutterAddLineNr ctermfg=2 guifg=#a3be8c + highlight GitGutterChangeLineNr ctermfg=3 guifg=#ebcb8b + highlight GitGutterDeleteLineNr ctermfg=1 guifg=#bf616a + highlight GitGutterChangeDeleteLineNr ctermfg=5 guifg=#b48ead +endif diff --git a/home/.config/nvim/plug-config/goyo.vim b/home/.config/nvim/plug-config/goyo.vim new file mode 100644 index 0000000..52d0ec5 --- /dev/null +++ b/home/.config/nvim/plug-config/goyo.vim @@ -0,0 +1,3 @@ +" Goyo/LimeLight config +autocmd! User GoyoEnter Limelight +autocmd! User GoyoLeave Limelight! diff --git a/home/.config/nvim/plug-config/illuminate.vim b/home/.config/nvim/plug-config/illuminate.vim new file mode 100644 index 0000000..6bae811 --- /dev/null +++ b/home/.config/nvim/plug-config/illuminate.vim @@ -0,0 +1,6 @@ +" augroup illuminate_augroup +" autocmd! +" autocmd VimEnter * hi link illuminatedWord Visual +" augroup END + +let g:Illuminate_ftblacklist = ['javascript', 'jsx', 'html', 'nerdtree'] diff --git a/home/.config/nvim/plug-config/indentline.vim b/home/.config/nvim/plug-config/indentline.vim new file mode 100644 index 0000000..c74d6b4 --- /dev/null +++ b/home/.config/nvim/plug-config/indentline.vim @@ -0,0 +1,12 @@ +let g:indentLine_enabled = 0 +let g:indentLine_showFirstIndentLevel = 1 +let g:indentLine_setConceal = 0 +" let g:indentLine_conceallevel = 1 +let g:indentLine_concealcursor = 'inc' +" let g:indentLine_setColors = 0 +" let g:indentLine_char = '┆' +let g:indentLine_char_list = ['|', '¦', '┆', '┊'] +let g:indentLine_leadingSpaceEnabled = 0 +let g:indentLine_leadingSpaceChar = "•" +let g:indentLine_fileTypeExclude = ['dashboard', 'vimwiki', 'coc-explorer', 'undotree', 'diff', 'help'] +let g:indentLine_bufTypeExclude = ['help', 'terminal'] diff --git a/home/.config/nvim/plug-config/moving.vim b/home/.config/nvim/plug-config/moving.vim new file mode 100644 index 0000000..d956990 --- /dev/null +++ b/home/.config/nvim/plug-config/moving.vim @@ -0,0 +1,14 @@ +" Consistent quickscope colors in colorschemes +augroup qs_colors + autocmd! + autocmd ColorScheme * highlight QuickScopePrimary guifg='#afff5f' gui=underline ctermfg=155 cterm=underline + autocmd ColorScheme * highlight QuickScopeSecondary guifg='#5fffff' gui=underline ctermfg=81 cterm=underline +augroup END + +" Sneak +let g:sneak#label = 1 +" QuickScope +let g:qs_highlight_on_keys = ['f', 'F', 't', 'T'] +let g:qs_enable=1 +let g:qs_buftype_blacklist = ['terminal', 'nofile'] +let g:qs_lazy_highlight = 1 diff --git a/home/.config/nvim/plug-config/nerdtree.vim b/home/.config/nvim/plug-config/nerdtree.vim new file mode 100644 index 0000000..c4f5403 --- /dev/null +++ b/home/.config/nvim/plug-config/nerdtree.vim @@ -0,0 +1,46 @@ +" Don't open new buffer on Nerdtree buffer +autocmd BufEnter * if bufname('#') =~# "^NERD_tree_" && winnr('$') > 1 | b# | endif +" Auto close when only Nerdtree exists +autocmd BufEnter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif +" Startscreen +" autocmd StdinReadPre * let s:std_in=1 +" autocmd VimEnter * +" \ if argc() != 0 || exists("s:std_in") +" \| NERDTree +" \| endif +" \| wincmd p + +" Nerdtree +let g:NERDTreeGitStatusUseNerdFonts = 1 +let g:NERDTreeGitStatusConcealBrackets = 0 " Do not enable this when using vim_devicons +let g:NERDTreeGitStatusShowClean = 0 +let g:NERDTreeGitStatusUntrackedFilesMode = 'normal' +let g:NERDTreeGitStatusShowIgnored = 1 +let g:NERDTreeGitStatusWithFlags = 1 +let g:NERDTreeGitStatusIndicatorMapCustom = { + \ "Modified" : "✹", + \ "Staged" : "✚", + \ "Untracked" : "✭", + \ "Renamed" : "➜", + \ "Unmerged" : "═", + \ "Deleted" : "✖", + \ "Dirty" : "✗", + \ "Clean" : "✔︎", + \ 'Ignored' : '☒', + \ "Unknown" : "?" + \ } +let NERDTreeShowHidden=1 +let g:NERDTreeHijackNetrw = 0 +let g:NERDTreeDirArrowExpandable = '' " '' +let g:NERDTreeDirArrowCollapsible = '' " '' +let g:plug_window = 'noautocmd vertical topleft new' " Avoid nerdtree crash when using vim-plug +" Nerdtree devicons +let g:WebDevIconsDisableDefaultFolderSymbolColorFromNERDTreeDir = 1 +let g:WebDevIconsDisableDefaultFileSymbolColorFromNERDTreeFile = 1 +let g:NERDTreeLimitedSyntax = 1 +let g:NERDTreeHighlightCursorline = 0 +let g:NERDTreeHighlightFolders = 1 +let g:NERDTreeHighlightFoldersFullName = 1 +let g:NERDTreeFileExtensionHighlightFullName = 1 +let g:NERDTreeExactMatchHighlightFullName = 1 +let g:NERDTreePatternMatchHighlightFullName = 1 diff --git a/home/.config/nvim/plug-config/nnn.vim b/home/.config/nvim/plug-config/nnn.vim new file mode 100644 index 0000000..ba71f03 --- /dev/null +++ b/home/.config/nvim/plug-config/nnn.vim @@ -0,0 +1,3 @@ +let g:nnn#set_default_mappings = 0 +let g:nnn#command = 'nnn -dHc' +let g:nnn#layout = 'new' diff --git a/home/.config/nvim/plug-config/polyglot.vim b/home/.config/nvim/plug-config/polyglot.vim new file mode 100644 index 0000000..ab1a539 --- /dev/null +++ b/home/.config/nvim/plug-config/polyglot.vim @@ -0,0 +1,19 @@ +let g:polyglot_disabled = ['csv'] + +" Haskell +" let g:haskell_classic_highlighting = 1 +let g:haskell_enable_quantification = 1 " to enable highlighting of `forall` +let g:haskell_enable_recursivedo = 1 " to enable highlighting of `mdo` and `rec` +let g:haskell_enable_arrowsyntax = 1 " to enable highlighting of `proc` +let g:haskell_enable_pattern_synonyms = 1 " to enable highlighting of `pattern` +let g:haskell_enable_typeroles = 1 " to enable highlighting of type roles +let g:haskell_enable_static_pointers = 1 " to enable highlighting of `static` +let g:haskell_backpack = 1 " to enable highlighting of backpack keywords +" Javascript +let g:javascript_plugin_jsdoc = 1 +let g:javascript_plugin_flow = 1 +let g:javascript_plugin_ngdoc = 1 +" jsx +let g:vim_jsx_pretty_colorful_config = 1 +" Python +let g:python_highlight_all=1 diff --git a/home/.config/nvim/plug-config/rainbow.vim b/home/.config/nvim/plug-config/rainbow.vim new file mode 100644 index 0000000..2c81ac4 --- /dev/null +++ b/home/.config/nvim/plug-config/rainbow.vim @@ -0,0 +1,7 @@ +" Rainbow parentheses +let g:rainbow_active = 0 +let g:rainbow#pairs = [['(', ')'], ['[', ']'], ['{', '}'], ['<', '>']] +" let g:rainbow_conf = {'guis': ['bold']} + +" Rainbow csv +let g:disable_rainbow_key_mappings = 1 diff --git a/home/.config/nvim/plug-config/rnvimr.vim b/home/.config/nvim/plug-config/rnvimr.vim new file mode 100644 index 0000000..b372d02 --- /dev/null +++ b/home/.config/nvim/plug-config/rnvimr.vim @@ -0,0 +1,25 @@ +let g:rnvimr_enable_ex = 1 +let g:rnvimr_enable_picker = 1 +let g:rnvimr_draw_border = 1 +let g:rnvimr_hide_gitignore = 0 +let g:rnvimr_border_attr = {'fg': 4, 'bg': -1} +let g:rnvimr_enable_bw = 1 +let g:rnvimr_ranger_cmd = 'ranger --cmd="set column_ratios 1,2" + \ --cmd="set draw_borders none" + \ --cmd="set show_hidden true"' +" Map Rnvimr action +let g:rnvimr_action = { + \ '': 'NvimEdit tabedit', + \ '': 'NvimEdit split', + \ '': 'NvimEdit vsplit', + \ 'gw': 'JumpNvimCwd', + \ 'yw': 'EmitRangerCwd' + \ } +" Customize the initial layout +let g:rnvimr_layout = { 'relative': 'editor', + \ 'width': float2nr(round(0.8 * &columns)), + \ 'height': float2nr(round(0.8 * &lines)), + \ 'col': float2nr(round(0.1 * &columns)), + \ 'row': float2nr(round(0.1 * &lines)), + \ 'style': 'minimal' } +let g:rnvimr_presets = [{}] diff --git a/home/.config/nvim/plug-config/rooter.vim b/home/.config/nvim/plug-config/rooter.vim new file mode 100644 index 0000000..158dab7 --- /dev/null +++ b/home/.config/nvim/plug-config/rooter.vim @@ -0,0 +1,5 @@ +let g:rooter_patterns = ['.git', 'Makefile', '_darcs', '.hg', '.bzr', '.svn', '*.pro', '.projectile', 'Dockerfile'] +let g:rooter_change_directory_for_non_project_files = 'current' +let g:rooter_silent_chdir = 1 +let g:rooter_resolve_links = 1 +let g:rooter_cd_cmd='lcd' diff --git a/home/.config/nvim/plug-config/spaceline.vim b/home/.config/nvim/plug-config/spaceline.vim new file mode 100644 index 0000000..b838198 --- /dev/null +++ b/home/.config/nvim/plug-config/spaceline.vim @@ -0,0 +1,18 @@ +if g:colors_name == 'onedark' + let g:spaceline_colorscheme = 'one' +elseif g:colors_name == 'nord' + let g:spaceline_colorscheme = 'nord' +endif +let g:spaceline_seperate_style= 'arrow-fade' +let g:spaceline_custom_vim_status = {"n": "NORMAL","V":"V-LINE","v":"VISUAL","\": "V-BLOCK","i":"INSERT","R":"REPLACE","r":"REPLACE","s":"S","t":"T","c":"COMMAND","!":"SE"} +let g:spaceline_diagnostic_tool = 'ale' +let g:spaceline_diagnostic_errorsign = '●' +let g:spaceline_diagnostic_warnsign = '●' +let g:spaceline_diagnostic_oksign = '' +let g:spaceline_git_branch_icon = ' ' +let g:spaceline_custom_diff_icon = ['+','~','-'] +let g:spaceline_diff_tool = 'git-gutter' +let g:spaceline_function_icon = ' ' +let g:spaceline_scroll_chars = [ + \ ' ', '▁', '▂', '▃', '▄', '▅', '▆', '▇', '█' + \ ] diff --git a/home/.config/nvim/plug-config/startify.vim b/home/.config/nvim/plug-config/startify.vim new file mode 100644 index 0000000..d524a33 --- /dev/null +++ b/home/.config/nvim/plug-config/startify.vim @@ -0,0 +1,52 @@ +let g:startify_custom_header = [ + \ " <-. (`-')_ (`-') _ (`-') _ <-. (`-') ", + \ " \\( OO) ) ( OO).-/ .-> _(OO ) (_) \\(OO )_ ", + \ " ,--./ ,--/ (,------.(`-')----. ,--.(_/,-.\\ ,-(`-'),--./ ,-.)", + \ " | \\ | | | .---'( OO).-. '\\ \\ / (_/ | ( OO)| `.' |", + \ " | . '| |)(| '--. ( _) | | | \\ / / | | )| |'.'| |", + \ " | |\\ | | .--' \\| |)| |_ \\ /_)(| |_/ | | | |", + \ " | | \\ | | `---. ' '-' '\\-'\\ / | |'->| | | |", + \ " `--' `--' `------' `-----' `-' `--' `--' `--'", + \ ] + +let g:startify_session_dir = '$HOME/.local/share/nvim/sessions' + +" returns all modified files of the current git repo +" `2>/dev/null` makes the command fail quietly, so that when we are not +" in a git repo, the list will be empty +function! s:gitModified() + let files = systemlist('git ls-files -m 2>/dev/null') + return map(files, "{'line': v:val, 'path': v:val}") +endfunction + +" same as above, but show untracked files, honouring .gitignore +function! s:gitUntracked() + let files = systemlist('git ls-files -o --exclude-standard 2>/dev/null') + return map(files, "{'line': v:val, 'path': v:val}") +endfunction + +let g:startify_lists = [ + \ { 'type': 'files', 'header': ['  Files'] }, + \ { 'type': 'dir', 'header': ['  Current folder: '. getcwd()] }, + \ { 'type': 'sessions', 'header': ['  Sessions'] }, + \ { 'type': 'bookmarks', 'header': ['  Bookmarks'] }, + \ { 'type': function('s:gitModified'), 'header': ['  Git modified'] }, + \ { 'type': function('s:gitUntracked'), 'header': ['  Git untracked']}, + \ ] + +let g:startify_session_autoload = 1 +let g:startify_session_delete_buffers = 1 +let g:startify_change_to_vcs_root = 1 +let g:startify_fortune_use_unicode = 1 +let g:startify_session_persistence = 1 +let g:startify_enable_special = 1 +let g:webdevicons_enable_startify = 1 +let g:startify_bookmarks = [ + \ { 'i': '~/.config/nvim/init.vim' }, + \ { 'p': '~/Code'}, + \ { 'c': '~/.config'}, + \ ] + +function! StartifyEntryFormat() + return 'WebDevIconsGetFileTypeSymbol(absolute_path) ." ". entry_path' +endfunction diff --git a/home/.config/nvim/plug-config/tablemode.vim b/home/.config/nvim/plug-config/tablemode.vim new file mode 100644 index 0000000..da4096c --- /dev/null +++ b/home/.config/nvim/plug-config/tablemode.vim @@ -0,0 +1,9 @@ +let g:table_mode_corner='|' " Markdown-compatible +let g:table_mode_corner_corner='+' " ReST-compatible +let g:table_mode_header_fillchar='=' " ReST-compatible +let g:table_mode_delete_row_map='td' +let g:table_mode_delete_column_map='tc' +let g:table_mode_insert_column_after_map='ti' +let g:table_mode_insert_column_before_map='tk' +let g:table_mode_add_formula_map='tf' +let g:table_mode_eval_expr_map='te' diff --git a/home/.config/nvim/plug-config/translator.vim b/home/.config/nvim/plug-config/translator.vim new file mode 100644 index 0000000..f1211a9 --- /dev/null +++ b/home/.config/nvim/plug-config/translator.vim @@ -0,0 +1,22 @@ +let g:translator_target_lang = 'ja' +let g:translator_source_lang = 'auto' +let g:translator_default_engines = ['trans'] +let g:translator_history_enable = v:false + +" Echo translation in the cmdline +nmap Tt Translate +vmap Tt TranslateV +" Display translation in a window +nmap Tw TranslateW +vmap Tw TranslateWV +" Replace the text with translation +nmap Tr TranslateR +vmap Tr TranslateRV +" Translate the text in clipboard +nmap Tx TranslateX + +" Scrolling the popup window +nnoremap translator#window#float#has_scroll() ? + \ translator#window#float#scroll(1) : "\" +nnoremap translator#window#float#has_scroll() ? + \ translator#window#float#scroll(0) : "\" diff --git a/home/.config/nvim/plug-config/undo.vim b/home/.config/nvim/plug-config/undo.vim new file mode 100644 index 0000000..4df7df6 --- /dev/null +++ b/home/.config/nvim/plug-config/undo.vim @@ -0,0 +1,16 @@ +" Persistent undo history +if has("persistent_undo") + set undodir=$HOME/.local/share/nvim/undodir + set undofile +endif + +let g:undotree_WindowLayout = 4 +let g:undotree_ShortIndicators = 1 +let g:undotree_SplitWidth = 24 +let g:undotree_DiffpanelHeight = 10 +let g:undotree_DiffAutoOpen = 1 +let g:undotree_SetFocusWhenToggle = 1 +let g:undotree_RelativeTimestamp = 1 +let g:undotree_HelpLine = 1 +let g:undotree_HighlightChangedText = 1 +let g:undotree_HighlightChangedWithSign = 0 diff --git a/home/.config/nvim/plug-config/vim-buffet.vim b/home/.config/nvim/plug-config/vim-buffet.vim new file mode 100644 index 0000000..e7cc32f --- /dev/null +++ b/home/.config/nvim/plug-config/vim-buffet.vim @@ -0,0 +1,42 @@ +let g:buffet_always_show_tabline = 1 +let g:buffet_show_index = 1 +let g:buffet_max_plug = 10 +let g:buffet_powerline_separators = 1 +let g:buffet_use_devicons = 1 +let g:buffet_tab_icon = "\uf9f0" +let g:buffet_left_trunc_icon = "\uf0a8" +let g:buffet_right_trunc_icon = "\uf0a9" +let g:buffet_modified_icon = '+' +let g:buffet_new_buffer_name = '*' + +if g:colors_name == "nord" + function! g:BuffetSetCustomColors() + hi! BuffetCurrentBuffer cterm=NONE ctermbg=6 ctermfg=8 guibg=#88c0d0 guifg=#2e3440 + hi! BuffetActiveBuffer cterm=NONE ctermbg=8 ctermfg=6 guibg=#3b4252 guifg=#88c0d0 + hi! BuffetBuffer cterm=NONE ctermbg=8 ctermfg=7 guibg=#3b4252 guifg=#d8dee9 + hi! BuffetModCurrentBuffer cterm=NONE ctermbg=2 ctermfg=8 guibg=#a3be8c guifg=#2e3440 + hi! BuffetModActiveBuffer cterm=NONE ctermbg=8 ctermfg=2 guibg=#3b4252 guifg=#a3be8c + hi! BuffetTrunc cterm=NONE ctermbg=8 ctermfg=7 guibg=#2e3440 guifg=#d8dee9 + hi! BuffetTab cterm=NONE ctermbg=4 ctermfg=8 guibg=#81a1c1 guifg=#2e3440 + + hi! link BuffetModBuffer BuffetBuffer + hi! link BuffetLeftTrunc BuffetTrunc + hi! link BuffetRightTrunc BuffetTrunc + hi! link BuffetEnd BuffetBuffer + endfunction +elseif g:colors_name == "onedark" + function! g:BuffetSetCustomColors() + hi! BuffetCurrentBuffer cterm=NONE ctermbg=4 ctermfg=8 guibg=#61afef guifg=#282c34 + hi! BuffetActiveBuffer cterm=NONE ctermbg=8 ctermfg=4 guibg=#3e4452 guifg=#61afef + hi! BuffetBuffer cterm=NONE ctermbg=8 ctermfg=7 guibg=#3e4452 guifg=#abb2bf + hi! BuffetModCurrentBuffer cterm=NONE ctermbg=2 ctermfg=8 guibg=#98c379 guifg=#282c34 + hi! BuffetModActiveBuffer cterm=NONE ctermbg=8 ctermfg=2 guibg=#3e4452 guifg=#98c379 + hi! BuffetTrunc cterm=NONE ctermbg=8 ctermfg=7 guibg=#282c34 guifg=#abb2bf + hi! BuffetTab cterm=NONE ctermbg=5 ctermfg=8 guibg=#c678dd guifg=#282c34 + + hi! link BuffetModBuffer BuffetBuffer + hi! link BuffetLeftTrunc BuffetTrunc + hi! link BuffetRightTrunc BuffetTrunc + hi! link BuffetEnd BuffetBuffer + endfunction +endif diff --git a/home/.config/nvim/plug-config/vimwiki.vim b/home/.config/nvim/plug-config/vimwiki.vim new file mode 100644 index 0000000..5554137 --- /dev/null +++ b/home/.config/nvim/plug-config/vimwiki.vim @@ -0,0 +1,4 @@ +let g:vimwiki_global_ext = 0 +let g:vimwiki_filetypes = ['markdown'] +let g:vimwiki_list = [{'path': '$HOME/.local/share/nvim/wiki/', + \ 'syntax': 'markdown', 'ext': '.md'}] diff --git a/home/.config/nvim/plug-config/vista.vim b/home/.config/nvim/plug-config/vista.vim new file mode 100644 index 0000000..e24166a --- /dev/null +++ b/home/.config/nvim/plug-config/vista.vim @@ -0,0 +1,8 @@ +let g:vista_disable_statusline = 0 +let g:vista_default_executive = 'coc' +let g:vista_enable_markdown_extension = 1 +let g:vista#renderer#enable_icon = 1 +let g:vista_icon_indent = ["▸ ", ""] +let g:vista_fzf_preview = ['right:50%'] +let g:vista_keep_fzf_colors = 1 +let g:vista_sidebar_width = 30 diff --git a/home/.config/nvim/plug-config/which-key.vim b/home/.config/nvim/plug-config/which-key.vim new file mode 100644 index 0000000..c0cee1f --- /dev/null +++ b/home/.config/nvim/plug-config/which-key.vim @@ -0,0 +1,266 @@ +autocmd! User vim-which-key call which_key#register('', "g:which_key_map") +" Map leader to which_key +nnoremap :silent :silent WhichKey '' +vnoremap :silent :silent WhichKeyVisual '' + +" Create map to add keys to +let g:which_key_map = {} +" No floating +let g:which_key_use_floating_win = 0 +" Define a separator +let g:which_key_sep = '→' + +set timeoutlen=300 + +" Highlighting +highlight default link WhichKey Operator +highlight default link WhichKeySeperator DiffAdded +highlight default link WhichKeyGroup Identifier +highlight default link WhichKeyDesc Function + +" Hide statusline +autocmd! FileType which_key +autocmd FileType which_key set laststatus=0 noshowmode noruler + \| autocmd BufLeave set laststatus=2 noshowmode ruler + +" 1-level entries +let g:which_key_map['.'] = [':e $MYVIMRC' , 'open init'] +let g:which_key_map['v'] = ['v' , 'split right'] +let g:which_key_map['='] = ['=' , 'balance windows'] +let g:which_key_map['h'] = ['s' , 'split below'] +let g:which_key_map[';'] = [':Commands' , 'commands'] +let g:which_key_map['e'] = [':Files' , 'search files'] +let g:which_key_map['n'] = [':CocCommand explorer' , 'coc-explorer'] +" let g:which_key_map['n'] = [':NERDTreeToggle' , 'nerdtree'] +let g:which_key_map['u'] = [':UndotreeToggle' , 'undotree'] +let g:which_key_map['?'] = 'coc search' +let g:which_key_map['d'] = 'doge' +let g:which_key_map['T'] = 'tableize range' + +" File managers +let g:which_key_map.r = { + \ 'name' : '+FileManagers' , + \ 'e' : [':Explore' , 'netrw'], + \ 'l' : [':FloatermNew lf' , 'lf'], + \ 'n' : [':NnnPicker' , 'nnn'], + \ 'r' : [':RnvimrToggle' , 'ranger'], + \ 'v' : [':Vifm' , 'vifm'], + \ } + +" Actions +let g:which_key_map.a = { + \ 'name' : '+Actions' , + \ 'a' : 'align text', + \ 'b' : [':Bracey' , 'live server'], + \ 'B' : [':BraceyStop' , 'live server stop'], + \ 'c' : [':ColorizerToggle' , 'colorizer toggle'], + \ 'd' : [':RainbowDelim' , 'rainbow csv on'], + \ 'D' : [':NoRainbowDelim' , 'rainbow csv off'], + \ 'e' : [':ALEDisableBuffer' , 'disable linting'], + \ 'E' : [':ALEEnableBuffer' , 'enable linting'], + \ 'g' : [':Goyo' , 'goyo toggle'], + \ 'i' : [':IndentLinesToggle' , 'indent toggle'], + \ 'l' : [':RainbowAlign' , 'align csv columns'], + \ 'L' : [':RainbowShrink' , 'shrink csv columns'], + \ 'm' : [':MarkdownPreview' , 'markdown preview'], + \ 'M' : [':MarkdownPreviewStop' , 'markdown preview stop'], + \ 'p' : [':DelimitMateSwitch' , 'auto-pairs toggle'], + \ 'r' : [':RainbowToggle' , 'rainbow brackets toggle'], + \ 's' : [':CocCommand cSpell.toggleEnableSpellChecker' , 'spellchecker toggle'], + \ 'v' : [':Vista!!' , 'vista toggle'], + \ 'V' : [':Vista finder coc' , 'vista coc tag'], + \ 'w' : [':ToggleWhitespace' , 'whitespace toggle'], + \ 'W' : [':StripWhitespace' , 'strip whitespace'], + \ } + +" Buffer/Tab commands +let g:which_key_map.b = { + \ 'name' : '+Buffer/Tab' , + \ '/' : ['Buffers' , 'fzf buffer'], + \ 'e' : ['enew' , 'new empty buffer'], + \ 'E' : ['tabnew' , 'new tab'], + \ 'd' : ['bd' , 'delete buffer'], + \ 'D' : ['tabclose' , 'tab close'], + \ 'f' : ['bfirst' , 'first buffer'], + \ 'F' : ['tabfirst' , 'first tab'], + \ 'l' : ['blast' , 'last buffer'], + \ 'L' : ['tablast' , 'last tab'], + \ 'n' : ['bnext' , 'next buffer'], + \ 'N' : ['tabnext' , 'next tab'], + \ 'p' : ['bprevious' , 'previous buffer'], + \ 'P' : ['tabprevious' , 'previous tab'], + \ 'v' : [':Bdelete menu' , 'delete buffers (verbose)'], + \ } + +" fzf +let g:which_key_map.f = { + \ 'name' : '+Fzf' , + \ '/' : [':History/' , 'history'], + \ ';' : [':Commands' , 'commands'], + \ 'a' : [':Ag' , 'text Ag'], + \ 'b' : [':BLines' , 'current buffer'], + \ 'B' : [':Buffers' , 'open buffers'], + \ 'c' : [':Commits' , 'commits'], + \ 'C' : [':BCommits' , 'buffer commits'], + \ 'f' : [':Files!' , 'files'], + \ 'g' : [':GFiles' , 'git files'], + \ 'G' : [':GFiles?' , 'modified git files'], + \ 'h' : [':History' , 'file history'], + \ 'H' : [':History:' , 'command history'], + \ 'l' : [':Lines' , 'lines'] , + \ 'm' : [':Marks' , 'marks'] , + \ 'M' : [':Maps' , 'normal maps'] , + \ 'p' : [':Helptags' , 'help tags'] , + \ 'P' : [':Tags' , 'project tags'], + \ 's' : [':CocList snippets' , 'snippets'], + \ 'S' : [':Colors' , 'color schemes'], + \ 't' : [':Rg' , 'text Rg'], + \ 'T' : [':BTags' , 'buffer tags'], + \ 'w' : [':Windows' , 'search windows'], + \ 'y' : [':Filetypes' , 'file types'], + \ } + +" Sessions (Startify/Dashboard) +let g:which_key_map.s = { + \ 'name' : '+Session' , + \ 'c' : [':SClose' , 'close session'], + \ 'd' : [':SDelete' , 'delete session'], + \ 'l' : [':SLoad' , 'load session'], + \ 's' : [':SSave' , 'save session'], + \ } +" let g:which_key_map.s = { +" \ 'name' : '+Session' , +" \ 'l' : [':SessionLoad' , 'load session'], +" \ 's' : [':SessionSave' , 'save session'], +" \ } + +" Git commands +let g:which_key_map.g = { + \ 'name' : '+Git' , + \ 'a' : [':Git add .' , 'add all'], + \ 'A' : [':Git add %' , 'add current'], + \ 'b' : [':Git blame' , 'blame'], + \ 'B' : [':GBrowse' , 'browse'], + \ 'c' : [':Git commit' , 'commit'], + \ 'd' : [':Git diff' , 'diff'], + \ 'D' : [':Gdiffsplit' , 'diff split'], + \ 'f' : ['(GitGutterFold)' , 'fold'], + \ 'g' : [':GGrep' , 'git grep'], + \ 'h' : ['(GitGutterPreviewHunk)' , 'preview hunk'], + \ 'H' : ['(GitGutterStageHunk)' , 'stage hunk'], + \ 'j' : ['(GitGutterNextHunk)' , 'next hunk'], + \ 'k' : ['(GitGutterPrevHunk)' , 'prev hunk'], + \ 'l' : [':Git log' , 'log'], + \ 'L' : [':GitGutterLineHighlightsToggle' , 'lines toggle'], + \ 'm' : ['(git-messenger)' , 'git messages'], + \ 'p' : [':Git push' , 'push'], + \ 'P' : [':Git pull' , 'pull'], + \ 'r' : [':GRemove' , 'remove'], + \ 's' : [':Gstatus' , 'status'], + \ 't' : [':GitGutterSignsToggle' , 'signs toggle'], + \ 'T' : [':GitGutterLineNrHighlightsToggle' , 'linenr toggle'], + \ 'u' : ['(GitGutterUndoHunk)' , 'undo hunk'], + \ 'v' : [':GV' , 'view commits'], + \ 'V' : [':GV!' , 'view buffer commits'], + \ } + +" Coc commands +let g:which_key_map.l = { + \ 'name' : '+CoC' , + \ '.' : [':CocConfig' , 'config'], + \ ';' : ['(coc-refactor)' , 'refactor'], + \ 'a' : 'code action', + \ 'b' : [':CocNext' , 'next action'], + \ 'B' : [':CocPrev' , 'prev action'], + \ 'c' : [':CocList commands' , 'commands'], + \ 'd' : ['(coc-definition)' , 'definition'], + \ 'D' : ['(coc-declaration)' , 'declaration'], + \ 'e' : [':CocList extensions' , 'extensions'], + \ 'f' : ['(coc-format-selected)' , 'format selected'], + \ 'F' : ['(coc-format)' , 'format'], + \ 'h' : ['(coc-float-hide)' , 'hide'], + \ 'i' : ['(coc-implementation)' , 'implementation'], + \ 'I' : [':CocList diagnostics' , 'diagnostics'], + \ 'j' : ['(coc-float-jump)' , 'float jump'], + \ 'l' : ['(coc-codelens-action)' , 'code lens'], + \ 'n' : ['(coc-diagnostic-next)' , 'next diagnostic'], + \ 'N' : ['(coc-diagnostic-next-error)' , 'next error'], + \ 'o' : ['(coc-openlink)' , 'open link'], + \ 'O' : [':CocList outline' , 'outline'], + \ 'p' : ['(coc-diagnostic-prev)' , 'prev diagnostic'], + \ 'P' : ['(coc-diagnostic-prev-error)' , 'prev error'], + \ 'q' : ['(coc-fix-current)' , 'quickfix'], + \ 'r' : ['(coc-rename)' , 'rename'], + \ 'R' : ['(coc-references)' , 'references'], + \ 's' : [':CocList -I symbols' , 'references'], + \ 'S' : [':CocList snippets' , 'snippets'], + \ 't' : ['(coc-type-definition)' , 'type definition'], + \ 'u' : [':CocListResume' , 'resume list'], + \ 'U' : [':CocUpdate' , 'update CoC'], + \ 'z' : [':CocDisable' , 'disable CoC'], + \ 'Z' : [':CocEnable' , 'enable CoC'], + \ } + +" Floaterm +let g:which_key_map.m = { + \ 'name' : '+Terminal' , + \ ';' : [':FloatermNew --wintype=normal --height=10' , 'terminal'], + \ 'g' : [':FloatermNew lazygit' , 'git'], + \ 'd' : [':FloatermNew lazydocker' , 'docker'], + \ 'n' : [':FloatermNew node' , 'node'], + \ 'p' : [':FloatermNew python' , 'python'], + \ 't' : [':FloatermToggle' , 'toggle'], + \ 's' : [':FloatermNew ncdu --color=dark' , 'ncdu'], + \ 'c' : [':FloatermNew calcurse' , 'calcurse'], + \ } + +" Vim wiki +let g:which_key_map.w = { + \ 'name' : '+Wiki' , + \ 'i' : 'diary index', + \ 's' : 'UI select', + \ 't' : 'tab index', + \ 'w' : 'index', + \ } + +" Figlet/Toilet +let g:which_key_map.i = { + \ 'name' : '+Figlet' , + \ 's' : [':.!figlet -f standard' , 'standard'], + \ 'l' : [':.!figlet -f slant' , 'slant'], + \ 'b' : [':.!figlet -f banner' , 'banner'], + \ 'e' : [':.!figlet -f lean' , 'lean'], + \ 'p' : [':.!figlet -f speed' , 'speed'], + \ 'r' : [':.!figlet -f roman' , 'roman'], + \ 'd' : [':.!figlet -f doh' , 'doh'], + \ 'w' : [':.!figlet -f starwars' , 'starwars'], + \ 'm' : [':.!figlet -f morse' , 'morse'], + \ 'x' : [':.!toilet -f term -F border' , 'border'], + \ } + +let g:which_key_map.T = { + \ 'name' : '+Translate' , + \ 't' : 'to cmdline', + \ 'w' : 'to popup', + \ 'r' : 'replace text', + \ 'x' : 'to clipboard', + \ } + +" Table mode +let g:which_key_map.t = { + \ 'name' : '+TableMode' , + \ 'm' : 'toggle table mode', + \ 'r' : 'realign', + \ 't' : 'tableize', + \ 'd' : 'delete row', + \ 'c' : 'delete column', + \ 'i' : 'insert column', + \ 'k' : 'insert column before cursor', + \ 'f' : 'add formula', + \ 'e' : 'evaluate formula line', + \ } + +" cheat.sh +let g:which_key_map.K = { + \ 'name' : '+Cheatsheet', + \ } diff --git a/home/.config/nvim/plug-config/whitespace.vim b/home/.config/nvim/plug-config/whitespace.vim new file mode 100644 index 0000000..cc31d47 --- /dev/null +++ b/home/.config/nvim/plug-config/whitespace.vim @@ -0,0 +1,2 @@ +let g:better_whitespace_enabled=0 +let g:strip_whitespace_on_save=0 diff --git a/home/.config/nvim/plugin/autocmd.vim b/home/.config/nvim/plugin/autocmd.vim new file mode 100644 index 0000000..8b03f85 --- /dev/null +++ b/home/.config/nvim/plugin/autocmd.vim @@ -0,0 +1,24 @@ +" No continuous commenting +autocmd FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o +" Correct comment highlighting in .json files +autocmd FileType json syntax match Comment +\/\/.\+$+ +" Turn on spellcheck for markdown and tex files +autocmd BufNewFile,BufEnter,BufRead *.md,*.mkd setfiletype markdown +autocmd BufNewFile,BufEnter,BufRead *.tex setfiletype tex +augroup auto_spellcheck + autocmd BufNewFile,BufRead *.md,*.mkd setlocal spell + autocmd BufNewFile,BufRead *.tex setlocal spell +augroup END +" Edit binary files as hex in vim (taken from :h hex-editing) +" vim -b : edit binary using xxd-format! +" I might never use this feature -_- but :%!xxd and :%!xxd -r to toggle hex mode +augroup Binary + au! + au BufReadPre *.bin,*.exe let &bin=1 + au BufReadPost *.bin,*.exe if &bin | %!xxd + au BufReadPost *.bin,*.exe set ft=xxd | endif + au BufWritePre *.bin,*.exe if &bin | %!xxd -r + au BufWritePre *.bin,*.exe endif + au BufWritePost *.bin,*.exe if &bin | %!xxd + au BufWritePost *.bin,*.exe set nomod | endif +augroup END diff --git a/home/.config/nvim/plugin/keybindings.vim b/home/.config/nvim/plugin/keybindings.vim new file mode 100644 index 0000000..9d065bf --- /dev/null +++ b/home/.config/nvim/plugin/keybindings.vim @@ -0,0 +1,68 @@ +" ______ ______ _____ _________ +" ___ /___________ ____ /____(_)____________ /_______ +" __ //_/ _ \_ / / /_ __ \_ /__ __ \ __ /__ ___/ +" _ ,< / __/ /_/ /_ /_/ / / _ / / / /_/ / _(__ ) +" /_/|_| \___/_\__, / /_.___//_/ /_/ /_/\__,_/ /____/ +" /____/ +" +" Better escape +inoremap jk +inoremap kj +" Better Y +nmap Y y$ +" Basic file commands +nnoremap :!touch +nnoremap :!crf +nnoremap :!mkdir +nnoremap :!mv% +" Shorten default replace command +nnoremap :%s//g +" Delete trailing whitespace +nnoremap :%s/\s\+$//e +" Use alt + hjkl to resize windows +nnoremap :resize -2 +nnoremap :resize +2 +nnoremap :vertical resize -2 +nnoremap :vertical resize +2 +" Better window navigation +nnoremap h +nnoremap j +nnoremap k +nnoremap l +" Terminal window navigation +" tnoremap h +" tnoremap j +" tnoremap k +" tnoremap l +tnoremap +" Cancel actions +nnoremap +inoremap i +" Move between buffers +nnoremap :bnext +nnoremap :bprevious +" Just do it +cmap w!! w !sudo tee % +" Fix indenting visual block +vmap < >gv +" Move selected line / block of text in visual mode +xnoremap K :move '<-2gv-gv +xnoremap J :move '>+1gv-gv +" Bad hands +cnoreabbrev W! w! +cnoreabbrev Q! q! +cnoreabbrev Qall! qall! +cnoreabbrev Qa! qa! +cnoreabbrev QA! qa! +cnoreabbrev Wq wq +cnoreabbrev Wa wa +cnoreabbrev wQ wq +cnoreabbrev WQ wq +cnoreabbrev W w +cnoreabbrev Q q +cnoreabbrev Qall qall +cnoreabbrev Qa qa +cnoreabbrev QA qa +cnoreabbrev Wqa wqa +cnoreabbrev WQa wqa diff --git a/home/.config/nvim/vim-plug/vim-plug.vim b/home/.config/nvim/vim-plug/vim-plug.vim new file mode 100644 index 0000000..def5773 --- /dev/null +++ b/home/.config/nvim/vim-plug/vim-plug.vim @@ -0,0 +1,158 @@ +" _____ ______ +" ___ ____(_)______ ___ ___________ /___ ________ _ +" __ | / /_ /__ __ `__ \_______ __ \_ /_ / / /_ __ `/ +" __ |/ /_ / _ / / / / //___/_ /_/ / / / /_/ /_ /_/ / +" _____/ /_/ /_/ /_/ /_/ _ .___//_/ \__,_/ _\__, / +" /_/ /____/ +" +" Install vim-plug if missing +if empty(glob('$HOME/.local/share/nvim/site/autoload/plug.vim')) + silent !curl -fLo $HOME/.local/share/nvim/site/autoload/plug.vim --create-dirs + \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim +endif + +call plug#begin('$HOME/.local/share/nvim/plugged') + +" Colorschemes +Plug 'arcticicestudio/nord-vim' +Plug 'joshdick/onedark.vim' +" Status bar +" Plug 'vim-airline/vim-airline' +Plug 'glepnir/spaceline.vim' +" Devicons +Plug 'ryanoasis/vim-devicons' +" Tabline +Plug 'bagrat/vim-buffet' +" Startscreen +Plug 'glepnir/dashboard-nvim' +" Plug 'mhinz/vim-startify' +"================================================= +" Syntax +Plug 'sheerun/vim-polyglot' +Plug 'mechatroner/rainbow_csv' +Plug 'jackguo380/vim-lsp-cxx-highlight' +" Indent guide +Plug 'Yggdroot/indentLine' +" Whitespaces +Plug 'ntpeters/vim-better-whitespace' +" Highlight cursor +Plug 'RRethy/vim-illuminate' +" Colorize color codes +Plug 'norcalli/nvim-colorizer.lua' +" Parenthesis +Plug 'luochen1990/rainbow' +"================================================= +" Completion +Plug 'neoclide/coc.nvim', {'branch': 'release'} +" Linting +Plug 'dense-analysis/ale' +" Make +Plug 'tpope/vim-dispatch' +Plug 'ilyachur/cmake4vim' +" Snippets for coc-snippets +Plug 'honza/vim-snippets' +Plug 'dsznajder/vscode-es7-javascript-react-snippets', {'do': 'yarn install --frozen-lockfile && yarn compile'} +Plug 'sdras/vue-vscode-snippets' +Plug 'ashinzekene/vscode-nestjs-snippets' +Plug 'andys8/vscode-jest-snippets' +" Database support for coc-db +Plug 'tpope/vim-dadbod' +Plug 'kristijanhusak/vim-dadbod-ui' +" Variables/Functions preview +Plug 'liuchengxu/vista.vim' +" Coding doc generator +Plug 'kkoomen/vim-doge' +" Git +Plug 'airblade/vim-gitgutter' +Plug 'tpope/vim-fugitive' +Plug 'junegunn/gv.vim' +Plug 'rhysd/git-messenger.vim' +" Github news +" Plug 'junegunn/vim-github-dashboard' +" Gist on Github +" Plug 'mattn/webapi-vim' +" Plug 'mattn/vim-gist' +" Maintain project directory +Plug 'airblade/vim-rooter' +"================================================= +" Split lines +Plug 'AndrewRadev/splitjoin.vim' +" Multi-cursor +Plug 'mg979/vim-visual-multi', {'branch': 'master'} +" Comments +Plug 'tpope/vim-commentary' +" html tags, brackets +Plug 'mattn/emmet-vim' +Plug 'tpope/vim-surround' +Plug 'alvan/vim-closetag' +Plug 'AndrewRadev/tagalong.vim' +Plug 'Raimondi/delimitMate' +" Move around +Plug 'unblevable/quick-scope' +Plug 'justinmk/vim-sneak' +" Edit text in regions +" Plug 'chrisbra/NrrwRgn' +" Smooth scrolling +Plug 'psliwka/vim-smoothie' +" Alternative w,b,e +" Plug 'bkad/CamelCaseMotion' +" Spelling, dictionary +Plug 'voldikss/vim-translator' +" Plug 'reedes/vim-lexical' +" Plug 'ron89/thesaurus_query.vim' +" Align text +Plug 'junegunn/vim-easy-align' +"================================================= +" Fuzzy finder +Plug 'junegunn/fzf', { 'do': { -> fzf#install() } } +Plug 'junegunn/fzf.vim' +" Nerdtree +" Plug 'preservim/nerdtree' +" Plug 'Xuyuanp/nerdtree-git-plugin' +" Plug 'tiagofumo/vim-nerdtree-syntax-highlight' +" File managers +Plug 'kevinhwang91/rnvimr' +Plug 'vifm/vifm.vim' +" Plug 'mcchrish/nnn.vim' +" Change windows +Plug 't9md/vim-choosewin' +" Emacs like which key +Plug 'liuchengxu/vim-which-key', { 'on': ['WhichKey', 'WhichKey!'] } +" Better embbed terminal +Plug 'voldikss/vim-floaterm' +" Default replacing is a pain +Plug 'brooth/far.vim' +" Undotree +Plug 'mbbill/undotree' +" Quickly close buffers +Plug 'Asheq/close-buffers.vim' +" Cheatsheet +Plug 'dbeniamine/cheat.sh-vim' +"================================================= +" Live-server for html +" Run 'npm install --prefix server' in $HOME/.local/share/nvim/plugged/bracey.vim/ to install dependencies +Plug 'turbio/bracey.vim' +" Markdown +Plug 'mzlogin/vim-markdown-toc' +Plug 'iamcco/markdown-preview.nvim', { 'do': 'cd app & yarn install' } +" Pandoc integration / LaTex support +Plug 'vim-pandoc/vim-pandoc' +Plug 'vim-pandoc/vim-pandoc-syntax' +" Plug 'lervag/vimtex' +" Org mode +" Plug 'jceb/vim-orgmode' +" Writing mode +Plug 'junegunn/goyo.vim' +Plug 'junegunn/limelight.vim' +" Note taking +Plug 'vimwiki/vimwiki' +" Tables +Plug 'dhruvasagar/vim-table-mode' + +call plug#end() + +" Install missing plugins on startup +autocmd VimEnter * + \ if len(filter(values(g:plugs), '!isdirectory(v:val.dir)')) + \| PlugInstall --sync | q + \| endif diff --git a/home/.config/nwg-launchers/nwgbar/bar.json b/home/.config/nwg-launchers/nwgbar/bar.json new file mode 100644 index 0000000..c4a870b --- /dev/null +++ b/home/.config/nwg-launchers/nwgbar/bar.json @@ -0,0 +1,22 @@ +[ + { + "name": "Lock screen", + "exec": "swaylock", + "icon": "system-lock-screen" + }, + { + "name": "Logout", + "exec": "wayland-logout", + "icon": "system-log-out" + }, + { + "name": "Reboot", + "exec": "loginctl reboot", + "icon": "system-reboot" + }, + { + "name": "Shutdown", + "exec": "loginctl poweroff", + "icon": "system-shutdown" + } +] diff --git a/home/.config/nwg-launchers/nwgbar/style.css b/home/.config/nwg-launchers/nwgbar/style.css new file mode 100644 index 0000000..624ef57 --- /dev/null +++ b/home/.config/nwg-launchers/nwgbar/style.css @@ -0,0 +1,26 @@ +#bar { + margin: 30px; /* affects top/bottom & left/right alignment */ + font-family: Sarasa Fixed J; + font-size: 16pt +} + +button, image { + background: none; + border-style: none; + box-shadow: none; + color: #d8dee9 +} + +button { + padding-left: 10px; + padding-right: 10px; + margin: 5px +} + +button:hover { + background-color: rgba (255, 255, 255, 0.1) +} + +button:focus { + box-shadow: 0 0 2px; +} diff --git a/home/.config/nwg-launchers/nwggrid/style.css b/home/.config/nwg-launchers/nwggrid/style.css new file mode 100644 index 0000000..305a125 --- /dev/null +++ b/home/.config/nwg-launchers/nwggrid/style.css @@ -0,0 +1,46 @@ +button, label, image { + background: none; + border-style: none; + box-shadow: none; + color: #d8dee9; +} + +button { + padding: 5px; + margin: 5px; + font-family: Sarasa Fixed J; + font-size: 13pt +} + +button:hover { + background-color: rgba (255, 255, 255, 0.1); +} + +button:focus { + box-shadow: 0 0 2px; +} + +#searchbox { + background: none; + border-color: #d8dee9; + color: #d8dee9; + margin-top: 20px; + margin-bottom: 20px; + min-width: 400px; + font-family: Sarasa Fixed J; + font-size: 13pt +} + +#separator { + background-color: rgba(200, 200, 200, 0.5); + margin-left: 500px; + margin-right: 500px; + margin-top: 10px; + margin-bottom: 10px +} + +#description { + margin-bottom: 20px; + font-family: Sarasa Fixed J; + font-size: 13pt +} diff --git a/home/.config/nwg-launchers/nwggrid/term b/home/.config/nwg-launchers/nwggrid/term new file mode 100644 index 0000000..7997ddc --- /dev/null +++ b/home/.config/nwg-launchers/nwggrid/term @@ -0,0 +1 @@ +alacritty diff --git a/home/.config/picom.conf b/home/.config/picom.conf new file mode 100644 index 0000000..27aaa70 --- /dev/null +++ b/home/.config/picom.conf @@ -0,0 +1,78 @@ +# Backend to use: "xrender" or "glx". +# GLX backend is typically much faster but depends on a sane driver. +backend = "glx"; +glx-no-stencil = true; +glx-copy-from-front = false; +glx-no-rebind-pixmap = true; +vsync = true; +refresh-rate = 0; +dbe = false; + +# Round corners +detect-rounded-corners = true; +round-borders = 1; +corner-radius = 10; +rounded-corners-exclude = [ + "class_g = 'Dunst'", + "class_g = 'spectrwm'", + "class_g = 'Polybar'", + "window_type = 'desktop'", + "window_type = 'toolip'" +]; + +# Shadow +shadow = true; +shadow-radius = 10; +shadow-offset-x = -5; +shadow-offset-y = -5; +shadow-opacity = 0.75; +shadow-exclude = [ ]; + +# Fading +fading = true; +# fade-delta = 0.25; +fade-in-step = 0.07; +fade-out-step = 0.07; +fade-exclude = [ + "class_g = 'Dunst'", + "class_g = 'Polybar'", + "window_type = 'menu'", + "window_type = 'dropdown_menu'", + "window_type = 'popup_menu'", + "window_type = 'dock'", + "window_type = 'tooltip'" +]; + +# Opacity +active-opacity = 0.95; +inactive-opacity = 0.95; +frame-opacity = 0.95; +inactive-opacity-override = false; +opacity-rule = [ + "100:window_type = 'popup_menu'", + "100:window_type = 'dropdown_menu'", + "100:window_type = 'desktop'", + "100:class_g = 'st-256color'", + "100:class_g = 'kitty'", + "95:class_g = 'Alacritty'", + "100:class_g = 'Termite'", + "100:class_g = 'Dunst'", + "95:class_g = 'Polybar'", + "0:_NET_WM_STATE@:32a *= '_NET_WM_STATE_HIDDEN'" +]; +detect-client-opacity = true; +detect-transient = true; +detect-client-leader = true; +invert-color-include = [ ]; +use-damage = true; +mark-wmwin-focused = false; +mark-ovredir-focused = false; + +# Blur background. Prefered GLX-backend +blur: { + method = "dual_kawase"; + strength = 5; + background = false; + background_frame = false; + background_fixed = false; +}; diff --git a/home/.config/polybar/nord/bluetooth.sh b/home/.config/polybar/nord/bluetooth.sh new file mode 100755 index 0000000..4d96107 --- /dev/null +++ b/home/.config/polybar/nord/bluetooth.sh @@ -0,0 +1,13 @@ +#!/bin/sh + +if [ $(bluetoothctl show | grep "Powered: yes" | wc -c) -eq 0 ] +then + echo "" +else + if [ $(echo info | bluetoothctl | grep 'Device' | wc -c) -eq 0 ] + then + echo "%{F#bf616a}" + else + echo "%{F#81a1c1}" + fi +fi diff --git a/home/.config/polybar/nord/config.ini b/home/.config/polybar/nord/config.ini new file mode 100644 index 0000000..4d4846c --- /dev/null +++ b/home/.config/polybar/nord/config.ini @@ -0,0 +1,250 @@ +; ________ ______ ______ +; ___ __ \________ /____ ____ /_______ ________ +; __ /_/ / __ \_ /__ / / /_ __ \ __ `/_ ___/ +; _ ____// /_/ / / _ /_/ /_ /_/ / /_/ /_ / +; /_/ \____//_/ _\__, / /_.___/\__,_/ /_/ +; /____/ + +[bar/mainbar] +background = #2e3440 +font-0 = "Iosevka Nerd Font:style=Regular:size=13:antialias=true;3" +font-1 = "Sarasa Fixed J:style=Regular:size=13:antialias=true;3" +height = 30 +modules-left = date weather vpn keyboard +modules-center = bsp +modules-right = cpu ram pulse battery ethernet wifi bluetooth mnt +module-margin = 1 +padding = 1 +tray-position = none +monitor = eDP-1 +wm-restack = bspwm +fixed-center = true +; width = 99% +; offset-y = 1% +; offset-x = 0.5% +underline-size = 0 +overline-size = 0 + +[bar/sidebar] +background = #2e3440 +font-0 = "Iosevka Nerd Font:style=Regular:size=13:antialias=true;3" +height = 30 +modules-center = bsp +monitor = HDMI-2 +tray-position = none +ws-restack = bspwm +fixed-center = true +; width = 99% +; offset-y = 1% +; offset-x = 0.5% +underline-size = 0 +overline-size = 0 + +[module/keyboard] +type = internal/xkeyboard +blacklist-0 = scroll lock +label-layout = %layout% +label-layout-padding = 0 +label-layout-foreground = #88c0d0 +label-indicator-on-capslock = Caps +label-indicator-off-capslock = +label-indicator-on-capslock-foreground = #88c0d0 +label-indicator-on-numlock = +label-indicator-off-numlock = !Num +label-indicator-off-numlock-foreground = #88c0d0 + +[module/bluetooth] +type = custom/script +exec = ~/.config/polybar/nord/bluetooth.sh +interval = 5 +format-foreground = #bf616a + +[module/mnt] +type = custom/script +exec = ~/.config/polybar/nord/mount.sh +interval = 5 +format-foreground = #bf616a + +; [module/temp] +; type = internal/temperature +; interval = 0.5 +; format =