diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 00000000..b2dadf30 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,9 @@ +root = true + +[*] +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true +indent_style = space +indent_size = 2 diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..c2658d7d --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +node_modules/ diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 674e4c51..00000000 --- a/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "dotdrop"] - path = dotdrop - url = https://github.com/deadc0de6/dotdrop.git diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100755 index 00000000..79df10e4 --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,50 @@ +#!/bin/sh + +# Source husky +# shellcheck disable=SC1091 +. "$(dirname -- "$0")/_/husky.sh" + +echo "FunctionalHacker's dotfile pre-commit hook start" +printf "Using shell: %s \n" "$(readlink /proc/$$/exe)" + +# All staged files +staged_files=$(git diff --name-only --cached --diff-filter=d) + +# Run taplo on staged TOML files +staged_toml=$(echo "$staged_files" | grep '.toml$' || true) +num_staged_toml=$(echo "$staged_toml" | grep -vce '^$' || true) +if [ "$num_staged_toml" -gt 0 ]; then + printf '\nFormatting %s staged TOML files with taplo\n' "$num_staged_toml" + taplo format "$staged_toml" + printf "Re-staging\n" + git add $staged_toml +fi + +# Run lua-format on staged Lua files +staged_lua=$(echo "$staged_files" | grep '.lua$' || true) +num_staged_lua=$(echo "$staged_lua" | grep -vce '^$' || true) +if [ "$num_staged_lua" -gt 0 ]; then + printf '\nFormatting %s staged Lua files with stylua\n' "$num_staged_lua" + + for file in $staged_lua; do + stylua "$file" + done + + printf "Re-staging\n\n" + git add $staged_lua +fi + +# Run shfmt on staged shell scripts +staged_sh=$(echo "$staged_files" | grep -E '(.sh$|pre-commit)' || true) +num_staged_sh=$(echo "$staged_sh" | grep -vce '^$' || true) +if [ "$num_staged_sh" -gt 0 ]; then + printf '\nFormatting %s staged shell scripts with shfmt\n' "$num_staged_sh" + shfmt -w $staged_sh + printf "Re-staging\n\n" + git add $staged_sh +fi + +# Run prettier on all other staged files +# that are supported +printf "\nRunning prettier on all supported files\n" +npx pretty-quick --staged diff --git a/.ignore b/.ignore new file mode 100644 index 00000000..6c41465d --- /dev/null +++ b/.ignore @@ -0,0 +1 @@ +dotdrop/ diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 00000000..2fd7d0d7 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,3 @@ +package-lock.json +lazy-lock.json +dotdrop/ diff --git a/.prettierrc.toml b/.prettierrc.toml new file mode 100644 index 00000000..30508e6c --- /dev/null +++ b/.prettierrc.toml @@ -0,0 +1,4 @@ +"$schema" = "https://json.schemastore.org/prettierrc.json" +trailingComma = "es5" +singleQuote = true +tabWidth = 2 diff --git a/LICENSE b/LICENSE deleted file mode 100644 index a5efa078..00000000 --- a/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2019 Marko Korhonen - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/LICENSE.adoc b/LICENSE.adoc new file mode 100644 index 00000000..276f8d35 --- /dev/null +++ b/LICENSE.adoc @@ -0,0 +1,14 @@ +== The MIT License (MIT) + +Copyright (c) {localyear} Marko Korhonen + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), +to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/README.adoc b/README.adoc new file mode 100644 index 00000000..5e0b5219 --- /dev/null +++ b/README.adoc @@ -0,0 +1,23 @@ += FunctionalHacker's dotfiles + +image:https://i.imgur.com/lz1Q4Zz.png?raw=true%22[screenshot of my +setup] + +My personal dotfiles for my workstations, mostly for easy access for +myself but feel free to steal them for yourself! + +I’m using https://github.com/deadc0de6/dotdrop[dotdrop] to manage and +ease deployment of my dotfiles. + +== Mirrors + +This repository lives at https://git.korhonen.cc/FunctionalHacker/dotfiles[my git server], +but it is also mirrored to: + +* https://gitlab.com/FunctionalHacker/dotfiles[GitLab] +* https://github.com/FunctionalHacker/dotfiles[GitHub] +* https://bitbucket.org/FunctionalHacker/dotfiles[Bitbucket] +* https://codeberg.org/FunctionalHacker/dotfiles[codeberg] + +If you have any ideas for improvements, questions or anything of this +sort, you can open an issue or a pull request at any of the mirrors. diff --git a/README.md b/README.md deleted file mode 100644 index 95bde0c9..00000000 --- a/README.md +++ /dev/null @@ -1,16 +0,0 @@ -# ReekyMarko's dotfiles -![screenshot of my setup](https://i.imgur.com/lz1Q4Zz.png?raw=true") - -My personal dotfiles for my workstations, mostly for easy access for myself -but feel free to steal them for yourself! - -I'm using [dotdrop](https://github.com/deadc0de6/dotdrop) to manage and ease deployment of my dotfiles. - -## Mirrors -This repository lives at [ReekyNET Git](https://git.reekynet.com/ReekyMarko/dotfiles), but it is also mirrored to: -- [GitLab](https://gitlab.com/ReekyMarko/dotfiles) -- [GitHub](https://github.com/ReekyMarko/dotfiles) -- [Bitbucket](https://bitbucket.org/ReekyMarko/dotfiles) -- [codeberg](https://codeberg.org/ReekyMarko/dotfiles) - -If you have any ideas for improvements, questions or anything of this sort, you can open an issue or a pull request in either ReekyNET Git (registrations open for anyone), or any of the mirrors. diff --git a/config-home.yaml b/config-home.yaml deleted file mode 100644 index b130afa7..00000000 --- a/config-home.yaml +++ /dev/null @@ -1,248 +0,0 @@ -actions: - vim-plug: nvim +PlugInstall +qall - zplug: zplug install - waybar: systemctl --user restart waybar - mako: systemctl --user restart mako -config: - backup: true - banner: true - create: true - dotpath: home - ignoreempty: false - keepdot: true - link_dotfile_default: nolink - link_on_import: nolink - longkey: false - showdiff: false - workdir: ~/.config/dotdrop -dotfiles: - d_systemd: - dst: ~/.config/systemd/user - src: .config/systemd/user - d_mpv: - dst: ~/.config/mpv - src: .config/mpv - d_nvim_config: - actions: - - vim-plug - dst: ~/.config/nvim/conf.d - src: .config/nvim/conf.d - d_scripts: - dst: ~/Scripts - src: Scripts - d_sway: - dst: ~/.config/sway - src: .config/sway - d_ticons: - dst: ~/.local/share/TelegramDesktop/tdata/ticons - src: .local/share/TelegramDesktop/tdata/ticons - d_waybar: - actions: - - waybar - dst: ~/.config/waybar - src: .config/waybar - f_abcde.conf: - dst: ~/.abcde.conf - src: .abcde.conf - f_alacritty.yml: - dst: ~/.config/alacritty/alacritty.yml - src: .config/alacritty/alacritty.yml - f_authorized_keys: - dst: ~/.ssh/authorized_keys - src: .ssh/authorized_keys - f_beets_config: - dst: ~/.config/beets/config.yaml - src: .config/beets/config.yaml - f_beets_whitelist: - dst: ~/.config/beets/whitelist - src: .config/beets/whitelist - f_bspwmrc: - dst: ~/.config/bspwm/bspwmrc - src: .config/bspwm/bspwmrc - f_coc-settings.json: - dst: ~/.config/nvim/coc-settings.json - src: .config/nvim/coc-settings.json - f_gitconfig: - dst: ~/.gitconfig - src: .gitconfig - f_init.vim: - dst: ~/.config/nvim/init.vim - src: .config/nvim/init.vim - f_libra_config: - dst: ~/.config/libra/config.toml - src: .config/libra/config.toml - f_mailcap: - dst: ~/.mailcap - src: .mailcap - f_makepkg.conf: - dst: ~/.config/pacman/makepkg.conf - src: .config/pacman/makepkg.conf - f_mako_config: - dst: ~/.config/mako/config - src: .config/mako/config - actions: - - mako - f_mimeo_associations.txt: - dst: ~/.config/mimeo/associations.txt - src: .config/mimeo/associations.txt - f_mpd.conf: - dst: ~/.config/mpd/mpd.conf - src: .config/mpd/mpd.conf - f_mpdris2.conf: - dst: ~/.config/mpDris2/mpDris2.conf - src: .config/mpDris2/mpDris2.conf - f_mpdscribble.conf: - dst: ~/.mpdscribble/mpdscribble.conf - src: .mpdscribble/mpdscribble.conf - f_ncmpcpp_bindings: - dst: ~/.config/ncmpcpp/bindings - src: .config/ncmpcpp/bindings - f_ranger.conf: - dst: ~/.config/ranger/rc.conf - src: .config/ranger/rc.conf - f_ranger_commands.py: - dst: ~/.config/ranger/commands.py - src: .config/ranger/commands.py - f_redshift.conf: - dst: ~/.config/redshift/redshift.conf - src: .config/redshift/redshift.conf - f_rofi-pass.conf: - dst: ~/.config/rofi-pass/config - src: .config/rofi-pass/config - f_rtv.cfg: - dst: ~/.config/rtv/rtv.cfg - src: .config/rtv/rtv.cfg - f_ssh.conf: - dst: ~/.ssh/config - src: .ssh/config - f_steam-native.desktop: - dst: ~/.local/share/applications/steam-native.desktop - src: .local/share/applications/steam-native.desktop - f_tdesktop_lang.strings: - dst: ~/.config/telegram-desktop/lang.strings - src: .config/telegram-desktop/lang.strings - f_tmux.conf: - dst: ~/.tmux.conf - src: .tmux.conf - f_yay_config.json: - dst: ~/.config/yay/config.json - src: .config/yay/config.json - f_youtube-dl_config: - dst: ~/.config/youtube-dl/config - src: .config/youtube-dl/config - f_youtube-viewer.conf: - dst: ~/.config/youtube-viewer/youtube-viewer.conf - src: .config/youtube-viewer/youtube-viewer.conf - f_zathurarc: - dst: ~/.config/zathura/zathurarc - src: .config/zathura/zathurarc - f_zprofile: - dst: ~/.zprofile - src: .zprofile - f_zshrc: - dst: ~/.zshrc - src: .zshrc - d_rofi: - src: .config/rofi - dst: ~/.config/rofi - d_zsh: - src: .config/zsh - dst: ~/.config/zsh - f_fonts.conf: - src: .config/fontconfig/fonts.conf - dst: ~/.config/fontconfig/fonts.conf - f_ignore: - src: .ignore - dst: ~/.ignore - f_nvimpager_init.vim: - src: .config/nvimpager/init.vim - dst: ~/.config/nvimpager/init.vim - f_ncmpcpp.conf: - src: .config/ncmpcpp/config - dst: ~/.config/ncmpcpp/config - d_efistub: - src: .EFISTUB - dst: ~/.EFISTUB - f_hushlogin: - src: .hushlogin - dst: ~/.hushlogin -profiles: - Base: - dotfiles: - - d_systemd - Media: - dotfiles: - - f_beets_config - - f_beets_whitelist - - f_abcde.conf - - d_mpv - - f_youtube-dl_config - - f_mpd.conf - - f_ncmpcpp_bindings - - f_ncmpcpp.conf - - f_libra_config - - f_mpdscribble.conf - - f_mpdris2.conf - - f_youtube-viewer.conf - Sway: - dotfiles: - - d_sway - - d_waybar - - d_rofi - - f_mako_config - - f_redshift.conf - - f_rofi-pass.conf - - f_zathurarc - - f_mimeo_associations.txt - - f_tdesktop_lang.strings - - f_fonts.conf - Pacman: - dotfiles: - - f_yay_config.json - - f_makepkg.conf - Mirkwood: - dotfiles: - - d_efistub - include: - - Base - - Terminal - - Media - - Sway - - Pacman - ReekyRaspberry: - include: - - Terminal - Rivendell: - include: - - Terminal - - Media - - Pacman - Terminal: - dotfiles: - - f_nvimpager_init.vim - - f_hushlogin - - f_ignore - - f_ranger_commands.py - - f_rtv.cfg - - f_mailcap - - d_zsh - - f_zshrc - - f_tmux.conf - - f_gitconfig - - f_ranger.conf - - f_ssh.conf - - f_authorized_keys - - d_scripts - - d_nvim_config - - f_init.vim - - f_coc-settings.json - - f_gitconfig - - f_alacritty.yml - AnittaPC: - include: - - Terminal - - Pacman - TakamakiPC: - include: - - Terminal - - Pacman diff --git a/config-root.toml b/config-root.toml new file mode 100644 index 00000000..0faab602 --- /dev/null +++ b/config-root.toml @@ -0,0 +1,282 @@ +[actions] +mkinitcpio = "mkinitcpio -P" + +[config] +backup = true +banner = true +create = true +dotpath = "root" +ignoreempty = false +keepdot = true +link_dotfile_default = "nolink" +link_on_import = "nolink" +longkey = false +showdiff = false +workdir = "~/.config/sdotdrop" + +[dotfiles."f_60-uinput-permissions.rules"] +dst = "/etc/udev/rules.d/60-uinput-permissions.rules" +src = "etc/udev/rules.d/60-uinput-permissions.rules" + +[dotfiles."f_yubikey_udev.rules"] +dst = "/etc/udev/rules.d/20-yubikey.rules" +src = "etc/udev/rules.d/20-yubikey.rules" + +[dotfiles.d_bin] +dst = "/usr/local/bin" +src = "usr/local/bin" + +[dotfiles.d_network] +src = "etc/systemd/network" +dst = "/etc/systemd/network" + +[dotfiles."f_networkd.conf"] +src = "etc/systemd/networkd.conf" +dst = "/etc/systemd/networkd.conf" + +[dotfiles."f_99-sysctl.conf"] +dst = "/etc/sysctl.d/99-sysctl.conf" +src = "etc/sysctl.d/99-sysctl.conf" + +[dotfiles."f_adb.service"] +dst = "/etc/systemd/system/adb.service" +src = "etc/systemd/system/adb.service" + +[dotfiles."f_clamd.conf"] +dst = "/etc/clamav/clamd.conf" +src = "etc/clamav/clamd.conf" + +[dotfiles.f_cryptissue] +dst = "/etc/cryptissue" +src = "etc/cryptissue" + +[dotfiles."f_detected.sh"] +dst = "/etc/clamav/detected.sh" +src = "etc/clamav/detected.sh" + +[dotfiles."f_freetype2.sh"] +dst = "/etc/profile.d/freetype2.sh" +src = "etc/profile.d/freetype2.sh" + +[dotfiles."f_fonts.conf"] +dst = "/etc/fonts/local.conf" +src = "etc/fonts/local.conf" + +[dotfiles."f_locale.conf"] +dst = "/etc/locale.conf" +src = "etc/locale.conf" + +[dotfiles."f_locale.gen"] +dst = "/etc/locale.gen" +src = "etc/locale.gen" + +[dotfiles."f_logind.conf"] +dst = "/etc/systemd/logind.conf" +src = "etc/systemd/logind.conf" + +[dotfiles."f_bluetooth.conf"] +dst = "/etc/bluetooth/main.conf" +src = "etc/bluetooth/main.conf" + +[dotfiles."f_pacman.conf"] +dst = "/etc/pacman.conf" +src = "etc/pacman.conf" + +[dotfiles.f_pacman_zsh_hook] +dst = "/etc/pacman.d/hooks/zsh.hook" +src = "etc/pacman.d/hooks/zsh.hook" + +[dotfiles."f_plymouthd.conf"] +src = "etc/plymouth/plymouthd.conf" +dst = "/etc/plymouth/plymouthd.conf" + +[dotfiles.f_sshd_config] +dst = "/etc/ssh/sshd_config" +src = "etc/ssh/sshd_config" + +[dotfiles."f_welcomemessage.conf"] +dst = "/etc/welcomemessage.conf" +src = "etc/welcomemessage.conf" + +[dotfiles."f_99-conbee-usb-serial.rules"] +src = "etc/udev/rules.d/99-conbee-usb-serial.rules" +dst = "/etc/udev/rules.d/99-conbee-usb-serial.rules" + +[dotfiles."f_99-lowbat.rules"] +src = "etc/udev/rules.d/99-lowbat.rules" +dst = "/etc/udev/rules.d/99-lowbat.rules" + +[dotfiles."f_sleep.conf"] +src = "etc/systemd/sleep.conf" +dst = "/etc/systemd/sleep.conf" + +[dotfiles.f_fstab] +src = "etc/fstab" +dst = "/etc/fstab" + +[dotfiles.f_ignore] +src = ".ignore" +dst = "/.ignore" + +[dotfiles."f_mkinitcpio.conf"] +src = "etc/mkinitcpio.conf" +dst = "/etc/mkinitcpio.conf" +actions = ["mkinitcpio"] + +[dotfiles."f_vconsole.conf"] +src = "etc/vconsole.conf" +dst = "/etc/vconsole.conf" + +[dotfiles."f_20-quiet-printk.conf"] +src = "etc/sysctl.d/20-quiet-printk.conf" +dst = "/etc/sysctl.d/20-quiet-printk.conf" + +[dotfiles."f_system.conf"] +src = "etc/systemd/system.conf" +dst = "/etc/systemd/system.conf" + +[dotfiles.f_cpupower] +src = "etc/default/cpupower" +dst = "/etc/default/cpupower" + +[dotfiles."f_pacserve.service.conf"] +src = "etc/pacserve/pacserve.service.conf" +dst = "/etc/pacserve/pacserve.service.conf" + +[dotfiles."f_mkinitcpio_linux.preset"] +src = "etc/mkinitcpio.d/linux.preset" +dst = "/etc/mkinitcpio.d/linux.preset" + +[dotfiles.f_cmdline] +src = "etc/kernel/cmdline" +dst = "/etc/kernel/cmdline" +actions = ["mkinitcpio"] + +[dotfiles."f_timesyncd.conf"] +src = "etc/systemd/timesyncd.conf" +dst = "/etc/systemd/timesyncd.conf" + +[dotfiles.f_sudoers_pacman] +src = "etc/sudoers.d/pacman" +dst = "/etc/sudoers.d/pacman" + +[dotfiles."f_doas.conf"] +src = "etc/doas.conf" +dst = "/etc/doas.conf" + +[dotfiles."f_flexo.toml"] +src = "etc/flexo/flexo.toml" +dst = "/etc/flexo/flexo.toml" + +[profiles.locale] +dotfiles = ["f_locale.conf", "f_locale.gen"] + +[profiles.pacman] +dotfiles = [ + "f_pacman.conf", + "f_pacman_zsh_hook", + "f_pacserve.service.conf", + "f_sudoers_pacman", +] + +[profiles.Mirkwood] +dotfiles = [ + "d_bin", + "f_20-quiet-printk.conf", + "f_60-uinput-permissions.rules", + "f_99-lowbat.rules", + "f_adb.service", + "f_bluetooth.conf", + "f_cmdline", + "f_cpupower", + "f_cryptissue", + "f_doas.conf", + "f_fonts.conf", + "f_freetype2.sh", + "f_ignore", + "f_logind.conf", + "f_mkinitcpio.conf", + "f_mkinitcpio_linux.preset", + "f_plymouthd.conf", + "f_sshd_config", + "f_system.conf", + "f_timesyncd.conf", + "f_welcomemessage.conf", + "f_flexo.toml", +] +include = ["locale", "pacman"] + +[profiles.VentoyArch] +dotfiles = [ + "d_bin", + "f_cmdline", + "f_doas.conf", + "f_fonts.conf", + "f_freetype2.sh", + "f_ignore", + "f_logind.conf", + "f_mkinitcpio.conf", + "f_mkinitcpio_linux.preset", + "f_plymouthd.conf", + "f_system.conf", + "f_timesyncd.conf", +] +include = ["locale", "pacman"] + +[profiles.Shire] +dotfiles = [ + "d_bin", + "f_20-quiet-printk.conf", + "f_60-uinput-permissions.rules", + "f_99-lowbat.rules", + "f_adb.service", + "f_bluetooth.conf", + "f_cmdline", + "f_cpupower", + "f_doas.conf", + "f_fonts.conf", + "f_freetype2.sh", + "f_ignore", + "f_logind.conf", + "f_mkinitcpio.conf", + "f_mkinitcpio_linux.preset", + "f_plymouthd.conf", + "f_sshd_config", + "f_system.conf", +] +include = ["locale", "pacman"] + +[profiles.Moria] +include = ["locale", "pacman"] +dotfiles = [ + "f_99-sysctl.conf", + "f_cmdline", + "f_cpupower", + "f_doas.conf", + "f_adb.service", + "f_mkinitcpio.conf", + "f_mkinitcpio_linux.preset", + "f_plymouthd.conf", + "f_sshd_config", + "f_flexo.toml", +] + +[profiles.Tirion] +dotfiles = ["f_doas.conf", "f_ignore", "f_sshd_config"] + +[profiles.Gondor] +include = ["locale", "pacman"] +dotfiles = ["f_doas.conf", "f_sshd_config"] + +[profiles.localhost] +include = ["locale"] + +[profiles.Edoras] +include = ["pacman"] + +[profiles.mko-laptop] +dotfiles = ["f_cpupower", "f_doas.conf", "f_timesyncd.conf"] + +[profiles.Evendim] +include = ["locale", "pacman"] +dotfiles = ["f_doas.conf", "f_sshd_config"] diff --git a/config-root.yaml b/config-root.yaml deleted file mode 100644 index 8b911673..00000000 --- a/config-root.yaml +++ /dev/null @@ -1,170 +0,0 @@ -config: - backup: true - banner: true - create: true - dotpath: root - ignoreempty: false - keepdot: true - link_dotfile_default: nolink - link_on_import: nolink - longkey: false - showdiff: false - workdir: ~/.config/sdotdrop -dotfiles: - f_60-uinput-permissions.rules: - dst: /etc/udev/rules.d/60-uinput-permissions.rules - src: etc/udev/rules.d/60-uinput-permissions.rules - d_bin: - dst: /usr/local/bin - src: usr/local/bin - f_99-sysctl.conf: - dst: /etc/sysctl.d/99-sysctl.conf - src: etc/sysctl.d/99-sysctl.conf - f_adb.service: - dst: /etc/systemd/system/adb.service - src: etc/systemd/system/adb.service - f_clamd.conf: - dst: /etc/clamav/clamd.conf - src: etc/clamav/clamd.conf - f_cryptissue: - dst: /etc/cryptissue - src: etc/cryptissue - f_detected.sh: - dst: /etc/clamav/detected.sh - src: etc/clamav/detected.sh - f_environment: - dst: /etc/environment - src: etc/environment - f_freetype2.sh: - dst: /etc/profile.d/freetype2.sh - src: etc/profile.d/freetype2.sh - f_iwd@.service: - dst: /etc/systemd/system/iwd@.service - src: etc/systemd/system/iwd@.service - f_loader.conf: - dst: /boot/loader/loader.conf - src: boot/loader/loader.conf - f_fonts.conf: - dst: /etc/fonts/local.conf - src: etc/fonts/local.conf - f_locale.conf: - dst: /etc/locale.conf - src: etc/locale.conf - f_locale.gen: - dst: /etc/locale.gen - src: etc/locale.gen - f_logind.conf: - dst: /etc/systemd/logind.conf - src: etc/systemd/logind.conf - f_bluetooth.conf: - dst: /etc/bluetooth/main.conf - src: etc/bluetooth/main.conf - f_pacman.conf: - dst: /etc/pacman.conf - src: etc/pacman.conf - f_pacserve.service.conf: - dst: /etc/pacserve/pacserve.service.conf - src: etc/pacserve/pacserve.service.conf - f_sshd_config: - dst: /etc/ssh/sshd_config - src: etc/ssh/sshd_config - f_timesyncd.conf: - dst: /etc/systemd/timesyncd.conf - src: etc/systemd/timesyncd.conf - f_welcomemessage.conf: - dst: /etc/welcomemessage.conf - src: etc/welcomemessage.conf - f_getty.conf: - src: etc/systemd/system/getty@tty1.service.d/override.conf - dst: /etc/systemd/system/getty@tty1.service.d/override.conf - f_99-conbee-usb-serial.rules: - src: etc/udev/rules.d/99-conbee-usb-serial.rules - dst: /etc/udev/rules.d/99-conbee-usb-serial.rules - f_99-lowbat.rules: - src: etc/udev/rules.d/99-lowbat.rules - dst: /etc/udev/rules.d/99-lowbat.rules - f_sleep.conf: - src: etc/systemd/sleep.conf - dst: /etc/systemd/sleep.conf - f_fstab: - src: etc/fstab - dst: /etc/fstab - f_ignore: - src: .ignore - dst: /.ignore - f_pacman-dl.service: - src: etc/systemd/system/pacman-dl.service - dst: /etc/systemd/system/pacman-dl.service - f_pacman-dl.timer: - src: etc/systemd/system/pacman-dl.timer - dst: /etc/systemd/system/pacman-dl.timer - f_zsh.hook: - src: etc/pacman.d/hooks/zsh.hook - dst: /etc/pacman.d/hooks/zsh.hook - f_nightly-reboot.service: - src: etc/systemd/system/nightly-reboot.service - dst: /etc/systemd/system/nightly-reboot.service - f_nightly-reboot.timer: - src: etc/systemd/system/nightly-reboot.timer - dst: /etc/systemd/system/nightly-reboot.timer - f_mkinitcpio.conf: - src: etc/mkinitcpio.conf - dst: /etc/mkinitcpio.conf - f_vconsole.conf: - src: etc/vconsole.conf - dst: /etc/vconsole.conf - f_20-quiet-printk.conf: - src: etc/sysctl.d/20-quiet-printk.conf - dst: /etc/sysctl.d/20-quiet-printk.conf -profiles: - Locale: - dotfiles: - - f_locale.conf - - f_locale.gen - Pacman: - dotfiles: - - f_pacman.conf - - f_pacserve.service.conf - - f_pacman-dl.service - - f_pacman-dl.timer - Mirkwood: - dotfiles: - - f_getty.conf - - f_environment - - f_cryptissue - - f_welcomemessage.conf - - d_bin - - f_adb.service - - f_bluetooth.conf - - f_iwd@.service - - f_loader.conf - - f_sshd_config - - f_logind.conf - - f_60-uinput-permissions.rules - - f_freetype2.sh - - f_fonts.conf - - f_timesyncd.conf - - f_99-sysctl.conf - - f_99-lowbat.rules - - f_ignore - - f_zsh.hook - - f_mkinitcpio.conf - - f_vconsole.conf - - f_20-quiet-printk.conf - include: - - Locale - - Pacman - Rivendell: - include: - - Locale - - Pacman - dotfiles: - - f_getty.conf - - f_vconsole.conf - - f_mkinitcpio.conf - - f_bluetooth.conf - - f_60-uinput-permissions.rules - - f_timesyncd.conf - - f_sshd_config - - f_nightly-reboot.service - - f_nightly-reboot.timer diff --git a/config.toml b/config.toml new file mode 100644 index 00000000..2490cd9c --- /dev/null +++ b/config.toml @@ -0,0 +1,285 @@ +#:schema ../../dotdrop-config-schema.json + +[actions] +dconf-load = "dconf load / < ~/.config/dconf.ini" +kanagawa-compile = "vim +KanagawaCompile +qa" + +[config] +backup = true +banner = true +create = true +dotpath = "home" +ignoreempty = false +keepdot = true +link_dotfile_default = "nolink" +link_on_import = "nolink" +longkey = false +showdiff = false +workdir = "~/.config/dotdrop" + +[dotfiles.d_systemd] +dst = "~/.config/systemd/user" +src = ".config/systemd/user" + +[dotfiles.d_mpv] +dst = "~/.config/mpv" +src = ".config/mpv" + +[dotfiles.d_nvim] +dst = "~/.config/nvim" +src = ".config/nvim" +actions = ["kanagawa-compile"] +instignore = ["*-lock.json"] + +[dotfiles."f_abcde.conf"] +dst = "~/.abcde.conf" +src = ".abcde.conf" + +[dotfiles.d_ssh] +dst = "~/.ssh" +src = ".ssh" + +[dotfiles.f_beets_config] +dst = "~/.config/beets/config.yaml" +src = ".config/beets/config.yaml" + +[dotfiles.f_beets_whitelist] +dst = "~/.config/beets/whitelist" +src = ".config/beets/whitelist" + +[dotfiles.f_gitconfig] +dst = "~/.config/git/config" +src = ".config/git/config" + +[dotfiles.f_librewolf_overrides] +dst = "~/.librewolf/librewolf.overrides.cfg" +src = ".librewolf/librewolf.overrides.cfg" + +[dotfiles."f_makepkg.conf"] +dst = "~/.config/pacman/makepkg.conf" +src = ".config/pacman/makepkg.conf" + +[dotfiles."f_mpd.conf"] +dst = "~/.config/mpd/mpd.conf" +src = ".config/mpd/mpd.conf" + +[dotfiles."f_mpdris2.conf"] +dst = "~/.config/mpDris2/mpDris2.conf" +src = ".config/mpDris2/mpDris2.conf" + +[dotfiles.f_ncmpcpp_bindings] +dst = "~/.config/ncmpcpp/bindings" +src = ".config/ncmpcpp/bindings" + +[dotfiles."f_ranger.conf"] +dst = "~/.config/ranger/rc.conf" +src = ".config/ranger/rc.conf" + +[dotfiles."f_ranger_commands.py"] +dst = "~/.config/ranger/commands.py" +src = ".config/ranger/commands.py" + +[dotfiles."f_ssh.conf"] +dst = "~/.ssh/config" +src = ".ssh/config" + +[dotfiles.f_zprofile] +dst = "~/.zprofile" +src = ".zprofile" + +[dotfiles.f_zshrc] +dst = "~/.zshrc" +src = ".zshrc" + +[dotfiles.d_zsh] +src = ".config/zsh" +dst = "~/.config/zsh" + +[dotfiles."f_fonts.conf"] +src = ".config/fontconfig/fonts.conf" +dst = "~/.config/fontconfig/fonts.conf" + +[dotfiles.f_ignore] +src = ".ignore" +dst = "~/.ignore" + +[dotfiles."f_ncmpcpp.conf"] +src = ".config/ncmpcpp/config" +dst = "~/.config/ncmpcpp/config" + +[dotfiles.f_hushlogin] +src = ".hushlogin" +dst = "~/.hushlogin" + +[dotfiles."f_paru.conf"] +src = ".config/paru/paru.conf" +dst = "~/.config/paru/paru.conf" + +[dotfiles."f_foot.ini"] +src = ".config/foot/foot.ini" +dst = "~/.config/foot/foot.ini" + +[dotfiles."f_gpg-agent.conf"] +src = ".gnupg/gpg-agent.conf" +dst = "~/.gnupg/gpg-agent.conf" +chmod = "600" + +[dotfiles."f_gpg.conf"] +src = ".gnupg/gpg.conf" +dst = "~/.gnupg/gpg.conf" + +[dotfiles."f_gpg_scdaemon.conf"] +src = ".gnupg/scdaemon.conf" +dst = "~/.gnupg/scdaemon.conf" + +[dotfiles."f_electron-flags.conf"] +src = ".config/electron-flags.conf" +dst = "~/.config/electron-flags.conf" + +[dotfiles."f_electron12-flags.conf"] +src = ".config/electron12-flags.conf" +dst = "~/.config/electron12-flags.conf" + +[dotfiles.f_pam_environment] +src = ".pam_environment" +dst = "~/.pam_environment" + +[dotfiles."f_dconf.ini"] +src = ".config/dconf.ini" +dst = "~/.config/dconf.ini" +actions = ["dconf-load"] + +[dotfiles."f_docker-config.json"] +src = ".docker/config.json" +dst = "~/.docker/config.json" +chmod = "600" + +[dotfiles.f_npmrc] +src = ".npmrc" +dst = "~/.npmrc" +chmod = "600" + +[dotfiles.f_zellij] +src = ".config/zellij/config.kdl" +dst = "~/.config/zellij/config.kdl" + +[profiles.pacman] +dotfiles = ["f_makepkg.conf", "f_paru.conf"] + +[profiles.terminal] +dotfiles = [ + "d_nvim", + "d_ssh", + "d_zsh", + "f_gitconfig", + "f_hushlogin", + "f_ignore", + "f_ranger.conf", + "f_ranger_commands.py", + "f_zellij", + "f_zshrc", + "f_npmrc", +] + +[profiles.media] +dotfiles = [ + "d_mpv", + "f_abcde.conf", + "f_beets_config", + "f_beets_whitelist", + "f_mpd.conf", + "f_mpdris2.conf", + "f_ncmpcpp.conf", + "f_ncmpcpp_bindings", +] + +[profiles.gpg] +dotfiles = [ + "f_gpg-agent.conf", + "f_gpg.conf", + "f_gpg_scdaemon.conf", + "f_pam_environment", +] + +[profiles.Mirkwood] +include = ["pacman", "terminal", "media", "gpg"] +dotfiles = [ + "f_librewolf_overrides", + "f_dconf.ini", + "f_docker-config.json", + "f_fonts.conf", + "f_foot.ini", +] + +[profiles.Mirkwood.variables] +wayland = true + +[profiles.VentoyArch] +include = ["pacman", "terminal", "media", "gpg"] +dotfiles = [ + "f_dconf.ini", + "f_fonts.conf", +] + +[profiles.VentoyArch.variables] +wayland = true + +[profiles.Shire] +include = ["pacman", "terminal", "media", "gpg"] +dotfiles = [ + "f_dconf.ini", + "f_fonts.conf", +] + +[profiles.Shire.variables] +wayland = true + +[profiles.Moria] +include = ["pacman", "terminal", "media", "gpg"] +dotfiles = [ + "f_librewolf_overrides", + "f_dconf.ini", + "f_zprofile", + "f_fonts.conf", + "d_systemd", +] + +[profiles.Moria.variables] +wayland = true + +[profiles.Tirion] +include = ["terminal", "gpg"] + +[profiles.Gondor] +include = ["pacman", "terminal"] + +[profiles.mko-laptop] +include = ["terminal", "gpg"] +dotfiles = ["f_librewolf_overrides", "f_dconf.ini", "d_systemd"] + +[profiles.mko-laptop.variables] +wayland = true + +[profiles.Isengard] +include = ["terminal"] + +[profiles.Isengard.variables] +distro_id = "termux" + +[profiles.Edoras] +include = ["terminal"] + +[profiles.TakamakiPC] +include = ["terminal"] + +[profiles.TakamakiPC.variables] +wayland = false + +[profiles.localhost] +include = ["terminal"] + +[profiles.ViiruJaTeippi] +include = ["terminal"] + +[profiles.Evendim] +include = ["terminal", "pacman"] diff --git a/deploy.sh b/deploy.sh deleted file mode 100644 index b7546ff5..00000000 --- a/deploy.sh +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/bash - -# to run this, execute -# bash <(curl -sL git.reekynet.com/ReekyMarko/dotfiles/raw/branch/master/deploy.sh) - -# Run this to install my dotfiles on a fresh Arch Linux installation. -# This should work on any Arch Linux install with an internet connection -# and sudo rights - -# When asked a hostname, make sure it's already in the dotrop config, -# otherwise dotdrop won't install anything - -export DOTREPO="$HOME/Git/dotfiles" -export HOSTNAME="$(hostnamectl | head -n 1 | sed 's/ //g' | cut -d':' -f2-)" -export DISTRO="$(lsb_release -ds | sed 's/"//g')" - -if [ "$DISTRO" -ne "Arch Linux" ]; then - print "Not running on Arch Linux" - print "Other distros not supported, exiting..." - exit 1 -fi - -read -p "Hostname [$HOSTNAME]: " -i $HOSTNAME NEWHOSTNAME -if [ "$HOSTNAME -ne $NEWHOSTNAME" ]; then - sudo hostnamectl set-hostname $NEWHOSTNAME -fi -HOSTNAME=$NEWHOSTNAME - -# install yay -if ! [ -x "$(command -v yay)" ]; then - read -p "Install yay? [Y/n] " -i "y" IYAY - if [ "$(tr '[:upper:]' ':lower:' $IYAY)" -eq "y" ]; then - print "Installing yay" - fi - sudo pacman -Syu --needed --noconfirm git wget base-devel - cd - wget https://aur.archlinux.org/cgit/aur.git/snapshot/yay.tar.gz - tar xfv yay.tar.gz - cd yay - makepkg -si --noconfirm - cd .. - rm -r yay* -fi - -mkdir ~/Git -git clone https://git.reekynet.com/ReekyMarko/dotfiles.git $DOTREPO -cd ~/Git/dotfiles -git submodule init -git submodule update -$DOTREPO/dotdrop.sh --cfg=$DOTREPO/config-home.yaml install -chsh -s /bin/zsh -zsh -c "source ~/.zshrc; sdotdrop install" diff --git a/docker/.gitignore b/docker/.gitignore new file mode 100644 index 00000000..934c1fb2 --- /dev/null +++ b/docker/.gitignore @@ -0,0 +1 @@ +*/.env diff --git a/docker/homeautomation/.gitignore b/docker/authentik/.gitignore similarity index 100% rename from docker/homeautomation/.gitignore rename to docker/authentik/.gitignore diff --git a/docker/authentik/docker-compose.yaml b/docker/authentik/docker-compose.yaml new file mode 100644 index 00000000..a8831667 --- /dev/null +++ b/docker/authentik/docker-compose.yaml @@ -0,0 +1,75 @@ +volumes: + redis: {} + media: {} + custom_templates: {} + geoip: {} + backups: {} +services: + redis: + image: redis:alpine + container_name: authentik-redis + networks: + - authentik + restart: unless-stopped + volumes: + - redis:/data + healthcheck: + test: + - CMD-SHELL + - redis-cli ping | grep PONG + start_period: 20s + interval: 30s + retries: 5 + timeout: 3s + server: + image: ghcr.io/goauthentik/server + container_name: authentik + restart: unless-stopped + command: server + volumes: + - media:/media + - custom_templates:/templates + - geoip:/geoip + env_file: + - .env + networks: + - authentik + - postgres + - proxy + worker: + image: ghcr.io/goauthentik/server + container_name: authentik-worker + restart: unless-stopped + command: worker + user: root + volumes: + - backups:/backups + - custom_templates:/templates + - geoip:/geoip + - media:/media + - /var/run/docker.sock:/var/run/docker.sock + env_file: + - .env + networks: + - authentik + - postgres + geoipupdate: + image: maxmindinc/geoipupdate + container_name: authentik-geoipupdate + restart: unless-stopped + networks: + - authentik + volumes: + - geoip:/usr/share/GeoIP + env_file: + - .env + environment: + GEOIPUPDATE_EDITION_IDS: GeoLite2-City + GEOIPUPDATE_FREQUENCY: '8' +networks: + authentik: + external: true + postgres: + external: true + proxy: + external: true diff --git a/docker/backup/DISABLED b/docker/backup/DISABLED new file mode 100644 index 00000000..e69de29b diff --git a/docker/backup/docker-compose.yaml b/docker/backup/docker-compose.yaml new file mode 100644 index 00000000..adc00671 --- /dev/null +++ b/docker/backup/docker-compose.yaml @@ -0,0 +1,33 @@ +volumes: + caddy_data: + external: true + caddy_config: + external: true + caddy_wkd: + external: true + homeautomation_hass: + external: true +services: + backup: + image: offen/docker-volume-backup:v2 + container_name: volume-backup + restart: unless-stopped + environment: + - AWS_ENDPOINT + - AWS_S3_BUCKET_NAME + - AWS_ACCESS_KEY_ID + - AWS_SECRET_ACCESS_KEY + - GPG_PASSPHRASE + - EMAIL_SMTP_HOST + - EMAIL_SMTP_PASSWORD + - EMAIL_SMTP_USERNAME + - EMAIL_SMTP_PORT + - BACKUP_COMPRESSION=zst + - BACKUP_RETENTION_DAYS=7 + volumes: + - /var/run/docker.sock:/var/run/docker.sock:ro + - /etc/localtime:/etc/localtime:ro + - caddy_data:/backup/caddy_data:ro + - caddy_config:/backup/caddy_config:ro + - caddy_wkd:/backup/caddy_wkd:ro + - homeautomation_hass:/backup/homeautomation_hass:ro diff --git a/docker/caddy/Caddyfile b/docker/caddy/Caddyfile new file mode 100644 index 00000000..59bc7f7e --- /dev/null +++ b/docker/caddy/Caddyfile @@ -0,0 +1,177 @@ +{ + order umami first +} + +korhonen.cc, *.korhonen.cc { + encode zstd gzip + + tls { + dns cloudflare {$CF_API_TOKEN} + resolvers 1.1.1.1 + } + + header { + Strict-Transport-Security "max-age=63072000; includeSubDomains; preload" + } + + @static { + file + path *.ico *.css *.js *.gif *.webp *.avif *.jpg *.jpeg *.png *.svg *.woff *.woff2 *.pdf *.webmanifest + } + + @homepage-www-redir host www.korhonen.cc + handle @homepage-www-redir { + redir https://korhonen.cc + } + + @homepage host korhonen.cc + handle @homepage { + # Redirect finnish WIP + # @redirFinnish { + # header Accept-Language *fi-FI* + # not path *.js *.css *.png *.jpg *.jpeg *.svg + # not path /en* /fi* + # } + # redir @redirFinnish /fi{uri} + # + # uri strip_prefix /en + + header @static Cache-Control max-age=5184000 + root * /var/www/korhonen.cc + file_server + } + + @wkd host openpgpkey.korhonen.cc + handle @wkd { + root * /var/www/wkd + file_server browse + header Access-Control-Allow-Origin "*" + } + + @index host index.korhonen.cc + handle @index { + umami { + event_endpoint "https://umami.korhonen.cc/api/send" + website_uuid "9fe4f5c0-8e63-4479-a58d-d399cdbc0a3a" + client_ip_header X-Real-IP + device_detection + allowed_extensions "" .tar.zst .json .html + } + root * /var/www/index.korhonen.cc + file_server browse + } + + @home-assistant host home.korhonen.cc + handle @home-assistant { + reverse_proxy home-assistant:8123 + } + + @authentik host sso.korhonen.cc + handle @authentik { + reverse_proxy authentik:9000 + } + + @forgejo host git.korhonen.cc + handle @forgejo { + rewrite /user/login /user/oauth2/Korhonen%20SSO + reverse_proxy forgejo:3000 + } + + @woodpecker host ci.korhonen.cc + handle @woodpecker { + reverse_proxy woodpecker:8000 + } + + @searx host dsearch.korhonen.cc + handle @searx { + reverse_proxy searx:8080 + } + + @freshrss host rss.korhonen.cc + handle @freshrss { + reverse_proxy freshrss + } + + @jellyfin host jellyfin.korhonen.cc + handle @jellyfin { + reverse_proxy jellyfin:8096 + } + + @pihole host pihole.korhonen.cc + handle @pihole { + reverse_proxy pihole + } + + @umami host umami.korhonen.cc + handle @umami { + reverse_proxy umami:3000 + } + + @nextcloud host cloud.korhonen.cc + handle @nextcloud { + # Redirect login page to Authentik + redir /login /apps/sociallogin/custom_oidc/korhonen-sso 301 + + # .htaccess / data / config / ... shouldn't be accessible from outside + @forbidden { + path /.htaccess + path /data/* + path /config/* + path /db_structure + path /.xml + path /README + path /3rdparty/* + path /lib/* + path /templates/* + path /occ + path /console.php + } + handle @forbidden { + respond 404 + } + + redir /.well-known/carddav /remote.php/dav 301 + redir /.well-known/caldav /remote.php/dav 301 + + root * /var/www/nextcloud + php_fastcgi nextcloud:9000 { + root /var/www/html + # Tells nextcloud to remove /index.php from URLs in links + env front_controller_active true + } + file_server + } + + @collabora host collabora.korhonen.cc + handle @collabora { + reverse_proxy collabora:9980 + } + + @drop host drop.korhonen.cc + handle @drop { + reverse_proxy drop:3000 + } + + @ipvX host ipv6.korhonen.cc ipv4.korhonen.cc + handle @ipvX { + respond {remote_host} + } + + handle { + respond "404 Not Found" 404 + } + + handle_errors { + @homepage_404 { + expression {http.error.status_code} == 404 + host korhonen.cc + } + handle @homepage_404 { + root * /var/www/korhonen.cc + rewrite * /404.html + file_server + } + + respond "{err.status_code} {err.status_text}" + } +} diff --git a/docker/caddy/docker-compose.yaml b/docker/caddy/docker-compose.yaml new file mode 100644 index 00000000..cb3936ef --- /dev/null +++ b/docker/caddy/docker-compose.yaml @@ -0,0 +1,35 @@ +volumes: + data: {} + config: {} + wkd: {} + korhonen_cc: {} + nextcloud_config: + external: true +services: + caddy: + image: git.korhonen.cc/functionalhacker/caddy + container_name: caddy + restart: unless-stopped + ports: + - 80:80 + - 443:443/tcp + - 443:443/udp + - 127.0.0.1:2019:2019 + networks: + - proxy + volumes: + - /etc/localtime:/etc/localtime:ro + - ./Caddyfile:/etc/caddy/Caddyfile + - data:/data + - config:/config + - wkd:/var/www/wkd + - korhonen_cc:/var/www/korhonen.cc + - nextcloud_config:/var/www/nextcloud + - /var/www/index.korhonen.cc:/var/www/index.korhonen.cc + env_file: + - .env + cap_add: + - NET_ADMIN +networks: + proxy: + external: true diff --git a/docker/cloudflared/docker-compose.yaml b/docker/cloudflared/docker-compose.yaml new file mode 100644 index 00000000..e4ea0f26 --- /dev/null +++ b/docker/cloudflared/docker-compose.yaml @@ -0,0 +1,19 @@ +services: + cloudflared: + image: cloudflare/cloudflared + container_name: cloudflared + restart: unless-stopped + networks: + - proxy + volumes: + - /etc/localtime:/etc/localtime:ro + entrypoint: + command: tunnel --no-autoupdate run + env_file: + - .env + extra_hosts: + - 'host.docker.internal:host-gateway' + +networks: + proxy: + external: true diff --git a/docker/ddns/DISABLED b/docker/ddns/DISABLED new file mode 100644 index 00000000..e69de29b diff --git a/docker/ddns/docker-compose.yaml b/docker/ddns/docker-compose.yaml new file mode 100644 index 00000000..9c75b67e --- /dev/null +++ b/docker/ddns/docker-compose.yaml @@ -0,0 +1,13 @@ +services: + cloudflare-ddns: + image: timothyjmiller/cloudflare-ddns + container_name: cloudflare-ddns + security_opt: + - no-new-privileges:true + network_mode: host + environment: + - PUID=1000 + - PGID=1000 + volumes: + - /mnt/Storage/docker/ddns/config.json:/config.json + restart: unless-stopped diff --git a/docker/drop/DISABLED b/docker/drop/DISABLED new file mode 100644 index 00000000..e69de29b diff --git a/docker/drop/docker-compose.yaml b/docker/drop/docker-compose.yaml new file mode 100644 index 00000000..e86bdd6f --- /dev/null +++ b/docker/drop/docker-compose.yaml @@ -0,0 +1,13 @@ +services: + drop: + image: lscr.io/linuxserver/pairdrop + container_name: drop + restart: unless-stopped + networks: + - proxy + - IPV6_LOCALIZE=4 + volumes: + - /etc/localtime:/etc/localtime:ro +networks: + proxy: + external: true diff --git a/docker/firefish/DISABLED b/docker/firefish/DISABLED new file mode 100644 index 00000000..e69de29b diff --git a/docker/firefish/docker-compose.yaml b/docker/firefish/docker-compose.yaml new file mode 100644 index 00000000..de031490 --- /dev/null +++ b/docker/firefish/docker-compose.yaml @@ -0,0 +1,48 @@ +volumes: + files: {} + config: {} + redis: {} + db: {} +services: + firefish: + image: registry.firefish.dev/firefish/firefish + container_name: firefish + restart: unless-stopped + depends_on: + - redis + ports: + - 3084:3000 + networks: + - firefish + - proxy + environment: + NODE_ENV: production + volumes: + - files:/firefish/files + - config:/firefish/.config:ro + redis: + image: redis + container_name: redis-firefish + restart: unless-stopped + networks: + - firefish + volumes: + - redis:/data + db: + image: groonga/pgroonga:3.1.8-alpine-16-slim + container_name: firefish-db + restart: unless-stopped + networks: + - firefish + volumes: + - db:/var/lib/postgresql/data + healthcheck: + test: pg_isready --user="firefish" --dbname="firefish" + interval: 5s + timeout: 5s + retries: 5 +networks: + firefish: + internal: true + proxy: + external: true diff --git a/docker/forgejo/docker-compose.yaml b/docker/forgejo/docker-compose.yaml new file mode 100644 index 00000000..6add26f3 --- /dev/null +++ b/docker/forgejo/docker-compose.yaml @@ -0,0 +1,37 @@ +volumes: + data: {} + runner: {} +services: + forgejo: + image: git.korhonen.cc/functionalhacker/forgejo-asciidoc + container_name: forgejo + environment: + - USER_UID=1000 + - USER_GID=1000 + restart: unless-stopped + networks: + - postgres + - proxy + ports: + - '2882:22' + volumes: + - data:/data + - /etc/localtime:/etc/localtime:ro + runner: + image: code.forgejo.org/forgejo/runner:6 + container_name: forgejo-runner + user: root:root + volumes: + - runner:/data + - ./runner.yaml:/data/config.yaml + - /var/run/docker.sock:/var/run/docker.sock + - /etc/localtime:/etc/localtime:ro + environment: + - SOCKFILE=/var/run/docker.sock + restart: unless-stopped + command: forgejo-runner daemon -c /data/config.yaml +networks: + postgres: + external: true + proxy: + external: true diff --git a/docker/forgejo/runner.yaml b/docker/forgejo/runner.yaml new file mode 100644 index 00000000..bf5286bc --- /dev/null +++ b/docker/forgejo/runner.yaml @@ -0,0 +1,34 @@ +log: + level: info + +runner: + file: .runner + capacity: 2 + env_file: .env + timeout: 3h + insecure: false + fetch_timeout: 5s + fetch_interval: 2s + labels: + - 'docker:docker://git.korhonen.cc/functionalhacker/ubuntu-act:22.04' + +cache: + enabled: true + dir: '' + host: '' + port: 0 + external_server: '' + +container: + network: '' + enable_ipv6: false + privileged: false + options: + workdir_parent: + valid_volumes: + - 'caddy_korhonen_cc' + docker_host: 'automount' + force_pull: false + +host: + workdir_parent: diff --git a/docker/freepbx/docker-compose.yaml b/docker/freepbx/docker-compose.yaml deleted file mode 100644 index 149da0b6..00000000 --- a/docker/freepbx/docker-compose.yaml +++ /dev/null @@ -1,31 +0,0 @@ -version: '2' - -services: - freepbx: - container_name: freepbx - image: tiredofit/freepbx - ports: - - 8012:80 - - 5060:5060 - - 5160:5160 - - 18000-18100:18000-18100/udp - #### Flash Operator Panel - - 4445:4445 - volumes: - - /docker/freepbx/certs:/certs - - /docker/freepbx/data:/data - - /docker/freepbx/logs:/var/log - - /docker/freepbx/www:/var/www/html - - /docker/freepbx/db:/var/lib/mysql - - environment: - - RTP_START=18000 - - RTP_FINISH=18100 - - DB_EMBEDDED=TRUE - - restart: always - - ### These final lines are for Fail2ban. If you don't want, comment and also add ENABLE_FAIL2BAN=FALSE to your environment - cap_add: - - NET_ADMIN - privileged: true diff --git a/docker/freshrss/.gitignore b/docker/freshrss/.gitignore new file mode 100644 index 00000000..4c49bd78 --- /dev/null +++ b/docker/freshrss/.gitignore @@ -0,0 +1 @@ +.env diff --git a/docker/freshrss/DISABLED b/docker/freshrss/DISABLED new file mode 100644 index 00000000..e69de29b diff --git a/docker/freshrss/docker-compose.yaml b/docker/freshrss/docker-compose.yaml new file mode 100644 index 00000000..af961c5d --- /dev/null +++ b/docker/freshrss/docker-compose.yaml @@ -0,0 +1,24 @@ +volumes: + config: {} +services: + freshrss: + image: linuxserver/freshrss + container_name: freshrss + restart: unless-stopped + networks: + - freshrss + - postgres + - proxy + environment: + - PUID=1000 + - PGID=985 + volumes: + - /etc/localtime:/etc/localtime:ro + - config:/config +networks: + freshrss: + external: false + postgres: + external: true + proxy: + external: true diff --git a/docker/gitea/docker-compose.yaml b/docker/gitea/docker-compose.yaml deleted file mode 100644 index 3dab71fe..00000000 --- a/docker/gitea/docker-compose.yaml +++ /dev/null @@ -1,41 +0,0 @@ -version: '2' - -networks: - gitea: - external: false - -services: - gitea: - container_name: gitea - image: gitea/gitea:latest - environment: - - USER_UID=1000 - - USER_GID=1000 - - DB_TYPE=mysql - - DB_HOST=db:3306 - - DB_NAME=gitea - - DB_USER=gitea - - DB_PASSWD=gitea - restart: always - networks: - - gitea - volumes: - - /docker/gitea/gitea:/data - - /etc/timezone:/etc/timezone:ro - - /etc/localtime:/etc/localtime:ro - ports: - - '3000:3000' - - '222:22' - depends_on: - - db - - mariadb: - container_name: mariadb-gitea - image: mariadb - restart: always - environment: - - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD} - ports: - - '3308:3306' - volumes: - - /docker/gitea/mariadb:/var/lib/mysql diff --git a/docker/headscale/DISABLED b/docker/headscale/DISABLED new file mode 100644 index 00000000..e69de29b diff --git a/docker/headscale/docker-compose.yaml b/docker/headscale/docker-compose.yaml new file mode 100644 index 00000000..96d383b5 --- /dev/null +++ b/docker/headscale/docker-compose.yaml @@ -0,0 +1,23 @@ +volumes: + config: {} + data: {} +services: + headscale: + image: headscale/headscale:0 + container_name: headscale + volumes: + - config:/etc/headscale + - data:/var/lib/headscale + ports: + - 3478:3478/udp + command: headscale serve + restart: unless-stopped + networks: + - postgres + headscale-ui: + image: ghcr.io/gurucomputing/headscale-ui + container_name: headscale-ui + restart: unless-stopped +networks: + postgres: + external: true diff --git a/docker/homeautomation/docker-compose.yaml b/docker/homeautomation/docker-compose.yaml new file mode 100644 index 00000000..adbcb414 --- /dev/null +++ b/docker/homeautomation/docker-compose.yaml @@ -0,0 +1,80 @@ +volumes: + hass: {} + mosquitto: {} + piper_english: {} + whisper_english: {} + openwakeword_english: {} +services: + home-assistant: + container_name: home-assistant + image: homeassistant/home-assistant + restart: unless-stopped + volumes: + - /etc/localtime:/etc/localtime:ro + - hass:/config + networks: + - homeautomation + - postgres + - proxy + ports: + - 8123:8123 + - 8300:8300 + extra_hosts: + - host.docker.internal:host-gateway + # mosquitto: + # container_name: mosquitto + # image: eclipse-mosquitto + # restart: unless-stopped + # environment: + # - TZ=Europe/Helsinki + # networks: + # - homeautomation + # ports: + # - 1883:1883 + # - 8866:8866 + # volumes: + # - mosquitto:/mosquitto + # - /etc/localtime:/etc/localtime:ro + piper_english: + container_name: piper_english + image: rhasspy/wyoming-piper + restart: unless-stopped + environment: + - TZ=Europe/Helsinki + ports: + - 10200:10200 + networks: + - homeautomation + command: + - --voice + - en_US-hfc_male-medium + volumes: + - piper_english:/data + - /etc/localtime:/etc/localtime:ro + whisper_english: + container_name: whisper_english + image: rhasspy/wyoming-whisper + restart: unless-stopped + environment: + - TZ=Europe/Helsinki + ports: + - 10300:10300 + networks: + - homeautomation + depends_on: + - home-assistant + command: + - --model + - tiny-int8 + - --language + - en + volumes: + - whisper_english:/data + - /etc/localtime:/etc/localtime:ro +networks: + homeautomation: + external: false + postgres: + external: true + proxy: + external: true diff --git a/docker/homeautomation/docker-compose.yml b/docker/homeautomation/docker-compose.yml deleted file mode 100644 index 18f5c96b..00000000 --- a/docker/homeautomation/docker-compose.yml +++ /dev/null @@ -1,72 +0,0 @@ -version: '3' -services: - home-assistant: - environment: - TZ: 'Europe/Helsinki' - container_name: home-assistant - restart: always - image: homeassistant/home-assistant - volumes: - - /docker/homeautomation/home-assistant:/config - network_mode: host - depends_on: - - deconz - - mosquitto - - deconz: - container_name: deconz - image: marthoc/deconz - restart: always - environment: - DECONZ_WEB_PORT: 8083 - DECONZ_WS_PORT: 8084 - DECONZ_VNC_PORT: 5901 - DECONZ_VNC_MODE: 1 - DECONZ_VNC_PASSWORD: '${DECONZ_VNC_PASSWORD}' - DEBUG_OTAU: 1 - network_mode: host - volumes: - - /etc/localtime:/etc/localtime:ro - - /docker/homeautomation/deconz:/root/.local/share/dresden-elektronik/deCONZ - devices: - - /dev/ttyACM0 - - node-red: - container_name: node-red - image: nodered/node-red - restart: always - environment: - TZ: 'Europe/Helsinki' - ports: - - '1880:1880' - volumes: - - /docker/homeautomation/node-red:/data - depends_on: - - home-assistant - - portainer: - container_name: portainer - image: portainer/portainer - restart: always - ports: - - '9000:9000' - volumes: - - /var/run/docker.sock:/var/run/docker.sock - - /docker/homeautomation/portainer:/data - - mosquitto: - container_name: mosquitto - image: eclipse-mosquitto - restart: always - network_mode: host - volumes: - - /docker/homeautomation/mosquitto:/mosquitto - - mariadb: - container_name: mariadb-hass - image: mariadb - restart: always - environment: - - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD} - volumes: - - /docker/homeautomation/mariadb:/var/lib/mysql diff --git a/docker/homeautomation/init.sh b/docker/homeautomation/init.sh deleted file mode 100755 index 08b509f6..00000000 --- a/docker/homeautomation/init.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash -cat < .env -MYSQL_ROOT_PASSWORD=$(pass reekynet/docker-home-automation | rg 'MYSQL_ROOT_PASSWORD' | cut -d' ' -f2-) -HA_MYSQL_PASSWORD="$(pass reekynet/docker-home-automation | rg 'HA_MYSQL_PASSWORD' | cut -d' ' -f2-) -DECONZ_VNC_PASSWORD=$(pass reekynet/docker-home-automation | rg 'DECONZ_VNC_PASSWORD' | cut -d' ' -f2-) -ENV - -docker-compose up -d diff --git a/docker/jellyfin/DISABLED b/docker/jellyfin/DISABLED new file mode 100644 index 00000000..e69de29b diff --git a/docker/jellyfin/docker-compose.yaml b/docker/jellyfin/docker-compose.yaml index 99481612..f617f28d 100644 --- a/docker/jellyfin/docker-compose.yaml +++ b/docker/jellyfin/docker-compose.yaml @@ -1,12 +1,31 @@ -version: '3' +volumes: + config: {} + cache: {} + media: + external: true + nextcloud_data: + external: true services: jellyfin: image: jellyfin/jellyfin container_name: jellyfin - user: 1001:985 - network_mode: 'host' - restart: always + ports: + - 8096:8096 + networks: + - proxy + - authentik + restart: unless-stopped volumes: - - /docker/jellyfin/config:/config - - /docker/jellyfin/cache:/cache - - /mnt/Storage/Media:/media + - /etc/localtime:/etc/localtime:ro + - config:/config + - cache:/cache + - media:/media + - nextcloud_data:/nextcloud_data + devices: + - /dev/dri/renderD128:/dev/dri/renderD128 + - /dev/dri/card1:/dev/dri/card0 +networks: + proxy: + external: true + authentik: + external: true diff --git a/docker/mumble/DISABLED b/docker/mumble/DISABLED new file mode 100644 index 00000000..e69de29b diff --git a/docker/mumble/docker-compose.yaml b/docker/mumble/docker-compose.yaml new file mode 100644 index 00000000..df0fe9c8 --- /dev/null +++ b/docker/mumble/docker-compose.yaml @@ -0,0 +1,11 @@ +volumes: + config: {} +services: + mumble: + container_name: mumble + image: phlak/mumble + network_mode: host + volumes: + - /etc/localtime:/etc/localtime:ro + - config:/etc/mumble + restart: unless-stopped diff --git a/docker/netbootxyz/DISABLED b/docker/netbootxyz/DISABLED new file mode 100644 index 00000000..e69de29b diff --git a/docker/netbootxyz/docker-compose.yaml b/docker/netbootxyz/docker-compose.yaml new file mode 100644 index 00000000..b6cd5bea --- /dev/null +++ b/docker/netbootxyz/docker-compose.yaml @@ -0,0 +1,24 @@ +volumes: + config: {} + assets: {} +services: + netbootxyz: + image: lscr.io/linuxserver/netbootxyz + container_name: netbootxyz + restart: unless-stopped + environment: + - PUID=1000 + - PGID=1000 + - TZ=Etc/UTC + - MENU_VERSION=1.9.9 + - PORT_RANGE=30000:30010 + - SUBFOLDER=/ + - NGINX_PORT=80 + - WEB_APP_PORT=3000 + ports: + - 3000:3000 + - 69:69/udp + - 8081:80 + volumes: + - config:/config + - assets:/assets diff --git a/docker/nextcloud/.gitignore b/docker/nextcloud/.gitignore new file mode 100644 index 00000000..4c49bd78 --- /dev/null +++ b/docker/nextcloud/.gitignore @@ -0,0 +1 @@ +.env diff --git a/docker/nextcloud/docker-compose.yaml b/docker/nextcloud/docker-compose.yaml new file mode 100644 index 00000000..f22bc02a --- /dev/null +++ b/docker/nextcloud/docker-compose.yaml @@ -0,0 +1,84 @@ +volumes: + nextcloud_config: + external: true + nextcloud_data: + external: true +services: + nextcloud: + image: nextcloud:fpm-alpine + container_name: nextcloud + restart: unless-stopped + networks: + - nextcloud + - postgres + - proxy + volumes: + - nextcloud_config:/var/www/html + - nextcloud_data:/var/www/html/data + - /etc/localtime:/etc/localtime:ro + environment: + - REDIS_HOST=redis + - REDIS_HOST_PASSWORD=123 + - TRUSTED_PROXIES=caddy + - NEXTCLOUD_TRUSTED_DOMAINS=cloud.korhonen.cc + - OVERWRITEHOST=cloud.korhonen.cc + - OVERWRITEPROTOCOL=https + depends_on: + - redis + labels: + ofelia.enabled: true + ofelia.job-exec.nextcloud.schedule: 0 */5 * * * * + ofelia.job-exec.nextcloud.command: php /var/www/html/cron.php + ofelia.job-exec.nextcloud.user: www-data + ofelia.smtp-host: ${SMTP_HOST} + ofelia.smtp-port: ${SMTP_PORT} + ofelia.smtp-user: ${SMTP_USER} + ofelia.smtp-password: ${SMTP_PASSWORD} + ofelia.email-to: ${EMAIL_TO} + ofelia.email-from: ${EMAIL_FROM} + ofelia.mail-only-on-error: true + redis: + image: redis:alpine + container_name: redis-nextcloud + networks: + - nextcloud + restart: unless-stopped + command: redis-server --requirepass 123 + coturn: + image: instrumentisto/coturn + container_name: coturn + restart: unless-stopped + env_file: .env + ports: + - 3478:3478/tcp + - 3478:3478/udp + - 49160-49200:49160-49200/udp + networks: + - nextcloud + command: + - -n + - --log-file=stdout + - --min-port=49160 + - --max-port=49200 + - --realm=cloud.korhonen.cc + - --use-auth-secret + - --static-auth-secret=${STATIC_AUTH_SECRET} + collabora: + image: collabora/code + container_name: collabora + restart: unless-stopped + env_file: .env + environment: + - username=${COLLABORA_USERNAME} + - password=${COLLABORA_PASSWORD} + - domain=cloud.korhonen.cc + - extra_params=--o:ssl.enable=false --o:ssl.termination=true + networks: + - proxy +networks: + nextcloud: + external: false + postgres: + external: true + proxy: + external: true diff --git a/docker/ofelia/docker-compose.yaml b/docker/ofelia/docker-compose.yaml new file mode 100644 index 00000000..00c4ba93 --- /dev/null +++ b/docker/ofelia/docker-compose.yaml @@ -0,0 +1,9 @@ +services: + ofelia: + image: mcuadros/ofelia + container_name: ofelia + restart: unless-stopped + volumes: + - /etc/localtime:/etc/localtime:ro + - /var/run/docker.sock:/var/run/docker.sock:ro + command: daemon --docker diff --git a/docker/opentogethertube/DISABLED b/docker/opentogethertube/DISABLED new file mode 100644 index 00000000..e69de29b diff --git a/docker/opentogethertube/docker-compose.yaml b/docker/opentogethertube/docker-compose.yaml new file mode 100644 index 00000000..f4ed1f85 --- /dev/null +++ b/docker/opentogethertube/docker-compose.yaml @@ -0,0 +1,42 @@ +services: + opentogethertube: + image: dyc3/opentogethertube + container_name: opentogethertube + restart: unless-stopped + environment: + - PORT=8080 + - REDIS_HOST=redis + - REDIS_PORT=6379 + - FFPROBE_PATH=/usr/bin/ffprobe + - DB_MODE=postgres + - POSTGRES_USER=opentogethertube + - POSTGRES_DB=opentogethertube + - POSTGRES_HOST=postgres + - POSTGRES_PASSWORD + - DOCKER=1 + - OTT_HOSTNAME=ott.korhonen.cc + - YOUTUBE_API_KEY + - OPENTOGETHERTUBE_API_KEY + - SESSION_SECRET + ports: + - 8080:8080 + - 3002:3002 + networks: + - default + - postgres + - proxy + depends_on: + - redis + volumes: + - ./production.toml:/app/env/production.toml + redis: + container_name: redis-opentogethertube + image: redis:alpine + restart: unless-stopped + healthcheck: + test: redis-cli ping +networks: + postgres: + external: true + proxy: + external: true diff --git a/docker/opentogethertube/production.toml b/docker/opentogethertube/production.toml new file mode 100644 index 00000000..e60fec7e --- /dev/null +++ b/docker/opentogethertube/production.toml @@ -0,0 +1,5 @@ +log = { level = "info" } + +[room] +enable_create_temporary = false +enable_create_permanent = false diff --git a/docker/pihole/DISABLED b/docker/pihole/DISABLED new file mode 100644 index 00000000..e69de29b diff --git a/docker/pihole/docker-compose.yaml b/docker/pihole/docker-compose.yaml new file mode 100644 index 00000000..8ce68ccd --- /dev/null +++ b/docker/pihole/docker-compose.yaml @@ -0,0 +1,29 @@ +volumes: + config: {} + dnsmasq: {} +services: + pihole: + container_name: pihole + image: pihole/pihole + ports: + - 53:53/tcp + - 53:53/udp + - 67:67/udp + - 8069:80/tcp + networks: + - proxy + volumes: + - config:/etc/pihole/ + - dnsmasq:/etc/dnsmasq.d/ + dns: + - 127.0.0.1 + - 1.1.1.1 + cap_add: + - NET_ADMIN + restart: unless-stopped + environment: + TZ: Europe/Helsinki + WEBPASSWORD: ${WEBPASSWORD} +networks: + proxy: + external: true diff --git a/docker/postgres/docker-compose.yaml b/docker/postgres/docker-compose.yaml new file mode 100644 index 00000000..f51c542f --- /dev/null +++ b/docker/postgres/docker-compose.yaml @@ -0,0 +1,17 @@ +volumes: + data: {} +services: + postgres: + container_name: postgres + image: postgres:16 + ports: + - 127.0.0.1:5432:5432 + networks: + - postgres + volumes: + - /etc/localtime:/etc/localtime:ro + - data:/var/lib/postgresql/data + restart: unless-stopped +networks: + postgres: + external: true diff --git a/docker/searx/DISABLED b/docker/searx/DISABLED new file mode 100644 index 00000000..e69de29b diff --git a/docker/searx/docker-compose.yaml b/docker/searx/docker-compose.yaml new file mode 100644 index 00000000..cd419ee4 --- /dev/null +++ b/docker/searx/docker-compose.yaml @@ -0,0 +1,46 @@ +volumes: + config: {} +services: + searx: + container_name: searx + image: searxng/searxng + restart: unless-stopped + networks: + - searx + - proxy + volumes: + - config:/etc/searxng + environment: + - SEARXNG_BASE_URL=https://search.korhonen.cc/ + cap_drop: + - ALL + cap_add: + - CHOWN + - SETGID + - SETUID + - DAC_OVERRIDE + logging: + driver: json-file + options: + max-size: 1m + max-file: '1' + redis: + container_name: redis-searx + image: redis:alpine + command: redis-server --save "" --appendonly "no" + networks: + - searx + tmpfs: + - /var/lib/redis + cap_drop: + - ALL + cap_add: + - SETGID + - SETUID + - DAC_OVERRIDE +networks: + searx: + ipam: + driver: default + proxy: + external: true diff --git a/docker/stats/DISABLED b/docker/stats/DISABLED new file mode 100644 index 00000000..e69de29b diff --git a/docker/stats/docker-compose.yaml b/docker/stats/docker-compose.yaml new file mode 100644 index 00000000..f5b38202 --- /dev/null +++ b/docker/stats/docker-compose.yaml @@ -0,0 +1,30 @@ +services: + grafana: + image: grafana/grafana + container_name: grafana + volumes: + - grafana:/var/lib/grafana + networks: + - stats + - proxy + user: 1000:984 + env_file: + - .env + environment: + - GF_AUTH_GENERIC_OAUTH_CLIENT_ID + - GF_AUTH_GENERIC_OAUTH_CLIENT_SECRET + - GF_AUTH_GENERIC_OAUTH_ENABLED=true + - GF_AUTH_GENERIC_OAUTH_NAME=authentik + - GF_AUTH_GENERIC_OAUTH_SCOPES=openid profile email + - GF_AUTH_GENERIC_OAUTH_AUTH_URL=https://sso.korhonen.cc/application/o/authorize/ + - GF_AUTH_GENERIC_OAUTH_TOKEN_URL=https://sso.korhonen.cc/application/o/token/ + - GF_AUTH_GENERIC_OAUTH_API_URL=https://sso.korhonen.cc/application/o/userinfo/ + - GF_AUTH_SIGNOUT_REDIRECT_URL=https://sso.korhonen.cc/application/o/grafana/end-session/ + - GF_AUTH_OAUTH_AUTO_LOGIN=true + - GF_SERVER_ROOT_URL=https://grafana.korhonen.cc + - GF_AUTH_GENERIC_OAUTH_ROLE_ATTRIBUTE_PATH=contains(groups[*], 'Administrators') && 'Admin' || 'Viewer' +networks: + stats: + external: false + proxy: + external: true diff --git a/docker/tftp/DISABLED b/docker/tftp/DISABLED new file mode 100644 index 00000000..e69de29b diff --git a/docker/tftp/docker-compose.yaml b/docker/tftp/docker-compose.yaml new file mode 100644 index 00000000..d266b8c2 --- /dev/null +++ b/docker/tftp/docker-compose.yaml @@ -0,0 +1,10 @@ +services: + tftp: + container_name: tftp + image: pghalliday/tftp + restart: unless-stopped + ports: + - 69:69/udp + volumes: + - /etc/localtime:/etc/localtime:ro + - /docker/tftp:/var/tftpboot diff --git a/docker/tvheadend/DISABLED b/docker/tvheadend/DISABLED new file mode 100644 index 00000000..e69de29b diff --git a/docker/tvheadend/docker-compose.yaml b/docker/tvheadend/docker-compose.yaml new file mode 100644 index 00000000..d6ac73d7 --- /dev/null +++ b/docker/tvheadend/docker-compose.yaml @@ -0,0 +1,26 @@ +volumes: + config: {} + picons: {} +services: + tvheadend: + image: linuxserver/tvheadend + container_name: tvheadend + environment: + - PUID=1000 + - PGID=985 + volumes: + - /etc/localtime:/etc/localtime:ro + - config:/config + - picons:/picons + - /mnt/Storage/Media/PVR:/recordings + ports: + - 9981:9981 + - 9982:9982 + devices: + - /dev/dvb:/dev/dvb + restart: unless-stopped + networks: + - proxy +networks: + proxy: + external: true diff --git a/docker/umami/DISABLED b/docker/umami/DISABLED new file mode 100644 index 00000000..e69de29b diff --git a/docker/umami/docker-compose.yaml b/docker/umami/docker-compose.yaml new file mode 100644 index 00000000..d92ff9d8 --- /dev/null +++ b/docker/umami/docker-compose.yaml @@ -0,0 +1,21 @@ +services: + umami: + image: ghcr.io/umami-software/umami:postgresql-latest + container_name: umami + restart: unless-stopped + networks: + - postgres + - proxy + env_file: .env + environment: + DATABASE_URL: postgresql://umami:${POSTGRES_PASS}@postgres:5432/umami + HASH_SALT: ${HASH_SALT} + logging: + options: + max-size: 10m + max-file: '10' +networks: + postgres: + external: true + proxy: + external: true diff --git a/docker/watchtower/DISABLED b/docker/watchtower/DISABLED new file mode 100644 index 00000000..e69de29b diff --git a/docker/watchtower/docker-compose.yaml b/docker/watchtower/docker-compose.yaml new file mode 100644 index 00000000..1429c1c4 --- /dev/null +++ b/docker/watchtower/docker-compose.yaml @@ -0,0 +1,18 @@ +services: + watchtower: + image: containrrr/watchtower + container_name: watchtower + restart: unless-stopped + environment: + - WATCHTOWER_CLEANUP=true + - WATCHTOWER_NOTIFICATION_EMAIL_FROM=watchtower@korhonen.cc + - WATCHTOWER_NOTIFICATION_EMAIL_TO=admin@korhonen.cc + - WATCHTOWER_NOTIFICATION_EMAIL_SERVER=smtp.migadu.com + - WATCHTOWER_NOTIFICATION_EMAIL_SERVER_PORT=587 + - WATCHTOWER_NOTIFICATION_EMAIL_SERVER_USER=${WATCHTOWER_NOTIFICATION_EMAIL_SERVER_USER} + - WATCHTOWER_NOTIFICATION_EMAIL_SERVER_PASSWORD=${WATCHTOWER_NOTIFICATION_EMAIL_SERVER_PASSWORD} + - WATCHTOWER_NOTIFICATION_EMAIL_DELAY=30 + - WATCHTOWER_NOTIFICATIONS=email + volumes: + - /var/run/docker.sock:/var/run/docker.sock + - /etc/localtime:/etc/localtime:ro diff --git a/docker/wud/DISABLED b/docker/wud/DISABLED new file mode 100644 index 00000000..e69de29b diff --git a/docker/wud/docker-compose.yaml b/docker/wud/docker-compose.yaml new file mode 100644 index 00000000..91bcbfd3 --- /dev/null +++ b/docker/wud/docker-compose.yaml @@ -0,0 +1,12 @@ +services: + whatsupdocker: + image: getwud/wud + container_name: wud + env_file: .env + environment: + - WUD_TRIGGER_SMTP_EMAIL_SIMPLETITLE=Container $${container.name} can be updated + - WUD_TRIGGER_SMTP_EMAIL_SIMPLEBODY=Container $${name} can be updated from $${local.substring(0, 15)} to $${remote.substring(0, 15)} + volumes: + - /var/run/docker.sock:/var/run/docker.sock + ports: + - 3000:3000 diff --git a/dotdrop b/dotdrop deleted file mode 160000 index 2d64e2ee..00000000 --- a/dotdrop +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 2d64e2ee59281e358253fadb04432a040f9392ee diff --git a/home/.EFISTUB/01-arch.efi b/home/.EFISTUB/01-arch.efi deleted file mode 100755 index 61ab7e03..00000000 --- a/home/.EFISTUB/01-arch.efi +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash -# vim:ft=sh - -sudo efibootmgr \ - --disk /dev/sda \ - --part 1 \ - --create \ - --quiet \ - --remove-dups \ - --label "Arch Linux" \ - --loader /vmlinuz-linux \ - --unicode 'cryptdevice=UUID=19fa8fab-c5fe-454a-9a17-b7185ce975ea:cryptroot:allow-discards root=/dev/mapper/cryptroot rootflags=subvol=root resume=/dev/mapper/cryptroot resume_offset=7345408 rw quiet loglevel=3 vga=current vt.global_cursor_default=0 processor.max_cstate=5 rcu_nocbs=0-11 initrd=/amd-ucode.img initrd=/initramfs-linux.img amdgpu.noretry=0' diff --git a/home/.EFISTUB/02-ck.efi b/home/.EFISTUB/02-ck.efi deleted file mode 100755 index b387bad3..00000000 --- a/home/.EFISTUB/02-ck.efi +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash -# vim:ft=sh - -sudo efibootmgr \ - --disk /dev/sda \ - --part 1 \ - --create \ - --quiet \ - --remove-dups \ - --label "Arch Linux CK" \ - --loader /vmlinuz-linux-ck-zen \ - --unicode 'cryptdevice=UUID=19fa8fab-c5fe-454a-9a17-b7185ce975ea:cryptroot:allow-discards root=/dev/mapper/cryptroot rootflags=subvol=root resume=/dev/mapper/cryptroot resume_offset=7345408 rw quiet loglevel=3 vga=current vt.global_cursor_default=0 processor.max_cstate=5 rcu_nocbs=0-11 initrd=/amd-ucode.img initrd=/initramfs-linux.img amdgpu.noretry=0' diff --git a/home/.EFISTUB/03-lts.efi b/home/.EFISTUB/03-lts.efi deleted file mode 100755 index fd74e762..00000000 --- a/home/.EFISTUB/03-lts.efi +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash -# vim:ft=sh - -sudo efibootmgr \ - --disk /dev/sda \ - --part 1 \ - --create \ - --quiet \ - --remove-dups \ - --label "Arch Linux LTS" \ - --loader /vmlinuz-linux-lts \ - --unicode 'cryptdevice=UUID=19fa8fab-c5fe-454a-9a17-b7185ce975ea:cryptroot:allow-discards root=/dev/mapper/cryptroot rootflags=subvol=root resume=/dev/mapper/cryptroot resume_offset=7345408 rw quiet loglevel=3 vga=current vt.global_cursor_default=0 processor.max_cstate=5 rcu_nocbs=0-11 initrd=/amd-ucode.img initrd=/initramfs-linux.img amdgpu.noretry=0' diff --git a/home/.EFISTUB/update.sh b/home/.EFISTUB/update.sh deleted file mode 100755 index 07c1dba8..00000000 --- a/home/.EFISTUB/update.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash - -# remove old entries -for bootentry in $(efibootmgr | head -n 3 | tail -n 1 | cut -d' ' -f2- | sed 's/,/\n/g'); do - sudo efibootmgr -qBb $bootentry -done - -# add all entries back -for bootscript in *.efi; do - ./$bootscript -done - -# set bootorder -sudo efibootmgr --bootorder 0000,0001,0002 diff --git a/home/.config/alacritty/alacritty.yml b/home/.config/alacritty/alacritty.yml index 24c86093..39b80d7e 100644 --- a/home/.config/alacritty/alacritty.yml +++ b/home/.config/alacritty/alacritty.yml @@ -1,4 +1,5 @@ window: + opacity: 1.0 dimensions: columns: 0 lines: 0 @@ -6,14 +7,12 @@ window: x: 30 y: 20 dynamic_padding: false + dynamic_title: true decorations: full scrolling: history: 10000 multiplier: 3 - auto_scroll: false - -tabspaces: 8 font: normal: @@ -61,13 +60,11 @@ colors: cyan: '0x56b6c2' white: '0x5c6370' -visual_bell: +bell: animation: EaseOutExpo duration: 0 color: '#ffffff' -background_opacity: 1.0 - mouse_bindings: - { mouse: Middle, action: PasteSelection } @@ -75,15 +72,11 @@ mouse: double_click: { threshold: 300 } triple_click: { threshold: 300 } hide_when_typing: false - url: - modifiers: None selection: semantic_escape_chars: ',│`|:"'' ()[]{}<>' save_to_clipboard: false -dynamic_title: true - cursor: style: Block unfocused_hollow: true diff --git a/home/.config/asd b/home/.config/asd new file mode 100644 index 00000000..e69de29b diff --git a/home/.config/beets/config.yaml b/home/.config/beets/config.yaml index acea956c..cea0277d 100644 --- a/home/.config/beets/config.yaml +++ b/home/.config/beets/config.yaml @@ -1,34 +1,31 @@ directory: ~/Music library: ~/Music/beets.db -plugins: -- acousticbrainz -- check -- edit -- fetchart -- follow -- fuzzy -- info -- lastgenre -- lyrics -- mbcollection -- mpdupdate -- play -- replaygain -- thumbnails -- web +plugins: + - edit + - fetchart + - fuzzy + - info + - lastgenre + - lyrics + # - mbcollection + - mpdupdate + - play + - replaygain + - thumbnails + - web import: - copy: no - move: yes - link: no + write: yes + copy: yes lastgenre: whitelist: ~/.config/beets/whitelist lyrics: fallback: '' play: - command: mpv + command: mpv --no-vid --no-resume-playback mpd: - host: localhost - port: 6600 + host: localhost + port: 6600 + password: "{{@@ env['PASS_MPD_ADMIN'] @@}}" follow: email: reekymarko@reekynet.com password: "{{@@ env['PASS_MUSPY'] @@}}" @@ -37,9 +34,6 @@ follow: replaygain: backend: gstreamer auto: yes -musicbrainz: - user: ReekyMarko - pass: "{{@@ env['PASS_MUSICBRAINZ'] @@}}" -mbcollection: - auto: "yes" - collection: "a4955b5c-db7f-4e27-9887-f77f820bad34" +#mbcollection: +# auto: 'yes' +# collection: 'a4955b5c-db7f-4e27-9887-f77f820bad34' diff --git a/home/.config/dconf.ini b/home/.config/dconf.ini new file mode 100644 index 00000000..19ccc814 --- /dev/null +++ b/home/.config/dconf.ini @@ -0,0 +1,88 @@ +[io/github/celluloid-player/celluloid] +dark-theme-enable=false +mpv-config-enable=true +mpv-config-file='file:///home/{{@@ env['USER'] @@}}/.config/mpv/mpv.conf' +mpv-input-config-enable=true +mpv-input-config-file='file:///home/{{@@ env['USER'] @@}}/.config/mpv/input.conf' +settings-migrated=true + +[org/gnome/Connections] +first-run=false + +[org/gnome/shell/weather] +automatic-location=false +locations=[<(uint32 2, <('Lappeenranta', 'EFLP', false, [(1.0654507804726074, 0.49128594181309354)], @a(dd) [])>)>] + +[org/gnome/Weather] +locations=[<(uint32 2, <('Lappeenranta', 'EFLP', false, [(1.0654507804726074, 0.49128594181309354)], @a(dd) [])>)>] + +[org/gnome/shell/world-clocks] +locations=[<(uint32 2, <('Bangkok', 'VTBD', true, [(0.24289166005364171, 1.7558012275062955)], [(0.23998277214922031, 1.754346792280731)])>)>, <(uint32 2, <('Lappeenranta', 'EFLP', true, [(1.0654507804726074, 0.49128594181309354)], [(1.065814402368968, 0.49189195503597105)])>)>] + +[org/gnome/clocks] +world-clocks=[{'location': <(uint32 2, <('Bangkok', 'VTBD', true, [(0.24289166005364171, 1.7558012275062955)], [(0.23998277214922031, 1.754346792280731)])>)>}, {'location': <(uint32 2, <('Lappeenranta', 'EFLP', true, [(1.0654507804726074, 0.49128594181309354)], [(1.065814402368968, 0.49189195503597105)])>)>}] + +[org/gnome/desktop/a11y/mouse] +dwell-click-enabled=false +dwell-threshold=10 +dwell-time=1.2 +secondary-click-enabled=true +secondary-click-time=1.2 + +[org/gnome/desktop/calendar] +show-weekdate=true + +[org/gnome/desktop/input-sources] +show-all-sources=true +sources=[('xkb', 'eu'), ('xkb', 'fi')] +xkb-options=['lv3:ralt_switch'] + +[org/gnome/desktop/peripherals/touchpad] +tap-to-click=true +two-finger-scrolling-enabled=true + +[org/gnome/desktop/privacy] +disable-microphone=false +old-files-age=uint32 14 +recent-files-max-age=-1 +remove-old-temp-files=true +remove-old-trash-files=true + +[org/gnome/desktop/wm/keybindings] +close=['w'] +move-to-workspace-down=['j'] +move-to-workspace-left=['h'] +move-to-workspace-right=['l'] +move-to-workspace-up=['k'] +switch-to-workspace-down=['j'] +switch-to-workspace-left=['h'] +switch-to-workspace-right=['l'] +switch-to-workspace-up=['k'] +toggle-fullscreen=@as [] +toggle-maximized=['f'] + +[org/gnome/settings-daemon/plugins/media-keys] +custom-keybindings=['/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/'] +screensaver=['BackSpace'] +www=['b'] +volume-step=1 + +[org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0] +binding='Return' +command='kgx' +name='Open terminal' + +[org/gnome/file-roller/dialogs/new] +default-extension='.tar.zst' + +[org/gnome/software] +check-timestamp=int64 1667730233 +download-updates=true +download-updates-notify=true +first-run=false + +[org/gnome/system/location] +enabled=true + +[org/gnome/tweaks] +show-extensions-notice=false diff --git a/home/.config/electron-flags.conf b/home/.config/electron-flags.conf new file mode 100644 index 00000000..51bdd86f --- /dev/null +++ b/home/.config/electron-flags.conf @@ -0,0 +1,2 @@ +--enable-features=UseOzonePlatform +--ozone-platform=wayland diff --git a/home/.config/electron12-flags.conf b/home/.config/electron12-flags.conf new file mode 100644 index 00000000..51bdd86f --- /dev/null +++ b/home/.config/electron12-flags.conf @@ -0,0 +1,2 @@ +--enable-features=UseOzonePlatform +--ozone-platform=wayland diff --git a/home/.config/environment.d/firefox.conf b/home/.config/environment.d/firefox.conf new file mode 100644 index 00000000..a882e761 --- /dev/null +++ b/home/.config/environment.d/firefox.conf @@ -0,0 +1,3 @@ +MOZ_ENABLE_WAYLAND=1 +MOZ_USE_XINPUT2=1 +MOZ_WEBRENDER=1 diff --git a/home/.config/environment.d/java.conf b/home/.config/environment.d/java.conf deleted file mode 100644 index ccb1305b..00000000 --- a/home/.config/environment.d/java.conf +++ /dev/null @@ -1,3 +0,0 @@ - _JAVA_AWT_WM_NONREPARENTING=1 - _JAVA_OPTIONS='-Dawt.useSystemAAFontSettings=on -Dswing.aatext=true -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel' - JAVA_FONTS=/usr/share/fonts/TTF diff --git a/home/.config/sway/env b/home/.config/environment.d/sway.conf similarity index 86% rename from home/.config/sway/env rename to home/.config/environment.d/sway.conf index 5aa01188..449de9ba 100644 --- a/home/.config/sway/env +++ b/home/.config/environment.d/sway.conf @@ -7,11 +7,6 @@ QT_QPA_PLATFORMTHEME=qt5ct QT_QPA_PLATFORM=wayland-egl QT_WAYLAND_DISABLE_WINDOWDECORATION=1 -# Firefox -MOZ_ENABLE_WAYLAND=1 -MOZ_USE_XINPUT2=1 -MOZ_WEBRENDER=1 - # Fix redshift on wlroots WLR_DRM_NO_ATOMIC=1 diff --git a/home/.config/fontconfig/fonts.conf b/home/.config/fontconfig/fonts.conf index 6118c70b..a12fa719 100644 --- a/home/.config/fontconfig/fonts.conf +++ b/home/.config/fontconfig/fonts.conf @@ -1,26 +1,22 @@ - - - sans-serif - - Overpass - - - - - serif - - Overpass - - - - - monospace - - Hack Nerd Font Mono - - - + + sans-serif + + Adwaita Sans + + + + serif + + Adwaita Sans + + + + monospace + + Adwaita mono + + diff --git a/home/.config/foot/foot-light.ini b/home/.config/foot/foot-light.ini new file mode 100644 index 00000000..47cc25dd --- /dev/null +++ b/home/.config/foot/foot-light.ini @@ -0,0 +1,45 @@ +pad=10x0 +dpi-aware=yes + +[scrollback] +lines=1000 + +[cursor] +blink=yes + +[mouse] +hide-when-typing=yes + +[colors] +foreground = 545464 +background = f2ecbc + +selection-foreground = 43436c +selection-background = c9cbd1 + +regular0 = 1F1F28 +regular1 = c84053 +regular2 = 6f894e +regular3 = 77713f +regular4 = 4d699b +regular5 = b35b79 +regular6 = 597b75 +regular7 = 545464 + +bright0 = 8a8980 +bright1 = d7474b +bright2 = 6e915f +bright3 = 836f4a +bright4 = 6693bf +bright5 = 624c83 +bright6 = 5e857a +bright7 = 43436c + + +16 = cc6d00 +17 = e82424 + +[csd] +color = fff2ecbc +button-color = ff545464 +hide-when-maximized = yes diff --git a/home/.config/foot/foot.ini b/home/.config/foot/foot.ini new file mode 100644 index 00000000..eb9fd24c --- /dev/null +++ b/home/.config/foot/foot.ini @@ -0,0 +1,44 @@ +pad=10x0 +dpi-aware=yes + +[scrollback] +lines=1000 + +[cursor] +blink=yes + +[mouse] +hide-when-typing=yes + +[colors] +foreground = dcd7ba +background = 1f1f28 + +selection-foreground = c8c093 +selection-background = 2d4f67 + +regular0 = 090618 +regular1 = c34043 +regular2 = 76946a +regular3 = c0a36e +regular4 = 7e9cd8 +regular5 = 957fb8 +regular6 = 6a9589 +regular7 = c8c093 + +bright0 = 727169 +bright1 = e82424 +bright2 = 98bb6c +bright3 = e6c384 +bright4 = 7fb4ca +bright5 = 938aa9 +bright6 = 7aa89f +bright7 = dcd7ba + +16 = ffa066 +17 = ff5d62 + +[csd] +color = ff1f1f28 +button-color = ffdcd7ba +hide-when-maximized = yes diff --git a/home/.config/git/config b/home/.config/git/config new file mode 100644 index 00000000..9c8c391e --- /dev/null +++ b/home/.config/git/config @@ -0,0 +1,64 @@ +[user] +{%@@ if profile == "mko-laptop" @@%} +email = marko.korhonen@netforecast.com +{%@@ else @@%} +email = marko@korhonen.cc +{%@@ endif @@%} +name = Marko Korhonen +signingkey = F2B9F713E7ED627336DD85E444FA3F28CD931BB0 + +[commit] +signoff = true +gpgsign = true + +[tag] +gpgSign = true +signoff = true + +[format] +signoff = true + +[merge] +prompt = false +conflictstyle = diff3 +tool = nvim + +[mergetool] +keepBackup = false +prompt = false + +[mergetool "nvim"] +cmd = nvim +DiffviewOpen + +[pull] +rebase = merges + +[alias] +mergetest = !git switch test && git pull && git merge --no-ff -m \"Merge $1 features to test\" $1 +upstream = !git push -u origin HEAD +sync = !git pull && git push +recommit = !git commit -eF $(git rev-parse --git-dir)/COMMIT_EDITMSG +pull-merge = pull --no-rebase --no-ff --no-edit +log-merge = log -i --grep=merge --pretty=oneline +log-fp = log --first-parent --pretty=oneline +ll = log --pretty=oneline +dno = !git --no-pager diff --name-only + +[color] +pager = no + +[init] +defaultBranch = main + +[credential] +helper = cache --timeout=600 +helper = !pass-git-helper $@ + +[rerere] +enabled = true + +[submodule] +recurse = true + +[push] +recurseSubmodules = check diff --git a/home/.config/gtk-3.0/gtk.css b/home/.config/gtk-3.0/gtk.css index 97052376..da7a019d 100644 --- a/home/.config/gtk-3.0/gtk.css +++ b/home/.config/gtk-3.0/gtk.css @@ -1,3 +1,4 @@ -VteTerminal, vte-terminal { - padding: 40px; +VteTerminal, +vte-terminal { + padding: 40px; } diff --git a/home/.config/imapnotify/admin@korhonen.cc.js b/home/.config/imapnotify/admin@korhonen.cc.js new file mode 100644 index 00000000..40d02d17 --- /dev/null +++ b/home/.config/imapnotify/admin@korhonen.cc.js @@ -0,0 +1,19 @@ +var child_process = require('child_process'); + +function getStdout(cmd) { + var stdout = child_process.execSync(cmd); + return stdout.toString().trim(); +} + +exports.host = 'imap.migadu.com'; +exports.port = 993; +exports.tls = true; +exports.tlsOptions = { + rejectUnauthorized: true, +}; +exports.username = 'admin@korhonen.cc'; +exports.password = "{{@@ env['PASS_EMAIL_ADMIN'] @@}}"; +exports.onNewMail = 'mbsync admin@korhonen.cc'; +exports.onNewMailPost = + '~/git/dotfiles/scripts/mail/notify-new-mail.sh admin@korhonen.cc'; +exports.boxes = ['INBOX']; diff --git a/home/.config/imapnotify/functionalhacker@korhonen.cc.js b/home/.config/imapnotify/functionalhacker@korhonen.cc.js new file mode 100644 index 00000000..50746dfd --- /dev/null +++ b/home/.config/imapnotify/functionalhacker@korhonen.cc.js @@ -0,0 +1,19 @@ +var child_process = require('child_process'); + +function getStdout(cmd) { + var stdout = child_process.execSync(cmd); + return stdout.toString().trim(); +} + +exports.host = 'imap.migadu.com'; +exports.port = 993; +exports.tls = true; +exports.tlsOptions = { + rejectUnauthorized: true, +}; +exports.username = 'functionalhacker@korhonen.cc'; +exports.password = "{{@@ env['PASS_EMAIL_HACKER'] @@}}"; +exports.onNewMail = 'mbsync functionalhacker@korhonen.cc'; +exports.onNewMailPost = + '~/git/dotfiles/scripts/mail/notify-new-mail.sh functionalhacker@korhonen.cc'; +exports.boxes = ['INBOX']; diff --git a/home/.config/imapnotify/marko@korhonen.cc.js b/home/.config/imapnotify/marko@korhonen.cc.js new file mode 100644 index 00000000..afac7b4c --- /dev/null +++ b/home/.config/imapnotify/marko@korhonen.cc.js @@ -0,0 +1,19 @@ +var child_process = require('child_process'); + +function getStdout(cmd) { + var stdout = child_process.execSync(cmd); + return stdout.toString().trim(); +} + +exports.host = 'imap.migadu.com'; +exports.port = 993; +exports.tls = true; +exports.tlsOptions = { + rejectUnauthorized: true, +}; +exports.username = 'marko@korhonen.cc'; +exports.password = "{{@@ env['PASS_EMAIL_MARKO'] @@}}"; +exports.onNewMail = 'mbsync marko@korhonen.cc'; +exports.onNewMailPost = + '~/git/dotfiles/scripts/mail/notify-new-mail.sh marko@korhonen.cc'; +exports.boxes = ['INBOX']; diff --git a/home/.config/mako/config b/home/.config/mako/config index aa7ae8e3..993dd074 100644 --- a/home/.config/mako/config +++ b/home/.config/mako/config @@ -1,6 +1,12 @@ -background-color=#282828 -text-color=#EBDBB2 -border-color=#D65D0E +background-color=#1E1D2F +text-color=#D9E0EE +border-color=#96CDFB +progress-color=over #302D41 + icons=1 default-timeout=5000 max-visible=6 +layer=overlay + +[urgency=high] +border-color=#F8BD96 diff --git a/home/.config/mimeo/associations.txt b/home/.config/mimeo/associations.txt index 931b7e0b..d9a37f2d 100644 --- a/home/.config/mimeo/associations.txt +++ b/home/.config/mimeo/associations.txt @@ -1,38 +1,41 @@ -mpvq %U +mpvqueue %U ^https?://invidio.us/.* -mpvq %U +mpvqueue %U ^https?://(m.)?(www.)?youtube.com/watch\?.*v= -mpvq %U +mpvqueue %U ^https?://(www.)?youtube.com/playlist\?.*list= -mpvq %U +mpvqueue %U ^https?://(www.)?youtu.be/ -mpvq %U +mpvqueue %U ^https?://(www.)?(m.)?twitch.tv/ -mpvq %U +mpvqueue %U ^https?://(?:[a-z0-9\-]+\.)+[a-z]{2,6}(?:/[^/#?]+)+\.(?:mp4|mkv|webm|avi|3gp|gif|gifv) -mpvq %U - ^https?://www.facebook.com/.*/videos/ +mpvqueue %U + ^https?://www.facebook.com/watch/?v=.* -mpvq %U +mpvqueue %U + ^https?://www.facebook.com/.*/videos/.* + +mpvqueue %U + ^https://fb.watch/.* + +mpvqueue %U ^https?://gfycat.com/.* -mpvq %U +mpvqueue %U ^https?://vimeo.com/.* -mpvq %U +mpvqueue %U ^https?://v.redd.it/.* -imgurviewer %U - ^https?://(www.)?imgur.com/a/ - -imgurviewer %U - ^https?://(www.)?imgur.com/gallery/ +mpvqueue %U + ^https?://areena.yle.fi.* imageviewer %U ^https?://(?:[a-z0-9\-]+\.)+[a-z]{2,6}(?:/[^/#?]+)+\.(?:jpg|jpeg|png|svg) diff --git a/home/.config/mpd/mpd.conf b/home/.config/mpd/mpd.conf index 01504433..38a2a616 100644 --- a/home/.config/mpd/mpd.conf +++ b/home/.config/mpd/mpd.conf @@ -1,25 +1,24 @@ -music_directory "~/Music" -playlist_directory "~/Music/Playlists" -db_file "~/.mpd/database" -log_file "~/.mpd/log" -pid_file "~/.mpd/pid" -state_file "~/.mpd/state" -sticker_file "~/.mpd/sticker.sql" +music_directory "~/Music" +playlist_directory "~/Music/Playlists" +db_file "~/.mpd/database" +log_file "~/.mpd/log" +state_file "~/.mpd/state" +sticker_file "~/.mpd/sticker.sql" -replaygain "track" +replaygain "track" -default_permissions "read" -password "{{@@ env['PASS_MPD'] @@}}@read,add,control" -password "{{@@ env['PASS_MPD_ADMIN'] @@}}@read,add,control,admin" +default_permissions "read,add,control" +password "{{@@ env['PASS_MPD'] @@}}@read,add,control" +password "{{@@ env['PASS_MPD_ADMIN'] @@}}@read,add,control,admin" audio_output { - type "fifo" - name "Visualizer" - path "/tmp/mpd.fifo" - format "44100:16:2" + type "fifo" + name "Visualizer" + path "/tmp/mpd.fifo" + format "44100:16:2" } audio_output { - type "pulse" - name "MPD PulseAudio" + type "pipewire" + name "MPD PipeWire" } diff --git a/home/.config/mpv/input.conf b/home/.config/mpv/input.conf index 92466f08..28f13934 100644 --- a/home/.config/mpv/input.conf +++ b/home/.config/mpv/input.conf @@ -19,3 +19,8 @@ m cycle ao-mute VOLUME_DOWN add ao-volume -2 VOLUME_UP add ao-volume +2 MUTE cycle ao-mute + += add audio-delay 0.100 +- add audio-delay -0.100 + +s playlist-shuffle diff --git a/home/.config/mpv/mpv.conf b/home/.config/mpv/mpv.conf index 265b49ba..28e7c939 100644 --- a/home/.config/mpv/mpv.conf +++ b/home/.config/mpv/mpv.conf @@ -7,10 +7,8 @@ vo=gpu hwdec=vaapi hwdec-codecs=all -{%@@ if profile == "Mirkwood" @@%} +{%@@ if wayland @@%} gpu-context=wayland -{%@@ elif profile == "Rivendell" @@%} -ao=alsa {%@@ endif @@%} ############# @@ -18,18 +16,21 @@ ao=alsa ############# pulse-buffer=50 # using a large buffer causes seeking issues audio-pitch-correction=yes # automatically insert scaletempo when playing with higher speed +replaygain=track ############# -# Plugins/misc # +# misc # ############# -# Mpris plugin -script=/usr/lib/mpv/mpris.so # Start ipc server input-ipc-server=/tmp/mpvsocket -# set youtube-dl max res to 1080 +# set youtube-dl max res +{%@@ if profile == "Moria" @@%} +ytdl-format=bestvideo[height<=2160]+bestaudio/best[height<=2160] +{%@@ else @@%} ytdl-format=bestvideo[height<=1080]+bestaudio/best[height<=1080] +{%@@ endif @@%} # continue watching save-position-on-quit @@ -62,7 +63,7 @@ sub-shadow-color="#33000000" sub-spacing=0.5 # OSD customizations -osd-font="Overpass" +osd-font="Lucida Console" osd-font-size=30 osd-color="#ffffffff" # ARGB format osd-border-color="#ff151515" # ARGB format @@ -73,7 +74,7 @@ osd-bar-w=60 # width of " " " osd-shadow-color="#11000000" osd-fractions -# Protocol specific configuration +# Protocol specific configuration [protocol.https] cache=yes user-agent='Mozilla/5.0 (X11; Linux x86_64; rv:72.0) Gecko/20100101 Firefox/72.0' @@ -105,8 +106,4 @@ ytdl-format="bestvideo[height<=2160]+bestaudio/best[height<=2160]" [best] ytdl-format="bestvideo+bestaudio" -# Vulkan hwdec profile -[vulkan] -gpu-api=vulkan -gpu-context=waylandvk -hwdec=vaapi-copy +script-opts-append=ytdl_hook-ytdl_path=yt-dlp diff --git a/home/.config/mpv/scripts/iptv.lua b/home/.config/mpv/scripts/iptv.lua new file mode 100644 index 00000000..ab43a6d5 --- /dev/null +++ b/home/.config/mpv/scripts/iptv.lua @@ -0,0 +1,505 @@ +--redefine keybindings here if needed; multiple bindings are possible +keybinds = { + activate = {'\\', 'MOUSE_BTN2'}, + plsup = {'UP', 'MOUSE_BTN3'}, + plsdown = {'DOWN', 'MOUSE_BTN4'}, + plsenter = {'ENTER', 'MOUSE_BTN0'} + } +--hide playlist after specified number of seconds +osd_time=10 +--show only specified number of playlist entries +window=7 +--fade video when showing playlist +fade=false +--if fade=true; -100 — black, 0 — normal +plsbrightness=-70 +--favorites get promotion to the top of the pls +favorites = {} +-- END OF CONFIGURABLE VARIABLES + +-- put your settings in (SCRIPTS DIR)/_iptvconf.lua +pcall(require, "_iptvconf") + +local timer +--local plscount +local pattern="" +local is_active +local is_playlist_loaded + +-- UTF-8 lower/upper conversion +local utf8_lc_uc = { + ["a"] = "A", + ["b"] = "B", + ["c"] = "C", + ["d"] = "D", + ["e"] = "E", + ["f"] = "F", + ["g"] = "G", + ["h"] = "H", + ["i"] = "I", + ["j"] = "J", + ["k"] = "K", + ["l"] = "L", + ["m"] = "M", + ["n"] = "N", + ["o"] = "O", + ["p"] = "P", + ["q"] = "Q", + ["r"] = "R", + ["s"] = "S", + ["t"] = "T", + ["u"] = "U", + ["v"] = "V", + ["w"] = "W", + ["x"] = "X", + ["y"] = "Y", + ["z"] = "Z", + ["а"] = "А", + ["б"] = "Б", + ["в"] = "В", + ["г"] = "Г", + ["д"] = "Д", + ["е"] = "Е", + ["ж"] = "Ж", + ["з"] = "З", + ["и"] = "И", + ["й"] = "Й", + ["к"] = "К", + ["л"] = "Л", + ["м"] = "М", + ["н"] = "Н", + ["о"] = "О", + ["п"] = "П", + ["р"] = "Р", + ["с"] = "С", + ["т"] = "Т", + ["у"] = "У", + ["ф"] = "Ф", + ["х"] = "Х", + ["ц"] = "Ц", + ["ч"] = "Ч", + ["ш"] = "Ш", + ["щ"] = "Щ", + ["ъ"] = "Ъ", + ["ы"] = "Ы", + ["ь"] = "Ь", + ["э"] = "Э", + ["ю"] = "Ю", + ["я"] = "Я", + ["ё"] = "Ё" +} + +local utf8_uc_lc = { + ["A"] = "a", + ["B"] = "b", + ["C"] = "c", + ["D"] = "d", + ["E"] = "e", + ["F"] = "f", + ["G"] = "g", + ["H"] = "h", + ["I"] = "i", + ["J"] = "j", + ["K"] = "k", + ["L"] = "l", + ["M"] = "m", + ["N"] = "n", + ["O"] = "o", + ["P"] = "p", + ["Q"] = "q", + ["R"] = "r", + ["S"] = "s", + ["T"] = "t", + ["U"] = "u", + ["V"] = "v", + ["W"] = "w", + ["X"] = "x", + ["Y"] = "y", + ["Z"] = "z", + ["А"] = "а", + ["Б"] = "б", + ["В"] = "в", + ["Г"] = "г", + ["Д"] = "д", + ["Е"] = "е", + ["Ж"] = "ж", + ["З"] = "з", + ["И"] = "и", + ["Й"] = "й", + ["К"] = "к", + ["Л"] = "л", + ["М"] = "м", + ["Н"] = "н", + ["О"] = "о", + ["П"] = "п", + ["Р"] = "р", + ["С"] = "с", + ["Т"] = "т", + ["У"] = "у", + ["Ф"] = "ф", + ["Х"] = "х", + ["Ц"] = "ц", + ["Ч"] = "ч", + ["Ш"] = "ш", + ["Щ"] = "щ", + ["Ъ"] = "ъ", + ["Ы"] = "ы", + ["Ь"] = "ь", + ["Э"] = "э", + ["Ю"] = "ю", + ["Я"] = "я", + ["Ё"] = "ё" +} + +--utf8 char pattern +local utf8_char="[\1-\127\192-\223][\128-\191]*" + +local cyr_chars={'а','б','в','г','д','е','ё','ж','з','и','й','к','л','м','н','о','п','р','с','т','у','ф','х','ц','ч','ш','щ','ъ','ы','ь','э','ю','я'} + +-- символы, которые возможно вводить для поиска +local chars={} +for i=string.byte('a'),string.byte('z') do + table.insert(chars,i) +end +for i=string.byte('A'),string.byte('Z') do + table.insert(chars,i) +end +for i=string.byte('0'),string.byte('9') do + table.insert(chars,i) +end +for _,v in ipairs({',','^','$','(',')','%','.','[',']','*','+','-','?','`',"'",";"}) do + table.insert(chars,string.byte(v)) +end + +local keybinder = { + remove = function(action) + for i,_ in ipairs(keybinds[action]) do + mp.remove_key_binding(action..tostring(i)) + end + end, + add = function(action, func, repeatable) + for i,key in ipairs(keybinds[action]) do + assert(type(func)=="function", "not a function") + if repeatable then + mp.add_forced_key_binding(key, action..tostring(i), func, "repeatable") + else + mp.add_forced_key_binding(key, action..tostring(i), func) + end + end + end +} + +local fader = { + saved_brtns, + on = function(self) + if fade and not self.saved_brtns then + self.saved_brtns = mp.get_property("brightness") + mp.set_property("brightness", plsbrightness) + end + end, + off = function(self) + if fade and self.saved_brtns then + mp.set_property("brightness", self.saved_brtns) + self.saved_brtns=nil + end + end +} + +local playlister = { +-- pls — список элементов плейлиста + pls, +-- plsfiltered — список индексов выбранных фильтром элементов плейлиста + plsfiltered, + plspos, + wndstart, + wndend, + cursor, + + init = function(self) + if not self.pls then + self.pls = mp.get_property_native("playlist") + end + mp.commandv("stop") + --need to mark first entry non-current (mpv bug?) + if self.pls[1] then + self.pls[1].current = false + end + if favorites and #favorites>0 then + self:sortfavs() + end + pattern = "" + self.plsfiltered = tablekeys(self.pls) + end, + + show = function(self) + local i + local newpos + local msg + --media-title + --playlist t[2].title + + if not self.plsfiltered then + return + end + if not self.plspos then + self.plspos=mp.get_property_native("playlist-pos-1") + --plscount=mp.get_property_native("playlist-count") + end + if not self.wndstart or not self.cursor then + self.wndstart=1 + self.cursor=0 + end + + msg="" + i = self.wndstart + local prefix + while self.plsfiltered[i] and i<=self.wndstart+window-1 do + if self.pls[self.plsfiltered[i]].current then + prefix="*" + elseif i==self.wndstart+self.cursor then + prefix=">" + else + prefix=" " + end + msg = msg..prefix..(self.pls[self.plsfiltered[i]].title or "").."\n" + i=i+1 + end + if self.wndstart>1 then + msg = "...\n"..msg + else + msg = " \n"..msg + end + if self.wndstart+window-1<#self.plsfiltered then + msg = msg.."..." + end + msg="/"..pattern.."\n"..msg + mp.osd_message(msg, osd_time) + end, + + sortfavs = function(self) + --favorites bubbles to the top + local favs={} + local nonfavs={} + for _,v in ipairs(self.pls) do + if in_array(favorites,v.title) then + favs[#favs+1] = v + else + nonfavs[#nonfavs+1] = v + end + end + for i=1,#nonfavs do + favs[#favs+1] = nonfavs[i] + end + self.pls = favs + end, + + filter = function(self) + self.plsfiltered={} + for i,v in ipairs(self.pls) do + if string.match(mylower(v.title),'.*'..prepat(pattern)..'.*') then + table.insert(self.plsfiltered,i) + end + end + self.wndstart=1 + self.cursor=0 + end, + + down = function(self) + if self.cursor >= #self.plsfiltered-1 then return end + if self.cursor0 then + self.cursor=self.cursor-1 + self.show(self) + else + if self.wndstart>1 then + self.wndstart=self.wndstart-1 + self.show(self) + end + end + end, + + play = function(self) + mp.commandv("loadfile",self.pls[self.plsfiltered[self.wndstart+self.cursor]].filename) + if self.plspos then + self.pls[self.plspos].current=false + end + self.plspos=self.plsfiltered[self.wndstart+self.cursor] + self.pls[self.plspos].current=true + end +} + +function add_bindings() + keybinder.add("plsup", up, true) + keybinder.add("plsdown", down, true) + for i,v in ipairs(chars) do + c=string.char(v) + mp.add_forced_key_binding(c, 'search'..v, typing(c),"repeatable") + end + mp.add_forced_key_binding('SPACE', 'search32', typing(' '),"repeatable") + +--[[ mp.add_key_binding('а', 'search1000', typing('а'),"repeatable") + mp.add_key_binding('с', 'search1001', typing('с'),"repeatable")]] + + mp.add_forced_key_binding('BS', 'searchbs', backspace,"repeatable") + keybinder.add("plsenter", play) + for i,v in ipairs(cyr_chars) do + mp.add_forced_key_binding(v, 'search'..i+1000, typing(v),"repeatable") + end +end + +function remove_bindings() + keybinder.remove('plsup') + keybinder.remove('plsdown') + keybinder.remove('plsenter') + for i,v in ipairs(chars) do + c=string.char(v) + mp.remove_key_binding('search'..v) + end + mp.remove_key_binding('search32') + mp.remove_key_binding('searchbs') + for i,v in ipairs(cyr_chars) do + mp.remove_key_binding('search'..i+1000) + end +end + +function activate() + if is_active then + shutdown() + return + else + is_active=true + fader:on() + playlister:show() + add_bindings() + if not timer then + timer=mp.add_periodic_timer(osd_time, shutdown) + timer.oneshot=true + else + resumetimer() + end + end +end + +function tablekeys(t) + local result={} + for i,v in ipairs(t) do + table.insert(result,i) + end + return result +end + +function in_array(array, value) + for _,v in ipairs(array) do + if v==value then + return true + end + end + return false +end + +function mylower(s) + local res,n = string.gsub(s,utf8_char,function (c) + return utf8_uc_lc[c] + end) + return res +end + +function myupper(s) + local res,n = string.gsub(s,utf8_char,function (c) + return utf8_lc_uc[c] + end) + return res +end + +function prepat(s) +--prepare nocase and magic chars + s = string.gsub(s, "[%^%$%(%)%%%.%[%]%*%+%-%?]",function (c) + return '%'..c + end) +--[[ s = string.gsub(s, utf8_char, function (c) + return string.format("[%s%s]", utf8_uc_lc[c] or c, utf8_lc_uc[c] or c) + end)]] + return s +end + +function resumetimer() + timer:kill() + timer:resume() +end + +function typing(char) + return function() + local c=string.lower(char) + pattern = pattern..c + playlister:filter() + playlister:show() + resumetimer() + end +end + +function backspace() + if string.len(pattern)>0 then +-- pattern = string.sub(pattern,1,-2) +-- for unicode + pattern = string.match(pattern,"(.*)"..utf8_char.."$") + playlister:filter() + playlister:show() + resumetimer() + end +end + +function play() +-- mp.commandv("playlist-move", wndstart+cursor, 1) +-- mp.commandv("playlist-clear") +-- mp.commandv("playlist-next") + fader:off() + playlister:play() + playlister:show() + resumetimer() +end + +function shutdown() + fader:off() + remove_bindings() + is_active=false + mp.osd_message("", 1) +end + +function down() + fader:on() + playlister:down() + resumetimer() +end + +function up() + fader:on() + playlister:up() + resumetimer() +end + +function on_start_file() + if is_playlist_loaded then + playlister:init() + mp.unregister_event(on_start_file) + activate() + else + is_playlist_loaded = true + end +end + +if mp.get_opt("iptv") then + mp.set_property_bool("idle", true) + mp.set_property_bool("force-window", true) + mp.register_event("start-file", on_start_file) + keybinder.add("activate", activate) +end + diff --git a/home/.config/mpv/scripts/yledl_hook.lua b/home/.config/mpv/scripts/yledl_hook.lua new file mode 100644 index 00000000..1ff15ff1 --- /dev/null +++ b/home/.config/mpv/scripts/yledl_hook.lua @@ -0,0 +1,76 @@ +-- Copied from https://github.com/pekkarr/mpv-yledl +-- Copyright 2021 Pekka Ristola + +-- This program is free software: you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation, either version 3 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program. If not, see . + +local msg = require 'mp.msg' +local utils = require 'mp.utils' + +local function add_series(data) + local playlist = { "#EXTM3U" } + for _, episode in pairs(data) do + table.insert(playlist, episode["webpage"]) + end + mp.set_property("stream-open-filename", "memory://" .. table.concat(playlist, "\n")) +end + +local function add_single_video(data) + local flavors = data["flavors"] + table.sort(flavors, function(a, b) return a["bitrate"] > b["bitrate"] end) + local best = flavors[1] + mp.set_property("stream-open-filename", best["url"]) + mp.set_property("file-local-options/force-media-title", data["title"]) + for _, sub in ipairs(data["subtitles"]) do + local lang = sub["language"] + msg.verbose("Adding subtitles for " .. lang) + mp.commandv("sub-add", sub["url"], "auto", sub["category"], lang) + end +end + +mp.add_hook("on_load", 9, function() + msg.verbose('yle-dl hook') + local url = mp.get_property("stream-open-filename", "") + if (url:find("https?://%a+%.yle%.fi/") == 1) or (url:find("https?://yle%.fi/") == 1) then + local start_time = os.clock() + local command = { "yle-dl", "--showmetadata", url } + msg.debug("Running: " .. table.concat(command, ' ')) + local ret = mp.command_native({name = "subprocess", + args = command, + capture_stdout = true, + capture_stderr = false}) + if ret.killed_by_us then + return + end + if (ret.status < 0) or (ret.stdout == nil) or (ret.stdout == "") then + msg.error("yle-dl failed to parse url") + return + end + + local json, err = utils.parse_json(ret.stdout) + if (json == nil) then + msg.error("failed to parse JSON: " .. err) + return + end + msg.verbose("yle-dl succeeded") + msg.debug("running yle-dl took " .. os.clock() - start_time .. " seconds") + + if #json == 1 then + add_single_video(json[1]) + else + add_series(json) + end + else + msg.verbose('not an areena url') + end +end) diff --git a/home/.config/msmtp/config b/home/.config/msmtp/config new file mode 100644 index 00000000..1179ee87 --- /dev/null +++ b/home/.config/msmtp/config @@ -0,0 +1,26 @@ +defaults +auth on +tls on +tls_starttls off +tls_trust_file /etc/ssl/certs/ca-certificates.crt +logfile ~/.log/msmtp.log +host smtp.migadu.com +port 465 + +# functionalhacker@korhonen.cc +account functionalhacker@korhonen.cc +from functionalhacker@korhonen.cc +user functionalhacker@korhonen.cc +password "{{@@ env['PASS_EMAIL_HACKER'] @@}}" + +# marko@korhonen.cc +account marko@korhonen.cc +from marko@korhonen.cc +user marko@korhonen.cc +password "{{@@ env['PASS_EMAIL_MARKO'] @@}}" + +# admin@korhonen.cc +account admin@korhonen.cc +from admin@korhonen.cc +user admin@korhonen.cc +password "{{@@ env['PASS_EMAIL_ADMIN'] @@}}" diff --git a/home/.config/mvi/input.conf b/home/.config/mvi/input.conf deleted file mode 100644 index 416eb1c2..00000000 --- a/home/.config/mvi/input.conf +++ /dev/null @@ -1,99 +0,0 @@ -SPACE repeatable playlist-next -alt+SPACE repeatable playlist-prev - -UP ignore -DOWN ignore -LEFT repeatable playlist-prev -RIGHT repeatable playlist-next - -# simple reminder of default bindings -#1 add contrast -1 -#2 add contrast 1 -#3 add brightness -1 -#4 add brightness 1 -#5 add gamma -1 -#6 add gamma 1 -#7 add saturation -1 -#8 add saturation 1 - -# mouse-centric bindings -MBTN_RIGHT script-binding image_viewer/drag-to-pan -MBTN_LEFT script-binding image_viewer/pan-follows-cursor -WHEEL_UP script-message cursor-centric-zoom 0.1 -WHEEL_DOWN script-message cursor-centric-zoom -0.1 - -# panning with the keyboard: -# pan-image takes the following arguments -# pan-image AXIS AMOUNT ZOOM_INVARIANT IMAGE_CONSTRAINED -# ^ ^ ^ -# x or y | | -# | | -# if yes, will pan by the same if yes, stops panning if the image -# amount regardless of zoom would go outside of the window - -ctrl+down repeatable script-message pan-image y -0.1 yes yes -ctrl+up repeatable script-message pan-image y +0.1 yes yes -ctrl+right repeatable script-message pan-image x -0.1 yes yes -ctrl+left repeatable script-message pan-image x +0.1 yes yes - -# now with more precision -alt+down repeatable script-message pan-image y -0.01 yes yes -alt+up repeatable script-message pan-image y +0.01 yes yes -alt+right repeatable script-message pan-image x -0.01 yes yes -alt+left repeatable script-message pan-image x +0.01 yes yes - -# replace at will with h,j,k,l if you prefer vim-style bindings - -# on a trackpad you may want to use these -#WHEEL_UP repeatable script-message pan-image y -0.02 yes yes -#WHEEL_DOWN repeatable script-message pan-image y +0.02 yes yes -#WHEEL_LEFT repeatable script-message pan-image x -0.02 yes yes -#WHEEL_RIGHT repeatable script-message pan-image x +0.02 yes yes - -# align the border of the image to the border of the window -# align-border takes the following arguments: -# align-border ALIGN_X ALIGN_Y -# any value for ALIGN_* is accepted, -1 and 1 map to the border of the window -ctrl+shift+right script-message align-border -1 "" -ctrl+shift+left script-message align-border 1 "" -ctrl+shift+down script-message align-border "" -1 -ctrl+shift+up script-message align-border "" 1 - -# reset the image -ctrl+0 no-osd set video-pan-x 0; no-osd set video-pan-y 0; no-osd set video-zoom 0 - -+ add video-zoom 0.5 -- add video-zoom -0.5; script-message reset-pan-if-visible -= no-osd set video-zoom 0; script-message reset-pan-if-visible - -# sxiv compatibility -w no-osd set video-unscaled yes; keypress = -e no-osd set video-unscaled no; keypress = - -h no-osd vf toggle hflip; show-text "Horizontal flip" -v no-osd vf toggle vflip; show-text "Vertical flip" - -r script-message rotate-video 90; show-text "Clockwise rotation" -R script-message rotate-video -90; show-text "Counter-clockwise rotation" -alt+r no-osd set video-rotate 0; show-text "Reset rotation" - -d script-message ruler - -# Toggling between pixel-exact reproduction and interpolation -a cycle-values scale nearest ewa_lanczossharp - -# Toggle color management on or off -c cycle icc-profile-auto - -# Screenshot of the window output -S screenshot window - -# Toggle aspect ratio information on and off -A cycle-values video-aspect "-1" "no" - -p script-message force-print-filename - -# ADVANCED: you can define bindings that belong to a "section" (named "image-viewer" here) like so: -#alt+SPACE {image-viewer} repeatable playlist-prev -#SPACE {image-viewer} repeatable playlist-next -# to load them conditionally with a command. See scripts-opts/image_viewer.conf for how you can do this diff --git a/home/.config/mvi/mpv.conf b/home/.config/mvi/mpv.conf deleted file mode 100644 index 5c5dcfbb..00000000 --- a/home/.config/mvi/mpv.conf +++ /dev/null @@ -1,46 +0,0 @@ -## IMAGE -# classic opengl-hq parameter, change at will -scale=spline36 -cscale=spline36 -dscale=mitchell -dither-depth=auto -correct-downscaling -sigmoid-upscaling -# debanding seems rarely useful with images -#deband - -## MISC -mute=yes -# the osc is mostly useful for videos -osc=no -# don't try to autoload subtitles or audio files -sub-auto=no -audio-file-auto=no -# get rid of the useless V: 00:00:00 / 00:00:00 line -term-status-msg= - -# replace mpv with mvi in the window title -title="${?media-title:${media-title}}${!media-title:No file} - mvi" - -# don't slideshow by default -image-display-duration=inf -# loop files in case of webms or gifs -loop-file=inf -# and loop the whole playlist -loop-playlist=inf - -# you need this if you plan to use drag-to-pan or pan-follows-cursor with MOUSE_LEFT -window-dragging=no - -#according to haasn, aspect ratio info for PNG and JPG is "universally bust" -[extension.png] -video-aspect=no - -[extension.jpg] -video-aspect=no - -[extension.jpeg] -profile=extension.jpg - -[silent] -msg-level=all=no diff --git a/home/.config/mvi/script-opts/image_viewer.conf b/home/.config/mvi/script-opts/image_viewer.conf deleted file mode 100644 index 4fe886fa..00000000 --- a/home/.config/mvi/script-opts/image_viewer.conf +++ /dev/null @@ -1,78 +0,0 @@ -## MISC -# size of the margins with pan-follows-cursor -pan_follows_cursor_margin=50 -# whether pan-follows-cursor should pan when the entire image is visible -pan_follows_cursor_move_if_full_view=no - -## STATUS LINE -# whether to show a status line -status_line_enabled=yes -# its position, possible values: (bottom|top)_(left|right) -status_line_position=bottom_left -# its font size -status_line_size=36 -# the text to be expanded -# see property expansion: https://mpv.io/manual/master/#property-expansion -# \N can be used for line breaks -# you can also use ass tags, see here: http://docs.aegisub.org/3.2/ASS_Tags/ -status_line=${filename} [${playlist-pos-1}/${playlist-count}] - -## MINIMAP -# whether to show a minimap -minimap_enabled=yes -# the position of the center of the minimap, in percentage of the window (x, y) -minimap_center=92,92 -# the scale of the minimap (i.e. the view rectangle is scale / 100 times the size of the window) -minimap_scale=12 -# the cutoff size of the minimap (i.e. the image rectangle is clipped if it falls outside of the this zone) -minimap_max_size=16,16 -# opacity of the "image" (from 00=opaque to FF=transparent) -minimap_image_opacity=88 -# color of the "image" (#BBGGRR where each component rages from 00 to FF) -minimap_image_color=BBBBBB -# opacity of the "view" -minimap_view_opacity=BB -minimap_view_color=222222 -# whether the view should be drawn above the image -minimap_view_above_image=yes -# whether to show the minimap if the current image is fully visible -minimap_hide_when_full_image_in_view=yes - -## RULER -# whether to show the length of the lines between the two points -ruler_show_distance=yes -# whether to show the coordinates of the two points -ruler_show_coordinates=yes -# the coordinate space of the text shown. Can be "image", "window", "both" -ruler_coordinates_space=image -# can be "degrees", "radians", "both", or "no" -ruler_show_angles=degrees -ruler_line_width=2 -ruler_dots_radius=3 -ruler_font_size=36 -# ranges from 00 (black) to FF (white) -ruler_line_color=33 -# bindings used to set points. The binding to trigger ruler mode can also be used. Comma-separated list -ruler_confirm_bindings=MBTN_LEFT,ENTER -# bindings used to set points. The binding to trigger ruler mode can also be used. Comma-separated list -ruler_exit_bindings=ESC -# if yes, the first point will be immediately set at the cursor position when calling 'ruler' -ruler_set_first_point_on_begin=no -# if yes, the ruler overlay will be immediately cleared when setting the second point -ruler_clear_on_second_point_set=no - -## HOOKS -# commands to execute when a file detected as an image (1 frame, no audio) is loaded or unloaded -# an image was loaded, and the previous file was not an image (or there was no previous file) -command_on_first_image_loaded= -# an image was loaded (regardless of what the previous file was) -command_on_image_loaded= -# a non-image was loaded, and the previous file was an image -command_on_non_image_loaded= -# the purpose of these "hooks" is to let you change bindings, profiles, reset properties... -# see https://mpv.io/manual/master/#list-of-input-commands for general command information -# note that there is no such thing as "unloading a profile", to emulate this you must create an opposite profile and load that -# example possible values: -#command_on_first_image_loaded=apply-profile image; enable-section image-viewer; script-message enable-status-line -#command_on_image_loaded=no-osd set video-pan-x 0; script-message align-border "" -1 -#command_on_non_image_loaded=disable-section image-viewer; no-osd set video-pan-x 0; no-osd set video-pan-y 0; no-osd set video-zoom 0; script-message disable-status-line diff --git a/home/.config/mvi/scripts/image-viewer.lua b/home/.config/mvi/scripts/image-viewer.lua deleted file mode 100644 index 9e1ec11b..00000000 --- a/home/.config/mvi/scripts/image-viewer.lua +++ /dev/null @@ -1,953 +0,0 @@ -local opts = { - pan_follows_cursor_margin = 50, - pan_follows_cursor_move_if_full_view = false, - - status_line_enabled = false, - status_line_position = "bottom_left", - status_line_size = 36, - status_line = "${filename} [${playlist-pos-1}/${playlist-count}]", - - minimap_enabled = true, - minimap_center = "92,92", - minimap_scale = 12, - minimap_max_size = "16,16", - minimap_image_opacity = "88", - minimap_image_color = "BBBBBB", - minimap_view_opacity = "BB", - minimap_view_color = "222222", - minimap_view_above_image = true, - minimap_hide_when_full_image_in_view = true, - - ruler_show_distance=true, - ruler_show_coordinates=true, - ruler_coordinates_space="both", - ruler_show_angles="degrees", - ruler_line_width=2, - ruler_dots_radius=3, - ruler_font_size=36, - ruler_line_color="33", - ruler_confirm_bindings="MBTN_LEFT,ENTER", - ruler_exit_bindings="ESC", - ruler_set_first_point_on_begin=false, - ruler_clear_on_second_point_set=false, - - command_on_first_image_loaded="", - command_on_image_loaded="", - command_on_non_image_loaded="", -} -(require 'mp.options').read_options(opts) -function split(input) - local ret = {} - for str in string.gmatch(input, "([^,]+)") do - ret[#ret + 1] = str - end - return ret -end -function str_to_num(array) - local ret = {} - for _, v in ipairs(array) do - ret[#ret + 1] = tonumber(v) - end - return ret -end -opts.minimap_center=str_to_num(split(opts.minimap_center)) -opts.minimap_max_size=str_to_num(split(opts.minimap_max_size)) -opts.ruler_confirm_bindings=split(opts.ruler_confirm_bindings) -opts.ruler_exit_bindings=split(opts.ruler_exit_bindings) - -function clamp(value, low, high) - if value <= low then - return low - elseif value >= high then - return high - else - return value - end -end - -local msg = require 'mp.msg' -local assdraw = require 'mp.assdraw' - -local ass = { -- shared ass state - status_line = "", - minimap = "", - ruler = "", -} - -local cleanup = nil -- function set up by drag-to-pan/pan-follows cursor and must be called to clean lingering state -local mouse_move_callbacks = {} -- functions that are called when mouse_move is triggered -function add_mouse_move_callback(key, func) - if #mouse_move_callbacks == 0 then - mp.add_forced_key_binding("mouse_move", "image-viewer-internal", function() - for _, func in pairs(mouse_move_callbacks) do - func() - end - end) - end - mouse_move_callbacks[key] = func -end -function remove_mouse_move_callback(key) - mouse_move_callbacks[key] = nil - for _,_ in pairs(mouse_move_callbacks) do - return - end - mp.remove_key_binding("image-viewer-internal") -end - -video_dimensions_stale = true -function get_video_dimensions() - -- this function is very much ripped from video/out/aspect.c in mpv's source - if not video_dimensions_stale then return _video_dimensions end - local video_params = mp.get_property_native("video-out-params") - if not video_params then - _video_dimensions = nil - return nil - end - if not _timestamp then _timestamp = 0 end - _timestamp = _timestamp + 1 - _video_dimensions = { - timestamp = _timestamp, - top_left = {x = 0, y = 0}, - bottom_right = {x = 0, y = 0}, - size = {w = 0, h = 0}, - ratios = {w = 0, h = 0}, -- by how much the original video got scaled - } - local keep_aspect = mp.get_property_bool("keepaspect") - local w = video_params["w"] - local h = video_params["h"] - local dw = video_params["dw"] - local dh = video_params["dh"] - if mp.get_property_number("video-rotate") % 180 == 90 then - w, h = h,w - dw, dh = dh, dw - end - local window_w, window_h = mp.get_osd_size() - - if keep_aspect then - local unscaled = mp.get_property_native("video-unscaled") - local panscan = mp.get_property_number("panscan") - - local fwidth = window_w - local fheight = math.floor(window_w / dw * dh) - if fheight > window_h or fheight < h then - local tmpw = math.floor(window_h / dh * dw) - if tmpw <= window_w then - fheight = window_h - fwidth = tmpw - end - end - local vo_panscan_area = window_h - fheight - local f_w = fwidth / fheight - local f_h = 1 - if vo_panscan_area == 0 then - vo_panscan_area = window_h - fwidth - f_w = 1 - f_h = fheight / fwidth - end - if unscaled or unscaled == "downscale-big" then - vo_panscan_area = 0 - if unscaled or (dw <= window_w and dh <= window_h) then - fwidth = dw - fheight = dh - end - end - - local scaled_width = fwidth + math.floor(vo_panscan_area * panscan * f_w) - local scaled_height = fheight + math.floor(vo_panscan_area * panscan * f_h) - - local split_scaling = function (dst_size, scaled_src_size, zoom, align, pan) - scaled_src_size = math.floor(scaled_src_size * 2 ^ zoom) - align = (align + 1) / 2 - local dst_start = math.floor((dst_size - scaled_src_size) * align + pan * scaled_src_size) - if dst_start < 0 then - --account for C int cast truncating as opposed to flooring - dst_start = dst_start + 1 - end - local dst_end = dst_start + scaled_src_size; - if dst_start >= dst_end then - dst_start = 0 - dst_end = 1 - end - return dst_start, dst_end - end - local zoom = mp.get_property_number("video-zoom") - - local align_x = mp.get_property_number("video-align-x") - local pan_x = mp.get_property_number("video-pan-x") - _video_dimensions.top_left.x, _video_dimensions.bottom_right.x = split_scaling(window_w, scaled_width, zoom, align_x, pan_x) - - local align_y = mp.get_property_number("video-align-y") - local pan_y = mp.get_property_number("video-pan-y") - _video_dimensions.top_left.y, _video_dimensions.bottom_right.y = split_scaling(window_h, scaled_height, zoom, align_y, pan_y) - else - _video_dimensions.top_left.x = 0 - _video_dimensions.bottom_right.x = window_w - _video_dimensions.top_left.y = 0 - _video_dimensions.bottom_right.y = window_h - end - _video_dimensions.size.w = _video_dimensions.bottom_right.x - _video_dimensions.top_left.x - _video_dimensions.size.h = _video_dimensions.bottom_right.y - _video_dimensions.top_left.y - _video_dimensions.ratios.w = _video_dimensions.size.w / w - _video_dimensions.ratios.h = _video_dimensions.size.h / h - video_dimensions_stale = false - return _video_dimensions -end - -for _, p in ipairs({ - "keepaspect", - "video-out-params", - "video-unscaled", - "panscan", - "video-zoom", - "video-align-x", - "video-pan-x", - "video-align-y", - "video-pan-y", - "osd-width", - "osd-height", -}) do - mp.observe_property(p, "native", function() video_dimensions_stale = true end) -end - -function drag_to_pan_handler(table) - if cleanup then - cleanup() - cleanup = nil - end - if table["event"] == "down" then - local video_dimensions = get_video_dimensions() - if not video_dimensions then return end - local mouse_pos_origin, video_pan_origin = {}, {} - local moved = false - mouse_pos_origin.x, mouse_pos_origin.y = mp.get_mouse_pos() - video_pan_origin.x = mp.get_property("video-pan-x") - video_pan_origin.y = mp.get_property("video-pan-y") - local idle = function() - if moved then - local mX, mY = mp.get_mouse_pos() - local pX = video_pan_origin.x + (mX - mouse_pos_origin.x) / video_dimensions.size.w - local pY = video_pan_origin.y + (mY - mouse_pos_origin.y) / video_dimensions.size.h - mp.command("no-osd set video-pan-x " .. clamp(pX, -3, 3) .. "; no-osd set video-pan-y " .. clamp(pY, -3, 3)) - moved = false - end - end - mp.register_idle(idle) - add_mouse_move_callback("drag-to-pan", function() moved = true end) - cleanup = function() - remove_mouse_move_callback("drag-to-pan") - mp.unregister_idle(idle) - end - end -end - -function pan_follows_cursor_handler(table) - if cleanup then - cleanup() - cleanup = nil - end - if table["event"] == "down" then - local video_dimensions = get_video_dimensions() - if not video_dimensions then return end - local window_w, window_h = mp.get_osd_size() - local moved = true - local idle = function() - if moved then - local mX, mY = mp.get_mouse_pos() - local x = math.min(1, math.max(- 2 * mX / window_w + 1, -1)) - local y = math.min(1, math.max(- 2 * mY / window_h + 1, -1)) - local command = "" - local margin, move_full = opts.pan_follows_cursor_margin, opts.pan_follows_cursor_move_if_full_view - if (not move_full and window_w < video_dimensions.size.w) then - command = command .. "no-osd set video-pan-x " .. clamp(x * (video_dimensions.size.w - window_w + 2 * margin) / (2 * video_dimensions.size.w), -3, 3) .. ";" - elseif mp.get_property_number("video-pan-x") ~= 0 then - command = command .. "no-osd set video-pan-x " .. "0;" - end - if (not move_full and window_h < video_dimensions.size.h) then - command = command .. "no-osd set video-pan-y " .. clamp(y * (video_dimensions.size.h - window_h + 2 * margin) / (2 * video_dimensions.size.h), -3, 3) .. ";" - elseif mp.get_property_number("video-pan-y") ~= 0 then - command = command .. "no-osd set video-pan-y " .. "0;" - end - if command ~= "" then - mp.command(command) - end - moved = false - end - end - mp.register_idle(idle) - add_mouse_move_callback("pan-follows-cursor", function() moved = true end) - cleanup = function() - remove_mouse_move_callback("pan-follows-cursor") - mp.unregister_idle(idle) - end - end -end - -function cursor_centric_zoom_handler(amt) - local zoom_inc = tonumber(amt) - if not zoom_inc or zoom_inc == 0 then return end - local video_dimensions = get_video_dimensions() - if not video_dimensions then return end - local mouse_pos_origin, video_pan_origin = {}, {} - mouse_pos_origin.x, mouse_pos_origin.y = mp.get_mouse_pos() - video_pan_origin.x = mp.get_property("video-pan-x") - video_pan_origin.y = mp.get_property("video-pan-y") - local zoom_origin = mp.get_property("video-zoom") - -- how far the cursor is form the middle of the video (in percentage) - local rx = (video_dimensions.top_left.x + video_dimensions.size.w / 2 - mouse_pos_origin.x) / (video_dimensions.size.w / 2) - local ry = (video_dimensions.top_left.y + video_dimensions.size.h / 2 - mouse_pos_origin.y) / (video_dimensions.size.h / 2) - - -- the size in pixels of the (in|de)crement - local diffHeight = (2 ^ zoom_inc - 1) * video_dimensions.size.h - local diffWidth = (2 ^ zoom_inc - 1) * video_dimensions.size.w - local newPanX = (video_pan_origin.x * video_dimensions.size.w + rx * diffWidth / 2) / (video_dimensions.size.w + diffWidth) - local newPanY = (video_pan_origin.y * video_dimensions.size.h + ry * diffHeight / 2) / (video_dimensions.size.h + diffHeight) - mp.command("no-osd set video-zoom " .. zoom_origin + zoom_inc .. "; no-osd set video-pan-x " .. clamp(newPanX, -3, 3) .. "; no-osd set video-pan-y " .. clamp(newPanY, -3, 3)) -end - -function align_border(x, y) - local video_dimensions = get_video_dimensions() - if not video_dimensions then return end - local window_w, window_h = mp.get_osd_size() - local x, y = tonumber(x), tonumber(y) - local command = "" - if x then - command = command .. "no-osd set video-pan-x " .. clamp(x * (video_dimensions.size.w - window_w) / (2 * video_dimensions.size.w), -3, 3) .. ";" - end - if y then - command = command .. "no-osd set video-pan-y " .. clamp(y * (video_dimensions.size.h - window_h) / (2 * video_dimensions.size.h), -3, 3) .. ";" - end - if command ~= "" then - mp.command(command) - end -end - -function pan_image(axis, amount, zoom_invariant, image_constrained) - amount = tonumber(amount) - if not amount or amount == 0 or axis ~= "x" and axis ~= "y" then return end - if zoom_invariant == "yes" then - amount = amount / 2 ^ mp.get_property_number("video-zoom") - end - local prop = "video-pan-" .. axis - local old_pan = mp.get_property_number(prop) - if image_constrained == "yes" then - local video_dimensions = get_video_dimensions() - if not video_dimensions then return end - local measure = axis == "x" and "w" or "h" - local window = {} - window.w, window.h = mp.get_osd_size() - local pixels_moved = amount * video_dimensions.size[measure] - -- should somehow refactor this - if pixels_moved > 0 then - if window[measure] > video_dimensions.size[measure] then - if video_dimensions.bottom_right[axis] >= window[measure] then return end - if video_dimensions.bottom_right[axis] + pixels_moved > window[measure] then - amount = (window[measure] - video_dimensions.bottom_right[axis]) / video_dimensions.size[measure] - end - else - if video_dimensions.top_left[axis] >= 0 then return end - if video_dimensions.top_left[axis] + pixels_moved > 0 then - amount = (0 - video_dimensions.top_left[axis]) / video_dimensions.size[measure] - end - end - else - if window[measure] > video_dimensions.size[measure] then - if video_dimensions.top_left[axis] <= 0 then return end - if video_dimensions.top_left[axis] + pixels_moved < 0 then - amount = (0 - video_dimensions.top_left[axis]) / video_dimensions.size[measure] - end - else - if video_dimensions.bottom_right[axis] <= window[measure] then return end - if video_dimensions.bottom_right[axis] + pixels_moved < window[measure] then - amount = (window[measure] - video_dimensions.bottom_right[axis]) / video_dimensions.size[measure] - end - end - end - end - mp.set_property_number(prop, old_pan + amount) -end - -function rotate_video(amt) - local rot = mp.get_property_number("video-rotate") - rot = (rot + amt) % 360 - mp.set_property_number("video-rotate", rot) -end - -function reset_pan_if_visible() - local video_dimensions = get_video_dimensions() - if not video_dimensions then return end - local window_w, window_h = mp.get_osd_size() - local command = "" - if (window_w >= video_dimensions.size.w) then - command = command .. "no-osd set video-pan-x 0" .. ";" - end - if (window_h >= video_dimensions.size.h) then - command = command .. "no-osd set video-pan-y 0" .. ";" - end - if command ~= "" then - mp.command(command) - end -end - -function force_print_filename() - mp.set_property("msg-level", "cplayer=info") - mp.commandv("print-text", mp.get_property("path")) - mp.set_property("msg-level", "all=no") -end - -function draw_ass() - local ww, wh = mp.get_osd_size() - local merge = function(a, b) - return b ~= "" and (a .. "\n" .. b) or a - end - mp.set_osd_ass(ww, wh, merge(merge(ass.status_line, ass.minimap), ass.ruler)) -end - -local status_line_enabled = false -local status_line_stale = true - -function mark_status_line_stale() - status_line_stale = true -end - -function refresh_status_line() - if not status_line_stale then return end - status_line_stale = false - local path = mp.get_property("path") - if path == nil or path == "" then - ass.status_line = "" - draw_ass() - return - end - local expanded = mp.command_native({ "expand-text", opts.status_line }) - if not expanded then - msg.warn("Error expanding status line") - ass.status_line = "" - draw_ass() - return - end - local w,h = mp.get_osd_size() - local an, x, y - local margin = 10 - if opts.status_line_position == "top_left" then - x = margin - y = margin - an = 7 - elseif opts.status_line_position == "top_right" then - x = w-margin - y = margin - an = 9 - elseif opts.status_line_position == "bottom_right" then - x = w-margin - y = h-margin - an = 3 - else - x = margin - y = h-margin - an = 1 - end - local a = assdraw:ass_new() - a:new_event() - a:an(an) - a:pos(x,y) - a:append("{\\fs".. opts.status_line_size.. "}{\\bord1.0}") - a:append(expanded) - ass.status_line = a.text - draw_ass() -end - -function enable_status_line() - if status_line_enabled then return end - status_line_enabled = true - local start = 0 - while true do - local s, e, cap = string.find(opts.status_line, "%${[?!]?([%l%d-/]*)", start) - if not s then break end - mp.observe_property(cap, nil, mark_status_line_stale) - start = e - end - mp.observe_property("path", nil, mark_status_line_stale) - mp.observe_property("osd-width", nil, mark_status_line_stale) - mp.observe_property("osd-height", nil, mark_status_line_stale) - mp.register_idle(refresh_status_line) - mark_status_line_stale() -end - -function disable_status_line() - if not status_line_enabled then return end - status_line_enabled = false - mp.unobserve_property(mark_status_line_stale) - mp.unregister_idle(refresh_status_line) - ass.status_line = "" - draw_ass() -end - -if opts.status_line_enabled then - enable_status_line() -end - -if opts.command_on_image_loaded ~= "" or opts.command_on_non_image_loaded ~= "" then - local was_image = false - local frame_count = nil - local audio_tracks = nil - local out_params_ready = nil - local path = nil - - function state_changed() - function set_image(is_image) - if is_image and not was_image and opts.command_on_first_image_loaded ~= "" then - mp.command(opts.command_on_first_image_loaded) - end - if is_image and opts.command_on_image_loaded ~= "" then - mp.command(opts.command_on_image_loaded) - end - if not is_image and was_image and opts.command_on_non_image_loaded ~= "" then - mp.command(opts.command_on_non_image_loaded) - end - was_image = is_image - end - -- only do things when state is consistent - if path ~= nil and audio_tracks ~= nil then - if frame_count == nil and audio_tracks > 0 then - set_image(false) - elseif out_params_ready and frame_count ~= nil then - -- png have 0 frames, jpg 1 ¯\_(ツ)_/¯ - set_image((frame_count == 0 or frame_count == 1) and audio_tracks == 0) - end - end - end - - mp.observe_property("video-out-params/par", "number", function(_, val) - out_params_ready = (val ~= nil and val > 0) - state_changed() - end) - mp.observe_property("estimated-frame-count", "number", function(_, val) - frame_count = val - state_changed() - end) - mp.observe_property("path", "string", function(_, val) - if not val or val == "" then - path = nil - else - path = val - end - state_changed() - end) - mp.register_event("tracks-changed", function() - audio_tracks = 0 - local tracks = 0 - for _, track in ipairs(mp.get_property_native("track-list")) do - tracks = tracks + 1 - if track.type == "audio" then - audio_tracks = audio_tracks + 1 - end - end - if tracks == 0 then - audio_tracks = nil - end - state_changed() - end) -end - -function refresh_minimap() - local dim = get_video_dimensions() - if not dim then - ass.minimap = "" - draw_ass() - return - end - if _minimap_old_timestamp and dim.timestamp == _minimap_old_timestamp then return end - _minimap_old_timestamp = dim.timestamp - local ww, wh = mp.get_osd_size() - if opts.minimap_hide_when_full_image_in_view then - if dim.top_left.x >= 0 and - dim.top_left.y >= 0 and - dim.bottom_right.x <= ww and - dim.bottom_right.y <= wh - then - ass.minimap = "" - draw_ass() - return - end - end - local center = { - x=opts.minimap_center[1]/100*ww, - y=opts.minimap_center[2]/100*wh - } - local cutoff = { - x=opts.minimap_max_size[1]/100*ww/2, - y=opts.minimap_max_size[2]/100*wh/2 - } - local a = assdraw.ass_new() - local draw = function(x, y, w, h, opacity, color) - a:new_event() - a:pos(center.x, center.y) - a:append("{\\bord0}") - a:append("{\\shad0}") - a:append("{\\c&" .. color .. "&}") - a:append("{\\2a&HFF}") - a:append("{\\3a&HFF}") - a:append("{\\4a&HFF}") - a:append("{\\1a&H" .. opacity .. "}") - w=w/2 - h=h/2 - a:draw_start() - local rounded = {true,true,true,true} -- tl, tr, br, bl - local x0,y0,x1,y1 = x-w, y-h, x+w, y+h - if x0 < -cutoff.x then - x0 = -cutoff.x - rounded[4] = false - rounded[1] = false - end - if y0 < -cutoff.y then - y0 = -cutoff.y - rounded[1] = false - rounded[2] = false - end - if x1 > cutoff.x then - x1 = cutoff.x - rounded[2] = false - rounded[3] = false - end - if y1 > cutoff.y then - y1 = cutoff.y - rounded[3] = false - rounded[4] = false - end - - local r = 3 - local c = 0.551915024494 * r - if rounded[0] then - a:move_to(x0 + r, y0) - else - a:move_to(x0,y0) - end - if rounded[1] then - a:line_to(x1 - r, y0) - a:bezier_curve(x1 - r + c, y0, x1, y0 + r - c, x1, y0 + r) - else - a:line_to(x1, y0) - end - if rounded[2] then - a:line_to(x1, y1 - r) - a:bezier_curve(x1, y1 - r + c, x1 - r + c, y1, x1 - r, y1) - else - a:line_to(x1, y1) - end - if rounded[3] then - a:line_to(x0 + r, y1) - a:bezier_curve(x0 + r - c, y1, x0, y1 - r + c, x0, y1 - r) - else - a:line_to(x0, y1) - end - if rounded[4] then - a:line_to(x0, y0 + r) - a:bezier_curve(x0, y0 + r - c, x0 + r - c, y0, x0 + r, y0) - else - a:line_to(x0, y0) - end - a:draw_stop() - end - local image = function() - draw((dim.top_left.x + dim.size.w/2 - ww/2) / opts.minimap_scale, - (dim.top_left.y + dim.size.h/2 - wh/2) / opts.minimap_scale, - dim.size.w / opts.minimap_scale, - dim.size.h / opts.minimap_scale, - opts.minimap_image_opacity, - opts.minimap_image_color) - end - local view = function() - draw(0, - 0, - ww / opts.minimap_scale, - wh / opts.minimap_scale, - opts.minimap_view_opacity, - opts.minimap_view_color) - end - if opts.minimap_view_above_image then - image() - view() - else - view() - image() - end - ass.minimap = a.text - draw_ass() -end - -local minimap_enabled = false - -function enable_minimap() - if minimap_enabled then return end - minimap_enabled = true - mp.register_idle(refresh_minimap) -end - -function disable_minimap() - if not minimap_enabled then return end - minimap_enabled = false - ass.minimap = a.text - draw_ass() - mp.unregister_idle(refresh_minimap) -end - -if opts.minimap_enabled then - enable_minimap() -end - -local ruler_state = 0 -- {0,1,2,3} = {inactive,setting first point,setting second point,done} -local ruler_first_point = nil -- in video space coordinates -local ruler_second_point = nil -- in video space coordinates - -function cursor_video_space() - local dim = get_video_dimensions() - if not dim then return nil end - local mx, my = mp.get_mouse_pos() - local ret = {} - ret.x = (mx - dim.top_left.x) / dim.ratios.w - ret.y = (my - dim.top_left.y) / dim.ratios.h - return ret -end -function video_space_to_screen(point) - local dim = get_video_dimensions() - if not dim then return nil end - local ret = {} - ret.x = point.x * dim.ratios.w + dim.top_left.x - ret.y = point.y * dim.ratios.h + dim.top_left.y - return ret -end - -function refresh_ruler() - local dim = get_video_dimensions() - if not dim then - ass.ruler = "" - draw_ass() - return - end - - local line_start = {} - local line_end = {} - if ruler_second_point then - line_start.image = ruler_first_point - line_start.screen = video_space_to_screen(ruler_first_point) - line_end.image = ruler_second_point - line_end.screen = video_space_to_screen(ruler_second_point) - elseif ruler_first_point then - line_start.image = ruler_first_point - line_start.screen = video_space_to_screen(ruler_first_point) - line_end.image = cursor_video_space() - line_end.screen = {} - line_end.screen.x, line_end.screen.y = mp.get_mouse_pos() - else - local mx, my = mp.get_mouse_pos() - line_start.image = cursor_video_space() - line_start.screen = {} - line_start.screen.x, line_start.screen.y = mp.get_mouse_pos() - line_end = line_start - end - local distinct = (math.abs(line_start.screen.x - line_end.screen.x) >= 1 - or math.abs(line_start.screen.y - line_end.screen.y) >= 1) - - local a = assdraw:ass_new() - local draw_setup = function(bord) - a:new_event() - a:pos(0,0) - a:append("{\\bord" .. bord .. "}") - a:append("{\\shad0}") - local r = opts.ruler_line_color - a:append("{\\3c&H".. r .. r .. r .. "&}") - a:append("{\\1a&HFF}") - a:append("{\\2a&HFF}") - a:append("{\\3a&H00}") - a:append("{\\4a&HFF}") - a:draw_start() - end - local dot = function(pos, size) - draw_setup(size) - a:move_to(pos.x, pos.y-0.5) - a:line_to(pos.x, pos.y+0.5) - end - local line = function(from, to, size) - draw_setup(size) - a:move_to(from.x, from.y) - a:line_to(to.x, to.y) - end - if distinct then - dot(line_start.screen, opts.ruler_dots_radius) - line(line_start.screen, line_end.screen, opts.ruler_line_width) - dot(line_end.screen, opts.ruler_dots_radius) - else - dot(line_start.screen, opts.ruler_dots_radius) - end - - local line_info = function() - if not opts.ruler_show_distance then return end - a:new_event() - a:append("{\\fs36}{\\bord1}") - a:pos((line_start.screen.x + line_end.screen.x) / 2, (line_start.screen.y + line_end.screen.y) / 2) - local an = 1 - if line_start.image.x < line_end.image.x then an = an + 2 end - if line_start.image.y < line_end.image.y then an = an + 6 end - a:an(an) - local image = math.sqrt(math.pow(line_start.image.x - line_end.image.x, 2) + math.pow(line_start.image.y - line_end.image.y, 2)) - local screen = math.sqrt(math.pow(line_start.screen.x - line_end.screen.x, 2) + math.pow(line_start.screen.y - line_end.screen.y, 2)) - if opts.ruler_coordinates_space == "both" then - a:append(string.format("image: %.1f\\Nscreen: %.1f", image, screen)) - elseif opts.ruler_coordinates_space == "image" then - a:append(string.format("%.1f", image)) - elseif opts.ruler_coordinates_space == "window" then - a:append(string.format("%.1f", screen)) - end - end - local dot_info = function(pos, opposite) - if not opts.ruler_show_coordinates then return end - a:new_event() - a:append("{\\fs" .. opts.ruler_font_size .."}{\\bord1}") - a:pos(pos.screen.x, pos.screen.y) - local an - if distinct then - an = 1 - if line_start.image.x > line_end.image.x then an = an + 2 end - if line_start.image.y < line_end.image.y then an = an + 6 end - else - an = 7 - end - if opposite then - an = 9 + 1 - an - end - a:an(an) - if opts.ruler_coordinates_space == "both" then - a:append(string.format("image: %.1f, %.1f\\Nscreen: %i, %i", - pos.image.x, pos.image.y, pos.screen.x, pos.screen.y)) - elseif opts.ruler_coordinates_space == "image" then - a:append(string.format("%.1f, %.1f", pos.image.x, pos.image.y)) - elseif opts.ruler_coordinates_space == "window" then - a:append(string.format("%i, %i", pos.screen.x, pos.screen.y)) - end - end - dot_info(line_start, true) - if distinct then - line_info() - dot_info(line_end, false) - end - if distinct and opts.ruler_show_angles ~= "no" then - local dist = 50 - local pos_from_angle = function(mult, angle) - return { - x = line_start.screen.x + mult * dist * math.cos(angle), - y = line_start.screen.y + mult * dist * math.sin(angle) - } - end - local extended = {x=line_start.screen.x, y=line_start.screen.y} - if line_end.screen.x > line_start.screen.x then - extended.x = extended.x + dist - else - extended.x = extended.x - dist - end - line(line_start.screen, extended, math.max(0, opts.ruler_line_width-0.5)) - local angle = math.atan(math.abs(line_start.image.y - line_end.image.y) / math.abs(line_start.image.x - line_end.image.x)) - local fix_angle - local an - if line_end.image.y < line_start.image.y and line_end.image.x > line_start.image.x then - -- upper-right - an = 4 - fix_angle = function(angle) return - angle end - elseif line_end.image.y < line_start.image.y then - -- upper-left - an = 6 - fix_angle = function(angle) return math.pi + angle end - elseif line_end.image.x < line_start.image.x then - -- bottom-left - an = 6 - fix_angle = function(angle) return math.pi - angle end - else - -- bottom-right - an = 4 - fix_angle = function(angle) return angle end - end - -- should implement this https://math.stackexchange.com/questions/873224/calculate-control-points-of-cubic-bezier-curve-approximating-a-part-of-a-circle - local cp1 = pos_from_angle(1, fix_angle(angle*1/4)) - local cp2 = pos_from_angle(1, fix_angle(angle*3/4)) - local p2 = pos_from_angle(1, fix_angle(angle)) - a:bezier_curve(cp1.x, cp1.y, cp2.x, cp2.y, p2.x, p2.y) - - a:new_event() - a:append("{\\fs" .. opts.ruler_font_size .."}{\\bord1}") - local text_pos = pos_from_angle(1.1, fix_angle(angle*2/3)) -- you'd think /2 would make more sense, but *2/3 looks better - a:pos(text_pos.x, text_pos.y) - a:an(an) - if opts.ruler_show_angles == "both" then - a:append(string.format("%.2f\\N%.1f°", angle, angle / math.pi * 180)) - elseif opts.ruler_show_angles == "degrees" then - a:append(string.format("%.1f°", angle / math.pi * 180)) - elseif opts.ruler_show_angles == "radians" then - a:append(string.format("%.2f", angle)) - end - end - - ass.ruler = a.text - draw_ass() -end - -function ruler_next() - if ruler_state == 0 then - mp.register_idle(refresh_ruler) - add_mouse_move_callback("ruler", function() end) -- only used to get an idle event on mouse move - for _,key in ipairs(opts.ruler_confirm_bindings) do - mp.add_forced_key_binding(key, "ruler-next-" .. key, ruler_next) - end - for _,key in ipairs(opts.ruler_exit_bindings) do - mp.add_forced_key_binding(key, "ruler-stop-" .. key, ruler_stop) - end - ruler_state = 1 - if opts.ruler_set_first_point_on_begin then - ruler_next() - end - elseif ruler_state == 1 then - ruler_first_point = cursor_video_space() - ruler_state = 2 - elseif ruler_state == 2 then - ruler_state = 3 - ruler_second_point = cursor_video_space() - if opts.ruler_clear_on_second_point_set then - ruler_next() - end - else - ruler_stop() - end -end - -function ruler_stop() - if ruler_state == 0 then return end - mp.unregister_idle(refresh_ruler) - for _,key in ipairs(opts.ruler_confirm_bindings) do - mp.remove_key_binding("ruler-next-" .. key) - end - for _,key in ipairs(opts.ruler_exit_bindings) do - mp.remove_key_binding("ruler-stop-" .. key) - end - remove_mouse_move_callback("ruler") - ruler_state = 0 - ruler_first_point = nil - ruler_second_point = nil - ass.ruler = "" - draw_ass() -end - -mp.add_key_binding(nil, "drag-to-pan", drag_to_pan_handler, {complex = true}) -mp.add_key_binding(nil, "pan-follows-cursor", pan_follows_cursor_handler, {complex = true}) -mp.add_key_binding(nil, "cursor-centric-zoom", cursor_centric_zoom_handler) -mp.add_key_binding(nil, "align-border", align_border) -mp.add_key_binding(nil, "pan-image", pan_image) -mp.add_key_binding(nil, "rotate-video", rotate_video) -mp.add_key_binding(nil, "reset-pan-if-visible", reset_pan_if_visible) -mp.add_key_binding(nil, "force-print-filename", force_print_filename) - -mp.add_key_binding(nil, "ruler", ruler_next) - -mp.add_key_binding(nil, "enable-status-line", enable_status_line) -mp.add_key_binding(nil, "disable-status-line", disable_status_line) -mp.add_key_binding(nil, "toggle-status-line", function() if status_line_enabled then disable_status_line() else enable_status_line() end end) - -mp.add_key_binding(nil, "enable-minimap", enable_minimap) -mp.add_key_binding(nil, "disable-minimap", disable_minimap) -mp.add_key_binding(nil, "toggle-minimap", function() if minimap_enabled then disable_minimap() else enable_minimap() end end) diff --git a/home/.config/ncmpcpp/config b/home/.config/ncmpcpp/config index c6b5ccd9..ebe09fb9 100644 --- a/home/.config/ncmpcpp/config +++ b/home/.config/ncmpcpp/config @@ -9,10 +9,9 @@ mpd_music_dir = ~/Music mpd_crossfade_time = 2 ##### visualizer ##### -visualizer_fifo_path = /tmp/mpd.fifo +visualizer_data_source = /tmp/mpd.fifo visualizer_output_name = Visualizer visualizer_in_stereo = yes -visualizer_sync_interval = 30 # spectrum,wave,wave_filled,ellipse. visualizer_type = wave_filled visualizer_look = ●▮ diff --git a/home/.config/neomutt/accounts/admin@reekynet.com b/home/.config/neomutt/accounts/admin@reekynet.com deleted file mode 100644 index 45503efe..00000000 --- a/home/.config/neomutt/accounts/admin@reekynet.com +++ /dev/null @@ -1,14 +0,0 @@ -# vim: filetype=muttrc - -set my_email = "admin@reekynet.com" -set from = $my_email -set sendmail = "/usr/bin/msmtp -a $my_email" -set realname = "ReekyNET Admin" -set status_format = "-%r-Mutt: $my_email %f [Msgs:%?M?%M/?%m%?n? New:%n?%?o? Old:%o?%?d? Del:%d?%?F? Flag:%F?%?t? Tag:%t?%?p? Post:%p?%?b? Inc:%b?%?l? %l?]---(%s/%S)-%>-(%P)---" -set mbox_type = Maildir -set folder = "~/.mail/$my_email" -set mbox = "+INBOX" -set record = "+INBOX" -set postponed = "+Drafts" -set spoolfile = "+INBOX" -mailboxes = +INBOX diff --git a/home/.config/neomutt/accounts/marko.korhonen@metropolia.fi b/home/.config/neomutt/accounts/marko.korhonen@metropolia.fi deleted file mode 100644 index f6c3442e..00000000 --- a/home/.config/neomutt/accounts/marko.korhonen@metropolia.fi +++ /dev/null @@ -1,14 +0,0 @@ -# vim: filetype=muttrc - -set my_email = "marko.korhonen@metropolia.fi" -set from = $my_email -set sendmail = "/usr/bin/msmtp -a $my_email" -set realname = "Marko Korhonen" -set status_format = "-%r-Mutt: $my_email %f [Msgs:%?M?%M/?%m%?n? New:%n?%?o? Old:%o?%?d? Del:%d?%?F? Flag:%F?%?t? Tag:%t?%?p? Post:%p?%?b? Inc:%b?%?l? %l?]---(%s/%S)-%>-(%P)---" -set mbox_type = Maildir -set folder = "~/.mail/$my_email" -set mbox = "+INBOX" -set record = "+INBOX" -set postponed = "+Drafts" -set spoolfile = "+INBOX" -mailboxes = +INBOX diff --git a/home/.config/neomutt/accounts/marko.korhonen@reekynet.com b/home/.config/neomutt/accounts/marko.korhonen@reekynet.com deleted file mode 100644 index 8b9d02be..00000000 --- a/home/.config/neomutt/accounts/marko.korhonen@reekynet.com +++ /dev/null @@ -1,14 +0,0 @@ -# vim: filetype=muttrc - -set my_email = "marko.korhonen@reekynet.com" -set from = $my_email -set sendmail = "/usr/bin/msmtp -a $my_email" -set realname = "Marko Korhonen" -set status_format = "-%r-Mutt: $my_email %f [Msgs:%?M?%M/?%m%?n? New:%n?%?o? Old:%o?%?d? Del:%d?%?F? Flag:%F?%?t? Tag:%t?%?p? Post:%p?%?b? Inc:%b?%?l? %l?]---(%s/%S)-%>-(%P)---" -set mbox_type = Maildir -set folder = "~/.mail/$my_email" -set mbox = "+INBOX" -set record = "+INBOX" -set postponed = "+Drafts" -set spoolfile = "+INBOX" -mailboxes = +INBOX diff --git a/home/.config/neomutt/accounts/marko@korhonen.cc b/home/.config/neomutt/accounts/marko@korhonen.cc new file mode 100644 index 00000000..d054f631 --- /dev/null +++ b/home/.config/neomutt/accounts/marko@korhonen.cc @@ -0,0 +1,9 @@ +# vim: filetype=neomuttrc + +set folder = ~/.mail/marko@korhonen.cc +set spoolfile = +INBOX +set postponed = +Drafts +set record = +Sent + +set realname='Marko Korhonen' +set from=marko@korhonen.cc diff --git a/home/.config/neomutt/accounts/reekymarko@reekynet.com b/home/.config/neomutt/accounts/reekymarko@reekynet.com deleted file mode 100644 index 9d578a85..00000000 --- a/home/.config/neomutt/accounts/reekymarko@reekynet.com +++ /dev/null @@ -1,15 +0,0 @@ -# vim: filetype=muttrc - -# Incoming mail from maildir -set my_email = "reekymarko@reekynet.com" -set from = $my_email -set sendmail = "/usr/bin/msmtp -a $my_email" -set realname = "Marko Korhonen" -set status_format = "-%r-Mutt: $my_email %f [Msgs:%?M?%M/?%m%?n? New:%n?%?o? Old:%o?%?d? Del:%d?%?F? Flag:%F?%?t? Tag:%t?%?p? Post:%p?%?b? Inc:%b?%?l? %l?]---(%s/%S)-%>-(%P)---" -set mbox_type = Maildir -set folder = ~/.mail/$my_email -set mbox = +INBOX -set record = +Sent -set postponed = +Drafts -set spoolfile = +INBOX -mailboxes = +INBOX diff --git a/home/.config/neomutt/appearance b/home/.config/neomutt/appearance deleted file mode 100644 index 49493cdb..00000000 --- a/home/.config/neomutt/appearance +++ /dev/null @@ -1 +0,0 @@ -color normal default default diff --git a/home/.config/neomutt/neomuttrc b/home/.config/neomutt/neomuttrc index 85ff9e15..f37ec331 100644 --- a/home/.config/neomutt/neomuttrc +++ b/home/.config/neomutt/neomuttrc @@ -1,15 +1,9 @@ -# vim: filetype=muttrc +# vim: filetype=neomuttrc -set sendmail = "/usr/bin/msmtp" -set mbox_type = Maildir -set folder = ~/.mail -set spoolfile = +Personal/INBOX +## General options +set header_cache = "~/.cache/neomutt" +set mbox_type=Maildir -source ~/.config/neomutt/appearance -source ~/.config/neomutt/sidebar -source ~/.config/neomutt/accounts/reekymarko@reekynet.com - -macro index 'source ~/.config/neomutt/accounts/reekymarko@reekynet.com!' -macro index 'source ~/.config/neomutt/accounts/marko.korhonen@reekynet.com!' -macro index 'source ~/.config/neomutt/accounts/admin@reekynet.com!' -macro index 'source ~/.config/neomutt/accounts/marko.korhonen@metropolia.fi!' +# Accounts +source "~/.config/neomutt/accounts/marko@korhonen.cc" +folder-hook $folder 'source ~/.config/neomutt/accounts/marko@korhonen.cc' diff --git a/home/.config/neomutt/sidebar b/home/.config/neomutt/sidebar deleted file mode 100644 index 616d505b..00000000 --- a/home/.config/neomutt/sidebar +++ /dev/null @@ -1,5 +0,0 @@ -# vim: filetype=muttrc - -set sidebar_visible = yes -set sidebar_indent_string = ' ' -sidebar_whitelist '~/.mail/<>/INBOX' diff --git a/home/.config/nvim/README.adoc b/home/.config/nvim/README.adoc new file mode 100644 index 00000000..caabc08f --- /dev/null +++ b/home/.config/nvim/README.adoc @@ -0,0 +1,16 @@ += FunctionalHacker's NeoVim configuration + +This is my personal NeoVim configuration I use for all text editing in my free +time and at my day job. I mostly code in Java, TypeScript and ReactJS, with +a bit of Rust and Python once in a blue moon. + +The configuration is quite minimal but still fully featured. Some highlights +include + +* LSP support with neovim's built in LSP client +** LSP servers are easily installed and auto-configured with Mason +* Treesitter +** Code folding +** Code highlighting +** Text objects +* Lazy plugin manager for fast startup times diff --git a/home/.config/nvim/coc-settings.json b/home/.config/nvim/coc-settings.json deleted file mode 100644 index 6ad1c293..00000000 --- a/home/.config/nvim/coc-settings.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "python.jediEnabled": false, - "suggest.noselect": false, - "suggest.echodocSupport": true, - "suggest.maxCompleteItemCount": 20, - "coc.preferences.formatOnSaveFiletypes": [ - "javascript", - "typescript", - "typescriptreact", - "json", - "javascriptreact", - "yaml" - ], - "prettier.singleQuote": true, - "diagnostic.errorSign": "•", - "diagnostic.warningSign": "•", - "diagnostic.infoSign": "•", - "suggest.snippetIndicator": "~", - "languageserver": { - "bash": { - "command": "bash-language-server", - "args": ["start"], - "filetypes": ["sh"], - "ignoredRootPaths": ["~"] - }, - "xml": { - "command": "xml-language-server", - "args": ["start"], - "filetypes": ["xml"], - "ignoredRootPaths": ["~"] - } - }, - "markdownlint.config": { - "rules": { - "default": true, - "line_length": false - } - } -} diff --git a/home/.config/nvim/conf.d/01-plugins.vim b/home/.config/nvim/conf.d/01-plugins.vim deleted file mode 100644 index e951fdc2..00000000 --- a/home/.config/nvim/conf.d/01-plugins.vim +++ /dev/null @@ -1,94 +0,0 @@ -" Auto-install vim-plug -if empty(glob('~/.config/nvim/autoload/plug.vim')) - silent !curl -fLo ~/.config/nvim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim - autocmd VimEnter * PlugInstall -endif - -" Set coc extensions -let g:coc_global_extensions = [ - \ 'coc-tsserver', - \ 'coc-html', - \ 'coc-tsserver', - \ 'coc-json', - \ 'coc-yaml', - \ 'coc-texlab', - \ 'coc-prettier', - \ 'coc-python', - \ 'coc-emmet', - \ 'coc-rust-analyzer', - \ 'coc-markdownlint', - \ 'coc-snippets', - \ ] - -call plug#begin() - -" statusline/tabline -Plug 'vim-airline/vim-airline' - -" Make editing passwords safer -Plug 'https://git.zx2c4.com/password-store', { 'rtp': 'contrib/vim/redact_pass.vim' } - -" Colorize color words -Plug 'norcalli/nvim-colorizer.lua' - -" Use neovim from firefox -Plug 'glacambre/firenvim', { 'do': { _ -> firenvim#install(0) } } - -" Spelling -Plug 'vim-scripts/Vimchant' - -" Pandoc plugins -Plug 'vim-pandoc/vim-pandoc' -Plug 'conornewton/vim-pandoc-markdown-preview' - -" Fuzzy finder -Plug 'junegunn/fzf' -Plug 'junegunn/fzf.vim' - -" Language syntax pack -Plug 'sheerun/vim-polyglot' - -" Read editorconfig settings -Plug 'editorconfig/editorconfig-vim' - -" Make directory if it doesn't exist -Plug 'pbrisbin/vim-mkdir' - -" Tree explorer -Plug 'scrooloose/nerdtree' - -" Moar snippets -Plug 'honza/vim-snippets' - -" Filetype icons -Plug 'ryanoasis/vim-devicons' - -" Surround stuff with brackets and quotes -Plug 'tpope/vim-surround' - -" Do stuff as sudo -Plug 'lambdalisue/suda.vim' - -" Conguer of Completion -Plug 'neoclide/coc.nvim', {'do': './install.sh nightly'} - -" VimL source for CoC -Plug 'Shougo/neco-vim' -Plug 'neoclide/coc-neco' - -" Git plugin -Plug 'jreybert/vimagit' - -" Git diff in gutter -Plug 'airblade/vim-gitgutter' - -" Gpg support -Plug 'jamessan/vim-gnupg' - -" Colorscheme -Plug 'joshdick/onedark.vim' - -" Latex plugin -Plug 'lervag/vimtex' - -call plug#end() diff --git a/home/.config/nvim/conf.d/02-appearance.vim b/home/.config/nvim/conf.d/02-appearance.vim deleted file mode 100644 index 7d4f593d..00000000 --- a/home/.config/nvim/conf.d/02-appearance.vim +++ /dev/null @@ -1,43 +0,0 @@ -" Set colorscheme -colorscheme onedark - -" Floating window transparency -set winblend=10 - -" Enable italics -let g:onedark_terminal_italics=1 - -" Disable built-in statusline because airline shows it -set noshowmode - -" Airline -set laststatus=2 -set encoding=utf-8 -let g:airline#extensions#tabline#enabled = 1 -let g:airline_powerline_fonts = 1 -let g:airline_section_warning = '' -let g:airline_section_error = '' -let g:airline_theme='onedark' - -" True color support -set termguicolors - -" Line numbering -set relativenumber -set number - -" Always show signcolumn -set signcolumn=yes - -" Autoindent and syntax highlight -set autoindent -set smartindent -syntax on -filetype on -filetype plugin indent on -set tabstop=4 -set shiftwidth=4 - -" Make gutter and cursorline bg transparent -highlight CursorLineNr guibg=transparent -highlight SignColumn guibg=transparent diff --git a/home/.config/nvim/conf.d/03-keybinds.vim b/home/.config/nvim/conf.d/03-keybinds.vim deleted file mode 100644 index 53bf144f..00000000 --- a/home/.config/nvim/conf.d/03-keybinds.vim +++ /dev/null @@ -1,35 +0,0 @@ -" Change leader to space -nnoremap -let mapleader = ' ' - -" Toggle nerdtree -map :NERDTreeToggle - -" Markdown preview -nmap MarkdownPreview -nmap MarkdownPreviewStop -nmap MarkdownPreviewToggle - -set splitbelow -set splitright - -" Move between buffers -nnoremap :bn -nnoremap :bp - -" Move between splits -nnoremap -nnoremap -nnoremap -nnoremap - -" Enable mouse -set mouse=a - -" Toggle equalalways -function ToggleEqual () - :set equalalways! - :set equalalways! -endfunction - -nnoremap = :call ToggleEqual() diff --git a/home/.config/nvim/conf.d/04-coc.vim b/home/.config/nvim/conf.d/04-coc.vim deleted file mode 100644 index a0424537..00000000 --- a/home/.config/nvim/conf.d/04-coc.vim +++ /dev/null @@ -1,129 +0,0 @@ -" Enable symbol highlight -autocmd CursorHold * silent call CocActionAsync('highlight') - -" If hidden is not set, TextEdit might fail. -set hidden - -" Some servers have issues with backup files, see #649 -set nobackup -set nowritebackup - -" Better display for messages -set cmdheight=2 - -" Smaller updatetime for CursorHold & CursorHoldI -set updatetime=300 - -" Don't give |ins-completion-menu| messages. -set shortmess+=c - -" Use tab for trigger completion with characters ahead and navigate. -" Use command ':verbose imap ' to make sure tab is not mapped by other plugin. -inoremap - \ pumvisible() ? "\" : - \ check_back_space() ? "\" : - \ coc#refresh() -inoremap pumvisible() ? "\" : "\" - -function! s:check_back_space() abort - let col = col('.') - 1 - return !col || getline('.')[col - 1] =~# '\s' -endfunction - -" Use to confirm snippet -inoremap pumvisible() ? coc#_select_confirm() : - \"\u\\=coc#on_enter()\" - -" Use to trigger completion. -inoremap coc#refresh() - -" Use to confirm completion, `u` means break undo chain at current position. -" Coc only does snippet and additional edit on confirm. -inoremap pumvisible() ? "\" : "\u\" - -" Use `[c` and `]c` to navigate diagnostics -nmap [c (coc-diagnostic-prev) -nmap ]c (coc-diagnostic-next) - -" Remap keys for gotos -nmap gd (coc-definition) -nmap gy (coc-type-definition) -nmap gi (coc-implementation) -nmap gr (coc-references) - -" 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('') - else - call CocAction('doHover') - endif -endfunction - -" Highlight symbol under cursor on CursorHold -autocmd CursorHold * silent call CocActionAsync('highlight') - -" Remap for rename current word -nmap rn (coc-rename) - -" Remap for format selected region -xmap f (coc-format-selected) -nmap f (coc-format-selected) - -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 - -" Remap for do codeAction of selected region, ex: `aap` for current paragraph -xmap a (coc-codeaction-selected) -nmap a (coc-codeaction-selected) - -" Remap for do codeAction of current line -nmap ac (coc-codeaction) -" Fix autofix problem of current line -nmap qf (coc-fix-current) - -" Use `:Format` to format current buffer -command! -nargs=0 Format :call CocAction('format') - -" Use `:Fold` to fold current buffer -command! -nargs=? Fold :call CocAction('fold', ) - - -" Add diagnostic info for https://github.com/itchyny/lightline.vim -let g:lightline = { - \ 'colorscheme': 'wombat', - \ 'active': { - \ 'left': [ [ 'mode', 'paste' ], - \ [ 'cocstatus', 'readonly', 'filename', 'modified' ] ] - \ }, - \ 'component_function': { - \ 'cocstatus': 'coc#status' - \ }, - \ } - - - -" Using CocList -" Show all diagnostics -nnoremap a :CocList diagnostics -" Manage extensions -nnoremap e :CocList extensions -" Show commands -nnoremap c :CocList commands -" Find symbol of current document -nnoremap o :CocList outline -" Search workspace symbols -nnoremap s :CocList -I symbols -" Do default action for next item. -nnoremap j :CocNext -" Do default action for previous item. -nnoremap k :CocPrev -" Resume latest coc list -nnoremap p :CocListResume diff --git a/home/.config/nvim/conf.d/05-language.vim b/home/.config/nvim/conf.d/05-language.vim deleted file mode 100644 index e5e7cb5e..00000000 --- a/home/.config/nvim/conf.d/05-language.vim +++ /dev/null @@ -1,12 +0,0 @@ -" LaTex settings -let g:vimtex_view_method='zathura' -let g:Tex_DefaultTargetFormat='pdf' -let g:Tex_MultipleCompileFormats='pdf, aux' -let g:vimtex_compiler_progname='nvr' - -" YAML settings -au! BufNewFile,BufReadPost *.{yaml,yml} set filetype=yaml foldmethod=indent -autocmd FileType yaml setlocal ts=2 sts=2 sw=2 expandtab - -" Run rustfmt on save -let g:rustfmt_autosave = 1 diff --git a/home/.config/nvim/conf.d/06-misc.vim b/home/.config/nvim/conf.d/06-misc.vim deleted file mode 100644 index 2768d29d..00000000 --- a/home/.config/nvim/conf.d/06-misc.vim +++ /dev/null @@ -1,38 +0,0 @@ -" Enable python support -let g:python3_host_prog='/usr/bin/python3' -let pyxversion=3 - -" Use suda by default -let g:suda_smart_edit = 1 - -" Remap exit terminal mode to esc -au TermOpen * tnoremap - -" Use system clipboard -set clipboard=unnamedplus - -" Remove extra line -set cmdheight=1 - -" Disable auto commenting -set formatoptions-=cro - -" Set pandoc preview program -let g:pandoc_preview_pdf_cmd = "zathura" - -" Case insensitive search -set ignorecase -set smartcase - -" Nerdtree settings -let NERDTreeMinimalUI = 1 "remove press ? for help" -let NERDTreeAutoDeleteBuffer = 1 " delete buffer when file is deleted -let NERDTreeQuitOnOpen = 1 " close nerdtree when opening file -let NERDTreeDirArrows = 1 - -" Firenvim filetypes -au BufEnter github.com_*.txt set filetype=markdown -au BufEnter gitlab.com_*.txt set filetype=markdown -au BufEnter git.reekynet.com_*.txt set filetype=markdown -au BufEnter www.reddit.com_*.txt set filetype=markdown -au BufEnter node.reekynet.com_*.txt set filetype=json diff --git a/home/.config/nvim/conf.d/07-clipboardfix.vim b/home/.config/nvim/conf.d/07-clipboardfix.vim deleted file mode 100644 index 4942a685..00000000 --- a/home/.config/nvim/conf.d/07-clipboardfix.vim +++ /dev/null @@ -1,18 +0,0 @@ -{%@@ if profile == "Mirkwood" @@%} -" Wayland clipboard provider that strips carriage returns (GTK3 issue). -" This is needed because currently there's an issue where GTK3 applications on -" Wayland contain carriage returns at the end of the lines (this is a root -" issue that needs to be fixed). -let g:clipboard = { - \ 'name': 'wayland-strip-carriage', - \ 'copy': { - \ '+': 'wl-copy --foreground --type text/plain', - \ '*': 'wl-copy --foreground --type text/plain --primary', - \ }, - \ 'paste': { - \ '+': {-> systemlist('wl-paste --no-newline | tr -d "\r"')}, - \ '*': {-> systemlist('wl-paste --no-newline --primary | tr -d "\r"')}, - \ }, - \ 'cache_enabled': 1, - \ } -{%@@ endif @@%} diff --git a/home/.config/nvim/conf.d/08-fzf.vim b/home/.config/nvim/conf.d/08-fzf.vim deleted file mode 100644 index b8568b23..00000000 --- a/home/.config/nvim/conf.d/08-fzf.vim +++ /dev/null @@ -1,53 +0,0 @@ -" FZF in floating window - -autocmd! FileType fzf -autocmd FileType fzf call SetFZFoptions() -function SetFZFoptions() - set noshowmode noruler nonumber norelativenumber - tunmap -endfunction - -let g:fzf_layout = { 'window': 'call FloatingFZF()' } -function! FloatingFZF() - let buf = nvim_create_buf(v:false, v:true) - call setbufvar(buf, '&signcolumn', 'no') - - let width = float2nr(&columns * 0.8) - let height = float2nr(&lines * 0.6) - let horizontal = 1 - let vertical = 1 - - let opts = { - \ 'relative': 'editor', - \ 'row': (&lines - height) / 2, - \ 'col': (&columns - width) / 2, - \ 'width': width, - \ 'height': height, - \ 'style': 'minimal' - \ } - - call nvim_open_win(buf, v:true, opts) -endfunction - -" Looks -"let $FZF_DEFAULT_OPTS=' --color=dark --color=fg:15,bg:-1,hl:1,fg+:#ffffff,bg+:0,hl+:1 --color=info:0,prompt:0,pointer:12,marker:4,spinner:11,header:-1 --layout=reverse --margin=1,4' - -" Keybinds -nmap :Files -nmap :Rg - -" Files command customization -command! -bang -nargs=* Rg - \ call fzf#vim#files( - \ 'rg --files --hidden 2>/dev/null'.shellescape(), 1, - \ 0 ? fzf#vim#with_preview('up:60%') - \ : fzf#vim#with_preview('right:50%:hidden', '?'), - \ 0) - -" Ripgrep command customization -command! -bang -nargs=* Rg - \ call fzf#vim#grep( - \ 'rg --column --hidden --line-number --no-heading --color=always --smart-case '.shellescape(), 1, - \ 0 ? fzf#vim#with_preview('up:60%') - \ : fzf#vim#with_preview('right:50%:hidden', '?'), - \ 0) diff --git a/home/.config/nvim/ftplugin/java.lua b/home/.config/nvim/ftplugin/java.lua new file mode 100644 index 00000000..58e0b620 --- /dev/null +++ b/home/.config/nvim/ftplugin/java.lua @@ -0,0 +1,111 @@ +local nvim_local_dir = vim.fn.expand("~/.local/share/nvim") +local mason_packages = nvim_local_dir .. "/mason/packages" +local lombok_jar = mason_packages .. "/jdtls/lombok.jar" +local project_name = vim.fn.fnamemodify(vim.fn.getcwd(), ":p:h:t") +local workspace_dir = nvim_local_dir .. "/jdtls-workspaces/" .. project_name +local lsp_utils = require("lsp_utils") +local jvm = "/usr/lib/jvm" +local java_version = 21 + +require("jdtls").start_or_attach({ + cmd = { + jvm .. "/java-" .. java_version .. "-openjdk-amd64/bin/java", + "-Declipse.application=org.eclipse.jdt.ls.core.id1", + "-Dosgi.bundles.defaultStartLevel=4", + "-Declipse.product=org.eclipse.jdt.ls.core.product", + "-Dlog.protocol=true", + "-Dlog.level=ALL", + "-Xms1g", + "--add-modules=ALL-SYSTEM", + "--add-opens", + "java.base/java.util=ALL-UNNAMED", + "--add-opens", + "java.base/java.lang=ALL-UNNAMED", + "-javaagent:" .. lombok_jar, + "-jar", + vim.fn.glob(mason_packages .. "/jdtls/plugins/org.eclipse.equinox.launcher_*.jar"), + "-configuration", + nvim_local_dir .. "/mason/packages/jdtls/config_linux", + "-data", + workspace_dir, + }, + settings = { + java = { + signatureHelp = { enabled = true }, + autobuild = { enabled = false }, + configuration = { + runtimes = { + { + name = "JavaSE-1.8", + path = jvm .. "/java-8-openjdk-amd64/", + }, + { + name = "JavaSE-11", + path = jvm .. "/java-11-openjdk-amd64/", + }, + { + name = "JavaSE-17", + path = jvm .. "/java-17-openjdk-amd64/", + }, + { + name = "JavaSE-21", + path = jvm .. "/java-21-openjdk-amd64/", + }, + }, + }, + }, + }, + completion = { favoriteStaticMembers = { "java.text.MessageFormat.format" } }, + handlers = { + ["language/status"] = function() end, + }, + init_options = { + bundles = { + vim.fn.glob(mason_packages .. "/java-debug-adapter/extension/server/com.microsoft.java.debug.plugin-*.jar"), + }, + }, + capabilities = lsp_utils.get_capabilities(), + on_attach = lsp_utils.map_keys, +}) + +function RunJava() + local function show_output(output) + vim.cmd("split") + vim.cmd("enew") + vim.fn.append(0, output) + --vim.cmd("1d") -- Remove the empty first line + vim.bo[0].modifiable = false + end + + local filename = vim.fn.expand("%") -- Get the current file name + local class_name = vim.fn.fnamemodify(filename, ":r") -- Extract the class name + local compile_cmd = "javac " .. filename + local run_cmd = "java " .. class_name + + -- Create a temporary file to capture the compile output + local temp_file = vim.fn.tempname() + + -- Run the compilation command and save the output to the temporary file + local compile_exit_code = vim.fn.system(compile_cmd .. " > " .. temp_file .. " 2>&1") + + -- Check the exit code of the compile command + if compile_exit_code == 0 then + -- Compilation was successful, run the Java program + show_output(vim.fn.systemlist(run_cmd)) + else + -- Compilation failed, display the error output from the temporary file + show_output(vim.fn.readfile(temp_file)) + end + + -- Clean up the temporary file and class file + vim.fn.delete(temp_file) + vim.fn.delete(vim.fn.expand("%:p:h") .. "/" .. class_name .. ".class") +end + +-- Define a VimScript command to execute the Lua function +vim.api.nvim_exec( + [[ + command! RunJava lua RunJava() +]], + false +) diff --git a/home/.config/nvim/init.lua b/home/.config/nvim/init.lua new file mode 100644 index 00000000..a23743b8 --- /dev/null +++ b/home/.config/nvim/init.lua @@ -0,0 +1,28 @@ +-- Install lazy if it's not yet installed +local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" +if not vim.loop.fs_stat(lazypath) then + vim.fn.system({ + "git", + "clone", + "--filter=blob:none", + "https://github.com/folke/lazy.nvim.git", + "--branch=stable", -- latest stable release + lazypath, + }) +end +vim.opt.rtp:prepend(lazypath) + +require("settings") +require("keybinds") +require("neovide") +require("highlight_yank") +require("lazy").setup({ + spec = { import = "plugins" }, + lockfile = "~/git/dotfiles/home/.config/nvim/lazy-lock.json", + performance = { + disabled_plugins = { "netrwPlugin" }, + }, + defaults = { + -- version = "*", -- Disabled for now + }, +}) diff --git a/home/.config/nvim/init.vim b/home/.config/nvim/init.vim deleted file mode 100644 index 6d4602ff..00000000 --- a/home/.config/nvim/init.vim +++ /dev/null @@ -1,3 +0,0 @@ -for f in split(glob('~/.config/nvim/conf.d/*.vim'), '\n') - exe 'source' f -endfor diff --git a/home/.config/nvim/lazy-lock.json b/home/.config/nvim/lazy-lock.json new file mode 100644 index 00000000..1ebcf4b2 --- /dev/null +++ b/home/.config/nvim/lazy-lock.json @@ -0,0 +1,70 @@ +{ + "LuaSnip": { "branch": "master", "commit": "c9b9a22904c97d0eb69ccb9bab76037838326817" }, + "alpha-nvim": { "branch": "main", "commit": "de72250e054e5e691b9736ee30db72c65d560771" }, + "auto-dark-mode.nvim": { "branch": "master", "commit": "c31de126963ffe9403901b4b0990dde0e6999cc6" }, + "bufferline.nvim": { "branch": "main", "commit": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3" }, + "cder.nvim": { "branch": "main", "commit": "0a071389bb52544ac9cf9557378aa1212dff6982" }, + "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, + "cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" }, + "cmp-git": { "branch": "main", "commit": "d9efd00e0b9527ee05031ce7e7e55d6b118f543e" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "99290b3ec1322070bcfb9e846450a46f6efa50f0" }, + "cmp-nvim-lua": { "branch": "main", "commit": "f12408bdb54c39c23e67cab726264c10db33ada8" }, + "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, + "cmp-spell": { "branch": "master", "commit": "694a4e50809d6d645c1ea29015dad0c293f019d6" }, + "cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" }, + "confirm-quit.nvim": { "branch": "main", "commit": "f15f6d728d385a3d2efa22098e9a45b8a2b20144" }, + "copilot-cmp": { "branch": "master", "commit": "15fc12af3d0109fa76b60b5cffa1373697e261d1" }, + "copilot.lua": { "branch": "master", "commit": "535ebb53880ae67e33d9e50b503d25f9ef3ca06c" }, + "diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" }, + "dropbar.nvim": { "branch": "master", "commit": "873ba43f83398fd0e28880cf98fd89e6ce667c51" }, + "firenvim": { "branch": "master", "commit": "c4ab7d2aeb145cd93db8660cb134f771722f2b5e" }, + "friendly-snippets": { "branch": "main", "commit": "efff286dd74c22f731cdec26a70b46e5b203c619" }, + "fugitive-gitea": { "branch": "master", "commit": "d93176028d13820f941c165c14039a6019744a5a" }, + "gitsigns.nvim": { "branch": "main", "commit": "7010000889bfb6c26065e0b0f7f1e6aa9163edd9" }, + "indent-blankline.nvim": { "branch": "master", "commit": "005b56001b2cb30bfa61b7986bc50657816ba4ba" }, + "kanagawa.nvim": { "branch": "master", "commit": "709018d5af92d2e5780bfb8a6d36e9cad01a6402" }, + "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, + "lazydev.nvim": { "branch": "main", "commit": "2367a6c0a01eb9edb0464731cc0fb61ed9ab9d2c" }, + "lualine.nvim": { "branch": "master", "commit": "1517caa8fff05e4b4999857319d3b0609a7f57fa" }, + "markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" }, + "mason-extra-cmds": { "branch": "main", "commit": "cc7163cb5089236042b5e351cb1a078d0905e40d" }, + "mason-lock.nvim": { "branch": "main", "commit": "86614f76c3442fba1c5c8d79aa1efcb3ad69de1c" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "1a31f824b9cd5bc6f342fc29e9a53b60d74af245" }, + "mason.nvim": { "branch": "main", "commit": "fc98833b6da5de5a9c5b1446ac541577059555be" }, + "mini.nvim": { "branch": "main", "commit": "189010888bc37fc1c382f2dcc81b7a6441160686" }, + "neoformat": { "branch": "master", "commit": "874dcd0995db340278c41860e0209bef29d6ef87" }, + "noice.nvim": { "branch": "main", "commit": "0427460c2d7f673ad60eb02b35f5e9926cf67c59" }, + "nui.nvim": { "branch": "main", "commit": "8d3bce9764e627b62b07424e0df77f680d47ffdb" }, + "nvim-asciidoc-preview": { "branch": "main", "commit": "b12e113b5f7e7522b4e412213d5498cc529f2628" }, + "nvim-autopairs": { "branch": "master", "commit": "6522027785b305269fa17088395dfc0f456cedd2" }, + "nvim-cmp": { "branch": "main", "commit": "1e1900b0769324a9675ef85b38f99cca29e203b3" }, + "nvim-colorizer.lua": { "branch": "master", "commit": "a065833f35a3a7cc3ef137ac88b5381da2ba302e" }, + "nvim-dap": { "branch": "master", "commit": "6a5bba0ddea5d419a783e170c20988046376090d" }, + "nvim-dap-ui": { "branch": "master", "commit": "bc81f8d3440aede116f821114547a476b082b319" }, + "nvim-jdtls": { "branch": "master", "commit": "2f7bff9b8d2ee1918b36ca55f19547d9d335a268" }, + "nvim-lsp-file-operations": { "branch": "master", "commit": "9744b738183a5adca0f916527922078a965515ed" }, + "nvim-lspconfig": { "branch": "master", "commit": "85e0dd26b710e834a105d679200d01e326a3d2b0" }, + "nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" }, + "nvim-notify": { "branch": "master", "commit": "22f29093eae7785773ee9d543f8750348b1a195c" }, + "nvim-tree.lua": { "branch": "master", "commit": "44d9b58f11d5a426c297aafd0be1c9d45617a849" }, + "nvim-treesitter": { "branch": "master", "commit": "da5825bf70cc2ea7eacd1e60c32c07baf19adeba" }, + "nvim-treesitter-textobjects": { "branch": "master", "commit": "9937e5e356e5b227ec56d83d0a9d0a0f6bc9cad4" }, + "nvim-ts-autotag": { "branch": "main", "commit": "a1d526af391f6aebb25a8795cbc05351ed3620b5" }, + "nvim-ufo": { "branch": "main", "commit": "a52c92c3bbaa10f0c9b547a50adaa8c7d8b29f94" }, + "nvim-web-devicons": { "branch": "master", "commit": "4c3a5848ee0b09ecdea73adcd2a689190aeb728c" }, + "password-store": { "branch": "master", "commit": "b5e965a838bb68c1227caa2cdd874ba496f10149" }, + "plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" }, + "promise-async": { "branch": "main", "commit": "119e8961014c9bfaf1487bf3c2a393d254f337e2" }, + "schemastore.nvim": { "branch": "main", "commit": "d307d291f38678d064cb987112926df6d9134de3" }, + "statuscol.nvim": { "branch": "main", "commit": "c399884e8f64019ec9bb581251f9710915b7f996" }, + "suda.vim": { "branch": "master", "commit": "9adda7d195222d4e2854efb2a88005a120296c47" }, + "telescope-fzf-native.nvim": { "branch": "main", "commit": "1f08ed60cafc8f6168b72b80be2b2ea149813e55" }, + "telescope-project.nvim": { "branch": "master", "commit": "ce2c9fe209a68c7a924acde42d94ed8a2b2a52c5" }, + "telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" }, + "telescope.nvim": { "branch": "master", "commit": "a4ed82509cecc56df1c7138920a1aeaf246c0ac5" }, + "vim-asciidoctor": { "branch": "master", "commit": "f553311b5db03440eb8d7035434d0405e4a2c559" }, + "vim-caddyfile": { "branch": "master", "commit": "24fe0720551883e407cb70ae1d7c03f162d1d5a0" }, + "vim-fugitive": { "branch": "master", "commit": "4a745ea72fa93bb15dd077109afbb3d1809383f2" }, + "vim-gnupg": { "branch": "main", "commit": "f9b608f29003dfde6450931dc0f495a912973a88" }, + "which-key.nvim": { "branch": "main", "commit": "370ec46f710e058c9c1646273e6b225acf47cbed" } +} diff --git a/home/.config/nvim/lua/highlight_yank.lua b/home/.config/nvim/lua/highlight_yank.lua new file mode 100644 index 00000000..649506bb --- /dev/null +++ b/home/.config/nvim/lua/highlight_yank.lua @@ -0,0 +1,12 @@ +-- Highlight yanked text + +local ag = vim.api.nvim_create_augroup +local au = vim.api.nvim_create_autocmd + +au('TextYankPost', { + group = ag('yank_highlight', {}), + pattern = '*', + callback = function() + vim.highlight.on_yank { higroup='IncSearch', timeout=300 } + end, +}) diff --git a/home/.config/nvim/lua/keybinds.lua b/home/.config/nvim/lua/keybinds.lua new file mode 100644 index 00000000..6676d121 --- /dev/null +++ b/home/.config/nvim/lua/keybinds.lua @@ -0,0 +1,15 @@ +vim.keymap.set("n", "b", function() + local current_theme = vim.fn.eval("&background") + if current_theme == "dark" then + vim.cmd("set background=light") + else + vim.cmd("set background=dark") + end +end, { desc = "Toggle background between dark and light" }) + +vim.keymap.set("n", "h", "nohlsearch", { desc = "Turn off search highlight" }) +vim.keymap.set("n", "co", 'silent! execute "%bd|e#|bd#"', { desc = "Close other buffers" }) +vim.keymap.set("n", "a", "e#", { desc = "Edit alternate file" }) +vim.keymap.set("n", "", "bnext", { desc = "Next buffer" }) +vim.keymap.set("n", "", "bprevious", { desc = "Previous buffer" }) +vim.keymap.set("t", "", "", { desc = "Exit terminal insert mode with esc" }) diff --git a/home/.config/nvim/lua/lsp_utils.lua b/home/.config/nvim/lua/lsp_utils.lua new file mode 100644 index 00000000..8851c307 --- /dev/null +++ b/home/.config/nvim/lua/lsp_utils.lua @@ -0,0 +1,56 @@ +-- This module contains lsp related +-- reusable functions +local m = {} + +local lsp = vim.lsp +local diagnostic = vim.diagnostic +local k = vim.keymap.set + +-- Maps LSP specific keybinds. +-- This makes them only available when LSP is running +function m.map_keys() + local builtin = require("telescope.builtin") + + require("which-key").add({ + { "w", group = "Workspace" }, + }) + + k("n", "F", lsp.buf.format, { desc = "Format with LSP" }) + k("n", "ca", lsp.buf.code_action, { desc = "Code action" }) + k("n", "e", diagnostic.open_float, { desc = "Open diagnostics" }) + k("n", "k", lsp.buf.signature_help, { desc = "Signature help" }) + k("n", "rn", lsp.buf.rename, { desc = "Rename symbol" }) + k("n", "wa", lsp.buf.add_workspace_folder, { desc = "Add folder" }) + k("n", "wl", function() + print(vim.inspect(lsp.buf.list_workspace_folders())) + end, { desc = "List folders" }) + k("n", "wr", lsp.buf.remove_workspace_folder, { desc = "Remove folder" }) + k("n", "K", lsp.buf.hover, { desc = "Hover" }) + k("n", "[d", diagnostic.goto_prev, { desc = "Previous diagnostic" }) + k("n", "]d", diagnostic.goto_next, { desc = "Next diagnostic" }) + k("n", "gD", lsp.buf.declaration, { desc = "Declaration" }) + k("n", "gd", builtin.lsp_definitions, { desc = "Definition" }) + k("n", "gi", builtin.lsp_implementations, { desc = "Implementation" }) + k("n", "gr", builtin.lsp_references, { desc = "References" }) + k("n", "gs", builtin.lsp_document_symbols, { desc = "Symbols" }) + k("n", "gt", lsp.buf.type_definition, { desc = "Type definition" }) +end + +-- Combine built-in LSP and cmp cabaibilities +-- and additional capabilities from other plugins +function m.get_capabilities() + local capabilities = vim.tbl_deep_extend( + "force", + lsp.protocol.make_client_capabilities(), + require("cmp_nvim_lsp").default_capabilities() + ) + + -- Neovim hasn't added foldingRange to default capabilities, users must add it manually for ufo + capabilities.textDocument.foldingRange = { + dynamicRegistration = false, + lineFoldingOnly = true, + } + return capabilities +end + +return m diff --git a/home/.config/nvim/lua/neovide.lua b/home/.config/nvim/lua/neovide.lua new file mode 100644 index 00000000..e0037efb --- /dev/null +++ b/home/.config/nvim/lua/neovide.lua @@ -0,0 +1,29 @@ +local g = vim.g +local o = vim.o + +-- Change scale factor with C+ and C- +g.neovide_scale_factor = {{@@ scale_factor|default(1.0) @@}} +local change_scale_factor = function(delta) + g.neovide_scale_factor = g.neovide_scale_factor * delta +end +vim.keymap.set("n", "", function() + change_scale_factor(1.25) +end) +vim.keymap.set("n", "", function() + change_scale_factor(1 / 1.25) +end) + +-- Hide mouse when typing in neovide (disabled) +g.neovide_hide_mouse_when_typing = false + +-- Enable cursor particles in neovide +g.neovide_cursor_vfx_mode = "railgun" + +-- Enable dark/light theme detection +g.neovide_theme = "auto" + +-- Confirm quit +g.neovide_confirm_quit = true + +-- Set font +--o.guifont = "Hack Nerd Font Mono:h15" diff --git a/home/.config/nvim/lua/pager.lua b/home/.config/nvim/lua/pager.lua new file mode 100644 index 00000000..aea0b8d7 --- /dev/null +++ b/home/.config/nvim/lua/pager.lua @@ -0,0 +1,2 @@ +-- Settings for pager mode +vim.keymap.set("n", "q", vim.cmd.q) diff --git a/home/.config/nvim/lua/plugins/alpha.lua b/home/.config/nvim/lua/plugins/alpha.lua new file mode 100644 index 00000000..792ea76d --- /dev/null +++ b/home/.config/nvim/lua/plugins/alpha.lua @@ -0,0 +1,39 @@ +-- Startup dashboard +--- @type LazyPluginSpec +return { + "goolord/alpha-nvim", + config = function() + local alpha = require("alpha") + local dashboard = require("alpha.themes.dashboard") + dashboard.section.header.val = { + [[ __ ]], + [[ ___ ___ ___ __ __ /\_\ ___ ___ ]], + [[ / _ `\ / __`\ / __`\/\ \/\ \\/\ \ / __` __`\ ]], + [[/\ \/\ \/\ __//\ \_\ \ \ \_/ |\ \ \/\ \/\ \/\ \ ]], + [[\ \_\ \_\ \____\ \____/\ \___/ \ \_\ \_\ \_\ \_\]], + [[ \/_/\/_/\/____/\/___/ \/__/ \/_/\/_/\/_/\/_/]], + } + dashboard.section.buttons.val = { + dashboard.button( + "p", + "📽 Open a project", + ":lua require('telescope').extensions.project.project()" + ), + dashboard.button("e", " New file", ":ene startinsert "), + dashboard.button("", "🔍 Find file", "Telescope find_files"), + dashboard.button("", "𑪢 Grep files", "Telescope live_grep"), + dashboard.button("l", "🛋 Lazy", ":Lazy"), + dashboard.button("m", "📦 Mason", ":Mason"), + dashboard.button("q", "ꭙ Quit NeoVim", ":qa"), + } + + -- Fortune in footer + dashboard.section.footer.val = require("alpha.fortune")() + + dashboard.config.opts.noautocmd = true + + vim.cmd([[autocmd User AlphaReady echo 'ready']]) + + alpha.setup(dashboard.config) + end, +} diff --git a/home/.config/nvim/lua/plugins/asciidoc.lua b/home/.config/nvim/lua/plugins/asciidoc.lua new file mode 100644 index 00000000..d723b3fc --- /dev/null +++ b/home/.config/nvim/lua/plugins/asciidoc.lua @@ -0,0 +1,15 @@ +-- AsciiDoc plugins are grouped together here +return { + -- Vim ♥️ Asciidoctor + --- @type LazyPluginSpec + { + "habamax/vim-asciidoctor", + ft = { "asciidoctor", "asciidoc" }, + }, + -- AsciiDoc preview + --- @type LazyPluginSpec + { + "tigion/nvim-asciidoc-preview", + ft = { "asciidoctor", "asciidoc" }, + }, +} diff --git a/home/.config/nvim/lua/plugins/autopairs.lua b/home/.config/nvim/lua/plugins/autopairs.lua new file mode 100644 index 00000000..cde6d85c --- /dev/null +++ b/home/.config/nvim/lua/plugins/autopairs.lua @@ -0,0 +1,6 @@ +-- Automatic brackets +--- @type LazyPluginSpec +return { + "windwp/nvim-autopairs", + config = true +} diff --git a/home/.config/nvim/lua/plugins/bufferline.lua b/home/.config/nvim/lua/plugins/bufferline.lua new file mode 100644 index 00000000..e4c85983 --- /dev/null +++ b/home/.config/nvim/lua/plugins/bufferline.lua @@ -0,0 +1,16 @@ +-- Bufferline +--- @type LazyPluginSpec +return { + "akinsho/bufferline.nvim", + dependencies = { "kyazdani42/nvim-web-devicons" }, + --- @type BufferlineConfig + opts = { + options = { + diagnostics = "nvim_lsp", + diagnostics_indicator = function(count, level) + local icon = level:match("error") and " " or " " + return " " .. icon .. count + end, + }, + }, +} diff --git a/home/.config/nvim/lua/plugins/caddyfile.lua b/home/.config/nvim/lua/plugins/caddyfile.lua new file mode 100644 index 00000000..ec4c5273 --- /dev/null +++ b/home/.config/nvim/lua/plugins/caddyfile.lua @@ -0,0 +1,6 @@ +-- Caddyfile syntax support +--- @type LazyPluginSpec +return { + "isobit/vim-caddyfile", + ft = "caddyfile", +} diff --git a/home/.config/nvim/lua/plugins/cmp.lua b/home/.config/nvim/lua/plugins/cmp.lua new file mode 100644 index 00000000..9f6537d5 --- /dev/null +++ b/home/.config/nvim/lua/plugins/cmp.lua @@ -0,0 +1,150 @@ +-- Auto completion +--- @type LazyPluginSpec +return { + "hrsh7th/nvim-cmp", + dependencies = { + "hrsh7th/cmp-buffer", -- Buffer source + -- Git source + { + "petertriho/cmp-git", + dependencies = { "nvim-lua/plenary.nvim" }, + config = true, + }, + "hrsh7th/cmp-nvim-lsp", -- LSP source + "hrsh7th/cmp-nvim-lua", -- Neovim Lua API documentation source + "hrsh7th/cmp-path", -- Path source + "hrsh7th/cmp-cmdline", -- cmdline source + "saadparwaiz1/cmp_luasnip", -- Snippets source + "f3fora/cmp-spell", -- Spell check source + "petertriho/cmp-git", -- Git source + -- Copilot source + { + "zbirenbaum/copilot-cmp", + opts = { fix_pairs = true }, + }, + }, + config = function() + local cmp = require("cmp") + local luasnip = require("luasnip") + + local has_words_before = function() + unpack = unpack or table.unpack + local line, col = unpack(vim.api.nvim_win_get_cursor(0)) + return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil + end + + -- Set completeopt to have a better completion experience + vim.o.completeopt = "menuone,noselect" + + local bordered = cmp.config.window.bordered() + + cmp.setup({ + snippet = { + expand = function(args) + luasnip.lsp_expand(args.body) + end, + }, + window = { + completion = bordered, + documentation = bordered, + }, + mapping = { + [""] = cmp.mapping.select_prev_item(), + [""] = cmp.mapping.select_next_item(), + [""] = cmp.mapping.scroll_docs(-4), + [""] = cmp.mapping.scroll_docs(4), + [""] = cmp.mapping.complete(), + [""] = cmp.mapping.close(), + [""] = cmp.mapping.confirm({ + behavior = cmp.ConfirmBehavior.Replace, + select = true, + }), + -- Snippet placeholder forward + [""] = cmp.mapping(function(fallback) + if luasnip.jumpable(1) then + luasnip.jump(1) + else + fallback() + end + end, { "i", "s" }), + -- Snippet placeholder backward + [""] = cmp.mapping(function(fallback) + if luasnip.jumpable(-1) then + luasnip.jump(-1) + else + fallback() + end + end, { "i", "s" }), + -- Completion menu forward + [""] = cmp.mapping(function(fallback) + if cmp.visible() then + -- If only one entry, select it + if #cmp.get_entries() == 1 then + cmp.confirm({ select = true }) + else + cmp.select_next_item() + end + elseif has_words_before() then + cmp.complete() + if #cmp.get_entries() == 1 then + cmp.confirm({ select = true }) + end + else + fallback() + end + end, { "i", "s" }), + -- Completion menu backward + [""] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_prev_item() + else + fallback() + end + end, { "i", "s" }), + }, + sources = { + { name = "luasnip" }, + { name = "nvim_lsp" }, + { name = "nvim_lua" }, + { name = "git" }, + { name = "copilot" }, + { name = "buffer" }, + { name = "spell" }, + { name = "path" }, + { + name = "lazydev", + group_index = 0, -- set group index to 0 to skip loading LuaLS completions + }, + }, + }) + + require("cmp_git").setup() + + -- Enable autopairs when enter is processed + -- on completion + local cmp_autopairs = require("nvim-autopairs.completion.cmp") + cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done()) + + -- search cmdline setup. + cmp.setup.cmdline({ "/", "?" }, { + mapping = cmp.mapping.preset.cmdline(), + sources = { + { name = "buffer" }, + }, + }) + -- `:` cmdline setup. + cmp.setup.cmdline(":", { + mapping = cmp.mapping.preset.cmdline(), + sources = cmp.config.sources({ + { name = "path" }, + }, { + { + name = "cmdline", + option = { + ignore_cmds = { "Man", "!" }, + }, + }, + }), + }) + end, +} diff --git a/home/.config/nvim/lua/plugins/confirm-quit.lua b/home/.config/nvim/lua/plugins/confirm-quit.lua new file mode 100644 index 00000000..f140e7af --- /dev/null +++ b/home/.config/nvim/lua/plugins/confirm-quit.lua @@ -0,0 +1,10 @@ +-- Confirm before quit +--- @type LazyPluginSpec +return { + cond = vim.g.neovide == not nil, + "yutkat/confirm-quit.nvim", + event = "CmdlineEnter", + opts = { + quit_message = "You are in Neovide, are you sure you want to quit?", + }, +} diff --git a/home/.config/nvim/lua/plugins/diffview.lua b/home/.config/nvim/lua/plugins/diffview.lua new file mode 100644 index 00000000..aa17c163 --- /dev/null +++ b/home/.config/nvim/lua/plugins/diffview.lua @@ -0,0 +1,3 @@ +-- Improved diffs +--- @type LazyPluginSpec +return { "sindrets/diffview.nvim" } diff --git a/home/.config/nvim/lua/plugins/dropbar.lua b/home/.config/nvim/lua/plugins/dropbar.lua new file mode 100644 index 00000000..30ef6fff --- /dev/null +++ b/home/.config/nvim/lua/plugins/dropbar.lua @@ -0,0 +1,6 @@ +-- Show the current LSP context in winbar +--- @type LazyPluginSpec +return { + enabled = vim.fn.has("nvim-0.10") == 1, + "Bekaboo/dropbar.nvim", +} diff --git a/home/.config/nvim/lua/plugins/firenvim.lua b/home/.config/nvim/lua/plugins/firenvim.lua new file mode 100644 index 00000000..dba55753 --- /dev/null +++ b/home/.config/nvim/lua/plugins/firenvim.lua @@ -0,0 +1,17 @@ +-- Neovim inside Firefox +--- @type LazyPluginSpec +return { + "glacambre/firenvim", + build = function() + vim.fn["firenvim#install"](0) + end, + config = function() + vim.g.firenvim_config = { + localSettings = { + [".*"] = { + takeOver = "never", + }, + }, + } + end, +} diff --git a/home/.config/nvim/lua/plugins/fugitive.lua b/home/.config/nvim/lua/plugins/fugitive.lua new file mode 100644 index 00000000..a8086c6c --- /dev/null +++ b/home/.config/nvim/lua/plugins/fugitive.lua @@ -0,0 +1,37 @@ +local k = vim.keymap.set + +-- Git commands +--- @type LazyPluginSpec +return { + "tpope/vim-fugitive", + dependencies = { "borissov/fugitive-gitea" }, + config = function() + vim.g.fugitive_gitea_domains = { + "https://git.korhonen.cc", + "https://git.rossum.fi", + } + + -- Keybinds + k("n", "gs", function() + vim.cmd("Git status") + end, { desc = "Status" }) + + k("n", "gaa", function() + vim.cmd("Git add -A") + end, { desc = "All" }) + + k("n", "gc", function() + vim.cmd("Git commit") + end, { desc = "Commit" }) + + k("n", "gu", function() + vim.cmd("Git push") + end, { desc = "Push" }) + + k("n", "gd", function() + vim.cmd("Git pull") + end, { desc = "Pull" }) + + k({ "n", "x" }, "gb", "'<,'>GBrowse", { desc = "Open in browser" }) + end, +} diff --git a/home/.config/nvim/lua/plugins/gitsigns.lua b/home/.config/nvim/lua/plugins/gitsigns.lua new file mode 100644 index 00000000..4cec2e48 --- /dev/null +++ b/home/.config/nvim/lua/plugins/gitsigns.lua @@ -0,0 +1,34 @@ +local k = vim.keymap.set + +--- @type LazyPluginSpec +return { + "lewis6991/gitsigns.nvim", + config = function() + local gs = require("gitsigns") + gs.setup() + + -- Keybinds + local opts + + -- Add groups for which-key + require("which-key").add({ + { "g", group = "Git" }, + { "gr", group = "Reset" }, + { "ga", group = "Add" }, + }) + + -- Hunk navigation + k("n", "[h", gs.prev_hunk, { desc = "Previous hunk" }) + k("n", "]h", gs.next_hunk, { desc = "Next hunk" }) + + -- Hunk actions + opts = { desc = "Hunk" } + k("n", "grh", gs.reset_hunk, opts) + k("n", "gah", gs.stage_hunk, opts) + + -- Buffer actions + opts = { desc = "Buffer" } + k("n", "gab", gs.stage_buffer, opts) + k("n", "grb", gs.reset_buffer, opts) + end, +} diff --git a/home/.config/nvim/lua/plugins/gnupg.lua b/home/.config/nvim/lua/plugins/gnupg.lua new file mode 100644 index 00000000..4da3d9d8 --- /dev/null +++ b/home/.config/nvim/lua/plugins/gnupg.lua @@ -0,0 +1,6 @@ +-- Edit GPG encrypted files transparently +--- @type LazyPluginSpec +return { + "jamessan/vim-gnupg", + ft = { "gpg" }, +} diff --git a/home/.config/nvim/lua/plugins/indent-blankline.lua b/home/.config/nvim/lua/plugins/indent-blankline.lua new file mode 100644 index 00000000..8ddab8c7 --- /dev/null +++ b/home/.config/nvim/lua/plugins/indent-blankline.lua @@ -0,0 +1,24 @@ +-- Indent characters +--- @type LazyPluginSpec +return { + "lukas-reineke/indent-blankline.nvim", + --- @type ibl.config + opts = { + exclude = { + filetypes = { + "", + "checkhealth", + "alpha", + "git", + "gitcommit", + "TelescopePrompt", + "TelescopeResults", + "help", + "lazy", + "lspinfo", + "man", + }, + }, + }, + main = "ibl", +} diff --git a/home/.config/nvim/lua/plugins/kanagawa.lua b/home/.config/nvim/lua/plugins/kanagawa.lua new file mode 100644 index 00000000..3cd3beac --- /dev/null +++ b/home/.config/nvim/lua/plugins/kanagawa.lua @@ -0,0 +1,56 @@ +-- Colorscheme +--- @type LazyPluginSpec +return { + "rebelot/kanagawa.nvim", + dependencies = { { "f-person/auto-dark-mode.nvim", config = true } }, + --- @type KanagawaConfig + opts = { + compile = true, + dimInactive = true, + colors = { + theme = { + all = { + ui = { + bg_gutter = "none", -- Hide gutter background + }, + }, + }, + }, + background = { + dark = "wave", + light = "lotus", + }, + overrides = function(colors) + local theme = colors.theme + return { + -- Transparent floating windows + NormalFloat = { bg = "none" }, + FloatBorder = { bg = "none" }, + FloatTitle = { bg = "none" }, + NormalDark = { fg = theme.ui.fg_dim, bg = theme.ui.bg_m3 }, + LazyNormal = { bg = theme.ui.bg_m3, fg = theme.ui.fg_dim }, + MasonNormal = { bg = theme.ui.bg_m3, fg = theme.ui.fg_dim }, + + -- Block-like modern Telescope UI + TelescopeTitle = { fg = theme.ui.special, bold = true }, + TelescopePromptNormal = { bg = theme.ui.bg_p1 }, + TelescopePromptBorder = { fg = theme.ui.bg_p1, bg = theme.ui.bg_p1 }, + TelescopeResultsNormal = { fg = theme.ui.fg_dim, bg = theme.ui.bg_m1 }, + TelescopeResultsBorder = { fg = theme.ui.bg_m1, bg = theme.ui.bg_m1 }, + TelescopePreviewNormal = { bg = theme.ui.bg_dim }, + TelescopePreviewBorder = { bg = theme.ui.bg_dim, fg = theme.ui.bg_dim }, + + -- More uniform look for the popup menu + Pmenu = { fg = theme.ui.shade0, bg = theme.ui.bg_p1, blend = vim.o.pumblend }, + PmenuSel = { fg = "NONE", bg = theme.ui.bg_p2 }, + PmenuSbar = { bg = theme.ui.bg_m1 }, + PmenuThumb = { bg = theme.ui.bg_p2 }, + } + end, + }, + --- @param opts KanagawaConfig + config = function(_, opts) + require("kanagawa").setup(opts) + vim.cmd("colorscheme kanagawa") + end, +} diff --git a/home/.config/nvim/lua/plugins/lazydev.lua b/home/.config/nvim/lua/plugins/lazydev.lua new file mode 100644 index 00000000..4e9b1b54 --- /dev/null +++ b/home/.config/nvim/lua/plugins/lazydev.lua @@ -0,0 +1,15 @@ +-- Neovim setup for init.lua and plugin development with full signature help, docs and completion for the nvim lua API. +--- @type LazyPluginSpec +return { + { + "folke/lazydev.nvim", + ft = "lua", -- only load on lua files + opts = { + library = { + -- See the configuration section for more details + -- Load luvit types when the `vim.uv` word is found + { path = "luvit-meta/library", words = { "vim%.uv" } }, + }, + }, + }, +} diff --git a/home/.config/nvim/lua/plugins/lualine.lua b/home/.config/nvim/lua/plugins/lualine.lua new file mode 100644 index 00000000..1aaba3e7 --- /dev/null +++ b/home/.config/nvim/lua/plugins/lualine.lua @@ -0,0 +1,38 @@ +local noice_mode = require("noice").api.statusline.mode +-- Statusline +--- @type LazyPluginSpec +return { + "nvim-lualine/lualine.nvim", + dependencies = { "kyazdani42/nvim-web-devicons" }, + opts = { + sections = { + lualine_x = { + "encoding", + "fileformat", + "filetype", + { + noice_mode.get, + cond = noice_mode.has, + color = { fg = "#ff9e64" }, + }, + }, + lualine_z = { + { + "selectioncount", + cond = function() + local mode = vim.fn.mode() + return mode == "v" or mode == "V" or mode == "\22" + end, + }, + { + "location", + cond = function() + local mode = vim.fn.mode() + return mode ~= "v" and mode ~= "V" and mode ~= "\22" + end, + }, + }, + }, + }, + config = true, +} diff --git a/home/.config/nvim/lua/plugins/luasnip.lua b/home/.config/nvim/lua/plugins/luasnip.lua new file mode 100644 index 00000000..1364a570 --- /dev/null +++ b/home/.config/nvim/lua/plugins/luasnip.lua @@ -0,0 +1,19 @@ +-- Snippets plugin +--- @type LazyPluginSpec +return { + "L3MON4D3/LuaSnip", + -- Snippets collection + dependencies = { "rafamadriz/friendly-snippets" }, + config = function() + local vsCodeLoader = require("luasnip/loaders/from_vscode") + + -- Load friendly-snippets + vsCodeLoader.lazy_load() + + -- Load my custom snippets + vsCodeLoader.lazy_load({ + paths = { "./snippets" }, + }) + end, + run = "make install_jsregexp", +} diff --git a/home/.config/nvim/lua/plugins/markdown-preview.lua b/home/.config/nvim/lua/plugins/markdown-preview.lua new file mode 100644 index 00000000..731496ab --- /dev/null +++ b/home/.config/nvim/lua/plugins/markdown-preview.lua @@ -0,0 +1,10 @@ +-- Markdown preview +--- @type LazyPluginSpec +return { + "iamcco/markdown-preview.nvim", + build = "cd app && yarn install", + config = function() + vim.g.mkdp_filetypes = { "markdown" } + end, + ft = { "markdown" }, +} diff --git a/home/.config/nvim/lua/plugins/mason.lua b/home/.config/nvim/lua/plugins/mason.lua new file mode 100644 index 00000000..ad4afb42 --- /dev/null +++ b/home/.config/nvim/lua/plugins/mason.lua @@ -0,0 +1,75 @@ +-- Package manager for LSP servers, DAP adapters etc. +-- It also handles starting all of my LSP servers +--- @type LazyPluginSpec +return { + "mason-org/mason.nvim", + version = "^1.0.0", + dependencies = { + "neovim/nvim-lspconfig", + { "mason-org/mason-lspconfig.nvim", version = "^1.0.0" }, + -- Add MasonUpdateAll + { "Zeioth/mason-extra-cmds", opts = {} }, + -- Add lockfile support + { + "zapling/mason-lock.nvim", + opts = { + lockfile_path = vim.fn.expand("~/git/dotfiles/home/.config/nvim/mason-lock.json"), + }, + }, + -- Extended functionality for jdtls + "mfussenegger/nvim-jdtls", + -- Add support for LSP file operations + { "antosha417/nvim-lsp-file-operations", opts = {} }, + -- Automatically fetch schemas from JSON schema store + "b0o/schemastore.nvim", + }, + config = function() + require("mason").setup() + + local mlspc = require("mason-lspconfig") + local lsp_utils = require("lsp_utils") + local lspconfig = require("lspconfig") + + local commonLspConfigArgs = { + on_attach = lsp_utils.map_keys, + capabilities = lsp_utils.get_capabilities(), + } + + mlspc.setup() + mlspc.setup_handlers({ + -- Default handler + function(server_name) + lspconfig[server_name].setup(commonLspConfigArgs) + end, + + -- Disable tsserver diagnostics diagnostics + -- that come from ESLint + ["ts_ls"] = function() + lspconfig.ts_ls.setup(vim.tbl_extend("force", commonLspConfigArgs, { + settings = { + diagnostics = { + ignoredCodes = { + 6133, -- Unused variable + 6192, -- Unused import + }, + }, + }, + })) + end, + + -- Don't set up jdtls, it is set up by nvim-jdtls + ["jdtls"] = function() end, + + ["jsonls"] = function() + lspconfig.jsonls.setup(vim.tbl_extend("force", commonLspConfigArgs, { + settings = { + json = { + schemas = require("schemastore").json.schemas(), + validate = { enable = true }, + }, + }, + })) + end, + }) + end, +} diff --git a/home/.config/nvim/lua/plugins/mini.lua b/home/.config/nvim/lua/plugins/mini.lua new file mode 100644 index 00000000..1c2c25a9 --- /dev/null +++ b/home/.config/nvim/lua/plugins/mini.lua @@ -0,0 +1,12 @@ +-- Library of 30+ independent Lua modules improving overall Neovim +--- @type LazyPluginSpec +return { + "echasnovski/mini.nvim", + config = function() + require("mini.surround").setup() + require("mini.comment").setup() + + -- Recommended for which-key + require("mini.icons").setup() + end, +} diff --git a/home/.config/nvim/lua/plugins/neoformat.lua b/home/.config/nvim/lua/plugins/neoformat.lua new file mode 100644 index 00000000..1bdc479a --- /dev/null +++ b/home/.config/nvim/lua/plugins/neoformat.lua @@ -0,0 +1,12 @@ +-- Formatter plugin +--- @type LazyPluginSpec +return { + "sbdchd/neoformat", + keys = { + { + desc = "Format with Neoformat", + "f", + "Neoformat", + }, + }, +} diff --git a/home/.config/nvim/lua/plugins/noice.lua b/home/.config/nvim/lua/plugins/noice.lua new file mode 100644 index 00000000..1de8aae2 --- /dev/null +++ b/home/.config/nvim/lua/plugins/noice.lua @@ -0,0 +1,30 @@ +-- Replace much of neovim's default UI +-- with a modern replacement +--- @type LazyPluginSpec +return { + "folke/noice.nvim", + event = "VeryLazy", + dependencies = { "MunifTanjim/nui.nvim", "rcarriga/nvim-notify" }, + --- @type NoiceConfig + opts = { + lsp = { + -- override markdown rendering so that **cmp** and other plugins use **Treesitter** + override = { + ["vim.lsp.util.convert_input_to_markdown_lines"] = true, + ["vim.lsp.util.stylize_markdown"] = true, + ["cmp.entry.get_documentation"] = true, + }, + }, + presets = { + -- add a border to hover docs and signature help + lsp_doc_border = true, + }, + }, + keys = { + { + desc = "Dismiss notifications", + "d", + "NoiceDismiss", + }, + }, +} diff --git a/home/.config/nvim/lua/plugins/nvim-colorizer.lua b/home/.config/nvim/lua/plugins/nvim-colorizer.lua new file mode 100644 index 00000000..ce3131d5 --- /dev/null +++ b/home/.config/nvim/lua/plugins/nvim-colorizer.lua @@ -0,0 +1,6 @@ +-- High performance color highlighter +--- @type LazyPluginSpec +return { + "norcalli/nvim-colorizer.lua", + config = true, +} diff --git a/home/.config/nvim/lua/plugins/nvim-dap.lua b/home/.config/nvim/lua/plugins/nvim-dap.lua new file mode 100644 index 00000000..7eb63a51 --- /dev/null +++ b/home/.config/nvim/lua/plugins/nvim-dap.lua @@ -0,0 +1,123 @@ +-- Debug adapter for NeoVim + +local masonPkg = vim.fn.stdpath("data") .. "/mason/packages" +--- @type LazyPluginSpec +return { + "mfussenegger/nvim-dap", + dependencies = { + { + "rcarriga/nvim-dap-ui", + dependencies = { "nvim-neotest/nvim-nio" }, + config = true, + }, + }, + config = function() + local dap = require("dap") + local configurations = dap.configurations + local adapters = dap.adapters + local pick_process = require("dap.utils").pick_process + + -- Applies all given configurations to the given filetypes + --- @param filetypes string[] + --- @param configs Configuration[] + local function dapConfigure(filetypes, configs) + for _, ft in ipairs(filetypes) do + configurations[ft] = configs + end + end + + -- Bash/sh + local bashAdapter = masonPkg .. "/bash-debug-adapter" + local bashExtension = bashAdapter .. "/extension" + adapters.bashdb = { + type = "executable", + command = bashAdapter .. "/bash-debug-adapter", + name = "bashdb", + } + configurations.sh = { + name = "Debug with bashdb", + type = "bashdb", + request = "launch", + showDebugOutput = true, + trace = true, + pathBashdbLib = bashExtension .. "/bashdb_dir", + pathBashdb = bashExtension .. "/bashdb_dir/bashdb", + file = "${file}", + program = "${file}", + cwd = "${workspaceFolder}", + pathCat = "cat", + pathBash = "/bin/bash", + pathMkfifo = "mkfifo", + pathPkill = "pkill", + args = {}, + env = {}, + terminalKind = "integrated", + } + + -- JavaScript/TypeScript in Firefox/Chrome/Node + adapters.libreWolf = { + type = "executable", + command = "node", + args = { masonPkg .. "/firefox-debug-adapter/dist/adapter.bundle.js" }, + } + adapters["pwa-node"] = { + type = "server", + host = "localhost", + port = "${port}", + executable = { + command = "node", + args = { masonPkg .. "/js-debug-adapter/js-debug/src/dapDebugServer.js", "8123" }, + }, + } + + --- @type Configuration[] + local browserConfigs = { + { + name = "LibreWolf attach", + type = "libreWolf", + request = "attach", + url = "http://localhost:4000", + webRoot = "${workspaceFolder}", + }, + { + name = "Chrome attach", + type = "pwa-chrome", + request = "attach", + cwd = "${workspaceFolder}", + }, + } + + --- @type Configuration[] + local nodeConfigs = { + { + name = "Node attach", + type = "pwa-node", + request = "attach", + processId = pick_process, + cwd = "${workspaceFolder}", + }, + { + name = "Node launch", + type = "pwa-node", + request = "launch", + program = "${file}", + cwd = "${workspaceFolder}", + port = "8123", + }, + } + + dapConfigure({ "typescriptreact", "javascriptreact" }, browserConfigs) + dapConfigure({ "typescript", "javascript" }, vim.tbl_extend("force", browserConfigs, nodeConfigs)) + + -- Java + configurations.java = { + { + name = "Debug (Attach) - Remote", + type = "java", + request = "attach", + hostName = "127.0.0.1", + port = 9009, + }, + } + end, +} diff --git a/home/.config/nvim/lua/plugins/nvim-tree.lua b/home/.config/nvim/lua/plugins/nvim-tree.lua new file mode 100644 index 00000000..fb185398 --- /dev/null +++ b/home/.config/nvim/lua/plugins/nvim-tree.lua @@ -0,0 +1,25 @@ +-- Tree explorer +--- @type LazyPluginSpec +return { + "kyazdani42/nvim-tree.lua", + dependencies = { "kyazdani42/nvim-web-devicons" }, + opts = { + diagnostics = { + enable = true, + show_on_dirs = true, + }, + renderer = { + highlight_git = true, + }, + update_focused_file = { + enable = true, + }, + }, + keys = { + { + desc = "Open/close nvim-tree", + "o", + "NvimTreeToggle", + }, + }, +} diff --git a/home/.config/nvim/lua/plugins/redact_pass.lua b/home/.config/nvim/lua/plugins/redact_pass.lua new file mode 100644 index 00000000..984de136 --- /dev/null +++ b/home/.config/nvim/lua/plugins/redact_pass.lua @@ -0,0 +1,8 @@ +-- Make editing passwords safer +--- @type LazyPluginSpec +return { + "https://git.zx2c4.com/password-store", + config = function(plugin) + vim.opt.rtp:append(plugin.dir .. "contrib/vim/redact_pass.vim") + end, +} diff --git a/home/.config/nvim/lua/plugins/statuscol.lua b/home/.config/nvim/lua/plugins/statuscol.lua new file mode 100644 index 00000000..c8890013 --- /dev/null +++ b/home/.config/nvim/lua/plugins/statuscol.lua @@ -0,0 +1,16 @@ +-- Customize statuscolumn +--- @type LazyPluginSpec +return { + "luukvbaal/statuscol.nvim", + config = function() + local builtin = require("statuscol.builtin") + require("statuscol").setup({ + relculright = true, + segments = { + { text = { builtin.foldfunc }, click = "v:lua.ScFa" }, + { text = { "%s" }, click = "v:lua.ScSa" }, + { text = { builtin.lnumfunc, " " }, click = "v:lua.ScLa" }, + }, + }) + end, +} diff --git a/home/.config/nvim/lua/plugins/suda.lua b/home/.config/nvim/lua/plugins/suda.lua new file mode 100644 index 00000000..e02bd3ae --- /dev/null +++ b/home/.config/nvim/lua/plugins/suda.lua @@ -0,0 +1,3 @@ +-- Do stuff as sudo +--- @type LazyPluginSpec +return { "lambdalisue/suda.vim" } diff --git a/home/.config/nvim/lua/plugins/telescope.lua b/home/.config/nvim/lua/plugins/telescope.lua new file mode 100644 index 00000000..0a8435a9 --- /dev/null +++ b/home/.config/nvim/lua/plugins/telescope.lua @@ -0,0 +1,107 @@ +--- @type LazyPluginSpec +return { + "nvim-telescope/telescope.nvim", + dependencies = { + -- Internal dependency for telescope + "nvim-lua/plenary.nvim", + + -- Use fzf for fuzzy finder + { + "nvim-telescope/telescope-fzf-native.nvim", + build = "make", + }, + + -- Replace vim built in select with telescope + "nvim-telescope/telescope-ui-select.nvim", + + -- cd plugin for telescope + "zane-/cder.nvim", + + -- project plugin for telescope + "nvim-telescope/telescope-project.nvim", + }, + opts = { + -- Set layout to vertical + defaults = { + layout_strategy = "flex", + layout_config = { + flex = { + flip_columns = 200, + }, + }, + }, + pickers = { + find_files = { find_command = { "fd", "-Ht", "f" } }, + lsp_references = { show_line = false }, + live_grep = { + additional_args = function() + return { "--hidden" } + end, + }, + }, + extensions = { + cder = { + previewer_command = "eza " + .. "-a " + .. "--color=always " + .. "-T " + .. "--level=3 " + .. "--icons " + .. "--git-ignore " + .. "--long " + .. "--no-permissions " + .. "--no-user " + .. "--no-filesize " + .. "--git " + .. "--ignore-glob=.git", + dir_command = { "fd", "-Ht", "d", ".", os.getenv("HOME") }, + }, + }, + }, + keys = function() + local telescope = require("telescope") + local builtin = require("telescope.builtin") + local extensions = telescope.extensions + + return { + { + desc = "Open Telescope", + "t", + function() + builtin.builtin({ include_extensions = true }) + end, + }, + { + desc = "Change directories", + "cd", + extensions.cder.cder, + }, + { + desc = "Find files", + "", + builtin.find_files, + }, + { + desc = "Grep files", + "", + builtin.live_grep, + }, + { + desc = "Open a project", + "p", + extensions.project.project, + }, + } + end, + config = function(_, opts) + local telescope = require("telescope") + telescope.setup(opts) + + -- Load extensions + telescope.load_extension("fzf") + telescope.load_extension("ui-select") + telescope.load_extension("cder") + telescope.load_extension("project") + telescope.load_extension("notify") + end, +} diff --git a/home/.config/nvim/lua/plugins/treesitter.lua b/home/.config/nvim/lua/plugins/treesitter.lua new file mode 100644 index 00000000..1c8d78c9 --- /dev/null +++ b/home/.config/nvim/lua/plugins/treesitter.lua @@ -0,0 +1,153 @@ +return { + -- Improved syntax highlighting, text objects and more + --- @type LazyPluginSpec + { + "nvim-treesitter/nvim-treesitter", + build = ":TSUpdate", + init = function() + require("nvim-treesitter.install").update({ + with_sync = true, + }) + end, + --- @type TSConfig + opts = { + highlight = { enable = true }, + indent = { enable = true }, + ensure_installed = { + "bash", + "css", + "diff", + "dockerfile", + "git_config", + "git_rebase", + "gitattributes", + "gitcommit", + "gitignore", + "html", + "http", + "java", + "javascript", + "jsdoc", + "json", + "json5", + "jsonc", + "latex", + "lua", + "luadoc", + "luap", + "make", + "markdown", + "markdown_inline", + "php", + "python", + "query", + "rasi", + "regex", + "rst", + "scss", + "toml", + "tsx", + "typescript", + "vim", + "vimdoc", + "yaml", + }, + incremental_selection = { + enable = true, + keymaps = { + init_selection = "", + node_incremental = "", + scope_incremental = false, + node_decremental = "", + }, + }, + textobjects = { + move = { + enable = true, + goto_next_start = { ["]f"] = "@function.outer", ["]c"] = "@class.outer" }, + goto_next_end = { ["]F"] = "@function.outer", ["]C"] = "@class.outer" }, + goto_previous_start = { ["[f"] = "@function.outer", ["[c"] = "@class.outer" }, + goto_previous_end = { ["[F"] = "@function.outer", ["[C"] = "@class.outer" }, + }, + select = { + enable = true, + lookahead = true, + keymaps = { + ["af"] = { + query = "@function.outer", + desc = "Select outer part of a function", + }, + ["if"] = { + query = "@function.inner", + desc = "Select inner part of a function", + }, + ["ac"] = { + query = "@class.outer", + desc = "Select outer part of a class", + }, + ["ic"] = { + query = "@class.inner", + desc = "Select inner part of a class", + }, + ["as"] = { + query = "@scope", + query_group = "locals", + desc = "Select language scope", + }, + }, + }, + }, + }, + --- @param opts TSConfig + config = function(_, opts) + if type(opts.ensure_installed) == "table" then + --- @type table + local added = {} + opts.ensure_installed = vim.tbl_filter(function(lang) + if added[lang] then + return false + end + added[lang] = true + return true + end, opts.ensure_installed) + end + require("nvim-treesitter.configs").setup(opts) + end, + dependencies = { + { + "nvim-treesitter/nvim-treesitter-textobjects", + config = function() + -- When in diff mode, we want to use the default + -- vim text objects c & C instead of the treesitter ones. + --- @type table + local move = require("nvim-treesitter.textobjects.move") + local configs = require("nvim-treesitter.configs") + for name, fn in pairs(move) do + if name:find("goto") == 1 then + move[name] = function(q, ...) + if vim.wo.diff then + --- @type table + local config = configs.get_module("textobjects.move")[name] + for key, query in pairs(config or {}) do + if q == query and key:find("[%]%[][cC]") then + vim.cmd("normal! " .. key) + return + end + end + end + return fn(q, ...) + end + end + end + end, + }, + }, + }, + + -- Automatically add closing tags for HTML and JSX + --- @type LazyPluginSpec + { + "windwp/nvim-ts-autotag", + config = true, + }, +} diff --git a/home/.config/nvim/lua/plugins/ufo.lua b/home/.config/nvim/lua/plugins/ufo.lua new file mode 100644 index 00000000..9615f83c --- /dev/null +++ b/home/.config/nvim/lua/plugins/ufo.lua @@ -0,0 +1,28 @@ +-- Better folds +--- @type LazyPluginSpec +return { + "kevinhwang91/nvim-ufo", + dependencies = { "kevinhwang91/promise-async" }, + --- @type UfoConfig + opts = { + close_fold_kinds_for_ft = { + default = { "imports" }, + }, + }, + --- @param opts UfoConfig + config = function(_, opts) + local ufo = require("ufo") + ufo.setup(opts) + + -- Using ufo, we need to remap `zR` and `zM` + vim.keymap.set("n", "zR", ufo.openAllFolds) + vim.keymap.set("n", "zM", ufo.closeAllFolds) + + -- Fold settings + local o = vim.o + o.foldcolumn = "1" + o.foldlevel = 99 + o.foldlevelstart = 99 + o.foldenable = true + end, +} diff --git a/home/.config/nvim/lua/plugins/which-key.lua b/home/.config/nvim/lua/plugins/which-key.lua new file mode 100644 index 00000000..481adc15 --- /dev/null +++ b/home/.config/nvim/lua/plugins/which-key.lua @@ -0,0 +1,20 @@ +-- Display possible keybinds +--- @type LazyPluginSpec +return { + "folke/which-key.nvim", + config = function() + require("which-key").add({ + { "", group = "Leader" }, + { "g", group = "Go to" }, + }) + end, + keys = { + { + "?", + function() + require("which-key").show({ global = false }) + end, + desc = "Buffer Local Keymaps (which-key)", + }, + }, +} diff --git a/home/.config/nvim/lua/settings.lua b/home/.config/nvim/lua/settings.lua new file mode 100644 index 00000000..a02c5de0 --- /dev/null +++ b/home/.config/nvim/lua/settings.lua @@ -0,0 +1,53 @@ +local o = vim.o +local g = vim.g +o.pumblend = 10 + +-- Relative line numbers +o.number = true +o.relativenumber = true + +-- True colors +o.termguicolors = true + +-- Enable cursorline highlighting +o.cursorline = true + +-- Floating window transparency +o.winblend = 10 + +-- Set window title +o.title = true +o.titlestring = "NeoVim: " .. vim.fn.getcwd() + +-- Diff settings +o.diffopt = "filler,internal,algorithm:histogram,indent-heuristic" + +-- Allow switching buffers with unsaved changes +o.hidden = true + +o.guicursor = table.concat({ + "i:ver1", -- Vertical bar cursor in insert mode + "a:blinkon1", -- Blinking cursor in all modes +}, ",") + +-- Enable global statusline +o.laststatus = 3 + +-- Use suda by default +g.suda_smart_edit = 1 + +-- Case insensitive search +o.ignorecase = true +o.smartcase = true + +-- Set leader +g.mapleader = " " + +-- Indentation settings +o.tabstop = 4 +o.softtabstop = -1 +o.expandtab = true +o.shiftwidth = 4 +o.smartindent = true + +o.showmode = false diff --git a/home/.config/nvim/mason-lock.json b/home/.config/nvim/mason-lock.json new file mode 100644 index 00000000..25d803af --- /dev/null +++ b/home/.config/nvim/mason-lock.json @@ -0,0 +1,15 @@ +{ + "bash-language-server": "5.4.3", + "bibtex-tidy": "1.14.0", + "css-lsp": "4.10.0", + "docker-compose-language-service": "0.3.0", + "dockerfile-language-server": "0.13.0", + "eslint-lsp": "4.10.0", + "html-lsp": "4.10.0", + "json-lsp": "4.10.0", + "lemminx": "0.28.0", + "lua-language-server": "3.13.9", + "texlab": "v5.22.1", + "typescript-language-server": "4.3.4", + "yaml-language-server": "1.17.0" +} \ No newline at end of file diff --git a/home/.config/nvim/snippets/javascript.json b/home/.config/nvim/snippets/javascript.json new file mode 100644 index 00000000..7e0f1e8e --- /dev/null +++ b/home/.config/nvim/snippets/javascript.json @@ -0,0 +1,8 @@ +{ + "logVariable": { + "scope": "javascript", + "prefix": "logvar", + "description": "Log the variable under the cursor", + "body": ["console.log('$1', $1);"] + } +} diff --git a/home/.config/nvim/snippets/package.json b/home/.config/nvim/snippets/package.json new file mode 100644 index 00000000..724d4794 --- /dev/null +++ b/home/.config/nvim/snippets/package.json @@ -0,0 +1,14 @@ +{ + "name": "functionalhacker-snippets", + "engines": { + "vscode": "^1.11.0" + }, + "contributes": { + "snippets": [ + { + "language": "javascript", + "path": "./javascript.json" + } + ] + } +} diff --git a/home/.config/nvimpager/init.vim b/home/.config/nvimpager/init.vim deleted file mode 100644 index e963c9aa..00000000 --- a/home/.config/nvimpager/init.vim +++ /dev/null @@ -1,11 +0,0 @@ -" Source UI plugins -set runtimepath+=~/.config/nvim/plugged/vim-airline -set runtimepath+=~/.config/nvim/plugged/onedark.vim - -" Source syntax plugins -set runtimepath+=~/.config/nvim/plugged/vim-polyglot - -source ~/.config/nvim/conf.d/02-appearance.vim -source ~/.config/nvim/conf.d/03-keybinds.vim -source ~/.config/nvim/conf.d/06-misc.vim -source ~/.config/nvim/conf.d/07-clipboardfix.vim diff --git a/home/.config/pacman/makepkg.conf b/home/.config/pacman/makepkg.conf index 48b6c3f5..4cb42c50 100644 --- a/home/.config/pacman/makepkg.conf +++ b/home/.config/pacman/makepkg.conf @@ -1,3 +1,4 @@ +PACKAGER="Marko Korhonen " DLAGENTS=('file::/usr/bin/curl -gqC - -o %o %u' 'ftp::/usr/bin/curl -gqfC - --ftp-pasv --retry 3 --retry-delay 3 -o %o %u' 'http::/usr/bin/curl -gqb "" -fLC - --retry 3 --retry-delay 3 -o %o %u' @@ -14,13 +15,18 @@ VCSCLIENTS=('bzr::bzr' CARCH="x86_64" CHOST="x86_64-pc-linux-gnu" -CPPFLAGS="-D_FORTIFY_SOURCE=2" -CFLAGS="-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fno-plt" -CXXFLAGS="-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fno-plt" -LDFLAGS="-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now" -MAKEFLAGS="-j$(nproc)" -DEBUG_CFLAGS="-g -fvar-tracking-assignments" -DEBUG_CXXFLAGS="-g -fvar-tracking-assignments" +CFLAGS="-march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions \ + -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security \ + -fstack-clash-protection -fcf-protection \ + -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer" +CXXFLAGS="$CFLAGS -Wp,-D_GLIBCXX_ASSERTIONS" +LDFLAGS="-Wl,-O1 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now \ + -Wl,-z,pack-relative-relocs" +LTOFLAGS="-flto=auto" +RUSTFLAGS="-Cforce-frame-pointers=yes" +DEBUG_CFLAGS="-g" +DEBUG_CXXFLAGS="$DEBUG_CFLAGS" +DEBUG_RUSTFLAGS="-C debuginfo=2" BUILDENV=(!distcc color !ccache check !sign) diff --git a/home/.config/paru/paru.conf b/home/.config/paru/paru.conf new file mode 100644 index 00000000..063d7694 --- /dev/null +++ b/home/.config/paru/paru.conf @@ -0,0 +1,7 @@ +[options] +NewsOnUpgrade +PgpFetch + +[bin] +Sudo = doas +Bat = /dev/null diff --git a/home/.config/pass-git-helper/git-pass-mapping.ini b/home/.config/pass-git-helper/git-pass-mapping.ini new file mode 100644 index 00000000..aeb49ee9 --- /dev/null +++ b/home/.config/pass-git-helper/git-pass-mapping.ini @@ -0,0 +1,9 @@ +[DEFAULT] +username_extractor=regex_search +regex_username=^username: (.*)$ + +[git.rossum.fi*] +target=work/ldap.rossum.fi + +[git.korhonen.cc*] +target=git/git.korhonen.cc diff --git a/home/.config/plasma-workspace/env/wayland.sh b/home/.config/plasma-workspace/env/wayland.sh new file mode 100644 index 00000000..17afd060 --- /dev/null +++ b/home/.config/plasma-workspace/env/wayland.sh @@ -0,0 +1,16 @@ +#!/bin/sh + +# Set environment variables for Sway + +# Firefox +export MOZ_ENABLE_WAYLAND=1 +export MOZ_USE_XINPUT2=1 +export MOZ_WEBRENDER=1 +export MOZ_DBUS_REMOTE=1 + +# Fix java on wayland +export _JAVA_AWT_WM_NONREPARENTING=1 +export _JAVA_OPTIONS='-Dawt.useSystemAAFontSettings=on -Dswing.aatext=true -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel' + +# Enable wayland support on clutter +export CLUTTER_BACKEND=wayland diff --git a/home/.config/rofi/config b/home/.config/rofi/config deleted file mode 100644 index d12d19db..00000000 --- a/home/.config/rofi/config +++ /dev/null @@ -1,9 +0,0 @@ -rofi.lines: 5 -rofi.eh: 2 -rofi.padding: 50 -rofi.fullscreen: false -rofi.bw: 0 -rofi.separator-style: none -rofi.hide-scrollbar: true -rofi.font: Overpass 22 -rofi.theme: ~/.config/rofi/gruvbox-dark.rasi diff --git a/home/.config/rofi/config.rasi b/home/.config/rofi/config.rasi new file mode 100644 index 00000000..be258cd5 --- /dev/null +++ b/home/.config/rofi/config.rasi @@ -0,0 +1,150 @@ +// vim: ft=rasi + +configuration { + font: "Overpass 15"; + show-icons: true; + terminal: "foot"; + // modi: "run,ssh"; + // location: 0; + // yoffset: 0; + // xoffset: 0; + // fixed-num-lines: true; + // ssh-client: "ssh"; + // ssh-command: "{terminal} -e {ssh-client} {host} [-p {port}]"; + // run-command: "{cmd}"; + // run-list-command: ""; + // run-shell-command: "{terminal} -e {cmd}"; + // window-command: "wmctrl -i -R {window}"; + // window-match-fields: "all"; + // icon-theme: "Papirus-Dark"; + // drun-match-fields: "name,generic,exec,categories,keywords"; + // drun-categories: ; + // drun-show-actions: false; + // drun-display-format: "{name}"; + // drun-url-launcher: "xdg-open"; + // disable-history: false; + // ignored-prefixes: ""; + // sort: false; + // sorting-method: "normal"; + // case-sensitive: false; + // cycle: true; + // sidebar-mode: false; + // hover-select: false; + // eh: 1; + // auto-select: false; + // parse-hosts: false; + // parse-known-hosts: true; + // combi-modi: "window,run"; + // matching: "normal"; + // tokenize: true; + // m: "-5"; + // filter: ; + // dpi: -1; + // threads: 0; + // scroll-method: 0; + // window-format: "{w} {c} {t}"; + // click-to-exit: true; + // max-history-size: 25; + // combi-hide-mode-prefix: false; + // combi-display-format: "{mode} {text}"; + // matching-negate-char: '-' unsupported ; + // cache-dir: ; + // window-thumbnail: false; + // drun-use-desktop-cache: false; + // drun-reload-desktop-cache: false; + // normalize-match: false; + // steal-focus: false; + // application-fallback-icon: ; + // pid: "/run/user/1000/rofi.pid"; + // display-run: ; + // display-ssh: ; + // display-drun: ""; + // display-combi: ; + // display-keys: ; + // display-filebrowser: ; + // kb-primary-paste: "Control+V,Shift+Insert"; + // kb-secondary-paste: "Control+v,Insert"; + // kb-clear-line: "Control+w"; + // kb-move-front: "Control+a"; + // kb-move-end: "Control+e"; + // kb-move-word-back: "Alt+b,Control+Left"; + // kb-move-word-forward: "Alt+f,Control+Right"; + // kb-move-char-back: "Left,Control+b"; + // kb-move-char-forward: "Right,Control+f"; + // kb-remove-word-back: "Control+Alt+h,Control+BackSpace"; + // kb-remove-word-forward: "Control+Alt+d"; + // kb-remove-char-forward: "Delete,Control+d"; + // kb-remove-char-back: "BackSpace,Shift+BackSpace,Control+h"; + // kb-remove-to-eol: "Control+k"; + // kb-remove-to-sol: "Control+u"; + // kb-accept-entry: "Control+j,Control+m,Return,KP_Enter"; + // kb-accept-custom: "Control+Return"; + // kb-accept-custom-alt: "Control+Shift+Return"; + // kb-accept-alt: "Shift+Return"; + // kb-delete-entry: "Shift+Delete"; + // kb-mode-next: "Shift+Right,Control+Tab"; + // kb-mode-previous: "Shift+Left,Control+ISO_Left_Tab"; + // kb-mode-complete: "Control+l"; + // kb-row-left: "Control+Page_Up"; + // kb-row-right: "Control+Page_Down"; + // kb-row-up: "Up,Control+p,ISO_Left_Tab"; + // kb-row-down: "Down,Control+n"; + // kb-row-tab: "Tab"; + // kb-page-prev: "Page_Up"; + // kb-page-next: "Page_Down"; + // kb-row-first: "Home,KP_Home"; + // kb-row-last: "End,KP_End"; + // kb-row-select: "Control+space"; + // kb-screenshot: "Alt+S"; + // kb-ellipsize: "Alt+period"; + // kb-toggle-case-sensitivity: "grave,dead_grave"; + // kb-toggle-sort: "Alt+grave"; + // kb-cancel: "Escape,Control+g,Control+bracketleft"; + // kb-custom-1: "Alt+1"; + // kb-custom-2: "Alt+2"; + // kb-custom-3: "Alt+3"; + // kb-custom-4: "Alt+4"; + // kb-custom-5: "Alt+5"; + // kb-custom-6: "Alt+6"; + // kb-custom-7: "Alt+7"; + // kb-custom-8: "Alt+8"; + // kb-custom-9: "Alt+9"; + // kb-custom-10: "Alt+0"; + // kb-custom-11: "Alt+exclam"; + // kb-custom-12: "Alt+at"; + // kb-custom-13: "Alt+numbersign"; + // kb-custom-14: "Alt+dollar"; + // kb-custom-15: "Alt+percent"; + // kb-custom-16: "Alt+dead_circumflex"; + // kb-custom-17: "Alt+ampersand"; + // kb-custom-18: "Alt+asterisk"; + // kb-custom-19: "Alt+parenleft"; + // kb-select-1: "Super+1"; + // kb-select-2: "Super+2"; + // kb-select-3: "Super+3"; + // kb-select-4: "Super+4"; + // kb-select-5: "Super+5"; + // kb-select-6: "Super+6"; + // kb-select-7: "Super+7"; + // kb-select-8: "Super+8"; + // kb-select-9: "Super+9"; + // kb-select-10: "Super+0"; + // ml-row-left: "ScrollLeft"; + // ml-row-right: "ScrollRight"; + // ml-row-up: "ScrollUp"; + // ml-row-down: "ScrollDown"; + // me-select-entry: "MousePrimary"; + // me-accept-entry: "MouseDPrimary"; + // me-accept-custom: "Control+MouseDPrimary"; + /* +timeout { +action: "kb-cancel"; +delay: 0; +} +filebrowser { +directories-first: true; +sorting-method: "name"; +} + */ +} +@theme "~/.cache/wal/colors-rofi-dark" diff --git a/home/.config/rofi/gruvbox-common.inc.rasi b/home/.config/rofi/gruvbox-common.inc.rasi deleted file mode 100644 index f7a168d9..00000000 --- a/home/.config/rofi/gruvbox-common.inc.rasi +++ /dev/null @@ -1,127 +0,0 @@ -/* ========================================================================== - File: gruvbox-common.rasi - Desc: Shared rules between all gruvbox themes - Author: bardisty - Source: https://github.com/bardisty/gruvbox-rofi - Modified: Mon Feb 12 2018 06:06:47 PST -0800 - ========================================================================== */ - -window { - background-color: @background; - border: 2; - padding: 2; -} - -mainbox { - border: 0; - padding: 0; -} - -message { - border: 2px 0 0; - border-color: @separatorcolor; - padding: 1px; -} - -textbox { - highlight: @highlight; - text-color: @foreground; -} - -listview { - border: 2px solid 0 0; - padding: 2px 0 0; - border-color: @separatorcolor; - spacing: 2px; - scrollbar: @scrollbar; -} - -element { - border: 0; - padding: 2px; -} - -element.normal.normal { - background-color: @normal-background; - text-color: @normal-foreground; -} - -element.normal.urgent { - background-color: @urgent-background; - text-color: @urgent-foreground; -} - -element.normal.active { - background-color: @active-background; - text-color: @active-foreground; -} - -element.selected.normal { - background-color: @selected-normal-background; - text-color: @selected-normal-foreground; -} - -element.selected.urgent { - background-color: @selected-urgent-background; - text-color: @selected-urgent-foreground; -} - -element.selected.active { - background-color: @selected-active-background; - text-color: @selected-active-foreground; -} - -element.alternate.normal { - background-color: @alternate-normal-background; - text-color: @alternate-normal-foreground; -} - -element.alternate.urgent { - background-color: @alternate-urgent-background; - text-color: @alternate-urgent-foreground; -} - -element.alternate.active { - background-color: @alternate-active-background; - text-color: @alternate-active-foreground; -} - -scrollbar { - width: 4px; - border: 0; - handle-color: @scrollbar-handle; - handle-width: 8px; - padding: 0; -} - -sidebar { - border: 2px 0 0; - border-color: @separatorcolor; -} - -inputbar { - spacing: 0; - text-color: @normal-foreground; - padding: 2px; - children: [ prompt, textbox-prompt-sep, entry, case-indicator ]; -} - -case-indicator, -entry, -prompt, -button { - spacing: 0; - text-color: @normal-foreground; -} - -button.selected { - background-color: @selected-normal-background; - text-color: @selected-normal-foreground; -} - -textbox-prompt-sep { - expand: false; - str: ":"; - text-color: @normal-foreground; - margin: 0 0.3em 0 0; -} diff --git a/home/.config/rofi/gruvbox-dark.rasi b/home/.config/rofi/gruvbox-dark.rasi deleted file mode 100644 index 8a4969d9..00000000 --- a/home/.config/rofi/gruvbox-dark.rasi +++ /dev/null @@ -1,61 +0,0 @@ -/* ========================================================================== - Rofi color theme - - Based on the Gruvbox color scheme for Vim by morhetz - https://github.com/morhetz/gruvbox - - File: gruvbox-dark-soft.rasi - Desc: Gruvbox dark (soft contrast) color theme for Rofi - Author: bardisty - Source: https://github.com/bardisty/gruvbox-rofi - Modified: Mon Feb 12 2018 06:04:37 PST -0800 - ========================================================================== */ - -* { - /* Theme settings */ - highlight: bold italic; - scrollbar: true; - - /* Gruvbox dark colors */ - gruvbox-dark-bg0-soft: #32302f; - gruvbox-dark-bg1: #3c3836; - gruvbox-dark-bg3: #665c54; - gruvbox-dark-fg0: #fbf1c7; - gruvbox-dark-fg1: #ebdbb2; - gruvbox-dark-red-dark: #cc241d; - gruvbox-dark-red-light: #fb4934; - gruvbox-dark-yellow-dark: #d79921; - gruvbox-dark-yellow-light: #fabd2f; - gruvbox-dark-gray: #a89984; - - /* Theme colors */ - background: @gruvbox-dark-bg0-soft; - background-color: @background; - foreground: @gruvbox-dark-fg1; - border-color: @gruvbox-dark-gray; - separatorcolor: @border-color; - scrollbar-handle: @border-color; - - normal-background: @background; - normal-foreground: @foreground; - alternate-normal-background: @background; - alternate-normal-foreground: @foreground; - selected-normal-background: @gruvbox-dark-bg3; - selected-normal-foreground: @gruvbox-dark-fg0; - - active-background: @gruvbox-dark-yellow-dark; - active-foreground: @background; - alternate-active-background: @active-background; - alternate-active-foreground: @active-foreground; - selected-active-background: @gruvbox-dark-yellow-light; - selected-active-foreground: @active-foreground; - - urgent-background: @gruvbox-dark-red-dark; - urgent-foreground: @background; - alternate-urgent-background: @urgent-background; - alternate-urgent-foreground: @urgent-foreground; - selected-urgent-background: @gruvbox-dark-red-light; - selected-urgent-foreground: @urgent-foreground; -} - -@import "gruvbox-common.inc" diff --git a/home/.config/rofi/nord.rasi b/home/.config/rofi/nord.rasi deleted file mode 100644 index fdf4de4c..00000000 --- a/home/.config/rofi/nord.rasi +++ /dev/null @@ -1,150 +0,0 @@ -* { - nord0: #2E3440; - nord1: #3B4252; - nord2: #434C5E; - nord3: #4C566A; - nord4: #D8DEE9; - nord5: #E5E9F0; - nord6: #ECEFF4; - nord7: #8FBCBB; - nord8: #88C0D0; - nord9: #81A1C1; - nord10: #5E81AC; - nord11: #BF616A; - nord12: #D08770; - nord13: #EBCB8B; - nord14: #A3BE8C; - nord15: #B48EAD; - background: @nord0; - foreground: @nord4; - selected-normal-foreground: @nord4; - normal-foreground: @foreground; - alternate-normal-background: @nord0; - selected-urgent-foreground: @nord4; - urgent-foreground: @foreground; - alternate-urgent-background: @nord0; - active-foreground: @foreground; - selected-active-foreground: @foreground; - alternate-active-background: @nord0; - bordercolor: @nord10; - alternate-normal-foreground: @foreground; - normal-background: @background; - selected-normal-background: @nord3; - border-color: @nord10; - spacing: 2; - separatorcolor: @blue; - urgent-background: @background; - selected-urgent-background: @nord3; - alternate-urgent-foreground: @urgent-foreground; - background-color: @background; - alternate-active-foreground: @active-foreground; - active-background: @background; - selected-active-background: @nord3; -} - -//---------------------- -// Style -//---------------------- - -#window { - background-color: @background; -} - -#mainbox { - border: 2; - padding: 10; -} - -#message { - border: 2px 2px 2px ; - border-color: @separatorcolor; - padding: 10 ; -} - -#textbox { - text-color: @foreground; -} - -#listview { - fixed-height: 0; - padding: 5 0 0; - spacing: 5px ; -} - -#element { - border: 0; - padding: 5px ; -} - -#element.normal.normal { - background-color: @normal-background; - text-color: @normal-foreground; -} - -#element.normal.urgent { - background-color: @urgent-background; - text-color: @urgent-foreground; -} - -#element.normal.active { - background-color: @active-background; - text-color: @active-foreground; -} - -#element.selected.normal { - background-color: @selected-normal-background; - text-color: @selected-normal-foreground; -} - -#element.selected.urgent { - background-color: @selected-urgent-background; - text-color: @selected-urgent-foreground; -} - -#element.selected.active { - background-color: @selected-active-background; - text-color: @selected-active-foreground; -} - -#element.alternate.normal { - background-color: @alternate-normal-background; - text-color: @alternate-normal-foreground; -} - -#element.alternate.urgent { - background-color: @alternate-urgent-background; - text-color: @alternate-urgent-foreground; -} - -#element.alternate.active { - background-color: @alternate-active-background; - text-color: @alternate-active-foreground; -} - -#button.selected { - background-color: @selected-normal-background; - text-color: @selected-normal-foreground; -} - -#inputbar { - spacing: 5; - text-color: @normal-foreground; - padding: 5px ; - border: 0 0 1; - border-color: @separatorcolor; -} - -#case-indicator { - spacing: 0; - text-color: @normal-foreground; -} - -#entry { - spacing: 0; - text-color: @normal-foreground; -} - -#prompt { - spacing: 0; - text-color: @normal-foreground; -} diff --git a/home/.config/sway/conf.d/01-vars.conf b/home/.config/sway/conf.d/01-vars.conf index 11347159..76837cf4 100644 --- a/home/.config/sway/conf.d/01-vars.conf +++ b/home/.config/sway/conf.d/01-vars.conf @@ -1,6 +1,7 @@ -# vim:ft=i3config +# vim:ft=swayconfig set $mod Mod4 -set $term alacritty +set $term footclient +set $browser librewolf set $gnome-schema org.gnome.desktop.interface -set $wallpaper ~/Pictures/Wallpapers/random/$(ls ~/Pictures/Wallpapers/random | sort -R | tail -n 1) +set $scripts ~/.config/sway/scripts diff --git a/home/.config/sway/conf.d/02-bar.conf b/home/.config/sway/conf.d/02-bar.conf new file mode 100644 index 00000000..8027d960 --- /dev/null +++ b/home/.config/sway/conf.d/02-bar.conf @@ -0,0 +1,5 @@ +# vim:ft=swayconfig + +bar { + swaybar_command waybar +} diff --git a/home/.config/sway/conf.d/02-input.conf b/home/.config/sway/conf.d/02-input.conf deleted file mode 100644 index eeafff07..00000000 --- a/home/.config/sway/conf.d/02-input.conf +++ /dev/null @@ -1,14 +0,0 @@ -# vim:ft=i3config - -input * { - xkb_layout eu - xkb_options caps:escape -} - -input "1739:32382:DELL0884:00_06CB:7E7E_Touchpad" { - tap enabled - natural_scroll enabled -} - -input "1267:9364:ELAN_Touchscreen" map_to_output eDP-1 -input "1739:32382:DELL0884:00_06CB:7E7E_Touchpad" map_to_output eDP-1 diff --git a/home/.config/sway/conf.d/03-input.conf b/home/.config/sway/conf.d/03-input.conf new file mode 100644 index 00000000..aea31fbe --- /dev/null +++ b/home/.config/sway/conf.d/03-input.conf @@ -0,0 +1,13 @@ +# vim:ft=swayconfig + +input type:keyboard { + xkb_layout eu + xkb_options caps:escape +} + +input type:touchpad { + tap enabled + natural_scroll enabled +} + +input "1267:9364:ELAN_Touchscreen" map_to_output eDP-1 diff --git a/home/.config/sway/conf.d/03-output.conf b/home/.config/sway/conf.d/03-output.conf deleted file mode 100644 index b6030a4a..00000000 --- a/home/.config/sway/conf.d/03-output.conf +++ /dev/null @@ -1,5 +0,0 @@ -# vim:ft=i3config - -output * bg $wallpaper fill -output eDP-1 position 0 0 -output HDMI-A-1 position 1920 0 diff --git a/home/.config/sway/conf.d/04-output.conf b/home/.config/sway/conf.d/04-output.conf new file mode 100644 index 00000000..9e524bf1 --- /dev/null +++ b/home/.config/sway/conf.d/04-output.conf @@ -0,0 +1,9 @@ +# vim:ft=swayconfig + +output * bg $wallpaper fill +output eDP-1 position 0 0 +output HDMI-A-1 position 1920 0 + +# Disable laptop screen when lid is closed +bindswitch --locked lid:on output eDP-1 disable +bindswitch --locked lid:off output eDP-1 enable diff --git a/home/.config/sway/conf.d/04-workspaces.conf b/home/.config/sway/conf.d/05-workspaces.conf similarity index 77% rename from home/.config/sway/conf.d/04-workspaces.conf rename to home/.config/sway/conf.d/05-workspaces.conf index 0f88c773..ea67ffe8 100644 --- a/home/.config/sway/conf.d/04-workspaces.conf +++ b/home/.config/sway/conf.d/05-workspaces.conf @@ -1,4 +1,4 @@ -# vim:ft=i3config +# vim:ft=swayconfig # Start applications in specific workspaces assign [app_id="telegramdesktop"] workspace 3 @@ -11,5 +11,6 @@ for_window [urgent="latest"] focus # Gimp export window for_window [title="Export Image*"] floating enable for_window [app_id="fzf-launcher"] focus, floating enabled, border pixel 1 -for_window [title="Mullvad VPN"] floating disable for_window [app_id="firefox" title="^Extension: \(PassFF\)"] floating enable +for_window [title="About Firefox Nightly"] floating enable +for_window [title="About Mozilla Firefox"] floating enable diff --git a/home/.config/sway/conf.d/05-keybinds.conf b/home/.config/sway/conf.d/06-keybinds.conf similarity index 64% rename from home/.config/sway/conf.d/05-keybinds.conf rename to home/.config/sway/conf.d/06-keybinds.conf index 793fb416..252050b4 100644 --- a/home/.config/sway/conf.d/05-keybinds.conf +++ b/home/.config/sway/conf.d/06-keybinds.conf @@ -1,13 +1,42 @@ -# vim:ft=i3config +# vim:ft=swayconfig # start terminal bindsym $mod+Return exec $term +# start neovide +bindsym $mod+n exec neovide + # kill focused window bindsym $mod+w kill -# start your launcher -bindsym $mod+Shift+p exec rofi-pass --bmarks +# Modes for controlling gaps +set $mode_gaps Gaps: (o) outer, (i) inner +set $mode_gaps_outer Outer Gaps: j|k|0|r|i +set $mode_gaps_inner Inner Gaps: j|k|0|r|o +bindsym $mod+g mode "$mode_gaps" + +mode "$mode_gaps" { + bindsym o mode "$mode_gaps_outer" + bindsym i mode "$mode_gaps_inner" + bindsym Escape mode "default" +} + +mode "$mode_gaps_inner" { + bindsym j gaps inner all minus 1 + bindsym k gaps inner all plus 1 + bindsym 0 gaps inner all set 0 + bindsym r gaps inner all set 10 + bindsym o mode "$mode_gaps_outer" + bindsym Escape mode "default" +} +mode "$mode_gaps_outer" { + bindsym j gaps outer all minus 1 + bindsym k gaps outer all plus 1 + bindsym 0 gaps outer all set 0 + bindsym r gaps outer all set 10 + bindsym i mode "$mode_gaps_inner" + bindsym Escape mode "default" +} # Drag floating windows by holding down $mod and left mouse button. # Resize them with right mouse button + $mod. @@ -20,19 +49,20 @@ floating_modifier $mod normal bindsym $mod+Shift+r reload # open link from clipboard in default application -bindsym $mod+Shift+o exec mimeo "$(wl-paste)" +bindsym $mod+Shift+o exec mimeo $(wl-paste) # turn on and off internal screen -bindsym --locked XF86Search output eDP-1 enable -bindsym --locked Shift+XF86Search output eDP-1 disable +bindsym --locked XF86Search output eDP-1 toggle -# FZF # exit menu -bindsym $mod+Shift+e exec $term --class fzf-launcher -e $HOME/Scripts/sway-exit.sh +bindsym $mod+Shift+e exec $term --app-id fzf-launcher --login-shell /bin/sh -c "$scripts/exit.sh" + # launch a program -bindsym $mod+d exec $term --class fzf-launcher --title "FZF Launcher" -e sh -c 'TERMINAL_COMMAND="alacritty -e" sway-launcher-desktop' -# password manager -bindsym $mod+p exec $term --class fzf-launcher --title "FZF pass" -e sh -c fzf-pass +bindsym $mod+d exec rofi -show drun +bindsym $mod+Shift+d exec rofi -show run + +# manage clipboard +bindsym $mod+c exec clipman pick -t wofi # manage notifications bindsym $mod+Backspace exec makoctl invoke @@ -112,12 +142,12 @@ mode "resize" { bindsym $mod+r mode "resize" # start browser -bindsym $mod+b exec firefox-nightly +bindsym $mod+b exec $browser # media keys -bindsym XF86AudioRaiseVolume exec pamixer -ui 2 && pamixer --get-volume > $SWAYSOCK.wob -bindsym XF86AudioLowerVolume exec pamixer -ud 2 && pamixer --get-volume > $SWAYSOCK.wob -bindsym --locked XF86AudioMute exec pulseaudio-ctl mute +bindsym --locked XF86AudioRaiseVolume exec pamixer -ui 1 && pamixer --get-volume > $SWAYSOCK.wob +bindsym --locked XF86AudioLowerVolume exec pamixer -ud 1 && pamixer --get-volume > $SWAYSOCK.wob +bindsym --locked XF86AudioMute exec pamixer --toggle-mute && ( pamixer --get-mute && echo 0 > $SWAYSOCK.wob ) || pamixer --get-volume > $SWAYSOCK.wob bindsym --locked XF86AudioNext exec playerctl next bindsym --locked XF86AudioPrev exec playerctl previous bindsym --locked XF86AudioPlay exec playerctl play-pause @@ -125,23 +155,28 @@ bindsym --locked XF86AudioStop exec playerctl stop bindsym --locked Ctrl+Alt+s exec playerctl stop # rotate screen -bindsym $mod+m+Right output eDP-1 transform 90 -bindsym $mod+m+Up output eDP-1 transform 0 -bindsym $mod+m+Down output eDP-1 transform 180 -bindsym $mod+m+Left output eDP-1 transform 270 -bindsym $mod+m+h output eDP-1 transform 270 -bindsym $mod+m+j output eDP-1 transform 180 -bindsym $mod+m+l output eDP-1 transform 90 -bindsym $mod+m+k output eDP-1 transform 0 +bindsym $mod+Control+Right output eDP-1 transform 90 +bindsym $mod+Control+Up output eDP-1 transform 0 +bindsym $mod+Control+Down output eDP-1 transform 180 +bindsym $mod+Control+Left output eDP-1 transform 270 +bindsym $mod+Control+h output eDP-1 transform 270 +bindsym $mod+Control+j output eDP-1 transform 180 +bindsym $mod+Control+l output eDP-1 transform 90 +bindsym $mod+Control+k output eDP-1 transform 0 # display brightness -bindsym XF86MonBrightnessUp exec light -A 5 && light -G | cut -d'.' -f1 > $SWAYSOCK.wob -bindsym XF86MonBrightnessDown exec light -U 5 && light -G | cut -d'.' -f1 > $SWAYSOCK.wob +bindsym --locked XF86MonBrightnessUp exec light -A 5 && light -G | cut -d'.' -f1 > $SWAYSOCK.wob +bindsym --locked XF86MonBrightnessDown exec light -U 5 && light -G | cut -d'.' -f1 > $SWAYSOCK.wob + +# Some built-in keyboard keys +bindsym XF86Mail workspace 4 +bindsym XF86Messenger workspace 3 +bindsym XF86Calculator exec alacritty -e calc # Switch to urgent workspace bindsym $mod+u [urgent=latest] focus -# Switch to workspace +# Switch to workspace bindsym $mod+1 workspace 1 bindsym $mod+2 workspace 2 bindsym $mod+3 workspace 3 @@ -187,3 +222,7 @@ bindsym Alt+h exec ydotool key left bindsym Alt+j exec ydotool key down bindsym Alt+k exec ydotool key up bindsym Alt+l exec ydotool key right + +# Mumble push to talk + bindsym --no-repeat F12 exec gdbus call -e -d net.sourceforge.mumble.mumble -o / -m net.sourceforge.mumble.Mumble.startTalk + bindsym --release F12 exec gdbus call -e -d net.sourceforge.mumble.mumble -o / -m net.sourceforge.mumble.Mumble.stopTalk diff --git a/home/.config/sway/conf.d/06-appearance.conf b/home/.config/sway/conf.d/07-appearance.conf similarity index 78% rename from home/.config/sway/conf.d/06-appearance.conf rename to home/.config/sway/conf.d/07-appearance.conf index 8947ed4b..fb429778 100644 --- a/home/.config/sway/conf.d/06-appearance.conf +++ b/home/.config/sway/conf.d/07-appearance.conf @@ -1,8 +1,6 @@ -# vim:ft=i3config +# vim:ft=swayconfig default_border none -gaps inner 10 -gaps outer 20 # Hide cursor after 4 seconds of inactivity seat * hide_cursor 4000 @@ -10,7 +8,7 @@ seat * hide_cursor 4000 ###### Borders ###### # class border backgr. text indicator child_border client.focused #8AC6F2 #8AC6F2 #292D3E #8AC6F2 #8AC6F2 -client.focused_inactive #292D3E #FFFFFF #FFFFFF #292D3E #292D3E +client.focused_inactive #292D3E #FFFFFF #292D3E #292D3E #292D3E client.unfocused #292D3E #292D3E #FFFFFF #282828 #292D3E for_window [app_id="^.*"] border pixel 4 diff --git a/home/.config/sway/conf.d/07-exec.conf b/home/.config/sway/conf.d/07-exec.conf deleted file mode 100644 index f4b5ff69..00000000 --- a/home/.config/sway/conf.d/07-exec.conf +++ /dev/null @@ -1,15 +0,0 @@ -# vim:ft=i3config - -exec { - systemctl --user import-environment - systemctl --user start sway-session.target -} - -exec_always { - gsettings set $gnome-schema gtk-theme 'vimix-dark-doder' - gsettings set $gnome-schema icon-theme 'Numix' - gsettings set $gnome-schema cursor-theme 'Breeze' - gsettings set $gnome-schema font-name 'Overpass 12' - gsettings set $gnome-schema document-font-name 'Overpass 12' - gsettings set $gnome-schema monospace-font-name 'Hack Nerd Font Mono 12' -} diff --git a/home/.config/sway/conf.d/08-exec.conf b/home/.config/sway/conf.d/08-exec.conf new file mode 100644 index 00000000..0ac58ac5 --- /dev/null +++ b/home/.config/sway/conf.d/08-exec.conf @@ -0,0 +1,30 @@ +# vim:ft=swayconfig + +exec { + foot -s + $scripts/idle.sh + autotiling + redshift-gtk -m wayland + telegram-desktop + /usr/lib/kdeconnectd + kdeconnect-indicator + mako + wl-paste -t text --watch clipman store --notify 1>> ~/.log/clipman 2>&1 + wl-paste -p -t text --watch clipman store -P --histpath="~/.local/share/clipman-primary.json" + mkfifo $SWAYSOCK.wob && tail -f $SWAYSOCK.wob | wob + /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 + mpDris2 + swaymsg workspace 1 + dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=sway + /usr/lib/geoclue-2.0/demos/agent + thunderbird +} + +exec_always { + gsettings set $gnome-schema gtk-theme 'Matcha-dark-azul' + gsettings set $gnome-schema icon-theme 'Papirus-Dark' + gsettings set $gnome-schema cursor-theme 'Numix-Cursor' + gsettings set $gnome-schema font-name 'Overpass 12' + gsettings set $gnome-schema document-font-name 'Overpass 12' + gsettings set $gnome-schema monospace-font-name 'Hack Nerd Font Mono 12' +} diff --git a/home/.config/sway/config b/home/.config/sway/config index afde203c..2d43f1ae 100644 --- a/home/.config/sway/config +++ b/home/.config/sway/config @@ -1,3 +1,4 @@ # vim:ft=i3config +include ~/.cache/wal/colors-sway include ~/.config/sway/conf.d/*.conf diff --git a/home/Scripts/sway-exit.sh b/home/.config/sway/scripts/exit.sh similarity index 91% rename from home/Scripts/sway-exit.sh rename to home/.config/sway/scripts/exit.sh index f25ab74f..87f28905 100755 --- a/home/Scripts/sway-exit.sh +++ b/home/.config/sway/scripts/exit.sh @@ -23,7 +23,7 @@ case "$RESP" in loginctl lock-session $(loginctl show-user $USER -p Sessions | cut -d'=' -f2) ;; Exit) - systemctl --user stop sway + swaymsg exit ;; *) exit 1 diff --git a/home/.config/sway/scripts/idle.sh b/home/.config/sway/scripts/idle.sh new file mode 100755 index 00000000..5b9fc27c --- /dev/null +++ b/home/.config/sway/scripts/idle.sh @@ -0,0 +1,13 @@ +#!/bin/bash +swaylock="$HOME/.config/sway/scripts/lock.sh" +screenon="swaymsg 'output * dpms on'" +screenoff="swaymsg 'output * dpms off'" +swayidle \ + lock "$swaylock" \ + unlock "pkill -9 swaylock" \ + timeout 300 "lqsd -d" \ + resume "lqsd -r" \ + timeout 600 "loginctl lock-session" \ + timeout 610 "$screenoff" \ + resume "$screenon; lqsd -r" \ + before-sleep "playerctl pause; loginctl lock-session" \ diff --git a/home/Scripts/swaylock.sh b/home/.config/sway/scripts/lock.sh similarity index 100% rename from home/Scripts/swaylock.sh rename to home/.config/sway/scripts/lock.sh diff --git a/home/.config/sway/security.d/00-defaults b/home/.config/sway/security.d/00-defaults deleted file mode 100644 index 8b52dfd7..00000000 --- a/home/.config/sway/security.d/00-defaults +++ /dev/null @@ -1,43 +0,0 @@ -# DO NOT CHANGE THIS FILE. Override these defaults by writing new files in -# /etc/sway/security.d/* - -# Configures enabled compositor features for specific programs -permit * fullscreen keyboard mouse -permit /usr/bin/swaylock lock -permit /usr/bin/swaybg background -permit /usr/bin/swaybar panel - -# Configures enabled IPC features for specific programs -ipc /usr/bin/swaymsg { - * enabled - - events { - * disabled - } -} - -ipc /usr/bin/swaybar { - bar-config enabled - outputs enabled - workspaces enabled - command enabled - - events { - workspace enabled - mode enabled - } -} - -ipc /usr/bin/swaylock { - outputs enabled -} - -# Limits the contexts from which certain commands are permitted -commands { - * all - - fullscreen binding criteria - bindsym config - exit binding - kill binding -} diff --git a/home/.config/systemd/user/mpDris2.service b/home/.config/systemd/user/mpDris2.service index bb8eee03..e6b4c18e 100644 --- a/home/.config/systemd/user/mpDris2.service +++ b/home/.config/systemd/user/mpDris2.service @@ -1,10 +1,10 @@ [Unit] Description=MPRIS2 support for MPD -PartOf=graphical-session.target +After=mpd.service [Service] Type=simple ExecStart=/usr/bin/mpDris2 [Install] -WantedBy=sway-session.target +WantedBy=default.target diff --git a/home/.config/systemd/user/nvim-headless.service b/home/.config/systemd/user/nvim-headless.service new file mode 100644 index 00000000..9c408839 --- /dev/null +++ b/home/.config/systemd/user/nvim-headless.service @@ -0,0 +1,11 @@ +[Unit] +Description=Neovim headless server + +[Service] +Type=simple +ExecStart=/bin/bash --login -c 'nvim --headless --listen %h/.var/nvim.socket' +Restart=always +RestartSec=1 + +[Install] +WantedBy=default.target diff --git a/home/.config/systemd/user/nvim-remote-ssh@.service b/home/.config/systemd/user/nvim-remote-ssh@.service new file mode 100644 index 00000000..e4658306 --- /dev/null +++ b/home/.config/systemd/user/nvim-remote-ssh@.service @@ -0,0 +1,13 @@ +[Unit] +Description=Neovim remote SSH socket + +# Pass arguments https://superuser.com/a/1282178 +[Service] +Type=simple +Environment="SCRIPT_ARGS=%I" +ExecStart=%h/.local/bin/nvim-remote-ssh $SCRIPT_ARGS +Restart=on-failure +RestartSec=1 + +[Install] +WantedBy=default.target diff --git a/home/.config/systemd/user/thunderbird.service b/home/.config/systemd/user/thunderbird.service index 6d6fba8b..949a0e76 100644 --- a/home/.config/systemd/user/thunderbird.service +++ b/home/.config/systemd/user/thunderbird.service @@ -4,6 +4,7 @@ PartOf=graphical-session.target [Service] Type=simple +Environment="LANG=en_XX.UTF-8@POSIX" ExecStart=/usr/bin/thunderbird [Install] diff --git a/home/.config/systemd/user/trash-empty.service b/home/.config/systemd/user/trash-empty.service new file mode 100644 index 00000000..37e2a8c9 --- /dev/null +++ b/home/.config/systemd/user/trash-empty.service @@ -0,0 +1,6 @@ +[Unit] +Description=Removes files older than a week from trash can + +[Service] +Type=oneshot +ExecStart=/usr/bin/trash-empty 7 diff --git a/home/.config/systemd/user/trash-empty.timer b/home/.config/systemd/user/trash-empty.timer new file mode 100644 index 00000000..2ea280f0 --- /dev/null +++ b/home/.config/systemd/user/trash-empty.timer @@ -0,0 +1,9 @@ +[Unit] +Description=Runs trash-empty.service every hour + +[Timer] +OnUnitActiveSec=1h +Unit=trash-empty.service + +[Install] +WantedBy=timers.target diff --git a/home/.config/systemd/user/ydotoold.service b/home/.config/systemd/user/ydotoold.service deleted file mode 100644 index 9e0cda73..00000000 --- a/home/.config/systemd/user/ydotoold.service +++ /dev/null @@ -1,10 +0,0 @@ -[Unit] -Description=Generic command-line automation tool -PartOf=graphical-session.target - -[Service] -Type=simple -ExecStart=/usr/bin/ydotoold - -[Install] -WantedBy=sway-session.target diff --git a/home/.config/udiskie/config.yml b/home/.config/udiskie/config.yml deleted file mode 100644 index 9e6a80cf..00000000 --- a/home/.config/udiskie/config.yml +++ /dev/null @@ -1,5 +0,0 @@ -{%@@ if profile == "ReekyPC" @@%} -device_config: - - id_uuid: 10879044936567925003 - ignore:true -{%@@ endif @@%} diff --git a/home/.config/user-dirs.dirs b/home/.config/user-dirs.dirs deleted file mode 100644 index 7f9a9593..00000000 --- a/home/.config/user-dirs.dirs +++ /dev/null @@ -1,15 +0,0 @@ -# This file is written by xdg-user-dirs-update -# If you want to change or add directories, just edit the line you're -# interested in. All local changes will be retained on the next run. -# Format is XDG_xxx_DIR="$HOME/yyy", where yyy is a shell-escaped -# homedir-relative path, or XDG_xxx_DIR="/yyy", where /yyy is an -# absolute path. No other format is supported. -# -XDG_DESKTOP_DIR="$HOME/Desktop" -XDG_DOWNLOAD_DIR="$HOME/Downloads" -XDG_TEMPLATES_DIR="$HOME/Templates" -XDG_PUBLICSHARE_DIR="$HOME/Public" -XDG_DOCUMENTS_DIR="$HOME/Documents" -XDG_MUSIC_DIR="$HOME/Music" -XDG_PICTURES_DIR="$HOME/Pictures" -XDG_VIDEOS_DIR="$HOME/Videos" diff --git a/home/.config/wal/colorschemes/dark/kanagawa.json b/home/.config/wal/colorschemes/dark/kanagawa.json new file mode 100644 index 00000000..af39e5a9 --- /dev/null +++ b/home/.config/wal/colorschemes/dark/kanagawa.json @@ -0,0 +1,27 @@ +{ + "colors": { + "color0": "#090618", + "color1": "#C34043", + "color2": "#76946A", + "color3": "#C0A36E", + "color4": "#7E9CD8", + "color5": "#957FB8", + "color6": "#6A9589", + "color7": "#C8C093", + "color8": "#727169", + "color9": "#E82424", + "color10": "#98BB6C", + "color11": "#E6C384", + "color12": "#7FB4CA", + "color13": "#938AA9", + "color14": "#7AA89F", + "color15": "#DCD7BA", + "color16": "#FFA066", + "color17": "#FF5D62" + }, + "special": { + "foreground": "#DCD7BA", + "background": "#1F1F28", + "cursor": "#C8C093" + } +} diff --git a/home/.config/wal/templates/colors-foot.ini b/home/.config/wal/templates/colors-foot.ini new file mode 100644 index 00000000..835bb948 --- /dev/null +++ b/home/.config/wal/templates/colors-foot.ini @@ -0,0 +1,24 @@ +[colors] +foreground = {foreground.strip} +background = {background.strip} +alpha = {background.alpha_dec} + +regular0 = {color0.strip} +regular1 = {color1.strip} +regular2 = {color2.strip} +regular3 = {color3.strip} +regular4 = {color4.strip} +regular5 = {color5.strip} +regular6 = {color6.strip} +regular7 = {color7.strip} +bright0 = {color8.strip} +bright1 = {color9.strip} +bright2 = {color10.strip} +bright3 = {color11.strip} +bright4 = {color12.strip} +bright5 = {color13.strip} +bright6 = {color14.strip} +bright7 = {color15.strip} + +[cursor] +color = {foreground.strip} {cursor.strip} diff --git a/home/.config/waybar/config b/home/.config/waybar/config index ea82c4f3..d0e27762 100644 --- a/home/.config/waybar/config +++ b/home/.config/waybar/config @@ -1,131 +1,127 @@ -// vim: ft=jsonc +// vim: ft=json { - "layer": "bottom", // Waybar at top layer - "height": 22, // Waybar height - "modules-left": ["sway/workspaces", "sway/mode", "custom/playerctl"], - "modules-center": ["sway/window"], - "modules-right": [ - "idle_inhibitor", - "pulseaudio", - "custom/yay", - "network", - "temperature", - "battery", - "clock", - "tray" - ], - // Modules configuration - "sway/workspaces": { - "disable-scroll": true, - "all-outputs": true, - "format": "{icon}", - "format-icons": { - "1": "", - "2": "", - "3": "", - "4": "", - "5": "", - "urgent": "", - "focused": "", - "default": "" - } - }, - "sway/mode": { - "format": "{}" - }, - "idle_inhibitor": { - "tooltip": false, - "format": "{icon}", - "format-icons": { - "activated": "", - "deactivated": "" - } - }, - "network": { - "format": "{ifname}", - "format-wifi": "{essid} ({signalStrength}%) ", - "format-ethernet": "{ipaddr} ", - "format-disconnected": "Disconnected ", //An empty format will hide the module. - "tooltip-format": "{ifname}", - "tooltip-format-wifi": "{ifname} {frequency}MHz ", - "tooltip-format-ethernet": "{ifname} ", - "tooltip-format-disconnected": "Disconnected" - }, - "tray": { - // "icon-size": 21, - "spacing": 10 - }, - "clock": { - "tooltip": false, - "format": "{:%Y-%m-%d %H:%M} " - }, - "cpu": { - "tooltip": false, - "format": "{usage}% " - }, - "memory": { - "tooltip": false, - "format": "{}% " - }, - "backlight": { - // "device": "acpi_video1", - "format": "{percent}% {icon}", - "format-icons": ["", ""] - }, - "battery": { - "tooltip": false, - "states": { - // "good": 95, - "warning": 30, - "critical": 15 - }, - "format": "{capacity}% {icon}", - // "format-good": "", // An empty format will hide the module - // "format-full": "", - "format-icons": ["", "", "", "", ""] - }, - "battery#bat2": { - "bat": "BAT2" - }, - "pulseaudio": { - "tooltip": false, - //"scroll-step": 1, - "format": "{volume}% {icon}", - "format-bluetooth": "{volume}% {icon}", - "format-muted": "", - "format-icons": { - "headphones": "", - "handsfree": "", - "headset": "", - "phone": "", - "portable": "", - "car": "", - "default": ["", ""] - }, - "on-click": "pulseaudio-ctl mute", - "on-click-right": "pavucontrol", - "on-scroll-up": "pulseaudio-ctl up", - "on-scroll-down": "pulseaudio-ctl down" - }, - "custom/playerctl": { - "tooltip": false, - "format": "{}", - "exec": "$HOME/Scripts/metadata.sh", - "interval": 2, - "max-length": 40, - "on-click": "playerctl play-pause", - "on-click-right": "playerctl next", - "on-scroll-up": "playerctl volume 0.05+", - "on-scroll-down": "playerctl volume 0.05-" - }, - "custom/yay":{ - "tooltip": false, - "format": "{} ", - "exec": "yay -Qu | wc -l", - "interval": 300, - "on-click": "alacritty -e yay" - }, - "temperature": { - "format": "{temperatureC}°C " - } + "layer": "top", + "test": "asd", + "height": 22, + "modules-left": ["sway/workspaces", "sway/mode", "custom/media"], + "modules-center": ["sway/window"], + "modules-right": [ + "idle_inhibitor", + "pulseaudio", + "custom/yay", + "network", + "temperature", + "battery", + "clock", + "tray" + ], + "sway/workspaces": { + "disable-scroll": true, + "all-outputs": true, + "format": "{icon}", + "format-icons": { + "1": "", + "2": "", + "3": "", + "4": "", + "5": "", + "urgent": "", + "focused": "", + "default": "" + } + }, + "sway/mode": { + "format": "{}" + }, + "idle_inhibitor": { + "tooltip": false, + "format": "{icon}", + "format-icons": { + "activated": "", + "deactivated": "" + } + }, + "network": { + "format": "{ifname}", + "format-wifi": "{essid} ({signalStrength}%) ", + "format-ethernet": "{ipaddr} ", + "format-disconnected": "Disconnected ", + "tooltip-format": "{ifname}", + "tooltip-format-wifi": "{ifname} {frequency}MHz ", + "tooltip-format-ethernet": "{ifname} ", + "tooltip-format-disconnected": "Disconnected" + }, + "tray": { + "spacing": 10 + }, + "clock": { + "tooltip": true, + "tooltip-format": "{:%Y %B}\n{calendar}", + "format": "{:%Y-%m-%d %H:%M} " + }, + "cpu": { + "tooltip": false, + "format": "{usage}% " + }, + "memory": { + "tooltip": false, + "format": "{}% " + }, + "backlight": { + "format": "{percent}% {icon}", + "format-icons": ["", ""] + }, + "battery": { + "tooltip": true, + "tooltip-format": "{time}", + "states": { + "warning": 30, + "critical": 15 + }, + "format": "{capacity}% {icon}", + "format-icons": ["", "", "", "", ""] + }, + "battery#bat2": { + "bat": "BAT2" + }, + "pulseaudio": { + "tooltip": false, + "format": "{volume}% {icon}", + "format-bluetooth": "{volume}% ", + "format-muted": "", + "format-icons": { + "headphones": "", + "handsfree": "", + "headset": "", + "phone": "", + "portable": "", + "car": "", + "default": ["", ""] + }, + "on-click": "pamixer --toggle-mute && ( pamixer --get-mute && echo 0 > $SWAYSOCK.wob ) || pamixer --get-volume > $SWAYSOCK.wob", + "on-click-right": "pavucontrol", + "on-scroll-up": "pamixer -ui 1 && pamixer --get-volume > $SWAYSOCK.wob", + "on-scroll-down": "pamixer -ud 1 && pamixer --get-volume > $SWAYSOCK.wob" + }, + "custom/media": { + "tooltip": false, + "format": "{}", + "return-type": "json", + "exec": "$HOME/.config/waybar/scripts/mediaplayer.py 2>/dev/null", + "max-length": 50, + "on-click": "playerctl play-pause", + "on-click-right": "playerctl next", + "on-scroll-up": "playerctl volume 0.05+", + "on-scroll-down": "playerctl volume 0.05-" + }, + "custom/yay": { + "tooltip": false, + "format": "{} ", + "exec": "yay -Qu | wc -l", + "interval": 300, + "on-click": "gnome-software --mode=updates" + }, + "temperature": { + "format": "{temperatureC}°C " + } } diff --git a/home/.config/waybar/scripts/mediaplayer.py b/home/.config/waybar/scripts/mediaplayer.py new file mode 100755 index 00000000..aa9dc613 --- /dev/null +++ b/home/.config/waybar/scripts/mediaplayer.py @@ -0,0 +1,126 @@ +#!/usr/bin/env python3 +import argparse +import logging +import sys +import signal +import gi +import json +gi.require_version('Playerctl', '2.0') +from gi.repository import Playerctl, GLib + +logger = logging.getLogger(__name__) + + +def write_output(text, player): + logger.info('Writing output') + + output = {'text': text, + 'class': 'custom-' + player.props.player_name, + 'alt': player.props.player_name} + + sys.stdout.write(json.dumps(output) + '\n') + sys.stdout.flush() + + +def on_play(player, status, manager): + logger.info('Received new playback status') + on_metadata(player, player.props.metadata, manager) + + +def on_metadata(player, metadata, manager): + logger.info('Received new metadata') + track_info = '' + + if player.get_artist() != '' and player.get_title() != '': + track_info = '{artist} - {title}'.format(artist=player.get_artist(), + title=player.get_title()) + else: + track_info = player.get_title() + + if player.props.status == 'Playing' and track_info: + track_info = ' ' + track_info + else: + track_info = ' ' + track_info + + write_output(track_info, player) + + +def on_player_appeared(manager, player, selected_player=None): + if player is not None and (selected_player is None or player.name == selected_player): + init_player(manager, player) + else: + logger.debug("New player appeared, but it's not the selected player, skipping") + + +def on_player_vanished(manager, player): + logger.info('Player has vanished') + sys.stdout.write('\n') + sys.stdout.flush() + + +def init_player(manager, name): + logger.debug('Initialize player: {player}'.format(player=name.name)) + player = Playerctl.Player.new_from_name(name) + player.connect('playback-status', on_play, manager) + player.connect('metadata', on_metadata, manager) + manager.manage_player(player) + on_metadata(player, player.props.metadata, manager) + + +def signal_handler(sig, frame): + logger.debug('Received signal to stop, exiting') + sys.stdout.write('\n') + sys.stdout.flush() + # loop.quit() + sys.exit(0) + + +def parse_arguments(): + parser = argparse.ArgumentParser() + + # Increase verbosity with every occurence of -v + parser.add_argument('-v', '--verbose', action='count', default=0) + + # Define for which player we're listening + parser.add_argument('--player') + + return parser.parse_args() + + +def main(): + arguments = parse_arguments() + + # Initialize logging + logging.basicConfig(stream=sys.stderr, level=logging.DEBUG, + format='%(name)s %(levelname)s %(message)s') + + # Logging is set by default to WARN and higher. + # With every occurrence of -v it's lowered by one + logger.setLevel(max((3 - arguments.verbose) * 10, 0)) + + # Log the sent command line arguments + logger.debug('Arguments received {}'.format(vars(arguments))) + + manager = Playerctl.PlayerManager() + loop = GLib.MainLoop() + + manager.connect('name-appeared', lambda *args: on_player_appeared(*args, arguments.player)) + manager.connect('player-vanished', on_player_vanished) + + signal.signal(signal.SIGINT, signal_handler) + signal.signal(signal.SIGTERM, signal_handler) + + for player in manager.props.player_names: + if arguments.player is not None and arguments.player != player.name: + logger.debug('{player} is not the filtered player, skipping it' + .format(player=player.name) + ) + continue + + init_player(manager, player) + + loop.run() + + +if __name__ == '__main__': + main() diff --git a/home/.config/waybar/style.css b/home/.config/waybar/style.css index 78fcae7a..e5b38cdf 100644 --- a/home/.config/waybar/style.css +++ b/home/.config/waybar/style.css @@ -1,130 +1,141 @@ * { - border: none; - border-radius: 0; - font-family: "Noto Sans Display", "Font Awesome 5 Free"; - font-size: 13px; - min-height: 0; + border: none; + border-radius: 0; + font-family: 'Noto Sans Display', 'Font Awesome 5 Free'; + font-size: 13px; + min-height: 0; } window#waybar { - background: #292D3E; - color: white; + background: #292d3e; + color: white; } /* https://github.com/Alexays/Waybar/wiki/FAQ#the-workspace-buttons-have-a-strange-hover-effect */ #workspaces button { - padding: 0 5px; - background: transparent; - color: white; + padding: 0 5px; + background: transparent; + color: white; } #workspaces button.focused { - background: #64727D; + background: #64727d; } #mode { - background: #64727D; + background: #64727d; } -#clock, #battery, #cpu, #temperature, #memory, #backlight, #network, #pulseaudio, #custom-playerctl, #custom-yay, #tray, #mode, #idle_inhibitor { - padding: 0 10px; - margin: 0 5px; +#clock, +#battery, +#cpu, +#temperature, +#memory, +#backlight, +#network, +#pulseaudio, +#custom-media, +#custom-yay, +#tray, +#mode, +#idle_inhibitor { + padding: 0 10px; + margin: 0 5px; } #clock { - background-color: #64727D; + background-color: #64727d; } #battery { - background-color: #ffffff; - color: black; + background-color: #ffffff; + color: black; } #battery.charging { - color: black; - background-color: #a3be8c; + color: black; + background-color: #a3be8c; } @keyframes blink { - to { - background-color: #ffffff; - color: black; - } + to { + background-color: #ffffff; + color: black; + } } #battery.critical:not(.charging) { - background: #bf616a; - color: white; - animation-name: blink; - animation-duration: 0.5s; - animation-timing-function: linear; - animation-iteration-count: infinite; - animation-direction: alternate; + background: #bf616a; + color: white; + animation-name: blink; + animation-duration: 0.5s; + animation-timing-function: linear; + animation-iteration-count: infinite; + animation-direction: alternate; } #temperature { - background: #97B084; - color: black; + background: #97b084; + color: black; } #temperature.critical { - background: #bf616a; - color: white; - animation-name: blink; - animation-duration: 0.5s; - animation-timing-function: linear; - animation-iteration-count: infinite; - animation-direction: alternate; + background: #bf616a; + color: white; + animation-name: blink; + animation-duration: 0.5s; + animation-timing-function: linear; + animation-iteration-count: infinite; + animation-direction: alternate; } #cpu { - background: #BD9B5D; - color: #000000; + background: #bd9b5d; + color: #000000; } #memory { - color: black; - background: #b48ead; + color: black; + background: #b48ead; } #backlight { - background: #90b1b1; + background: #90b1b1; } #network { - color: black; - background: #81a1c1; + color: black; + background: #81a1c1; } #network.disconnected { - background: #f53c3c; + background: #f53c3c; } #pulseaudio { - background: #88c0d0; - color: black; + background: #88c0d0; + color: black; } #pulseaudio.muted { - background: #90b1b1; - color: #2a5c45; + background: #90b1b1; + color: #2a5c45; } -#custom-playerctl { - background: #97B084; - color: black; +#custom-media { + background: #97b084; + color: black; } #custom-yay { - background-color: #64727D; + background-color: #64727d; } #tray { - background-color: #282828; + background-color: #282828; } #idle_inhibitor { - background-color: #8fbcbb; - color: #000000; + background-color: #8fbcbb; + color: #000000; } - diff --git a/home/.config/wofi/config b/home/.config/wofi/config new file mode 100644 index 00000000..ff4508eb --- /dev/null +++ b/home/.config/wofi/config @@ -0,0 +1,2 @@ +show=drun +allow_images=true diff --git a/home/.config/yay/config.json b/home/.config/yay/config.json deleted file mode 100644 index 7bf0b632..00000000 --- a/home/.config/yay/config.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "aururl": "https://aur.archlinux.org", - "buildDir": "$HOME/.cache/yay", - "editor": "vim", - "editorflags": "", - "makepkgbin": "makepkg", - "makepkgconf": "", - "pacmanbin": "pacman", - "pacmanconf": "/etc/pacman.conf", - "tarbin": "bsdtar", - "redownload": "no", - "rebuild": "no", - "answerclean": "", - "answerdiff": "", - "answeredit": "", - "answerupgrade": "", - "gitbin": "git", - "gpgbin": "gpg", - "gpgflags": "", - "mflags": "", - "sortby": "votes", - "gitflags": "", - "removemake": "ask", - "requestsplitn": 150, - "sortmode": 0, - "completionrefreshtime": 7, - "sudoloop": false, - "timeupdate": false, - "devel": false, - "cleanAfter": false, - "gitclone": true, - "provides": true, - "pgpfetch": true, - "upgrademenu": true, - "cleanmenu": true, - "diffmenu": true, - "editmenu": false, - "combinedupgrade": true, - "useask": false -} diff --git a/home/.config/youtube-dl/config b/home/.config/youtube-dl/config index 1a7eb023..e3dad33c 100644 --- a/home/.config/youtube-dl/config +++ b/home/.config/youtube-dl/config @@ -2,7 +2,6 @@ --write-sub --sub-lang en --embed-subs ---embed-thumbnail --add-metadata --prefer-ffmpeg --yes-playlist diff --git a/home/.config/zathura/catppuccin b/home/.config/zathura/catppuccin new file mode 100644 index 00000000..0ee25130 --- /dev/null +++ b/home/.config/zathura/catppuccin @@ -0,0 +1,37 @@ +set default-fg "#d9e0ee" +set default-bg "#1e1d2f" + +set completion-bg "#302d41" +set completion-fg "#d9e0ee" +set completion-highlight-bg "#575268" +set completion-highlight-fg "#d9e0ee" +set completion-group-bg "#302d41" +set completion-group-fg "#96cdfb" + +set statusbar-fg "#d9e0ee" +set statusbar-bg "#302d41" + +set notification-bg "#302d41" +set notification-fg "#d9e0ee" +set notification-error-bg "#302d41" +set notification-error-fg "#f28fad" +set notification-warning-bg "#302d41" +set notification-warning-fg "#fae3b0" + +set inputbar-fg "#d9e0ee" +set inputbar-bg "#302d41" + +set recolor-lightcolor "#1e1d2f" +set recolor-darkcolor "#d9e0ee" + +set index-fg "#d9e0ee" +set index-bg "#1e1d2f" +set index-active-fg "#d9e0ee" +set index-active-bg "#302d41" + +set render-loading-bg "#1e1d2f" +set render-loading-fg "#d9e0ee" + +set highlight-color "#575268" +set highlight-fg "#f5c2e7" +set highlight-active-color "#f5c2e7" diff --git a/home/.config/zathura/zathurarc b/home/.config/zathura/zathurarc index 3f06e2a8..c5ed9997 100644 --- a/home/.config/zathura/zathurarc +++ b/home/.config/zathura/zathurarc @@ -1,33 +1,7 @@ -set completion-bg "#282828" -set recolor-darkcolor "#EBDBB2" -set recolor-lightcolor "#282828" -set completion-fg "#EBDBB2" -set completion-group-bg "#282828" -set completion-group-fg "#1E6D8B" -set completion-highlight-bg "#EBDBB2" -set completion-highlight-fg "#282828" -set default-bg "#282828" -set default-fg "#EBDBB2" -set inputbar-bg "#282828" -set inputbar-fg "#EBDBB2" -set notification-bg "#282828" -set notification-fg "#EBDBB2" -set notification-error-bg "#EBAE79" -set notification-error-fg "#EBDBB2" -set notification-warning-bg "#EBAE79" -set notification-warning-fg "#EBDBB2" -set statusbar-bg "#282828" -set statusbar-fg "#EBDBB2" -set index-bg "#282828" -set index-fg "#EBDBB2" -set index-active-bg "#EBDBB2" -set index-active-fg "#282828" -set render-loading-bg "#282828" -set render-loading-fg "#EBDBB2" - -set smooth-scroll true set window-title-home-tilde true set statusbar-basename true set selection-clipboard clipboard set recolor false set vertical-center true + +include catppuccin diff --git a/home/.config/zellij/config.kdl b/home/.config/zellij/config.kdl new file mode 100644 index 00000000..88d64342 --- /dev/null +++ b/home/.config/zellij/config.kdl @@ -0,0 +1,12 @@ +session_serialization false +theme "kanagawa" + +keybinds { + unbind "Ctrl g" + locked { + bind "Ctrl l" { SwitchToMode "Normal"; } + } + shared_except "locked" { + bind "Ctrl l" { SwitchToMode "Locked"; } + } +} diff --git a/home/.config/zsh/01-env.zsh b/home/.config/zsh/01-env.zsh deleted file mode 100644 index 47431a93..00000000 --- a/home/.config/zsh/01-env.zsh +++ /dev/null @@ -1,44 +0,0 @@ -# zsh key timeout -export KEYTIMEOUT=1 - -# prompt customization -export PURE_PROMPT_SYMBOL="λ" -export PURE_PROMPT_VICMD_SYMBOL="y" - -# zsh history settings -export HISTFILE=~/.zsh_history -export HISTSIZE=1000 -export SAVEHIST=1000 - -# Variable to pass to sdotdrop to get current user -export USRNAME=$USER - -# go path -export GOPATH=~/.bin/go - -# fzf settings -export FZF_DEFAULT_COMMAND='rg --files --hidden 2>/dev/null' -export FZF_COMPLETION_TRIGGER='**' -export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND" -export FZF_CTRL_T_OPTS='--preview "/usr/bin/cat {} | nvimpager -c "' -export FZF_ALT_C_COMMAND='rg --hidden --files --null --sort path 2>/dev/null | xargs -0 dirname | uniq' - -# use lesspipe with less -export LESSOPEN="|lesspipe.sh %s" - -# dotdrop repository location -export DOTREPO="$HOME/Git/dotfiles" - -# nvim ftw! -export EDITOR=nvim -export PAGER="nvimpager -p" - -{%@@ if profile == "Mirkwood" @@%} -# use gpg for ssh -export GPG_TTY="$(tty)" -export SSH_AUTH_SOCK="/run/user/$UID/gnupg/S.gpg-agent.ssh" -gpg-connect-agent updatestartuptty /bye > /dev/null -{%@@ endif @@%} - -# tehfuk -eval $(thefuck --alias) diff --git a/home/.config/zsh/01-zellij.zsh b/home/.config/zsh/01-zellij.zsh new file mode 100644 index 00000000..d8dfb94b --- /dev/null +++ b/home/.config/zsh/01-zellij.zsh @@ -0,0 +1,4 @@ + # Launch or attach zellij to existing session if logging in over ssh +if [[ -z "$ZELLIJ" && -n "$SSH_CONNECTION" ]]; then + exec zellij attach -c SSH +fi diff --git a/home/.config/zsh/02-env.zsh b/home/.config/zsh/02-env.zsh new file mode 100644 index 00000000..8fef18a9 --- /dev/null +++ b/home/.config/zsh/02-env.zsh @@ -0,0 +1,91 @@ +# key timeout +export KEYTIMEOUT=1 + +# prompt customization +export PURE_PROMPT_SYMBOL="λ" +export PURE_PROMPT_VICMD_SYMBOL="y" + +# history settings +export HISTFILE=~/.zsh_history +export HISTSIZE=10000 +export SAVEHIST=10000 +# Ignore these functions from history since they will +# append the expandend command to the history +export HISTORY_IGNORE="(pi|pr)" +# Additional settings (source https://jdhao.github.io/2021/03/24/zsh_history_setup) +setopt HIST_IGNORE_ALL_DUPS +setopt HIST_SAVE_NO_DUPS +setopt HIST_REDUCE_BLANKS +setopt INC_APPEND_HISTORY_TIME +setopt EXTENDED_HISTORY + +# Enable completions for aliases +setopt no_complete_aliases + +# Variable to pass to sdotdrop to get current user +export USRNAME=$USER + +# Add ~/.local/bin to path +export PATH="$HOME/.local/bin:$PATH" + +# Add locally installed npm binaries to path +export PATH="$HOME/.local/share/npm/bin:$PATH" + +# Add ~/.cargo/bin to path +export PATH="$HOME/.cargo/bin:$PATH" + +# Add ~/.local/share/nvim/mason/bin to path +export PATH="$HOME/.local/share/nvim/mason/bin:$PATH" + +# go path +export GOPATH=~/.go + +# fzf settings +export FD_COMMAND='fd -HLt' +export FZF_DEFAULT_COMMAND="$FD_COMMAND f" +export FZF_ALT_C_COMMAND="$FD_COMMAND d" +export FZF_ALT_C_OPTS="--preview 'eza -l {}'" +export FZF_DEFAULT_OPTS='-m --ansi --bind ctrl-a:toggle-all,ctrl-d:deselect-all,ctrl-t:toggle-all' +export FZF_COMPLETION_TRIGGER='**' +export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND --strip-cwd-prefix" +export FZF_CTRL_T_OPTS='--preview "bat --color=always --style=numbers --line-range=:500 {}"' +_fzf_compgen_path() { + resultcmd="$FZF_DEFAULT_COMMAND . $1" + eval ${resultcmd} +} +_fzf_compgen_dir() { + resultcmd="$FZF_ALT_C_COMMAND . $1" + eval ${resultcmd} +} + +# dotfile repository location +export DOTREPO="$HOME/git/dotfiles" + +# nvim ftw! +export EDITOR=nvim +export PAGER="$EDITOR -R +\"lua require 'pager'\"" +export GIT_PAGER="$EDITOR -c 'set ft=git' -R +\"lua require 'pager'\"" +export PARU_PAGER="$PAGER -c 'set ft=PKGBUILD'" +export AUR_PAGER=$EDITOR +export MANPAGER="$EDITOR +\"lua require 'pager'\" +Man!" +export SYSTEMD_EDITOR=$EDITOR +export SYSTEMD_PAGER=less + +# neovide settings +export NEOVIDE_MULTIGRID=1 +export NEOVIDE_FORK=1 + +{%@@ if distro_id == "arch" or distro_id == "ubuntu" @@%} +if [ "${gnupg_SSH_AUTH_SOCK_by:-0}" -ne $$ ]; then + export SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)" +fi +gpgconf --launch gpg-agent +{%@@ elif distro_id == "termux" @@%} +eval $(okc-ssh-agent) >/dev/null +{%@@ endif @@%} + +# Enable grc colorization of supported commands +[[ -s "/etc/grc.zsh" ]] && source /etc/grc.zsh + +# Disable dotdrop submodule auto update +export DOTDROP_AUTOUPDATE=no diff --git a/home/.config/zsh/03-aliases.zsh b/home/.config/zsh/03-aliases.zsh deleted file mode 100644 index 829c05eb..00000000 --- a/home/.config/zsh/03-aliases.zsh +++ /dev/null @@ -1,198 +0,0 @@ -# git shorthands -alias gc='git commit' -alias gac='ga && gc' -alias gpull='git pull' -alias gpush='git push' - -# Syntax highlighting cat -alias cat='nvimpager -c' - -rip() { - abcde - printf "Ripping done. Importing to library" - beet import ~/Documents/Rip/flac/* -} - -# make fzf zsh plugin use ripgrep -_fzf_compgen_dir() { - rg --hidden --files --null --sort path "$1" 2>/dev/null | xargs -0 dirname | uniq -} -_fzf_compgen_path() { - rg --files --hidden "$1" 2>/dev/null -} - -# search and install packages with fzf -yi() { - SELECTED_PKGS="$(yay -Slq | fzf --header='Install packages' -m --preview 'yay -Si {1}')" - if [ -n "$SELECTED_PKGS" ]; then - yay -S $(echo $SELECTED_PKGS) - fi -} - -# search and remove packages with fzf -yr() { - SELECTED_PKGS="$(yay -Qsq | fzf --header='Remove packages' -m --preview 'yay -Si {1}')" - if [ -n "$SELECTED_PKGS" ]; then - yay -Rns $(echo $SELECTED_PKGS) - fi -} - -# find and open man pages with fzf -fman() { - man -k . | fzf --prompt='Man> ' | awk '{print $1}' | xargs -r man -} - -# I'm retarded so I need this -alias :q='exit' -alias :wq='exit' - -# zbar output only data -alias zbarimg='zbarimg -q --raw' -alias zbarcam='zbarcam -q --raw' - -# shorten systemctl -alias sc='sudo systemctl' -alias scu='systemctl --user' - -# switch to desktop mode -alias dock='swaymsg output eDP-1 disable' - -# move to trash instead of remove -alias rm='trash' - -# clean stuff -clean() { - DFCMD="df -h / | tail -n 1 | cut -d' ' -f8- | cut -d' ' -f1 | sed 's/[^0-9]*//g'" - SPACEBEFORE=$(eval "$DFCMD") - trash-empty 10 - sudo journalctl --vacuum-size=500M - yay -Sc - SPACEAFTER=$(eval "$DFCMD") - echo "Saved $(calc $SPACEAFTER - $SPACEBEFORE)G of space" -} - -# connect to wireguard -alias startvpn='sudo systemctl start wg-quick@wg0.service' -alias stopvpn='sudo systemctl stop wg-quick@wg0.service' - -# connect to metropolia vpn -alias metropoliavpn='sudo openconnect -u markoak --passwd-on-stdin vpn.metropolia.fi' - -# read qrcode from selection -qr() { grim -g "$(slurp -d)" - | zbarimg PNG:- } - -# generate qr code in terminal -alias qrencode='qrencode -t ansiutf8' - -# color picker -cpick() { grim -g "$(slurp -p)" -t ppm - | convert - -format "%[pixel:p{0,0}]" txt:- } - -#iwctl aliases -alias i='iwctl station wlan0' - -# change cpu power settings -battery() { - sudo cpupower frequency-set -g powersave - echo low | sudo tee /sys/class/drm/card0/device/power_dpm_force_performance_level -} -plugged() { - sudo cpupower frequency-set -g schedutil - echo auto | sudo tee /sys/class/drm/card0/device/power_dpm_force_performance_level -} -ultimatepowersave() { - battery - powersave - sudo ryzenadj --stapm-limit=25000 --fast-limit=25000 --slow-limit=25000 --tctl-temp=20; -} -performance() { - sudo cpupower frequency-set -g performance - sudo ryzenadj --stapm-limit=45000 --fast-limit=45000 --slow-limit=45000 --tctl-temp=90 -} - -# monitor cpu freq -cpufreq() { watch -n 1 eval "cat /proc/cpuinfo | grep MHz" } - -# dotdrop -updatesecrets() { bash $DOTREPO/secrets/secrets.sh; chmod 600 $DOTREPO/secrets/secrets } -dotdrop() { source $DOTREPO/secrets/secrets && $DOTREPO/dotdrop/dotdrop.sh --cfg=$DOTREPO/config-home.yaml $@ } -sdotdrop() { source $DOTREPO/secrets/secrets && sudo -E $DOTREPO/dotdrop/dotdrop.sh --cfg=$DOTREPO/config-root.yaml $@ } -compdef _dotdrop-completion.zsh sdotdrop -alias dotgit='git -C $DOTREPO' -dotsync() { cd $DOTREPO && gpull && ga && gc && gpush && cd $OLDPWD } - -# sync password manager -passync() { pass git pull && pass git push && updatesecrets } - -# update stuff -plugupdate() { vim +PlugUpgrade +PlugUpdate +CocUpdate +qa && zinit update && $HOME/.tmux/plugins/tpm/bin/update_plugins all } -update() { yay -Syu --devel firefox-nightly } -updateall() { update; plugupdate; sudo awman-update } - -# remove unneeded packages -autoremove() { sudo pacman -R $(pacman -Qdtq) } - -# turn on usb tethering on my android phone -tether() { adb shell su -c "service call connectivity 33 i32 1 s16 me" > /dev/null } - -# update arch mirrorlist -alias reflect='sudo reflector --latest 200 --threads 8 --verbose --protocol http --protocol https --sort rate --save /etc/pacman.d/mirrorlist' - -# better ls -alias ls='ls_extended' - -# default icon for notify-send -alias notify-send='notify-send --icon=alarm' - - -# encrypted tar's with zstd compression -cgpgtar() { tar cf - --zstd $1 | gpg -e -z 0 > $1.tar.zst.gpg } -xgpgtar() { gpg -d $1 | tar x --zstd } - -# colorise output -cvs() { grc cvs $@ } -df() { grc df $@ } -digg() { grc digg $@ } -gcc() { grc gcc $@ } -g++() { grc g++ $@ } -ifconfig() { grc ifconfig $@ } -make() { grc make $@ } -mount() { grc mount $@ } -mtr() { grc mtr $@ } -netstat() { grc mount $@ } -ping() { grc ping $@ } -ps() { grc ps $@ } -tail() { grc tail $@ } -traceroute() { grc traceroute $@ } -wdiff() { grc wdiff $@ } -blkid() { grc blkid $@ } -du() { grc du $@ } -dnf() { grc dnf $@ } -docker() { grc docker $@ } -docke-machine() { grc docker-machine $@ } -env() { grc env $@ } -id() { grc id $@ } -ip() { grc ip $@ } -iostat() { grc iostat $@ } -last() { grc last $@ } -lsattr() { grc lsattr $@ } -lsblk() { grc lsblk $@ } -lspci() { grc lspci $@ } -lsmod() { grc lsmod $@ } -lsof() { grc lsof $@ } -getfacl() { grc getfacl $@ } -getsebool() { grc getsebool $@ } -ulimit() { grc ulimit $@ } -uptime() { grc uptime $@ } -nmap() { grc nmap $@ } -fdisk() { grc fdisk $@ } -findmnt() { grc findmnt $@ } -free() { grc free $@ } -semanage() { grc semanage $@ } -sar() { grc sar $@ } -ss() { grc ss $@ } -sysctl() { grc sysctl $@ } -systemctl() { grc systemctl $@ } -stat() { grc stat $@ } -showmount() { grc showmount $@ } -tune2fs() { grc tune2fs $@ } -tcpdum() { grc tcpdum $@ } diff --git a/home/.config/zsh/02-plugins.zsh b/home/.config/zsh/03-plugins.zsh similarity index 58% rename from home/.config/zsh/02-plugins.zsh rename to home/.config/zsh/03-plugins.zsh index 94efc2a9..1712bf54 100644 --- a/home/.config/zsh/02-plugins.zsh +++ b/home/.config/zsh/03-plugins.zsh @@ -1,7 +1,7 @@ # install zinit if it's not already installed if [ ! -f ~/.zinit/bin/zinit.zsh ]; then - mkdir ~/.zinit - git clone https://github.com/zdharma/zinit.git ~/.zinit/bin + mkdir ~/.zinit + git clone https://github.com/zdharma-continuum/zinit.git ~/.zinit/bin fi source ~/.zinit/bin/zinit.zsh @@ -19,7 +19,7 @@ zinit ice lucid zinit light zsh-users/zsh-history-substring-search # fzf git awesomeness -zinit ice wait'1' lucid atload'source $HOME/.config/zsh/03-aliases.zsh' +zinit ice wait'1' lucid atload'source $HOME/.config/zsh/04-aliases.zsh' zinit light wfxr/forgit # lots of completions @@ -30,18 +30,13 @@ zinit light zsh-users/zsh-completions zinit ice wait'1' lucid as'completion' zinit snippet https://gist.githubusercontent.com/RPigott/a3efdc08fa4d5fd7df38d091ab5e8532/raw/867ac1884d97d1bd1e5d4037d4eefdf4a004e72b/_swaymsg -# dotdrop completion -zinit ice wait'1' lucid as'completion' -zinit snippet '$DOTREPO/dotdrop/completion/_dotdrop-completion.zsh' - -# docker-compose completion -zinit ice wait'1' lucid as'completion' -zinit snippet https://raw.githubusercontent.com/docker/compose/master/contrib/completion/zsh/_docker-compose - # syntax highlighting zinit ice lucid atinit'zpcompinit' -zinit light zdharma/fast-syntax-highlighting +zinit light zdharma-continuum/fast-syntax-highlighting # use fzf with zsh -source /usr/share/fzf/key-bindings.zsh -source /usr/share/fzf/completion.zsh +source <(fzf --zsh) + +# Generate completions at runtime +zinit ice wait'2' lucid +zinit light RobSis/zsh-completion-generator diff --git a/home/.config/zsh/04-aliases.zsh b/home/.config/zsh/04-aliases.zsh new file mode 100644 index 00000000..427e8a3d --- /dev/null +++ b/home/.config/zsh/04-aliases.zsh @@ -0,0 +1,408 @@ +# Fix sudo and doas not expanding aliases +# see: https://unix.stackexchange.com/questions/148545/why-does-sudo-ignore-aliases +alias sudo='sudo ' +alias doas='doas ' + +# git shorthands +alias gc='git commit' +alias gac='ga && gc' +alias gs='git status' +alias gpull='git pull' +alias gpush='git push' + +alias o='xdg-open' + +# Open nvim with diffview +# Handy plugin for viewing git diffs +# and handling merges +alias dv='nvim +DiffviewOpen' + +# Rename grc alias from forgit since it +# collides with the grc colorizer +forgit_revert_commit=fgrc + +# Modern replacement for ls +alias ls='eza --icons --git' + +# Enable command not found handler +{%@@ if distro_id == "arch" @@%} +source /usr/share/doc/pkgfile/command-not-found.zsh +{%@@ elif distro_id == "ubuntu" @@%} +source /etc/zsh_command_not_found +{%@@ elif distro_id == "termux" @@%} +function command_not_found_handler { + $PREFIX/libexec/termux/command-not-found $1 +} +{%@@ endif @@%} + +# search and install/remove packages with fzf +pi() { + {%@@ if distro_id == "arch" @@%} + SELECTED_PKGS="$(paru -Slq | fzf --header='Install packages' -m --preview 'paru -Si {1}' | tr '\n' ' ')" + {%@@ else @@%} + SELECTED_PKGS="$(apt list 2>/dev/null | cut -d '/' -f 1 | tail +2 | fzf --header='Install packages' -m --preview 'apt show 2>/dev/null {1}' | tr '\n' ' ')" + {%@@ endif @@%} + if [ -n "$SELECTED_PKGS" ]; then + {%@@ if distro_id == "arch" @@%} + cmd="paru -S $SELECTED_PKGS" + {%@@ elif distro_id == "ubuntu" or distro_id == "debian" @@%} + cmd="doas apt install $SELECTED_PKGS" + {%@@ elif distro_id == "termux" @@%} + cmd="apt install $SELECTED_PKGS" + {%@@ endif @@%} + + # Append the expanded command to history + print -s "$cmd" + + # Finally, excecute the command + eval "$cmd" + fi +} + +mkcd() { + mkdir -p $1 + cd $1 +} + +pr() { + {%@@ if distro_id == "arch" @@%} + SELECTED_PKGS="$(paru -Qsq | fzf --header='Remove packages' -m --preview 'paru -Qi {1}' | tr '\n' ' ')" + {%@@ else @@%} + SELECTED_PKGS="$(apt list --installed 2>/dev/null | cut -d '/' -f 1 | tail +2 | fzf --header='Remove packages' -m --preview 'apt show 2>/dev/null {1}' | tr '\n' ' ')" + {%@@ endif @@%} + if [ -n "$SELECTED_PKGS" ]; then + {%@@ if distro_id == "arch" @@%} + cmd="paru -Rns $SELECTED_PKGS" + {%@@ elif distro_id == "ubuntu" or distro_id == "debian" @@%} + cmd="doas apt remove $SELECTED_PKGS" + {%@@ elif distro_id == "termux" @@%} + cmd="apt remove $SELECTED_PKGS" + {%@@ endif @@%} + + # Append the expanded command to history + print -s "$cmd" + + # Finally, excecute the command + eval "$cmd" + fi +} + +{%@@ if profile == "Moria" @@%} +# Add packages to repo with fzf +ra() { + SELECTED_PKGS="$(paru -Slqa | fzf --header='Add packages to repo' -m --preview 'paru -Si {1}' | tr '\n' ' ')" + if [ -n "$SELECTED_PKGS" ]; then + cmd="aur sync -S $SELECTED_PKGS" + + # Append the expanded command to history + print -s "$cmd" + + # Finally, excecute the command + eval "$cmd" + fi +} +{%@@ endif @@%} + +{%@@ if distro_id == "termux" @@%} +alias gp='okc-gpg' +{%@@ endif @@%} + +# find and open man pages with fzf +fman() { + man -k . | fzf --prompt='Man> ' | awk '{print $1}' | xargs -r man +} + +alias :q='cowsay "You are not in vim anymore"' + +alias reboot-kodi='systemctl reboot --boot-loader-entry=kodi.conf' + +# zbar output only data +alias zbarimg='zbarimg -q --raw' +alias zbarcam='zbarcam -q --raw' + +# shorten systemctl and journalctl +alias sc='systemctl' +alias scu='systemctl --user' +alias jc='journalctl' +alias jcu='journalctl --user' + +# switch to desktop mode +alias dock='swaymsg output eDP-1 disable' + +{%@@ if distro_id != "termux" @@%} +# move to trash instead of remove +alias rm='trash' +{%@@ endif @@%} + +# clean stuff +clean() { + DFCMD="df -h / | tail -n 1 | cut -d' ' -f8- | cut -d' ' -f1 | sed 's/[^0-9]*//g'" + SPACEBEFORE=$(eval "$DFCMD") + trash-empty 10 + doas journalctl --vacuum-size=500M + paru -Sc + SPACEAFTER=$(eval "$DFCMD") + echo "Saved $(calc $SPACEAFTER - $SPACEBEFORE)G of space" +} + +# connect to wireguard +alias startvpn='doas systemctl start wg-quick@wg0.service' +alias stopvpn='doas systemctl stop wg-quick@wg0.service' + +# read qrcode from selection +qr() { + gdbus call --session --dest org.gnome.Shell --object-path /org/gnome/Shell --method org.gnome.Shell.Eval 'Main.screenshotUI.open();' 2>&1 > /dev/null && wl-paste | zbarimg -q --raw PNG:- +} + +# generate qr code in terminal +alias qrencode='qrencode -t ansiutf8' + +# color picker +cpick() { grim -g "$(slurp -p)" -t ppm - | convert - -format "%[pixel:p{0,0}]" txt:- } + +#iwctl aliases +alias i='iwctl station wlan0' + +# monitor cpu freq +cpufreq() { watch -n 1 eval "cat /proc/cpuinfo | grep MHz" } + +# dotdrop +alias dotdrop="source $DOTREPO/secrets/secrets && {%@@ if distro_id != "termux" @@%} UID=$(id -u) {%@@ endif @@%} dotdrop --cfg=$DOTREPO/config.toml {%@@ if profile == "Isengard" @@%} -p Isengard{%@@ endif @@%}" + + +alias sdotdrop="source $DOTREPO/secrets/secrets && sudo -E dotdrop --cfg=$DOTREPO/config-root.toml" +compdef _dotdrop-completion.zsh sdotdrop + +updatesecrets() { + bash $DOTREPO/secrets/secrets.sh + chmod 600 $DOTREPO/secrets/secrets +} + +alias dotgit='git -C $DOTREPO' +dotsync() { cd $DOTREPO && gac && gpull && gpush && cd $OLDPWD } + +# sync password manager +passync() { pass git pull && pass git push && updatesecrets } + +update() { + all() { + dotfiles + packages + {%@@ if profile == "Moria" @@%} + repo + docker-update + {%@@ endif @@%} + plugins + } + + packages() { + {%@@ if distro_id == "arch" @@%} + paru -Syu --noconfirm + {%@@ elif distro_id == "ubuntu" or distro_id == "debian" @@%} + doas apt update && doas apt full-upgrade -y && doas apt autoremove -y && doas apt autoclean -y + {%@@ elif distro_id == "termux" @@%} + pkg update && pkg upgrade --yes + {%@@ endif @@%} + {%@@ if distro_id == "termux" @@%} + pip-update-installed + cargo-update-installed + {%@@ endif @@%} + } + + plugins() { + echo "Updating NeoVim plugins to match lockfiles" + nvim --headless -c "Lazy! restore" -c 'TSUpdateSync' -c 'MasonLockRestore' -c 'qa' + echo "Updating zsh plugins" + zinit self-update + zinit update -p + } + + pip-update-installed() { + pip install --upgrade $(pip list --outdated | tail -n +3 | awk '{print $1}') + } + + cargo-update-installed() { + cargo install-update -a + } + + {%@@ if profile == "Moria" @@%} + repo() { + aur sync -Su --margs --noconfirm + } + + local docker-update() { + prevpwddocker=$PWD + for dir in $HOME/git/dotfiles/docker/*/; do + cd $dir + if [[ -f ./DISABLED ]]; then + echo "$(basename $dir) stack is disabled, skipping..." + else + docker compose pull + docker compose up -d + fi + cd .. + done + cd $prevpwddocker + docker system prune -af --volumes + + occ upgrade + occ app:update --all + occ db:add-missing-indices + } + {%@@ endif @@%} + + dotfiles() { + dotgit pull + dotdrop install + } + + if [ $# -eq 0 ]; then + packages # Update only packages if no option was provided + else + case "$1" in + all) + all + ;; + dotfiles) + dotfiles + ;; + plugins) + plugins + ;; + {%@@ if profile == "Moria" @@%} + docker) + docker-update + ;; + repo) + repo + ;; + {%@@ endif @@%} + *) + echo "Unknown option: $1" + return 1 + ;; + esac + fi +} + +_update() { + local commands=( + "all:Update everything" + "dotfiles:Update dotfiles" + "plugins:Update plugins for NeoVim and ZSH" + {%@@ if profile == "Moria" @@%} + "repo:Update packages in Korhonen AUR repository" + "docker:Update all Docker containers" + {%@@ endif @@%} + ) + + _arguments \ + '1: :->command' \ + '*:: :->args' + + case "$state" in + (command) + _describe -t commands 'available commands' commands + ;; + esac +} +compdef _update update + +# turn on usb tethering on my android phone +tether() { adb shell su -c "service call connectivity 33 i32 1 s16 me" > /dev/null } + +# update arch mirrorlist +alias reflect='doas reflector --latest 200 --threads 8 --verbose --protocol http --protocol https --sort rate --save /etc/pacman.d/mirrorlist' + +# default icon for notify-send +alias notify-send='notify-send --icon=alarm' + +# download archiso +alias archiso='curl "http://mirror.rackspace.com/archlinux/iso/$(date +%Y.%m).01/archlinux-$(date +%Y.%m).01-x86_64.iso"' + +# encrypted tar's with zstd compression +cgpgtar() { tar cf - --zstd $1 | gpg -e -z 0 > $1.tar.zst.gpg } +xgpgtar() { gpg -d $1 | tar x --zstd } + +# Switch to different yubikey +alias switch-yubikey='gpg-connect-agent "scd serialno" "learn --force" /bye' + +btw, () { + echo " I use" + echo " ▄ + ▟█▙ + ▟███▙ + ▟█████▙ + ▟███████▙ + ▂▔▀▜██████▙ + ▟██▅▂▝▜█████▙ + ▟█████████████▙ + ▟███████████████▙ + ▟█████████████████▙ + ▟███████████████████▙ + ▟█████████▛▀▀▜████████▙ + ▟████████▛ ▜███████▙ + ▟█████████ ████████▙ + ▟██████████ █████▆▅▄▃▂ + ▟██████████▛ ▜█████████▙ + ▟██████▀▀▀ ▀▀██████▙ + ▟███▀▘ ▝▀███▙ + ▟▛▀ ▀▜▙" +} + +# docker-compose with TOML +# dct() { +# local file_path=('./docker-compose.toml') +# +# zmodload zsh/zutil +# zparseopts -D -K -- \ +# f:=file_path || +# return 1 +# +# file_path=${file_path[-1]} +# +# if [[ ! -a "$file_path" ]]; then +# echo "File $file_path does not exist!" +# return 1 +# fi +# +# yj -ty < $file_path | docker compose -f /dev/stdin --env-file ./.env $@ +# } + +alias dslr-webcam='pkill -f gphoto2; gphoto2 --stdout --capture-movie | ffmpeg -i - -vcodec rawvideo -pix_fmt yuv420p -threads 0 -f v4l2 /dev/video0' + +clock() { + while true; do + printf '%s\r' "$(date)" + sleep 0.1 + done +} + +# Change file extension made easy +chext() { + file="$1" + new_ext="$2" + dest="${file%.*}.$new_ext" + + help() { + printf "Change file extension\nUsage: chext file new_extension\nFor example: chext my_script.sh zsh" + } + + if [ "$1" = "-h" ] || [ "$1" = "--help" ]; then + help + return + fi + + if [ $# -lt 2 ]; then + help + return 1 + fi + + if [ ! -e "$1" ]; then + echo "$file: no such file or directory" + help + return 1 + fi + + mv "$file" "$dest" +} diff --git a/home/.config/zsh/05-misc.zsh b/home/.config/zsh/05-misc.zsh deleted file mode 100644 index 10ddf01d..00000000 --- a/home/.config/zsh/05-misc.zsh +++ /dev/null @@ -1,10 +0,0 @@ -# Launch tmux if logging in over ssh -if [[ -z "$TMUX" ]] && [ "$SSH_CONNECTION" != "" ]; then - tmux attach-session -t ssh_tmux || tmux new-session -s ssh_tmux -fi - -# share history between running zsh instances -setopt share_history - -# ignore commands with leading space from history -setopt histignorespace diff --git a/home/.config/zsh/04-keybinds.zsh b/home/.config/zsh/06-keybinds.zsh similarity index 95% rename from home/.config/zsh/04-keybinds.zsh rename to home/.config/zsh/06-keybinds.zsh index 7f0c95d2..bea3d85a 100644 --- a/home/.config/zsh/04-keybinds.zsh +++ b/home/.config/zsh/06-keybinds.zsh @@ -44,3 +44,7 @@ bindkey -M vicmd e edit-command-line # bind delete in normal mode bindkey -M vicmd '^[[3~' delete-char + +# Rebind fzf to ctrl+f +bindkey '^F' fzf-file-widget +bindkey '^T' transpose-chars diff --git a/home/.config/zsh/06-pacman.zsh b/home/.config/zsh/06-pacman.zsh deleted file mode 100644 index 56ebbcea..00000000 --- a/home/.config/zsh/06-pacman.zsh +++ /dev/null @@ -1,6 +0,0 @@ -# from https://wiki.archlinux.org/index.php/Zsh#On-demand_rehash -catch_signal_usr1() { - trap catch_signal_usr1 USR1 - rehash -} -trap catch_signal_usr1 USR1 diff --git a/home/.config/zsh/07-misc.zsh b/home/.config/zsh/07-misc.zsh new file mode 100644 index 00000000..7f84ba4d --- /dev/null +++ b/home/.config/zsh/07-misc.zsh @@ -0,0 +1,5 @@ +# share history between running zsh instances +setopt share_history + +# ignore commands with leading space from history +setopt histignorespace diff --git a/home/.config/zsh/08-pacman.zsh b/home/.config/zsh/08-pacman.zsh new file mode 100644 index 00000000..72077edd --- /dev/null +++ b/home/.config/zsh/08-pacman.zsh @@ -0,0 +1,17 @@ +# from https://wiki.archlinux.org/index.php/Zsh#On-demand_rehash + +zshcache_time="$(date +%s%N)" + +autoload -Uz add-zsh-hook + +rehash_precmd() { + if [[ -e /var/cache/zsh/pacman ]]; then + local paccache_time="$(date -r /var/cache/zsh/pacman +%s%N)" + if ((zshcache_time < paccache_time)); then + rehash + zshcache_time="$paccache_time" + fi + fi +} + +add-zsh-hook -Uz precmd rehash_precmd diff --git a/home/.docker/config.json b/home/.docker/config.json new file mode 100644 index 00000000..113ba69f --- /dev/null +++ b/home/.docker/config.json @@ -0,0 +1,3 @@ +{ + "credsStore": "pass" +} diff --git a/home/.gitconfig b/home/.gitconfig deleted file mode 100644 index 423e9f15..00000000 --- a/home/.gitconfig +++ /dev/null @@ -1,25 +0,0 @@ -[user] - email = marko.korhonen@reekynet.com - name = Marko Korhonen - signingkey = C514037F1EFF4FA6 - -[commit] - signoff = true - gpgsign = true -[tag] - gpgSign = true - signoff = true -[format] - signoff = true - -[merge] - prompt = false - tool = nvim-merge -[mergetool "nvim-merge"] - cmd = nvim -d $LOCAL $REMOTE $MERGED -c '$wincmd w' -c 'wincmd J' - -[diff] - prompt = false - tool = nvim-diff -[difftool "nvim-diff"] - cmd = nvim -d -c 'set nomodifiable' diff --git a/home/.gnupg/gpg-agent.conf b/home/.gnupg/gpg-agent.conf new file mode 100644 index 00000000..9e025a01 --- /dev/null +++ b/home/.gnupg/gpg-agent.conf @@ -0,0 +1,2 @@ +enable-ssh-support +pinentry-program /usr/bin/pinentry-gnome3 diff --git a/home/.gnupg/gpg.conf b/home/.gnupg/gpg.conf index 50a0191b..0a9596e7 100644 --- a/home/.gnupg/gpg.conf +++ b/home/.gnupg/gpg.conf @@ -1,17 +1,2 @@ -# File re-created by pEp -# See backup in '/home/reekymarko/.gnupg/gpg.conf.1.pep.bkp' - -# File re-created by pEp -# See backup in '/home/reekymarko/.gnupg/gpg.conf.0.pep.bkp' - -# GnuPG config file created by KGpg - -default-key A90767494C36DEC2EBBCFB8E83850D9D26A2216C -keyserver hkp://keys.gnupg.net -cert-digest-algo SHA256 -no-emit-version -no-comments -personal-cipher-preferences AES AES256 AES192 CAST5 -personal-digest-preferences SHA256 SHA512 SHA384 SHA224 -ignore-time-conflict -allow-freeform-uid +use-agent +keyserver hkps://keys.openpgp.org diff --git a/home/.gnupg/scdaemon.conf b/home/.gnupg/scdaemon.conf new file mode 100644 index 00000000..eb818ddf --- /dev/null +++ b/home/.gnupg/scdaemon.conf @@ -0,0 +1 @@ +disable-ccid diff --git a/home/.ignore b/home/.ignore index 8ee79ae6..d1402308 100644 --- a/home/.ignore +++ b/home/.ignore @@ -7,6 +7,16 @@ .cache/ .cargo/ .rustup/ -.zplugin/ +.go/ +.zinit/ .config/nvim/plugged/ .local/share/Trash/ +.bin/ +.AndroidStudio*/ +.android/ +.audacity-data/ +.zcompdump* +.var/ +.npm/ +.vscode-oss/ +.git/ diff --git a/home/.librewolf/librewolf.overrides.cfg b/home/.librewolf/librewolf.overrides.cfg new file mode 100644 index 00000000..b05aac1e --- /dev/null +++ b/home/.librewolf/librewolf.overrides.cfg @@ -0,0 +1,48 @@ +// vim:ft=javascript + +// Enable Google safe browsing +pref("browser.safebrowsing.malware.enabled", true); +pref("browser.safebrowsing.phishing.enabled", true); +pref("browser.safebrowsing.blockedURIs.enabled", true); +pref( + "browser.safebrowsing.provider.google4.gethashURL", + "https://safebrowsing.googleapis.com/v4/fullHashes:find?$ct=application/x-protobuf&key=%GOOGLE_SAFEBROWSING_API_KEY%&$httpMethod=POST" +); +pref( + "browser.safebrowsing.provider.google4.updateURL", + "https://safebrowsing.googleapis.com/v4/threatListUpdates:fetch?$ct=application/x-protobuf&key=%GOOGLE_SAFEBROWSING_API_KEY%&$httpMethod=POST" +); +pref( + "browser.safebrowsing.provider.google.gethashURL", + "https://safebrowsing.google.com/safebrowsing/gethash?client=SAFEBROWSING_ID&appver=%MAJOR_VERSION%&pver=2.2" +); +pref( + "browser.safebrowsing.provider.google.updateURL", + "https://safebrowsing.google.com/safebrowsing/downloads?client=SAFEBROWSING_ID&appver=%MAJOR_VERSION%&pver=2.2&key=%GOOGLE_SAFEBROWSING_API_KEY%" +); + +// Disable letterboxing +pref("privacy.resistFingerprinting.letterboxing", false); + +/* +* Disable RFP because I want automatic dark mode on websites +* that support it +*/ +pref("privacy.resistFingerprinting", false); + +pref("privacy.resistFingerprinting.autoDeclineNoUserInputCanvasPrompts", false); + +// Scan downloads for suspicious files +pref("browser.safebrowsing.downloads.enabled", true); + +// Disable WebGL +pref("webgl.disabled", false); + +// Enable Firefox Sync +pref("identity.fxaccounts.enabled", true); + +// Don't clear browsing history on shutdown +pref("privacy.clearOnShutdown.history", false); + +// Clear download history on shutdown +pref("privacy.clearOnShutdown.downloads", true); diff --git a/home/.mbsyncrc b/home/.mbsyncrc index 5f83b782..d16d2f42 100644 --- a/home/.mbsyncrc +++ b/home/.mbsyncrc @@ -1,99 +1,73 @@ -### reekymarko@reekynet.com ##################################### -IMAPAccount reekymarko@reekynet.com +### functionalhacker@korhonen.cc ##################################### +IMAPAccount functionalhacker@korhonen.cc Host imap.migadu.com -User reekymarko@reekynet.com -PassCmd "pass email/reekymarko@reekynet.com | head -n 1" +User functionalhacker@korhonen.cc +Pass "{{@@ env['PASS_EMAIL_HACKER'] @@}}" SSLType IMAPS Port 993 CertificateFile /etc/ssl/certs/ca-certificates.crt -IMAPStore reekymarko@reekynet.com-remote -Account reekymarko@reekynet.com +IMAPStore functionalhacker@korhonen.cc-remote +Account functionalhacker@korhonen.cc -MaildirStore reekymarko@reekynet.com-local +MaildirStore functionalhacker@korhonen.cc-local Subfolders Verbatim -Path ~/.mail/reekymarko@reekynet.com/ -Inbox ~/.mail/reekymarko@reekynet.com/INBOX +Path ~/.mail/functionalhacker@korhonen.cc/ +Inbox ~/.mail/functionalhacker@korhonen.cc/INBOX -Channel reekymarko@reekynet.com -Master :reekymarko@reekynet.com-remote: -Slave :reekymarko@reekynet.com-local: +Channel functionalhacker@korhonen.cc +Master :functionalhacker@korhonen.cc-remote: +Slave :functionalhacker@korhonen.cc-local: Create Both Patterns * SyncState * ################################################################# -### marko.korhonen@reekynet.com ##################################### -IMAPAccount marko.korhonen@reekynet.com +### marko@korhonen.cc ##################################### +IMAPAccount marko@korhonen.cc Host imap.migadu.com -User marko.korhonen@reekynet.com -PassCmd "pass email/marko.korhonen@reekynet.com | head -n 1" +User marko@korhonen.cc +Pass "{{@@ env['PASS_EMAIL_MARKO'] @@}}" SSLType IMAPS Port 993 CertificateFile /etc/ssl/certs/ca-certificates.crt -IMAPStore marko.korhonen@reekynet.com-remote -Account marko.korhonen@reekynet.com +IMAPStore marko@korhonen.cc-remote +Account marko@korhonen.cc -MaildirStore marko.korhonen@reekynet.com-local +MaildirStore marko@korhonen.cc-local Subfolders Verbatim -Path ~/.mail/marko.korhonen@reekynet.com/ -Inbox ~/.mail/marko.korhonen@reekynet.com/INBOX +Path ~/.mail/marko@korhonen.cc/ +Inbox ~/.mail/marko@korhonen.cc/INBOX -Channel marko.korhonen@reekynet.com -Master :marko.korhonen@reekynet.com-remote: -Slave :marko.korhonen@reekynet.com-local: +Channel marko@korhonen.cc +Master :marko@korhonen.cc-remote: +Slave :marko@korhonen.cc-local: Create Both Patterns * SyncState * ################################################################# - -### admin@reekynet.com ##################################### -IMAPAccount admin@reekynet.com +### admin@korhonen.cc ##################################### +IMAPAccount admin@korhonen.cc Host imap.migadu.com -User admin@reekynet.com -PassCmd "pass email/admin@reekynet.com | head -n 1" +User admin@korhonen.cc +Pass "{{@@ env['PASS_EMAIL_ADMIN'] @@}}" SSLType IMAPS Port 993 CertificateFile /etc/ssl/certs/ca-certificates.crt -IMAPStore admin@reekynet.com-remote -Account admin@reekynet.com +IMAPStore admin@korhonen.cc-remote +Account admin@korhonen.cc -MaildirStore admin@reekynet.com-local +MaildirStore admin@korhonen.cc-local Subfolders Verbatim -Path ~/.mail/admin@reekynet.com/ -Inbox ~/.mail/admin@reekynet.com/INBOX +Path ~/.mail/admin@korhonen.cc/ +Inbox ~/.mail/admin@korhonen.cc/INBOX -Channel admin@reekynet.com -Master :admin@reekynet.com-remote: -Slave :admin@reekynet.com-local: -Create Both -Patterns * -SyncState * -################################################################# - -### marko.korhonen@metropolia.fi ##################################### -IMAPAccount marko.korhonen@metropolia.fi -Host imap.metropolia.fi -User markoak -PassCmd "pass email/marko.korhonen@metropolia.fi | head -n 1" -SSLType IMAPS -Port 993 -CertificateFile /etc/ssl/certs/ca-certificates.crt - -IMAPStore marko.korhonen@metropolia.fi-remote -Account marko.korhonen@metropolia.fi - -MaildirStore marko.korhonen@metropolia.fi-local -Subfolders Verbatim -Path ~/.mail/marko.korhonen@metropolia.fi/ -Inbox ~/.mail/marko.korhonen@metropolia.fi/INBOX - -Channel marko.korhonen@metropolia.fi -Master :marko.korhonen@metropolia.fi-remote: -Slave :marko.korhonen@metropolia.fi-local: +Channel admin@korhonen.cc +Master :admin@korhonen.cc-remote: +Slave :admin@korhonen.cc-local: Create Both Patterns * SyncState * diff --git a/home/.msmtprc b/home/.msmtprc deleted file mode 100644 index 79c5ce7a..00000000 --- a/home/.msmtprc +++ /dev/null @@ -1,38 +0,0 @@ -defaults -auth on -logfile ~/.msmtp.log -tls on -tls_trust_file /etc/ssl/certs/ca-certificates.crt - -# reekymarko@reekynet.com -account reekymarko@reekynet.com -host smtp.migadu.com -port 587 -from reekymarko@reekynet.com -user reekymarko@reekynet.com -passwordeval "pass email/reekymarko@reekynet.com | head -n 1" - -# marko.korhonen@reekynet.com -account marko.korhonen@reekynet.com -host smtp.migadu.com -port 587 -from marko.korhonen@reekynet.com -user marko.korhonen@reekynet.com -passwordeval "pass email/marko.korhonen@reekynet.com | head -n 1" - - -# admin@reekynet.com -account admin@reekynet.com -host smtp.migadu.com -port 587 -from admin@reekynet.com -user admin@reekynet.com -passwordeval "pass email/admin@reekynet.com | head -n 1" - -# marko.korhonen@metropolia.fi -account marko.korhonen@metropolia.fi -host smtp.metropolia.fi -port 587 -from marko.korhonen@metropolia.fi -user markoak -passwordeval "pass email/marko.korhonen@metropolia.fi | head -n 1" diff --git a/home/.newsboat/urls b/home/.newsboat/urls index 713ee5b1..e4ef2427 100644 --- a/home/.newsboat/urls +++ b/home/.newsboat/urls @@ -1,6 +1,4 @@ -https://www.mindfactory.de/xml/rss/mindstar_artikel.xml https://github.com/TeamNewPipe/NewPipe/releases.atom "Git" -https://github.com/overdodactyl/ShadowFox/releases.atom "Git" https://github.com/home-assistant/home-assistant/releases.atom "Git" https://github.com/zeapo/Android-Password-Store/releases.atom "Git" https://github.com/ccrama/Slide/releases.atom "Git" diff --git a/home/.npmrc b/home/.npmrc new file mode 100644 index 00000000..256f89fc --- /dev/null +++ b/home/.npmrc @@ -0,0 +1 @@ +prefix=~/.local/share/npm diff --git a/home/.pam_environment b/home/.pam_environment new file mode 100644 index 00000000..b55fba74 --- /dev/null +++ b/home/.pam_environment @@ -0,0 +1,2 @@ +SSH_AGENT_PID DEFAULT= +SSH_AUTH_SOCK DEFAULT="${XDG_RUNTIME_DIR}/gnupg/S.gpg-agent.ssh" diff --git a/home/.ssh/authorized_keys b/home/.ssh/authorized_keys index 17e74ec1..9bd02835 100644 --- a/home/.ssh/authorized_keys +++ b/home/.ssh/authorized_keys @@ -1 +1 @@ -ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDPIoTVXJ2gljf+Tpk7GdwAihhAlnyoblOWYiwFenKeomcYizLt8arEXNT+1Hr+jit7+Fg2Izv31ovo9M1ePyhzuO1jcuCOZkIPvcaN0c6XIH83ZiA04Ysd/HIGv1r7tDTxNnXeKfl55tWpd+F2A0BF3D3dIDBqDfX2Z2odXIjKXHoFBgETATl45bm0txpjTjbpjIiPbaRHg6+lcSnWm3f5p8lCzXs5MIGCdXcBxMhVVxszAI3CD/cEBmnweCam1Ji3J1qYna4BOrIyW5Z3HzS6vAkajxZd2wPU47gpoc3/2sXBwJeE/iOACECC+34rYqadZThprihpYc7D8gIDr7IDN16rvFfEcxE8SFvsPmM1Qbo7uH/F2TFF6mb0FzGQuTcdR4bqcms5jMsgqPGfEs6Rd1pkOXTcxwKOtbH27VYhSs/ow5TEbVHrbLwTU35ohIfZRqlKbrMv3CGgTNzj9MlN339x6G3//lnKR36i/W+Z4FPjT/KayhwbsNR1B5Mfdlr7tbmvFcI2KxvyD7Rr5XuouVTx98s3nlc2MJpII/Q/oX2tWPnYAK/myJC7ucY7G4Y/3uoCv2GYTi2flpEFJITSDPqzwrX19yYK2ooYyvg40Cd2mt4xu9sj4SyEMUu98CIfECT7dsaKVPfcjQqaRZb2Spr4tPfMrcUZYiZgJBPxWQ== cardno:000610127408 +ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHLUrf0LpumX6XEkPW6Z105sgJMWWOllWy7sxB+lgdUw Marko YubiKey diff --git a/home/.ssh/config b/home/.ssh/config index 47217b82..5ffe1d8c 100644 --- a/home/.ssh/config +++ b/home/.ssh/config @@ -1,41 +1,94 @@ -host gitea - HostName git.reekynet.com - user gitea +Include ~/.ssh/netforecast_hosts -host gitlab - HostName gitlab.com - User git +host * + IdentitiesOnly yes + IdentityFile ~/.ssh/id_ed25519_yubikey.pub + #ControlMaster auto + #ControlPersist 10m + #ControlPath ~/.ssh/%r@%h:%p.socket -host github - HostName github.com - User git +host moria + HostName home.korhonen.cc + port 221 + User functionalhacker + {%@@ if distro_id != "termux" @@%} + # Forward GPG agent + StreamLocalBindUnlink yes + RemoteForward /run/user/1000/gnupg/S.gpg-agent /run/user/{{@@ env['UID'] @@}}/gnupg/S.gpg-agent.extra + RemoteForward /run/user/1000/gnupg/S.gpg-agent.ssh /run/user/{{@@ env['UID'] @@}}/gnupg/S.gpg-agent.ssh + {%@@ endif @@%} -host bitbucket - HostName bitbucket.org - User git +host evendim + HostName evendim.korhonen.cc + port 22 + User functionalhacker + {%@@ if distro_id != "termux" @@%} + # Forward GPG agent + StreamLocalBindUnlink yes + RemoteForward /run/user/1000/gnupg/S.gpg-agent /run/user/{{@@ env['UID'] @@}}/gnupg/S.gpg-agent.extra + RemoteForward /run/user/1000/gnupg/S.gpg-agent.ssh /run/user/{{@@ env['UID'] @@}}/gnupg/S.gpg-agent.ssh + {%@@ endif @@%} -Host aur - HostName aur.archlinux.org - User aur +host beleriand + HostName beleriand.korhonen.lan + User root + +host esgaroth + HostName esgaroth.korhonen.lan + User root host rivendell - HostName reekynet.com - port 22 - User gimli - ForwardAgent yes + HostName rivendell.korhonen.lan + User root -host mirkwood - HostName reekynet.com - port 8123 - User reekymarko +host forgejo + HostName git.korhonen.cc + port 2882 + user git + +host gitlab + HostName gitlab.com + User git + +host github + HostName github.com + User git + +host bitbucket + HostName bitbucket.org + User git + +Host aur + HostName aur.archlinux.org + User aur + +host moria-unlock + HostName home.korhonen.cc + port 221 + User root + +host gondor + hostname tolkku.net + port 22 + User reekymarko + {%@@ if distro_id != "termux" @@%} + # Forward GPG agent + StreamLocalBindUnlink yes + RemoteForward /run/user/1000/gnupg/S.gpg-agent /run/user/{{@@ env['UID'] @@}}/gnupg/S.gpg-agent.extra + RemoteForward /run/user/1000/gnupg/S.gpg-agent.ssh /run/user/{{@@ env['UID'] @@}}/gnupg/S.gpg-agent.ssh + {%@@ endif @@%} host anitta - HostName 10.200.200.4 - port 22 - user reekymarko - ForwardAgent yes + HostName 10.200.200.4 + port 22 + user reekymarko host takamaki - HostName 10.200.200.5 - port 22 - user reekymarko + HostName 10.200.200.5 + port 22 + user reekymarko + +host viirujateippi + HostName viirujateippi.fi + port 22 + user functionalhacker diff --git a/home/.ssh/id_ed25519_yubikey.pub b/home/.ssh/id_ed25519_yubikey.pub new file mode 100644 index 00000000..9bd02835 --- /dev/null +++ b/home/.ssh/id_ed25519_yubikey.pub @@ -0,0 +1 @@ +ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHLUrf0LpumX6XEkPW6Z105sgJMWWOllWy7sxB+lgdUw Marko YubiKey diff --git a/home/.tmux.conf b/home/.tmux.conf index 58b4a55a..585da95a 100644 --- a/home/.tmux.conf +++ b/home/.tmux.conf @@ -1,3 +1,6 @@ +# set shell +set -g default-shell /bin/zsh + # Change prefix to ctrl+a unbind C-b set -g prefix C-a @@ -12,3 +15,6 @@ set-option -ga terminal-overrides ",*256col*:Tc" # Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf) run -b '~/.tmux/plugins/tpm/tpm' + +# Enable mouse +set -g mouse on diff --git a/home/.zprofile b/home/.zprofile index c7215bd7..e69de29b 100644 --- a/home/.zprofile +++ b/home/.zprofile @@ -1 +0,0 @@ -[[ -z $DISPLAY && $XDG_VTNR -eq 1 ]] && sway > /dev/null 2>&1 diff --git a/home/Scripts/autorotate.sh b/home/Scripts/autorotate.sh deleted file mode 100755 index 97cb94b8..00000000 --- a/home/Scripts/autorotate.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash -function rotate_ms { - case $1 in - "normal") - swaymsg output eDP-1 transform 0 - ;; - "right-up") - swaymsg output eDP-1 transform 90 - ;; - "bottom-up") - swaymsg output eDP-1 transform 180 - ;; - "left-up") - swaymsg output eDP-1 transform 270 - ;; - esac -} - -while IFS='$\n' read -r line; do - rotation="$(echo $line | sed -En "s/^.*orientation changed: (.*)/\1/p")" - [[ ! -z $rotation ]] && rotate_ms $rotation -done < <(stdbuf -oL monitor-sensor) diff --git a/home/Scripts/check-mail.sh b/home/Scripts/check-mail.sh deleted file mode 100755 index 8afa3967..00000000 --- a/home/Scripts/check-mail.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash -mbsync -a -notmuch new -notifymuch diff --git a/home/Scripts/confgen/termite.conf.gen.sh b/home/Scripts/confgen/termite.conf.gen.sh deleted file mode 100755 index 415d887d..00000000 --- a/home/Scripts/confgen/termite.conf.gen.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/usr/bin/env bash -source ~/.cache/wal/colors.sh -echo "[colors] -foreground = $foreground -background = $background -color0 = $color0 -color1 = $color1 -color2 = $color2 -color3 = $color3 -color4 = $color4 -color5 = $color5 -color6 = $color6 -color7 = $color7 -color8 = $color8 -color9 = $color9 -color10 = $color10 -color11 = $color11 -color12 = $color12 -color13 = $color13 -color14 = $color14 -color15 = $color15 - -[options] -font = Noto Color Emoji 12 -font = Material Design Icons 12 -font = Hack Nerd Font 12" > ~/.config/termite/config diff --git a/home/Scripts/confgen/zathura.conf.gen.sh b/home/Scripts/confgen/zathura.conf.gen.sh deleted file mode 100755 index 68b15848..00000000 --- a/home/Scripts/confgen/zathura.conf.gen.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/sh - -# Generates zathura configuration file with pywal colors - -. $HOME/.cache/wal/colors.sh - -cat < ~/.config/zathura/zathurarc -set completion-bg "$background" -set recolor-darkcolor "$foreground" -set recolor-lightcolor "$background" -set completion-fg "$foreground" -set completion-group-bg "$background" -set completion-group-fg "$color2" -set completion-highlight-bg "$foreground" -set completion-highlight-fg "$background" -set default-bg "$background" -set default-fg "$foreground" -set inputbar-bg "$background" -set inputbar-fg "$foreground" -set notification-bg "$background" -set notification-fg "$foreground" -set notification-error-bg "$color1" -set notification-error-fg "$foreground" -set notification-warning-bg "$color1" -set notification-warning-fg "$foreground" -set statusbar-bg "$background" -set statusbar-fg "$foreground" -set index-bg "$background" -set index-fg "$foreground" -set index-active-bg "$foreground" -set index-active-fg "$background" -set render-loading-bg "$background" -set render-loading-fg "$foreground" - -set smooth-scroll true -set window-title-home-tilde true -set statusbar-basename true -set selection-clipboard clipboard -set recolor false -CONF diff --git a/home/Scripts/fonts.sh b/home/Scripts/fonts.sh deleted file mode 100755 index d15202a7..00000000 --- a/home/Scripts/fonts.sh +++ /dev/null @@ -1,3 +0,0 @@ -sudo ln -s /etc/fonts/conf.avail/70-no-bitmaps.conf /etc/fonts/conf.d -sudo ln -s /etc/fonts/conf.avail/10-sub-pixel-rgb.conf /etc/fonts/conf.d -sudo ln -s /etc/fonts/conf.avail/11-lcdfilter-default.conf /etc/fonts/conf.d diff --git a/home/Scripts/fzf-pass.sh b/home/Scripts/fzf-pass.sh deleted file mode 100755 index 61e512a7..00000000 --- a/home/Scripts/fzf-pass.sh +++ /dev/null @@ -1 +0,0 @@ -Moved to https://git.reekynet.com/ReekyMarko/fzf-pass diff --git a/home/Scripts/fzf-shot.sh b/home/Scripts/fzf-shot.sh deleted file mode 100755 index 66cc94b4..00000000 --- a/home/Scripts/fzf-shot.sh +++ /dev/null @@ -1,64 +0,0 @@ -#!/bin/bash - -TYPE=$(cat < /home/reekymarko/Scripts/suspendcommand -else - echo "won't suspend, external display connected" - echo " " > /home/reekymarko/Scripts/suspendcommand -fi diff --git a/home/Scripts/metadata.sh b/home/Scripts/metadata.sh deleted file mode 100755 index 91689b31..00000000 --- a/home/Scripts/metadata.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash -ARTIST=$(playerctl metadata | grep 'xesam:artist' | cut -d' ' -f5- | sed 's/^[ \t]*//') -TITLE=$(playerctl metadata title) - -if [ -n "$ARTIST" ]; then - echo "$ARTIST - $TITLE" -else - echo "$TITLE" -fi diff --git a/home/Scripts/mpvqueue b/home/Scripts/mpvqueue deleted file mode 100755 index d55fcca7..00000000 --- a/home/Scripts/mpvqueue +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/env bash - -MPVPIPE=/tmp/mpvqueue.playlist - -notify="notify-send -i mpv -a mpv" - -# if link is a youtube playlist, open recursively -if [[ ${1} =~ (^.*(youtu.be\/|list=)([^#\&\?]*).*) ]]; then - $notify "Adding playlist ${@}" - /usr/local/bin/mpvqueue $(youtube-dl -j --flat-playlist "${1}" | jq -r '.id' | sed 's_^_https://youtube.com/watch?v=_') - exit -fi - -# See if MPV is already running -if [ -z "$(pidof mpv)" ]; then - # mpv is not running - # remove fifo - rm -f $MPVPIPE && mkfifo $MPVPIPE - - # start mpv - /usr/bin/mpv --no-terminal --input-file="${MPVPIPE}" "${@}" & disown - - # Wait for mpv to be up before moving on to adding anything else to playlist - while [ -z "$(pidof mpv)" ]; do - sleep 1 - done - $notify "Playing ${@}" - -else - # mpv is running, so add stuff to playlist - $notify "Adding ${@}" - echo "loadfile \"${@}\" append-play" >> "${MPVPIPE}" -fi diff --git a/home/Scripts/open_with_linux.py b/home/Scripts/open_with_linux.py deleted file mode 100755 index fe1dbecf..00000000 --- a/home/Scripts/open_with_linux.py +++ /dev/null @@ -1,184 +0,0 @@ -#!/usr/bin/env python -from __future__ import print_function - -import os -import sys -import json -import struct -import subprocess - -VERSION = '7.1b2' - -try: - sys.stdin.buffer - - # Python 3.x version - # Read a message from stdin and decode it. - def getMessage(): - rawLength = sys.stdin.buffer.read(4) - if len(rawLength) == 0: - sys.exit(0) - messageLength = struct.unpack('@I', rawLength)[0] - message = sys.stdin.buffer.read(messageLength).decode('utf-8') - return json.loads(message) - - # Send an encoded message to stdout - def sendMessage(messageContent): - encodedContent = json.dumps(messageContent).encode('utf-8') - encodedLength = struct.pack('@I', len(encodedContent)) - - sys.stdout.buffer.write(encodedLength) - sys.stdout.buffer.write(encodedContent) - sys.stdout.buffer.flush() - -except AttributeError: - # Python 2.x version (if sys.stdin.buffer is not defined) - # Read a message from stdin and decode it. - def getMessage(): - rawLength = sys.stdin.read(4) - if len(rawLength) == 0: - sys.exit(0) - messageLength = struct.unpack('@I', rawLength)[0] - message = sys.stdin.read(messageLength) - return json.loads(message) - - # Send an encoded message to stdout - def sendMessage(messageContent): - encodedContent = json.dumps(messageContent) - encodedLength = struct.pack('@I', len(encodedContent)) - - sys.stdout.write(encodedLength) - sys.stdout.write(encodedContent) - sys.stdout.flush() - - -def install(): - home_path = os.getenv('HOME') - - manifest = { - 'name': 'open_with', - 'description': 'Open With native host', - 'path': os.path.realpath(__file__), - 'type': 'stdio', - } - locations = { - 'chrome': os.path.join(home_path, '.config', 'google-chrome', 'NativeMessagingHosts'), - 'chromium': os.path.join(home_path, '.config', 'chromium', 'NativeMessagingHosts'), - 'firefox': os.path.join(home_path, '.mozilla', 'native-messaging-hosts'), - } - filename = 'open_with.json' - - for browser, location in locations.items(): - if os.path.exists(os.path.dirname(location)): - if not os.path.exists(location): - os.mkdir(location) - - browser_manifest = manifest.copy() - if browser == 'firefox': - browser_manifest['allowed_extensions'] = ['openwith@darktrojan.net'] - else: - browser_manifest['allowed_origins'] = [ - 'chrome-extension://cogjlncmljjnjpbgppagklanlcbchlno/', # Chrome - 'chrome-extension://fbmcaggceafhobjkhnaakhgfmdaadhhg/', # Opera - ] - - with open(os.path.join(location, filename), 'w') as file: - file.write( - json.dumps(browser_manifest, indent=2, separators=(',', ': '), sort_keys=True).replace(' ', '\t') + '\n' - ) - - -def _read_desktop_file(path): - with open(path, 'r') as desktop_file: - current_section = None - name = None - command = None - for line in desktop_file: - if line[0] == '[': - current_section = line[1:-2] - if current_section != 'Desktop Entry': - continue - - if line.startswith('Name='): - name = line[5:].strip() - elif line.startswith('Exec='): - command = line[5:].strip() - - return { - 'name': name, - 'command': command - } - - -def find_browsers(): - apps = [ - 'Chrome', - 'Chromium', - 'chromium-browser', - 'firefox', - 'Firefox', - 'Google Chrome', - 'google-chrome', - 'opera', - 'Opera', - 'SeaMonkey', - 'seamonkey', - ] - paths = [ - os.path.join(os.getenv('HOME'), '.local/share/applications'), - '/usr/local/share/applications', - '/usr/share/applications' - ] - suffix = '.desktop' - - results = [] - for p in paths: - for a in apps: - fp = os.path.join(p, a) + suffix - if os.path.exists(fp): - results.append(_read_desktop_file(fp)) - return results - - -def listen(): - receivedMessage = getMessage() - if receivedMessage == 'ping': - sendMessage({ - 'version': VERSION, - 'file': os.path.realpath(__file__) - }) - elif receivedMessage == 'find': - sendMessage(find_browsers()) - else: - for k, v in os.environ.items(): - if k.startswith('MOZ_'): - try: - os.unsetenv(k) - except: - os.environ[k] = '' - - devnull = open(os.devnull, 'w') - subprocess.Popen(receivedMessage, stdout=devnull, stderr=devnull) - sendMessage(None) - - -if __name__ == '__main__': - if len(sys.argv) == 2: - if sys.argv[1] == 'install': - install() - sys.exit(0) - elif sys.argv[1] == 'find_browsers': - print(find_browsers()) - sys.exit(0) - - allowed_extensions = [ - 'openwith@darktrojan.net', - 'chrome-extension://cogjlncmljjnjpbgppagklanlcbchlno/', - 'chrome-extension://fbmcaggceafhobjkhnaakhgfmdaadhhg/', - ] - for ae in allowed_extensions: - if ae in sys.argv: - listen() - sys.exit(0) - - print('Open With native helper, version %s.' % VERSION) diff --git a/home/Scripts/panextsink.sh b/home/Scripts/panextsink.sh deleted file mode 100644 index d3338391..00000000 --- a/home/Scripts/panextsink.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/bash - -# Get the pid of the window that is to be moved to the next sink -pid_to_move=$(swaymsg -t get_tree | jq -r '.nodes[]?.nodes[]?.nodes[]?.nodes[]?.nodes[] | select(.focused==true).pid') - -# Assign all the sink indices into an array -sink_array=($(pacmd list-sinks | grep index | sed 's/index://' | sed 's/*//' | xargs)) - -# Get the sink inputs to prepare to be inserted into array of arrays -# The following raw string format is index sink pid\nindex sink pid -sink_inputs_raw=$(pacmd list-sink-inputs | grep -e index -e sink: -e process.id | sed 's/<[^"]*>//' | sed 's/[^0-9]*//g' | tr '\n' ' ' | xargs | sed 's/\([[:digit:]]*\) \([[:digit:]]*\) \([[:digit:]]*\) /\1 \2 \3\n/g') - -# Find the corresponding pid -sink_input_selected_pid=$(echo "$sink_inputs_raw" | grep $pid_to_move) - -# Parse the individual values from the info retrieved above -selected_input_index=$(echo $sink_input_selected_pid | awk '{print $1;}') -selected_input_sink=$(echo $sink_input_selected_pid | awk '{print $2;}') -selected_input_pid=$(echo $sink_input_selected_pid | awk '{print $3;}') - -len=${#sink_array[@]} - -for (( i=0; i<$len; i++ )); do - if [[ $selected_input_sink == "${sink_array[$i]}" ]]; then - len_idx=$((len-1)) - if (( $i == $len_idx )); then - pacmd move-sink-input $selected_input_index ${sink_array[0]} - else - pacmd move-sink-input $selected_input_index ${sink_array[$((i+1))]} - fi - fi -done diff --git a/home/Scripts/polybar.sh b/home/Scripts/polybar.sh deleted file mode 100755 index 21ee5522..00000000 --- a/home/Scripts/polybar.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env sh - -# Terminate already running bar instances -killall -q polybar - -# Wait until the processes have been shut down -while pgrep -u $UID -x polybar >/dev/null; do sleep 1; done - -# Launch bar1 and bar2 -polybar top & - - -echo "Bars launched..." diff --git a/home/Scripts/sway-launcher-desktop.sh b/home/Scripts/sway-launcher-desktop.sh deleted file mode 100755 index efcb8e2d..00000000 --- a/home/Scripts/sway-launcher-desktop.sh +++ /dev/null @@ -1,165 +0,0 @@ -#!/usr/bin/env bash -# terminal application launcher for sway, using fzf -# Based on: https://gitlab.com/FlyingWombat/my-scripts/blob/master/sway-launcher - -shopt -s nullglob -if [[ "$1" == 'describe' ]]; then - shift - if [[ $2 == 'command' ]]; then - title=$1 - readarray arr < <(whatis -l "$1" 2>/dev/null) - description="${arr[0]}" - description="${description%*-}" - else - title=$(sed -ne '/^Name=/{s/^Name=//;p;q}' "$1") - description=$(sed -ne '/^Comment=/{s/^Comment=//;p;q}' "$1") - fi - echo -e "\033[33m$title\033[0m" - echo "${description:-No description}" - exit -fi - -HIST_FILE="${XDG_CACHE_HOME:-$HOME/.cache}/${0##*/}-history.txt" - -DIRS=( - /usr/share/applications - "$HOME/.local/share/applications" - /usr/local/share/applications -) - -GLYPH_COMMAND=" " -GLYPH_DESKTOP=" " - -touch "$HIST_FILE" -readarray HIST_LINES <"$HIST_FILE" -FZFPIPE=$(mktemp) -PIDFILE=$(mktemp) -trap 'rm "$FZFPIPE" "$PIDFILE"' EXIT INT - -# Append Launcher History, removing usage count -(printf '%s' "${HIST_LINES[@]#* }" >>"$FZFPIPE") & - -# Load and append Desktop entries -( - for dir in "${DIRS[@]}"; do - [[ -d "$dir" ]] || continue - awk -v pre="$GLYPH_DESKTOP" -F= ' - BEGINFILE{application=0;block="";a=0} - /^\[Desktop Entry\]/{block="entry"} - /^Type=Application/{application=1} - /^\[Desktop Action/{ - sub("^\\[Desktop Action ", ""); - sub("\\]$", ""); - block="action"; - a++; - actions[a,"key"]=$0 - } - /^Name=/{ - if(block=="action") { - actions[a,"name"]=$2; - } else { - name=$2 - } - } - ENDFILE{ - if (application){ - print FILENAME "\034desktop\034\033[33m" pre name "\033[0m"; - if (a>0) - for (i=1; i<=a; i++) - print FILENAME "\034desktop\034\033[33m" pre name "\033[0m (" actions[i, "name"] ")\034" actions[i, "key"] - } - }' \ - "$dir/"*.desktop >"$FZFPIPE" - # the empty stdin is needed in case no *.desktop files - done -) & - -# Load and append command list -( - IFS=: - read -ra path <<<"$PATH" - for dir in "${path[@]}"; do - printf '%s\n' "$dir/"* | - awk -F / -v pre="$GLYPH_COMMAND" '{print $NF "\034command\034\033[31m" pre "\033[0m" $NF;}' - done | sort -u >>"$FZFPIPE" -) & - -COMMAND_STR=$( - ( - tail -n +0 -f "$FZFPIPE" & - echo $! >"$PIDFILE" - ) | - fzf +s -x -d '\034' --nth ..3 --with-nth 3 \ - --preview "$0 describe {1} {2}" \ - --preview-window=up:3:wrap --ansi - kill -9 "$(<"$PIDFILE")" | tail -n1 -) || exit 1 - -[ -z "$COMMAND_STR" ] && exit 1 - -# update history -for i in "${!HIST_LINES[@]}"; do - if [[ "${HIST_LINES[i]}" == *" $COMMAND_STR"$'\n' ]]; then - HIST_COUNT=${HIST_LINES[i]%% *} - HIST_LINES[$i]="$((HIST_COUNT + 1)) $COMMAND_STR"$'\n' - match=1 - break - fi -done -if ! ((match)); then - HIST_LINES+=("1 $COMMAND_STR"$'\n') -fi - -printf '%s' "${HIST_LINES[@]}" | sort -nr >"$HIST_FILE" - -command='echo "nope"' -# shellcheck disable=SC2086 -readarray -d $'\034' -t PARAMS <<<${COMMAND_STR} -# COMMAND_STR is "\034" -case ${PARAMS[1]} in -desktop) - # Define the search pattern that specifies the block to search for within the .desktop file - PATTERN="^\\\\[Desktop Entry\\\\]" - if [[ -n ${PARAMS[3]} ]]; then - PATTERN="^\\\\[Desktop Action ${PARAMS[3]%?}\\\\]" - fi - # 1. We see a line starting [Desktop, but we're already searching: deactivate search again - # 2. We see the specified pattern: start search - # 3. We see an Exec= line during search: remove field codes and set variable - # 3. We see a Path= line during search: set variable - # 4. Finally, build command line - command=$(awk -v pattern="${PATTERN}" -F= ' - BEGIN{a=0;exec=0; path=0} - /^\[Desktop/{ - if(a){ - a=0 - } - } - $0 ~ pattern{ - a=1 - } - /^Exec=/{ - if(a && !exec){ - sub("^Exec=", ""); - gsub(" ?%[cDdFfikmNnUuv]", ""); - exec=$0; - } - } - /^Path=/{ - if(a && !path){ - path=$2 - } - } - - END{ - if(path){ - print "cd " path " &&" - } - print exec - }' "${PARAMS[0]}") - ;; -command) - command="${PARAMS[0]}" - ;; -esac -swaymsg -t command exec "$command" diff --git a/home/Scripts/swayidle.sh b/home/Scripts/swayidle.sh deleted file mode 100755 index 87ad8998..00000000 --- a/home/Scripts/swayidle.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash -swaylock="$HOME/Scripts/swaylock.sh" -dimscreen="$HOME/Scripts/dim-screen.sh" -screenon="swaymsg 'output * dpms on'" -screenoff="swaymsg 'output * dpms off'" -swayidle \ - lock "$swaylock" \ - timeout 300 "lqsd -d" \ - resume "lqsd -r" \ - timeout 600 "loginctl lock-session $(loginctl show-user $USER -p Sessions | cut -d'=' -f2); sleep 0.5; $screenoff" \ - resume "$screenon; lqsd -r" \ - before-sleep "playerctl pause; loginctl lock-session $(loginctl show-user $USER -p Sessions | cut -d'=' -f2)" \ - unlock "pkill -9 swaylock" diff --git a/home/Scripts/switchlayout.sh b/home/Scripts/switchlayout.sh deleted file mode 100755 index 66fa8351..00000000 --- a/home/Scripts/switchlayout.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash -curLayout=$(setxkbmap -query | grep layout | sed 's/layout: //g') - -if [ $curLayout == "eu" ]; then - setxkbmap dvorak -else - setxkbmap eu -fi diff --git a/home/Scripts/touchpadtoggle.sh b/home/Scripts/touchpadtoggle.sh deleted file mode 100755 index ec3a10ea..00000000 --- a/home/Scripts/touchpadtoggle.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/sh - - -gr="FocalTechPS/2 FocalTech Touchpad" -#gr="SynPS/2 Synaptics TouchPad" - - -#Creates a file if it does not exist to store the 0 or 1 bit to check if touchpad is enabled or disabled. Set to 0 by default -if [ ! -f .touchpad ]; - then - echo 0 > .touchpad; - -fi - -if grep -q 0 ".touchpad"; -then - xinput enable "$gr"; - echo 1 > .touchpad; - echo "Touchpad enabled" - notify-send "Touchpad enabled" -else - xinput disable "$gr"; - echo 0 > .touchpad; - echo "Touchpad Disabled" - notify-send "Touchpad disabled" -fi diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 00000000..36e7515e --- /dev/null +++ b/package-lock.json @@ -0,0 +1,803 @@ +{ + "name": "dotfiles", + "version": "1.0.0", + "lockfileVersion": 2, + "requires": true, + "packages": { + "": { + "name": "dotfiles", + "version": "1.0.0", + "license": "MIT", + "dependencies": { + "prettier": "^2.7.1", + "pretty-quick": "^3.1.3" + }, + "devDependencies": { + "husky": "^8.0.0" + } + }, + "node_modules/@types/minimatch": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.5.tgz", + "integrity": "sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ==" + }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/array-differ": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/array-differ/-/array-differ-3.0.0.tgz", + "integrity": "sha512-THtfYS6KtME/yIAhKjZ2ul7XI96lQGHRputJQHO80LAWQnuGP4iCIN8vdMRboGbIEYBwU33q8Tch1os2+X0kMg==", + "engines": { + "node": ">=8" + } + }, + "node_modules/array-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "engines": { + "node": ">=8" + } + }, + "node_modules/arrify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-2.0.1.tgz", + "integrity": "sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug==", + "engines": { + "node": ">=8" + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" + }, + "node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/chalk": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz", + "integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" + }, + "node_modules/cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/end-of-stream": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", + "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", + "dependencies": { + "once": "^1.4.0" + } + }, + "node_modules/execa": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-4.1.0.tgz", + "integrity": "sha512-j5W0//W7f8UxAn8hXVnwG8tLwdiUy4FJLcSupCg6maBYZDpyBvTApK7KyuI4bKj8KOh1r2YH+6ucuYtJv1bTZA==", + "dependencies": { + "cross-spawn": "^7.0.0", + "get-stream": "^5.0.0", + "human-signals": "^1.1.1", + "is-stream": "^2.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^4.0.0", + "onetime": "^5.1.0", + "signal-exit": "^3.0.2", + "strip-final-newline": "^2.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" + } + }, + "node_modules/find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dependencies": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/get-stream": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", + "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", + "dependencies": { + "pump": "^3.0.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "engines": { + "node": ">=8" + } + }, + "node_modules/human-signals": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-1.1.1.tgz", + "integrity": "sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw==", + "engines": { + "node": ">=8.12.0" + } + }, + "node_modules/husky": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/husky/-/husky-8.0.1.tgz", + "integrity": "sha512-xs7/chUH/CKdOCs7Zy0Aev9e/dKOMZf3K1Az1nar3tzlv0jfqnYtu235bstsWTmXOR0EfINrPa97yy4Lz6RiKw==", + "dev": true, + "bin": { + "husky": "lib/bin.js" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/typicode" + } + }, + "node_modules/ignore": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", + "integrity": "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==", + "engines": { + "node": ">= 4" + } + }, + "node_modules/is-stream": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==" + }, + "node_modules/locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dependencies": { + "p-locate": "^4.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/merge-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==" + }, + "node_modules/mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "engines": { + "node": ">=6" + } + }, + "node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/mri": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/mri/-/mri-1.2.0.tgz", + "integrity": "sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==", + "engines": { + "node": ">=4" + } + }, + "node_modules/multimatch": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/multimatch/-/multimatch-4.0.0.tgz", + "integrity": "sha512-lDmx79y1z6i7RNx0ZGCPq1bzJ6ZoDDKbvh7jxr9SJcWLkShMzXrHbYVpTdnhNM5MXpDUxCQ4DgqVttVXlBgiBQ==", + "dependencies": { + "@types/minimatch": "^3.0.3", + "array-differ": "^3.0.0", + "array-union": "^2.1.0", + "arrify": "^2.0.1", + "minimatch": "^3.0.4" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/npm-run-path": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", + "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", + "dependencies": { + "path-key": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/onetime": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", + "dependencies": { + "mimic-fn": "^2.1.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dependencies": { + "p-limit": "^2.2.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "engines": { + "node": ">=6" + } + }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "engines": { + "node": ">=8" + } + }, + "node_modules/prettier": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.7.1.tgz", + "integrity": "sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g==", + "bin": { + "prettier": "bin-prettier.js" + }, + "engines": { + "node": ">=10.13.0" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, + "node_modules/pretty-quick": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/pretty-quick/-/pretty-quick-3.1.3.tgz", + "integrity": "sha512-kOCi2FJabvuh1as9enxYmrnBC6tVMoVOenMaBqRfsvBHB0cbpYHjdQEpSglpASDFEXVwplpcGR4CLEaisYAFcA==", + "dependencies": { + "chalk": "^3.0.0", + "execa": "^4.0.0", + "find-up": "^4.1.0", + "ignore": "^5.1.4", + "mri": "^1.1.5", + "multimatch": "^4.0.0" + }, + "bin": { + "pretty-quick": "bin/pretty-quick.js" + }, + "engines": { + "node": ">=10.13" + }, + "peerDependencies": { + "prettier": ">=2.0.0" + } + }, + "node_modules/pump": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", + "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "dependencies": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "engines": { + "node": ">=8" + } + }, + "node_modules/signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==" + }, + "node_modules/strip-final-newline": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", + "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", + "engines": { + "node": ">=6" + } + }, + "node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" + } + }, + "dependencies": { + "@types/minimatch": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.5.tgz", + "integrity": "sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ==" + }, + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "requires": { + "color-convert": "^2.0.1" + } + }, + "array-differ": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/array-differ/-/array-differ-3.0.0.tgz", + "integrity": "sha512-THtfYS6KtME/yIAhKjZ2ul7XI96lQGHRputJQHO80LAWQnuGP4iCIN8vdMRboGbIEYBwU33q8Tch1os2+X0kMg==" + }, + "array-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==" + }, + "arrify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-2.0.1.tgz", + "integrity": "sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug==" + }, + "balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "chalk": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz", + "integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==", + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" + }, + "cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "requires": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + } + }, + "end-of-stream": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", + "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", + "requires": { + "once": "^1.4.0" + } + }, + "execa": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-4.1.0.tgz", + "integrity": "sha512-j5W0//W7f8UxAn8hXVnwG8tLwdiUy4FJLcSupCg6maBYZDpyBvTApK7KyuI4bKj8KOh1r2YH+6ucuYtJv1bTZA==", + "requires": { + "cross-spawn": "^7.0.0", + "get-stream": "^5.0.0", + "human-signals": "^1.1.1", + "is-stream": "^2.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^4.0.0", + "onetime": "^5.1.0", + "signal-exit": "^3.0.2", + "strip-final-newline": "^2.0.0" + } + }, + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "get-stream": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", + "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", + "requires": { + "pump": "^3.0.0" + } + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" + }, + "human-signals": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-1.1.1.tgz", + "integrity": "sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw==" + }, + "husky": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/husky/-/husky-8.0.1.tgz", + "integrity": "sha512-xs7/chUH/CKdOCs7Zy0Aev9e/dKOMZf3K1Az1nar3tzlv0jfqnYtu235bstsWTmXOR0EfINrPa97yy4Lz6RiKw==", + "dev": true + }, + "ignore": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", + "integrity": "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==" + }, + "is-stream": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==" + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==" + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "requires": { + "p-locate": "^4.1.0" + } + }, + "merge-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==" + }, + "mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==" + }, + "minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "mri": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/mri/-/mri-1.2.0.tgz", + "integrity": "sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==" + }, + "multimatch": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/multimatch/-/multimatch-4.0.0.tgz", + "integrity": "sha512-lDmx79y1z6i7RNx0ZGCPq1bzJ6ZoDDKbvh7jxr9SJcWLkShMzXrHbYVpTdnhNM5MXpDUxCQ4DgqVttVXlBgiBQ==", + "requires": { + "@types/minimatch": "^3.0.3", + "array-differ": "^3.0.0", + "array-union": "^2.1.0", + "arrify": "^2.0.1", + "minimatch": "^3.0.4" + } + }, + "npm-run-path": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", + "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", + "requires": { + "path-key": "^3.0.0" + } + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "requires": { + "wrappy": "1" + } + }, + "onetime": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", + "requires": { + "mimic-fn": "^2.1.0" + } + }, + "p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "requires": { + "p-limit": "^2.2.0" + } + }, + "p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==" + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==" + }, + "path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==" + }, + "prettier": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.7.1.tgz", + "integrity": "sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g==" + }, + "pretty-quick": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/pretty-quick/-/pretty-quick-3.1.3.tgz", + "integrity": "sha512-kOCi2FJabvuh1as9enxYmrnBC6tVMoVOenMaBqRfsvBHB0cbpYHjdQEpSglpASDFEXVwplpcGR4CLEaisYAFcA==", + "requires": { + "chalk": "^3.0.0", + "execa": "^4.0.0", + "find-up": "^4.1.0", + "ignore": "^5.1.4", + "mri": "^1.1.5", + "multimatch": "^4.0.0" + } + }, + "pump": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", + "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "requires": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "requires": { + "shebang-regex": "^3.0.0" + } + }, + "shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==" + }, + "signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==" + }, + "strip-final-newline": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", + "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==" + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "requires": { + "has-flag": "^4.0.0" + } + }, + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "requires": { + "isexe": "^2.0.0" + } + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 00000000..a75bf0a9 --- /dev/null +++ b/package.json @@ -0,0 +1,23 @@ +{ + "$schema": "https://json.schemastore.org/package.json", + "name": "dotfiles", + "version": "1.0.0", + "private": false, + "description": "FunctionalHacker’s dotfiles", + "scripts": { + "prepare": "husky install" + }, + "repository": { + "type": "git", + "url": "https://git.korhonen.cc/FunctionalHacker/dotfiles" + }, + "author": "", + "license": "MIT", + "devDependencies": { + "husky": "^8.0.0" + }, + "dependencies": { + "prettier": "^2.7.1", + "pretty-quick": "^3.1.3" + } +} diff --git a/pkglist b/pkglist deleted file mode 100644 index 054861e7..00000000 --- a/pkglist +++ /dev/null @@ -1,187 +0,0 @@ -aic94xx-firmware -alacritty -alacritty-terminfo -alsa-utils -amd-ucode -asciiquarium -autoconf -automake -bash -bash-language-server -binutils -bison -blueberry -bluez-utils -bzip2 -ccid -chromium -clipman -clutter -coreutils -cpupower -cryptsetup -device-mapper -dhcpcd -diffutils -discord -dmenu -dolphin -drill-search-cli -e2fsprogs -evolution -evolution-decsync -fakeroot -ffmpeg-amd-full-git -file -file-roller -filesystem -findutils -firefox-nightly -fmui-git -fzf -gawk -gcc -gcc-libs -gettext -git -glibc -gnome-keyring -gotop-bin -grep -grim -gzip -imv -inetutils -iproute2 -iputils -iwd -jfsutils -kdeconnect -kdenlive -kodi-wayland -less -lib32-libva-mesa-driver -lib32-mesa -lib32-vulkan-radeon -libva-mesa-driver -licenses -light -linux -linux-firmware -locale-en_xx -logrotate -ls_extended -lvm2 -lxappearance -make -mako -man-db -man-pages -matcha-gtk-theme -mdadm -mimeo -mkinitcpio-welcomemessage -mpd -mpdris2-py3-git -mpdscribble -mpv-acestream -mpv-amd-full-git -mpv-mpris -mumble -nano -nautilus -ncmpcpp -neofetch -neovim -netctl -nodejs -noto-fonts -numix-icon-theme-git -opensc -openssh -otf-overpass -pacman -pacserve -pass-otp -pass-wl-clipboard -passdmenu -patch -pavucontrol -pciutils -perl -pkgconf -playerctl -polkit-gnome -powertop -procps-ng -psmisc -pulseaudio-ctl -python-docopt -python-jinja -python-ruamel-yaml -qt5-styleplugins -qt5-wayland -qt5ct -ranger -redshift-wlr-gamma-control -reflector -reiserfsprogs -ripgrep -rofi-pass -rtv -ryzenadj-git -s-nail -sed -shadow -sl -slurp -socat -steam -steam-native-runtime -sudo -sway -swaybg -swayidle -swaylock-effects-git -syncthing -syncthing-gtk -sysfsutils -systemd-boot-pacman-hook -systemd-resolvconf -systemd-sysvcompat -tar -telegram-desktop -texinfo -thefuck -tlp -tmux -trash-cli -ttf-dejavu -ttf-font-awesome -ttf-mac-fonts -ttf-nerd-fonts-hack-complete-git -usbutils -util-linux -vi -vulkan-radeon -w3m -waybar-git -wayland -wd719x-firmware -wf-recorder-git -wget -which -wl-clipboard-git -wl-clipboard-x11 -xcursor-breeze -xdg-utils-mimeo -xf86-video-amdgpu -xfsprogs -xorg-server-xwayland -xorg-xeyes -yarn -yay-bin -ydotool-git -youtube-dl -zathura-pdf-mupdf -zsh diff --git a/root/boot/loader/entries/arch-lts.conf b/root/boot/loader/entries/arch-lts.conf deleted file mode 100755 index 7cd59828..00000000 --- a/root/boot/loader/entries/arch-lts.conf +++ /dev/null @@ -1,5 +0,0 @@ -title Arch Linux -linux /vmlinuz-linux-lts -initrd /amd-ucode.img -initrd /initramfs-linux-lts.img -options cryptdevice=/dev/disk/by-uuid/2fedee0d-fbf1-41ee-8d27-01feb25d9e8d:cryptroot:allow-discards root=/dev/mapper/cryptroot rootflags=subvol=__arch/root resume=/dev/mapper/cryptswap quiet acpi_backlight=vendor rw diff --git a/root/boot/loader/entries/arch.conf b/root/boot/loader/entries/arch.conf deleted file mode 100755 index afe144c8..00000000 --- a/root/boot/loader/entries/arch.conf +++ /dev/null @@ -1,5 +0,0 @@ -title Arch Linux -linux /vmlinuz-linux -initrd /amd-ucode.img -initrd /initramfs-linux.img -options cryptdevice=/dev/disk/by-uuid/2fedee0d-fbf1-41ee-8d27-01feb25d9e8d:cryptroot:allow-discards root=/dev/mapper/cryptroot rootflags=subvol=__arch/root resume=/dev/mapper/cryptswap cpuidle.governor=teo acpi_backlight=vendor amd_iommu=on iommu=pt rw idle=nomwait rcu_nocbs=0-7 quiet fastboot diff --git a/root/boot/loader/loader.conf b/root/boot/loader/loader.conf deleted file mode 100755 index 49951610..00000000 --- a/root/boot/loader/loader.conf +++ /dev/null @@ -1,3 +0,0 @@ -default arch -timeout 0 -editor 1 diff --git a/root/etc/bluetooth/main.conf b/root/etc/bluetooth/main.conf index ee4a1c5f..750103f8 100755 --- a/root/etc/bluetooth/main.conf +++ b/root/etc/bluetooth/main.conf @@ -1,107 +1,6 @@ [General] -# Default adapter name -# Defaults to 'BlueZ X.YZ' -#Name = BlueZ - -# Default device class. Only the major and minor device class bits are -# considered. Defaults to '0x000000'. -#Class = 0x000100 - -# How long to stay in discoverable mode before going back to non-discoverable -# The value is in seconds. Default is 180, i.e. 3 minutes. -# 0 = disable timer, i.e. stay discoverable forever -#DiscoverableTimeout = 0 - -# How long to stay in pairable mode before going back to non-discoverable -# The value is in seconds. Default is 0. -# 0 = disable timer, i.e. stay pairable forever -#PairableTimeout = 0 - -# Use vendor id source (assigner), vendor, product and version information for -# DID profile support. The values are separated by ":" and assigner, VID, PID -# and version. -# Possible vendor id source values: bluetooth, usb (defaults to usb) -#DeviceID = bluetooth:1234:5678:abcd - -# Do reverse service discovery for previously unknown devices that connect to -# us. This option is really only needed for qualification since the BITE tester -# doesn't like us doing reverse SDP for some test cases (though there could in -# theory be other useful purposes for this too). Defaults to 'true'. -#ReverseServiceDiscovery = true - -# Enable name resolving after inquiry. Set it to 'false' if you don't need -# remote devices name and want shorter discovery cycle. Defaults to 'true'. -#NameResolving = true - -# Enable runtime persistency of debug link keys. Default is false which -# makes debug link keys valid only for the duration of the connection -# that they were created for. -#DebugKeys = false - -# Restricts all controllers to the specified transport. Default value -# is "dual", i.e. both BR/EDR and LE enabled (when supported by the HW). -# Possible values: "dual", "bredr", "le" -#ControllerMode = dual - -# Enables Multi Profile Specification support. This allows to specify if -# system supports only Multiple Profiles Single Device (MPSD) configuration -# or both Multiple Profiles Single Device (MPSD) and Multiple Profiles Multiple -# Devices (MPMD) configurations. -# Possible values: "off", "single", "multiple" -#MultiProfile = off - -# Permanently enables the Fast Connectable setting for adapters that -# support it. When enabled other devices can connect faster to us, -# however the tradeoff is increased power consumptions. This feature -# will fully work only on kernel version 4.1 and newer. Defaults to -# 'false'. -#FastConnectable = false - -# Default privacy setting. -# Enables use of private address. -# Possible values: "off", "device", "network" -# "network" option not supported currently -# Defaults to "off" -# Privacy = off - [GATT] -# GATT attribute cache. -# Possible values: -# always: Always cache attributes even for devices not paired, this is -# recommended as it is best for interoperability, with more consistent -# reconnection times and enables proper tracking of notifications for all -# devices. -# yes: Only cache attributes of paired devices. -# no: Never cache attributes -# Default: always -#Cache = always - -# Minimum required Encryption Key Size for accessing secured characteristics. -# Possible values: 0 and 7-16. 0 means don't care. -# Defaults to 0 -# MinEncKeySize = 0 [Policy] -# -# The ReconnectUUIDs defines the set of remote services that should try -# to be reconnected to in case of a link loss (link supervision -# timeout). The policy plugin should contain a sane set of values by -# default, but this list can be overridden here. By setting the list to -# empty the reconnection feature gets disabled. -#ReconnectUUIDs=00001112-0000-1000-8000-00805f9b34fb,0000111f-0000-1000-8000-00805f9b34fb,0000110a-0000-1000-8000-00805f9b34fb - -# ReconnectAttempts define the number of attempts to reconnect after a link -# lost. Setting the value to 0 disables reconnecting feature. -#ReconnectAttempts=7 - -# ReconnectIntervals define the set of intervals in seconds to use in between -# attempts. -# If the number of attempts defined in ReconnectAttempts is bigger than the -# set of intervals the last interval is repeated until the last attempt. -#ReconnectIntervals=1,2,4,8,16,32,64 - -# AutoEnable defines option to enable all controllers when they are found. -# This includes adapters present on start as well as adapters that are plugged -# in later on. Defaults to 'false'. AutoEnable=true diff --git a/root/etc/clamav/detected.sh b/root/etc/clamav/detected.sh index 6f3f1f9c..4d15efce 100755 --- a/root/etc/clamav/detected.sh +++ b/root/etc/clamav/detected.sh @@ -5,22 +5,22 @@ alert="Signature detected: $CLAM_VIRUSEVENT_VIRUSNAME in $CLAM_VIRUSEVENT_FILENA # Send the alert to systemd logger if exist, othewise to /var/log if [[ -z $(command -v systemd-cat) ]]; then - echo "$(date) - $alert" >> /var/log/clamav/infected.log + echo "$(date) - $alert" >>/var/log/clamav/infected.log else - # as "emerg", this could cause your DE to show a visual alert. Happen in Plasma. but the next visual alert is much nicer - echo "$alert" | /usr/bin/systemd-cat -t clamav -p emerg + # as "emerg", this could cause your DE to show a visual alert. Happen in Plasma. but the next visual alert is much nicer + echo "$alert" | /usr/bin/systemd-cat -t clamav -p emerg fi #send an alrt to all graphical user -XUSERS=($(who|awk '{print $1}'|sort -u)) +XUSERS=($(who | awk '{print $1}' | sort -u)) for XUSER in $XUSERS; do - NAME=(${XUSER/(/ }) - DISPLAY=${NAME[1]/)/} - DBUS_ADDRESS=unix:path=/run/user/$(id -u ${NAME[0]})/bus - echo "run $NAME - $DISPLAY - $DBUS_ADDRESS -" >> /tmp/testlog - /usr/bin/sudo -u ${NAME[0]} DISPLAY=${DISPLAY} \ - DBUS_SESSION_BUS_ADDRESS=${DBUS_ADDRESS} \ - PATH=${PATH} \ - /usr/bin/notify-send -i dialog-warning "clamAV" "$alert" + NAME=(${XUSER/(/ }) + DISPLAY=${NAME[1]/)/} + DBUS_ADDRESS=unix:path=/run/user/$(id -u ${NAME[0]})/bus + echo "run $NAME - $DISPLAY - $DBUS_ADDRESS -" >>/tmp/testlog + /usr/bin/sudo -u ${NAME[0]} DISPLAY=${DISPLAY} \ + DBUS_SESSION_BUS_ADDRESS=${DBUS_ADDRESS} \ + PATH=${PATH} \ + /usr/bin/notify-send -i dialog-warning "clamAV" "$alert" done diff --git a/root/etc/cryptissue b/root/etc/cryptissue index 3c9154a1..ff9f538e 100755 --- a/root/etc/cryptissue +++ b/root/etc/cryptissue @@ -47,3 +47,4 @@ Please return it to me! Below are my contact details Name: {{@@ env['ME_FULLNAME'] @@}} Address: {{@@ env['ME_ADDRESS'] @@}} Phone: {{@@ env['ME_PHONE'] @@}} +Email: {{@@ env['ME_EMAIL'] @@}} diff --git a/root/etc/default/cpupower b/root/etc/default/cpupower new file mode 100644 index 00000000..7786ac77 --- /dev/null +++ b/root/etc/default/cpupower @@ -0,0 +1,6 @@ +# vim:set ts=2 sw=2 ft=sh et: +{%@@ if profile == "Mirkwood" @@%} +governor='schedutil' +{%@@ else @@%} +governor='performance' +{%@@ endif @@%} diff --git a/root/etc/doas.conf b/root/etc/doas.conf new file mode 100644 index 00000000..cb547a49 --- /dev/null +++ b/root/etc/doas.conf @@ -0,0 +1,7 @@ +{%@@ if distro_id == "arch" @@%} +permit persist :wheel +permit nopass :wheel as root cmd pacman +{%@@ else @@%} +permit persist :sudo +permit nopass :sudo as root cmd apt +{%@@ endif @@%} diff --git a/root/etc/environment b/root/etc/environment deleted file mode 100755 index a5e7f909..00000000 --- a/root/etc/environment +++ /dev/null @@ -1 +0,0 @@ -XDG_SESSION_TYPE=wayland diff --git a/root/etc/flexo/flexo.toml b/root/etc/flexo/flexo.toml new file mode 100644 index 00000000..07ec1138 --- /dev/null +++ b/root/etc/flexo/flexo.toml @@ -0,0 +1,26 @@ +cache_directory = "/var/cache/flexo/pkg" +connect_timeout = 3000 +mirrorlist_fallback_file = "/var/cache/flexo/state/mirrorlist" +mirrorlist_latency_test_results_file = "/var/cache/flexo/state/latency_test_results.json" +listen_ip_address = "0.0.0.0" +port = 7878 +mirror_selection_method = "auto" +mirrors_predefined = [] +num_versions_retain = 3 + +[mirrors_auto] + +mirrors_status_json_endpoint = "https://archlinux.org/mirrors/status/json/" +mirrors_status_json_endpoint_fallbacks = [ + "https://raw.githubusercontent.com/nroi/archlinux-mirrors-status-fallback/main/mirrorlist.json", +] +mirrors_blacklist = [] +https_required = true +ipv4 = true +ipv6 = false +max_score = 2.5 +num_mirrors = 8 +mirrors_random_or_sort = "sort" +timeout = 350 +refresh_latency_tests_after = "8 days" +allowed_countries = [] diff --git a/root/etc/kernel/cmdline b/root/etc/kernel/cmdline new file mode 100644 index 00000000..b38c85c5 --- /dev/null +++ b/root/etc/kernel/cmdline @@ -0,0 +1,9 @@ +{%@@ if profile == "Mirkwood" @@%} +cryptdevice=UUID=ddc8cabe-f726-4287-8407-3a0323ec6037:cryptroot:allow-discards root=/dev/mapper/cryptroot rootflags=subvol=root resume=/dev/mapper/cryptroot resume_offset=18529853 rw quiet splash vt.global_cursor_default=0 fbcon=nodefer log_level=3 udev.log_level=3 +{%@@ elif profile == "Moria" @@%} +cryptdevice=UUID=51115cf2-6a44-4f8c-8aa2-ff9d834953d8:cryptroot:allow-discards root=/dev/mapper/cryptroot rootflags=subvol=root ip=:::::eth0:dhcp netconf_timeout=60 rw quiet splash vt.global_cursor_default=0 fbcon=nodefer log_level=3 udev.log_level=3 +{%@@ elif profile == "Shire" @@%} +cryptdevice=UUID=8898d32c-d150-4258-ad0f-96b5afca4718:cryptroot root=/dev/mapper/cryptroot rootflags=subvol=root resume_offset=2106624 intel_idle.max_cstate=1 rw quiet splash vt.global_cursor_default=0 fbcon=nodefer log_level=3 udev.log_level=3 +{%@@ elif profile == "VentoyArch" @@%} +cryptdevice=UUID=d43414f3-37e9-4f35-9d3c-2f85c36c0034:cryptroot:allow-discards root=/dev/mapper/cryptroot rootflags=subvol=root rw quiet splash vt.global_cursor_default=0 fbcon=nodefer log_level=3 udev.log_level=3 +{%@@ endif @@%} diff --git a/root/etc/locale.gen b/root/etc/locale.gen index 91085b8d..062fc4cf 100755 --- a/root/etc/locale.gen +++ b/root/etc/locale.gen @@ -1,2 +1,4 @@ en_US.UTF-8 UTF-8 en_XX.UTF-8@POSIX UTF-8 +fi_FI.UTF-8 UTF-8 +th_TH.UTF-8 UTF-8 diff --git a/root/etc/mkinitcpio.conf b/root/etc/mkinitcpio.conf index 12264164..9fec8d14 100644 --- a/root/etc/mkinitcpio.conf +++ b/root/etc/mkinitcpio.conf @@ -1,8 +1,22 @@ +COMPRESSION="zstd" +{%@@ if profile == "Mirkwood" or profile == "Moria" @@%} MODULES=(amdgpu) -BINARIES=() -FILES=() -{%@@ if profile == "Mirkwood" @@%} -HOOKS=(base udev autodetect modconf block filesystems keyboard colors consolefont welcomemessage encrypt resume fsck) -{%@@ elif profile == "Rivendell" @@%} -HOOKS=(colors consolefont base udev autodetect modconf block filesystems keyboard fsck) +{%@@ elif profile == "Shire" @@%} +MODULES=(i915 hid-multitouch i2c-hid i2c-hid-acpi hid_generic) +{%@@ endif @@%} +{%@@ if profile == "Mirkwood" or profile == "Moria" @@%} +BINARIES=("/usr/bin/btrfs") +{%@@ else @@%} +BINARIES=() +{%@@ endif @@%} +FILES=() + +{%@@ if profile == "Mirkwood" @@%} +HOOKS=(base udev kms plymouth keyboard autodetect microcode modconf block filesystems btrfs encrypt resume fsck) +{%@@ elif profile == 'Moria' @@%} +HOOKS=(base udev kms keyboard autodetect microcode modconf block netconf dropbear encryptssh filesystems btrfs fsck) +{%@@ elif profile == 'Shire' @@%} +HOOKS=(base udev kms keyboard keymap autodetect microcode modconf block bluetooth unl0kr encrypt plymouth filesystems resume fsck) +{%@@ elif profile == "VentoyArch" @@%} +HOOKS=(base udev kms plymouth keyboard autodetect microcode modconf block ventoy filesystems btrfs encrypt resume fsck) {%@@ endif @@%} diff --git a/root/etc/mkinitcpio.d/linux-lts.preset b/root/etc/mkinitcpio.d/linux-lts.preset new file mode 100644 index 00000000..3957588c --- /dev/null +++ b/root/etc/mkinitcpio.d/linux-lts.preset @@ -0,0 +1,7 @@ +PRESETS=('default') + +ALL_config="/etc/mkinitcpio.conf" +ALL_kver="/boot/vmlinuz-linux-lts" + +default_image="/boot/initramfs-linux-lts.img" +default_uki="/boot/EFI/Linux/archlinux-linux-lts.efi" diff --git a/root/etc/mkinitcpio.d/linux.preset b/root/etc/mkinitcpio.d/linux.preset new file mode 100644 index 00000000..f7b29ac9 --- /dev/null +++ b/root/etc/mkinitcpio.d/linux.preset @@ -0,0 +1,7 @@ +PRESETS=('default') + +ALL_config="/etc/mkinitcpio.conf" +ALL_kver="/boot/vmlinuz-linux" + +default_image="/boot/initramfs-linux.img" +default_uki="/boot/EFI/Linux/archlinux-linux.efi" diff --git a/root/etc/pacman.conf b/root/etc/pacman.conf index f572251b..df0355eb 100755 --- a/root/etc/pacman.conf +++ b/root/etc/pacman.conf @@ -2,12 +2,16 @@ ILoveCandy Color CheckSpace -TotalDownload +ParallelDownloads = 5 HoldPkg = pacman glibc SigLevel = Required DatabaseOptional Architecture = auto LocalFileSigLevel = Optional CacheDir = /var/cache/pacman/pkg +{%@@ if profile == "Moria" @@%} +CleanMethod=KeepCurrent +CacheDir= /var/www/index.korhonen.cc/repo/arch_linux/korhonen_aur/x86_64 +{%@@ endif @@%} [core] Include = /etc/pacman.d/pacserve @@ -17,13 +21,14 @@ Include = /etc/pacman.d/mirrorlist Include = /etc/pacman.d/pacserve Include = /etc/pacman.d/mirrorlist -[community] -Include = /etc/pacman.d/pacserve -Include = /etc/pacman.d/mirrorlist - [multilib] Include = /etc/pacman.d/pacserve Include = /etc/pacman.d/mirrorlist -[repo-ck] -Server = http://repo-ck.com/$arch +[korhonen_aur] +{%@@ if profile == "Moria" @@%} +Server = file:///var/www/index.korhonen.cc/repo/arch_linux/$repo/$arch +{%@@ else @@%} +Include = /etc/pacman.d/pacserve +Server = http://index.korhonen.cc/repo/arch_linux/$repo/$arch +{%@@ endif @@%} diff --git a/root/etc/pacman.d/hooks/zsh.hook b/root/etc/pacman.d/hooks/zsh.hook index 4c3881c0..567e8b83 100644 --- a/root/etc/pacman.d/hooks/zsh.hook +++ b/root/etc/pacman.d/hooks/zsh.hook @@ -2,11 +2,10 @@ Operation = Install Operation = Upgrade Operation = Remove -Type = Package +Type = Path Target = usr/bin/* [Action] Depends = zsh -Depends = procps-ng When = PostTransaction -Exec = /usr/bin/pkill zsh --signal=USR1 +Exec = /usr/bin/install -Dm644 /dev/null /var/cache/zsh/pacman diff --git a/root/etc/pacserve/pacserve.service.conf b/root/etc/pacserve/pacserve.service.conf index 262805ff..a983b4c5 100755 --- a/root/etc/pacserve/pacserve.service.conf +++ b/root/etc/pacserve/pacserve.service.conf @@ -1 +1 @@ -PACSERVE_ARGS="--multicast" +PACSERVE_ARGS="--multicast --avahi" diff --git a/root/etc/plymouth/plymouthd.conf b/root/etc/plymouth/plymouthd.conf new file mode 100644 index 00000000..dffebeca --- /dev/null +++ b/root/etc/plymouth/plymouthd.conf @@ -0,0 +1,7 @@ +[Daemon] +Theme=arch-charge-gdm-spinner +ShowDelay=0 +DeviceTimeout=8 +{%@@ if profile == "Moria" @@%} +DeviceScale=2 +{%@@ endif @@%} diff --git a/root/etc/ssh/sshd_config b/root/etc/ssh/sshd_config index 448f96a6..9cecff1e 100644 --- a/root/etc/ssh/sshd_config +++ b/root/etc/ssh/sshd_config @@ -1,10 +1,14 @@ # Remove socket for gpg agent forwarding StreamLocalBindUnlink yes +{%@@ if profile == "Moria" @@%} +Port 221 +{%@@ endif @@%} X11Forwarding yes -AuthorizedKeysFile .ssh/authorized_keys +AuthorizedKeysFile .ssh/authorized_keys PasswordAuthentication no +PermitRootLogin no ChallengeResponseAuthentication no UsePAM yes PrintMotd no # pam does that -Subsystem sftp /usr/lib/ssh/sftp-server +Subsystem sftp /usr/lib/ssh/sftp-server diff --git a/root/etc/sudoers.d/pacman b/root/etc/sudoers.d/pacman new file mode 100644 index 00000000..12be60e1 --- /dev/null +++ b/root/etc/sudoers.d/pacman @@ -0,0 +1 @@ +%wheel ALL = (root) NOPASSWD: /usr/bin/pacman diff --git a/root/etc/systemd/network/01-wired.network b/root/etc/systemd/network/01-wired.network new file mode 100644 index 00000000..3775e67c --- /dev/null +++ b/root/etc/systemd/network/01-wired.network @@ -0,0 +1,8 @@ +[Match] +Name=enp* + +[Network] +DHCP=yes + +[DHCP] +UseDomains=true diff --git a/root/etc/systemd/network/02-wireless.network b/root/etc/systemd/network/02-wireless.network new file mode 100644 index 00000000..0f966cc7 --- /dev/null +++ b/root/etc/systemd/network/02-wireless.network @@ -0,0 +1,8 @@ +[Match] +Name=w* + +[Network] +DHCP=yes + +[DHCP] +UseDomains=true diff --git a/root/etc/systemd/networkd.conf b/root/etc/systemd/networkd.conf new file mode 100644 index 00000000..966d4b58 --- /dev/null +++ b/root/etc/systemd/networkd.conf @@ -0,0 +1,3 @@ +[Network] +SpeedMeter=yes +SpeedMeterIntervalSec=10sec diff --git a/root/etc/systemd/sleep.conf b/root/etc/systemd/sleep.conf index fda7b736..3ade3978 100644 --- a/root/etc/systemd/sleep.conf +++ b/root/etc/systemd/sleep.conf @@ -1,5 +1,5 @@ [Sleep] AllowSuspendThenHibernate=yes -SuspendMode=suspend +SuspendMode=suspend-then-hibernate SuspendState=disk -HibernateDelaySec=120min +HibernateDelaySec=1min diff --git a/root/etc/systemd/system.conf b/root/etc/systemd/system.conf new file mode 100644 index 00000000..65ff02c8 --- /dev/null +++ b/root/etc/systemd/system.conf @@ -0,0 +1,2 @@ +[Manager] +DefaultTimeoutStopSec=30s diff --git a/root/etc/systemd/system/getty@tty1.service.d/override.conf b/root/etc/systemd/system/getty@tty1.service.d/override.conf deleted file mode 100644 index b3c5c28f..00000000 --- a/root/etc/systemd/system/getty@tty1.service.d/override.conf +++ /dev/null @@ -1,3 +0,0 @@ -[Service] -ExecStart= -ExecStart=-/usr/bin/agetty --skip-login --nonewline --noissue --autologin {{@@ env['USRNAME'] @@}} --noclear %I $TERM diff --git a/root/etc/systemd/system/iwd.service.d/override.conf b/root/etc/systemd/system/iwd.service.d/override.conf deleted file mode 100755 index 3f1920ca..00000000 --- a/root/etc/systemd/system/iwd.service.d/override.conf +++ /dev/null @@ -1,3 +0,0 @@ -[Unit] -BindsTo=sys-subsystem-net-devices-wlan0.device -After=sys-subsystem-net-devices-wlan0.device diff --git a/root/etc/systemd/system/iwd@.service b/root/etc/systemd/system/iwd@.service deleted file mode 100755 index 2dca19dc..00000000 --- a/root/etc/systemd/system/iwd@.service +++ /dev/null @@ -1,14 +0,0 @@ -[Unit] -Description=Wireless service on %I -BindsTo=sys-subsystem-net-devices-%i.device -After=sys-subsystem-net-devices-%i.device - -[Service] -Type=dbus -BusName=net.connman.iwd -ExecStart=/usr/lib/iwd/iwd --interface %i -LimitNPROC=1 -Restart=on-failure - -[Install] -WantedBy=multi-user.target diff --git a/root/etc/systemd/system/nightly-reboot.service b/root/etc/systemd/system/nightly-reboot.service deleted file mode 100644 index 702dda78..00000000 --- a/root/etc/systemd/system/nightly-reboot.service +++ /dev/null @@ -1,6 +0,0 @@ -[Unit] -Description=Nightly reboot - -[Service] -Type=simple -ExecStart=/usr/bin/systemctl reboot diff --git a/root/etc/systemd/system/nightly-reboot.timer b/root/etc/systemd/system/nightly-reboot.timer deleted file mode 100644 index a03a53c4..00000000 --- a/root/etc/systemd/system/nightly-reboot.timer +++ /dev/null @@ -1,8 +0,0 @@ -[Unit] -Description=Reboot Scheduling. - -[Timer] -OnCalendar=*-*-* 03:00:00 - -[Install] -WantedBy=multi-user.target diff --git a/root/etc/systemd/system/pacman-dl.service b/root/etc/systemd/system/pacman-dl.service deleted file mode 100755 index 43611ee8..00000000 --- a/root/etc/systemd/system/pacman-dl.service +++ /dev/null @@ -1,10 +0,0 @@ -[Unit] -Description=Download package updates -After=network-online.target - -[Service] -Type=oneshot -ExecStart=/usr/bin/pacman -Syuw --noconfirm - -[Install] -WantedBy=network-online.target diff --git a/root/etc/systemd/system/pacman-dl.timer b/root/etc/systemd/system/pacman-dl.timer deleted file mode 100644 index 1ffd0a9f..00000000 --- a/root/etc/systemd/system/pacman-dl.timer +++ /dev/null @@ -1,8 +0,0 @@ -[Unit] -Description=Download packages hourly - -[Timer] -OnCalendar=hourly - -[Install] -WantedBy=timers.target diff --git a/root/etc/systemd/system/qbittorrent.service b/root/etc/systemd/system/qbittorrent.service deleted file mode 100644 index ed7a42c0..00000000 --- a/root/etc/systemd/system/qbittorrent.service +++ /dev/null @@ -1,10 +0,0 @@ -[Unit] -Description=qBittorrent Daemon Service -After=network.target - -[Service] -User=qbtuser -ExecStart=/usr/bin/qbittorrent-nox --webui-port=8080 - -[Install] -WantedBy=multi-user.target diff --git a/root/etc/systemd/system/rtorrent.service b/root/etc/systemd/system/rtorrent.service deleted file mode 100644 index 38da7b4b..00000000 --- a/root/etc/systemd/system/rtorrent.service +++ /dev/null @@ -1,13 +0,0 @@ -[Unit] -Description=rTorrent in tmux -After=network.target - -[Service] -User=rtorrent -WorkingDirectory=/home/rtorrent -Environment="TERM=linux" -Type=forking -ExecStart=/bin/bash -c "/usr/bin/tmux -2u -L rtps-%u new-session -s rtps-%u -n rT-PS -d /bin/bash -c rtorrent" - -[Install] -WantedBy=default.target diff --git a/root/etc/systemd/timesyncd.conf b/root/etc/systemd/timesyncd.conf index e1aac332..243bc7a3 100644 --- a/root/etc/systemd/timesyncd.conf +++ b/root/etc/systemd/timesyncd.conf @@ -1,3 +1,3 @@ [Time] -NTP=0.arch.pool.ntp.org -FallbackNTP=0.pfsense.pool.ntp.org +NTP=esgaroth.korhonen.lan +FallbackNTP=0.pool.ntp.org diff --git a/root/etc/udev/rules.d/20-yubikey.rules b/root/etc/udev/rules.d/20-yubikey.rules new file mode 100644 index 00000000..92465054 --- /dev/null +++ b/root/etc/udev/rules.d/20-yubikey.rules @@ -0,0 +1 @@ +ACTION=="remove", ENV{ID_BUS}=="usb", ENV{ID_MODEL_ID}=="0407", ENV{ID_VENDOR_ID}=="1050", RUN+="/usr/bin/loginctl lock-sessions" diff --git a/root/usr/local/bin/audacity b/root/usr/local/bin/audacity deleted file mode 100755 index 22f7cecd..00000000 --- a/root/usr/local/bin/audacity +++ /dev/null @@ -1 +0,0 @@ -GTK_THEME=Adwaita /usr/bin/audacity $@ diff --git a/root/usr/local/bin/evenbetterlockscreen b/root/usr/local/bin/evenbetterlockscreen deleted file mode 100755 index 501a27dd..00000000 --- a/root/usr/local/bin/evenbetterlockscreen +++ /dev/null @@ -1,373 +0,0 @@ -#!/usr/bin/env bash - -# Author : Pavan Jadhaw -# Github Profile : https://github.com/pavanjadhaw -# Project Repository : https://github.com/pavanjadhaw/betterlockscreen - - -# create folder in ~/.cache/i3lock directory -folder="$HOME/.cache/i3lock" - -# ratio for rectangle to be drawn for time background on lockscreen -# Original Image -orig_wall="$folder/wall.png" - -# Versions (from here) -# You can use these images to set different versions as wallpaper -# lockscreen background. -resized="$folder/resized.png" # resized image for your resolution - -# images to be used as wallpaper -dim="$folder/dim.png" # image with subtle overlay of black -blur="$folder/blur.png" # blurred version -dimblur="$folder/dimblur.png" - -# lockscreen images (images to be used as lockscreen background) -l_resized="$folder/l_resized.png" -l_dim="$folder/l_dim.png" -l_blur="$folder/l_blur.png" -l_dimblur="$folder/l_dimblur.png" - - -prelock() { - pkill -u "$USER" -USR1 dunst -} - -lock() { - #$1 image path - letterEnteredColor=d23c3dff - letterRemovedColor=d23c3dff - passwordCorrect=00000000 - passwordIncorrect=d23c3dff - background=00000000 - foreground=ffffffff - i3lock \ - -n \ - --timestr="%H:%M" \ - -t -i "$1" \ - --timepos="110:h-70" \ - --datepos="135:h-45" \ - --clock --datestr "Type password to unlock" \ - --insidecolor=$background --ringcolor=$foreground --line-uses-inside \ - --keyhlcolor=$letterEnteredColor --bshlcolor=$letterRemovedColor --separatorcolor=$background \ - --insidevercolor=$passwordCorrect --insidewrongcolor=$passwordIncorrect \ - --ringvercolor=$foreground --ringwrongcolor=$foreground --indpos="x+280:h-70" \ - --radius=20 --ring-width=4 --veriftext="" --wrongtext="" \ - --verifcolor="$foreground" --timecolor="$foreground" --datecolor="$foreground" \ - --noinputtext="" \ - --force-clock -} - -postlock() { - pkill -u "$USER" -USR2 dunst -} - -rec_get_random() { - dir="$1" - if [ ! -d "$dir" ]; then - user_input="$dir" - return - fi - dir=($dir/*) - dir=${dir[RANDOM % ${#dir[@]}]} - rec_get_random "$dir" -} - -usage() { - - echo "Important : Update the image cache, Ex: betterlockscreen -u path/to/image.jpg" - echo " Image cache must be updated to initially configure or update wallpaper used" - echo - echo - echo "See : https://github.com/pavanjadhaw/betterlockscreen for additional info..." - echo - echo - echo "Options:" - echo - echo " -h --help" - - echo " For help. Ex: betterlockscreen -h or betterlockscreen --help" - echo - echo - echo " -u --update" - echo " to update image cache, you should do this before using any other options" - - echo " Ex: betterlockscreen -u path/to/image.png when image.png is custom background" - echo " Or you can use betterlockscreen -u path/to/imagedir and a random file will be selected" - echo - echo - echo " -l --lock" - echo " to lock screen, Ex. betterlockscreen -l" - echo " you can also use dimmed or blurred background for lockscreen" - echo " Ex: betterlockscreen -l dim (for dimmed background)" - echo " Ex: betterlockscreen -l blur (for blurred background)" - echo " Ex: betterlockscreen -l dimblur (for dimmed + blurred background)" - echo - echo - echo " -s --suspend" - echo " to suspend system and lock screen, Ex. betterlockscreen -s" - echo " you can also use dimmed or blurred background for lockscreen" - echo " Ex: betterlockscreen -s dim (for dimmed background)" - echo " Ex: betterlockscreen -s blur (for blurred background)" - echo " Ex: betterlockscreen -s dimblur (for dimmed + blurred background)" - echo - echo - echo " -w --wall" - echo " you can also set lockscreen background as wallpaper" - echo " to set wallpaper. Ex betterlockscreen -w or betterlockscreen --wall" - echo " you can also use dimmed or blurred variants" - echo " Ex: betterlockscreen -w dim (for dimmed wallpaper)" - echo " Ex: betterlockscreen -w blur (for blurred wallpaper)" - echo " Ex: betterlockscreen -w dimblur (for dimmed + blurred wallpaper)" - echo - echo - echo " -r --resolution" - echo " to be used after -u" - echo " used to set a custom resolution for the image cache." - echo " Ex: betterlockscreen -u path/to/image.png -r 1920x1080" - echo " Ex: betterlockscreen -u path/to/image.png --resolution 3840x1080" - echo - echo " -b --blur" - echo " to be used after -u" - echo " used to set blur intensity. Default to 1." - echo " Ex: betterlockscreen -u path/to/image.png -b 3" - echo " Ex: betterlockscreen -u path/to/image.png --blur 0.5" - echo - -} - -# Options -case "$1" in - "") - if [ ! -f $l_dim ]; then - - echo "Important : Update the image cache, Ex. betterlockscreen -u path/to/image.jpg" - echo - echo " Image cache must be updated to initially configure or update wallpaper used" - echo - echo "See also : For other set of options and help use help command." - echo "Ex. betterlockscreen -h or betterlockscreen --help" - - echo - echo "See : https://github.com/pavanjadhaw/betterlockscreen for addition info..." - exit 1 - else - echo - echo "Seems you havent provided any argument, see below for usage info" - echo - echo "See also : For other set of options and help use help command." - - echo "Ex. betterlockscreen -h or betterlockscreen --help" - - echo - echo "See : https://github.com/pavanjadhaw/betterlockscreen for addition info..." - echo - exit 1 - fi - ;; - - -h | --help) - - usage - - ;; - - -l | --lock) - case "$2" in - "") - # default lockscreen - prelock - lock "$l_resized" - postlock - ;; - - dim) - # lockscreen with dimmed background - prelock - lock "$l_dim" - postlock - ;; - - blur) - # set lockscreen with blurred background - prelock - lock "$l_blur" - postlock - ;; - - dimblur) - # set lockscreen with dimmed + blurred background - prelock - lock "$l_dimblur" - postlock - ;; - esac - ;; - - -s | --suspend) - case "$2" in - "") - # default lockscreen - prelock - lock "$l_resized" && systemctl suspend - postlock - ;; - - dim) - # lockscreen with dimmed background - prelock - lock "$l_dim" && systemctl suspend - postlock - ;; - - blur) - # set lockscreen with blurred background - prelock - lock "$l_blur" && systemctl suspend - postlock - ;; - - dimblur) - # set lockscreen with dimmed + blurred background - prelock - lock "$l_dimblur" && systemctl suspend - postlock - ;; - esac - ;; - - - -w | --wall) - case "$2" in - "") - # set resized image as wallpaper if no argument is supplied by user - feh --bg-fill $resized - ;; - - dim) - # set dimmed image as wallpaper - feh --bg-fill $dim - ;; - - blur) - # set blurred image as wallpaper - feh --bg-fill $blur - ;; - - dimblur) - # set dimmed + blurred image as wallpaper - feh --bg-fill $dimblur - ;; - esac - ;; - - -u | --update) - background="$2" - shift 2 - - # find your resolution so images can be resized to match your screen resolution - y_res=$(xdpyinfo | grep dimensions | sed -r 's/^[^0-9]*([0-9]+x[0-9]+).*$/\1/') - # default blur level - blur_level=1 - - # parse update arguments - while [ $# -gt 0 ]; do - case "$1" in - -r | --resolution ) - y_res="$2" - shift 2 - ;; - -b | --blur ) - blur_level="$2" - shift 2 - ;; - *) - shift ;; - esac - done - - rectangles=" " - SR=$(xrandr --query | grep ' connected' | grep -o '[0-9][0-9]*x[0-9][0-9]*[^ ]*') - for RES in $SR; do - SRA=(${RES//[x+]/ }) - CX=$((${SRA[2]} + 25)) - CY=$((${SRA[1]} - 30)) - rectangles+="rectangle $CX,$CY $((CX+300)),$((CY-80)) " - done - - # User supplied Image - user_image="$folder/user_image.png" - - # create folder - if [ ! -d $folder ]; then - echo "Creating '$folder' directory to cache processed images." - mkdir -p "$folder" - fi - - # get random file in dir if passed argument is a dir - rec_get_random "$background" - - # get user image - cp "$user_input" "$user_image" - if [ ! -f $user_image ]; then - echo "Please specify the path to the image you would like to use" - exit 1 - fi - - # replace orignal with user image - cp "$user_image" "$orig_wall" - rm "$user_image" - - echo "Generating alternate images based on the image you specified," - echo "please wait this might take few seconds..." - - # wallpapers - - echo - echo "Converting provided image to match your resolution..." - # resize image - convert "$orig_wall" -resize "$y_res""^" -gravity center -extent "$y_res" "$resized" - - echo - echo "Applying dim and blur effect to resized image" - # dim - convert "$resized" -fill black -colorize 40% "$dim" - - # blur - blur_shrink=$(echo "scale=2; 20 / $blur_level" | bc) - blur_sigma=$(echo "scale=2; 0.6 * $blur_level" | bc) - convert "$resized" \ - -filter Gaussian \ - -resize "$blur_shrink%" \ - -define "filter:sigma=$blur_sigma" \ - -resize "$y_res^" -gravity center -extent "$y_res" \ - "$blur" - - # dimblur - convert "$dim" \ - -filter Gaussian \ - -resize "$blur_shrink%" \ - -define "filter:sigma=$blur_sigma" \ - -resize "$y_res^" -gravity center -extent "$y_res" \ - "$dimblur" - - # lockscreen backgrounds - - echo - echo "Caching images for faster screen locking" - # resized - convert "$resized" -draw "fill rgba(0, 0, 0, 0.4) $rectangles" "$l_resized" - - # dim - convert "$dim" -draw "fill rgba(0, 0, 0, 0.4) $rectangles" "$l_dim" - - # blur - convert "$blur" -draw "fill rgba(0, 0, 0, 0.4) $rectangles" "$l_blur" - - # blur - convert "$dimblur" -draw "fill rgba(0, 0, 0, 0.4) $rectangles" "$l_dimblur" - echo - echo "All required changes have been applied" - ;; -esac - diff --git a/root/usr/local/bin/gnome-terminal b/root/usr/local/bin/gnome-terminal deleted file mode 100755 index 54812cd2..00000000 --- a/root/usr/local/bin/gnome-terminal +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash -if [ $# -eq 1 ]; then - /usr/bin/alacritty -e "nvim $1" -else - /usr/bin/alacritty -e "$@" -fi diff --git a/root/usr/local/bin/ikhal b/root/usr/local/bin/ikhal deleted file mode 100755 index 687c8cbb..00000000 --- a/root/usr/local/bin/ikhal +++ /dev/null @@ -1 +0,0 @@ -LANG="en_US.UTF-8" /usr/bin/ikhal $* diff --git a/root/usr/local/bin/khal b/root/usr/local/bin/khal deleted file mode 100755 index 4597e2fe..00000000 --- a/root/usr/local/bin/khal +++ /dev/null @@ -1 +0,0 @@ -LANG="en_US.UTF-8" /usr/bin/khal $* diff --git a/root/usr/local/bin/qtwebflix b/root/usr/local/bin/qtwebflix deleted file mode 100755 index f33cd83d..00000000 --- a/root/usr/local/bin/qtwebflix +++ /dev/null @@ -1 +0,0 @@ -/usr/lib/qtwebflix --register-pepper-plugins="/usr/lib/qt/plugins/ppapi/libwidevinecdmadapter.so; application/x-ppapi-widevine-cdm" diff --git a/root/usr/local/bin/sway-run.sh b/root/usr/local/bin/sway-run.sh new file mode 100755 index 00000000..ac015c91 --- /dev/null +++ b/root/usr/local/bin/sway-run.sh @@ -0,0 +1,45 @@ +#!/bin/sh + +# Set environment variables for Sway + +# Firefox +export MOZ_ENABLE_WAYLAND=1 +export MOZ_USE_XINPUT2=1 +export MOZ_WEBRENDER=1 +export MOZ_DBUS_REMOTE=1 + +# Enable xdg-desktop-portal-wlr +export XDG_CURRENT_DESKTOP=sway +export XDG_SESSION_TYPE=wayland + +# Fix java on wayland +export _JAVA_AWT_WM_NONREPARENTING=1 +export _JAVA_OPTIONS='-Dawt.useSystemAAFontSettings=on -Dswing.aatext=true -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel' + +# Enable qt5 theming and wayland support +export QT_QPA_PLATFORMTHEME=qt5ct +export QT_QPA_PLATFORM=wayland +export QT_WAYLAND_DISABLE_WINDOWDECORATION=1 + +# Enable wayland support on clutter +export CLUTTER_BACKEND=wayland + +# Fix redshift on wlroots +export WLR_DRM_NO_ATOMIC=1 + +# Run sway +dbus-run-session sway + +# Unset the variables after quitting Sway +unset MOZ_ENABLE_WAYLAND +unset MOZ_USE_XINPUT2 +unset MOZ_WEBRENDER +unset MOZ_DBUS_REMOTE +unset _JAVA_AWT_WM_NONREPARENTING +unset _JAVA_OPTIONS +unset QT_QPA_PLATFORMTHEME +unset QT_QPA_PLATFORM +unset QT_WAYLAND_DISABLE_WINDOWDECORATION +unset CLUTTER_BACKEND +unset WLR_DRM_NO_ATOMIC +unset XDG_CURRENT_DESKTOP diff --git a/root/usr/local/bin/telegram-desktop b/root/usr/local/bin/telegram-desktop deleted file mode 100755 index 05f66f23..00000000 --- a/root/usr/local/bin/telegram-desktop +++ /dev/null @@ -1 +0,0 @@ -LANG=en_DK.UTF-8 QT_QPA_PLATFORMTHEME="" QT_STYLE_OVERRIDE="" /usr/bin/telegram-desktop $@ diff --git a/scripts/fhackeditor b/scripts/fhackeditor new file mode 100755 index 00000000..7a1d4934 --- /dev/null +++ b/scripts/fhackeditor @@ -0,0 +1,9 @@ +#!/bin/sh +# Script to launch a graphical editor if in graphical mode, +# terminal editor otherwise + +if [ -n "$DISPLAY" ] || [ -n "$WAYLAND_DISPLAY" ]; then + echo "Running in graphical mode" +else + echo "Running in TTY mode" +fi diff --git a/scripts/hibernate-lowbattery.sh b/scripts/hibernate-lowbattery.sh new file mode 100755 index 00000000..71fb0d16 --- /dev/null +++ b/scripts/hibernate-lowbattery.sh @@ -0,0 +1,9 @@ +#!/bin/sh +acpi -b | awk -F'[,:%]' '{print $2, $3}' | { + read -r status capacity + + if [ "$status" = Discharging -a "$capacity" -lt 5 ]; then + logger "Critical battery threshold" + systemctl hibernate + fi +} diff --git a/secrets/env b/secrets/env index c9e35d7b..aeb2ded3 100755 --- a/secrets/env +++ b/secrets/env @@ -1,12 +1,25 @@ #!/bin/bash -export PASS_LIBREFM="$(pass entertainment/libre.fm | head -n 1)" -export PASS_MUSICBRAINZ="$(pass entertainment/musicbrainz.org | head -n 1)" +export PASS_LIBREFM="$(pass entertainment/libre.fm | head -1)" +export PASS_MUSICBRAINZ="$(pass entertainment/musicbrainz.org | head -1)" export PASS_LISTENBRAINZ="$(pass entertainment/musicbrainz.org | rg 'listenbrainz_token' | cut -d' ' -f2-)" -export PASS_MUSPY="$(pass entertainment/muspy.com | head -n 1)" -export PASS_ARIA2="$(pass linux/aria2 | head -n 1)" -export PASS_MPD="$(pass linux/mpd | head -n 1)" -export PASS_MPD_ADMIN="$(pass linux/mpd-admin | head -n 1)" +export PASS_MUSPY="$(pass entertainment/muspy.com | head -1)" +export PASS_ARIA2="$(pass linux/aria2 | head -1)" +export PASS_MPD="$(pass linux/mpd | head -1)" +export PASS_MPD_ADMIN="$(pass linux/mpd-admin | head -1)" +export PASS_MQTT="$(pass selfhosted/mqtt.reekynet.com | head -1)" -export ME_FULLNAME="$(pass me | head -n 1)" +export PASS_EMAIL_HACKER="$(pass email/functionalhacker@korhonen.cc | head -1)" +export PASS_EMAIL_MARKO="$(pass email/marko@korhonen.cc | head -1)" +export PASS_EMAIL_ADMIN="$(pass email/admin@korhonen.cc | head -1)" + +export ME_FULLNAME="$(pass me | head -1)" export ME_ADDRESS="$(pass me | rg 'address' | cut -d' ' -f2-)" export ME_PHONE="$(pass me | rg 'phone' | cut -d' ' -f2-)" +export ME_EMAIL="$(pass me | rg 'email' | cut -d' ' -f2-)" + +export WIREGUARD_MIRKWOOD_PRIVKEY="$(pass selfhosted/wireguard/mirkwood | grep PrivateKey | cut -d' ' -f2-)" +export WIREGUARD_MIRKWOOD_PUBKEY="$(pass selfhosted/wireguard/mirkwood | grep PublicKey | cut -d' ' -f2-)" +export WIREGUARD_MIRKWOOD_PSK="$(pass selfhosted/wireguard/mirkwood | grep PreSharedKey | cut -d' ' -f2-)" + +export WIREGUARD_MORIA_PRIVKEY="$(pass selfhosted/wireguard/moria | grep PrivateKey | cut -d' ' -f2-)" +export WIREGUARD_MORIA_PUBKEY="$(pass selfhosted/wireguard/moria | grep PublicKey | cut -d' ' -f2-)" diff --git a/secrets/secrets.sh b/secrets/secrets.sh index 2de5945f..2232d5e4 100755 --- a/secrets/secrets.sh +++ b/secrets/secrets.sh @@ -2,7 +2,7 @@ source $DOTREPO/secrets/env -cat < $DOTREPO/secrets/secrets +cat <$DOTREPO/secrets/secrets export PASS_LIBREFM="$PASS_LIBREFM" export PASS_MUSICBRAINZ="$PASS_MUSICBRAINZ" export PASS_LISTENBRAINZ="$PASS_LISTENBRAINZ" @@ -10,8 +10,24 @@ export PASS_MUSPY="$PASS_MUSPY" export PASS_ARIA2="$PASS_ARIA2" export PASS_MPD="$PASS_MPD" export PASS_MPD_ADMIN="$PASS_MPD_ADMIN" +export PASS_IPMI="$PASS_IPMI" +export PASS_MQTT="$PASS_MQTT" + +export PASS_EMAIL_HACKER="$PASS_EMAIL_HACKER" +export PASS_EMAIL_MARKO="$PASS_EMAIL_MARKO" +export PASS_EMAIL_ADMIN="$PASS_EMAIL_ADMIN" export ME_FULLNAME="$ME_FULLNAME" export ME_ADDRESS="$ME_ADDRESS" export ME_PHONE="$ME_PHONE" +export ME_EMAIL="$ME_EMAIL" + +export WIREGUARD_MIRKWOOD_PRIVKEY="$WIREGUARD_MIRKWOOD_PRIVKEY" +export WIREGUARD_MIRKWOOD_PUBKEY="$WIREGUARD_MIRKWOOD_PUBKEY" +export WIREGUARD_MIRKWOOD_PSK="$WIREGUARD_MIRKWOOD_PSK" + +export WIREGUARD_MORIA_PRIVKEY="$WIREGUARD_MORIA_PRIVKEY" +export WIREGUARD_MORIA_PUBKEY="$WIREGUARD_MORIA_PUBKEY" SECRET + +chmod 600 $DOTREPO/secrets/secrets