diff --git a/.config/fontconfig/fonts.conf b/.config/fontconfig/fonts.conf index 77fdc3ff..a583463b 100755 --- a/.config/fontconfig/fonts.conf +++ b/.config/fontconfig/fonts.conf @@ -4,7 +4,7 @@ serif - Linux Libertine + Noto Serif Joy Pixels Noto Color Emoji @@ -12,7 +12,7 @@ sans-serif - Linux Biolinum + Noto Sans Joy Pixels Noto Color Emoji @@ -20,7 +20,7 @@ sans - Linux Biolinum + Noto Sans Joy Pixels Noto Color Emoji @@ -28,7 +28,7 @@ monospace - Fira Code + JetBrainsMono Nerd Font Mono Liberation Mono Braille diff --git a/.config/kitty/kitty.conf b/.config/kitty/kitty.conf index 362721d4..5e3f4822 100644 --- a/.config/kitty/kitty.conf +++ b/.config/kitty/kitty.conf @@ -5,7 +5,7 @@ font_family JetBrainsMono Nerd Font Mono bold_font auto italic_font auto bold_italic_font auto -font_size 14.0 +font_size 12.0 disable_ligatures cursor #: }}} @@ -40,31 +40,13 @@ window_alert_on_bell no #: }}} #: Tab bar {{{ -tab_activity_symbol none -bell_on_tab no -tab_separator "" -tab_bar_edge bottom -tab_bar_margin_width 0.0 -tab_bar_margin_height 0.0 0.0 -tab_bar_style custom -tab_bar_align left -tab_bar_min_tabs 1 -tab_switch_strategy previous -tab_title_template " 祿{f'{title[:6]}…{title[-6:]}' if title.rindex(title[-1]) + 1 > 25 else title}" -active_tab_title_template " 綠{f'{title[:6]}…{title[-6:]}' if title.rindex(title[-1]) + 1 > 25 else title}" -active_tab_foreground #c0caf5 -active_tab_background #101014 -active_tab_font_style bold -inactive_tab_foreground #414868 -inactive_tab_background #101014 -inactive_tab_font_style bold -tab_bar_background #101014 +tab_bar_style hidden #: }}} #: Color scheme {{{ foreground #a9b1d6 background #1a1b26 -background_opacity 1 +background_opacity 0.8 dim_opacity 0.75 selection_foreground none selection_background #28344a @@ -97,7 +79,7 @@ color15 #c0caf5 #: Advanced {{{ close_on_child_death no -allow_remote_control yes +allow_remote_control no listen_on none #: }}} @@ -111,9 +93,8 @@ clear_all_shortcuts yes kitty_mod ctrl+shift map kitty_mod+c copy_to_clipboard map kitty_mod+v paste_from_clipboard -#: }}} -#: Scrolling {{{ +# Scrolling map kitty_mod+up scroll_line_up map kitty_mod+down scroll_line_down map kitty_mod+page_up scroll_page_up @@ -124,25 +105,13 @@ map kitty_mod+y scroll_to_prompt -1 map kitty_mod+x scroll_to_prompt 1 map kitty_mod+h show_scrollback map kitty_mod+g show_last_command_output -#: }}} -#: Tab management {{{ -map shift+right next_tab -map shift+left previous_tab -map kitty_mod+t new_tab -map kitty_mod+r close_tab -map kitty_mod+right move_tab_forward -map kitty_mod+left move_tab_backward -map kitty_mod+alt+t set_tab_title -#: }}} - -#: Font sizes {{{ +# Font sizes map kitty_mod+plus change_font_size all +2.0 map kitty_mod+minus change_font_size all -2.0 map kitty_mod+backspace change_font_size all 0 -#: }}} -#: Select and act on visible text {{{ +# Select and act on visible text map kitty_mod+e open_url_with_hints map kitty_mod+p>f kitten hints --type path --program - map kitty_mod+p>shift+f kitten hints --type path @@ -151,11 +120,10 @@ map kitty_mod+p>w kitten hints --type word --program - map kitty_mod+p>h kitten hints --type hash --program - map kitty_mod+p>n kitten hints --type linenum map kitty_mod+p>y kitten hints --type hyperlink -#: }}} -#: Miscellaneous {{{ +# Miscellaneous map kitty_mod+f2 edit_config_file map kitty_mod+f5 load_config_file -#: }}} #: }}} + diff --git a/.config/kitty/kittyfullscreen.conf b/.config/kitty/kittyfullscreen.conf new file mode 100644 index 00000000..9de3ede0 --- /dev/null +++ b/.config/kitty/kittyfullscreen.conf @@ -0,0 +1,155 @@ +# vim:fileencoding=utf-8:foldmethod=marker + +#: Fonts {{{ +font_family JetBrainsMono Nerd Font Mono +bold_font auto +italic_font auto +bold_italic_font auto +font_size 12.0 +disable_ligatures cursor +#: }}} + +#: Cursor customization {{{ +cursor #c0caf5 +cursor_text_color #1a1b26 +cursor_stop_blinking_after 10.0 +#: }}} + +#: Scrollback {{{ +scrollback_lines 20000 +scrollback_pager_history_size 10 +scrollback_fill_enlarged_window yes +#: }}} + +#: Mouse {{{ +mouse_hide_wait -1 +url_color #9ece6a +pointer_shape_when_dragging hand +rectangle_select_modifiers ctrl+alt +focus_follows_mouse yes +#: }}} + +#: Performance tuning {{{ +repaint_delay 7 +input_delay 2 +#: }}} + +#: Terminal bell {{{ +enable_audio_bell no +window_alert_on_bell no +#: }}} + +#: Tab bar {{{ +tab_activity_symbol none +bell_on_tab no +tab_separator "" +tab_bar_edge bottom +tab_bar_margin_width 0.0 +tab_bar_margin_height 0.0 0.0 +tab_bar_style custom +tab_bar_align left +tab_bar_min_tabs 1 +tab_switch_strategy previous +tab_title_template " 祿{f'{title[:6]}…{title[-6:]}' if title.rindex(title[-1]) + 1 > 25 else title}" +active_tab_title_template " 綠{f'{title[:6]}…{title[-6:]}' if title.rindex(title[-1]) + 1 > 25 else title}" +active_tab_foreground #c0caf5 +active_tab_background #101014 +active_tab_font_style bold +inactive_tab_foreground #414868 +inactive_tab_background #101014 +inactive_tab_font_style bold +tab_bar_background #101014 +#: }}} + +#: Color scheme {{{ +foreground #a9b1d6 +background #1a1b26 +background_opacity 1 +dim_opacity 0.75 +selection_foreground none +selection_background #28344a +#: The color table {{{ +#: black +color0 #414868 +color8 #414868 +#: red +color1 #f7768e +color9 #f7768e +#: green +color2 #73daca +color10 #73daca +color3 #e0af68 +color11 #e0af68 +#: blue +color4 #7aa2f7 +color12 #7aa2f7 +#: magenta +color5 #bb9af7 +color13 #bb9af7 +#: cyan +color6 #7dcfff +color14 #7dcfff +#: white +color7 #c0caf5 +color15 #c0caf5 +#: }}} +#: }}} + +#: Advanced {{{ +close_on_child_death no +allow_remote_control no +listen_on none +#: }}} + +#: OS specific tweaks {{{ +linux_display_server x11 +confirm_os_window_close 2 +#: }}} + +#: Keyboard shortcuts {{{ +clear_all_shortcuts yes +kitty_mod ctrl+shift +map kitty_mod+c copy_to_clipboard +map kitty_mod+v paste_from_clipboard + +# Scrolling +map kitty_mod+up scroll_line_up +map kitty_mod+down scroll_line_down +map kitty_mod+page_up scroll_page_up +map kitty_mod+page_down scroll_page_down +map kitty_mod+home scroll_home +map kitty_mod+end scroll_end +map kitty_mod+y scroll_to_prompt -1 +map kitty_mod+x scroll_to_prompt 1 +map kitty_mod+h show_scrollback +map kitty_mod+g show_last_command_output + +# Tab management +map shift+right next_tab +map shift+left previous_tab +map kitty_mod+t new_tab +map kitty_mod+r close_tab +map kitty_mod+right move_tab_forward +map kitty_mod+left move_tab_backward +map kitty_mod+alt+t set_tab_title + +# Font sizes +map kitty_mod+plus change_font_size all +2.0 +map kitty_mod+minus change_font_size all -2.0 +map kitty_mod+backspace change_font_size all 0 + +# Select and act on visible text +map kitty_mod+e open_url_with_hints +map kitty_mod+p>f kitten hints --type path --program - +map kitty_mod+p>shift+f kitten hints --type path +map kitty_mod+p>l kitten hints --type line --program - +map kitty_mod+p>w kitten hints --type word --program - +map kitty_mod+p>h kitten hints --type hash --program - +map kitty_mod+p>n kitten hints --type linenum +map kitty_mod+p>y kitten hints --type hyperlink + +# Miscellaneous +map kitty_mod+f2 edit_config_file +map kitty_mod+f5 load_config_file + +#: }}} diff --git a/.config/lvim/plugin/packer_compiled.lua b/.config/lvim/plugin/packer_compiled.lua index 4590006a..e2a8c2b8 100644 --- a/.config/lvim/plugin/packer_compiled.lua +++ b/.config/lvim/plugin/packer_compiled.lua @@ -123,13 +123,6 @@ _G.packer_plugins = { path = "/home/luca/.local/share/lunarvim/site/pack/packer/start/cmp_luasnip", url = "https://github.com/saadparwaiz1/cmp_luasnip" }, - ["diffview.nvim"] = { - loaded = false, - needs_bufread = false, - only_cond = false, - path = "/home/luca/.local/share/lunarvim/site/pack/packer/opt/diffview.nvim", - url = "https://github.com/sindrets/diffview.nvim" - }, ["friendly-snippets"] = { loaded = true, path = "/home/luca/.local/share/lunarvim/site/pack/packer/start/friendly-snippets", @@ -338,44 +331,44 @@ if not vim.g.packer_custom_loader_enabled then vim.g.packer_custom_loader_enabled = true end --- Config for: LuaSnip -time([[Config for LuaSnip]], true) -try_loadstring("\27LJ\2\n\3\0\0\v\0\23\00166\0\0\0'\2\1\0B\0\2\0024\1\0\0006\2\2\0009\2\3\0029\2\4\0029\2\5\0029\2\6\2\15\0\2\0X\3\f\21\2\1\0\22\2\0\0029\3\a\0006\5\b\0B\5\1\2'\6\t\0'\a\n\0'\b\v\0'\t\f\0'\n\r\0B\3\a\2<\3\2\0019\2\a\0006\4\14\0B\4\1\2'\5\15\0B\2\3\0029\3\16\0\18\5\2\0B\3\2\2\15\0\3\0X\4\3\21\3\1\0\22\3\0\3<\2\3\0016\3\0\0'\5\17\0B\3\2\0029\3\18\3B\3\1\0016\3\0\0'\5\19\0B\3\2\0029\3\18\0035\5\20\0=\1\21\5B\3\2\0016\3\0\0'\5\22\0B\3\2\0029\3\18\3B\3\1\1K\0\1\0\"luasnip.loaders.from_snipmate\npaths\1\0\0 luasnip.loaders.from_vscode\14lazy_load\29luasnip.loaders.from_lua\17is_directory\rsnippets\19get_config_dir\22friendly-snippets\nstart\vpacker\tpack\tsite\20get_runtime_dir\15join_paths\22friendly_snippets\fsources\fluasnip\fbuiltin\tlvim\15lvim.utils\frequire\2\0", "config", "LuaSnip") -time([[Config for LuaSnip]], false) --- Config for: nvim-treesitter -time([[Config for nvim-treesitter]], true) -try_loadstring("\27LJ\2\nB\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\25lvim.core.treesitter\frequire\0", "config", "nvim-treesitter") -time([[Config for nvim-treesitter]], false) --- Config for: telescope.nvim -time([[Config for telescope.nvim]], true) -try_loadstring("\27LJ\2\nA\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\24lvim.core.telescope\frequire\0", "config", "telescope.nvim") -time([[Config for telescope.nvim]], false) --- Config for: nvim-autopairs -time([[Config for nvim-autopairs]], true) -try_loadstring("\27LJ\2\nA\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\24lvim.core.autopairs\frequire\0", "config", "nvim-autopairs") -time([[Config for nvim-autopairs]], false) --- Config for: lualine.nvim -time([[Config for lualine.nvim]], true) -try_loadstring("\27LJ\2\n?\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\22lvim.core.lualine\frequire\0", "config", "lualine.nvim") -time([[Config for lualine.nvim]], false) --- Config for: alpha-nvim -time([[Config for alpha-nvim]], true) -try_loadstring("\27LJ\2\n=\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\20lvim.core.alpha\frequire\0", "config", "alpha-nvim") -time([[Config for alpha-nvim]], false) -- Config for: nvim-cmp time([[Config for nvim-cmp]], true) try_loadstring("\27LJ\2\n`\0\0\3\0\6\0\v6\0\0\0009\0\1\0009\0\2\0\15\0\0\0X\1\56\0\3\0'\2\4\0B\0\2\0029\0\5\0B\0\1\1K\0\1\0\nsetup\18lvim.core.cmp\frequire\bcmp\fbuiltin\tlvim\0", "config", "nvim-cmp") time([[Config for nvim-cmp]], false) +-- Config for: alpha-nvim +time([[Config for alpha-nvim]], true) +try_loadstring("\27LJ\2\n=\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\20lvim.core.alpha\frequire\0", "config", "alpha-nvim") +time([[Config for alpha-nvim]], false) +-- Config for: nvim-autopairs +time([[Config for nvim-autopairs]], true) +try_loadstring("\27LJ\2\nA\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\24lvim.core.autopairs\frequire\0", "config", "nvim-autopairs") +time([[Config for nvim-autopairs]], false) +-- Config for: nvim-treesitter +time([[Config for nvim-treesitter]], true) +try_loadstring("\27LJ\2\nB\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\25lvim.core.treesitter\frequire\0", "config", "nvim-treesitter") +time([[Config for nvim-treesitter]], false) +-- Config for: lualine.nvim +time([[Config for lualine.nvim]], true) +try_loadstring("\27LJ\2\n?\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\22lvim.core.lualine\frequire\0", "config", "lualine.nvim") +time([[Config for lualine.nvim]], false) -- Config for: project.nvim time([[Config for project.nvim]], true) try_loadstring("\27LJ\2\n?\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\22lvim.core.project\frequire\0", "config", "project.nvim") time([[Config for project.nvim]], false) +-- Config for: telescope.nvim +time([[Config for telescope.nvim]], true) +try_loadstring("\27LJ\2\nA\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\24lvim.core.telescope\frequire\0", "config", "telescope.nvim") +time([[Config for telescope.nvim]], false) +-- Config for: LuaSnip +time([[Config for LuaSnip]], true) +try_loadstring("\27LJ\2\n\3\0\0\v\0\23\00166\0\0\0'\2\1\0B\0\2\0024\1\0\0006\2\2\0009\2\3\0029\2\4\0029\2\5\0029\2\6\2\15\0\2\0X\3\f\21\2\1\0\22\2\0\0029\3\a\0006\5\b\0B\5\1\2'\6\t\0'\a\n\0'\b\v\0'\t\f\0'\n\r\0B\3\a\2<\3\2\0019\2\a\0006\4\14\0B\4\1\2'\5\15\0B\2\3\0029\3\16\0\18\5\2\0B\3\2\2\15\0\3\0X\4\3\21\3\1\0\22\3\0\3<\2\3\0016\3\0\0'\5\17\0B\3\2\0029\3\18\3B\3\1\0016\3\0\0'\5\19\0B\3\2\0029\3\18\0035\5\20\0=\1\21\5B\3\2\0016\3\0\0'\5\22\0B\3\2\0029\3\18\3B\3\1\1K\0\1\0\"luasnip.loaders.from_snipmate\npaths\1\0\0 luasnip.loaders.from_vscode\14lazy_load\29luasnip.loaders.from_lua\17is_directory\rsnippets\19get_config_dir\22friendly-snippets\nstart\vpacker\tpack\tsite\20get_runtime_dir\15join_paths\22friendly_snippets\fsources\fluasnip\fbuiltin\tlvim\15lvim.utils\frequire\2\0", "config", "LuaSnip") +time([[Config for LuaSnip]], false) vim.cmd [[augroup packer_load_aucmds]] vim.cmd [[au!]] -- Event lazy-loads time([[Defining lazy-load event autocommands]], true) -vim.cmd [[au BufRead * ++once lua require("packer.load")({'vim-sanegx', 'gitsigns.nvim', 'Comment.nvim', 'diffview.nvim', 'todo-comments.nvim', 'numb.nvim'}, { event = "BufRead *" }, _G.packer_plugins)]] vim.cmd [[au BufWinEnter * ++once lua require("packer.load")({'bufferline.nvim', 'which-key.nvim', 'toggleterm.nvim'}, { event = "BufWinEnter *" }, _G.packer_plugins)]] +vim.cmd [[au BufRead * ++once lua require("packer.load")({'todo-comments.nvim', 'vim-sanegx', 'gitsigns.nvim', 'numb.nvim', 'Comment.nvim'}, { event = "BufRead *" }, _G.packer_plugins)]] vim.cmd [[au BufReadPost * ++once lua require("packer.load")({'nvim-ts-context-commentstring'}, { event = "BufReadPost *" }, _G.packer_plugins)]] time([[Defining lazy-load event autocommands]], false) vim.cmd("augroup END") diff --git a/.config/pipewire/pipewire.conf b/.config/pipewire/pipewire.conf index ae5c76e9..f39d44b5 100644 --- a/.config/pipewire/pipewire.conf +++ b/.config/pipewire/pipewire.conf @@ -236,7 +236,7 @@ context.exec = [ # but it is better to start it as a systemd service. # Run the session manager with -h for options. # - { path = "/usr/bin/pipewire-media-session" args = "" } + { path = "/usr/bin/wireplumber" args = "" } # # You can optionally start the pulseaudio-server here as well # but it is better to start it as a systemd service. @@ -245,3 +245,4 @@ context.exec = [ # { path = "/usr/bin/pipewire" args = "-c pipewire-pulse.conf" } ] + diff --git a/.config/shell/aliasrc b/.config/shell/aliasrc index a0b4547e..b78a40ff 100644 --- a/.config/shell/aliasrc +++ b/.config/shell/aliasrc @@ -6,6 +6,10 @@ # Use $XINITRC variable if file exists. [ -f "$XINITRC" ] && alias startx="startx $XINITRC" +# fix ssh if using kitty as terminal +[ "$TERM" = "xterm-kitty" ] && alias ssh="kitty +kitten ssh" + + # sudo not required for some system commands for command in mount umount sv pacman updatedb su shutdown poweroff reboot ; do alias $command="sudo $command" @@ -51,4 +55,3 @@ alias \ weath="less -S ${XDG_DATA_HOME:-$HOME/.local/share}/weatherreport" \ remvirt="virt-manager -c 'qemu+ssh://luca@192.168.178.200/system'" \ vim="lvim" \ - ssh="kitty +kitten ssh myserver" diff --git a/.config/zsh/.zcompdump b/.config/zsh/.zcompdump index 237e92b1..b66ccdeb 100644 --- a/.config/zsh/.zcompdump +++ b/.config/zsh/.zcompdump @@ -1,4 +1,4 @@ -#files: 825 version: 5.9 +#files: 823 version: 5.9 _comps=( '-' '_precommand' @@ -178,7 +178,6 @@ _comps=( 'cmp' '_cmp' 'co' '_rcs' 'code' '_code' -'code-oss' '_code-oss' 'column' '_column' 'comb' '_sccs' 'combine' '_imagemagick' @@ -1675,170 +1674,170 @@ bindkey '^[/' _history-complete-older bindkey '^[~' _bash_complete-word autoload -Uz _bat _bootctl _busctl _cargo _checkupdates \ - _code _code-oss _coredumpctl _curl _email-notmuch \ - _exa _hostnamectl _journalctl _kernel-install _kitty \ - _lf _libinput _localectl _loginctl _machinectl \ - _meson _mkinitcpio _mpv _networkctl _ninja \ - _notmuch _oomctl _paccache _pacdiff _paclist \ - _paclog-pkglist _pacman _pacscripts _pacsearch _pacsort \ - _pactree _paru _pass _pulseaudio _rankmirrors \ - _resolvectl _rg _sd_hosts_or_user_at_host _sd_machines _sd_outputmodes \ - _sd_unit_files _systemctl _systemd _systemd-analyze _systemd-delta \ - _systemd-inhibit _systemd-nspawn _systemd-path _systemd-run _systemd-tmpfiles \ - _timedatectl _tremc _udevadm _updpkgsums _xwallpaper \ - _zathura _cdr _all_labels _all_matches _alternative \ - _approximate _arg_compile _arguments _bash_completions _cache_invalid \ - _call_function _combination _complete _complete_debug _complete_help \ - _complete_help_generic _complete_tag _comp_locale _correct _correct_filename \ - _correct_word _describe _description _dispatch _expand \ - _expand_alias _expand_word _extensions _external_pwds _generic \ - _guard _history _history_complete_word _ignored _list \ - _main_complete _match _menu _message _most_recent_file \ - _multi_parts _next_label _next_tags _normal _nothing \ - _numbers _oldlist _pick_variant _prefix _read_comp \ - _regex_arguments _regex_words _requested _retrieve_cache _sep_parts \ - _sequence _set_command _setup _store_cache _sub_commands \ - _tags _user_expand _values _wanted _acpi \ - _acpitool _alsa-utils _analyseplugin _basenc _brctl \ - _btrfs _capabilities _chattr _chcon _choom \ - _chrt _cpupower _cryptsetup _dkms _e2label \ - _ethtool _findmnt _free _fuse_arguments _fusermount \ - _fuse_values _gpasswd _htop _iconvconfig _ionice \ - _ipset _iptables _iwconfig _kpartx _losetup \ - _lsattr _lsblk _lsns _lsusb _ltrace \ - _mat _mat2 _mdadm _mii-tool _modutils \ - _mondo _networkmanager _nsenter _opkg _perf \ - _pidof _pmap _qdbus _schedtool _selinux_contexts \ - _selinux_roles _selinux_types _selinux_users _setpriv _setsid \ - _slabtop _ss _sshfs _strace _sysstat \ - _tload _tpb _tracepath _tune2fs _uml \ - _unshare _valgrind _vserver _wakeup_capable_devices _wipefs \ - _wpa_cli _a2ps _aap _abcde _absolute_command_paths \ - _ack _adb _ansible _ant _antiword \ - _apachectl _apm _arch_archives _arch_namespace _arp \ - _arping _asciidoctor _asciinema _at _attr \ - _augeas _avahi _awk _base64 _basename \ - _bash _baudrates _baz _beep _bibtex \ - _bind_addresses _bison _bittorrent _bogofilter _bpf_filters \ - _bpython _bzip2 _bzr _cabal _cal \ - _calendar _canonical_paths _cat _ccal _cdcd \ - _cdrdao _cdrecord _chkconfig _chmod _chown \ - _chroot _chsh _cksum _clay _cmdambivalent \ - _cmdstring _cmp _column _comm _composer \ - _compress _configure _cowsay _cp _cpio \ - _cplay _crontab _cscope _csplit _cssh \ - _ctags _ctags_tags _curl _cut _cvs \ - _darcs _date _date_formats _dates _dbus \ - _dconf _dd _devtodo _df _dhclient \ - _dict _dict_words _diff _diff3 _diff_options \ - _diffstat _dig _directories _dir_list _django \ - _dmesg _dmidecode _dns_types _doas _domains \ - _dos2unix _drill _dropbox _dsh _dtruss \ - _du _dvi _ecasound _ed _elfdump \ - _elinks _email_addresses _enscript _entr _env \ - _espeak _etags _fakeroot _feh _fetchmail \ - _ffmpeg _figlet _file_modes _files _file_systems \ - _find _find_net_interfaces _finger _flac _flex \ - _fmt _fold _fortune _fsh _fuser \ - _gcc _gcore _gdb _gem _genisoimage \ - _getconf _getent _getfacl _getmail _getopt \ - _ghostscript _git _global _global_tags _gnu_generic \ - _gnupod _gnutls _go _gpg _gphoto2 \ - _gprof _gradle _graphicsmagick _grep _groff \ - _groups _growisofs _gsettings _guilt _gzip \ - _have_glob_qual _head _hexdump _host _hostname \ - _hosts _iconv _id _ifconfig _iftop \ - _imagemagick _initctl _init_d _install _iostat \ - _ip _ipsec _irssi _ispell _java \ - _java_class _joe _join _jq _killall \ - _knock _kvno _last _ldconfig _ldd \ - _ld_debug _less _lha _libvirt _links \ - _list_files _lldb _ln _loadkeys _locale \ - _localedef _locales _locate _logger _look \ - _lp _ls _lsof _lua _luarocks \ - _lynx _lz4 _lzop _mail _mailboxes \ - _make _man _md5sum _mencal _mh \ - _mime_types _mkdir _mkfifo _mknod _mktemp \ - _module _monotone _moosic _mosh _mount \ - _mpc _mt _mtools _mtr _mutt \ - _mv _my_accounts _myrepos _mysqldiff _mysql_utils \ - _ncftp _netcat _net_interfaces _netstat _newsgroups \ - _nginx _ngrep _nice _nkf _nl \ - _nm _nmap _npm _nslookup _numfmt \ - _objdump _object_files _od _openstack _opustools \ - _other_accounts _pack _pandoc _paste _patch \ - _patchutils _path_commands _path_files _pax _pbm \ - _pdf _perforce _perl _perl_basepods _perldoc \ - _perl_modules _pgids _pgrep _php _picocom \ - _pids _pine _ping _pip _pkgadd \ - _pkg-config _pkginfo _pkg_instance _pkgrm _pon \ - _ports _postfix _postgresql _postscript _pr \ - _printenv _printers _process_names _prove _ps \ - _pspdf _psutils _ptx _pump _pv \ - _pwgen _pydoc _python _python_modules _qemu \ - _quilt _rake _ranlib _rar _rclone \ - _rcs _readelf _readlink _remote_files _renice \ - _ri _rlogin _rm _rmdir _route \ - _rrdtool _rsync _rubber _ruby _runit \ - _samba _sccs _scons _screen _script \ - _seafile _sed _seq _service _services \ - _setfacl _sh _shasum _showmount _shred \ - _shuf _shutdown _signals _sisu _slrn \ - _smartmontools _socket _sort _spamassassin _split \ - _sqlite _sqsh _ssh _ssh_hosts _stat \ - _stdbuf _stgit _stow _strings _strip \ - _stty _su _subversion _sudo _surfraw \ - _swaks _swanctl _swift _sys_calls _sysctl \ - _tac _tail _tar _tar_archive _tardy \ - _tcpdump _tcptraceroute _tee _telnet _terminals \ - _tex _texi _texinfo _tidy _tiff \ - _tilde_files _timeout _time_zone _tin _tla \ - _tmux _todo.sh _toilet _top _topgit \ - _totd _touch _tput _tr _transmission \ - _tree _truncate _truss _tty _ttys \ - _twidge _twisted _umountable _unace _uname \ - _unexpand _uniq _unison _units _uptime \ - _urls _user_admin _user_at_host _users _users_on \ - _vi _vim _visudo _vmstat _vorbis \ - _vpnc _w _w3m _watch _wc \ - _webbrowser _wget _whereis _who _whois \ - _wiggle _xargs _xmlsoft _xmlstarlet _xmms2 \ - _xxd _xz _yafc _yodl _yp \ - _zcat _zdump _zfs _zfs_dataset _zfs_pool \ - _zip _zsh _acroread _code _dcop \ - _eog _evince _geany _gnome-gv _gqview \ - _gv _kdeconnect _kfmclient _matlab _mozilla \ - _mplayer _mupdf _nautilus _nedit _netscape \ - _okular _pdftk _qiv _rdesktop _setxkbmap \ - _sublimetext _urxvt _vnc _x_arguments _xauth \ - _xautolock _x_borderwidth _xclip _x_color _x_colormapid \ - _x_cursor _x_display _xdvi _x_extension _xfig \ - _x_font _xft_fonts _x_geometry _xinput _x_keysym \ - _xloadimage _x_locale _x_modifier _xmodmap _x_name \ - _xournal _xpdf _xrandr _x_resource _xscreensaver \ - _x_selection_timeout _xset _xt_arguments _xterm _x_title \ - _xt_session_id _x_utils _xv _x_visual _x_window \ - _xwit _zeal _add-zle-hook-widget _add-zsh-hook _alias \ - _aliases __arguments _arrays _assign _autocd \ - _bindkey _brace_parameter _builtin _cd _command \ - _command_names _compadd _compdef _completers _condition \ - _default _delimiters _directory_stack _dirs _disable \ - _dynamic_directory_name _echotc _echoti _emulate _enable \ - _equal _exec _fc _file_descriptors _first \ - _functions _globflags _globqual_delims _globquals _hash \ - _history_modifiers _in_vared _jobs _jobs_bg _jobs_builtin \ - _jobs_fg _kill _limit _limits _math \ - _math_params _mere _module_math_func _options _options_set \ - _options_unset _parameter _parameters _precommand _print \ - _prompt _ps1234 _read _redirect _run-help \ - _sched _set _setopt _source _strftime \ - _subscript _suffix_alias_files _tcpsys _tilde _trap \ - _ttyctl _typeset _ulimit _unhash _user_math_func \ - _value _vared _vars _vcs_info _vcs_info_hooks \ - _wait _which _widgets _zargs _zattr \ - _zcalc _zcalc_line _zcompile _zed _zftp \ - _zle _zmodload _zmv _zparseopts _zpty \ - _zsh-mime-handler _zsocket _zstyle _ztodo + _coredumpctl _curl _email-notmuch _exa _hostnamectl \ + _journalctl _kernel-install _kitty _lf _libinput \ + _localectl _loginctl _machinectl _meson _mkinitcpio \ + _mpv _networkctl _ninja _notmuch _oomctl \ + _paccache _pacdiff _paclist _paclog-pkglist _pacman \ + _pacscripts _pacsearch _pacsort _pactree _paru \ + _pass _pulseaudio _rankmirrors _resolvectl _rg \ + _sd_hosts_or_user_at_host _sd_machines _sd_outputmodes _sd_unit_files _systemctl \ + _systemd _systemd-analyze _systemd-delta _systemd-inhibit _systemd-nspawn \ + _systemd-path _systemd-run _systemd-tmpfiles _timedatectl _tremc \ + _udevadm _updpkgsums _xwallpaper _zathura _cdr \ + _all_labels _all_matches _alternative _approximate _arg_compile \ + _arguments _bash_completions _cache_invalid _call_function _combination \ + _complete _complete_debug _complete_help _complete_help_generic _complete_tag \ + _comp_locale _correct _correct_filename _correct_word _describe \ + _description _dispatch _expand _expand_alias _expand_word \ + _extensions _external_pwds _generic _guard _history \ + _history_complete_word _ignored _list _main_complete _match \ + _menu _message _most_recent_file _multi_parts _next_label \ + _next_tags _normal _nothing _numbers _oldlist \ + _pick_variant _prefix _read_comp _regex_arguments _regex_words \ + _requested _retrieve_cache _sep_parts _sequence _set_command \ + _setup _store_cache _sub_commands _tags _user_expand \ + _values _wanted _acpi _acpitool _alsa-utils \ + _analyseplugin _basenc _brctl _btrfs _capabilities \ + _chattr _chcon _choom _chrt _cpupower \ + _cryptsetup _dkms _e2label _ethtool _findmnt \ + _free _fuse_arguments _fusermount _fuse_values _gpasswd \ + _htop _iconvconfig _ionice _ipset _iptables \ + _iwconfig _kpartx _losetup _lsattr _lsblk \ + _lsns _lsusb _ltrace _mat _mat2 \ + _mdadm _mii-tool _modutils _mondo _networkmanager \ + _nsenter _opkg _perf _pidof _pmap \ + _qdbus _schedtool _selinux_contexts _selinux_roles _selinux_types \ + _selinux_users _setpriv _setsid _slabtop _ss \ + _sshfs _strace _sysstat _tload _tpb \ + _tracepath _tune2fs _uml _unshare _valgrind \ + _vserver _wakeup_capable_devices _wipefs _wpa_cli _a2ps \ + _aap _abcde _absolute_command_paths _ack _adb \ + _ansible _ant _antiword _apachectl _apm \ + _arch_archives _arch_namespace _arp _arping _asciidoctor \ + _asciinema _at _attr _augeas _avahi \ + _awk _base64 _basename _bash _baudrates \ + _baz _beep _bibtex _bind_addresses _bison \ + _bittorrent _bogofilter _bpf_filters _bpython _bzip2 \ + _bzr _cabal _cal _calendar _canonical_paths \ + _cat _ccal _cdcd _cdrdao _cdrecord \ + _chkconfig _chmod _chown _chroot _chsh \ + _cksum _clay _cmdambivalent _cmdstring _cmp \ + _column _comm _composer _compress _configure \ + _cowsay _cp _cpio _cplay _crontab \ + _cscope _csplit _cssh _ctags _ctags_tags \ + _curl _cut _cvs _darcs _date \ + _date_formats _dates _dbus _dconf _dd \ + _devtodo _df _dhclient _dict _dict_words \ + _diff _diff3 _diff_options _diffstat _dig \ + _directories _dir_list _django _dmesg _dmidecode \ + _dns_types _doas _domains _dos2unix _drill \ + _dropbox _dsh _dtruss _du _dvi \ + _ecasound _ed _elfdump _elinks _email_addresses \ + _enscript _entr _env _espeak _etags \ + _fakeroot _feh _fetchmail _ffmpeg _figlet \ + _file_modes _files _file_systems _find _find_net_interfaces \ + _finger _flac _flex _fmt _fold \ + _fortune _fsh _fuser _gcc _gcore \ + _gdb _gem _genisoimage _getconf _getent \ + _getfacl _getmail _getopt _ghostscript _git \ + _global _global_tags _gnu_generic _gnupod _gnutls \ + _go _gpg _gphoto2 _gprof _gradle \ + _graphicsmagick _grep _groff _groups _growisofs \ + _gsettings _guilt _gzip _have_glob_qual _head \ + _hexdump _host _hostname _hosts _iconv \ + _id _ifconfig _iftop _imagemagick _initctl \ + _init_d _install _iostat _ip _ipsec \ + _irssi _ispell _java _java_class _joe \ + _join _jq _killall _knock _kvno \ + _last _ldconfig _ldd _ld_debug _less \ + _lha _libvirt _links _list_files _lldb \ + _ln _loadkeys _locale _localedef _locales \ + _locate _logger _look _lp _ls \ + _lsof _lua _luarocks _lynx _lz4 \ + _lzop _mail _mailboxes _make _man \ + _md5sum _mencal _mh _mime_types _mkdir \ + _mkfifo _mknod _mktemp _module _monotone \ + _moosic _mosh _mount _mpc _mt \ + _mtools _mtr _mutt _mv _my_accounts \ + _myrepos _mysqldiff _mysql_utils _ncftp _netcat \ + _net_interfaces _netstat _newsgroups _nginx _ngrep \ + _nice _nkf _nl _nm _nmap \ + _npm _nslookup _numfmt _objdump _object_files \ + _od _openstack _opustools _other_accounts _pack \ + _pandoc _paste _patch _patchutils _path_commands \ + _path_files _pax _pbm _pdf _perforce \ + _perl _perl_basepods _perldoc _perl_modules _pgids \ + _pgrep _php _picocom _pids _pine \ + _ping _pip _pkgadd _pkg-config _pkginfo \ + _pkg_instance _pkgrm _pon _ports _postfix \ + _postgresql _postscript _pr _printenv _printers \ + _process_names _prove _ps _pspdf _psutils \ + _ptx _pump _pv _pwgen _pydoc \ + _python _python_modules _qemu _quilt _rake \ + _ranlib _rar _rclone _rcs _readelf \ + _readlink _remote_files _renice _ri _rlogin \ + _rm _rmdir _route _rrdtool _rsync \ + _rubber _ruby _runit _samba _sccs \ + _scons _screen _script _seafile _sed \ + _seq _service _services _setfacl _sh \ + _shasum _showmount _shred _shuf _shutdown \ + _signals _sisu _slrn _smartmontools _socket \ + _sort _spamassassin _split _sqlite _sqsh \ + _ssh _ssh_hosts _stat _stdbuf _stgit \ + _stow _strings _strip _stty _su \ + _subversion _sudo _surfraw _swaks _swanctl \ + _swift _sys_calls _sysctl _tac _tail \ + _tar _tar_archive _tardy _tcpdump _tcptraceroute \ + _tee _telnet _terminals _tex _texi \ + _texinfo _tidy _tiff _tilde_files _timeout \ + _time_zone _tin _tla _tmux _todo.sh \ + _toilet _top _topgit _totd _touch \ + _tput _tr _transmission _tree _truncate \ + _truss _tty _ttys _twidge _twisted \ + _umountable _unace _uname _unexpand _uniq \ + _unison _units _uptime _urls _user_admin \ + _user_at_host _users _users_on _vi _vim \ + _visudo _vmstat _vorbis _vpnc _w \ + _w3m _watch _wc _webbrowser _wget \ + _whereis _who _whois _wiggle _xargs \ + _xmlsoft _xmlstarlet _xmms2 _xxd _xz \ + _yafc _yodl _yp _zcat _zdump \ + _zfs _zfs_dataset _zfs_pool _zip _zsh \ + _acroread _code _dcop _eog _evince \ + _geany _gnome-gv _gqview _gv _kdeconnect \ + _kfmclient _matlab _mozilla _mplayer _mupdf \ + _nautilus _nedit _netscape _okular _pdftk \ + _qiv _rdesktop _setxkbmap _sublimetext _urxvt \ + _vnc _x_arguments _xauth _xautolock _x_borderwidth \ + _xclip _x_color _x_colormapid _x_cursor _x_display \ + _xdvi _x_extension _xfig _x_font _xft_fonts \ + _x_geometry _xinput _x_keysym _xloadimage _x_locale \ + _x_modifier _xmodmap _x_name _xournal _xpdf \ + _xrandr _x_resource _xscreensaver _x_selection_timeout _xset \ + _xt_arguments _xterm _x_title _xt_session_id _x_utils \ + _xv _x_visual _x_window _xwit _zeal \ + _add-zle-hook-widget _add-zsh-hook _alias _aliases __arguments \ + _arrays _assign _autocd _bindkey _brace_parameter \ + _builtin _cd _command _command_names _compadd \ + _compdef _completers _condition _default _delimiters \ + _directory_stack _dirs _disable _dynamic_directory_name _echotc \ + _echoti _emulate _enable _equal _exec \ + _fc _file_descriptors _first _functions _globflags \ + _globqual_delims _globquals _hash _history_modifiers _in_vared \ + _jobs _jobs_bg _jobs_builtin _jobs_fg _kill \ + _limit _limits _math _math_params _mere \ + _module_math_func _options _options_set _options_unset _parameter \ + _parameters _precommand _print _prompt _ps1234 \ + _read _redirect _run-help _sched _set \ + _setopt _source _strftime _subscript _suffix_alias_files \ + _tcpsys _tilde _trap _ttyctl _typeset \ + _ulimit _unhash _user_math_func _value _vared \ + _vars _vcs_info _vcs_info_hooks _wait _which \ + _widgets _zargs _zattr _zcalc _zcalc_line \ + _zcompile _zed _zftp _zle _zmodload \ + _zmv _zparseopts _zpty _zsh-mime-handler _zsocket \ + _zstyle _ztodo autoload -Uz +X _call_program typeset -gUa _comp_assocs diff --git a/.config/zsh/.zshrc b/.config/zsh/.zshrc index 728d75ec..5a8cf1d2 100644 --- a/.config/zsh/.zshrc +++ b/.config/zsh/.zshrc @@ -2,12 +2,12 @@ autoload -U colors && colors # Load colors PS1="%{$fg[cyan]%}%n%{$reset_color%}@%{$fg[blue]%}%m %{$reset_color%}[%{$fg[magenta]%}%3~%{$reset_color%}] %{$fg[green]%}»%{$reset_color%} " stty stop undef # Disable ctrl-s to freeze terminal. -setopt interactive_comments histignorealldups autocd +setopt interactive_comments histignorealldups # History in cache directory: HISTSIZE=10000000 SAVEHIST=10000000 -HISTFILE=~/.cache/zsh/history +HISTFILE="${XDG_CACHE_HOME:-$HOME/.cache}/zsh/history" # Load aliases and shortcuts if existent. [ -f "${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutrc" ] && source "${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutrc" @@ -72,5 +72,7 @@ bindkey -s '^f' 'cd "$(dirname "$(fzf)")"\n' autoload edit-command-line; zle -N edit-command-line bindkey '^e' edit-command-line +[ -f /usr/share/fzf/key-bindings.zsh ] && source /usr/share/fzf/key-bindings.zsh + # Load syntax highlighting; should be last. source /usr/share/zsh/plugins/fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh 2>/dev/null diff --git a/.local/bin/statusbar/sb-pacpackages b/.local/bin/statusbar/sb-pacpackages index 709573b6..05b7d155 100755 --- a/.local/bin/statusbar/sb-pacpackages +++ b/.local/bin/statusbar/sb-pacpackages @@ -26,4 +26,4 @@ case $BLOCK_BUTTON in 6) "$TERMINAL" -e "$EDITOR" "$0" ;; esac -pacman -Qu | grep -Fcv "[ignored]" | sed "s/^/ /;s/^ 0$//g" +pacman -Qu | grep -Fcv "[ignored]" | sed "s/^/  /;s/^  0$//g" diff --git a/.local/bin/statusbar/sb-volume b/.local/bin/statusbar/sb-volume index fc675600..adbdac77 100755 --- a/.local/bin/statusbar/sb-volume +++ b/.local/bin/statusbar/sb-volume @@ -18,13 +18,13 @@ esac vol="$(pamixer --get-volume)" if [ "$vol" -gt "70" ]; then - icon="墳" + icon=" 墳" elif [ "$vol" -gt "30" ]; then - icon="奔" + icon=" 奔" elif [ "$vol" -gt "0" ]; then - icon="奄" + icon=" 奄" else - echo ﱝ && exit + echo " ﱝ "&& exit fi echo "$icon$vol%" diff --git a/.local/share/lunarvim/lvim/.gitignore b/.local/share/lunarvim/lvim/.gitignore deleted file mode 100644 index c4b5cbc1..00000000 --- a/.local/share/lunarvim/lvim/.gitignore +++ /dev/null @@ -1,32 +0,0 @@ -plugin/ -dein -tags* -.netrwhist -pythonpath.vim -nodepath.vim -autoload/plugged/* -vimspector-config/gadgets/* -paths.vim -session -wiki/ -pack/ -utils/java/* -lv-config.lua -lua-language-server/ -eclipse.jdt.ls/ -.language-servers/ -.debuggers/ -spell/ -nv-settings.lua -lv-settings.lua -lua/lv-user/ -lua/lv-user-config/ - -*.tmp -*.temp -*.bak -*.backup -*.old - -.luarc.json -.luacheckcache diff --git a/.local/share/lunarvim/lvim/.luacheckrc b/.local/share/lunarvim/lvim/.luacheckrc deleted file mode 100644 index 136e2326..00000000 --- a/.local/share/lunarvim/lvim/.luacheckrc +++ /dev/null @@ -1,42 +0,0 @@ --- vim: ft=lua tw=80 - -stds.nvim = { - globals = { - "lvim", - vim = { fields = { "g" } }, - "TERMINAL", - "USER", - "C", - "Config", - "WORKSPACE_PATH", - "JAVA_LS_EXECUTABLE", - "MUtils", - "USER_CONFIG_PATH", - os = { fields = { "capture" } }, - }, - read_globals = { - "jit", - "os", - "vim", - "join_paths", - "get_runtime_dir", - "get_config_dir", - "get_cache_dir", - "get_lvim_base_dir", - "require_clean", - }, -} -std = "lua51+nvim" - -files["tests/*_spec.lua"].std = "lua51+nvim+busted" - --- Don't report unused self arguments of methods. -self = false - --- Rerun tests only if their modification time changed. -cache = true - -ignore = { - "631", -- max_line_length - "212/_.*", -- unused argument, for vars with "_" prefix -} diff --git a/.local/share/lunarvim/lvim/.pre-commit-config.yaml b/.local/share/lunarvim/lvim/.pre-commit-config.yaml deleted file mode 100644 index 2c4921ec..00000000 --- a/.local/share/lunarvim/lvim/.pre-commit-config.yaml +++ /dev/null @@ -1,34 +0,0 @@ -repos: - - repo: local - hooks: - - id: shfmt - name: shfmt - minimum_pre_commit_version: 2.4.0 - language: system - types: [shell] - entry: bash - args: [-c, make lint-sh] - - id: shellcheck - name: shellcheck - language: system - types: [shell] - entry: bash - args: [-c, make style-sh] - - id: stylua - name: StyLua - language: rust - entry: stylua - types: [lua] - args: ["-"] - - id: luacheck - name: luacheck - language: system - entry: luacheck - types: [lua] - args: [.] - - id: commitlint - name: commitlint - language: system - entry: bash - args: [./utils/ci/run_commitlint.sh] - stages: [commit-msg] diff --git a/.local/share/lunarvim/lvim/.stylua.toml b/.local/share/lunarvim/lvim/.stylua.toml deleted file mode 100644 index df96b7b0..00000000 --- a/.local/share/lunarvim/lvim/.stylua.toml +++ /dev/null @@ -1,6 +0,0 @@ -column_width = 120 -line_endings = "Unix" -indent_type = "Spaces" -indent_width = 2 -quote_style = "AutoPreferDouble" -no_call_parentheses = true diff --git a/.local/share/lunarvim/lvim/LICENSE b/.local/share/lunarvim/lvim/LICENSE deleted file mode 100644 index f288702d..00000000 --- a/.local/share/lunarvim/lvim/LICENSE +++ /dev/null @@ -1,674 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - 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 . - -Also add information on how to contact you by electronic and paper mail. - - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - Copyright (C) - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an "about box". - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -. - - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -. diff --git a/.local/share/lunarvim/lvim/ftdetect/json.lua b/.local/share/lunarvim/lvim/ftdetect/json.lua deleted file mode 100644 index 9824e3e4..00000000 --- a/.local/share/lunarvim/lvim/ftdetect/json.lua +++ /dev/null @@ -1,3 +0,0 @@ -vim.cmd [[ - au BufRead,BufNewFile tsconfig.json set filetype=jsonc -]] diff --git a/.local/share/lunarvim/lvim/ftdetect/plaintex.lua b/.local/share/lunarvim/lvim/ftdetect/plaintex.lua deleted file mode 100644 index aa01dec8..00000000 --- a/.local/share/lunarvim/lvim/ftdetect/plaintex.lua +++ /dev/null @@ -1 +0,0 @@ -vim.cmd [[ au BufRead,BufNewFile *.tex set filetype=tex ]] diff --git a/.local/share/lunarvim/lvim/ftdetect/zig.lua b/.local/share/lunarvim/lvim/ftdetect/zig.lua deleted file mode 100644 index 343c56c0..00000000 --- a/.local/share/lunarvim/lvim/ftdetect/zig.lua +++ /dev/null @@ -1,3 +0,0 @@ -vim.cmd [[ - au BufRead,BufNewFile *.zir set filetype=zir -]] diff --git a/.local/share/lunarvim/lvim/init.lua b/.local/share/lunarvim/lvim/init.lua deleted file mode 100644 index cd7c6598..00000000 --- a/.local/share/lunarvim/lvim/init.lua +++ /dev/null @@ -1,21 +0,0 @@ -local init_path = debug.getinfo(1, "S").source:sub(2) -local base_dir = init_path:match("(.*[/\\])"):sub(1, -2) - -if not vim.tbl_contains(vim.opt.rtp:get(), base_dir) then - vim.opt.rtp:append(base_dir) -end - -require("lvim.bootstrap"):init(base_dir) - -require("lvim.config"):load() - -local plugins = require "lvim.plugins" -require("lvim.plugin-loader").load { plugins, lvim.plugins } - -local Log = require "lvim.core.log" -Log:debug "Starting LunarVim" - -local commands = require "lvim.core.commands" -commands.load(commands.defaults) - -require("lvim.lsp").setup() diff --git a/.local/share/lunarvim/lvim/lua/lvim/bootstrap.lua b/.local/share/lunarvim/lvim/lua/lvim/bootstrap.lua deleted file mode 100644 index f637c144..00000000 --- a/.local/share/lunarvim/lvim/lua/lvim/bootstrap.lua +++ /dev/null @@ -1,130 +0,0 @@ -local M = {} - -if vim.fn.has "nvim-0.7" ~= 1 then - vim.notify("Please upgrade your Neovim base installation. Lunarvim requires v0.7+", vim.log.levels.WARN) - vim.wait(5000, function() - return false - end) - vim.cmd "cquit" -end - -local uv = vim.loop -local path_sep = uv.os_uname().version:match "Windows" and "\\" or "/" -local in_headless = #vim.api.nvim_list_uis() == 0 - ----Join path segments that were passed as input ----@return string -function _G.join_paths(...) - local result = table.concat({ ... }, path_sep) - return result -end - ----Require a module in protected mode without relying on its cached value ----@param module string ----@return any -function _G.require_clean(module) - package.loaded[module] = nil - _G[module] = nil - local _, requested = pcall(require, module) - return requested -end - ----Get the full path to `$LUNARVIM_RUNTIME_DIR` ----@return string -function _G.get_runtime_dir() - local lvim_runtime_dir = os.getenv "LUNARVIM_RUNTIME_DIR" - if not lvim_runtime_dir then - -- when nvim is used directly - return vim.call("stdpath", "data") - end - return lvim_runtime_dir -end - ----Get the full path to `$LUNARVIM_CONFIG_DIR` ----@return string -function _G.get_config_dir() - local lvim_config_dir = os.getenv "LUNARVIM_CONFIG_DIR" - if not lvim_config_dir then - return vim.call("stdpath", "config") - end - return lvim_config_dir -end - ----Get the full path to `$LUNARVIM_CACHE_DIR` ----@return string -function _G.get_cache_dir() - local lvim_cache_dir = os.getenv "LUNARVIM_CACHE_DIR" - if not lvim_cache_dir then - return vim.call("stdpath", "cache") - end - return lvim_cache_dir -end - ----Initialize the `&runtimepath` variables and prepare for startup ----@return table -function M:init(base_dir) - self.runtime_dir = get_runtime_dir() - self.config_dir = get_config_dir() - self.cache_dir = get_cache_dir() - self.pack_dir = join_paths(self.runtime_dir, "site", "pack") - self.packer_install_dir = join_paths(self.runtime_dir, "site", "pack", "packer", "start", "packer.nvim") - self.packer_cache_path = join_paths(self.config_dir, "plugin", "packer_compiled.lua") - - ---@meta overridden to use LUNARVIM_CACHE_DIR instead, since a lot of plugins call this function interally - ---NOTE: changes to "data" are currently unstable, see #2507 - vim.fn.stdpath = function(what) - if what == "cache" then - return _G.get_cache_dir() - end - return vim.call("stdpath", what) - end - - ---Get the full path to LunarVim's base directory - ---@return string - function _G.get_lvim_base_dir() - return base_dir - end - - if os.getenv "LUNARVIM_RUNTIME_DIR" then - -- vim.opt.rtp:append(os.getenv "LUNARVIM_RUNTIME_DIR" .. path_sep .. "lvim") - vim.opt.rtp:remove(join_paths(vim.call("stdpath", "data"), "site")) - vim.opt.rtp:remove(join_paths(vim.call("stdpath", "data"), "site", "after")) - vim.opt.rtp:prepend(join_paths(self.runtime_dir, "site")) - vim.opt.rtp:append(join_paths(self.runtime_dir, "site", "after")) - - vim.opt.rtp:remove(vim.call("stdpath", "config")) - vim.opt.rtp:remove(join_paths(vim.call("stdpath", "config"), "after")) - vim.opt.rtp:prepend(self.config_dir) - vim.opt.rtp:append(join_paths(self.config_dir, "after")) - -- TODO: we need something like this: vim.opt.packpath = vim.opt.rtp - - vim.cmd [[let &packpath = &runtimepath]] - end - - -- FIXME: currently unreliable in unit-tests - if not in_headless then - _G.PLENARY_DEBUG = false - require "lvim.impatient" - end - - require("lvim.config"):init() - - require("lvim.plugin-loader").init { - package_root = self.pack_dir, - install_path = self.packer_install_dir, - } - - return self -end - ----Update LunarVim ----pulls the latest changes from github and, resets the startup cache -function M:update() - require_clean("lvim.utils.hooks").run_pre_update() - local ret = require_clean("lvim.utils.git").update_base_lvim() - if ret then - require_clean("lvim.utils.hooks").run_post_update() - end -end - -return M diff --git a/.local/share/lunarvim/lvim/lua/lvim/config/defaults.lua b/.local/share/lunarvim/lvim/lua/lvim/config/defaults.lua deleted file mode 100644 index 7bccc895..00000000 --- a/.local/share/lunarvim/lvim/lua/lvim/config/defaults.lua +++ /dev/null @@ -1,42 +0,0 @@ -return { - leader = "space", - colorscheme = "onedarker", - transparent_window = false, - format_on_save = { - ---@usage pattern string pattern used for the autocommand (Default: '*') - pattern = "*", - ---@usage timeout number timeout in ms for the format request (Default: 1000) - timeout = 1000, - ---@usage filter func to select client - filter = require("lvim.lsp.handlers").format_filter, - }, - keys = {}, - - use_icons = true, - - builtin = {}, - - plugins = { - -- use config.lua for this not put here - }, - - autocommands = {}, - lang = {}, - log = { - ---@usage can be { "trace", "debug", "info", "warn", "error", "fatal" }, - level = "warn", - viewer = { - ---@usage this will fallback on "less +F" if not found - cmd = "lnav", - layout_config = { - ---@usage direction = 'vertical' | 'horizontal' | 'window' | 'float', - direction = "horizontal", - open_mapping = "", - size = 40, - float_opts = {}, - }, - }, - -- currently disabled due to instabilities - override_notify = false, - }, -} diff --git a/.local/share/lunarvim/lvim/lua/lvim/config/init.lua b/.local/share/lunarvim/lvim/lua/lvim/config/init.lua deleted file mode 100644 index 4343ace9..00000000 --- a/.local/share/lunarvim/lvim/lua/lvim/config/init.lua +++ /dev/null @@ -1,149 +0,0 @@ -local utils = require "lvim.utils" -local Log = require "lvim.core.log" - -local M = {} -local user_config_dir = get_config_dir() -local user_config_file = utils.join_paths(user_config_dir, "config.lua") - ----Get the full path to the user configuration file ----@return string -function M:get_user_config_path() - return user_config_file -end - ---- Initialize lvim default configuration and variables -function M:init() - lvim = vim.deepcopy(require "lvim.config.defaults") - - require("lvim.keymappings").load_defaults() - - local builtins = require "lvim.core.builtins" - builtins.config { user_config_file = user_config_file } - - local settings = require "lvim.config.settings" - settings.load_defaults() - - local autocmds = require "lvim.core.autocmds" - autocmds.load_defaults() - - local lvim_lsp_config = require "lvim.lsp.config" - lvim.lsp = vim.deepcopy(lvim_lsp_config) - - ---@deprecated replaced with lvim.builtin.alpha - lvim.builtin.dashboard = { - active = false, - on_config_done = nil, - search_handler = "", - disable_at_vim_enter = 0, - session_directory = "", - custom_header = {}, - custom_section = {}, - footer = {}, - } - - lvim.builtin.luasnip = { - sources = { - friendly_snippets = true, - }, - } -end - -local function handle_deprecated_settings() - local function deprecation_notice(setting, new_setting) - local in_headless = #vim.api.nvim_list_uis() == 0 - if in_headless then - return - end - - local msg = string.format( - "Deprecation notice: [%s] setting is no longer supported. %s", - setting, - new_setting or "See https://github.com/LunarVim/LunarVim#breaking-changes" - ) - vim.schedule(function() - vim.notify_once(msg, vim.log.levels.WARN) - end) - end - - ---lvim.lang.FOO.lsp - for lang, entry in pairs(lvim.lang) do - local deprecated_config = entry.formatters or entry.linters or {} - if not vim.tbl_isempty(deprecated_config) then - deprecation_notice(string.format("lvim.lang.%s", lang)) - end - end - - -- lvim.lsp.override - if lvim.lsp.override and not vim.tbl_isempty(lvim.lsp.override) then - deprecation_notice("lvim.lsp.override", "Use `lvim.lsp.automatic_configuration.skipped_servers` instead") - vim.tbl_map(function(c) - if not vim.tbl_contains(lvim.lsp.automatic_configuration.skipped_servers, c) then - table.insert(lvim.lsp.automatic_configuration.skipped_servers, c) - end - end, lvim.lsp.override) - end - - -- lvim.lsp.popup_border - if vim.tbl_contains(vim.tbl_keys(lvim.lsp), "popup_border") then - deprecation_notice "lvim.lsp.popup_border" - end - - -- dashboard.nvim - if lvim.builtin.dashboard.active then - deprecation_notice("lvim.builtin.dashboard", "Use `lvim.builtin.alpha` instead. See LunarVim#1906") - end - - if lvim.autocommands.custom_groups then - deprecation_notice( - "lvim.autocommands.custom_groups", - "Use vim.api.nvim_create_autocmd instead or check LunarVim#2592 to learn about the new syntax" - ) - end -end - ---- Override the configuration with a user provided one --- @param config_path The path to the configuration overrides -function M:load(config_path) - local autocmds = require "lvim.core.autocmds" - config_path = config_path or self:get_user_config_path() - local ok, err = pcall(dofile, config_path) - if not ok then - if utils.is_file(user_config_file) then - Log:warn("Invalid configuration: " .. err) - else - vim.notify_once(string.format("Unable to find configuration file [%s]", config_path), vim.log.levels.WARN) - end - end - - handle_deprecated_settings() - - autocmds.define_autocmds(lvim.autocommands) - - vim.g.mapleader = (lvim.leader == "space" and " ") or lvim.leader - - require("lvim.keymappings").load(lvim.keys) - - if lvim.transparent_window then - autocmds.enable_transparent_mode() - end -end - ---- Override the configuration with a user provided one --- @param config_path The path to the configuration overrides -function M:reload() - vim.schedule(function() - require_clean("lvim.utils.hooks").run_pre_reload() - - M:load() - - require("lvim.core.autocmds").configure_format_on_save() - - local plugins = require "lvim.plugins" - local plugin_loader = require "lvim.plugin-loader" - - plugin_loader.reload { plugins, lvim.plugins } - require_clean("lvim.utils.hooks").run_post_reload() - end) -end - -return M diff --git a/.local/share/lunarvim/lvim/lua/lvim/config/settings.lua b/.local/share/lunarvim/lvim/lua/lvim/config/settings.lua deleted file mode 100644 index faa28641..00000000 --- a/.local/share/lunarvim/lvim/lua/lvim/config/settings.lua +++ /dev/null @@ -1,84 +0,0 @@ -local M = {} - -M.load_default_options = function() - local utils = require "lvim.utils" - local join_paths = utils.join_paths - - local undodir = join_paths(get_cache_dir(), "undo") - - if not utils.is_directory(undodir) then - vim.fn.mkdir(undodir, "p") - end - - local default_options = { - backup = false, -- creates a backup file - clipboard = "unnamedplus", -- allows neovim to access the system clipboard - cmdheight = 2, -- more space in the neovim command line for displaying messages - colorcolumn = "99999", -- fixes indentline for now - completeopt = { "menuone", "noselect" }, - conceallevel = 0, -- so that `` is visible in markdown files - fileencoding = "utf-8", -- the encoding written to a file - foldmethod = "manual", -- folding, set to "expr" for treesitter based folding - foldexpr = "", -- set to "nvim_treesitter#foldexpr()" for treesitter based folding - guifont = "monospace:h17", -- the font used in graphical neovim applications - hidden = true, -- required to keep multiple buffers and open multiple buffers - hlsearch = true, -- highlight all matches on previous search pattern - ignorecase = true, -- ignore case in search patterns - mouse = "a", -- allow the mouse to be used in neovim - pumheight = 10, -- pop up menu height - showmode = false, -- we don't need to see things like -- INSERT -- anymore - showtabline = 2, -- always show tabs - smartcase = true, -- smart case - smartindent = true, -- make indenting smarter again - splitbelow = true, -- force all horizontal splits to go below current window - splitright = true, -- force all vertical splits to go to the right of current window - swapfile = false, -- creates a swapfile - termguicolors = true, -- set term gui colors (most terminals support this) - timeoutlen = 250, -- time to wait for a mapped sequence to complete (in milliseconds) - title = true, -- set the title of window to the value of the titlestring - -- opt.titlestring = "%<%F%=%l/%L - nvim" -- what the title of the window will be set to - undodir = undodir, -- set an undo directory - undofile = true, -- enable persistent undo - updatetime = 300, -- faster completion - writebackup = false, -- if a file is being edited by another program (or was written to file while editing with another program), it is not allowed to be edited - expandtab = true, -- convert tabs to spaces - shiftwidth = 2, -- the number of spaces inserted for each indentation - tabstop = 2, -- insert 2 spaces for a tab - cursorline = true, -- highlight the current line - number = true, -- set numbered lines - relativenumber = false, -- set relative numbered lines - numberwidth = 4, -- set number column width to 2 {default 4} - signcolumn = "yes", -- always show the sign column, otherwise it would shift the text each time - wrap = false, -- display lines as one long line - shadafile = join_paths(get_cache_dir(), "lvim.shada"), - scrolloff = 8, -- minimal number of screen lines to keep above and below the cursor. - sidescrolloff = 8, -- minimal number of screen lines to keep left and right of the cursor. - } - - --- SETTINGS --- - vim.opt.shortmess:append "c" -- don't show redundant messages from ins-completion-menu - vim.opt.shortmess:append "I" -- don't show the default intro message - vim.opt.whichwrap:append "<,>,[,],h,l" - - for k, v in pairs(default_options) do - vim.opt[k] = v - end -end - -M.load_headless_options = function() - vim.opt.shortmess = "" -- try to prevent echom from cutting messages off or prompting - vim.opt.more = false -- don't pause listing when screen is filled - vim.opt.cmdheight = 9999 -- helps avoiding |hit-enter| prompts. - vim.opt.columns = 9999 -- set the widest screen possible - vim.opt.swapfile = false -- don't use a swap file -end - -M.load_defaults = function() - if #vim.api.nvim_list_uis() == 0 then - M.load_headless_options() - return - end - M.load_default_options() -end - -return M diff --git a/.local/share/lunarvim/lvim/lua/lvim/core/alpha.lua b/.local/share/lunarvim/lvim/lua/lvim/core/alpha.lua deleted file mode 100644 index fd637818..00000000 --- a/.local/share/lunarvim/lvim/lua/lvim/core/alpha.lua +++ /dev/null @@ -1,81 +0,0 @@ -local M = {} - -function M.config() - local lvim_dashboard = require "lvim.core.alpha.dashboard" - local lvim_startify = require "lvim.core.alpha.startify" - lvim.builtin.alpha = { - dashboard = { config = {}, section = lvim_dashboard.get_sections() }, - startify = { config = {}, section = lvim_startify.get_sections() }, - active = true, - mode = "dashboard", - } -end - -local function resolve_buttons(theme_name, entries) - local selected_theme = require("alpha.themes." .. theme_name) - local val = {} - for _, entry in pairs(entries) do - local on_press = function() - local sc_ = entry[1]:gsub("%s", ""):gsub("SPC", "") - local key = vim.api.nvim_replace_termcodes(sc_, true, false, true) - vim.api.nvim_feedkeys(key, "normal", false) - end - local button_element = selected_theme.button(entry[1], entry[2], entry[3]) - -- this became necessary after recent changes in alpha.nvim (06ade3a20ca9e79a7038b98d05a23d7b6c016174) - button_element.on_press = on_press - table.insert(val, button_element) - end - return val -end - -local function resolve_config(theme_name) - local selected_theme = require("alpha.themes." .. theme_name) - local resolved_section = selected_theme.section - local section = lvim.builtin.alpha[theme_name].section - - for name, el in pairs(section) do - for k, v in pairs(el) do - if name:match "buttons" and k == "entries" then - resolved_section[name].val = resolve_buttons(theme_name, v) - elseif v then - resolved_section[name][k] = v - end - end - end - - return selected_theme.config -end - -local function configure_additional_autocmds() - local group = "_dashboard_settings" - vim.api.nvim_create_augroup(group, {}) - vim.api.nvim_create_autocmd("FileType", { - group = group, - pattern = "alpha", - command = "set showtabline=0 | autocmd BufLeave set showtabline=" .. vim.opt.showtabline._value, - }) - if not lvim.builtin.lualine.options.globalstatus then - -- https://github.com/goolord/alpha-nvim/issues/42 - vim.api.nvim_create_autocmd("FileType", { - group = group, - pattern = "alpha", - command = "set laststatus=0 | autocmd BufUnload set laststatus=" .. vim.opt.laststatus._value, - }) - end -end - -function M.setup() - local alpha = require "alpha" - local mode = lvim.builtin.alpha.mode - local config = lvim.builtin.alpha[mode].config - - -- this makes it easier to use a completely custom configuration - if vim.tbl_isempty(config) then - config = resolve_config(mode) - end - - alpha.setup(config) - configure_additional_autocmds() -end - -return M diff --git a/.local/share/lunarvim/lvim/lua/lvim/core/alpha/dashboard.lua b/.local/share/lunarvim/lvim/lua/lvim/core/alpha/dashboard.lua deleted file mode 100644 index 69b0ab76..00000000 --- a/.local/share/lunarvim/lvim/lua/lvim/core/alpha/dashboard.lua +++ /dev/null @@ -1,75 +0,0 @@ -local M = {} - -function M.get_sections() - local header = { - type = "text", - val = { - "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀", - "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣠⣴⣶⣿⣿⣿⣷⣶⣤⡀⠀⠀⠀⠀⠀⠀", - "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣴⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣧⡀⠀⠀⠀⠀", - "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⠀⠀⠀⠀", - "⠀⣀⣴⣶⣶⣶⣶⣤⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣼⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡄⠀⠀⠀", - "⣰⣿⣿⠿⠛⠿⢿⣿⣿⣷⣦⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣤⣶⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠀⠀⠀⠀", - "⣿⣿⡇⠀⠀⠀⠀⠈⠛⢿⣿⣿⣦⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣰⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡟⠀⠀⠀⠀", - "⠹⣿⣧⠀⠀⠀⠀⠀⠀⠀⠙⢿⣿⣿⣦⣄⠀⠀⠀⠀⠀⠀⠀⢀⣿⣿⣿⣿⣿⣿⣿⡿⠛⠉⠀⢀⣿⣿⣿⣿⣿⣿⣿⠟⠀⠀⠀⠀⠀", - "⠀⠙⢿⣧⡀⠀⠀⠀⠀⠀⠀⠀⠙⢿⣿⣿⣿⣷⣶⣶⣶⣶⣶⣿⣿⣿⣿⣿⣿⣿⣿⣷⣤⣤⣶⣿⣿⣿⣿⣿⡿⠟⠁⠀⠀⠀⠀⠀⠀", - "⠀⠀⠀⠉⠻⠷⡄⠀⠀⠀⠀⠀⠀⠀⠈⠛⠿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠿⠛⠉⠀⢀⣠⣤⣤⣄⡀⠀⠀", - "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣼⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠿⠋⠁⠀⠀⠀⠀⢠⣿⣿⣿⣿⣿⣿⣷⡀", - "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣦⣄⡀⠀⠀⠀⠀⣿⠟⠉⠉⠙⢿⣿⣿⣷", - "⠀⠀⠀⣀⣠⣤⣤⣤⣶⣶⣶⣤⣤⠀⣴⣿⣿⣿⡿⠟⠛⠛⠛⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣦⡀⠀⠀⠉⠀⠀⠀⢀⣼⣿⣿⡿", - "⠀⠀⠀⠈⠉⠉⠉⠉⠉⠉⠛⠻⠏⣼⣿⣿⡿⣋⣀⣤⣤⣴⣶⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣶⣤⣄⣀⣠⣴⣾⣿⣿⡿⠁", - "⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣾⣿⡿⠋⠘⠿⠟⠛⠛⢻⣿⣿⣿⠋⠁⠈⠉⢿⣿⣿⣧⠀⠙⠻⢿⣿⣿⣿⣿⣿⣿⣿⡿⠟⠉⠀⠀", - "⠙⣷⣤⣀⠀⠀⠀⢀⣀⣤⣶⣿⡿⠋⠀⠀⠀⠀⠀⠀⠀⢸⣿⣿⡟⠀⠀⠀⢠⣿⣿⣿⡟⠀⠀⠀⠀⠀⠉⠉⠉⠉⠉⠀⠀⠀⠀⠀⠀", - "⠀⠈⠛⠿⢿⣿⣿⣿⠿⠿⠛⠉⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⣿⣿⡀⠀⢠⣿⣿⣿⣿⠃⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀", - "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⣿⣿⣿⣷⣶⣶⣶⣶⣦⣤⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀", - "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⣙⠿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣦⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀", - "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠐⢶⣦⣤⣶⣾⣿⣿⡶⠈⠉⠛⠿⣿⣿⣿⣿⣿⣷⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀", - "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠉⠉⠉⠉⠀⠀⠀⠀⠀⠀⠀⠙⣿⣿⣿⣿⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀", - "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣼⣿⣿⡿⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀", - "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣤⣤⣶⡿⠿⠟⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀", - }, - opts = { - position = "center", - hl = "Label", - }, - } - - local text = require "lvim.interface.text" - local lvim_version = require("lvim.utils.git").get_lvim_version() - - local footer = { - type = "text", - val = text.align_center({ width = 0 }, { - "", - "lunarvim.org", - lvim_version, - }, 0.5), - opts = { - position = "center", - hl = "Number", - }, - } - - local buttons = { - entries = { - { "SPC f", " Find File", "Telescope find_files" }, - { "SPC n", " New File", "ene!" }, - { "SPC P", " Recent Projects ", "Telescope projects" }, - { "SPC s r", " Recently Used Files", "Telescope oldfiles" }, - { "SPC s t", " Find Word", "Telescope live_grep" }, - { - "SPC L c", - " Configuration", - "edit " .. require("lvim.config"):get_user_config_path() .. " ", - }, - }, - } - - return { - header = header, - buttons = buttons, - footer = footer, - } -end - -return M diff --git a/.local/share/lunarvim/lvim/lua/lvim/core/alpha/startify.lua b/.local/share/lunarvim/lvim/lua/lvim/core/alpha/startify.lua deleted file mode 100644 index 2ea541f5..00000000 --- a/.local/share/lunarvim/lvim/lua/lvim/core/alpha/startify.lua +++ /dev/null @@ -1,48 +0,0 @@ -local M = {} - -function M.get_sections() - local header = { - type = "text", - val = { - [[ __ _ ___ ]], - [[ / / __ ______ ____ _____| | / (_)___ ___ ]], - [[ / / / / / / __ \/ __ `/ ___/ | / / / __ `__ \]], - [[ / /___/ /_/ / / / / /_/ / / | |/ / / / / / / /]], - [[/_____/\__,_/_/ /_/\__,_/_/ |___/_/_/ /_/ /_/ ]], - }, - opts = { - hl = "Label", - shrink_margin = false, - -- wrap = "overflow"; - }, - } - - local top_buttons = { - entries = { - { "e", " New File", "ene!" }, - }, - val = {}, - } - - local bottom_buttons = { - entries = { - { "q", "Quit", "quit" }, - }, - val = {}, - } - - local footer = { - type = "group", - val = {}, - } - - return { - header = header, - top_buttons = top_buttons, - bottom_buttons = bottom_buttons, - -- this is probably broken - footer = footer, - } -end - -return M diff --git a/.local/share/lunarvim/lvim/lua/lvim/core/autocmds.lua b/.local/share/lunarvim/lvim/lua/lvim/core/autocmds.lua deleted file mode 100644 index 20716e83..00000000 --- a/.local/share/lunarvim/lvim/lua/lvim/core/autocmds.lua +++ /dev/null @@ -1,191 +0,0 @@ -local M = {} -local Log = require "lvim.core.log" - ---- Load the default set of autogroups and autocommands. -function M.load_defaults() - local user_config_file = require("lvim.config"):get_user_config_path() - - if vim.loop.os_uname().version:match "Windows" then - -- autocmds require forward slashes even on windows - user_config_file = user_config_file:gsub("\\", "/") - end - - local definitions = { - { - "TextYankPost", - { - group = "_general_settings", - pattern = "*", - desc = "Highlight text on yank", - callback = function() - require("vim.highlight").on_yank { higroup = "Search", timeout = 200 } - end, - }, - }, - { - "BufWritePost", - { - group = "_general_settings", - pattern = user_config_file, - desc = "Trigger LvimReload on saving " .. vim.fn.expand "%:~", - callback = function() - require("lvim.config"):reload() - end, - }, - }, - { - "FileType", - { - group = "_filetype_settings", - pattern = "qf", - command = "set nobuflisted", - }, - }, - { - "FileType", - { - group = "_filetype_settings", - pattern = { "gitcommit", "markdown" }, - command = "setlocal wrap spell", - }, - }, - { - "FileType", - { - group = "_buffer_mappings", - pattern = { "qf", "help", "man", "floaterm", "lspinfo", "lsp-installer", "null-ls-info" }, - command = "nnoremap q :close", - }, - }, - { - { "BufWinEnter", "BufRead", "BufNewFile" }, - { - group = "_format_options", - pattern = "*", - command = "setlocal formatoptions-=c formatoptions-=r formatoptions-=o", - }, - }, - { - "VimResized", - { - group = "_auto_resize", - pattern = "*", - command = "tabdo wincmd =", - }, - }, - } - - M.define_autocmds(definitions) -end - -local get_format_on_save_opts = function() - local defaults = require("lvim.config.defaults").format_on_save - -- accept a basic boolean `lvim.format_on_save=true` - if type(lvim.format_on_save) ~= "table" then - return defaults - end - - return { - pattern = lvim.format_on_save.pattern or defaults.pattern, - timeout = lvim.format_on_save.timeout or defaults.timeout, - } -end - -function M.enable_format_on_save() - local opts = get_format_on_save_opts() - vim.api.nvim_create_augroup("lsp_format_on_save", {}) - vim.api.nvim_create_autocmd("BufWritePre", { - group = "lsp_format_on_save", - pattern = opts.pattern, - callback = function() - require("lvim.lsp.utils").format { timeout_ms = opts.timeout, filter = opts.filter } - end, - }) - Log:debug "enabled format-on-save" -end - -function M.disable_format_on_save() - M.clear_augroup "lsp_format_on_save" - Log:debug "disabled format-on-save" -end - -function M.configure_format_on_save() - if lvim.format_on_save then - M.enable_format_on_save() - else - M.disable_format_on_save() - end -end - -function M.toggle_format_on_save() - local exists, autocmds = pcall(vim.api.nvim_get_autocmds, { - group = "lsp_format_on_save", - event = "BufWritePre", - }) - if not exists or #autocmds == 0 then - M.enable_format_on_save() - else - M.disable_format_on_save() - end -end - -function M.enable_transparent_mode() - vim.api.nvim_create_autocmd("ColorScheme", { - pattern = "*", - callback = function() - local hl_groups = { - "Normal", - "SignColumn", - "NormalNC", - "TelescopeBorder", - "NvimTreeNormal", - "EndOfBuffer", - "MsgArea", - } - for _, name in ipairs(hl_groups) do - vim.cmd(string.format("highlight %s ctermbg=none guibg=none", name)) - end - end, - }) - vim.opt.fillchars = "eob: " -end - ---- Clean autocommand in a group if it exists ---- This is safer than trying to delete the augroup itself ----@param name string the augroup name -function M.clear_augroup(name) - -- defer the function in case the autocommand is still in-use - local exists, _ = pcall(vim.api.nvim_get_autocmds, { group = name }) - if not exists then - Log:debug("ignoring request to clear autocmds from non-existent group " .. name) - return - end - vim.schedule(function() - local status_ok, _ = xpcall(function() - vim.api.nvim_clear_autocmds { group = name } - end, debug.traceback) - if not status_ok then - Log:warn("problems detected while clearing autocmds from " .. name) - Log:debug(debug.traceback()) - end - end) -end - ---- Create autocommand groups based on the passed definitions ---- Also creates the augroup automatically if it doesn't exist ----@param definitions table contains a tuple of event, opts, see `:h nvim_create_autocmd` -function M.define_autocmds(definitions) - for _, entry in ipairs(definitions) do - local event = entry[1] - local opts = entry[2] - if type(opts.group) == "string" and opts.group ~= "" then - local exists, _ = pcall(vim.api.nvim_get_autocmds, { group = opts.group }) - if not exists then - vim.api.nvim_create_augroup(opts.group, {}) - end - end - vim.api.nvim_create_autocmd(event, opts) - end -end - -return M diff --git a/.local/share/lunarvim/lvim/lua/lvim/core/autopairs.lua b/.local/share/lunarvim/lvim/lua/lvim/core/autopairs.lua deleted file mode 100644 index 4d9f33f4..00000000 --- a/.local/share/lunarvim/lvim/lua/lvim/core/autopairs.lua +++ /dev/null @@ -1,84 +0,0 @@ -local M = {} - -function M.config() - lvim.builtin.autopairs = { - active = true, - on_config_done = nil, - ---@usage modifies the function or method delimiter by filetypes - map_char = { - all = "(", - tex = "{", - }, - ---@usage check bracket in same line - enable_check_bracket_line = false, - ---@usage check treesitter - check_ts = true, - ts_config = { - lua = { "string", "source" }, - javascript = { "string", "template_string" }, - java = false, - }, - disable_filetype = { "TelescopePrompt", "spectre_panel" }, - ignored_next_char = string.gsub([[ [%w%%%'%[%"%.] ]], "%s+", ""), - enable_moveright = true, - ---@usage disable when recording or executing a macro - disable_in_macro = false, - ---@usage add bracket pairs after quote - enable_afterquote = true, - ---@usage map the key - map_bs = true, - ---@usage map to delete a pair if possible - map_c_w = false, - ---@usage disable when insert after visual block mode - disable_in_visualblock = false, - ---@usage change default fast_wrap - fast_wrap = { - map = "", - chars = { "{", "[", "(", '"', "'" }, - pattern = string.gsub([[ [%'%"%)%>%]%)%}%,] ]], "%s+", ""), - offset = 0, -- Offset from pattern match - end_key = "$", - keys = "qwertyuiopzxcvbnmasdfghjkl", - check_comma = true, - highlight = "Search", - highlight_grey = "Comment", - }, - } -end - -M.setup = function() - local autopairs = require "nvim-autopairs" - local Rule = require "nvim-autopairs.rule" - - autopairs.setup { - check_ts = lvim.builtin.autopairs.check_ts, - enable_check_bracket_line = lvim.builtin.autopairs.enable_check_bracket_line, - ts_config = lvim.builtin.autopairs.ts_config, - disable_filetype = lvim.builtin.autopairs.disable_filetype, - disable_in_macro = lvim.builtin.autopairs.disable_in_macro, - ignored_next_char = lvim.builtin.autopairs.ignored_next_char, - enable_moveright = lvim.builtin.autopairs.enable_moveright, - enable_afterquote = lvim.builtin.autopairs.enable_afterquote, - map_c_w = lvim.builtin.autopairs.map_c_w, - map_bs = lvim.builtin.autopairs.map_bs, - disable_in_visualblock = lvim.builtin.autopairs.disable_in_visualblock, - fast_wrap = lvim.builtin.autopairs.fast_wrap, - } - - require("nvim-treesitter.configs").setup { autopairs = { enable = true } } - - local ts_conds = require "nvim-autopairs.ts-conds" - - -- TODO: can these rules be safely added from "config.lua" ? - -- press % => %% is only inside comment or string - autopairs.add_rules { - Rule("%", "%", "lua"):with_pair(ts_conds.is_ts_node { "string", "comment" }), - Rule("$", "$", "lua"):with_pair(ts_conds.is_not_ts_node { "function" }), - } - - if lvim.builtin.autopairs.on_config_done then - lvim.builtin.autopairs.on_config_done(autopairs) - end -end - -return M diff --git a/.local/share/lunarvim/lvim/lua/lvim/core/bufferline.lua b/.local/share/lunarvim/lvim/lua/lvim/core/bufferline.lua deleted file mode 100644 index 28e0f06d..00000000 --- a/.local/share/lunarvim/lvim/lua/lvim/core/bufferline.lua +++ /dev/null @@ -1,221 +0,0 @@ -local M = {} - -local function is_ft(b, ft) - return vim.bo[b].filetype == ft -end - -local function diagnostics_indicator(num, _, diagnostics, _) - local result = {} - local symbols = { error = "", warning = "", info = "" } - if not lvim.use_icons then - return "(" .. num .. ")" - end - for name, count in pairs(diagnostics) do - if symbols[name] and count > 0 then - table.insert(result, symbols[name] .. " " .. count) - end - end - result = table.concat(result, " ") - return #result > 0 and result or "" -end - -local function custom_filter(buf, buf_nums) - local logs = vim.tbl_filter(function(b) - return is_ft(b, "log") - end, buf_nums) - if vim.tbl_isempty(logs) then - return true - end - local tab_num = vim.fn.tabpagenr() - local last_tab = vim.fn.tabpagenr "$" - local is_log = is_ft(buf, "log") - if last_tab == 1 then - return true - end - -- only show log buffers in secondary tabs - return (tab_num == last_tab and is_log) or (tab_num ~= last_tab and not is_log) -end - -M.config = function() - lvim.builtin.bufferline = { - active = true, - on_config_done = nil, - keymap = { - normal_mode = {}, - }, - highlights = { - background = { - gui = "italic", - }, - buffer_selected = { - gui = "bold", - }, - }, - options = { - numbers = "none", -- can be "none" | "ordinal" | "buffer_id" | "both" | function - close_command = "bdelete! %d", -- can be a string | function, see "Mouse actions" - right_mouse_command = "vert sbuffer %d", -- can be a string | function, see "Mouse actions" - left_mouse_command = "buffer %d", -- can be a string | function, see "Mouse actions" - middle_mouse_command = nil, -- can be a string | function, see "Mouse actions" - -- NOTE: this plugin is designed with this icon in mind, - -- and so changing this is NOT recommended, this is intended - -- as an escape hatch for people who cannot bear it for whatever reason - indicator_icon = "▎", - buffer_close_icon = "", - modified_icon = "●", - close_icon = "", - left_trunc_marker = "", - right_trunc_marker = "", - --- name_formatter can be used to change the buffer's label in the bufferline. - --- Please note some names can/will break the - --- bufferline so use this at your discretion knowing that it has - --- some limitations that will *NOT* be fixed. - name_formatter = function(buf) -- buf contains a "name", "path" and "bufnr" - -- remove extension from markdown files for example - if buf.name:match "%.md" then - return vim.fn.fnamemodify(buf.name, ":t:r") - end - end, - max_name_length = 18, - max_prefix_length = 15, -- prefix used when a buffer is de-duplicated - tab_size = 18, - diagnostics = "nvim_lsp", - diagnostics_update_in_insert = false, - diagnostics_indicator = diagnostics_indicator, - -- NOTE: this will be called a lot so don't do any heavy processing here - custom_filter = custom_filter, - offsets = { - { - filetype = "undotree", - text = "Undotree", - highlight = "PanelHeading", - padding = 1, - }, - { - filetype = "NvimTree", - text = "Explorer", - highlight = "PanelHeading", - padding = 1, - }, - { - filetype = "DiffviewFiles", - text = "Diff View", - highlight = "PanelHeading", - padding = 1, - }, - { - filetype = "flutterToolsOutline", - text = "Flutter Outline", - highlight = "PanelHeading", - }, - { - filetype = "packer", - text = "Packer", - highlight = "PanelHeading", - padding = 1, - }, - }, - show_buffer_icons = lvim.use_icons, -- disable filetype icons for buffers - show_buffer_close_icons = lvim.use_icons, - show_close_icon = false, - show_tab_indicators = true, - persist_buffer_sort = true, -- whether or not custom sorted buffers should persist - -- can also be a table containing 2 custom separators - -- [focused and unfocused]. eg: { '|', '|' } - separator_style = "thin", - enforce_regular_tabs = false, - always_show_bufferline = false, - sort_by = "id", - }, - } -end - -M.setup = function() - require("lvim.keymappings").load(lvim.builtin.bufferline.keymap) - require("bufferline").setup { - options = lvim.builtin.bufferline.options, - highlights = lvim.builtin.bufferline.highlights, - } - - if lvim.builtin.bufferline.on_config_done then - lvim.builtin.bufferline.on_config_done() - end -end - ---stylua: ignore - --- Common kill function for bdelete and bwipeout --- credits: based on bbye and nvim-bufdel ----@param kill_command? string defaults to "bd" ----@param bufnr? number defaults to the current buffer ----@param force? boolean defaults to false -function M.buf_kill(kill_command, bufnr, force) - kill_command = kill_command or "bd" - - local bo = vim.bo - local api = vim.api - local fmt = string.format - local fnamemodify = vim.fn.fnamemodify - - if bufnr == 0 or bufnr == nil then - bufnr = api.nvim_get_current_buf() - end - - local bufname = api.nvim_buf_get_name(bufnr) - - if not force then - local warning - if bo[bufnr].modified then - warning = fmt([[No write since last change for (%s)]], fnamemodify(bufname, ":t")) - elseif api.nvim_buf_get_option(bufnr, "buftype") == "terminal" then - warning = fmt([[Terminal %s will be killed]], bufname) - end - if warning then - vim.ui.input({ - prompt = string.format([[%s. Close it anyway? [y]es or [n]o (default: no): ]], warning), - }, function(choice) - if choice:match "ye?s?" then force = true end - end) - if not force then return end - end - end - - -- Get list of windows IDs with the buffer to close - local windows = vim.tbl_filter(function(win) - return api.nvim_win_get_buf(win) == bufnr - end, api.nvim_list_wins()) - - if #windows == 0 then return end - - if force then - kill_command = kill_command .. "!" - end - - -- Get list of active buffers - local buffers = vim.tbl_filter(function(buf) - return api.nvim_buf_is_valid(buf) and bo[buf].buflisted - end, api.nvim_list_bufs()) - - -- If there is only one buffer (which has to be the current one), vim will - -- create a new buffer on :bd. - -- For more than one buffer, pick the previous buffer (wrapping around if necessary) - if #buffers > 1 then - for i, v in ipairs(buffers) do - if v == bufnr then - local prev_buf_idx = i == 1 and (#buffers - 1) or (i - 1) - local prev_buffer = buffers[prev_buf_idx] - for _, win in ipairs(windows) do - api.nvim_win_set_buf(win, prev_buffer) - end - end - end - end - - -- Check if buffer still exists, to ensure the target buffer wasn't killed - -- due to options like bufhidden=wipe. - if api.nvim_buf_is_valid(bufnr) and bo[bufnr].buflisted then - vim.cmd(string.format("%s %d", kill_command, bufnr)) - end -end - -return M diff --git a/.local/share/lunarvim/lvim/lua/lvim/core/builtins/init.lua b/.local/share/lunarvim/lvim/lua/lvim/core/builtins/init.lua deleted file mode 100644 index e219d45e..00000000 --- a/.local/share/lunarvim/lvim/lua/lvim/core/builtins/init.lua +++ /dev/null @@ -1,28 +0,0 @@ -local M = {} - -local builtins = { - "lvim.core.which-key", - "lvim.core.gitsigns", - "lvim.core.cmp", - "lvim.core.dap", - "lvim.core.terminal", - "lvim.core.telescope", - "lvim.core.treesitter", - "lvim.core.nvimtree", - "lvim.core.project", - "lvim.core.bufferline", - "lvim.core.autopairs", - "lvim.core.comment", - "lvim.core.notify", - "lvim.core.lualine", - "lvim.core.alpha", -} - -function M.config(config) - for _, builtin_path in ipairs(builtins) do - local builtin = require(builtin_path) - builtin.config(config) - end -end - -return M diff --git a/.local/share/lunarvim/lvim/lua/lvim/core/cmp.lua b/.local/share/lunarvim/lvim/lua/lvim/core/cmp.lua deleted file mode 100644 index baf6279b..00000000 --- a/.local/share/lunarvim/lvim/lua/lvim/core/cmp.lua +++ /dev/null @@ -1,318 +0,0 @@ -local M = {} -M.methods = {} - ----checks if the character preceding the cursor is a space character ----@return boolean true if it is a space character, false otherwise -local check_backspace = function() - local col = vim.fn.col "." - 1 - return col == 0 or vim.fn.getline("."):sub(col, col):match "%s" -end -M.methods.check_backspace = check_backspace - -local function T(str) - return vim.api.nvim_replace_termcodes(str, true, true, true) -end - ----wraps vim.fn.feedkeys while replacing key codes with escape codes ----Ex: feedkeys("", "n") becomes feedkeys("^M", "n") ----@param key string ----@param mode string -local function feedkeys(key, mode) - vim.fn.feedkeys(T(key), mode) -end -M.methods.feedkeys = feedkeys - ----checks if emmet_ls is available and active in the buffer ----@return boolean true if available, false otherwise -local is_emmet_active = function() - local clients = vim.lsp.buf_get_clients() - - for _, client in pairs(clients) do - if client.name == "emmet_ls" then - return true - end - end - return false -end -M.methods.is_emmet_active = is_emmet_active - ----when inside a snippet, seeks to the nearest luasnip field if possible, and checks if it is jumpable ----@param dir number 1 for forward, -1 for backward; defaults to 1 ----@return boolean true if a jumpable luasnip field is found while inside a snippet -local function jumpable(dir) - local luasnip_ok, luasnip = pcall(require, "luasnip") - if not luasnip_ok then - return - end - - local win_get_cursor = vim.api.nvim_win_get_cursor - local get_current_buf = vim.api.nvim_get_current_buf - - local function inside_snippet() - -- for outdated versions of luasnip - if not luasnip.session.current_nodes then - return false - end - - local node = luasnip.session.current_nodes[get_current_buf()] - if not node then - return false - end - - local snip_begin_pos, snip_end_pos = node.parent.snippet.mark:pos_begin_end() - local pos = win_get_cursor(0) - pos[1] = pos[1] - 1 -- LuaSnip is 0-based not 1-based like nvim for rows - return pos[1] >= snip_begin_pos[1] and pos[1] <= snip_end_pos[1] - end - - ---sets the current buffer's luasnip to the one nearest the cursor - ---@return boolean true if a node is found, false otherwise - local function seek_luasnip_cursor_node() - -- for outdated versions of luasnip - if not luasnip.session.current_nodes then - return false - end - - local pos = win_get_cursor(0) - pos[1] = pos[1] - 1 - local node = luasnip.session.current_nodes[get_current_buf()] - if not node then - return false - end - - local snippet = node.parent.snippet - local exit_node = snippet.insert_nodes[0] - - -- exit early if we're past the exit node - if exit_node then - local exit_pos_end = exit_node.mark:pos_end() - if (pos[1] > exit_pos_end[1]) or (pos[1] == exit_pos_end[1] and pos[2] > exit_pos_end[2]) then - snippet:remove_from_jumplist() - luasnip.session.current_nodes[get_current_buf()] = nil - - return false - end - end - - node = snippet.inner_first:jump_into(1, true) - while node ~= nil and node.next ~= nil and node ~= snippet do - local n_next = node.next - local next_pos = n_next and n_next.mark:pos_begin() - local candidate = n_next ~= snippet and next_pos and (pos[1] < next_pos[1]) - or (pos[1] == next_pos[1] and pos[2] < next_pos[2]) - - -- Past unmarked exit node, exit early - if n_next == nil or n_next == snippet.next then - snippet:remove_from_jumplist() - luasnip.session.current_nodes[get_current_buf()] = nil - - return false - end - - if candidate then - luasnip.session.current_nodes[get_current_buf()] = node - return true - end - - local ok - ok, node = pcall(node.jump_from, node, 1, true) -- no_move until last stop - if not ok then - snippet:remove_from_jumplist() - luasnip.session.current_nodes[get_current_buf()] = nil - - return false - end - end - - -- No candidate, but have an exit node - if exit_node then - -- to jump to the exit node, seek to snippet - luasnip.session.current_nodes[get_current_buf()] = snippet - return true - end - - -- No exit node, exit from snippet - snippet:remove_from_jumplist() - luasnip.session.current_nodes[get_current_buf()] = nil - return false - end - - if dir == -1 then - return inside_snippet() and luasnip.jumpable(-1) - else - return inside_snippet() and seek_luasnip_cursor_node() and luasnip.jumpable() - end -end -M.methods.jumpable = jumpable - -M.config = function() - local status_cmp_ok, cmp = pcall(require, "cmp") - if not status_cmp_ok then - return - end - local status_luasnip_ok, luasnip = pcall(require, "luasnip") - if not status_luasnip_ok then - return - end - - lvim.builtin.cmp = { - confirm_opts = { - behavior = cmp.ConfirmBehavior.Replace, - select = false, - }, - completion = { - ---@usage The minimum length of a word to complete on. - keyword_length = 1, - }, - experimental = { - ghost_text = true, - native_menu = false, - }, - formatting = { - fields = { "kind", "abbr", "menu" }, - max_width = 0, - kind_icons = { - Class = " ", - Color = " ", - Constant = "ﲀ ", - Constructor = " ", - Enum = "練", - EnumMember = " ", - Event = " ", - Field = " ", - File = "", - Folder = " ", - Function = " ", - Interface = "ﰮ ", - Keyword = " ", - Method = " ", - Module = " ", - Operator = "", - Property = " ", - Reference = " ", - Snippet = " ", - Struct = " ", - Text = " ", - TypeParameter = " ", - Unit = "塞", - Value = " ", - Variable = " ", - }, - source_names = { - nvim_lsp = "(LSP)", - emoji = "(Emoji)", - path = "(Path)", - calc = "(Calc)", - cmp_tabnine = "(Tabnine)", - vsnip = "(Snippet)", - luasnip = "(Snippet)", - buffer = "(Buffer)", - tmux = "(TMUX)", - }, - duplicates = { - buffer = 1, - path = 1, - nvim_lsp = 0, - luasnip = 1, - }, - duplicates_default = 0, - format = function(entry, vim_item) - local max_width = lvim.builtin.cmp.formatting.max_width - if max_width ~= 0 and #vim_item.abbr > max_width then - vim_item.abbr = string.sub(vim_item.abbr, 1, max_width - 1) .. "…" - end - if lvim.use_icons then - vim_item.kind = lvim.builtin.cmp.formatting.kind_icons[vim_item.kind] - end - vim_item.menu = lvim.builtin.cmp.formatting.source_names[entry.source.name] - vim_item.dup = lvim.builtin.cmp.formatting.duplicates[entry.source.name] - or lvim.builtin.cmp.formatting.duplicates_default - return vim_item - end, - }, - snippet = { - expand = function(args) - require("luasnip").lsp_expand(args.body) - end, - }, - window = { - completion = cmp.config.window.bordered(), - documentation = cmp.config.window.bordered(), - }, - sources = { - { name = "nvim_lsp" }, - { name = "path" }, - { name = "luasnip" }, - { name = "cmp_tabnine" }, - { name = "nvim_lua" }, - { name = "buffer" }, - { name = "calc" }, - { name = "emoji" }, - { name = "treesitter" }, - { name = "crates" }, - { name = "tmux" }, - }, - mapping = cmp.mapping.preset.insert { - [""] = cmp.mapping.select_prev_item(), - [""] = cmp.mapping.select_next_item(), - [""] = cmp.mapping.scroll_docs(-4), - [""] = cmp.mapping.scroll_docs(4), - -- TODO: potentially fix emmet nonsense - [""] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_next_item() - elseif luasnip.expandable() then - luasnip.expand() - elseif jumpable() then - luasnip.jump(1) - elseif check_backspace() then - fallback() - elseif is_emmet_active() then - return vim.fn["cmp#complete"]() - else - fallback() - end - end, { - "i", - "s", - }), - [""] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_prev_item() - elseif jumpable(-1) then - luasnip.jump(-1) - else - fallback() - end - end, { - "i", - "s", - }), - - [""] = cmp.mapping.complete(), - [""] = cmp.mapping.abort(), - [""] = cmp.mapping(function(fallback) - if cmp.visible() and cmp.confirm(lvim.builtin.cmp.confirm_opts) then - if jumpable() then - luasnip.jump(1) - end - return - end - - if jumpable() then - if not luasnip.jump(1) then - fallback() - end - else - fallback() - end - end), - }, - } -end - -function M.setup() - require("cmp").setup(lvim.builtin.cmp) -end - -return M diff --git a/.local/share/lunarvim/lvim/lua/lvim/core/commands.lua b/.local/share/lunarvim/lvim/lua/lvim/core/commands.lua deleted file mode 100644 index 80c5bb03..00000000 --- a/.local/share/lunarvim/lvim/lua/lvim/core/commands.lua +++ /dev/null @@ -1,78 +0,0 @@ -local M = {} - -vim.cmd [[ - function! QuickFixToggle() - if empty(filter(getwininfo(), 'v:val.quickfix')) - copen - else - cclose - endif - endfunction -]] - -M.defaults = { - { - name = "BufferKill", - fn = function() - require("lvim.core.bufferline").buf_kill "bd" - end, - }, - { - name = "LvimToggleFormatOnSave", - fn = function() - require("lvim.core.autocmds").toggle_format_on_save() - end, - }, - { - name = "LvimInfo", - fn = function() - require("lvim.core.info").toggle_popup(vim.bo.filetype) - end, - }, - { - name = "LvimCacheReset", - fn = function() - require("lvim.utils.hooks").reset_cache() - end, - }, - { - name = "LvimReload", - fn = function() - require("lvim.config"):reload() - end, - }, - { - name = "LvimUpdate", - fn = function() - require("lvim.bootstrap"):update() - end, - }, - { - name = "LvimSyncCorePlugins", - fn = function() - require("lvim.plugin-loader").sync_core_plugins() - end, - }, - { - name = "LvimChangelog", - fn = function() - require("lvim.core.telescope.custom-finders").view_lunarvim_changelog() - end, - }, - { - name = "LvimVersion", - fn = function() - print(require("lvim.utils.git").get_lvim_version()) - end, - }, -} - -function M.load(collection) - local common_opts = { force = true } - for _, cmd in pairs(collection) do - local opts = vim.tbl_deep_extend("force", common_opts, cmd.opts or {}) - vim.api.nvim_create_user_command(cmd.name, cmd.fn, opts) - end -end - -return M diff --git a/.local/share/lunarvim/lvim/lua/lvim/core/comment.lua b/.local/share/lunarvim/lvim/lua/lvim/core/comment.lua deleted file mode 100644 index 0b454074..00000000 --- a/.local/share/lunarvim/lvim/lua/lvim/core/comment.lua +++ /dev/null @@ -1,71 +0,0 @@ -local M = {} - -function M.config() - local pre_hook = nil - if lvim.builtin.treesitter.context_commentstring.enable then - pre_hook = function(_ctx) - return require("ts_context_commentstring.internal").calculate_commentstring() - end - end - lvim.builtin.comment = { - active = true, - on_config_done = nil, - ---Add a space b/w comment and the line - ---@type boolean - padding = true, - - ---Lines to be ignored while comment/uncomment. - ---Could be a regex string or a function that returns a regex string. - ---Example: Use '^$' to ignore empty lines - ---@type string|function - ignore = "^$", - - ---Whether to create basic (operator-pending) and extra mappings for NORMAL/VISUAL mode - ---@type table - mappings = { - ---operator-pending mapping - ---Includes `gcc`, `gcb`, `gc[count]{motion}` and `gb[count]{motion}` - basic = true, - ---extended mapping - ---Includes `g>`, `g<`, `g>[count]{motion}` and `g<[count]{motion}` - extra = false, - }, - - ---LHS of line and block comment toggle mapping in NORMAL/VISUAL mode - ---@type table - toggler = { - ---line-comment toggle - line = "gcc", - ---block-comment toggle - block = "gbc", - }, - - ---LHS of line and block comment operator-mode mapping in NORMAL/VISUAL mode - ---@type table - opleader = { - ---line-comment opfunc mapping - line = "gc", - ---block-comment opfunc mapping - block = "gb", - }, - - ---Pre-hook, called before commenting the line - ---@type function|nil - pre_hook = pre_hook, - - ---Post-hook, called after commenting is done - ---@type function|nil - post_hook = nil, - } -end - -function M.setup() - local nvim_comment = require "Comment" - - nvim_comment.setup(lvim.builtin.comment) - if lvim.builtin.comment.on_config_done then - lvim.builtin.comment.on_config_done(nvim_comment) - end -end - -return M diff --git a/.local/share/lunarvim/lvim/lua/lvim/core/dap.lua b/.local/share/lunarvim/lvim/lua/lvim/core/dap.lua deleted file mode 100644 index 727e238f..00000000 --- a/.local/share/lunarvim/lvim/lua/lvim/core/dap.lua +++ /dev/null @@ -1,78 +0,0 @@ -local M = {} - -M.config = function() - lvim.builtin.dap = { - active = false, - on_config_done = nil, - breakpoint = { - text = "", - texthl = "LspDiagnosticsSignError", - linehl = "", - numhl = "", - }, - breakpoint_rejected = { - text = "", - texthl = "LspDiagnosticsSignHint", - linehl = "", - numhl = "", - }, - stopped = { - text = "", - texthl = "LspDiagnosticsSignInformation", - linehl = "DiagnosticUnderlineInfo", - numhl = "LspDiagnosticsSignInformation", - }, - } -end - -M.setup = function() - local dap = require "dap" - - if lvim.use_icons then - vim.fn.sign_define("DapBreakpoint", lvim.builtin.dap.breakpoint) - vim.fn.sign_define("DapBreakpointRejected", lvim.builtin.dap.breakpoint_rejected) - vim.fn.sign_define("DapStopped", lvim.builtin.dap.stopped) - end - - dap.defaults.fallback.terminal_win_cmd = "50vsplit new" - - lvim.builtin.which_key.mappings["d"] = { - name = "Debug", - t = { "lua require'dap'.toggle_breakpoint()", "Toggle Breakpoint" }, - b = { "lua require'dap'.step_back()", "Step Back" }, - c = { "lua require'dap'.continue()", "Continue" }, - C = { "lua require'dap'.run_to_cursor()", "Run To Cursor" }, - d = { "lua require'dap'.disconnect()", "Disconnect" }, - g = { "lua require'dap'.session()", "Get Session" }, - i = { "lua require'dap'.step_into()", "Step Into" }, - o = { "lua require'dap'.step_over()", "Step Over" }, - u = { "lua require'dap'.step_out()", "Step Out" }, - p = { "lua require'dap'.pause()", "Pause" }, - r = { "lua require'dap'.repl.toggle()", "Toggle Repl" }, - s = { "lua require'dap'.continue()", "Start" }, - q = { "lua require'dap'.close()", "Quit" }, - } - - if lvim.builtin.dap.on_config_done then - lvim.builtin.dap.on_config_done(dap) - end -end - --- TODO put this up there ^^^ call in ftplugin - --- M.dap = function() --- if lvim.plugin.dap.active then --- local dap_install = require "dap-install" --- dap_install.config("python_dbg", {}) --- end --- end --- --- M.dap = function() --- -- gem install readapt ruby-debug-ide --- if lvim.plugin.dap.active then --- local dap_install = require "dap-install" --- dap_install.config("ruby_vsc_dbg", {}) --- end --- end - -return M diff --git a/.local/share/lunarvim/lvim/lua/lvim/core/gitsigns.lua b/.local/share/lunarvim/lvim/lua/lvim/core/gitsigns.lua deleted file mode 100644 index 0365fc69..00000000 --- a/.local/share/lunarvim/lvim/lua/lvim/core/gitsigns.lua +++ /dev/null @@ -1,90 +0,0 @@ -local M = {} - -M.config = function() - lvim.builtin.gitsigns = { - active = true, - on_config_done = nil, - opts = { - signs = { - add = { - hl = "GitSignsAdd", - text = "▎", - numhl = "GitSignsAddNr", - linehl = "GitSignsAddLn", - }, - change = { - hl = "GitSignsChange", - text = "▎", - numhl = "GitSignsChangeNr", - linehl = "GitSignsChangeLn", - }, - delete = { - hl = "GitSignsDelete", - text = "契", - numhl = "GitSignsDeleteNr", - linehl = "GitSignsDeleteLn", - }, - topdelete = { - hl = "GitSignsDelete", - text = "契", - numhl = "GitSignsDeleteNr", - linehl = "GitSignsDeleteLn", - }, - changedelete = { - hl = "GitSignsChange", - text = "▎", - numhl = "GitSignsChangeNr", - linehl = "GitSignsChangeLn", - }, - }, - numhl = false, - linehl = false, - keymaps = { - -- Default keymap options - noremap = true, - buffer = true, - }, - signcolumn = true, - word_diff = false, - attach_to_untracked = true, - current_line_blame = false, -- Toggle with `:Gitsigns toggle_current_line_blame` - current_line_blame_opts = { - virt_text = true, - virt_text_pos = "eol", -- 'eol' | 'overlay' | 'right_align' - delay = 1000, - ignore_whitespace = false, - }, - current_line_blame_formatter_opts = { - relative_time = false, - }, - max_file_length = 40000, - preview_config = { - -- Options passed to nvim_open_win - border = "rounded", - style = "minimal", - relative = "cursor", - row = 0, - col = 1, - }, - watch_gitdir = { - interval = 1000, - follow_files = true, - }, - sign_priority = 6, - update_debounce = 200, - status_formatter = nil, -- Use default - yadm = { enable = false }, - }, - } -end - -M.setup = function() - local gitsigns = require "gitsigns" - - gitsigns.setup(lvim.builtin.gitsigns.opts) - if lvim.builtin.gitsigns.on_config_done then - lvim.builtin.gitsigns.on_config_done(gitsigns) - end -end - -return M diff --git a/.local/share/lunarvim/lvim/lua/lvim/core/info.lua b/.local/share/lunarvim/lvim/lua/lvim/core/info.lua deleted file mode 100644 index ac7d690a..00000000 --- a/.local/share/lunarvim/lvim/lua/lvim/core/info.lua +++ /dev/null @@ -1,222 +0,0 @@ -local M = { - banner = { - "", - [[ __ _ ___ ]], - [[ / / __ ______ ____ _____| | / (_)___ ___ ]], - [[ / / / / / / __ \/ __ `/ ___/ | / / / __ `__ \]], - [[ / /___/ /_/ / / / / /_/ / / | |/ / / / / / / /]], - [[/_____/\__,_/_/ /_/\__,_/_/ |___/_/_/ /_/ /_/ ]], - }, -} - -local fmt = string.format -local text = require "lvim.interface.text" -local lsp_utils = require "lvim.lsp.utils" - -local function str_list(list) - return #list == 1 and list[1] or fmt("[%s]", table.concat(list, ", ")) -end - -local function make_formatters_info(ft) - local null_formatters = require "lvim.lsp.null-ls.formatters" - local registered_formatters = null_formatters.list_registered(ft) - local supported_formatters = null_formatters.list_supported(ft) - local section = { - "Formatters info", - fmt( - "* Active: %s%s", - table.concat(registered_formatters, "  , "), - vim.tbl_count(registered_formatters) > 0 and "  " or "" - ), - fmt("* Supported: %s", str_list(supported_formatters)), - } - - return section -end - -local function make_code_actions_info(ft) - local null_actions = require "lvim.lsp.null-ls.code_actions" - local registered_actions = null_actions.list_registered(ft) - local section = { - "Code actions info", - fmt( - "* Active: %s%s", - table.concat(registered_actions, "  , "), - vim.tbl_count(registered_actions) > 0 and "  " or "" - ), - } - - return section -end - -local function make_linters_info(ft) - local null_linters = require "lvim.lsp.null-ls.linters" - local supported_linters = null_linters.list_supported(ft) - local registered_linters = null_linters.list_registered(ft) - local section = { - "Linters info", - fmt( - "* Active: %s%s", - table.concat(registered_linters, "  , "), - vim.tbl_count(registered_linters) > 0 and "  " or "" - ), - fmt("* Supported: %s", str_list(supported_linters)), - } - - return section -end - -local function tbl_set_highlight(terms, highlight_group) - for _, v in pairs(terms) do - vim.cmd('let m=matchadd("' .. highlight_group .. '", "' .. v .. "[ ,│']\")") - vim.cmd('let m=matchadd("' .. highlight_group .. '", ", ' .. v .. '")') - end -end - -local function make_client_info(client) - if client.name == "null-ls" then - return - end - local client_enabled_caps = lsp_utils.get_client_capabilities(client.id) - local name = client.name - local id = client.id - local filetypes = lsp_utils.get_supported_filetypes(name) - local attached_buffers_list = str_list(vim.lsp.get_buffers_by_client_id(client.id)) - local client_info = { - fmt("* name: %s", name), - fmt("* id: %s", tostring(id)), - fmt("* supported filetype(s): %s", str_list(filetypes)), - fmt("* attached buffers: %s", tostring(attached_buffers_list)), - fmt("* root_dir pattern: %s", tostring(attached_buffers_list)), - } - if not vim.tbl_isempty(client_enabled_caps) then - local caps_text = "* capabilities: " - local caps_text_len = caps_text:len() - local enabled_caps = text.format_table(client_enabled_caps, 3, " | ") - enabled_caps = text.shift_right(enabled_caps, caps_text_len) - enabled_caps[1] = fmt("%s%s", caps_text, enabled_caps[1]:sub(caps_text_len + 1)) - vim.list_extend(client_info, enabled_caps) - end - - return client_info -end - -local function make_auto_lsp_info(ft) - local skipped_filetypes = lvim.lsp.automatic_configuration.skipped_filetypes - local skipped_servers = lvim.lsp.automatic_configuration.skipped_servers - local info_lines = { "Automatic LSP info" } - - if vim.tbl_contains(skipped_filetypes, ft) then - vim.list_extend(info_lines, { "* Status: disabled for " .. ft }) - return info_lines - end - - local available = lsp_utils.get_supported_servers_per_filetype(ft) - local skipped = vim.tbl_filter(function(name) - return vim.tbl_contains(available, name) - end, skipped_servers) - - if #skipped == 0 then - return { "" } - end - - vim.list_extend(info_lines, { fmt("* Skipped servers: %s", str_list(skipped)) }) - - return info_lines -end - -function M.toggle_popup(ft) - local clients = vim.lsp.get_active_clients() - local client_names = {} - local bufnr = vim.api.nvim_get_current_buf() - local ts_active_buffers = vim.tbl_keys(vim.treesitter.highlighter.active) - local is_treesitter_active = function() - local status = "inactive" - if vim.tbl_contains(ts_active_buffers, bufnr) then - status = "active" - end - return status - end - local header = { - "Buffer info", - fmt("* filetype: %s", ft), - fmt("* bufnr: %s", bufnr), - fmt("* treesitter status: %s", is_treesitter_active()), - } - - local lsp_info = { - "Active client(s)", - } - - for _, client in pairs(clients) do - local client_info = make_client_info(client) - if client_info then - vim.list_extend(lsp_info, client_info) - end - table.insert(client_names, client.name) - end - - local auto_lsp_info = make_auto_lsp_info(ft) - - local formatters_info = make_formatters_info(ft) - - local linters_info = make_linters_info(ft) - - local code_actions_info = make_code_actions_info(ft) - - local content_provider = function(popup) - local content = {} - - for _, section in ipairs { - M.banner, - { "" }, - { "" }, - header, - { "" }, - lsp_info, - { "" }, - auto_lsp_info, - { "" }, - formatters_info, - { "" }, - linters_info, - { "" }, - code_actions_info, - } do - vim.list_extend(content, section) - end - - return text.align_left(popup, content, 0.5) - end - - local function set_syntax_hl() - vim.cmd [[highlight LvimInfoIdentifier gui=bold]] - vim.cmd [[highlight link LvimInfoHeader Type]] - vim.fn.matchadd("LvimInfoHeader", "Buffer info") - vim.fn.matchadd("LvimInfoHeader", "Active client(s)") - vim.fn.matchadd("LvimInfoHeader", fmt("Overridden %s server(s)", ft)) - vim.fn.matchadd("LvimInfoHeader", "Formatters info") - vim.fn.matchadd("LvimInfoHeader", "Linters info") - vim.fn.matchadd("LvimInfoHeader", "Code actions info") - vim.fn.matchadd("LvimInfoHeader", "Automatic LSP info") - vim.fn.matchadd("LvimInfoIdentifier", " " .. ft .. "$") - vim.fn.matchadd("string", "true") - vim.fn.matchadd("string", "active") - vim.fn.matchadd("string", "") - vim.fn.matchadd("boolean", "inactive") - vim.fn.matchadd("error", "false") - tbl_set_highlight(require("lvim.lsp.null-ls.formatters").list_registered(ft), "LvimInfoIdentifier") - tbl_set_highlight(require("lvim.lsp.null-ls.linters").list_registered(ft), "LvimInfoIdentifier") - tbl_set_highlight(require("lvim.lsp.null-ls.code_actions").list_registered(ft), "LvimInfoIdentifier") - end - - local Popup = require("lvim.interface.popup"):new { - win_opts = { number = false }, - buf_opts = { modifiable = false, filetype = "lspinfo" }, - } - Popup:display(content_provider) - set_syntax_hl() - - return Popup -end -return M diff --git a/.local/share/lunarvim/lvim/lua/lvim/core/log.lua b/.local/share/lunarvim/lvim/lua/lvim/core/log.lua deleted file mode 100644 index 49c70f83..00000000 --- a/.local/share/lunarvim/lvim/lua/lvim/core/log.lua +++ /dev/null @@ -1,207 +0,0 @@ -local Log = {} - -Log.levels = { - TRACE = 1, - DEBUG = 2, - INFO = 3, - WARN = 4, - ERROR = 5, -} -vim.tbl_add_reverse_lookup(Log.levels) - -local notify_opts = {} - -function Log:set_level(level) - -- package.loaded["lvim.core.log"] = nil - local log_level = Log.levels[level:upper()] - local status_ok, logger = pcall(require("structlog").get_logger, "lvim") - if status_ok then - for _, s in ipairs(logger.sinks) do - s.level = log_level - end - end - - package.loaded["packer.log"] = nil - require("packer.log").new { level = lvim.log.level } -end - -function Log:init() - local status_ok, structlog = pcall(require, "structlog") - if not status_ok then - return nil - end - - local log_level = Log.levels[(lvim.log.level):upper() or "WARN"] - local lvim_log = { - lvim = { - sinks = { - structlog.sinks.Console(log_level, { - async = false, - processors = { - structlog.processors.Namer(), - structlog.processors.StackWriter({ "line", "file" }, { max_parents = 0, stack_level = 2 }), - structlog.processors.Timestamper "%H:%M:%S", - }, - formatter = structlog.formatters.FormatColorizer( -- - "%s [%-5s] %s: %-30s", - { "timestamp", "level", "logger_name", "msg" }, - { level = structlog.formatters.FormatColorizer.color_level() } - ), - }), - structlog.sinks.File(log_level, self:get_path(), { - processors = { - structlog.processors.Namer(), - structlog.processors.StackWriter({ "line", "file" }, { max_parents = 3, stack_level = 2 }), - structlog.processors.Timestamper "%F %H:%M:%S", - }, - formatter = structlog.formatters.Format( -- - "%s [%-5s] %s: %-30s", - { "timestamp", "level", "logger_name", "msg" } - ), - }), - }, - }, - } - - structlog.configure(lvim_log) - local logger = structlog.get_logger "lvim" - - -- Overwrite `vim.notify` to use the logger - if lvim.log.override_notify then - vim.notify = function(msg, vim_log_level, opts) - notify_opts = opts or {} - - -- vim_log_level can be omitted - if vim_log_level == nil then - vim_log_level = Log.levels["INFO"] - elseif type(vim_log_level) == "string" then - vim_log_level = Log.levels[(vim_log_level):upper()] or Log.levels["INFO"] - else - -- https://github.com/neovim/neovim/blob/685cf398130c61c158401b992a1893c2405cd7d2/runtime/lua/vim/lsp/log.lua#L5 - vim_log_level = vim_log_level + 1 - end - - logger:log(vim_log_level, msg) - end - end - - return logger -end - ---- Configure the sink in charge of logging notifications ----@param notif_handle table The implementation used by the sink for displaying the notifications -function Log:configure_notifications(notif_handle) - local status_ok, structlog = pcall(require, "structlog") - if not status_ok then - return - end - - local default_namer = function(logger, entry) - entry["title"] = logger.name - return entry - end - - local notify_opts_injecter = function(_, entry) - for key, value in pairs(notify_opts) do - entry[key] = value - end - notify_opts = {} - return entry - end - - local sink = structlog.sinks.NvimNotify(Log.levels.INFO, { - processors = { - default_namer, - notify_opts_injecter, - }, - formatter = structlog.formatters.Format( -- - "%s", - { "msg" }, - { blacklist_all = true } - ), - -- This should probably not be hard-coded - params_map = { - icon = "icon", - keep = "keep", - on_open = "on_open", - on_close = "on_close", - timeout = "timeout", - title = "title", - }, - impl = notif_handle, - }) - - table.insert(self.__handle.sinks, sink) -end - ---- Adds a log entry using Plenary.log ----@param msg any ----@param level string [same as vim.log.log_levels] -function Log:add_entry(level, msg, event) - local logger = self:get_logger() - if not logger then - return - end - logger:log(level, vim.inspect(msg), event) -end - ----Retrieves the handle of the logger object ----@return table|nil logger handle if found -function Log:get_logger() - if self.__handle then - return self.__handle - end - - local logger = self:init() - if not logger then - return - end - - self.__handle = logger - return logger -end - ----Retrieves the path of the logfile ----@return string path of the logfile -function Log:get_path() - return string.format("%s/%s.log", get_cache_dir(), "lvim") -end - ----Add a log entry at TRACE level ----@param msg any ----@param event any -function Log:trace(msg, event) - self:add_entry(self.levels.TRACE, msg, event) -end - ----Add a log entry at DEBUG level ----@param msg any ----@param event any -function Log:debug(msg, event) - self:add_entry(self.levels.DEBUG, msg, event) -end - ----Add a log entry at INFO level ----@param msg any ----@param event any -function Log:info(msg, event) - self:add_entry(self.levels.INFO, msg, event) -end - ----Add a log entry at WARN level ----@param msg any ----@param event any -function Log:warn(msg, event) - self:add_entry(self.levels.WARN, msg, event) -end - ----Add a log entry at ERROR level ----@param msg any ----@param event any -function Log:error(msg, event) - self:add_entry(self.levels.ERROR, msg, event) -end - -setmetatable({}, Log) - -return Log diff --git a/.local/share/lunarvim/lvim/lua/lvim/core/lualine/colors.lua b/.local/share/lunarvim/lvim/lua/lvim/core/lualine/colors.lua deleted file mode 100644 index 4984cd1f..00000000 --- a/.local/share/lunarvim/lvim/lua/lvim/core/lualine/colors.lua +++ /dev/null @@ -1,16 +0,0 @@ -local colors = { - bg = "#202328", - fg = "#bbc2cf", - yellow = "#ECBE7B", - cyan = "#008080", - darkblue = "#081633", - green = "#98be65", - orange = "#FF8800", - violet = "#a9a1e1", - magenta = "#c678dd", - purple = "#c678dd", - blue = "#51afef", - red = "#ec5f67", -} - -return colors diff --git a/.local/share/lunarvim/lvim/lua/lvim/core/lualine/components.lua b/.local/share/lunarvim/lvim/lua/lvim/core/lualine/components.lua deleted file mode 100644 index 49a8ff81..00000000 --- a/.local/share/lunarvim/lvim/lua/lvim/core/lualine/components.lua +++ /dev/null @@ -1,155 +0,0 @@ -local conditions = require "lvim.core.lualine.conditions" -local colors = require "lvim.core.lualine.colors" - -local function diff_source() - local gitsigns = vim.b.gitsigns_status_dict - if gitsigns then - return { - added = gitsigns.added, - modified = gitsigns.changed, - removed = gitsigns.removed, - } - end -end - -return { - mode = { - function() - return " " - end, - padding = { left = 0, right = 0 }, - color = {}, - cond = nil, - }, - branch = { - "b:gitsigns_head", - icon = " ", - color = { gui = "bold" }, - cond = conditions.hide_in_width, - }, - filename = { - "filename", - color = {}, - cond = nil, - }, - diff = { - "diff", - source = diff_source, - symbols = { added = "  ", modified = " ", removed = " " }, - diff_color = { - added = { fg = colors.green }, - modified = { fg = colors.yellow }, - removed = { fg = colors.red }, - }, - cond = nil, - }, - python_env = { - function() - local utils = require "lvim.core.lualine.utils" - if vim.bo.filetype == "python" then - local venv = os.getenv "CONDA_DEFAULT_ENV" - if venv then - return string.format("  (%s)", utils.env_cleanup(venv)) - end - venv = os.getenv "VIRTUAL_ENV" - if venv then - return string.format("  (%s)", utils.env_cleanup(venv)) - end - return "" - end - return "" - end, - color = { fg = colors.green }, - cond = conditions.hide_in_width, - }, - diagnostics = { - "diagnostics", - sources = { "nvim_diagnostic" }, - symbols = { error = " ", warn = " ", info = " ", hint = " " }, - cond = conditions.hide_in_width, - }, - treesitter = { - function() - local b = vim.api.nvim_get_current_buf() - if next(vim.treesitter.highlighter.active[b]) then - return "" - end - return "" - end, - color = { fg = colors.green }, - cond = conditions.hide_in_width, - }, - lsp = { - function(msg) - msg = msg or "LS Inactive" - local buf_clients = vim.lsp.buf_get_clients() - if next(buf_clients) == nil then - -- TODO: clean up this if statement - if type(msg) == "boolean" or #msg == 0 then - return "LS Inactive" - end - return msg - end - local buf_ft = vim.bo.filetype - local buf_client_names = {} - - -- add client - for _, client in pairs(buf_clients) do - if client.name ~= "null-ls" then - table.insert(buf_client_names, client.name) - end - end - - -- add formatter - local formatters = require "lvim.lsp.null-ls.formatters" - local supported_formatters = formatters.list_registered(buf_ft) - vim.list_extend(buf_client_names, supported_formatters) - - -- add linter - local linters = require "lvim.lsp.null-ls.linters" - local supported_linters = linters.list_registered(buf_ft) - vim.list_extend(buf_client_names, supported_linters) - - local unique_client_names = vim.fn.uniq(buf_client_names) - return "[" .. table.concat(unique_client_names, ", ") .. "]" - end, - color = { gui = "bold" }, - cond = conditions.hide_in_width, - }, - location = { "location", cond = conditions.hide_in_width, color = {} }, - progress = { "progress", cond = conditions.hide_in_width, color = {} }, - spaces = { - function() - if not vim.api.nvim_buf_get_option(0, "expandtab") then - return "Tab size: " .. vim.api.nvim_buf_get_option(0, "tabstop") .. " " - end - local size = vim.api.nvim_buf_get_option(0, "shiftwidth") - if size == 0 then - size = vim.api.nvim_buf_get_option(0, "tabstop") - end - return "Spaces: " .. size .. " " - end, - cond = conditions.hide_in_width, - color = {}, - }, - encoding = { - "o:encoding", - fmt = string.upper, - color = {}, - cond = conditions.hide_in_width, - }, - filetype = { "filetype", cond = conditions.hide_in_width }, - scrollbar = { - function() - local current_line = vim.fn.line "." - local total_lines = vim.fn.line "$" - local chars = { "__", "▁▁", "▂▂", "▃▃", "▄▄", "▅▅", "▆▆", "▇▇", "██" } - local line_ratio = current_line / total_lines - local index = math.ceil(line_ratio * #chars) - return chars[index] - end, - padding = { left = 0, right = 0 }, - color = { fg = colors.yellow, bg = colors.bg }, - cond = nil, - }, -} diff --git a/.local/share/lunarvim/lvim/lua/lvim/core/lualine/conditions.lua b/.local/share/lunarvim/lvim/lua/lvim/core/lualine/conditions.lua deleted file mode 100644 index 6e120b26..00000000 --- a/.local/share/lunarvim/lvim/lua/lvim/core/lualine/conditions.lua +++ /dev/null @@ -1,17 +0,0 @@ -local window_width_limit = 70 - -local conditions = { - buffer_not_empty = function() - return vim.fn.empty(vim.fn.expand "%:t") ~= 1 - end, - hide_in_width = function() - return vim.fn.winwidth(0) > window_width_limit - end, - -- check_git_workspace = function() - -- local filepath = vim.fn.expand "%:p:h" - -- local gitdir = vim.fn.finddir(".git", filepath .. ";") - -- return gitdir and #gitdir > 0 and #gitdir < #filepath - -- end, -} - -return conditions diff --git a/.local/share/lunarvim/lvim/lua/lvim/core/lualine/init.lua b/.local/share/lunarvim/lvim/lua/lvim/core/lualine/init.lua deleted file mode 100644 index e041e8a8..00000000 --- a/.local/share/lunarvim/lvim/lua/lvim/core/lualine/init.lua +++ /dev/null @@ -1,54 +0,0 @@ -local M = {} -M.config = function() - lvim.builtin.lualine = { - active = true, - style = "lvim", - options = { - icons_enabled = nil, - component_separators = nil, - section_separators = nil, - theme = nil, - disabled_filetypes = nil, - globalstatus = false, - }, - sections = { - lualine_a = nil, - lualine_b = nil, - lualine_c = nil, - lualine_x = nil, - lualine_y = nil, - lualine_z = nil, - }, - inactive_sections = { - lualine_a = nil, - lualine_b = nil, - lualine_c = nil, - lualine_x = nil, - lualine_y = nil, - lualine_z = nil, - }, - tabline = nil, - extensions = nil, - on_config_done = nil, - } -end - -M.setup = function() - -- avoid running in headless mode since it's harder to detect failures - if #vim.api.nvim_list_uis() == 0 then - local Log = require "lvim.core.log" - Log:debug "headless mode detected, skipping running setup for lualine" - return - end - - require("lvim.core.lualine.styles").update() - - local lualine = require "lualine" - lualine.setup(lvim.builtin.lualine) - - if lvim.builtin.lualine.on_config_done then - lvim.builtin.lualine.on_config_done(lualine) - end -end - -return M diff --git a/.local/share/lunarvim/lvim/lua/lvim/core/lualine/styles.lua b/.local/share/lunarvim/lvim/lua/lvim/core/lualine/styles.lua deleted file mode 100644 index 8991d9d9..00000000 --- a/.local/share/lunarvim/lvim/lua/lvim/core/lualine/styles.lua +++ /dev/null @@ -1,137 +0,0 @@ -local M = {} -local components = require "lvim.core.lualine.components" - -local styles = { - lvim = nil, - default = nil, - none = nil, -} - -styles.none = { - style = "none", - options = { - theme = "auto", - icons_enabled = lvim.use_icons, - component_separators = { left = "", right = "" }, - section_separators = { left = "", right = "" }, - disabled_filetypes = {}, - }, - sections = { - lualine_a = {}, - lualine_b = {}, - lualine_c = {}, - lualine_x = {}, - lualine_y = {}, - lualine_z = {}, - }, - inactive_sections = { - lualine_a = {}, - lualine_b = {}, - lualine_c = {}, - lualine_x = {}, - lualine_y = {}, - lualine_z = {}, - }, - tabline = {}, - extensions = {}, -} - -styles.default = { - style = "default", - options = { - theme = "auto", - icons_enabled = lvim.use_icons, - component_separators = { left = "", right = "" }, - section_separators = { left = "", right = "" }, - disabled_filetypes = {}, - }, - sections = { - lualine_a = { "mode" }, - lualine_b = { "branch" }, - lualine_c = { "filename" }, - lualine_x = { "encoding", "fileformat", "filetype" }, - lualine_y = { "progress" }, - lualine_z = { "location" }, - }, - inactive_sections = { - lualine_a = {}, - lualine_b = {}, - lualine_c = { "filename" }, - lualine_x = { "location" }, - lualine_y = {}, - lualine_z = {}, - }, - tabline = {}, - extensions = {}, -} - -styles.lvim = { - style = "lvim", - options = { - theme = "auto", - icons_enabled = lvim.use_icons, - component_separators = { left = "", right = "" }, - section_separators = { left = "", right = "" }, - disabled_filetypes = { "alpha", "NvimTree", "Outline" }, - }, - sections = { - lualine_a = { - components.mode, - }, - lualine_b = { - components.branch, - components.filename, - }, - lualine_c = { - components.diff, - components.python_env, - }, - lualine_x = { - components.diagnostics, - components.treesitter, - components.lsp, - components.filetype, - }, - lualine_y = {}, - lualine_z = { - components.scrollbar, - }, - }, - inactive_sections = { - lualine_a = { - "filename", - }, - lualine_b = {}, - lualine_c = {}, - lualine_x = {}, - lualine_y = {}, - lualine_z = {}, - }, - tabline = {}, - extensions = { "nvim-tree" }, -} - -function M.get_style(style) - local style_keys = vim.tbl_keys(styles) - if not vim.tbl_contains(style_keys, style) then - local Log = require "lvim.core.log" - Log:error( - "Invalid lualine style" - .. string.format('"%s"', style) - .. "options are: " - .. string.format('"%s"', table.concat(style_keys, '", "')) - ) - Log:debug '"lvim" style is applied.' - style = "lvim" - end - - return vim.deepcopy(styles[style]) -end - -function M.update() - local style = M.get_style(lvim.builtin.lualine.style) - - lvim.builtin.lualine = vim.tbl_deep_extend("keep", lvim.builtin.lualine, style) -end - -return M diff --git a/.local/share/lunarvim/lvim/lua/lvim/core/lualine/utils.lua b/.local/share/lunarvim/lvim/lua/lvim/core/lualine/utils.lua deleted file mode 100644 index 3fd3c2d3..00000000 --- a/.local/share/lunarvim/lvim/lua/lvim/core/lualine/utils.lua +++ /dev/null @@ -1,14 +0,0 @@ -local M = {} - -function M.env_cleanup(venv) - if string.find(venv, "/") then - local final_venv = venv - for w in venv:gmatch "([^/]+)" do - final_venv = w - end - venv = final_venv - end - return venv -end - -return M diff --git a/.local/share/lunarvim/lvim/lua/lvim/core/notify.lua b/.local/share/lunarvim/lvim/lua/lvim/core/notify.lua deleted file mode 100644 index 2db4c4d5..00000000 --- a/.local/share/lunarvim/lvim/lua/lvim/core/notify.lua +++ /dev/null @@ -1,68 +0,0 @@ -local M = {} - -local Log = require "lvim.core.log" - -local defaults = { - active = false, - on_config_done = nil, - opts = { - ---@usage Animation style one of { "fade", "slide", "fade_in_slide_out", "static" } - stages = "slide", - - ---@usage Function called when a new window is opened, use for changing win settings/config - on_open = nil, - - ---@usage Function called when a window is closed - on_close = nil, - - ---@usage timeout for notifications in ms, default 5000 - timeout = 5000, - - -- Render function for notifications. See notify-render() - render = "default", - - ---@usage highlight behind the window for stages that change opacity - background_colour = "Normal", - - ---@usage minimum width for notification windows - minimum_width = 50, - - ---@usage Icons for the different levels - icons = { - ERROR = "", - WARN = "", - INFO = "", - DEBUG = "", - TRACE = "✎", - }, - }, -} - -function M.config() - if not lvim.use_icons then - defaults.opts.icons = { - ERROR = "[ERROR]", - WARN = "[WARNING]", - INFO = "[INFo]", - DEBUG = "[DEBUG]", - TRACE = "[TRACE]", - } - end - lvim.builtin.notify = vim.tbl_deep_extend("force", defaults, lvim.builtin.notify or {}) -end - -function M.setup() - if #vim.api.nvim_list_uis() == 0 then - -- no need to configure notifications in headless - return - end - - local opts = lvim.builtin.notify and lvim.builtin.notify.opts or defaults - local notify = require "notify" - - notify.setup(opts) - vim.notify = notify - Log:configure_notifications(notify) -end - -return M diff --git a/.local/share/lunarvim/lvim/lua/lvim/core/nvimtree.lua b/.local/share/lunarvim/lvim/lua/lvim/core/nvimtree.lua deleted file mode 100644 index 214d095c..00000000 --- a/.local/share/lunarvim/lvim/lua/lvim/core/nvimtree.lua +++ /dev/null @@ -1,212 +0,0 @@ -local M = {} -local Log = require "lvim.core.log" - -function M.config() - lvim.builtin.nvimtree = { - active = true, - on_config_done = nil, - setup = { - disable_netrw = true, - hijack_netrw = true, - open_on_setup = false, - open_on_setup_file = false, - sort_by = "name", - ignore_buffer_on_setup = false, - ignore_ft_on_setup = { - "startify", - "dashboard", - "alpha", - }, - auto_reload_on_write = true, - hijack_unnamed_buffer_when_opening = false, - hijack_directories = { - enable = true, - auto_open = true, - }, - open_on_tab = false, - hijack_cursor = false, - update_cwd = false, - diagnostics = { - enable = lvim.use_icons, - show_on_dirs = false, - icons = { - hint = "", - info = "", - warning = "", - error = "", - }, - }, - update_focused_file = { - enable = true, - update_cwd = true, - ignore_list = {}, - }, - system_open = { - cmd = nil, - args = {}, - }, - git = { - enable = true, - ignore = false, - timeout = 200, - }, - view = { - width = 30, - height = 30, - hide_root_folder = false, - side = "left", - preserve_window_proportions = false, - mappings = { - custom_only = false, - list = {}, - }, - number = false, - relativenumber = false, - signcolumn = "yes", - }, - renderer = { - indent_markers = { - enable = false, - icons = { - corner = "└ ", - edge = "│ ", - none = " ", - }, - }, - icons = { - webdev_colors = lvim.use_icons, - show = { - git = lvim.use_icons, - folder = lvim.use_icons, - file = lvim.use_icons, - folder_arrow = lvim.use_icons, - }, - glyphs = { - default = "", - symlink = "", - git = { - unstaged = "", - staged = "S", - unmerged = "", - renamed = "➜", - deleted = "", - untracked = "U", - ignored = "◌", - }, - folder = { - default = "", - open = "", - empty = "", - empty_open = "", - symlink = "", - }, - }, - }, - highlight_git = true, - root_folder_modifier = ":t", - }, - filters = { - dotfiles = false, - custom = { "node_modules", "\\.cache" }, - exclude = {}, - }, - trash = { - cmd = "trash", - require_confirm = true, - }, - log = { - enable = false, - truncate = false, - types = { - all = false, - config = false, - copy_paste = false, - diagnostics = false, - git = false, - profile = false, - }, - }, - actions = { - use_system_clipboard = true, - change_dir = { - enable = true, - global = false, - restrict_above_cwd = false, - }, - open_file = { - quit_on_open = false, - resize_window = false, - window_picker = { - enable = true, - chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890", - exclude = { - filetype = { "notify", "packer", "qf", "diff", "fugitive", "fugitiveblame" }, - buftype = { "nofile", "terminal", "help" }, - }, - }, - }, - }, - }, - } -end - -function M.setup() - local status_ok, nvim_tree = pcall(require, "nvim-tree") - if not status_ok then - Log:error "Failed to load nvim-tree" - return - end - - if lvim.builtin.nvimtree._setup_called then - Log:debug "ignoring repeated setup call for nvim-tree, see kyazdani42/nvim-tree.lua#1308" - return - end - - -- lvim.builtin.which_key.mappings["e"] = { "NvimTreeToggle", "Explorer" } - lvim.builtin.nvimtree._setup_called = true - - -- Implicitly update nvim-tree when project module is active - if lvim.builtin.project.active then - lvim.builtin.nvimtree.setup.respect_buf_cwd = true - lvim.builtin.nvimtree.setup.update_cwd = true - lvim.builtin.nvimtree.setup.update_focused_file = { enable = true, update_cwd = true } - end - - local function telescope_find_files(_) - require("lvim.core.nvimtree").start_telescope "find_files" - end - - local function telescope_live_grep(_) - require("lvim.core.nvimtree").start_telescope "live_grep" - end - - -- Add useful keymaps - if #lvim.builtin.nvimtree.setup.view.mappings.list == 0 then - lvim.builtin.nvimtree.setup.view.mappings.list = { - { key = { "l", "", "o" }, action = "edit", mode = "n" }, - { key = "h", action = "close_node" }, - { key = "v", action = "vsplit" }, - { key = "C", action = "cd" }, - { key = "gtf", action = "telescope_find_files", action_cb = telescope_find_files }, - { key = "gtg", action = "telescope_live_grep", action_cb = telescope_live_grep }, - } - end - - nvim_tree.setup(lvim.builtin.nvimtree.setup) - - if lvim.builtin.nvimtree.on_config_done then - lvim.builtin.nvimtree.on_config_done(nvim_tree) - end -end - -function M.start_telescope(telescope_mode) - local node = require("nvim-tree.lib").get_node_at_cursor() - local abspath = node.link_to or node.absolute_path - local is_folder = node.open ~= nil - local basedir = is_folder and abspath or vim.fn.fnamemodify(abspath, ":h") - require("telescope.builtin")[telescope_mode] { - cwd = basedir, - } -end - -return M diff --git a/.local/share/lunarvim/lvim/lua/lvim/core/project.lua b/.local/share/lunarvim/lvim/lua/lvim/core/project.lua deleted file mode 100644 index 485137b7..00000000 --- a/.local/share/lunarvim/lvim/lua/lvim/core/project.lua +++ /dev/null @@ -1,52 +0,0 @@ -local M = {} - -function M.config() - lvim.builtin.project = { - ---@usage set to false to disable project.nvim. - --- This is on by default since it's currently the expected behavior. - active = true, - - on_config_done = nil, - - ---@usage set to true to disable setting the current-woriking directory - --- Manual mode doesn't automatically change your root directory, so you have - --- the option to manually do so using `:ProjectRoot` command. - manual_mode = false, - - ---@usage Methods of detecting the root directory - --- Allowed values: **"lsp"** uses the native neovim lsp - --- **"pattern"** uses vim-rooter like glob pattern matching. Here - --- order matters: if one is not detected, the other is used as fallback. You - --- can also delete or rearangne the detection methods. - -- detection_methods = { "lsp", "pattern" }, -- NOTE: lsp detection will get annoying with multiple langs in one project - detection_methods = { "pattern" }, - - ---@usage patterns used to detect root dir, when **"pattern"** is in detection_methods - patterns = { ".git", "_darcs", ".hg", ".bzr", ".svn", "Makefile", "package.json" }, - - ---@ Show hidden files in telescope when searching for files in a project - show_hidden = false, - - ---@usage When set to false, you will get a message when project.nvim changes your directory. - -- When set to false, you will get a message when project.nvim changes your directory. - silent_chdir = true, - - ---@usage list of lsp client names to ignore when using **lsp** detection. eg: { "efm", ... } - ignore_lsp = {}, - - ---@type string - ---@usage path to store the project history for use in telescope - datapath = get_cache_dir(), - } -end - -function M.setup() - local project = require "project_nvim" - - project.setup(lvim.builtin.project) - if lvim.builtin.project.on_config_done then - lvim.builtin.project.on_config_done(project) - end -end - -return M diff --git a/.local/share/lunarvim/lvim/lua/lvim/core/telescope.lua b/.local/share/lunarvim/lvim/lua/lvim/core/telescope.lua deleted file mode 100644 index f556913b..00000000 --- a/.local/share/lunarvim/lvim/lua/lvim/core/telescope.lua +++ /dev/null @@ -1,150 +0,0 @@ -local M = {} - -function M.config() - -- Define this minimal config so that it's available if telescope is not yet available. - - lvim.builtin.telescope = { - ---@usage disable telescope completely [not recommended] - active = true, - on_config_done = nil, - } - - local ok, actions = pcall(require, "telescope.actions") - if not ok then - return - end - lvim.builtin.telescope = vim.tbl_extend("force", lvim.builtin.telescope, { - defaults = { - prompt_prefix = " ", - selection_caret = " ", - entry_prefix = " ", - initial_mode = "insert", - selection_strategy = "reset", - sorting_strategy = "descending", - layout_strategy = "horizontal", - layout_config = { - width = 0.75, - preview_cutoff = 120, - horizontal = { - preview_width = function(_, cols, _) - if cols < 120 then - return math.floor(cols * 0.5) - end - return math.floor(cols * 0.6) - end, - mirror = false, - }, - vertical = { mirror = false }, - }, - vimgrep_arguments = { - "rg", - "--color=never", - "--no-heading", - "--with-filename", - "--line-number", - "--column", - "--smart-case", - "--hidden", - "--glob=!.git/", - }, - mappings = { - i = { - [""] = actions.move_selection_next, - [""] = actions.move_selection_previous, - [""] = actions.close, - [""] = actions.cycle_history_next, - [""] = actions.cycle_history_prev, - [""] = actions.smart_send_to_qflist + actions.open_qflist, - [""] = actions.select_default, - }, - n = { - [""] = actions.move_selection_next, - [""] = actions.move_selection_previous, - [""] = actions.smart_send_to_qflist + actions.open_qflist, - }, - }, - file_ignore_patterns = {}, - path_display = { shorten = 5 }, - winblend = 0, - border = {}, - borderchars = { "─", "│", "─", "│", "╭", "╮", "╯", "╰" }, - color_devicons = true, - set_env = { ["COLORTERM"] = "truecolor" }, -- default = nil, - }, - pickers = { - find_files = { - hidden = true, - }, - live_grep = { - --@usage don't include the filename in the search results - only_sort_text = true, - }, - }, - extensions = { - fzf = { - fuzzy = true, -- false will only do exact matching - override_generic_sorter = true, -- override the generic sorter - override_file_sorter = true, -- override the file sorter - case_mode = "smart_case", -- or "ignore_case" or "respect_case" - }, - }, - }) -end - -function M.setup() - local previewers = require "telescope.previewers" - local sorters = require "telescope.sorters" - local actions = require "telescope.actions" - - lvim.builtin.telescope = vim.tbl_extend("keep", { - file_previewer = previewers.vim_buffer_cat.new, - grep_previewer = previewers.vim_buffer_vimgrep.new, - qflist_previewer = previewers.vim_buffer_qflist.new, - file_sorter = sorters.get_fuzzy_file, - generic_sorter = sorters.get_generic_fuzzy_sorter, - ---@usage Mappings are fully customizable. Many familiar mapping patterns are setup as defaults. - mappings = { - i = { - [""] = actions.move_selection_next, - [""] = actions.move_selection_previous, - [""] = actions.close, - [""] = actions.cycle_history_next, - [""] = actions.cycle_history_prev, - [""] = actions.smart_send_to_qflist + actions.open_qflist, - [""] = actions.select_default + actions.center, - }, - n = { - [""] = actions.move_selection_next, - [""] = actions.move_selection_previous, - [""] = actions.smart_send_to_qflist + actions.open_qflist, - }, - }, - }, lvim.builtin.telescope) - - local telescope = require "telescope" - telescope.setup(lvim.builtin.telescope) - - if lvim.builtin.project.active then - pcall(function() - require("telescope").load_extension "projects" - end) - end - - if lvim.builtin.notify.active then - pcall(function() - require("telescope").load_extension "notify" - end) - end - - if lvim.builtin.telescope.on_config_done then - lvim.builtin.telescope.on_config_done(telescope) - end - - if lvim.builtin.telescope.extensions and lvim.builtin.telescope.extensions.fzf then - pcall(function() - require("telescope").load_extension "fzf" - end) - end -end - -return M diff --git a/.local/share/lunarvim/lvim/lua/lvim/core/telescope/custom-finders.lua b/.local/share/lunarvim/lvim/lua/lvim/core/telescope/custom-finders.lua deleted file mode 100644 index b0ee1c07..00000000 --- a/.local/share/lunarvim/lvim/lua/lvim/core/telescope/custom-finders.lua +++ /dev/null @@ -1,97 +0,0 @@ -local M = {} - -local _, builtin = pcall(require, "telescope.builtin") -local _, finders = pcall(require, "telescope.finders") -local _, pickers = pcall(require, "telescope.pickers") -local _, sorters = pcall(require, "telescope.sorters") -local _, themes = pcall(require, "telescope.themes") -local _, actions = pcall(require, "telescope.actions") -local _, previewers = pcall(require, "telescope.previewers") -local _, make_entry = pcall(require, "telescope.make_entry") - -local utils = require "lvim.utils" - -function M.find_lunarvim_files(opts) - opts = opts or {} - local theme_opts = themes.get_ivy { - sorting_strategy = "ascending", - layout_strategy = "bottom_pane", - prompt_prefix = ">> ", - prompt_title = "~ LunarVim files ~", - cwd = get_runtime_dir(), - search_dirs = { utils.join_paths(get_runtime_dir(), "lvim"), lvim.lsp.templates_dir }, - } - opts = vim.tbl_deep_extend("force", theme_opts, opts) - builtin.find_files(opts) -end - -function M.grep_lunarvim_files(opts) - opts = opts or {} - local theme_opts = themes.get_ivy { - sorting_strategy = "ascending", - layout_strategy = "bottom_pane", - prompt_prefix = ">> ", - prompt_title = "~ search LunarVim ~", - cwd = get_runtime_dir(), - search_dirs = { utils.join_paths(get_runtime_dir(), "lvim"), lvim.lsp.templates_dir }, - } - opts = vim.tbl_deep_extend("force", theme_opts, opts) - builtin.live_grep(opts) -end - -local copy_to_clipboard_action = function(prompt_bufnr) - local _, action_state = pcall(require, "telescope.actions.state") - local entry = action_state.get_selected_entry() - local version = entry.value - vim.fn.setreg("+", version) - vim.fn.setreg('"', version) - vim.notify("Copied " .. version .. " to clipboard", vim.log.levels.INFO) - actions.close(prompt_bufnr) -end - -function M.view_lunarvim_changelog() - local opts = themes.get_ivy { - cwd = get_lvim_base_dir(), - } - opts.entry_maker = make_entry.gen_from_git_commits(opts) - - pickers.new(opts, { - prompt_title = "~ LunarVim Changelog ~", - - finder = finders.new_oneshot_job( - vim.tbl_flatten { - "git", - "log", - "--pretty=oneline", - "--abbrev-commit", - }, - opts - ), - previewer = { - previewers.git_commit_diff_as_was.new(opts), - }, - - --TODO: consider opening a diff view when pressing enter - attach_mappings = function(_, map) - map("i", "", copy_to_clipboard_action) - map("n", "", copy_to_clipboard_action) - map("i", "", actions._close) - map("n", "", actions._close) - map("n", "q", actions._close) - return true - end, - sorter = sorters.generic_sorter, - }):find() -end - --- Smartly opens either git_files or find_files, depending on whether the working directory is --- contained in a Git repo. -function M.find_project_files() - local ok = pcall(builtin.git_files) - - if not ok then - builtin.find_files() - end -end - -return M diff --git a/.local/share/lunarvim/lvim/lua/lvim/core/terminal.lua b/.local/share/lunarvim/lvim/lua/lvim/core/terminal.lua deleted file mode 100644 index 6c190dd5..00000000 --- a/.local/share/lunarvim/lvim/lua/lvim/core/terminal.lua +++ /dev/null @@ -1,127 +0,0 @@ -local M = {} -local Log = require "lvim.core.log" - -M.config = function() - lvim.builtin["terminal"] = { - on_config_done = nil, - -- size can be a number or function which is passed the current terminal - size = 20, - -- open_mapping = [[]], - open_mapping = [[]], - hide_numbers = true, -- hide the number column in toggleterm buffers - shade_filetypes = {}, - shade_terminals = true, - shading_factor = 2, -- the degree by which to darken to terminal colour, default: 1 for dark backgrounds, 3 for light - start_in_insert = true, - insert_mappings = true, -- whether or not the open mapping applies in insert mode - persist_size = false, - -- direction = 'vertical' | 'horizontal' | 'window' | 'float', - direction = "float", - close_on_exit = true, -- close the terminal window when the process exits - shell = vim.o.shell, -- change the default shell - -- This field is only relevant if direction is set to 'float' - float_opts = { - -- The border key is *almost* the same as 'nvim_win_open' - -- see :h nvim_win_open for details on borders however - -- the 'curved' border is a custom border type - -- not natively supported but implemented in this plugin. - -- border = 'single' | 'double' | 'shadow' | 'curved' | ... other options supported by win open - border = "curved", - -- width = , - -- height = , - winblend = 0, - highlights = { - border = "Normal", - background = "Normal", - }, - }, - -- Add executables on the config.lua - -- { exec, keymap, name} - -- lvim.builtin.terminal.execs = {{}} to overwrite - -- lvim.builtin.terminal.execs[#lvim.builtin.terminal.execs+1] = {"gdb", "tg", "GNU Debugger"} - execs = { - { "lazygit", "gg", "LazyGit", "float" }, - { "lazygit", "", "LazyGit", "float" }, - }, - } -end - -M.setup = function() - local terminal = require "toggleterm" - terminal.setup(lvim.builtin.terminal) - - for i, exec in pairs(lvim.builtin.terminal.execs) do - local opts = { - cmd = exec[1], - keymap = exec[2], - label = exec[3], - -- NOTE: unable to consistently bind id/count <= 9, see #2146 - count = i + 100, - direction = exec[4] or lvim.builtin.terminal.direction, - size = lvim.builtin.terminal.size, - } - - M.add_exec(opts) - end - - if lvim.builtin.terminal.on_config_done then - lvim.builtin.terminal.on_config_done(terminal) - end -end - -M.add_exec = function(opts) - local binary = opts.cmd:match "(%S+)" - if vim.fn.executable(binary) ~= 1 then - Log:debug("Skipping configuring executable " .. binary .. ". Please make sure it is installed properly.") - return - end - - local exec_func = string.format( - "lua require('lvim.core.terminal')._exec_toggle({ cmd = '%s', count = %d, direction = '%s'})", - opts.cmd, - opts.count, - opts.direction - ) - - require("lvim.keymappings").load { - normal_mode = { [opts.keymap] = exec_func }, - term_mode = { [opts.keymap] = exec_func }, - } - - local wk_status_ok, wk = pcall(require, "which-key") - if not wk_status_ok then - return - end - wk.register({ [opts.keymap] = { opts.label } }, { mode = "n" }) -end - -M._exec_toggle = function(opts) - local Terminal = require("toggleterm.terminal").Terminal - local term = Terminal:new { cmd = opts.cmd, count = opts.count, direction = opts.direction } - term:toggle(lvim.builtin.terminal.size, opts.direction) -end - ----Toggles a log viewer according to log.viewer.layout_config ----@param logfile string the fullpath to the logfile -M.toggle_log_view = function(logfile) - local log_viewer = lvim.log.viewer.cmd - if vim.fn.executable(log_viewer) ~= 1 then - log_viewer = "less +F" - end - Log:debug("attempting to open: " .. logfile) - log_viewer = log_viewer .. " " .. logfile - local term_opts = vim.tbl_deep_extend("force", lvim.builtin.terminal, { - cmd = log_viewer, - open_mapping = lvim.log.viewer.layout_config.open_mapping, - direction = lvim.log.viewer.layout_config.direction, - -- TODO: this might not be working as expected - size = lvim.log.viewer.layout_config.size, - float_opts = lvim.log.viewer.layout_config.float_opts, - }) - - local Terminal = require("toggleterm.terminal").Terminal - local log_view = Terminal:new(term_opts) - log_view:toggle() -end - -return M diff --git a/.local/share/lunarvim/lvim/lua/lvim/core/treesitter.lua b/.local/share/lunarvim/lvim/lua/lvim/core/treesitter.lua deleted file mode 100644 index fcada24f..00000000 --- a/.local/share/lunarvim/lvim/lua/lvim/core/treesitter.lua +++ /dev/null @@ -1,97 +0,0 @@ -local M = {} -local Log = require "lvim.core.log" - -M.config = function() - lvim.builtin.treesitter = { - on_config_done = nil, - ensure_installed = {}, -- one of "all", "maintained" (parsers with maintainers), or a list of languages - ignore_install = {}, - matchup = { - enable = false, -- mandatory, false will disable the whole extension - -- disable = { "c", "ruby" }, -- optional, list of language that will be disabled - }, - highlight = { - enable = true, -- false will disable the whole extension - additional_vim_regex_highlighting = false, - disable = { "latex" }, - }, - context_commentstring = { - enable = true, - enable_autocmd = false, - config = { - -- Languages that have a single comment style - typescript = "// %s", - css = "/* %s */", - scss = "/* %s */", - html = "", - svelte = "", - vue = "", - json = "", - }, - }, - indent = { enable = true, disable = { "yaml", "python" } }, - autotag = { enable = false }, - textobjects = { - swap = { - enable = false, - -- swap_next = textobj_swap_keymaps, - }, - -- move = textobj_move_keymaps, - select = { - enable = false, - -- keymaps = textobj_sel_keymaps, - }, - }, - textsubjects = { - enable = false, - keymaps = { ["."] = "textsubjects-smart", [";"] = "textsubjects-big" }, - }, - playground = { - enable = false, - disable = {}, - updatetime = 25, -- Debounced time for highlighting nodes in the playground from source code - persist_queries = false, -- Whether the query persists across vim sessions - keybindings = { - toggle_query_editor = "o", - toggle_hl_groups = "i", - toggle_injected_languages = "t", - toggle_anonymous_nodes = "a", - toggle_language_display = "I", - focus_language = "f", - unfocus_language = "F", - update = "R", - goto_node = "", - show_help = "?", - }, - }, - rainbow = { - enable = false, - extended_mode = true, -- Highlight also non-parentheses delimiters, boolean or table: lang -> boolean - max_file_lines = 1000, -- Do not enable for files with more than 1000 lines, int - }, - } -end - -M.setup = function() - -- avoid running in headless mode since it's harder to detect failures - if #vim.api.nvim_list_uis() == 0 then - Log:debug "headless mode detected, skipping running setup for treesitter" - return - end - - local status_ok, treesitter_configs = pcall(require, "nvim-treesitter.configs") - if not status_ok then - Log:error "Failed to load nvim-treesitter.configs" - return - end - - local opts = vim.deepcopy(lvim.builtin.treesitter) - - treesitter_configs.setup(opts) - - if lvim.builtin.treesitter.on_config_done then - lvim.builtin.treesitter.on_config_done(treesitter_configs) - end -end - -return M diff --git a/.local/share/lunarvim/lvim/lua/lvim/core/which-key.lua b/.local/share/lunarvim/lvim/lua/lvim/core/which-key.lua deleted file mode 100644 index 3015781b..00000000 --- a/.local/share/lunarvim/lvim/lua/lvim/core/which-key.lua +++ /dev/null @@ -1,286 +0,0 @@ -local M = {} - -M.config = function() - lvim.builtin.which_key = { - ---@usage disable which-key completely [not recommended] - active = true, - on_config_done = nil, - setup = { - plugins = { - marks = true, -- shows a list of your marks on ' and ` - registers = true, -- shows your registers on " in NORMAL or in INSERT mode - -- the presets plugin, adds help for a bunch of default keybindings in Neovim - -- No actual key bindings are created - presets = { - operators = false, -- adds help for operators like d, y, ... - motions = false, -- adds help for motions - text_objects = false, -- help for text objects triggered after entering an operator - windows = false, -- default bindings on - nav = true, -- misc bindings to work with windows - z = true, -- bindings for folds, spelling and others prefixed with z - g = true, -- bindings for prefixed with g - }, - spelling = { enabled = true, suggestions = 20 }, -- use which-key for spelling hints - }, - icons = { - breadcrumb = "»", -- symbol used in the command line area that shows your active key combo - separator = "➜", -- symbol used between a key and it's label - group = "+", -- symbol prepended to a group - }, - popup_mappings = { - scroll_down = "", -- binding to scroll down inside the popup - scroll_up = "", -- binding to scroll up inside the popup - }, - window = { - border = "single", -- none, single, double, shadow - position = "bottom", -- bottom, top - margin = { 1, 0, 1, 0 }, -- extra window margin [top, right, bottom, left] - padding = { 2, 2, 2, 2 }, -- extra window padding [top, right, bottom, left] - winblend = 0, - }, - layout = { - height = { min = 4, max = 25 }, -- min and max height of the columns - width = { min = 20, max = 50 }, -- min and max width of the columns - spacing = 3, -- spacing between columns - align = "left", -- align columns left, center or right - }, - hidden = { "", "", "", "", "call", "lua", "^:", "^ " }, -- hide mapping boilerplate - ignore_missing = false, -- enable this to hide mappings for which you didn't specify a label - show_help = true, -- show help message on the command line when the popup is visible - triggers = "auto", -- automatically setup triggers - -- triggers = {""} -- or specify a list manually - triggers_blacklist = { - -- list of mode / prefixes that should never be hooked by WhichKey - -- this is mostly relevant for key maps that start with a native binding - -- most people should not need to change this - i = { "j", "k" }, - v = { "j", "k" }, - }, - }, - - opts = { - mode = "n", -- NORMAL mode - prefix = "", - buffer = nil, -- Global mappings. Specify a buffer number for buffer local mappings - silent = true, -- use `silent` when creating keymaps - noremap = true, -- use `noremap` when creating keymaps - nowait = true, -- use `nowait` when creating keymaps - }, - vopts = { - mode = "v", -- VISUAL mode - prefix = "", - buffer = nil, -- Global mappings. Specify a buffer number for buffer local mappings - silent = true, -- use `silent` when creating keymaps - noremap = true, -- use `noremap` when creating keymaps - nowait = true, -- use `nowait` when creating keymaps - }, - -- NOTE: Prefer using : over as the latter avoids going back in normal-mode. - -- see https://neovim.io/doc/user/map.html#:map-cmd - vmappings = { - ["/"] = { "lua require('Comment.api').toggle_linewise_op(vim.fn.visualmode())", "Comment" }, - }, - mappings = { - [";"] = { "Alpha", "Dashboard" }, - ["w"] = { "w!", "Save" }, - ["q"] = { "lua require('lvim.utils.functions').smart_quit()", "Quit" }, - ["/"] = { "lua require('Comment.api').toggle_current_linewise()", "Comment" }, - ["c"] = { "BufferKill", "Close Buffer" }, - ["f"] = { require("lvim.core.telescope.custom-finders").find_project_files, "Find File" }, - ["h"] = { "nohlsearch", "No Highlight" }, - b = { - name = "Buffers", - j = { "BufferLinePick", "Jump" }, - f = { "Telescope buffers", "Find" }, - b = { "BufferLineCyclePrev", "Previous" }, - -- w = { "BufferWipeout", "Wipeout" }, -- TODO: implement this for bufferline - e = { - "BufferLinePickClose", - "Pick which buffer to close", - }, - h = { "BufferLineCloseLeft", "Close all to the left" }, - l = { - "BufferLineCloseRight", - "Close all to the right", - }, - D = { - "BufferLineSortByDirectory", - "Sort by directory", - }, - L = { - "BufferLineSortByExtension", - "Sort by language", - }, - }, - p = { - name = "Packer", - c = { "PackerCompile", "Compile" }, - i = { "PackerInstall", "Install" }, - r = { "lua require('lvim.plugin-loader').recompile()", "Re-compile" }, - s = { "PackerSync", "Sync" }, - S = { "PackerStatus", "Status" }, - u = { "PackerUpdate", "Update" }, - }, - - -- " Available Debug Adapters: - -- " https://microsoft.github.io/debug-adapter-protocol/implementors/adapters/ - -- " Adapter configuration and installation instructions: - -- " https://github.com/mfussenegger/nvim-dap/wiki/Debug-Adapter-installation - -- " Debug Adapter protocol: - -- " https://microsoft.github.io/debug-adapter-protocol/ - -- " Debugging - g = { - name = "Git", - j = { "lua require 'gitsigns'.next_hunk()", "Next Hunk" }, - k = { "lua require 'gitsigns'.prev_hunk()", "Prev Hunk" }, - l = { "lua require 'gitsigns'.blame_line()", "Blame" }, - p = { "lua require 'gitsigns'.preview_hunk()", "Preview Hunk" }, - r = { "lua require 'gitsigns'.reset_hunk()", "Reset Hunk" }, - R = { "lua require 'gitsigns'.reset_buffer()", "Reset Buffer" }, - s = { "lua require 'gitsigns'.stage_hunk()", "Stage Hunk" }, - u = { - "lua require 'gitsigns'.undo_stage_hunk()", - "Undo Stage Hunk", - }, - o = { "Telescope git_status", "Open changed file" }, - b = { "Telescope git_branches", "Checkout branch" }, - c = { "Telescope git_commits", "Checkout commit" }, - C = { - "Telescope git_bcommits", - "Checkout commit(for current file)", - }, - d = { - "Gitsigns diffthis HEAD", - "Git Diff", - }, - }, - l = { - name = "LSP", - a = { "lua vim.lsp.buf.code_action()", "Code Action" }, - d = { "Telescope diagnostics bufnr=0 theme=get_ivy", "Buffer Diagnostics" }, - w = { "Telescope diagnostics", "Diagnostics" }, - f = { require("lvim.lsp.utils").format, "Format" }, - i = { "LspInfo", "Info" }, - I = { "LspInstallInfo", "Installer Info" }, - j = { - vim.diagnostic.goto_next, - "Next Diagnostic", - }, - k = { - vim.diagnostic.goto_prev, - "Prev Diagnostic", - }, - l = { vim.lsp.codelens.run, "CodeLens Action" }, - p = { - name = "Peek", - d = { "lua require('lvim.lsp.peek').Peek('definition')", "Definition" }, - t = { "lua require('lvim.lsp.peek').Peek('typeDefinition')", "Type Definition" }, - i = { "lua require('lvim.lsp.peek').Peek('implementation')", "Implementation" }, - }, - q = { vim.diagnostic.setloclist, "Quickfix" }, - r = { vim.lsp.buf.rename, "Rename" }, - s = { "Telescope lsp_document_symbols", "Document Symbols" }, - S = { - "Telescope lsp_dynamic_workspace_symbols", - "Workspace Symbols", - }, - e = { "Telescope quickfix", "Telescope Quickfix" }, - }, - L = { - name = "+LunarVim", - c = { - "edit " .. get_config_dir() .. "/config.lua", - "Edit config.lua", - }, - f = { - "lua require('lvim.core.telescope.custom-finders').find_lunarvim_files()", - "Find LunarVim files", - }, - g = { - "lua require('lvim.core.telescope.custom-finders').grep_lunarvim_files()", - "Grep LunarVim files", - }, - k = { "Telescope keymaps", "View LunarVim's keymappings" }, - i = { - "lua require('lvim.core.info').toggle_popup(vim.bo.filetype)", - "Toggle LunarVim Info", - }, - I = { - "lua require('lvim.core.telescope.custom-finders').view_lunarvim_changelog()", - "View LunarVim's changelog", - }, - l = { - name = "+logs", - d = { - "lua require('lvim.core.terminal').toggle_log_view(require('lvim.core.log').get_path())", - "view default log", - }, - D = { - "lua vim.fn.execute('edit ' .. require('lvim.core.log').get_path())", - "Open the default logfile", - }, - l = { - "lua require('lvim.core.terminal').toggle_log_view(vim.lsp.get_log_path())", - "view lsp log", - }, - L = { "lua vim.fn.execute('edit ' .. vim.lsp.get_log_path())", "Open the LSP logfile" }, - n = { - "lua require('lvim.core.terminal').toggle_log_view(os.getenv('NVIM_LOG_FILE'))", - "view neovim log", - }, - N = { "edit $NVIM_LOG_FILE", "Open the Neovim logfile" }, - p = { - "lua require('lvim.core.terminal').toggle_log_view(get_cache_dir() .. '/packer.nvim.log')", - "view packer log", - }, - P = { "edit $LUNARVIM_CACHE_DIR/packer.nvim.log", "Open the Packer logfile" }, - }, - n = { "Telescope notify", "View Notifications" }, - r = { "LvimReload", "Reload LunarVim's configuration" }, - u = { "LvimUpdate", "Update LunarVim" }, - }, - s = { - name = "Search", - b = { "Telescope git_branches", "Checkout branch" }, - c = { "Telescope colorscheme", "Colorscheme" }, - f = { "Telescope find_files", "Find File" }, - h = { "Telescope help_tags", "Find Help" }, - H = { "Telescope highlights", "Find highlight groups" }, - M = { "Telescope man_pages", "Man Pages" }, - r = { "Telescope oldfiles", "Open Recent File" }, - R = { "Telescope registers", "Registers" }, - t = { "Telescope live_grep", "Text" }, - k = { "Telescope keymaps", "Keymaps" }, - C = { "Telescope commands", "Commands" }, - p = { - "lua require('telescope.builtin.internal').colorscheme({enable_preview = true})", - "Colorscheme with Preview", - }, - }, - T = { - name = "Treesitter", - i = { ":TSConfigInfo", "Info" }, - }, - }, - } -end - -M.setup = function() - local which_key = require "which-key" - - which_key.setup(lvim.builtin.which_key.setup) - - local opts = lvim.builtin.which_key.opts - local vopts = lvim.builtin.which_key.vopts - - local mappings = lvim.builtin.which_key.mappings - local vmappings = lvim.builtin.which_key.vmappings - - which_key.register(mappings, opts) - which_key.register(vmappings, vopts) - - if lvim.builtin.which_key.on_config_done then - lvim.builtin.which_key.on_config_done(which_key) - end -end - -return M diff --git a/.local/share/lunarvim/lvim/lua/lvim/impatient.lua b/.local/share/lunarvim/lvim/lua/lvim/impatient.lua deleted file mode 100644 index fe26b940..00000000 --- a/.local/share/lunarvim/lvim/lua/lvim/impatient.lua +++ /dev/null @@ -1,364 +0,0 @@ --- modified version from https://github.com/lewis6991/impatient.nvim - -local vim = vim -local api = vim.api -local uv = vim.loop -local _loadfile = loadfile -local get_runtime = api.nvim__get_runtime -local fs_stat = uv.fs_stat -local mpack = vim.mpack - -local appdir = os.getenv "APPDIR" - -local M = { - chunks = { - cache = {}, - profile = nil, - dirty = false, - path = vim.fn.stdpath "cache" .. "/luacache_chunks", - }, - modpaths = { - cache = {}, - profile = nil, - dirty = false, - path = vim.fn.stdpath "cache" .. "/luacache_modpaths", - }, - log = {}, -} - -_G.__luacache = M - -if not get_runtime then - -- nvim 0.5 compat - get_runtime = function(paths, all, _) - local r = {} - for _, path in ipairs(paths) do - local found = api.nvim_get_runtime_file(path, all) - for i = 1, #found do - r[#r + 1] = found[i] - end - end - return r - end -end - -local function log(...) - M.log[#M.log + 1] = table.concat({ string.format(...) }, " ") -end - -function M.print_log() - for _, l in ipairs(M.log) do - print(l) - end -end - -function M.enable_profile() - local P = require "lvim.impatient.profile" - - M.chunks.profile = {} - M.modpaths.profile = {} - - P.setup(M.modpaths.profile) - - M.print_profile = function() - P.print_profile(M) - end - - vim.cmd [[command! LuaCacheProfile lua _G.__luacache.print_profile()]] -end - -local function hash(modpath) - local stat = fs_stat(modpath) - if stat then - return stat.mtime.sec .. stat.mtime.nsec .. stat.size - end - error("Could not hash " .. modpath) -end - -local function modpath_mangle(modpath) - if appdir then - modpath = modpath:gsub(appdir, "/$APPDIR") - end - return modpath -end - -local function modpath_unmangle(modpath) - if appdir then - modpath = modpath:gsub("/$APPDIR", appdir) - end - return modpath -end - -local function profile(m, entry, name, loader) - if m.profile then - local mp = m.profile - mp[entry] = mp[entry] or {} - if not mp[entry].loader and loader then - mp[entry].loader = loader - end - if not mp[entry][name] then - mp[entry][name] = uv.hrtime() - end - end -end - -local function mprofile(mod, name, loader) - profile(M.modpaths, mod, name, loader) -end - -local function cprofile(path, name, loader) - profile(M.chunks, path, name, loader) -end - -local function get_runtime_file(basename, paths) - -- Look in the cache to see if we have already loaded a parent module. - -- If we have then try looking in the parents directory first. - local parents = vim.split(basename, "/") - for i = #parents, 1, -1 do - local parent = table.concat(vim.list_slice(parents, 1, i), "/") - local ppath = M.modpaths.cache[parent] - if ppath then - if ppath:sub(-9) == "/init.lua" then - ppath = ppath:sub(1, -10) -- a/b/init.lua -> a/b - else - ppath = ppath:sub(1, -5) -- a/b.lua -> a/b - end - - for _, path in ipairs(paths) do - -- path should be of form 'a/b/c.lua' or 'a/b/c/init.lua' - local modpath = ppath .. "/" .. path:sub(#("lua/" .. parent) + 2) - if fs_stat(modpath) then - return modpath, "cache(p)" - end - end - end - end - - -- What Neovim does by default; slowest - local modpath = get_runtime(paths, false, { is_lua = true })[1] - return modpath, "standard" -end - -local function get_runtime_file_cached(basename, paths) - local mp = M.modpaths - if mp.cache[basename] then - local modpath = mp.cache[basename] - if fs_stat(modpath) then - mprofile(basename, "resolve_end", "cache") - return modpath - end - mp.cache[basename] = nil - mp.dirty = true - end - - local modpath, loader = get_runtime_file(basename, paths) - if modpath then - mprofile(basename, "resolve_end", loader) - log("Creating cache for module %s", basename) - mp.cache[basename] = modpath_mangle(modpath) - mp.dirty = true - end - return modpath -end - -local function extract_basename(pats) - local basename - - -- Deconstruct basename from pats - for _, pat in ipairs(pats) do - for i, npat in ipairs { - -- Ordered by most specific - "lua/(.*)/init%.lua", - "lua/(.*)%.lua", - } do - local m = pat:match(npat) - if i == 2 and m and m:sub(-4) == "init" then - m = m:sub(0, -6) - end - if not basename then - if m then - basename = m - end - elseif m and m ~= basename then - -- matches are inconsistent - return - end - end - end - - return basename -end - -local function get_runtime_cached(pats, all, opts) - local fallback = false - if all or not opts or not opts.is_lua then - -- Fallback - fallback = true - end - - local basename - - if not fallback then - basename = extract_basename(pats) - end - - if fallback or not basename then - return get_runtime(pats, all, opts) - end - - return { get_runtime_file_cached(basename, pats) } -end - --- Copied from neovim/src/nvim/lua/vim.lua with two lines changed -local function load_package(name) - local basename = name:gsub("%.", "/") - local paths = { "lua/" .. basename .. ".lua", "lua/" .. basename .. "/init.lua" } - - -- Original line: - -- local found = vim.api.nvim__get_runtime(paths, false, {is_lua=true}) - local found = { get_runtime_file_cached(basename, paths) } - if #found > 0 then - local f, err = loadfile(found[1]) - return f or error(err) - end - - local so_paths = {} - for _, trail in ipairs(vim._so_trails) do - local path = "lua" .. trail:gsub("?", basename) -- so_trails contains a leading slash - table.insert(so_paths, path) - end - - -- Original line: - -- found = vim.api.nvim__get_runtime(so_paths, false, {is_lua=true}) - found = { get_runtime_file_cached(basename, so_paths) } - if #found > 0 then - -- Making function name in Lua 5.1 (see src/loadlib.c:mkfuncname) is - -- a) strip prefix up to and including the first dash, if any - -- b) replace all dots by underscores - -- c) prepend "luaopen_" - -- So "foo-bar.baz" should result in "luaopen_bar_baz" - local dash = name:find("-", 1, true) - local modname = dash and name:sub(dash + 1) or name - local f, err = package.loadlib(found[1], "luaopen_" .. modname:gsub("%.", "_")) - return f or error(err) - end - return nil -end - -local function load_from_cache(path) - local mc = M.chunks - - if not mc.cache[path] then - return nil, string.format("No cache for path %s", path) - end - - local mhash, codes = unpack(mc.cache[path]) - - if mhash ~= hash(modpath_unmangle(path)) then - mc.cache[path] = nil - mc.dirty = true - return nil, string.format("Stale cache for path %s", path) - end - - local chunk = loadstring(codes) - - if not chunk then - mc.cache[path] = nil - mc.dirty = true - return nil, string.format("Cache error for path %s", path) - end - - return chunk -end - -local function loadfile_cached(path) - cprofile(path, "load_start") - - local chunk, err = load_from_cache(path) - if chunk and not err then - log("Loaded cache for path %s", path) - cprofile(path, "load_end", "cache") - return chunk - end - log(err) - - chunk, err = _loadfile(path) - - if not err then - log("Creating cache for path %s", path) - M.chunks.cache[modpath_mangle(path)] = { hash(path), string.dump(chunk) } - M.chunks.dirty = true - end - - cprofile(path, "load_end", "standard") - return chunk, err -end - -function M.save_cache() - local function _save_cache(t) - if t.dirty then - log("Updating chunk cache file: %s", t.path) - local f = io.open(t.path, "w+b") - f:write(mpack.encode(t.cache)) - f:flush() - t.dirty = false - end - end - _save_cache(M.chunks) - _save_cache(M.modpaths) -end - -function M.clear_cache() - local function _clear_cache(t) - t.cache = {} - os.remove(t.path) - end - _clear_cache(M.chunks) - _clear_cache(M.modpaths) -end - -local function init_cache() - local function _init_cache(t) - if fs_stat(t.path) then - log("Loading cache file %s", t.path) - local f = io.open(t.path, "rb") - local ok - ok, t.cache = pcall(function() - return mpack.decode(f:read "*a") - end) - - if not ok then - log("Corrupted cache file, %s. Invalidating...", t.path) - os.remove(t.path) - t.cache = {} - end - t.dirty = not ok - end - end - - _init_cache(M.chunks) - _init_cache(M.modpaths) -end - -local function setup() - init_cache() - - -- Override default functions - vim._load_package = load_package - vim.api.nvim__get_runtime = get_runtime_cached - -- luacheck: ignore 121 - loadfile = loadfile_cached - - vim.cmd [[ - augroup impatient - autocmd VimEnter,VimLeave * lua _G.__luacache.save_cache() - augroup END - - command! LuaCacheClear lua _G.__luacache.clear_cache() - command! LuaCacheLog lua _G.__luacache.print_log() - ]] -end - -setup() - -return M diff --git a/.local/share/lunarvim/lvim/lua/lvim/impatient/profile.lua b/.local/share/lunarvim/lvim/lua/lvim/impatient/profile.lua deleted file mode 100644 index 0ab04d65..00000000 --- a/.local/share/lunarvim/lvim/lua/lvim/impatient/profile.lua +++ /dev/null @@ -1,242 +0,0 @@ -local M = {} - -local api, uv = vim.api, vim.loop - -local std_data = vim.fn.stdpath "data" -local std_config = vim.fn.stdpath "config" -local vimruntime = os.getenv "VIMRUNTIME" -local lvim_runtime = get_runtime_dir() -local lvim_config = get_config_dir() - -local function load_buffer(title, lines) - local bufnr = api.nvim_create_buf(false, false) - api.nvim_buf_set_lines(bufnr, 0, 0, false, lines) - api.nvim_buf_set_option(bufnr, "bufhidden", "wipe") - api.nvim_buf_set_option(bufnr, "buftype", "nofile") - api.nvim_buf_set_option(bufnr, "swapfile", false) - api.nvim_buf_set_option(bufnr, "modifiable", false) - api.nvim_buf_set_name(bufnr, title) - api.nvim_set_current_buf(bufnr) -end - -local function mod_path(path) - if not path then - return "?" - end - path = path:gsub(std_data .. "/site/pack/packer/", "/") - path = path:gsub(std_data .. "/", "/") - path = path:gsub(std_config .. "/", "/") - path = path:gsub(vimruntime .. "/", "/") - path = path:gsub(lvim_runtime .. "/", "/") - path = path:gsub(lvim_config .. "/", "/") - return path -end - -local function time_tostr(x) - if x == 0 then - return "?" - end - return string.format("%8.3fms", x) -end - -local function mem_tostr(x) - local unit = "" - for _, u in ipairs { "K", "M", "G" } do - if x < 1000 then - break - end - x = x / 1000 - unit = u - end - return string.format("%1.1f%s", x, unit) -end - -function M.print_profile(I) - local mod_profile = I.modpaths.profile - local chunk_profile = I.chunks.profile - - if not mod_profile and not chunk_profile then - print "Error: profiling was not enabled" - return - end - - local total_resolve = 0 - local total_load = 0 - local modules = {} - - for path, m in pairs(chunk_profile) do - m.load = m.load_end - m.load_start - m.load = m.load / 1000000 - m.path = mod_path(path) - end - - local module_content_width = 0 - - for module, m in pairs(mod_profile) do - m.resolve = 0 - if m.resolve_end then - m.resolve = m.resolve_end - m.resolve_start - m.resolve = m.resolve / 1000000 - end - - m.module = module:gsub("/", ".") - m.loader = m.loader or m.loader_guess - - local path = I.modpaths.cache[module] - local path_prof = chunk_profile[path] - m.path = mod_path(path) - - if path_prof then - chunk_profile[path] = nil - m.load = path_prof.load - m.ploader = path_prof.loader - else - m.load = 0 - m.ploader = "NA" - end - - total_resolve = total_resolve + m.resolve - total_load = total_load + m.load - - if #module > module_content_width then - module_content_width = #module - end - - modules[#modules + 1] = m - end - - table.sort(modules, function(a, b) - return (a.resolve + a.load) > (b.resolve + b.load) - end) - - local paths = {} - - local total_paths_load = 0 - for _, m in pairs(chunk_profile) do - paths[#paths + 1] = m - total_paths_load = total_paths_load + m.load - end - - table.sort(paths, function(a, b) - return a.load > b.load - end) - - local lines = {} - local function add(fmt, ...) - local args = { ... } - for i, a in ipairs(args) do - if type(a) == "number" then - args[i] = time_tostr(a) - end - end - - lines[#lines + 1] = string.format(fmt, unpack(args)) - end - - local time_cell_width = 12 - local loader_cell_width = 11 - local time_content_width = time_cell_width - 2 - local loader_content_width = loader_cell_width - 2 - local module_cell_width = module_content_width + 2 - - local tcwl = string.rep("─", time_cell_width) - local lcwl = string.rep("─", loader_cell_width) - local mcwl = string.rep("─", module_cell_width + 2) - - local n = string.rep("─", 200) - - local module_cell_format = "%-" .. module_cell_width .. "s" - local loader_format = "%-" .. loader_content_width .. "s" - local line_format = "%s │ %s │ %s │ %s │ %s │ %s" - - local row_fmt = line_format:format( - " %" .. time_content_width .. "s", - loader_format, - "%" .. time_content_width .. "s", - loader_format, - module_cell_format, - "%s" - ) - - local title_fmt = line_format:format( - " %-" .. time_content_width .. "s", - loader_format, - "%-" .. time_content_width .. "s", - loader_format, - module_cell_format, - "%s" - ) - - local title1_width = time_cell_width + loader_cell_width - 1 - local title1_fmt = ("%s │ %s │"):format(" %-" .. title1_width .. "s", "%-" .. title1_width .. "s") - - add "Note: this report is not a measure of startup time. Only use this for comparing" - add "between cached and uncached loads of Lua modules" - add "" - - add "Cache files:" - for _, f in ipairs { I.chunks.path, I.modpaths.path } do - local size = vim.loop.fs_stat(f).size - add(" %s %s", f, mem_tostr(size)) - end - add "" - - add("%s─%s┬%s─%s┐", tcwl, lcwl, tcwl, lcwl) - add(title1_fmt, "Resolve", "Load") - add("%s┬%s┼%s┬%s┼%s┬%s", tcwl, lcwl, tcwl, lcwl, mcwl, n) - add(title_fmt, "Time", "Method", "Time", "Method", "Module", "Path") - add("%s┼%s┼%s┼%s┼%s┼%s", tcwl, lcwl, tcwl, lcwl, mcwl, n) - add(row_fmt, total_resolve, "", total_load, "", "Total", "") - add("%s┼%s┼%s┼%s┼%s┼%s", tcwl, lcwl, tcwl, lcwl, mcwl, n) - for _, p in ipairs(modules) do - add(row_fmt, p.resolve, p.loader, p.load, p.ploader, p.module, p.path) - end - add("%s┴%s┴%s┴%s┴%s┴%s", tcwl, lcwl, tcwl, lcwl, mcwl, n) - - if #paths > 0 then - add "" - add(n) - local f3 = " %" .. time_content_width .. "s │ %" .. loader_content_width .. "s │ %s" - add "Files loaded with no associated module" - add("%s┬%s┬%s", tcwl, lcwl, n) - add(f3, "Time", "Loader", "Path") - add("%s┼%s┼%s", tcwl, lcwl, n) - add(f3, total_paths_load, "", "Total") - add("%s┼%s┼%s", tcwl, lcwl, n) - for _, p in ipairs(paths) do - add(f3, p.load, p.loader, p.path) - end - add("%s┴%s┴%s", tcwl, lcwl, n) - add "" - end - - load_buffer("Impatient Profile Report", lines) -end - -M.setup = function(profile) - local _require = require - - -- luacheck: ignore 121 - require = function(mod) - local basename = mod:gsub("%.", "/") - if not profile[basename] then - profile[basename] = {} - profile[basename].resolve_start = uv.hrtime() - profile[basename].loader_guess = "C" - end - return _require(mod) - end - - -- Add profiling around all the loaders - local pl = package.loaders - for i = 1, #pl do - local l = pl[i] - pl[i] = function(mod) - local basename = mod:gsub("%.", "/") - profile[basename].loader_guess = i == 1 and "preloader" or "loader #" .. i - return l(mod) - end - end -end - -return M diff --git a/.local/share/lunarvim/lvim/lua/lvim/interface/popup.lua b/.local/share/lunarvim/lvim/lua/lvim/interface/popup.lua deleted file mode 100644 index b767f609..00000000 --- a/.local/share/lunarvim/lvim/lua/lvim/interface/popup.lua +++ /dev/null @@ -1,64 +0,0 @@ -local Popup = {} - ---- Create a new floating window --- @param config The configuration passed to vim.api.nvim_open_win --- @param win_opts The options registered with vim.api.nvim_win_set_option --- @param buf_opts The options registered with vim.api.nvim_buf_set_option --- @return A new popup -function Popup:new(opts) - opts = opts or {} - opts.layout = opts.layout or {} - opts.win_opts = opts.win_opts or {} - opts.buf_opts = opts.buf_opts or {} - - Popup.__index = Popup - - local editor_layout = { - height = vim.o.lines - vim.o.cmdheight - 2, -- Add margin for status and buffer line - width = vim.o.columns, - } - local popup_layout = { - relative = "editor", - height = math.floor(editor_layout.height * 0.9), - width = math.floor(editor_layout.width * 0.8), - style = "minimal", - border = "rounded", - } - popup_layout.row = math.floor((editor_layout.height - popup_layout.height) / 2) - popup_layout.col = math.floor((editor_layout.width - popup_layout.width) / 2) - - local obj = { - buffer = vim.api.nvim_create_buf(false, true), - layout = vim.tbl_deep_extend("force", popup_layout, opts.layout), - win_opts = opts.win_opts, - buf_opts = opts.buf_opts, - } - - setmetatable(obj, Popup) - - return obj -end - ---- Display the popup with the provided content --- @param content_provider A function accepting the popup's layout and returning the content to display -function Popup:display(content_provider) - self.win_id = vim.api.nvim_open_win(self.buffer, true, self.layout) - vim.api.nvim_command( - string.format("autocmd BufHidden,BufLeave ++once lua pcall(vim.api.nvim_win_close, %d, true)", self.win_id) - ) - - local lines = content_provider(self.layout) - vim.api.nvim_buf_set_lines(self.bufnr or 0, 0, -1, false, lines) - - -- window options - for key, value in pairs(self.win_opts) do - vim.api.nvim_win_set_option(self.win_id or 0, key, value) - end - - -- buffer options - for key, value in pairs(self.buf_opts) do - vim.api.nvim_buf_set_option(self.buffer, key, value) - end -end - -return Popup diff --git a/.local/share/lunarvim/lvim/lua/lvim/interface/text.lua b/.local/share/lunarvim/lvim/lua/lvim/interface/text.lua deleted file mode 100644 index 0266d520..00000000 --- a/.local/share/lunarvim/lvim/lua/lvim/interface/text.lua +++ /dev/null @@ -1,95 +0,0 @@ -local M = {} - -local function max_len_line(lines) - local max_len = 0 - - for _, line in ipairs(lines) do - local line_len = line:len() - if line_len > max_len then - max_len = line_len - end - end - - return max_len -end - ---- Left align lines relatively to the parent container --- @param container The container where lines will be displayed --- @param lines The text to align --- @param alignment The alignment value, range: [0-1] -function M.align_left(container, lines, alignment) - local max_len = max_len_line(lines) - local indent_amount = math.ceil(math.max(container.width - max_len, 0) * alignment) - return M.shift_right(lines, indent_amount) -end - ---- Center align lines relatively to the parent container --- @param container The container where lines will be displayed --- @param lines The text to align --- @param alignment The alignment value, range: [0-1] -function M.align_center(container, lines, alignment) - local output = {} - local max_len = max_len_line(lines) - - for _, line in ipairs(lines) do - local padding = string.rep(" ", (math.max(container.width, max_len) - line:len()) * alignment) - table.insert(output, padding .. line) - end - - return output -end - ---- Shift lines by a given amount --- @params lines The lines the shift --- @param amount The amount of spaces to add -function M.shift_right(lines, amount) - local output = {} - local padding = string.rep(" ", amount) - - for _, line in ipairs(lines) do - table.insert(output, padding .. line) - end - - return output -end - ---- Pretty format tables --- @param entries The table to format --- @param col_count The number of column to span the table on --- @param col_sep The separator between each column, default: " " -function M.format_table(entries, col_count, col_sep) - col_sep = col_sep or " " - - local col_rows = math.ceil(vim.tbl_count(entries) / col_count) - local cols = {} - local count = 0 - - for i, entry in ipairs(entries) do - if ((i - 1) % col_rows) == 0 then - table.insert(cols, {}) - count = count + 1 - end - table.insert(cols[count], entry) - end - - local col_max_len = {} - for _, col in ipairs(cols) do - table.insert(col_max_len, max_len_line(col)) - end - - local output = {} - for i, col in ipairs(cols) do - for j, entry in ipairs(col) do - if not output[j] then - output[j] = entry - else - local padding = string.rep(" ", col_max_len[i - 1] - cols[i - 1][j]:len()) - output[j] = output[j] .. padding .. col_sep .. entry - end - end - end - - return output -end - -return M diff --git a/.local/share/lunarvim/lvim/lua/lvim/keymappings.lua b/.local/share/lunarvim/lvim/lua/lvim/keymappings.lua deleted file mode 100644 index 137f1cc0..00000000 --- a/.local/share/lunarvim/lvim/lua/lvim/keymappings.lua +++ /dev/null @@ -1,203 +0,0 @@ -local M = {} -local Log = require "lvim.core.log" - -local generic_opts_any = { noremap = true, silent = true } - -local generic_opts = { - insert_mode = generic_opts_any, - normal_mode = generic_opts_any, - visual_mode = generic_opts_any, - visual_block_mode = generic_opts_any, - command_mode = generic_opts_any, - term_mode = { silent = true }, -} - -local mode_adapters = { - insert_mode = "i", - normal_mode = "n", - term_mode = "t", - visual_mode = "v", - visual_block_mode = "x", - command_mode = "c", -} - ----@class Keys ----@field insert_mode table ----@field normal_mode table ----@field terminal_mode table ----@field visual_mode table ----@field visual_block_mode table ----@field command_mode table - -local defaults = { - insert_mode = { - -- 'jk' for quitting insert mode - ["jk"] = "", - -- 'kj' for quitting insert mode - ["kj"] = "", - -- 'jj' for quitting insert mode - ["jj"] = "", - -- Move current line / block with Alt-j/k ala vscode. - [""] = ":m .+1==gi", - -- Move current line / block with Alt-j/k ala vscode. - [""] = ":m .-2==gi", - -- navigation - [""] = "k", - [""] = "j", - [""] = "h", - [""] = "l", - }, - - normal_mode = { - -- Better window movement - [""] = "h", - [""] = "j", - [""] = "k", - [""] = "l", - - -- Resize with arrows - [""] = ":resize -2", - [""] = ":resize +2", - [""] = ":vertical resize -2", - [""] = ":vertical resize +2", - - -- Tab switch buffer - [""] = ":BufferLineCycleNext", - [""] = ":BufferLineCyclePrev", - - -- Move current line / block with Alt-j/k a la vscode. - [""] = ":m .+1==", - [""] = ":m .-2==", - - -- QuickFix - ["]q"] = ":cnext", - ["[q"] = ":cprev", - [""] = ":call QuickFixToggle()", - }, - - term_mode = { - -- Terminal window navigation - [""] = "h", - [""] = "j", - [""] = "k", - [""] = "l", - }, - - visual_mode = { - -- Better indenting - ["<"] = ""] = ">gv", - - -- ["p"] = '"0p', - -- ["P"] = '"0P', - }, - - visual_block_mode = { - -- Move selected line / block of text in visual mode - ["K"] = ":move '<-2gv-gv", - ["J"] = ":move '>+1gv-gv", - - -- Move current line / block with Alt-j/k ala vscode. - [""] = ":m '>+1gv-gv", - [""] = ":m '<-2gv-gv", - }, - - command_mode = { - -- navigate tab completion with and - -- runs conditionally - [""] = { 'pumvisible() ? "\\" : "\\"', { expr = true, noremap = true } }, - [""] = { 'pumvisible() ? "\\" : "\\"', { expr = true, noremap = true } }, - }, -} - -if vim.fn.has "mac" == 1 then - defaults.normal_mode[""] = defaults.normal_mode[""] - defaults.normal_mode[""] = defaults.normal_mode[""] - defaults.normal_mode[""] = defaults.normal_mode[""] - defaults.normal_mode[""] = defaults.normal_mode[""] - Log:debug "Activated mac keymappings" -end - --- Unsets all keybindings defined in keymaps --- @param keymaps The table of key mappings containing a list per mode (normal_mode, insert_mode, ..) -function M.clear(keymaps) - local default = M.get_defaults() - for mode, mappings in pairs(keymaps) do - local translated_mode = mode_adapters[mode] or mode - for key, _ in pairs(mappings) do - -- some plugins may override default bindings that the user hasn't manually overridden - if default[mode][key] ~= nil or (default[translated_mode] ~= nil and default[translated_mode][key] ~= nil) then - pcall(vim.keymap.del, translated_mode, key) - end - end - end -end - --- Unsets all keybindings defined in keymaps --- @param keymaps The table of key mappings containing a list per mode (normal_mode, insert_mode, ..) -function M.clear(keymaps) - local default = M.get_defaults() - for mode, mappings in pairs(keymaps) do - local translated_mode = mode_adapters[mode] and mode_adapters[mode] or mode - for key, _ in pairs(mappings) do - -- some plugins may override default bindings that the user hasn't manually overriden - if default[mode][key] ~= nil or (default[translated_mode] ~= nil and default[translated_mode][key] ~= nil) then - pcall(vim.api.nvim_del_keymap, translated_mode, key) - end - end - end -end - --- Set key mappings individually --- @param mode The keymap mode, can be one of the keys of mode_adapters --- @param key The key of keymap --- @param val Can be form as a mapping or tuple of mapping and user defined opt -function M.set_keymaps(mode, key, val) - local opt = generic_opts[mode] or generic_opts_any - if type(val) == "table" then - opt = val[2] - val = val[1] - end - if val then - vim.keymap.set(mode, key, val, opt) - else - pcall(vim.api.nvim_del_keymap, mode, key) - end -end - --- Load key mappings for a given mode --- @param mode The keymap mode, can be one of the keys of mode_adapters --- @param keymaps The list of key mappings -function M.load_mode(mode, keymaps) - mode = mode_adapters[mode] or mode - for k, v in pairs(keymaps) do - M.set_keymaps(mode, k, v) - end -end - --- Load key mappings for all provided modes --- @param keymaps A list of key mappings for each mode -function M.load(keymaps) - keymaps = keymaps or {} - for mode, mapping in pairs(keymaps) do - M.load_mode(mode, mapping) - end -end - --- Load the default keymappings -function M.load_defaults() - M.load(M.get_defaults()) - lvim.keys = lvim.keys or {} - for idx, _ in pairs(defaults) do - if not lvim.keys[idx] then - lvim.keys[idx] = {} - end - end -end - --- Get the default keymappings -function M.get_defaults() - return defaults -end - -return M diff --git a/.local/share/lunarvim/lvim/lua/lvim/lsp/config.lua b/.local/share/lunarvim/lvim/lua/lvim/lsp/config.lua deleted file mode 100644 index 1f84c4e2..00000000 --- a/.local/share/lunarvim/lvim/lua/lvim/lsp/config.lua +++ /dev/null @@ -1,128 +0,0 @@ -local skipped_servers = { - "angularls", - "ansiblels", - "ccls", - "csharp_ls", - "cssmodules_ls", - "denols", - "ember", - "emmet_ls", - "eslint", - "eslintls", - "golangci_lint_ls", - "graphql", - "jedi_language_server", - "ltex", - "ocamlls", - "phpactor", - "psalm", - "pylsp", - "quick_lint_js", - "rome", - "reason_ls", - "scry", - "solang", - "solidity_ls", - "sorbet", - "sourcekit", - "sourcery", - "spectral", - "sqlls", - "sqls", - "stylelint_lsp", - "tailwindcss", - "tflint", - "svlangserver", - "verible", - "vuels", -} - -local skipped_filetypes = { "markdown", "rst", "plaintext" } - -return { - templates_dir = join_paths(get_runtime_dir(), "site", "after", "ftplugin"), - diagnostics = { - signs = { - active = true, - values = { - { name = "DiagnosticSignError", text = "" }, - { name = "DiagnosticSignWarn", text = "" }, - { name = "DiagnosticSignHint", text = "" }, - { name = "DiagnosticSignInfo", text = "" }, - }, - }, - virtual_text = true, - update_in_insert = false, - underline = true, - severity_sort = true, - float = { - focusable = false, - style = "minimal", - border = "rounded", - source = "always", - header = "", - prefix = "", - format = function(d) - local t = vim.deepcopy(d) - local code = d.code or (d.user_data and d.user_data.lsp.code) - if code then - t.message = string.format("%s [%s]", t.message, code):gsub("1. ", "") - end - return t.message - end, - }, - }, - document_highlight = true, - code_lens_refresh = true, - float = { - focusable = true, - style = "minimal", - border = "rounded", - }, - peek = { - max_height = 15, - max_width = 30, - context = 10, - }, - on_attach_callback = nil, - on_init_callback = nil, - automatic_servers_installation = true, - automatic_configuration = { - ---@usage list of servers that the automatic installer will skip - skipped_servers = skipped_servers, - ---@usage list of filetypes that the automatic installer will skip - skipped_filetypes = skipped_filetypes, - }, - buffer_mappings = { - normal_mode = { - ["K"] = { vim.lsp.buf.hover, "Show hover" }, - ["gd"] = { vim.lsp.buf.definition, "Goto Definition" }, - ["gD"] = { vim.lsp.buf.declaration, "Goto declaration" }, - ["gr"] = { vim.lsp.buf.references, "Goto references" }, - ["gI"] = { vim.lsp.buf.implementation, "Goto Implementation" }, - ["gs"] = { vim.lsp.buf.signature_help, "show signature help" }, - ["gp"] = { - function() - require("lvim.lsp.peek").Peek "definition" - end, - "Peek definition", - }, - ["gl"] = { - function() - local config = lvim.lsp.diagnostics.float - config.scope = "line" - vim.diagnostic.open_float(0, config) - end, - "Show line diagnostics", - }, - }, - insert_mode = {}, - visual_mode = {}, - }, - null_ls = { - setup = {}, - config = {}, - }, - ---@deprecated use automatic_configuration.skipped_servers instead - override = {}, -} diff --git a/.local/share/lunarvim/lvim/lua/lvim/lsp/handlers.lua b/.local/share/lunarvim/lvim/lua/lvim/lsp/handlers.lua deleted file mode 100644 index 84f2ba5f..00000000 --- a/.local/share/lunarvim/lvim/lua/lvim/lsp/handlers.lua +++ /dev/null @@ -1,19 +0,0 @@ --- Set Default Prefix. --- Note: You can set a prefix per lsp server in the lv-globals.lua file -local M = {} - -function M.setup() - local config = { -- your config - virtual_text = lvim.lsp.diagnostics.virtual_text, - signs = lvim.lsp.diagnostics.signs, - underline = lvim.lsp.diagnostics.underline, - update_in_insert = lvim.lsp.diagnostics.update_in_insert, - severity_sort = lvim.lsp.diagnostics.severity_sort, - float = lvim.lsp.diagnostics.float, - } - vim.diagnostic.config(config) - vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, lvim.lsp.float) - vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with(vim.lsp.handlers.signature_help, lvim.lsp.float) -end - -return M diff --git a/.local/share/lunarvim/lvim/lua/lvim/lsp/init.lua b/.local/share/lunarvim/lvim/lua/lvim/lsp/init.lua deleted file mode 100644 index 2f3258c9..00000000 --- a/.local/share/lunarvim/lvim/lua/lvim/lsp/init.lua +++ /dev/null @@ -1,135 +0,0 @@ -local M = {} -local Log = require "lvim.core.log" -local utils = require "lvim.utils" -local autocmds = require "lvim.core.autocmds" - -local function add_lsp_buffer_keybindings(bufnr) - local mappings = { - normal_mode = "n", - insert_mode = "i", - visual_mode = "v", - } - - if lvim.builtin.which_key.active then - -- Remap using which_key - local status_ok, wk = pcall(require, "which-key") - if not status_ok then - return - end - for mode_name, mode_char in pairs(mappings) do - wk.register(lvim.lsp.buffer_mappings[mode_name], { mode = mode_char, buffer = bufnr }) - end - else - -- Remap using nvim api - for mode_name, mode_char in pairs(mappings) do - for key, remap in pairs(lvim.lsp.buffer_mappings[mode_name]) do - vim.api.nvim_buf_set_keymap(bufnr, mode_char, key, remap[1], { noremap = true, silent = true }) - end - end - end -end - -function M.common_capabilities() - local capabilities = vim.lsp.protocol.make_client_capabilities() - capabilities.textDocument.completion.completionItem.snippetSupport = true - capabilities.textDocument.completion.completionItem.resolveSupport = { - properties = { - "documentation", - "detail", - "additionalTextEdits", - }, - } - - local status_ok, cmp_nvim_lsp = pcall(require, "cmp_nvim_lsp") - if status_ok then - capabilities = cmp_nvim_lsp.update_capabilities(capabilities) - end - - return capabilities -end - -function M.common_on_exit(_, _) - if lvim.lsp.document_highlight then - autocmds.clear_augroup "lsp_document_highlight" - end - if lvim.lsp.code_lens_refresh then - autocmds.clear_augroup "lsp_code_lens_refresh" - end -end - -function M.common_on_init(client, bufnr) - if lvim.lsp.on_init_callback then - lvim.lsp.on_init_callback(client, bufnr) - Log:debug "Called lsp.on_init_callback" - return - end -end - -function M.common_on_attach(client, bufnr) - if lvim.lsp.on_attach_callback then - lvim.lsp.on_attach_callback(client, bufnr) - Log:debug "Called lsp.on_attach_callback" - end - local lu = require "lvim.lsp.utils" - if lvim.lsp.document_highlight then - lu.setup_document_highlight(client, bufnr) - end - if lvim.lsp.code_lens_refresh then - lu.setup_codelens_refresh(client, bufnr) - end - add_lsp_buffer_keybindings(bufnr) -end - -local function bootstrap_nlsp(opts) - opts = opts or {} - local lsp_settings_status_ok, lsp_settings = pcall(require, "nlspsettings") - if lsp_settings_status_ok then - lsp_settings.setup(opts) - end -end - -function M.get_common_opts() - return { - on_attach = M.common_on_attach, - on_init = M.common_on_init, - on_exit = M.common_on_exit, - capabilities = M.common_capabilities(), - } -end - -function M.setup() - Log:debug "Setting up LSP support" - - local lsp_status_ok, _ = pcall(require, "lspconfig") - if not lsp_status_ok then - return - end - - if lvim.use_icons then - for _, sign in ipairs(lvim.lsp.diagnostics.signs.values) do - vim.fn.sign_define(sign.name, { texthl = sign.name, text = sign.text, numhl = sign.name }) - end - end - - require("lvim.lsp.handlers").setup() - - if not utils.is_directory(lvim.lsp.templates_dir) then - require("lvim.lsp.templates").generate_templates() - end - - bootstrap_nlsp { - config_home = utils.join_paths(get_config_dir(), "lsp-settings"), - append_default_schemas = true, - } - - require("nvim-lsp-installer").setup { - -- use the default nvim_data_dir, since the server binaries are independent - install_root_dir = utils.join_paths(vim.call("stdpath", "data"), "lsp_servers"), - } - - require("lvim.lsp.null-ls").setup() - - autocmds.configure_format_on_save() -end - -return M diff --git a/.local/share/lunarvim/lvim/lua/lvim/lsp/manager.lua b/.local/share/lunarvim/lvim/lua/lvim/lsp/manager.lua deleted file mode 100644 index 9e898841..00000000 --- a/.local/share/lunarvim/lvim/lua/lvim/lsp/manager.lua +++ /dev/null @@ -1,99 +0,0 @@ -local M = {} - -local Log = require "lvim.core.log" -local lvim_lsp_utils = require "lvim.lsp.utils" - ----Resolve the configuration for a server by merging with the default config ----@param server_name string ----@vararg any config table [optional] ----@return table -local function resolve_config(server_name, ...) - local defaults = { - on_attach = require("lvim.lsp").common_on_attach, - on_init = require("lvim.lsp").common_on_init, - on_exit = require("lvim.lsp").common_on_exit, - capabilities = require("lvim.lsp").common_capabilities(), - } - - local has_custom_provider, custom_config = pcall(require, "lvim/lsp/providers/" .. server_name) - if has_custom_provider then - Log:debug("Using custom configuration for requested server: " .. server_name) - defaults = vim.tbl_deep_extend("force", defaults, custom_config) - end - - defaults = vim.tbl_deep_extend("force", defaults, ...) - - return defaults -end - --- manually start the server and don't wait for the usual filetype trigger from lspconfig -local function buf_try_add(server_name, bufnr) - bufnr = bufnr or vim.api.nvim_get_current_buf() - require("lspconfig")[server_name].manager.try_add_wrapper(bufnr) -end - --- check if the manager autocomd has already been configured since some servers can take a while to initialize --- this helps guarding against a data-race condition where a server can get configured twice --- which seems to occur only when attaching to single-files -local function client_is_configured(server_name, ft) - ft = ft or vim.bo.filetype - local active_autocmds = vim.split(vim.fn.execute("autocmd FileType " .. ft), "\n") - for _, result in ipairs(active_autocmds) do - if result:match(server_name) then - Log:debug(string.format("[%q] is already configured", server_name)) - return true - end - end - return false -end - -local function launch_server(server_name, config) - pcall(function() - require("lspconfig")[server_name].setup(config) - buf_try_add(server_name) - end) -end - ----Setup a language server by providing a name ----@param server_name string name of the language server ----@param user_config table? when available it will take predence over any default configurations -function M.setup(server_name, user_config) - vim.validate { name = { server_name, "string" } } - user_config = user_config or {} - - if lvim_lsp_utils.is_client_active(server_name) or client_is_configured(server_name) then - return - end - - local servers = require "nvim-lsp-installer.servers" - local server_available, server = servers.get_server(server_name) - - if not server_available then - local config = resolve_config(server_name, user_config) - launch_server(server_name, config) - return - end - - local install_in_progress = false - - if not server:is_installed() then - if lvim.lsp.automatic_servers_installation then - Log:debug "Automatic server installation detected" - server:install() - install_in_progress = true - else - Log:debug(server.name .. " is not managed by the automatic installer") - end - end - - server:on_ready(function() - if install_in_progress then - vim.notify(string.format("Installation complete for [%s] server", server.name), vim.log.levels.INFO) - end - install_in_progress = false - local config = resolve_config(server_name, server:get_default_options(), user_config) - launch_server(server_name, config) - end) -end - -return M diff --git a/.local/share/lunarvim/lvim/lua/lvim/lsp/null-ls/code_actions.lua b/.local/share/lunarvim/lvim/lua/lvim/lsp/null-ls/code_actions.lua deleted file mode 100644 index 50f4cfb9..00000000 --- a/.local/share/lunarvim/lvim/lua/lvim/lsp/null-ls/code_actions.lua +++ /dev/null @@ -1,26 +0,0 @@ -local M = {} - -local Log = require "lvim.core.log" - -local null_ls = require "null-ls" -local services = require "lvim.lsp.null-ls.services" -local method = null_ls.methods.CODE_ACTION - -function M.list_registered(filetype) - local registered_providers = services.list_registered_providers_names(filetype) - return registered_providers[method] or {} -end - -function M.setup(actions_configs) - if vim.tbl_isempty(actions_configs) then - return - end - - local registered = services.register_sources(actions_configs, method) - - if #registered > 0 then - Log:debug("Registered the following action-handlers: " .. unpack(registered)) - end -end - -return M diff --git a/.local/share/lunarvim/lvim/lua/lvim/lsp/null-ls/formatters.lua b/.local/share/lunarvim/lvim/lua/lvim/lsp/null-ls/formatters.lua deleted file mode 100644 index b4fb2f30..00000000 --- a/.local/share/lunarvim/lvim/lua/lvim/lsp/null-ls/formatters.lua +++ /dev/null @@ -1,33 +0,0 @@ -local M = {} - -local Log = require "lvim.core.log" - -local null_ls = require "null-ls" -local services = require "lvim.lsp.null-ls.services" -local method = null_ls.methods.FORMATTING - -function M.list_registered(filetype) - local registered_providers = services.list_registered_providers_names(filetype) - return registered_providers[method] or {} -end - -function M.list_supported(filetype) - local s = require "null-ls.sources" - local supported_formatters = s.get_supported(filetype, "formatting") - table.sort(supported_formatters) - return supported_formatters -end - -function M.setup(formatter_configs) - if vim.tbl_isempty(formatter_configs) then - return - end - - local registered = services.register_sources(formatter_configs, method) - - if #registered > 0 then - Log:debug("Registered the following formatters: " .. unpack(registered)) - end -end - -return M diff --git a/.local/share/lunarvim/lvim/lua/lvim/lsp/null-ls/init.lua b/.local/share/lunarvim/lvim/lua/lvim/lsp/null-ls/init.lua deleted file mode 100644 index 51a200f4..00000000 --- a/.local/share/lunarvim/lvim/lua/lvim/lsp/null-ls/init.lua +++ /dev/null @@ -1,16 +0,0 @@ -local M = {} - -local Log = require "lvim.core.log" - -function M.setup() - local status_ok, null_ls = pcall(require, "null-ls") - if not status_ok then - Log:error "Missing null-ls dependency" - return - end - - local default_opts = require("lvim.lsp").get_common_opts() - null_ls.setup(vim.tbl_deep_extend("force", default_opts, lvim.lsp.null_ls.setup)) -end - -return M diff --git a/.local/share/lunarvim/lvim/lua/lvim/lsp/null-ls/linters.lua b/.local/share/lunarvim/lvim/lua/lvim/lsp/null-ls/linters.lua deleted file mode 100644 index 07c8094b..00000000 --- a/.local/share/lunarvim/lvim/lua/lvim/lsp/null-ls/linters.lua +++ /dev/null @@ -1,33 +0,0 @@ -local M = {} - -local Log = require "lvim.core.log" - -local null_ls = require "null-ls" -local services = require "lvim.lsp.null-ls.services" -local method = null_ls.methods.DIAGNOSTICS - -function M.list_registered(filetype) - local registered_providers = services.list_registered_providers_names(filetype) - return registered_providers[method] or {} -end - -function M.list_supported(filetype) - local s = require "null-ls.sources" - local supported_linters = s.get_supported(filetype, "diagnostics") - table.sort(supported_linters) - return supported_linters -end - -function M.setup(linter_configs) - if vim.tbl_isempty(linter_configs) then - return - end - - local registered = services.register_sources(linter_configs, method) - - if #registered > 0 then - Log:debug("Registered the following linters: " .. unpack(registered)) - end -end - -return M diff --git a/.local/share/lunarvim/lvim/lua/lvim/lsp/null-ls/services.lua b/.local/share/lunarvim/lvim/lua/lvim/lsp/null-ls/services.lua deleted file mode 100644 index 7dc0bb62..00000000 --- a/.local/share/lunarvim/lvim/lua/lvim/lsp/null-ls/services.lua +++ /dev/null @@ -1,104 +0,0 @@ -local M = {} - -local Log = require "lvim.core.log" - -local function find_root_dir() - local util = require "lspconfig/util" - local lsp_utils = require "lvim.lsp.utils" - - local ts_client = lsp_utils.is_client_active "typescript" - if ts_client then - return ts_client.config.root_dir - end - local dirname = vim.fn.expand "%:p:h" - return util.root_pattern "package.json"(dirname) -end - -local function from_node_modules(command) - local root_dir = find_root_dir() - - if not root_dir then - return nil - end - - local join_paths = require("lvim.utils").join_paths - return join_paths(root_dir, "node_modules", ".bin", command) -end - -local local_providers = { - prettier = { find = from_node_modules }, - prettierd = { find = from_node_modules }, - prettier_d_slim = { find = from_node_modules }, - eslint_d = { find = from_node_modules }, - eslint = { find = from_node_modules }, - stylelint = { find = from_node_modules }, -} - -function M.find_command(command) - if local_providers[command] then - local local_command = local_providers[command].find(command) - if local_command and vim.fn.executable(local_command) == 1 then - return local_command - end - end - - if command and vim.fn.executable(command) == 1 then - return command - end - return nil -end - -function M.list_registered_providers_names(filetype) - local s = require "null-ls.sources" - local available_sources = s.get_available(filetype) - local registered = {} - for _, source in ipairs(available_sources) do - for method in pairs(source.methods) do - registered[method] = registered[method] or {} - table.insert(registered[method], source.name) - end - end - return registered -end - -function M.register_sources(configs, method) - local null_ls = require "null-ls" - local is_registered = require("null-ls.sources").is_registered - - local sources, registered_names = {}, {} - - for _, config in ipairs(configs) do - local cmd = config.exe or config.command - local name = config.name or cmd:gsub("-", "_") - local type = method == null_ls.methods.CODE_ACTION and "code_actions" or null_ls.methods[method]:lower() - local source = type and null_ls.builtins[type][name] - Log:debug(string.format("Received request to register [%s] as a %s source", name, type)) - if not source then - Log:error("Not a valid source: " .. name) - elseif is_registered { name = source.name or name, method = method } then - Log:trace(string.format("Skipping registering [%s] more than once", name)) - else - local command = M.find_command(source._opts.command) or source._opts.command - - -- treat `args` as `extra_args` for backwards compatibility. Can otherwise use `generator_opts.args` - local compat_opts = vim.deepcopy(config) - if config.args then - compat_opts.extra_args = config.args or config.extra_args - compat_opts.args = nil - end - - local opts = vim.tbl_deep_extend("keep", { command = command }, compat_opts) - Log:debug("Registering source " .. name) - Log:trace(vim.inspect(opts)) - table.insert(sources, source.with(opts)) - vim.list_extend(registered_names, { source.name }) - end - end - - if #sources > 0 then - null_ls.register { sources = sources } - end - return registered_names -end - -return M diff --git a/.local/share/lunarvim/lvim/lua/lvim/lsp/peek.lua b/.local/share/lunarvim/lvim/lua/lvim/lsp/peek.lua deleted file mode 100644 index 65c67e92..00000000 --- a/.local/share/lunarvim/lvim/lua/lvim/lsp/peek.lua +++ /dev/null @@ -1,157 +0,0 @@ -local M = { - floating_buf = nil, - floating_win = nil, - prev_result = nil, -} - -local function create_floating_file(location, opts) - vim.validate { - location = { location, "t" }, - opts = { opts, "t", true }, - } - - -- Set some defaults - opts = opts or {} - local close_events = opts.close_events or { "CursorMoved", "CursorMovedI", "BufHidden", "InsertCharPre" } - - -- location may be LocationLink or Location - local uri = location.targetUri or location.uri - if uri == nil then - return - end - local bufnr = vim.uri_to_bufnr(uri) - if not vim.api.nvim_buf_is_loaded(bufnr) then - vim.fn.bufload(bufnr) - end - - local range = location.targetRange or location.range - - local contents = vim.api.nvim_buf_get_lines( - bufnr, - range.start.line, - math.min( - range["end"].line + 1 + (opts.context or lvim.lsp.peek.max_height), - range.start.line + (opts.max_height or lvim.lsp.peek.max_height) - ), - false - ) - if next(contents) == nil then - vim.notify("peek: Unable to get contents of the file!", vim.log.levels.WARN) - return - end - local width, height = vim.lsp.util._make_floating_popup_size(contents, opts) - local if_nil = vim.F.if_nil - opts = vim.lsp.util.make_floating_popup_options( - if_nil(width, lvim.lsp.peek.max_width), - if_nil(height, lvim.lsp.peek.max_height), - opts - ) - -- Don't make it minimal as it is meant to be fully featured - opts["style"] = nil - - vim.api.nvim_buf_set_option(bufnr, "bufhidden", "wipe") - - local winnr = vim.api.nvim_open_win(bufnr, false, opts) - vim.api.nvim_win_set_option(winnr, "winblend", 0) - - vim.api.nvim_win_set_cursor(winnr, { range.start.line + 1, range.start.character }) - vim.api.nvim_buf_set_var(bufnr, "lsp_floating_window", winnr) - - -- Set some autocmds to close the window - vim.api.nvim_command( - string.format("autocmd %s ++once lua pcall(vim.api.nvim_win_close, %d, true)", unpack(close_events), winnr) - ) - - return bufnr, winnr -end - -local function preview_location_callback(result) - if result == nil or vim.tbl_isempty(result) then - return nil - end - - local opts = { - border = "rounded", - context = lvim.lsp.peek.context, - } - - if vim.tbl_islist(result) then - M.prev_result = result[1] - M.floating_buf, M.floating_win = create_floating_file(result[1], opts) - else - M.prev_result = result - M.floating_buf, M.floating_win = create_floating_file(result, opts) - end -end - -local function preview_location_callback_new_signature(_, result) - return preview_location_callback(result) -end - -function M.open_file() - -- Get the file currently open in the floating window - local filepath = vim.fn.expand "%:." - - if not filepath then - vim.notify("peek: Unable to open the file!", vim.log.levels.ERROR) - return - end - - -- Close the floating window - pcall(vim.api.nvim_win_close, M.floating_win, true) - - -- Edit the file - vim.cmd("edit " .. filepath) - - local winnr = vim.api.nvim_get_current_win() - - -- Set the cursor at the right position - M.set_cursor_to_prev_pos(winnr) -end - -function M.set_cursor_to_prev_pos(winnr) - -- Get position of the thing to peek at - local location = M.prev_result - local range = location.targetRange or location.range - local cursor_pos = { range.start.line + 1, range.start.character } - - -- Set the winnr to the floating window if none was passed in - winnr = winnr or M.floating_win - -- Set the cursor at the correct position in the floating window - vim.api.nvim_win_set_cursor(winnr, cursor_pos) -end - -function M.Peek(what) - -- If a window already exists, focus it at the right position! - if vim.tbl_contains(vim.api.nvim_list_wins(), M.floating_win) then - local success_1, _ = pcall(vim.api.nvim_set_current_win, M.floating_win) - if not success_1 then - vim.notify("peek: You cannot edit the current file in a preview!", vim.log.levels.ERROR) - return - end - - -- Set the cursor at the correct position in the floating window - M.set_cursor_to_prev_pos() - - vim.api.nvim_buf_set_keymap( - M.floating_buf, - "n", - "", - ":lua require('lvim.lsp.peek').open_file()", - { noremap = true, silent = true } - ) - else - -- Make a new request and then create the new window in the callback - local params = vim.lsp.util.make_position_params() - local preview_callback = preview_location_callback_new_signature - local success, _ = pcall(vim.lsp.buf_request, 0, "textDocument/" .. what, params, preview_callback) - if not success then - vim.notify( - 'peek: Error calling LSP method "textDocument/' .. what .. '". The current language lsp might not support it.', - vim.log.levels.ERROR - ) - end - end -end - -return M diff --git a/.local/share/lunarvim/lvim/lua/lvim/lsp/providers/jsonls.lua b/.local/share/lunarvim/lvim/lua/lvim/lsp/providers/jsonls.lua deleted file mode 100644 index 528c72a0..00000000 --- a/.local/share/lunarvim/lvim/lua/lvim/lsp/providers/jsonls.lua +++ /dev/null @@ -1,23 +0,0 @@ -local full_schemas = vim.tbl_deep_extend( - "force", - require("schemastore").json.schemas(), - require("nlspsettings.jsonls").get_default_schemas() -) -local opts = { - settings = { - json = { - schemas = full_schemas, - }, - }, - setup = { - commands = { - Format = { - function() - vim.lsp.buf.range_formatting({}, { 0, 0 }, { vim.fn.line "$", 0 }) - end, - }, - }, - }, -} - -return opts diff --git a/.local/share/lunarvim/lvim/lua/lvim/lsp/providers/sumneko_lua.lua b/.local/share/lunarvim/lvim/lua/lvim/lsp/providers/sumneko_lua.lua deleted file mode 100644 index fa0d2d31..00000000 --- a/.local/share/lunarvim/lvim/lua/lvim/lsp/providers/sumneko_lua.lua +++ /dev/null @@ -1,34 +0,0 @@ -local opts = { - settings = { - Lua = { - diagnostics = { - globals = { "vim", "lvim", "packer_plugins" }, - }, - workspace = { - library = { - [require("lvim.utils").join_paths(get_runtime_dir(), "lvim", "lua")] = true, - }, - maxPreload = 100000, - preloadFileSize = 10000, - }, - }, - }, -} - -local lua_dev_loaded, lua_dev = pcall(require, "lua-dev") -if not lua_dev_loaded then - return opts -end - -local dev_opts = { - library = { - vimruntime = true, -- runtime path - types = true, -- full signature, docs and completion of vim.api, vim.treesitter, vim.lsp and others - -- plugins = true, -- installed opt or start plugins in packpath - -- you can also specify the list of plugins to make available as a workspace library - plugins = { "plenary.nvim" }, - }, - lspconfig = opts, -} - -return lua_dev.setup(dev_opts) diff --git a/.local/share/lunarvim/lvim/lua/lvim/lsp/providers/vuels.lua b/.local/share/lunarvim/lvim/lua/lvim/lsp/providers/vuels.lua deleted file mode 100644 index 326363fd..00000000 --- a/.local/share/lunarvim/lvim/lua/lvim/lsp/providers/vuels.lua +++ /dev/null @@ -1,26 +0,0 @@ -local opts = { - setup = { - root_dir = function(fname) - local util = require "lvim.lspconfig/util" - return util.root_pattern "package.json"(fname) or util.root_pattern "vue.config.js"(fname) or vim.fn.getcwd() - end, - init_options = { - config = { - vetur = { - completion = { - autoImport = true, - tagCasing = "kebab", - useScaffoldSnippets = true, - }, - useWorkspaceDependencies = true, - validation = { - script = true, - style = true, - template = true, - }, - }, - }, - }, - }, -} -return opts diff --git a/.local/share/lunarvim/lvim/lua/lvim/lsp/providers/yamlls.lua b/.local/share/lunarvim/lvim/lua/lvim/lsp/providers/yamlls.lua deleted file mode 100644 index 156a35b0..00000000 --- a/.local/share/lunarvim/lvim/lua/lvim/lsp/providers/yamlls.lua +++ /dev/null @@ -1,30 +0,0 @@ -local opts = { - settings = { - yaml = { - hover = true, - completion = true, - validate = true, - schemaStore = { - enable = true, - url = "https://www.schemastore.org/api/json/catalog.json", - }, - schemas = { - kubernetes = { - "daemon.{yml,yaml}", - "manager.{yml,yaml}", - "restapi.{yml,yaml}", - "role.{yml,yaml}", - "role_binding.{yml,yaml}", - "*onfigma*.{yml,yaml}", - "*ngres*.{yml,yaml}", - "*ecre*.{yml,yaml}", - "*eployment*.{yml,yaml}", - "*ervic*.{yml,yaml}", - "kubectl-edit*.yaml", - }, - }, - }, - }, -} - -return opts diff --git a/.local/share/lunarvim/lvim/lua/lvim/lsp/templates.lua b/.local/share/lunarvim/lvim/lua/lvim/lsp/templates.lua deleted file mode 100644 index 09f82430..00000000 --- a/.local/share/lunarvim/lvim/lua/lvim/lsp/templates.lua +++ /dev/null @@ -1,77 +0,0 @@ -local M = {} - -local Log = require "lvim.core.log" -local utils = require "lvim.utils" -local lvim_lsp_utils = require "lvim.lsp.utils" - -local ftplugin_dir = lvim.lsp.templates_dir - -local join_paths = _G.join_paths - -function M.remove_template_files() - -- remove any outdated files - for _, file in ipairs(vim.fn.glob(ftplugin_dir .. "/*.lua", 1, 1)) do - vim.fn.delete(file) - end -end - -local skipped_filetypes = lvim.lsp.automatic_configuration.skipped_filetypes -local skipped_servers = lvim.lsp.automatic_configuration.skipped_servers - ----Generates an ftplugin file based on the server_name in the selected directory ----@param server_name string name of a valid language server, e.g. pyright, gopls, tsserver, etc. ----@param dir string the full path to the desired directory -function M.generate_ftplugin(server_name, dir) - if vim.tbl_contains(skipped_servers, server_name) then - return - end - - -- get the supported filetypes and remove any ignored ones - local filetypes = vim.tbl_filter(function(ft) - return not vim.tbl_contains(skipped_filetypes, ft) - end, lvim_lsp_utils.get_supported_filetypes(server_name) or {}) - - if not filetypes then - return - end - - for _, filetype in ipairs(filetypes) do - local filename = join_paths(dir, filetype .. ".lua") - local setup_cmd = string.format([[require("lvim.lsp.manager").setup(%q)]], server_name) - -- print("using setup_cmd: " .. setup_cmd) - -- overwrite the file completely - utils.write_file(filename, setup_cmd .. "\n", "a") - end -end - ----Generates ftplugin files based on a list of server_names ----The files are generated to a runtimepath: "$LUNARVIM_RUNTIME_DIR/site/after/ftplugin/template.lua" ----@param servers_names? table list of servers to be enabled. Will add all by default -function M.generate_templates(servers_names) - servers_names = servers_names or {} - - Log:debug "Templates installation in progress" - - M.remove_template_files() - - if vim.tbl_isempty(servers_names) then - local available_servers = require("nvim-lsp-installer.servers").get_available_servers() - - for _, server in pairs(available_servers) do - table.insert(servers_names, server.name) - table.sort(servers_names) - end - end - - -- create the directory if it didn't exist - if not utils.is_directory(lvim.lsp.templates_dir) then - vim.fn.mkdir(ftplugin_dir, "p") - end - - for _, server in ipairs(servers_names) do - M.generate_ftplugin(server, ftplugin_dir) - end - Log:debug "Templates installation is complete" -end - -return M diff --git a/.local/share/lunarvim/lvim/lua/lvim/lsp/utils.lua b/.local/share/lunarvim/lvim/lua/lvim/lsp/utils.lua deleted file mode 100644 index d0e36241..00000000 --- a/.local/share/lunarvim/lvim/lua/lvim/lsp/utils.lua +++ /dev/null @@ -1,194 +0,0 @@ -local M = {} - -local tbl = require "lvim.utils.table" - -function M.is_client_active(name) - local clients = vim.lsp.get_active_clients() - return tbl.find_first(clients, function(client) - return client.name == name - end) -end - -function M.get_active_clients_by_ft(filetype) - local matches = {} - local clients = vim.lsp.get_active_clients() - for _, client in pairs(clients) do - local supported_filetypes = client.config.filetypes or {} - if client.name ~= "null-ls" and vim.tbl_contains(supported_filetypes, filetype) then - table.insert(matches, client) - end - end - return matches -end - -function M.get_client_capabilities(client_id) - local client - if not client_id then - local buf_clients = vim.lsp.buf_get_clients() - for _, buf_client in pairs(buf_clients) do - if buf_client.name ~= "null-ls" then - client = buf_client - break - end - end - else - client = vim.lsp.get_client_by_id(tonumber(client_id)) - end - if not client then - error "Unable to determine client_id" - return - end - - local enabled_caps = {} - for capability, status in pairs(client.server_capabilities or client.resolved_capabilities) do - if status == true then - table.insert(enabled_caps, capability) - end - end - - return enabled_caps -end - ----Get supported filetypes per server ----@param server_name string can be any server supported by nvim-lsp-installer ----@return table supported filestypes as a list of strings -function M.get_supported_filetypes(server_name) - local status_ok, lsp_installer_servers = pcall(require, "nvim-lsp-installer.servers") - if not status_ok then - return {} - end - - local server_available, requested_server = lsp_installer_servers.get_server(server_name) - if not server_available then - return {} - end - - return requested_server:get_supported_filetypes() -end - ----Get supported servers per filetype ----@param filetype string ----@return table list of names of supported servers -function M.get_supported_servers_per_filetype(filetype) - local filetype_server_map = require "nvim-lsp-installer._generated.filetype_map" - return filetype_server_map[filetype] -end - ----Get all supported filetypes by nvim-lsp-installer ----@return table supported filestypes as a list of strings -function M.get_all_supported_filetypes() - local status_ok, lsp_installer_filetypes = pcall(require, "nvim-lsp-installer._generated.filetype_map") - if not status_ok then - return {} - end - return vim.tbl_keys(lsp_installer_filetypes or {}) -end - -function M.setup_document_highlight(client, bufnr) - local status_ok, highlight_supported = pcall(function() - return client.supports_method "textDocument/documentHighlight" - end) - if not status_ok or not highlight_supported then - return - end - local augroup_exist, _ = pcall(vim.api.nvim_get_autocmds, { - group = "lsp_document_highlight", - }) - if not augroup_exist then - vim.api.nvim_create_augroup("lsp_document_highlight", {}) - end - vim.api.nvim_create_autocmd({ "CursorHold", "CursorHoldI" }, { - group = "lsp_document_highlight", - buffer = bufnr, - callback = vim.lsp.buf.document_highlight, - }) - vim.api.nvim_create_autocmd("CursorMoved", { - group = "lsp_document_highlight", - buffer = bufnr, - callback = vim.lsp.buf.clear_references, - }) -end - -function M.setup_codelens_refresh(client, bufnr) - local status_ok, codelens_supported = pcall(function() - return client.supports_method "textDocument/codeLens" - end) - if not status_ok or not codelens_supported then - return - end - local augroup_exist, _ = pcall(vim.api.nvim_get_autocmds, { - group = "lsp_code_lens_refresh", - }) - if not augroup_exist then - vim.api.nvim_create_augroup("lsp_code_lens_refresh", {}) - end - vim.api.nvim_create_autocmd({ "BufEnter", "InsertLeave" }, { - group = "lsp_code_lens_refresh", - buffer = bufnr, - callback = vim.lsp.codelens.refresh, - }) -end - ----filter passed to vim.lsp.buf.format ----gives higher priority to null-ls ----@param clients table clients attached to a buffer ----@return table chosen clients -function M.format_filter(clients) - return vim.tbl_filter(function(client) - local status_ok, formatting_supported = pcall(function() - return client.supports_method "textDocument/formatting" - end) - -- give higher prio to null-ls - if status_ok and formatting_supported and client.name == "null-ls" then - return "null-ls" - else - return status_ok and formatting_supported and client.name - end - end, clients) -end - ----Provide vim.lsp.buf.format for nvim <0.8 ----@param opts table -function M.format(opts) - opts = opts or { filter = M.format_filter } - - if vim.lsp.buf.format then - return vim.lsp.buf.format(opts) - end - - local bufnr = opts.bufnr or vim.api.nvim_get_current_buf() - local clients = vim.lsp.buf_get_clients(bufnr) - - if opts.filter then - clients = opts.filter(clients) - elseif opts.id then - clients = vim.tbl_filter(function(client) - return client.id == opts.id - end, clients) - elseif opts.name then - clients = vim.tbl_filter(function(client) - return client.name == opts.name - end, clients) - end - - clients = vim.tbl_filter(function(client) - return client.supports_method "textDocument/formatting" - end, clients) - - if #clients == 0 then - vim.notify_once "[LSP] Format request failed, no matching language servers." - end - - local timeout_ms = opts.timeout_ms or 1000 - for _, client in pairs(clients) do - local params = vim.lsp.util.make_formatting_params(opts.formatting_options) - local result, err = client.request_sync("textDocument/formatting", params, timeout_ms, bufnr) - if result and result.result then - vim.lsp.util.apply_text_edits(result.result, bufnr, client.offset_encoding) - elseif err then - vim.notify(string.format("[LSP][%s] %s", client.name, err), vim.log.levels.WARN) - end - end -end - -return M diff --git a/.local/share/lunarvim/lvim/lua/lvim/plugin-loader.lua b/.local/share/lunarvim/lvim/lua/lvim/plugin-loader.lua deleted file mode 100644 index aa275da2..00000000 --- a/.local/share/lunarvim/lvim/lua/lvim/plugin-loader.lua +++ /dev/null @@ -1,166 +0,0 @@ -local plugin_loader = {} - -local utils = require "lvim.utils" -local Log = require "lvim.core.log" -local join_paths = utils.join_paths -local in_headless = #vim.api.nvim_list_uis() == 0 - --- we need to reuse this outside of init() -local compile_path = join_paths(get_config_dir(), "plugin", "packer_compiled.lua") -local snapshot_path = join_paths(get_cache_dir(), "snapshots") -local default_snapshot = join_paths(get_lvim_base_dir(), "snapshots", "default.json") - -function plugin_loader.init(opts) - opts = opts or {} - - local install_path = opts.install_path - or join_paths(vim.fn.stdpath "data", "site", "pack", "packer", "start", "packer.nvim") - - local init_opts = { - package_root = opts.package_root or join_paths(vim.fn.stdpath "data", "site", "pack"), - compile_path = compile_path, - snapshot_path = snapshot_path, - log = { level = "warn" }, - git = { - clone_timeout = 300, - }, - display = { - open_fn = function() - return require("packer.util").float { border = "rounded" } - end, - }, - } - - if in_headless then - init_opts.display = nil - end - - if not utils.is_directory(install_path) then - vim.fn.system { "git", "clone", "--depth", "1", "https://github.com/wbthomason/packer.nvim", install_path } - vim.cmd "packadd packer.nvim" - -- IMPORTANT: we only set this the very first time to avoid constantly triggering the rollback function - -- https://github.com/wbthomason/packer.nvim/blob/c576ab3f1488ee86d60fd340d01ade08dcabd256/lua/packer.lua#L998-L995 - init_opts.snapshot = default_snapshot - end - - local status_ok, packer = pcall(require, "packer") - if status_ok then - packer.on_complete = vim.schedule_wrap(function() - require("lvim.utils.hooks").run_on_packer_complete() - end) - packer.init(init_opts) - end -end - --- packer expects a space separated list -local function pcall_packer_command(cmd, kwargs) - local status_ok, msg = pcall(function() - require("packer")[cmd](unpack(kwargs or {})) - end) - if not status_ok then - Log:warn(cmd .. " failed with: " .. vim.inspect(msg)) - Log:trace(vim.inspect(vim.fn.eval "v:errmsg")) - end -end - -function plugin_loader.cache_clear() - if vim.fn.delete(compile_path) == 0 then - Log:debug "deleted packer_compiled.lua" - end -end - -function plugin_loader.recompile() - plugin_loader.cache_clear() - pcall_packer_command "compile" - if utils.is_file(compile_path) then - Log:debug "generated packer_compiled.lua" - end -end - -function plugin_loader.reload(configurations) - _G.packer_plugins = _G.packer_plugins or {} - for k, v in pairs(_G.packer_plugins) do - if k ~= "packer.nvim" then - _G.packer_plugins[v] = nil - end - end - plugin_loader.load(configurations) - - plugin_loader.ensure_plugins() -end - -function plugin_loader.load(configurations) - Log:debug "loading plugins configuration" - local packer_available, packer = pcall(require, "packer") - if not packer_available then - Log:warn "skipping loading plugins until Packer is installed" - return - end - local status_ok, _ = xpcall(function() - packer.reset() - packer.startup(function(use) - for _, plugins in ipairs(configurations) do - for _, plugin in ipairs(plugins) do - use(plugin) - end - end - end) - -- colorscheme must get called after plugins are loaded or it will break new installs. - vim.g.colors_name = lvim.colorscheme - vim.cmd("colorscheme " .. lvim.colorscheme) - end, debug.traceback) - if not status_ok then - Log:warn "problems detected while loading plugins' configurations" - Log:trace(debug.traceback()) - end -end - -function plugin_loader.get_core_plugins() - local list = {} - local plugins = require "lvim.plugins" - for _, item in pairs(plugins) do - if not item.disable then - table.insert(list, item[1]:match "/(%S*)") - end - end - return list -end - -function plugin_loader.load_snapshot(snapshot_file) - snapshot_file = snapshot_file or default_snapshot - if not in_headless then - vim.notify("Syncing core plugins is in progress..", vim.log.levels.INFO, { title = "lvim" }) - end - Log:debug(string.format("Using snapshot file [%s]", snapshot_file)) - local core_plugins = plugin_loader.get_core_plugins() - require("packer").rollback(snapshot_file, unpack(core_plugins)) -end - -function plugin_loader.sync_core_plugins() - -- problem: rollback() will get stuck if a plugin directory doesn't exist - -- solution: call sync() beforehand - -- see https://github.com/wbthomason/packer.nvim/issues/862 - vim.api.nvim_create_autocmd("User", { - pattern = "PackerComplete", - once = true, - callback = function() - require("lvim.plugin-loader").load_snapshot(default_snapshot) - end, - }) - pcall_packer_command "sync" -end - -function plugin_loader.ensure_plugins() - vim.api.nvim_create_autocmd("User", { - pattern = "PackerComplete", - once = true, - callback = function() - Log:debug "calling packer.clean()" - pcall_packer_command "clean" - end, - }) - Log:debug "calling packer.install()" - pcall_packer_command "install" -end - -return plugin_loader diff --git a/.local/share/lunarvim/lvim/lua/lvim/plugins.lua b/.local/share/lunarvim/lvim/lua/lvim/plugins.lua deleted file mode 100644 index dd40b967..00000000 --- a/.local/share/lunarvim/lvim/lua/lvim/plugins.lua +++ /dev/null @@ -1,265 +0,0 @@ -local core_plugins = { - -- Packer can manage itself as an optional plugin - { "wbthomason/packer.nvim" }, - { "neovim/nvim-lspconfig" }, - { "tamago324/nlsp-settings.nvim" }, - { - "jose-elias-alvarez/null-ls.nvim", - }, - { "antoinemadec/FixCursorHold.nvim" }, -- Needed while issue https://github.com/neovim/neovim/issues/12587 is still open - { - "williamboman/nvim-lsp-installer", - }, - { - "lunarvim/onedarker.nvim", - config = function() - pcall(function() - if lvim and lvim.colorscheme == "onedarker" then - require("onedarker").setup() - lvim.builtin.lualine.options.theme = "onedarker" - end - end) - end, - disable = lvim.colorscheme ~= "onedarker", - }, - { - "rcarriga/nvim-notify", - config = function() - require("lvim.core.notify").setup() - end, - requires = { "nvim-telescope/telescope.nvim" }, - disable = not lvim.builtin.notify.active or not lvim.builtin.telescope.active, - }, - { "Tastyep/structlog.nvim" }, - - { "nvim-lua/popup.nvim" }, - { "nvim-lua/plenary.nvim" }, - -- Telescope - { - "nvim-telescope/telescope.nvim", - config = function() - require("lvim.core.telescope").setup() - end, - disable = not lvim.builtin.telescope.active, - }, - { - "nvim-telescope/telescope-fzf-native.nvim", - requires = { "nvim-telescope/telescope.nvim" }, - run = "make", - disable = not lvim.builtin.telescope.active, - }, - -- Install nvim-cmp, and buffer source as a dependency - { - "hrsh7th/nvim-cmp", - config = function() - if lvim.builtin.cmp then - require("lvim.core.cmp").setup() - end - end, - requires = { - "L3MON4D3/LuaSnip", - }, - }, - { - "rafamadriz/friendly-snippets", - disable = not lvim.builtin.luasnip.sources.friendly_snippets, - }, - { - "L3MON4D3/LuaSnip", - config = function() - local utils = require "lvim.utils" - local paths = {} - if lvim.builtin.luasnip.sources.friendly_snippets then - paths[#paths + 1] = utils.join_paths(get_runtime_dir(), "site", "pack", "packer", "start", "friendly-snippets") - end - local user_snippets = utils.join_paths(get_config_dir(), "snippets") - if utils.is_directory(user_snippets) then - paths[#paths + 1] = user_snippets - end - require("luasnip.loaders.from_lua").lazy_load() - require("luasnip.loaders.from_vscode").lazy_load { - paths = paths, - } - require("luasnip.loaders.from_snipmate").lazy_load() - end, - }, - { - "hrsh7th/cmp-nvim-lsp", - }, - { - "saadparwaiz1/cmp_luasnip", - }, - { - "hrsh7th/cmp-buffer", - }, - { - "hrsh7th/cmp-path", - }, - { - -- NOTE: Temporary fix till folke comes back - "max397574/lua-dev.nvim", - module = "lua-dev", - }, - - -- Autopairs - { - "windwp/nvim-autopairs", - -- event = "InsertEnter", - config = function() - require("lvim.core.autopairs").setup() - end, - disable = not lvim.builtin.autopairs.active, - }, - - -- Treesitter - { - "nvim-treesitter/nvim-treesitter", - -- run = ":TSUpdate", - config = function() - require("lvim.core.treesitter").setup() - end, - }, - { - "JoosepAlviste/nvim-ts-context-commentstring", - event = "BufReadPost", - }, - - -- NvimTree - { - "kyazdani42/nvim-tree.lua", - -- event = "BufWinOpen", - -- cmd = "NvimTreeToggle", - config = function() - require("lvim.core.nvimtree").setup() - end, - disable = not lvim.builtin.nvimtree.active, - }, - - { - "lewis6991/gitsigns.nvim", - - config = function() - require("lvim.core.gitsigns").setup() - end, - event = "BufRead", - disable = not lvim.builtin.gitsigns.active, - }, - - -- Whichkey - { - "max397574/which-key.nvim", - config = function() - require("lvim.core.which-key").setup() - end, - event = "BufWinEnter", - disable = not lvim.builtin.which_key.active, - }, - - -- Comments - { - "numToStr/Comment.nvim", - event = "BufRead", - config = function() - require("lvim.core.comment").setup() - end, - disable = not lvim.builtin.comment.active, - }, - - -- project.nvim - { - "ahmedkhalf/project.nvim", - config = function() - require("lvim.core.project").setup() - end, - disable = not lvim.builtin.project.active, - }, - - -- Icons - { - "kyazdani42/nvim-web-devicons", - disable = not lvim.use_icons, - }, - - -- Status Line and Bufferline - { - -- "hoob3rt/lualine.nvim", - "nvim-lualine/lualine.nvim", - -- "Lunarvim/lualine.nvim", - config = function() - require("lvim.core.lualine").setup() - end, - disable = not lvim.builtin.lualine.active, - }, - - { - "akinsho/bufferline.nvim", - config = function() - require("lvim.core.bufferline").setup() - end, - branch = "main", - event = "BufWinEnter", - disable = not lvim.builtin.bufferline.active, - }, - - -- Debugging - { - "mfussenegger/nvim-dap", - -- event = "BufWinEnter", - config = function() - require("lvim.core.dap").setup() - end, - disable = not lvim.builtin.dap.active, - }, - - -- Debugger management - { - "Pocco81/dap-buddy.nvim", - branch = "dev", - -- event = "BufWinEnter", - -- event = "BufRead", - disable = not lvim.builtin.dap.active, - }, - - -- alpha - { - "goolord/alpha-nvim", - config = function() - require("lvim.core.alpha").setup() - end, - disable = not lvim.builtin.alpha.active, - }, - - -- Terminal - { - "akinsho/toggleterm.nvim", - event = "BufWinEnter", - branch = "main", - config = function() - require("lvim.core.terminal").setup() - end, - disable = not lvim.builtin.terminal.active, - }, - - -- SchemaStore - { - "b0o/schemastore.nvim", - }, -} - -local default_snapshot_path = join_paths(get_lvim_base_dir(), "snapshots", "default.json") -local content = vim.fn.readfile(default_snapshot_path) -local default_sha1 = vim.fn.json_decode(content) - -local get_default_sha1 = function(spec) - local short_name, _ = require("packer.util").get_plugin_short_name(spec) - return default_sha1[short_name] and default_sha1[short_name].commit -end - -for _, spec in ipairs(core_plugins) do - if not vim.env.LVIM_DEV_MODE then - -- Manually lock the commit hash since Packer's snapshots are unreliable in headless mode - spec["commit"] = get_default_sha1(spec) - end -end - -return core_plugins diff --git a/.local/share/lunarvim/lvim/lua/lvim/utils.lua b/.local/share/lunarvim/lvim/lua/lvim/utils.lua deleted file mode 100644 index 71ede6e6..00000000 --- a/.local/share/lunarvim/lvim/lua/lvim/utils.lua +++ /dev/null @@ -1,107 +0,0 @@ -local M = {} -local uv = vim.loop - --- recursive Print (structure, limit, separator) -local function r_inspect_settings(structure, limit, separator) - limit = limit or 100 -- default item limit - separator = separator or "." -- indent string - if limit < 1 then - print "ERROR: Item limit reached." - return limit - 1 - end - if structure == nil then - io.write("-- O", separator:sub(2), " = nil\n") - return limit - 1 - end - local ts = type(structure) - - if ts == "table" then - for k, v in pairs(structure) do - -- replace non alpha keys with ["key"] - if tostring(k):match "[^%a_]" then - k = '["' .. tostring(k) .. '"]' - end - limit = r_inspect_settings(v, limit, separator .. "." .. tostring(k)) - if limit < 0 then - break - end - end - return limit - end - - if ts == "string" then - -- escape sequences - structure = string.format("%q", structure) - end - separator = separator:gsub("%.%[", "%[") - if type(structure) == "function" then - -- don't print functions - io.write("-- lvim", separator:sub(2), " = function ()\n") - else - io.write("lvim", separator:sub(2), " = ", tostring(structure), "\n") - end - return limit - 1 -end - -function M.generate_settings() - -- Opens a file in append mode - local file = io.open("lv-settings.lua", "w") - - -- sets the default output file as test.lua - io.output(file) - - -- write all `lvim` related settings to `lv-settings.lua` file - r_inspect_settings(lvim, 10000, ".") - - -- closes the open file - io.close(file) -end - ---- Returns a table with the default values that are missing. ---- either parameter can be empty. ---@param config (table) table containing entries that take priority over defaults ---@param default_config (table) table contatining default values if found -function M.apply_defaults(config, default_config) - config = config or {} - default_config = default_config or {} - local new_config = vim.tbl_deep_extend("keep", vim.empty_dict(), config) - new_config = vim.tbl_deep_extend("keep", new_config, default_config) - return new_config -end - ---- Checks whether a given path exists and is a file. ---@param path (string) path to check ---@returns (bool) -function M.is_file(path) - local stat = uv.fs_stat(path) - return stat and stat.type == "file" or false -end - ---- Checks whether a given path exists and is a directory ---@param path (string) path to check ---@returns (bool) -function M.is_directory(path) - local stat = uv.fs_stat(path) - return stat and stat.type == "directory" or false -end - -M.join_paths = _G.join_paths - ----Write data to a file ----@param path string can be full or relative to `cwd` ----@param txt string|table text to be written, uses `vim.inspect` internally for tables ----@param flag string used to determine access mode, common flags: "w" for `overwrite` or "a" for `append` -function M.write_file(path, txt, flag) - local data = type(txt) == "string" and txt or vim.inspect(txt) - uv.fs_open(path, flag, 438, function(open_err, fd) - assert(not open_err, open_err) - uv.fs_write(fd, data, -1, function(write_err) - assert(not write_err, write_err) - uv.fs_close(fd, function(close_err) - assert(not close_err, close_err) - end) - end) - end) -end - -return M diff --git a/.local/share/lunarvim/lvim/lua/lvim/utils/functions.lua b/.local/share/lunarvim/lvim/lua/lvim/utils/functions.lua deleted file mode 100644 index de46bc8a..00000000 --- a/.local/share/lunarvim/lvim/lua/lvim/utils/functions.lua +++ /dev/null @@ -1,19 +0,0 @@ -local M = {} - -function M.smart_quit() - local bufnr = vim.api.nvim_get_current_buf() - local modified = vim.api.nvim_buf_get_option(bufnr, "modified") - if modified then - vim.ui.input({ - prompt = "You have unsaved changes. Quit anyway? (y/n) ", - }, function(input) - if input == "y" then - vim.cmd "q!" - end - end) - else - vim.cmd "q!" - end -end - -return M diff --git a/.local/share/lunarvim/lvim/lua/lvim/utils/git.lua b/.local/share/lunarvim/lvim/lua/lvim/utils/git.lua deleted file mode 100644 index 81b1faf4..00000000 --- a/.local/share/lunarvim/lvim/lua/lvim/utils/git.lua +++ /dev/null @@ -1,140 +0,0 @@ -local M = {} - -local Log = require "lvim.core.log" -local if_nil = vim.F.if_nil - -local function git_cmd(opts) - local plenary_loaded, Job = pcall(require, "plenary.job") - if not plenary_loaded then - return 1, { "" } - end - - opts = opts or {} - opts.cwd = opts.cwd or get_lvim_base_dir() - - local stderr = {} - local stdout, ret = Job - :new({ - command = "git", - args = opts.args, - cwd = opts.cwd, - on_stderr = function(_, data) - table.insert(stderr, data) - end, - }) - :sync() - - if not vim.tbl_isempty(stderr) then - Log:debug(stderr) - end - - if not vim.tbl_isempty(stdout) then - Log:debug(stdout) - end - - return ret, stdout -end - -local function safe_deep_fetch() - local ret, result = git_cmd { args = { "rev-parse", "--is-shallow-repository" } } - if ret ~= 0 then - Log:error "Git fetch failed! Check the log for further information" - return - end - -- git fetch --unshallow will cause an error on a a complete clone - local fetch_mode = result[1] == "true" and "--unshallow" or "--all" - ret = git_cmd { args = { "fetch", fetch_mode } } - if ret ~= 0 then - Log:error "Git fetch failed! Check the log for further information" - return - end - return true -end - ----pulls the latest changes from github -function M.update_base_lvim() - Log:info "Checking for updates" - - local ret = git_cmd { args = { "fetch" } } - if ret ~= 0 then - Log:error "Update failed! Check the log for further information" - return - end - - ret = git_cmd { args = { "diff", "--quiet", "@{upstream}" } } - if ret == 0 then - Log:info "LunarVim is already up-to-date" - return - end - - ret = git_cmd { args = { "merge", "--ff-only", "--progress" } } - if ret ~= 0 then - Log:error "Update failed! Please pull the changes manually instead." - return - end - - return true -end - ----Switch Lunarvim to the specified development branch ----@param branch string -function M.switch_lvim_branch(branch) - if not safe_deep_fetch() then - return - end - local args = { "switch", branch } - - if branch:match "^[0-9]" then - -- avoids producing an error for tags - vim.list_extend(args, { "--detach" }) - end - - local ret = git_cmd { args = args } - if ret ~= 0 then - Log:error "Unable to switch branches! Check the log for further information" - return - end - return true -end - ----Get the current Lunarvim development branch ----@return string|nil -function M.get_lvim_branch() - local _, results = git_cmd { args = { "rev-parse", "--abbrev-ref", "HEAD" } } - local branch = if_nil(results[1], "") - return branch -end - ----Get currently checked-out tag of Lunarvim ----@return string -function M.get_lvim_tag() - local args = { "describe", "--tags", "--abbrev=0" } - - local _, results = git_cmd { args = args } - local tag = if_nil(results[1], "") - return tag -end - ----Get currently running version of Lunarvim ----@return string -function M.get_lvim_version() - local current_branch = M.get_lvim_branch() - - local lvim_version - if current_branch ~= "HEAD" or "" then - lvim_version = current_branch .. "-" .. M.get_lvim_current_sha() - else - lvim_version = "v" .. M.get_lvim_tag() - end - return lvim_version -end - ----Get the commit hash of currently checked-out commit of Lunarvim ----@return string|nil -function M.get_lvim_current_sha() - local _, log_results = git_cmd { args = { "log", "--pretty=format:%h", "-1" } } - local abbrev_version = if_nil(log_results[1], "") - return abbrev_version -end - -return M diff --git a/.local/share/lunarvim/lvim/lua/lvim/utils/hooks.lua b/.local/share/lunarvim/lvim/lua/lvim/utils/hooks.lua deleted file mode 100644 index f15f6729..00000000 --- a/.local/share/lunarvim/lvim/lua/lvim/utils/hooks.lua +++ /dev/null @@ -1,87 +0,0 @@ -local M = {} - -local Log = require "lvim.core.log" -local in_headless = #vim.api.nvim_list_uis() == 0 - -function M.run_pre_update() - Log:debug "Starting pre-update hook" -end - -function M.run_pre_reload() - Log:debug "Starting pre-reload hook" -end - -function M.run_on_packer_complete() - Log:debug "Packer operation complete" - vim.api.nvim_exec_autocmds("User", { pattern = "PackerComplete" }) - - vim.g.colors_name = lvim.colorscheme - pcall(vim.cmd, "colorscheme " .. lvim.colorscheme) - - if M._reload_triggered then - Log:info "Reloaded configuration" - M._reload_triggered = nil - end -end - -function M.run_post_reload() - Log:debug "Starting post-reload hook" - M.reset_cache() - M._reload_triggered = true -end - ----Reset any startup cache files used by Packer and Impatient ----It also forces regenerating any template ftplugin files ----Tip: Useful for clearing any outdated settings -function M.reset_cache() - local impatient = _G.__luacache - if impatient then - impatient.clear_cache() - end - local lvim_modules = {} - for module, _ in pairs(package.loaded) do - if module:match "lvim.core" or module:match "lvim.lsp" then - package.loaded[module] = nil - table.insert(lvim_modules, module) - end - end - Log:trace(string.format("Cache invalidated for core modules: { %s }", table.concat(lvim_modules, ", "))) - require("lvim.lsp.templates").generate_templates() -end - -function M.run_post_update() - Log:debug "Starting post-update hook" - - if vim.fn.has "nvim-0.7" ~= 1 then - local compat_tag = "1.1.3" - vim.notify( - "Please upgrade your Neovim base installation. Newer version of Lunarvim requires v0.7+", - vim.log.levels.WARN - ) - vim.wait(1000, function() - return false - end) - local ret = require_clean("lvim.utils.git").switch_lvim_branch(compat_tag) - if ret then - vim.notify("Reverted to the last known compatibile version: " .. compat_tag, vim.log.levels.WARN) - end - return - end - - M.reset_cache() - - Log:debug "Syncing core plugins" - require("lvim.plugin-loader").sync_core_plugins() - - if not in_headless then - vim.schedule(function() - if package.loaded["nvim-treesitter"] then - vim.cmd [[ TSUpdateSync ]] - end - -- TODO: add a changelog - vim.notify("Update complete", vim.log.levels.INFO) - end) - end -end - -return M diff --git a/.local/share/lunarvim/lvim/lua/lvim/utils/table.lua b/.local/share/lunarvim/lvim/lua/lvim/utils/table.lua deleted file mode 100644 index 1ac5949e..00000000 --- a/.local/share/lunarvim/lvim/lua/lvim/utils/table.lua +++ /dev/null @@ -1,24 +0,0 @@ -local Table = {} - ---- Find the first entry for which the predicate returns true. --- @param t The table --- @param predicate The function called for each entry of t --- @return The entry for which the predicate returned True or nil -function Table.find_first(t, predicate) - for _, entry in pairs(t) do - if predicate(entry) then - return entry - end - end - return nil -end - ---- Check if the predicate returns True for at least one entry of the table. --- @param t The table --- @param predicate The function called for each entry of t --- @return True if predicate returned True at least once, false otherwise -function Table.contains(t, predicate) - return Table.find_first(t, predicate) ~= nil -end - -return Table diff --git a/.local/share/lunarvim/lvim/snapshots/default.json b/.local/share/lunarvim/lvim/snapshots/default.json deleted file mode 100644 index 533ff25e..00000000 --- a/.local/share/lunarvim/lvim/snapshots/default.json +++ /dev/null @@ -1,113 +0,0 @@ -{ - "Comment.nvim": { - "commit": "3c69bab" - }, - "FixCursorHold.nvim": { - "commit": "1bfb32e" - }, - "LuaSnip": { - "commit": "79b2019" - }, - "alpha-nvim": { - "commit": "ef27a59" - }, - "bufferline.nvim": { - "commit": "c78b3ec" - }, - "cmp-buffer": { - "commit": "12463cf" - }, - "cmp-nvim-lsp": { - "commit": "affe808" - }, - "cmp-path": { - "commit": "466b6b8" - }, - "cmp_luasnip": { - "commit": "a9de941" - }, - "dap-buddy.nvim": { - "commit": "bbda2b0" - }, - "friendly-snippets": { - "commit": "d27a83a" - }, - "gitsigns.nvim": { - "commit": "c18e016" - }, - "lua-dev.nvim": { - "commit": "54149d1" - }, - "lualine.nvim": { - "commit": "3362b28" - }, - "nlsp-settings.nvim": { - "commit": "62d72bc" - }, - "null-ls.nvim": { - "commit": "ff40739" - }, - "nvim-autopairs": { - "commit": "fa6876f" - }, - "nvim-cmp": { - "commit": "df6734a" - }, - "nvim-dap": { - "commit": "014ebd5" - }, - "nvim-lsp-installer": { - "commit": "2408a0f" - }, - "nvim-lspconfig": { - "commit": "10c3934" - }, - "nvim-notify": { - "commit": "8960269" - }, - "nvim-tree.lua": { - "commit": "bdb6d4a" - }, - "nvim-treesitter": { - "commit": "518e275" - }, - "nvim-ts-context-commentstring": { - "commit": "8834375" - }, - "nvim-web-devicons": { - "commit": "8d2c533" - }, - "onedarker.nvim": { - "commit": "b00dd21" - }, - "packer.nvim": { - "commit": "00ec5ad" - }, - "plenary.nvim": { - "commit": "968a4b9" - }, - "popup.nvim": { - "commit": "b7404d3" - }, - "project.nvim": { - "commit": "541115e" - }, - "schemastore.nvim": { - "commit": "a32911d" - }, - "structlog.nvim": { - "commit": "232a8e2" - }, - "telescope-fzf-native.nvim": { - "commit": "6a33ece" - }, - "telescope.nvim": { - "commit": "d96eaa9" - }, - "toggleterm.nvim": { - "commit": "aaeed9e" - }, - "which-key.nvim": { - "commit": "f03a259" - } -} diff --git a/.local/share/lunarvim/lvim/tests/lvim/helpers.lua b/.local/share/lunarvim/lvim/tests/lvim/helpers.lua deleted file mode 100644 index 2d8477de..00000000 --- a/.local/share/lunarvim/lvim/tests/lvim/helpers.lua +++ /dev/null @@ -1,48 +0,0 @@ -local M = {} - -function M.search_file(file, args) - local Job = require "plenary.job" - local stderr = {} - local stdout, ret = Job - :new({ - command = "grep", - args = { args, file }, - cwd = get_cache_dir(), - on_stderr = function(_, data) - table.insert(stderr, data) - end, - }) - :sync() - return ret, stdout, stderr -end - -function M.file_contains(file, query) - local ret, stdout, stderr = M.search_file(file, query) - if ret == 0 then - return true - end - if not vim.tbl_isempty(stderr) then - error(vim.inspect(stderr)) - end - if not vim.tbl_isempty(stdout) then - error(vim.inspect(stdout)) - end - return false -end - -function M.log_contains(query) - local logfile = require("lvim.core.log"):get_path() - local ret, stdout, stderr = M.search_file(logfile, query) - if ret == 0 then - return true - end - if not vim.tbl_isempty(stderr) then - error(vim.inspect(stderr)) - end - if not vim.tbl_isempty(stdout) then - error(vim.inspect(stdout)) - end - return false -end - -return M diff --git a/.local/share/lunarvim/lvim/tests/minimal_init.lua b/.local/share/lunarvim/lvim/tests/minimal_init.lua deleted file mode 100644 index 91579243..00000000 --- a/.local/share/lunarvim/lvim/tests/minimal_init.lua +++ /dev/null @@ -1,12 +0,0 @@ -local path_sep = vim.loop.os_uname().version:match "Windows" and "\\" or "/" -local base_dir = os.getenv "LUNARVIM_RUNTIME_DIR" .. path_sep .. "lvim" -local tests_dir = base_dir .. path_sep .. "tests" - -vim.opt.rtp:append(tests_dir) -vim.opt.rtp:append(base_dir) - -require("lvim.bootstrap"):init(base_dir) - --- NOTE: careful about name collisions --- see https://github.com/nvim-lualine/lualine.nvim/pull/621 -require "tests.lvim.helpers" diff --git a/.local/share/lunarvim/lvim/tests/minimal_lsp.lua b/.local/share/lunarvim/lvim/tests/minimal_lsp.lua deleted file mode 100644 index a610fd7f..00000000 --- a/.local/share/lunarvim/lvim/tests/minimal_lsp.lua +++ /dev/null @@ -1,114 +0,0 @@ -local on_windows = vim.loop.os_uname().version:match "Windows" - -local function join_paths(...) - local path_sep = on_windows and "\\" or "/" - local result = table.concat({ ... }, path_sep) - return result -end - -vim.cmd [[set runtimepath=$VIMRUNTIME]] - -local temp_dir = vim.loop.os_getenv "TEMP" or "/tmp" - -vim.cmd("set packpath=" .. join_paths(temp_dir, "nvim", "site")) - -local package_root = join_paths(temp_dir, "nvim", "site", "pack") -local install_path = join_paths(package_root, "packer", "start", "packer.nvim") -local compile_path = join_paths(install_path, "plugin", "packer_compiled.lua") - --- Choose whether to use the executable that's managed by lsp-installer -local use_lsp_installer = true - -local function load_plugins() - require("packer").startup { - { - "wbthomason/packer.nvim", - "neovim/nvim-lspconfig", - { "williamboman/nvim-lsp-installer", disable = not use_lsp_installer }, - }, - config = { - package_root = package_root, - compile_path = compile_path, - }, - } -end - -function _G.dump(...) - local objects = vim.tbl_map(vim.inspect, { ... }) - print(unpack(objects)) - return ... -end - -_G.load_config = function() - vim.lsp.set_log_level "trace" - require("vim.lsp.log").set_format_func(vim.inspect) - local nvim_lsp = require "lspconfig" - local on_attach = function(_, bufnr) - local function buf_set_keymap(...) - vim.api.nvim_buf_set_keymap(bufnr, ...) - end - local function buf_set_option(...) - vim.api.nvim_buf_set_option(bufnr, ...) - end - - buf_set_option("omnifunc", "v:lua.vim.lsp.omnifunc") - - -- Mappings. - local opts = { noremap = true, silent = true } - buf_set_keymap("n", "gD", "lua vim.lsp.buf.declaration()", opts) - buf_set_keymap("n", "gd", "lua vim.lsp.buf.definition()", opts) - buf_set_keymap("n", "K", "lua vim.lsp.buf.hover()", opts) - buf_set_keymap("n", "gi", "lua vim.lsp.buf.implementation()", opts) - buf_set_keymap("n", "", "lua vim.lsp.buf.signature_help()", opts) - buf_set_keymap("n", "wa", "lua vim.lsp.buf.add_workspace_folder()", opts) - buf_set_keymap("n", "wr", "lua vim.lsp.buf.remove_workspace_folder()", opts) - buf_set_keymap("n", "wl", "lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))", opts) - buf_set_keymap("n", "lD", "lua vim.lsp.buf.type_definition()", opts) - buf_set_keymap("n", "lr", "lua vim.lsp.buf.rename()", opts) - buf_set_keymap("n", "gr", "lua vim.lsp.buf.references()", opts) - buf_set_keymap("n", "gl", "lua vim.diagnostic.open_float(0,{scope='line'})", opts) - buf_set_keymap("n", "lk", "lua vim.diagnostic.goto_prev()", opts) - buf_set_keymap("n", "lj", "lua vim.diagnostic.goto_next()", opts) - buf_set_keymap("n", "lq", "lua vim.diagnostic.setloclist()", opts) - buf_set_keymap("n", "li", "LspInfo", opts) - buf_set_keymap("n", "lI", "LspInstallInfo", opts) - end - - -- Add the server that troubles you here, e.g. "clangd", "pyright", "tsserver" - local name = "sumneko_lua" - - local setup_opts = { - on_attach = on_attach, - } - - if use_lsp_installer then - local server_available, server = require("nvim-lsp-installer.servers").get_server(name) - if not server_available then - server:install() - end - local default_opts = server:get_default_options() - setup_opts = vim.tbl_deep_extend("force", setup_opts, default_opts) - end - - if not name then - print "You have not defined a server name, please edit minimal_init.lua" - end - if not nvim_lsp[name].document_config.default_config.cmd and not setup_opts.cmd then - print [[You have not defined a server default cmd for a server - that requires it please edit minimal_init.lua]] - end - - nvim_lsp[name].setup(setup_opts) - print [[You can find your log at $HOME/.cache/nvim/lsp.log. Please paste in a github issue under a details tag as described in the issue template.]] -end - -if vim.fn.isdirectory(install_path) == 0 then - vim.fn.system { "git", "clone", "https://github.com/wbthomason/packer.nvim", install_path } - load_plugins() - require("packer").sync() - vim.cmd [[autocmd User PackerComplete ++once lua load_config()]] -else - load_plugins() - require("packer").sync() - _G.load_config() -end diff --git a/.local/share/lunarvim/lvim/tests/specs/bootstrap_spec.lua b/.local/share/lunarvim/lvim/tests/specs/bootstrap_spec.lua deleted file mode 100644 index 9426a16c..00000000 --- a/.local/share/lunarvim/lvim/tests/specs/bootstrap_spec.lua +++ /dev/null @@ -1,42 +0,0 @@ -local a = require "plenary.async_lib.tests" -local uv = vim.loop -local home_dir = uv.os_homedir() - -a.describe("initial start", function() - local lvim_config_path = get_config_dir() - local lvim_runtime_path = get_runtime_dir() - local lvim_cache_path = get_cache_dir() - - a.it("should be able to detect test environment", function() - assert.truthy(os.getenv "LVIM_TEST_ENV") - assert.falsy(package.loaded["lvim.impatient"]) - end) - - a.it("should be able to use lunarvim cache directory using vim.fn", function() - assert.equal(lvim_cache_path, vim.fn.stdpath "cache") - end) - - a.it("should be to retrieve default neovim directories", function() - local xdg_config = os.getenv "XDG_CONFIG_HOME" or join_paths(home_dir, ".config") - assert.equal(join_paths(xdg_config, "nvim"), vim.call("stdpath", "config")) - end) - - a.it("should be able to read lunarvim directories", function() - local rtp_list = vim.opt.rtp:get() - assert.truthy(vim.tbl_contains(rtp_list, lvim_runtime_path .. "/lvim")) - assert.truthy(vim.tbl_contains(rtp_list, lvim_config_path)) - end) - - a.it("should be able to run treesitter without errors", function() - assert.truthy(vim.treesitter.highlighter.active) - end) - - a.it("should be able to pass basic checkhealth without errors", function() - vim.cmd "set cmdheight&" - vim.cmd "checkhealth nvim" - local errmsg = vim.fn.eval "v:errmsg" - local exception = vim.fn.eval "v:exception" - assert.equal("", errmsg) -- v:errmsg was not updated. - assert.equal("", exception) - end) -end) diff --git a/.local/share/lunarvim/lvim/tests/specs/config_loader_spec.lua b/.local/share/lunarvim/lvim/tests/specs/config_loader_spec.lua deleted file mode 100644 index 99053548..00000000 --- a/.local/share/lunarvim/lvim/tests/specs/config_loader_spec.lua +++ /dev/null @@ -1,55 +0,0 @@ -local a = require "plenary.async_lib.tests" -local config = require "lvim.config" -local fmt = string.format - -a.describe("config-loader", function() - local user_config_path = join_paths(get_config_dir(), "config.lua") - local default_config_path = join_paths(get_lvim_base_dir(), "utils", "installer", "config.example.lua") - - before_each(function() - os.execute(fmt("cp -f %s %s", default_config_path, user_config_path)) - vim.cmd [[ - let v:errmsg = "" - let v:errors = [] - ]] - end) - - after_each(function() - local errmsg = vim.fn.eval "v:errmsg" - local exception = vim.fn.eval "v:exception" - local errors = vim.fn.eval "v:errors" - assert.equal("", errmsg) - assert.equal("", exception) - assert.True(vim.tbl_isempty(errors)) - end) - - a.it("should be able to find user-config", function() - assert.equal(user_config_path, get_config_dir() .. "/config.lua") - end) - - a.it("should be able to load user-config without errors", function() - config:load(user_config_path) - end) - - a.it("should be able to reload user-config without errors", function() - config:load(user_config_path) - local test_path = "/tmp/lvim" - os.execute(string.format([[echo "vim.opt.undodir = '%s'" >> %s]], test_path, user_config_path)) - config:reload() - vim.schedule(function() - assert.equal(vim.opt.undodir:get()[1], test_path) - end) - end) - - a.it("should not get interrupted by errors in user-config", function() - local test_path = "/tmp/lunarvim" - os.execute(string.format([[echo "vim.opt.undodir = '%s'" >> %s]], test_path, user_config_path)) - config:load(user_config_path) - assert.equal(vim.opt.undodir:get()[1], test_path) - require("lvim.core.log"):set_level "error" - os.execute(string.format("echo 'invalid_function()' >> %s", user_config_path)) - config:load(user_config_path) - require("lvim.core.log"):set_level "error" - assert.equal(vim.opt.undodir:get()[1], test_path) - end) -end) diff --git a/.local/share/lunarvim/lvim/tests/specs/lsp_spec.lua b/.local/share/lunarvim/lvim/tests/specs/lsp_spec.lua deleted file mode 100644 index 7d9a3386..00000000 --- a/.local/share/lunarvim/lvim/tests/specs/lsp_spec.lua +++ /dev/null @@ -1,82 +0,0 @@ -local a = require "plenary.async_lib.tests" -local utils = require "lvim.utils" -local helpers = require "tests.lvim.helpers" -local spy = require "luassert.spy" - -a.describe("lsp workflow", function() - before_each(function() - vim.cmd [[ - let v:errmsg = "" - let v:errors = [] - ]] - end) - - after_each(function() - local errmsg = vim.fn.eval "v:errmsg" - local exception = vim.fn.eval "v:exception" - local errors = vim.fn.eval "v:errors" - assert.equal("", errmsg) - assert.equal("", exception) - assert.True(vim.tbl_isempty(errors)) - end) - - lvim.lsp.templates_dir = join_paths(get_cache_dir(), "artifacts") - - a.it("should be able to delete ftplugin templates", function() - if utils.is_directory(lvim.lsp.templates_dir) then - assert.equal(vim.fn.delete(lvim.lsp.templates_dir, "rf"), 0) - end - assert.False(utils.is_directory(lvim.lsp.templates_dir)) - end) - - a.it("should be able to generate ftplugin templates", function() - if utils.is_directory(lvim.lsp.templates_dir) then - assert.equal(vim.fn.delete(lvim.lsp.templates_dir, "rf"), 0) - end - - require("lvim.lsp").setup() - - assert.True(utils.is_directory(lvim.lsp.templates_dir)) - end) - - a.it("should not include blacklisted servers in the generated templates", function() - require("lvim.lsp").setup() - - for _, file in ipairs(vim.fn.glob(lvim.lsp.templates_dir .. "/*.lua", 1, 1)) do - for _, server_name in ipairs(lvim.lsp.override) do - local setup_cmd = string.format([[require("lvim.lsp.manager").setup(%q)]], server_name) - assert.False(helpers.file_contains(file, setup_cmd)) - end - end - end) - - a.it("should only include one server per generated template", function() - require("lvim.lsp").setup() - - for _, file in ipairs(vim.fn.glob(lvim.lsp.templates_dir .. "/*.lua", 1, 1)) do - local content = {} - for entry in io.lines(file) do - table.insert(content, entry) - end - local err_msg = "" - if #content > 1 then - err_msg = string.format( - "found more than one server for [%q]: \n{\n %q \n}", - file:match "[^/]*.lua$", - table.concat(content, ", ") - ) - end - assert.equal(err_msg, "") - end - end) - - a.it("should not attempt to re-generate ftplugin templates", function() - local s = spy.on(require "lvim.lsp.templates", "generate_templates") - local plugins = require "lvim.plugins" - require("lvim.plugin-loader").load { plugins, lvim.plugins } - - require("lvim.lsp").setup() - assert.spy(s).was_not_called() - s:revert() - end) -end) diff --git a/.local/share/lunarvim/lvim/tests/specs/plugins_load_spec.lua b/.local/share/lunarvim/lvim/tests/specs/plugins_load_spec.lua deleted file mode 100644 index 283d5547..00000000 --- a/.local/share/lunarvim/lvim/tests/specs/plugins_load_spec.lua +++ /dev/null @@ -1,74 +0,0 @@ -local a = require "plenary.async_lib.tests" - -a.describe("plugin-loader", function() - local plugins = require "lvim.plugins" - local loader = require "lvim.plugin-loader" - - pcall(function() - lvim.log.level = "debug" - package.loaded["packer.log"] = nil - package.loaded["lvim.core.log"] = nil - end) - - a.it("should be able to load default packages without errors", function() - loader.load { plugins, lvim.plugins } - - -- TODO: maybe there's a way to avoid hard-coding the names of the modules? - local startup_plugins = { - "packer", - } - - for _, plugin in ipairs(startup_plugins) do - assert.truthy(package.loaded[plugin]) - end - end) - - a.it("should be able to load lsp packages without errors", function() - loader.load { plugins, lvim.plugins } - - require("lvim.lsp").setup() - - local lsp_packages = { - "lspconfig", - "nlspsettings", - "null-ls", - } - - for _, plugin in ipairs(lsp_packages) do - assert.truthy(package.loaded[plugin]) - end - end) - - pending("should be able to rollback plugins without errors", function() - local plugin = { name = "onedarker.nvim" } - plugin.path = vim.tbl_filter(function(package) - return package:match(plugin.name) - end, vim.api.nvim_list_runtime_paths())[1] - - local get_current_sha = function(repo) - local res = vim.fn.system(string.format("git -C %s log -1 --pretty=%%h", repo)):gsub("\n", "") - return res - end - plugin.test_sha = "316b1c9" - _G.locked_sha = get_current_sha(plugin.path) - loader.load { plugins, lvim.plugins } - - os.execute(string.format("git -C %s fetch --deepen 999 --quiet", plugin.path)) - os.execute(string.format("git -C %s checkout %s --quiet", plugin.path, plugin.test_sha)) - assert.equal(plugin.test_sha, get_current_sha(plugin.path)) - _G.completed = false - _G.verify_sha = function() - if _G.locked_sha ~= get_current_sha(plugin.path) then - error "unmached results!" - else - _G.completed = true - end - end - vim.cmd [[autocmd User PackerComplete ++once lua _G.verify_sha()]] - loader.load_snapshot() - local ret = vim.wait(30 * 10 * 1000, function() - return _G.completed == true - end, 200) - assert.True(ret) - end) -end) diff --git a/.local/share/lunarvim/lvim/utils/bin/jdtls b/.local/share/lunarvim/lvim/utils/bin/jdtls deleted file mode 100755 index a8821580..00000000 --- a/.local/share/lunarvim/lvim/utils/bin/jdtls +++ /dev/null @@ -1,62 +0,0 @@ -#!/usr/bin/env bash - -# NOTE: -# This doesn't work as is on Windows. You'll need to create an equivalent `.bat` file instead -# -# NOTE: -# If you're not using Linux you'll need to adjust the `-configuration` option -# to point to the `config_mac' or `config_win` folders depending on your system. - -case Darwin in -Linux) - CONFIG="$HOME/.local/share/nvim/lsp_servers/jdtls/config_linux" - ;; -Darwin) - CONFIG="$HOME/.local/share/nvim/lsp_servers/jdtls/config_mac" - ;; -esac - -# Determine the Java command to use to start the JVM. -if [ -n "$JAVA_HOME" ]; then - if [ -x "$JAVA_HOME/jre/sh/java" ]; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" - else - JAVACMD="$JAVA_HOME/bin/java" - fi - if [ ! -x "$JAVACMD" ]; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -else - JAVACMD="java" - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi - -# JAR="$HOME/.config/nvim/.language-servers/eclipse.jdt.ls/org.eclipse.jdt.ls.product/target/repository/plugins/org.eclipse.equinox.launcher_*.jar" -JAR="$HOME/.local/share/nvim/lsp_servers/jdtls/plugins/org.eclipse.equinox.launcher_*.jar" -GRADLE_HOME=$HOME/gradle "$JAVACMD" \ - -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 \ - -javaagent:$HOME/.local/share/nvim/lsp_servers/jdtls/lombok.jar \ - -Xms1g \ - -Xmx2G \ - -jar $(echo "$JAR") \ - -configuration "$CONFIG" \ - -data "${1:-$HOME/workspace}" \ - --add-modules=ALL-SYSTEM \ - --add-opens java.base/java.util=ALL-UNNAMED \ - --add-opens java.base/java.lang=ALL-UNNAMED - -# for older java versions if you wanna use lombok -# -Xbootclasspath/a:/usr/local/share/lombok/lombok.jar \ - -# -javaagent:/usr/local/share/lombok/lombok.jar \ diff --git a/.local/share/lunarvim/lvim/utils/bin/lvim.ps1 b/.local/share/lunarvim/lvim/utils/bin/lvim.ps1 deleted file mode 100644 index 32723c18..00000000 --- a/.local/share/lunarvim/lvim/utils/bin/lvim.ps1 +++ /dev/null @@ -1,13 +0,0 @@ -#Requires -Version 7.1 -$ErrorActionPreference = "Stop" # exit when command fails - -$env:XDG_DATA_HOME = $env:XDG_DATA_HOME ?? $env:APPDATA -$env:XDG_CONFIG_HOME = $env:XDG_CONFIG_HOME ?? $env:LOCALAPPDATA -$env:XDG_CACHE_HOME = $env:XDG_CACHE_HOME ?? $env:TEMP - -$env:LUNARVIM_RUNTIME_DIR = $env:LUNARVIM_RUNTIME_DIR ?? "$env:XDG_DATA_HOME\lunarvim" -$env:LUNARVIM_CONFIG_DIR = $env:LUNARVIM_CONFIG_DIR ?? "$env:XDG_CONFIG_HOME\lvim" -$env:LUNARVIM_CACHE_DIR = $env:LUNARVIM_CACHE_DIR ?? "$env:XDG_CACHE_HOME\lvim" -$env:LUNARVIM_BASE_DIR = $env:LUNARVIM_BASE_DIR ?? "$env:LUNARVIM_RUNTIME_DIR\lvim" - -nvim -u "$env:LUNARVIM_RUNTIME_DIR\lvim\init.lua" @args diff --git a/.local/share/lunarvim/lvim/utils/bin/lvim.template b/.local/share/lunarvim/lvim/utils/bin/lvim.template deleted file mode 100644 index 1b18977d..00000000 --- a/.local/share/lunarvim/lvim/utils/bin/lvim.template +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh - -export LUNARVIM_RUNTIME_DIR="${LUNARVIM_RUNTIME_DIR:-RUNTIME_DIR_VAR}" -export LUNARVIM_CONFIG_DIR="${LUNARVIM_CONFIG_DIR:-CONFIG_DIR_VAR}" -export LUNARVIM_CACHE_DIR="${LUNARVIM_CACHE_DIR:-CACHE_DIR_VAR}" - -exec nvim -u "$LUNARVIM_RUNTIME_DIR/lvim/init.lua" "$@" diff --git a/.local/share/lunarvim/lvim/utils/ci/generate_new_lockfile.lua b/.local/share/lunarvim/lvim/utils/ci/generate_new_lockfile.lua deleted file mode 100644 index fd10775c..00000000 --- a/.local/share/lunarvim/lvim/utils/ci/generate_new_lockfile.lua +++ /dev/null @@ -1,115 +0,0 @@ -local sp = os.getenv "SNAPSHOT_PATH" - -local function call_proc(process, opts, cb) - local output, error_output = "", "" - local handle_stdout = function(err, chunk) - assert(not err, err) - if chunk then - output = output .. chunk - end - end - - local handle_stderr = function(err, chunk) - assert(not err, err) - if chunk then - error_output = error_output .. chunk - end - end - - local uv = vim.loop - local handle - - local stdout = uv.new_pipe(false) - local stderr = uv.new_pipe(false) - - local stdio = { nil, stdout, stderr } - - handle = uv.spawn( - process, - { args = opts.args, cwd = opts.cwd or uv.cwd(), stdio = stdio }, - vim.schedule_wrap(function(code) - if code ~= 0 then - stdout:read_stop() - stderr:read_stop() - end - - local check = uv.new_check() - check:start(function() - for _, pipe in ipairs(stdio) do - if pipe and not pipe:is_closing() then - return - end - end - check:stop() - handle:close() - cb(code, output, error_output) - end) - end) - ) - - uv.read_start(stdout, handle_stdout) - uv.read_start(stderr, handle_stderr) - - return handle -end - -local plugins_list = {} - -local completed = 0 - -local function write_lockfile(verbose) - local default_plugins = {} - local active_jobs = {} - - local core_plugins = require "lvim.plugins" - for _, plugin in pairs(core_plugins) do - local name = plugin[1]:match "/(%S*)" - local url = "https://github.com/" .. plugin[1] - local commit = "" - table.insert(default_plugins, { - name = name, - url = url, - commit = commit, - }) - end - - table.sort(default_plugins, function(a, b) - return a.name < b.name - end) - - for _, entry in pairs(default_plugins) do - local on_done = function(success, result, errors) - completed = completed + 1 - if not success then - print("error: " .. errors) - return - end - local latest_sha = result:gsub("\tHEAD\n", ""):sub(1, 7) - plugins_list[entry.name] = { - commit = latest_sha, - } - end - - local handle = call_proc("git", { args = { "ls-remote", entry.url, "HEAD" } }, on_done) - assert(handle) - table.insert(active_jobs, handle) - end - - print("active: " .. #active_jobs) - print("plugins: " .. #default_plugins) - - vim.wait(#active_jobs * 60 * 1000, function() - return completed == #active_jobs - end) - - if verbose then - print(vim.inspect(plugins_list)) - end - - local fd = assert(io.open(sp, "w")) - fd:write(vim.json.encode(plugins_list), "\n") - fd:flush() -end - -write_lockfile() -vim.cmd "q" diff --git a/.local/share/lunarvim/lvim/utils/ci/generate_new_lockfile.sh b/.local/share/lunarvim/lvim/utils/ci/generate_new_lockfile.sh deleted file mode 100644 index 077df41f..00000000 --- a/.local/share/lunarvim/lvim/utils/ci/generate_new_lockfile.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/bin/env bash -set -e - -REPO_DIR=$(git rev-parse --show-toplevel) - -export SNAPSHOT_NAME="default.json" -export SNAPSHOT_DIR="${REPO_DIR}/snapshots" - -mkdir -p "${SNAPSHOT_DIR}" - -export SNAPSHOT_PATH="${REPO_DIR}/snapshots/${SNAPSHOT_NAME}" - -time lvim --headless \ - -c "luafile ./utils/ci/generate_new_lockfile.lua" - -temp=$(mktemp) - -jq --sort-keys . "${SNAPSHOT_PATH}" >"${temp}" -mv "${temp}" "${SNAPSHOT_PATH}" diff --git a/.local/share/lunarvim/lvim/utils/ci/run_commitlint.sh b/.local/share/lunarvim/lvim/utils/ci/run_commitlint.sh deleted file mode 100644 index b752956d..00000000 --- a/.local/share/lunarvim/lvim/utils/ci/run_commitlint.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env bash -set -eo pipefail - -REPO_DIR="$(git rev-parse --show-toplevel)" -HELP_URL="https://github.com/LunarVim/LunarVim/blob/rolling/CONTRIBUTING.md#commit-messages" -CONFIG="$REPO_DIR/.github/workflows/commitlint.config.js" - -if ! npx commitlint --edit --verbose --help-url "$HELP_URL" --config "$CONFIG"; then - exit 1 -fi diff --git a/.local/share/lunarvim/lvim/utils/ci/run_test.sh b/.local/share/lunarvim/lvim/utils/ci/run_test.sh deleted file mode 100644 index b12ceb7e..00000000 --- a/.local/share/lunarvim/lvim/utils/ci/run_test.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/usr/bin/env bash -set -e - -export LUNARVIM_RUNTIME_DIR="${LUNARVIM_RUNTIME_DIR:-"$HOME/.local/share/lunarvim"}" - -export LVIM_TEST_ENV=true - -# we should start with an empty configuration -LUNARVIM_CONFIG_DIR="$(mktemp -d)" -LUNARVIM_CACHE_DIR="$(mktemp -d)" - -export LUNARVIM_CONFIG_DIR LUNARVIM_CACHE_DIR - -echo "cache: $LUNARVIM_CACHE_DIR - -config: $LUNARVIM_CONFIG_DIR" - -lvim() { - nvim -u "$LUNARVIM_RUNTIME_DIR/lvim/tests/minimal_init.lua" --cmd "set runtimepath+=$LUNARVIM_RUNTIME_DIR/lvim" "$@" -} - -if [ -n "$1" ]; then - lvim --headless -c "lua require('plenary.busted').run('$1')" -else - lvim --headless -c "PlenaryBustedDirectory tests/specs { minimal_init = './tests/minimal_init.lua' }" -fi diff --git a/.local/share/lunarvim/lvim/utils/ci/update_changelog.sh b/.local/share/lunarvim/lvim/utils/ci/update_changelog.sh deleted file mode 100644 index 49dae53a..00000000 --- a/.local/share/lunarvim/lvim/utils/ci/update_changelog.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/env bash -set -eo pipefail - -BRANCH="$(git rev-parse --abbrev-ref HEAD)" - -if [ "$BRANCH" != "master" ]; then - exit 0 -fi - -REPO_DIR="$(git rev-parse --show-toplevel)" -LATEST_TAG="$(git describe --tags --abbrev=0)" -CONFIG_FILE="$REPO_DIR/.github/workflows/cliff.toml" -CHANGELOG="$REPO_DIR/CHANGELOG.md" - -git -C "$REPO_DIR" cliff "$LATEST_TAG"..HEAD -u -c "$CONFIG_FILE" -p "$CHANGELOG" diff --git a/.local/share/lunarvim/lvim/utils/ci/verify_plugins.lua b/.local/share/lunarvim/lvim/utils/ci/verify_plugins.lua deleted file mode 100644 index c56d85d1..00000000 --- a/.local/share/lunarvim/lvim/utils/ci/verify_plugins.lua +++ /dev/null @@ -1,134 +0,0 @@ -local completed = 0 -local collection = {} -local active_jobs = {} - -local fmt = string.format -local core_plugins = require "lvim.plugins" - -local default_snapshot_path = join_paths(get_lvim_base_dir(), "snapshots", "default.json") -local fd = io.open(default_snapshot_path, "rb") -local content -if fd then - content = fd:read "*a" -end -local default_sha1 = vim.json.decode(content) - -local get_short_name = function(spec) - return spec[1]:match "/(%S*)" -end - -local get_default_sha1 = function(spec) - local short_name, _ = get_short_name(spec) - assert(default_sha1[short_name]) - return default_sha1[short_name].commit -end - -local is_directory = require("lvim.utils").is_directory --- see packer.init() -local packdir = join_paths(get_runtime_dir(), "site", "pack", "packer") -local packer_config = { opt_dir = join_paths(packdir, "opt"), start_dir = join_paths(packdir, "start") } -local is_optional = function(spec) - return spec.opt or spec.event or spec.cmd or spec.module -end -local get_install_path = function(spec) - local prefix = is_optional(spec) and packer_config.opt_dir or packer_config.start_dir - local path = join_paths(prefix, get_short_name(spec)) - assert(is_directory(path)) - return path -end - -local function call_proc(process, opts, cb) - local output, error_output = "", "" - local handle_stdout = function(err, chunk) - assert(not err, err) - if chunk then - output = output .. chunk - end - end - - local handle_stderr = function(err, chunk) - assert(not err, err) - if chunk then - error_output = error_output .. chunk - end - end - - local uv = vim.loop - local handle - - local stdout = uv.new_pipe(false) - local stderr = uv.new_pipe(false) - - local stdio = { nil, stdout, stderr } - - handle = uv.spawn( - process, - { args = opts.args, cwd = opts.cwd or uv.cwd(), stdio = stdio }, - vim.schedule_wrap(function(code) - if code ~= 0 then - stdout:read_stop() - stderr:read_stop() - end - - local check = uv.new_check() - check:start(function() - for _, pipe in ipairs(stdio) do - if pipe and not pipe:is_closing() then - return - end - end - check:stop() - handle:close() - cb(code, output, error_output) - end) - end) - ) - - uv.read_start(stdout, handle_stdout) - uv.read_start(stderr, handle_stderr) - - return handle -end - -local function verify_core_plugins(verbose) - for _, spec in pairs(core_plugins) do - if not spec.disable then - table.insert(collection, { - name = get_short_name(spec), - commit = get_default_sha1(spec), - path = get_install_path(spec), - }) - end - end - - for _, entry in pairs(collection) do - local on_done = function(code, result, errors) - completed = completed + 1 - if code ~= 0 then - io.write(errors .. "\n") - -- os.exit(code) - else - if verbose then - io.write(fmt("verified [%s]\n", entry.name)) - end - end - local current_commit = result:gsub("\n", ""):gsub([[']], [[]]) - -- just in case there are some extra qutoes or it's a longer commit hash - if current_commit ~= entry.commit then - io.write(fmt("mismatch at [%s]: expected [%s], got [%s]\n", entry.name, entry.commit, current_commit)) - os.exit(1) - end - end - - local handle = call_proc("git", { args = { "log", "--pretty='%h'", "-1" }, cwd = entry.path }, on_done) - assert(handle) - table.insert(active_jobs, handle) - end - - vim.wait(#active_jobs * 60 * 1000, function() - return completed == #active_jobs - end) -end - -verify_core_plugins() -vim.cmd "q" diff --git a/.local/share/lunarvim/lvim/utils/ci/verify_plugins.sh b/.local/share/lunarvim/lvim/utils/ci/verify_plugins.sh deleted file mode 100644 index 48ed12fe..00000000 --- a/.local/share/lunarvim/lvim/utils/ci/verify_plugins.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env bash -set -e - -BASEDIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)" -BASEDIR="$(dirname -- "$(dirname -- "$BASEDIR")")" - -LUNARVIM_BASE_DIR="${LUNARVIM_BASE_DIR:-"$BASEDIR"}" - -lvim --headless \ - -c "luafile ${LUNARVIM_BASE_DIR}/utils/ci/verify_plugins.lua" diff --git a/.local/share/lunarvim/lvim/utils/desktop/lvim.desktop b/.local/share/lunarvim/lvim/utils/desktop/lvim.desktop deleted file mode 100644 index f570cfae..00000000 --- a/.local/share/lunarvim/lvim/utils/desktop/lvim.desktop +++ /dev/null @@ -1,13 +0,0 @@ -[Desktop Entry] -Name=LunarVim -GenericName=Text Editor -Comment=An IDE layer for Neovim with sane defaults. Completely free and community driven. -TryExec=lvim -Exec=lvim %F -Terminal=true -Type=Application -Keywords=Text;editor; -Icon=nvim -Categories=Utility;TextEditor; -StartupNotify=false -MimeType=text/english;text/plain;text/x-makefile;text/x-c++hdr;text/x-c++src;text/x-chdr;text/x-csrc;text/x-java;text/x-moc;text/x-pascal;text/x-tcl;text/x-tex;application/x-shellscript;text/x-c;text/x-c++; diff --git a/.local/share/lunarvim/lvim/utils/docker/Dockerfile.local b/.local/share/lunarvim/lvim/utils/docker/Dockerfile.local deleted file mode 100644 index ed4a67f3..00000000 --- a/.local/share/lunarvim/lvim/utils/docker/Dockerfile.local +++ /dev/null @@ -1,27 +0,0 @@ -# To run this file execute: -# docker build -f -t Lunarvim:local - -FROM ubuntu:latest - -# Set environment correctly -ENV DEBIAN_FRONTEND=noninteractive -ENV PATH="/root/.local/bin:/root/.cargo/bin:/root/.npm-global/bin${PATH}" - -# Copy in local directory -COPY --chown=root:root . /LunarVim - -# Install dependencies and LunarVim -RUN apt update && \ - apt -y install sudo curl build-essential git fzf python3-dev python3-pip cargo && \ - curl -fsSL https://deb.nodesource.com/setup_16.x | bash - && \ - apt update && \ - apt -y install nodejs && \ - apt clean && rm -rf /var/lib/apt/lists/* /tmp/* && \ - /LunarVim/utils/installer/install-neovim-from-release && \ - /LunarVim/utils/installer/install.sh --local --no-install-dependencies - -# Setup LVIM to run on startup -ENTRYPOINT ["/bin/bash"] -CMD ["lvim"] - -# vim: ft=dockerfile: diff --git a/.local/share/lunarvim/lvim/utils/docker/Dockerfile.remote b/.local/share/lunarvim/lvim/utils/docker/Dockerfile.remote deleted file mode 100644 index 179a5a42..00000000 --- a/.local/share/lunarvim/lvim/utils/docker/Dockerfile.remote +++ /dev/null @@ -1,27 +0,0 @@ -# To run this file execute: -# docker build -f Dockerfile.remote . -t Lunarvim:remote - -FROM ubuntu:latest - -# Build argument to point to correct branch on GitHub -ARG LV_BRANCH=rolling - -# Set environment correctly -ENV DEBIAN_FRONTEND=noninteractive -ENV PATH="/root/.local/bin:/root/.cargo/bin:/root/.npm-global/bin${PATH}" - -# Install dependencies and LunarVim -RUN apt update && \ - apt -y install sudo curl build-essential git fzf python3-dev python3-pip cargo && \ - curl -fsSL https://deb.nodesource.com/setup_16.x | bash - && \ - apt update && \ - apt -y install nodejs && \ - apt clean && rm -rf /var/lib/apt/lists/* /tmp/* && \ - curl -LSs https://raw.githubusercontent.com/lunarvim/lunarvim/${LV_BRANCH}/utils/installer/install-neovim-from-release | bash && \ - LV_BRANCH=${LV_BRANCH} curl -LSs https://raw.githubusercontent.com/lunarvim/lunarvim/${LV_BRANCH}/utils/installer/install.sh | bash -s -- --no-install-dependencies - -# Setup LVIM to run on startup -ENTRYPOINT ["/bin/bash"] -CMD ["lvim"] - -# vim: ft=dockerfile: diff --git a/.local/share/lunarvim/lvim/utils/installer/config.example.lua b/.local/share/lunarvim/lvim/utils/installer/config.example.lua deleted file mode 100644 index 1bcff7f0..00000000 --- a/.local/share/lunarvim/lvim/utils/installer/config.example.lua +++ /dev/null @@ -1,167 +0,0 @@ ---[[ -lvim is the global options object - -Linters should be -filled in as strings with either -a global executable or a path to -an executable -]] --- THESE ARE EXAMPLE CONFIGS FEEL FREE TO CHANGE TO WHATEVER YOU WANT - --- general -lvim.log.level = "warn" -lvim.format_on_save = true -lvim.colorscheme = "onedarker" --- to disable icons and use a minimalist setup, uncomment the following --- lvim.use_icons = false - --- keymappings [view all the defaults by pressing Lk] -lvim.leader = "space" --- add your own keymapping -lvim.keys.normal_mode[""] = ":w" --- unmap a default keymapping --- vim.keymap.del("n", "") --- override a default keymapping --- lvim.keys.normal_mode[""] = ":q" -- or vim.keymap.set("n", "", ":q" ) - --- Change Telescope navigation to use j and k for navigation and n and p for history in both input and normal mode. --- we use protected-mode (pcall) just in case the plugin wasn't loaded yet. --- local _, actions = pcall(require, "telescope.actions") --- lvim.builtin.telescope.defaults.mappings = { --- -- for input mode --- i = { --- [""] = actions.move_selection_next, --- [""] = actions.move_selection_previous, --- [""] = actions.cycle_history_next, --- [""] = actions.cycle_history_prev, --- }, --- -- for normal mode --- n = { --- [""] = actions.move_selection_next, --- [""] = actions.move_selection_previous, --- }, --- } - --- Use which-key to add extra bindings with the leader-key prefix --- lvim.builtin.which_key.mappings["P"] = { "Telescope projects", "Projects" } --- lvim.builtin.which_key.mappings["t"] = { --- name = "+Trouble", --- r = { "Trouble lsp_references", "References" }, --- f = { "Trouble lsp_definitions", "Definitions" }, --- d = { "Trouble document_diagnostics", "Diagnostics" }, --- q = { "Trouble quickfix", "QuickFix" }, --- l = { "Trouble loclist", "LocationList" }, --- w = { "Trouble workspace_diagnostics", "Wordspace Diagnostics" }, --- } - --- TODO: User Config for predefined plugins --- After changing plugin config exit and reopen LunarVim, Run :PackerInstall :PackerCompile -lvim.builtin.alpha.active = true -lvim.builtin.alpha.mode = "dashboard" -lvim.builtin.notify.active = true -lvim.builtin.terminal.active = true -lvim.builtin.nvimtree.setup.view.side = "left" -lvim.builtin.nvimtree.setup.renderer.icons.show.git = false - --- if you don't want all the parsers change this to a table of the ones you want -lvim.builtin.treesitter.ensure_installed = { - "bash", - "c", - "javascript", - "json", - "lua", - "python", - "typescript", - "tsx", - "css", - "rust", - "java", - "yaml", -} - -lvim.builtin.treesitter.ignore_install = { "haskell" } -lvim.builtin.treesitter.highlight.enabled = true - --- generic LSP settings - --- ---@usage disable automatic installation of servers --- lvim.lsp.automatic_servers_installation = false - --- ---configure a server manually. !!Requires `:LvimCacheReset` to take effect!! --- ---see the full default list `:lua print(vim.inspect(lvim.lsp.automatic_configuration.skipped_servers))` --- vim.list_extend(lvim.lsp.automatic_configuration.skipped_servers, { "pyright" }) --- local opts = {} -- check the lspconfig documentation for a list of all possible options --- require("lvim.lsp.manager").setup("pyright", opts) - --- ---remove a server from the skipped list, e.g. eslint, or emmet_ls. !!Requires `:LvimCacheReset` to take effect!! --- ---`:LvimInfo` lists which server(s) are skiipped for the current filetype --- vim.tbl_map(function(server) --- return server ~= "emmet_ls" --- end, lvim.lsp.automatic_configuration.skipped_servers) - --- -- you can set a custom on_attach function that will be used for all the language servers --- -- See --- lvim.lsp.on_attach_callback = function(client, bufnr) --- local function buf_set_option(...) --- vim.api.nvim_buf_set_option(bufnr, ...) --- end --- --Enable completion triggered by --- buf_set_option("omnifunc", "v:lua.vim.lsp.omnifunc") --- end - --- -- set a formatter, this will override the language server formatting capabilities (if it exists) --- local formatters = require "lvim.lsp.null-ls.formatters" --- formatters.setup { --- { command = "black", filetypes = { "python" } }, --- { command = "isort", filetypes = { "python" } }, --- { --- -- each formatter accepts a list of options identical to https://github.com/jose-elias-alvarez/null-ls.nvim/blob/main/doc/BUILTINS.md#Configuration --- command = "prettier", --- ---@usage arguments to pass to the formatter --- -- these cannot contain whitespaces, options such as `--line-width 80` become either `{'--line-width', '80'}` or `{'--line-width=80'}` --- extra_args = { "--print-with", "100" }, --- ---@usage specify which filetypes to enable. By default a providers will attach to all the filetypes it supports. --- filetypes = { "typescript", "typescriptreact" }, --- }, --- } - --- -- set additional linters --- local linters = require "lvim.lsp.null-ls.linters" --- linters.setup { --- { command = "flake8", filetypes = { "python" } }, --- { --- -- each linter accepts a list of options identical to https://github.com/jose-elias-alvarez/null-ls.nvim/blob/main/doc/BUILTINS.md#Configuration --- command = "shellcheck", --- ---@usage arguments to pass to the formatter --- -- these cannot contain whitespaces, options such as `--line-width 80` become either `{'--line-width', '80'}` or `{'--line-width=80'}` --- extra_args = { "--severity", "warning" }, --- }, --- { --- command = "codespell", --- ---@usage specify which filetypes to enable. By default a providers will attach to all the filetypes it supports. --- filetypes = { "javascript", "python" }, --- }, --- } - --- Additional Plugins --- lvim.plugins = { --- {"folke/tokyonight.nvim"}, --- { --- "folke/trouble.nvim", --- cmd = "TroubleToggle", --- }, --- } - --- Autocommands (https://neovim.io/doc/user/autocmd.html) --- vim.api.nvim_create_autocmd("BufEnter", { --- pattern = { "*.json", "*.jsonc" }, --- -- enable wrap mode for json files only --- command = "setlocal wrap", --- }) --- vim.api.nvim_create_autocmd("FileType", { --- pattern = "zsh", --- callback = function() --- -- let treesitter use bash highlight for zsh files as well --- require("nvim-treesitter.highlight").attach(0, "bash") --- end, --- }) diff --git a/.local/share/lunarvim/lvim/utils/installer/config_win.example.lua b/.local/share/lunarvim/lvim/utils/installer/config_win.example.lua deleted file mode 100644 index 011ca0da..00000000 --- a/.local/share/lunarvim/lvim/utils/installer/config_win.example.lua +++ /dev/null @@ -1,182 +0,0 @@ ---[[ - THESE ARE EXAMPLE CONFIGS FEEL FREE TO CHANGE TO WHATEVER YOU WANT - `lvim` is the global options object -]] - --- Enable powershell as your default shell -vim.opt.shell = "pwsh.exe -NoLogo" -vim.opt.shellcmdflag = - "-NoLogo -NoProfile -ExecutionPolicy RemoteSigned -Command [Console]::InputEncoding=[Console]::OutputEncoding=[System.Text.Encoding]::UTF8;" -vim.cmd [[ - let &shellredir = '2>&1 | Out-File -Encoding UTF8 %s; exit $LastExitCode' - let &shellpipe = '2>&1 | Out-File -Encoding UTF8 %s; exit $LastExitCode' - set shellquote= shellxquote= - ]] - --- Set a compatible clipboard manager -vim.g.clipboard = { - copy = { - ["+"] = "win32yank.exe -i --crlf", - ["*"] = "win32yank.exe -i --crlf", - }, - paste = { - ["+"] = "win32yank.exe -o --lf", - ["*"] = "win32yank.exe -o --lf", - }, -} - --- general -lvim.log.level = "warn" -lvim.format_on_save = true -lvim.colorscheme = "onedarker" --- to disable icons and use a minimalist setup, uncomment the following --- lvim.use_icons = false - --- keymappings [view all the defaults by pressing Lk] -lvim.leader = "space" --- add your own keymapping -lvim.keys.normal_mode[""] = ":w" --- unmap a default keymapping --- vim.keymap.del("n", "") --- override a default keymapping --- lvim.keys.normal_mode[""] = ":q" -- or vim.keymap.set("n", "", ":q" ) - --- Change Telescope navigation to use j and k for navigation and n and p for history in both input and normal mode. --- we use protected-mode (pcall) just in case the plugin wasn't loaded yet. --- local _, actions = pcall(require, "telescope.actions") --- lvim.builtin.telescope.defaults.mappings = { --- -- for input mode --- i = { --- [""] = actions.move_selection_next, --- [""] = actions.move_selection_previous, --- [""] = actions.cycle_history_next, --- [""] = actions.cycle_history_prev, --- }, --- -- for normal mode --- n = { --- [""] = actions.move_selection_next, --- [""] = actions.move_selection_previous, --- }, --- } - --- Use which-key to add extra bindings with the leader-key prefix --- lvim.builtin.which_key.mappings["P"] = { "Telescope projects", "Projects" } --- lvim.builtin.which_key.mappings["t"] = { --- name = "+Trouble", --- r = { "Trouble lsp_references", "References" }, --- f = { "Trouble lsp_definitions", "Definitions" }, --- d = { "Trouble document_diagnostics", "Diagnostics" }, --- q = { "Trouble quickfix", "QuickFix" }, --- l = { "Trouble loclist", "LocationList" }, --- w = { "Trouble workspace_diagnostics", "Workspace Diagnostics" }, --- } - --- After changing plugin config exit and reopen LunarVim, Run :PackerInstall :PackerCompile -lvim.builtin.alpha.active = true -lvim.builtin.alpha.mode = "dashboard" -lvim.builtin.notify.active = true -lvim.builtin.terminal.active = false --- lvim.builtin.terminal.shell = "pwsh.exe -NoLogo" - --- nvim-tree has some performance issues on windows, see kyazdani42/nvim-tree.lua#549 -lvim.builtin.nvimtree.setup.diagnostics.enable = false -lvim.builtin.nvimtree.setup.filters.custom = false -lvim.builtin.nvimtree.setup.git.enable = false -lvim.builtin.nvimtree.setup.update_cwd = false -lvim.builtin.nvimtree.setup.update_focused_file.update_cwd = false -lvim.builtin.nvimtree.setup.view.side = "left" -lvim.builtin.nvimtree.setup.renderer.highlight_git = false -lvim.builtin.nvimtree.setup.renderer.icons.show.git = false - --- if you don't want all the parsers change this to a table of the ones you want -lvim.builtin.treesitter.ensure_installed = { - "c", - "lua", -} - -lvim.builtin.treesitter.ignore_install = { "haskell" } -lvim.builtin.treesitter.highlight.enabled = true - --- generic LSP settings - --- ---@usage disable automatic installation of servers --- lvim.lsp.automatic_servers_installation = false - --- ---configure a server manually. !!Requires `:LvimCacheReset` to take effect!! --- ---see the full default list `:lua print(vim.inspect(lvim.lsp.automatic_configuration.skipped_servers))` --- vim.list_extend(lvim.lsp.automatic_configuration.skipped_servers, { "pyright" }) --- local opts = {} -- check the lspconfig documentation for a list of all possible options --- require("lvim.lsp.manager").setup("pyright", opts) - --- ---remove a server from the skipped list, e.g. eslint, or emmet_ls. !!Requires `:LvimCacheReset` to take effect!! --- ---`:LvimInfo` lists which server(s) are skiipped for the current filetype --- vim.tbl_map(function(server) --- return server ~= "emmet_ls" --- end, lvim.lsp.automatic_configuration.skipped_servers) - --- -- you can set a custom on_attach function that will be used for all the language servers --- -- See --- lvim.lsp.on_attach_callback = function(client, bufnr) --- local function buf_set_option(...) --- vim.api.nvim_buf_set_option(bufnr, ...) --- end --- --Enable completion triggered by --- buf_set_option("omnifunc", "v:lua.vim.lsp.omnifunc") --- end - --- -- set a formatter, this will override the language server formatting capabilities (if it exists) --- local formatters = require "lvim.lsp.null-ls.formatters" --- formatters.setup { --- { command = "black", filetypes = { "python" } }, --- { command = "isort", filetypes = { "python" } }, --- { --- -- each formatter accepts a list of options identical to https://github.com/jose-elias-alvarez/null-ls.nvim/blob/main/doc/BUILTINS.md#Configuration --- command = "prettier", --- ---@usage arguments to pass to the formatter --- -- these cannot contain whitespaces, options such as `--line-width 80` become either `{'--line-width', '80'}` or `{'--line-width=80'}` --- extra_args = { "--print-with", "100" }, --- ---@usage specify which filetypes to enable. By default a providers will attach to all the filetypes it supports. --- filetypes = { "typescript", "typescriptreact" }, --- }, --- } - --- -- set additional linters --- local linters = require "lvim.lsp.null-ls.linters" --- linters.setup { --- { command = "flake8", filetypes = { "python" } }, --- { --- -- each linter accepts a list of options identical to https://github.com/jose-elias-alvarez/null-ls.nvim/blob/main/doc/BUILTINS.md#Configuration --- command = "shellcheck", --- ---@usage arguments to pass to the formatter --- -- these cannot contain whitespaces, options such as `--line-width 80` become either `{'--line-width', '80'}` or `{'--line-width=80'}` --- extra_args = { "--severity", "warning" }, --- }, --- { --- command = "codespell", --- ---@usage specify which filetypes to enable. By default a providers will attach to all the filetypes it supports. --- filetypes = { "javascript", "python" }, --- }, --- } - --- Additional Plugins --- lvim.plugins = { --- {"folke/tokyonight.nvim"}, --- { --- "folke/trouble.nvim", --- cmd = "TroubleToggle", --- }, --- } - --- Autocommands (https://neovim.io/doc/user/autocmd.html) --- vim.api.nvim_create_autocmd("BufEnter", { --- pattern = { "*.json", "*.jsonc" }, --- -- enable wrap mode for json files only --- command = "setlocal wrap", --- }) --- vim.api.nvim_create_autocmd("FileType", { --- pattern = "zsh", --- callback = function() --- -- let treesitter use bash highlight for zsh files as well --- require("nvim-treesitter.highlight").attach(0, "bash") --- end, --- }) diff --git a/.local/share/lunarvim/lvim/utils/installer/install-neovim-from-release b/.local/share/lunarvim/lvim/utils/installer/install-neovim-from-release deleted file mode 100755 index 08f27149..00000000 --- a/.local/share/lunarvim/lvim/utils/installer/install-neovim-from-release +++ /dev/null @@ -1,87 +0,0 @@ -#!/usr/bin/env bash - -set -eu pipefall - -declare -r LV_INSTALL_PREFIX="${INSTALL_PREFIX:-"$HOME/.local"}" -declare -r RELEASE_VER="${RELEASE_VER:-latest}" # can be set to nightly - -declare ARCHIVE_NAME -declare RELEASE_NAME -declare OS - -OS="$(uname -s)" - -if [ "$OS" == "Linux" ]; then - ARCHIVE_NAME="nvim-linux64" - RELEASE_NAME="nvim-linux64" -elif [ "$OS" == "Darwin" ]; then - ARCHIVE_NAME="nvim-macos" - # for some reason the archive has a different name - RELEASE_NAME="nvim-osx64" -else - echo "$OS platform is not supported currently" - exit 1 -fi - -if [[ "${RELEASE_VER}" == "latest" ]]; then - declare -r RELEASE_URL="https://github.com/neovim/neovim/releases/${RELEASE_VER}/download/${ARCHIVE_NAME}.tar.gz" -else - declare -r RELEASE_URL="https://github.com/neovim/neovim/releases/download/${RELEASE_VER}/${ARCHIVE_NAME}.tar.gz" -fi -declare -r CHECKSUM_URL="$RELEASE_URL.sha256sum" - -DOWNLOAD_DIR="$(mktemp -d)" -readonly DOWNLOAD_DIR - -RELEASE_SHA="$(curl -Ls "$CHECKSUM_URL" | awk '{print $1}')" -readonly RELEASE_SHA - -function main() { - if [ ! -d "$LV_INSTALL_PREFIX" ]; then - mkdir -p "$LV_INSTALL_PREFIX" || __invalid__prefix__handler - fi - download_neovim - verify_neovim - install_neovim -} - -function download_neovim() { - echo "Downloading Neovim's binary from $RELEASE_VER release.." - if ! curl --progress-bar --fail -L "$RELEASE_URL" -o "$DOWNLOAD_DIR/$ARCHIVE_NAME.tar.gz"; then - echo "Download failed. Check that the release/filename are correct." - exit 1 - fi - echo "Download complete!" -} - -function verify_neovim() { - echo "Verifying the installation.." - DOWNLOADED_SHA="$(openssl dgst -sha256 "$DOWNLOAD_DIR/$ARCHIVE_NAME.tar.gz" | awk '{print $2}')" - - if [ "$RELEASE_SHA" != "$DOWNLOADED_SHA" ]; then - echo "Error! checksum mismatch." - echo "Expected: $RELEASE_SHA but got: $DOWNLOADED_SHA" - exit 1 - fi - echo "Verification complete!" -} - -function install_neovim() { - - echo "Installing Neovim.." - pushd "$DOWNLOAD_DIR" - tar -xzf "$DOWNLOAD_DIR/$ARCHIVE_NAME.tar.gz" - popd - # https://dev.to/ackshaey/macos-vs-linux-the-cp-command-will-trip-you-up-2p00 - cp -r "$DOWNLOAD_DIR/$RELEASE_NAME/." "$LV_INSTALL_PREFIX" - echo "Installation complete!" - echo "Now you can run $LV_INSTALL_PREFIX/bin/nvim" -} - -function __invalid__prefix__handler() { - echo "Error! Invalid value for LV_INSTALL_PREFIX: [$INSTALL_PREFIX]" - echo "Please verify that the folder exists and re-run the installer!" - exit 1 -} - -main "$@" diff --git a/.local/share/lunarvim/lvim/utils/installer/install.ps1 b/.local/share/lunarvim/lvim/utils/installer/install.ps1 deleted file mode 100644 index 31f862f3..00000000 --- a/.local/share/lunarvim/lvim/utils/installer/install.ps1 +++ /dev/null @@ -1,290 +0,0 @@ -#Requires -Version 7.1 -$ErrorActionPreference = "Stop" # exit when command fails - -# set script variables -$LV_BRANCH = $LV_BRANCH ?? "rolling" -$LV_REMOTE = $LV_REMOTE ?? "lunarvim/lunarvim.git" -$INSTALL_PREFIX = $INSTALL_PREFIX ?? "$HOME\.local" - -$env:XDG_DATA_HOME = $env:XDG_DATA_HOME ?? $env:APPDATA -$env:XDG_CONFIG_HOME = $env:XDG_CONFIG_HOME ?? $env:LOCALAPPDATA -$env:XDG_CACHE_HOME = $env:XDG_CACHE_HOME ?? $env:TEMP - -$env:LUNARVIM_RUNTIME_DIR = $env:LUNARVIM_RUNTIME_DIR ?? "$env:XDG_DATA_HOME\lunarvim" -$env:LUNARVIM_CONFIG_DIR = $env:LUNARVIM_CONFIG_DIR ?? "$env:XDG_CONFIG_HOME\lvim" -$env:LUNARVIM_CACHE_DIR = $env:LUNARVIM_CACHE_DIR ?? "$env:XDG_CACHE_HOME\lvim" -$env:LUNARVIM_BASE_DIR = $env:LUNARVIM_BASE_DIR ?? "$env:LUNARVIM_RUNTIME_DIR\lvim" - -$__lvim_dirs = ( - $env:LUNARVIM_BASE_DIR, - $env:LUNARVIM_RUNTIME_DIR, - $env:LUNARVIM_CONFIG_DIR, - $env:LUNARVIM_CACHE_DIR -) - -function __add_separator($div_width) { - "-" * $div_width - Write-Output "" -} - -function msg($text){ - Write-Output $text - __add_separator "80" -} - -function main($cliargs) { - - print_logo - - verify_lvim_dirs - - if ($cliargs.Contains("--overwrite")) { - Write-Output "!!Warning!! -> Removing all lunarvim related config because of the --overwrite flag" - $answer = Read-Host "Would you like to continue? [y]es or [n]o " - if ("$answer" -ne "y" -and "$answer" -ne "Y") { - exit 1 - } - uninstall_lvim - } - if ($cliargs.Contains("--local") -or $cliargs.Contains("--testing")) { - msg "Using local LunarVim installation" - local_install - exit - } - - msg "Checking dependencies.." - check_system_deps - - $answer = Read-Host "Would you like to check lunarvim's NodeJS dependencies? [y]es or [n]o (default: no) " - if ("$answer" -eq "y" -or "$answer" -eq "Y") { - install_nodejs_deps - } - - $answer = Read-Host "Would you like to check lunarvim's Python dependencies? [y]es or [n]o (default: no) " - if ("$answer" -eq "y" -or "$answer" -eq "Y") { - install_python_deps - } - - - if (Test-Path "$env:LUNARVIM_BASE_DIR\init.lua" ) { - msg "Updating LunarVim" - validate_lunarvim_files - } - else { - msg "Cloning Lunarvim" - clone_lvim - setup_lvim - } -} - -function print_missing_dep_msg($dep) { - Write-Output "[ERROR]: Unable to find dependency [$dep]" - Write-Output "Please install it first and re-run the installer." -} - -$winget_package_matrix=@{"git" = "Git.Git"; "nvim" = "Neovim.Neovim"; "make" = "GnuWin32.Make"; "node" = "OpenJS.NodeJS"; "pip" = "Python.Python.3"} -$scoop_package_matrix=@{"git" = "git"; "nvim" = "neovim-nightly"; "make" = "make"; "node" = "nodejs"; "pip" = "python3"} - -function install_system_package($dep) { - if (Get-Command -Name "winget" -ErrorAction SilentlyContinue) { - Write-Output "Attempting to install dependency [$dep] with winget" - $install_cmd = "winget install --interactive $winget_package_matrix[$dep]" - } - elseif (Get-Command -Name "scoop" -ErrorAction SilentlyContinue) { - Write-Output "Attempting to install dependency [$dep] with scoop" - # TODO: check if it's fine to not run it with --global - $install_cmd = "scoop install $scoop_package_matrix[$dep]" - } - else { - print_missing_dep_msg "$dep" - exit 1 - } - - try { - Invoke-Command $install_cmd -ErrorAction Stop - } - catch { - print_missing_dep_msg "$dep" - exit 1 - } -} - -function check_system_dep($dep) { - try { - Get-Command -Name $dep -ErrorAction Stop | Out-Null - } - catch { - install_system_package "$dep" - } -} - -function check_system_deps() { - check_system_dep "git" - check_system_dep "nvim" - check_system_dep "make" -} - -function install_nodejs_deps() { - $dep = "node" - try { - check_system_dep "$dep" - Invoke-Command -ScriptBlock { npm install --global neovim tree-sitter-cli } -ErrorAction Break - } - catch { - print_missing_dep_msg "$dep" - } -} - -function install_python_deps() { - $dep = "pip" - try { - check_system_dep "$dep" - Invoke-Command -ScriptBlock { python -m pip install --user pynvim } -ErrorAction Break - } - catch { - print_missing_dep_msg "$dep" - } -} - -function backup_old_config() { - $src = "$env:LUNARVIM_CONFIG_DIR" - if (Test-Path $src) { - New-Item "$src.old" -ItemType Directory -Force | Out-Null - Copy-Item -Force -Recurse "$src\*" "$src.old\." | Out-Null - } - msg "Backup operation complete" -} - - -function local_install() { - verify_lvim_dirs - $repoDir = git rev-parse --show-toplevel - $gitLocalCloneCmd = git clone --progress "$repoDir" "$env:LUNARVIM_BASE_DIR" - Invoke-Command -ErrorAction Stop -ScriptBlock { $gitLocalCloneCmd; setup_lvim } -} - -function clone_lvim() { - try { - $gitCloneCmd = git clone --progress --depth 1 --branch "$LV_BRANCH" ` - "https://github.com/$LV_REMOTE" ` - "$env:LUNARVIM_BASE_DIR" - Invoke-Command -ErrorAction Stop -ScriptBlock { $gitCloneCmd } - } - catch { - msg "Failed to clone repository. Installation failed." - exit 1 - } -} - -function setup_shim() { - if ((Test-Path "$INSTALL_PREFIX\bin") -eq $false) { - New-Item "$INSTALL_PREFIX\bin" -ItemType Directory | Out-Null - } - - Copy-Item -Force "$env:LUNARVIM_BASE_DIR\utils\bin\lvim.ps1" "$INSTALL_PREFIX\bin\lvim.ps1" -} - -function uninstall_lvim() { - foreach ($dir in $__lvim_dirs) { - if (Test-Path "$dir") { - Remove-Item -Force -Recurse "$dir" - } - } -} - -function verify_lvim_dirs() { - foreach ($dir in $__lvim_dirs) { - if ((Test-Path "$dir") -eq $false) { - New-Item "$dir" -ItemType Directory | Out-Null - } - } - backup_old_config -} - - -function setup_lvim() { - msg "Installing LunarVim shim" - setup_shim - - msg "Installing sample configuration" - - if (Test-Path "$env:LUNARVIM_CONFIG_DIR\config.lua") { - Move-Item "$env:LUNARVIM_CONFIG_DIR\config.lua" "$env:LUNARVIM_CONFIG_DIR\config.lua.old" - } - - New-Item -ItemType File -Path "$env:LUNARVIM_CONFIG_DIR\config.lua" | Out-Null - - $exampleConfig = "$env:LUNARVIM_BASE_DIR\utils\installer\config_win.example.lua" - Copy-Item -Force "$exampleConfig" "$env:LUNARVIM_CONFIG_DIR\config.lua" - - # FIXME: this has never worked - # Invoke-Expression "$INSTALL_PREFIX\bin\lvim.ps1 --headless -c 'autocmd User PackerComplete quitall' -c 'PackerSync'" - - Write-Host "Make sure to run `:PackerSync` at first launch" -ForegroundColor Green - - create_alias - - msg "Thank you for installing LunarVim!!" - - Write-Output "You can start it by running: $INSTALL_PREFIX\bin\lvim.ps1" - Write-Output "Do not forget to use a font with glyphs (icons) support [https://github.com/ryanoasis/nerd-fonts]" -} - - -function validate_lunarvim_files() { - Set-Alias lvim "$INSTALL_PREFIX\bin\lvim.ps1" - try { - $verify_version_cmd='if v:errmsg != "" | cquit | else | quit | endif' - Invoke-Command -ScriptBlock { lvim --headless -c 'LvimUpdate' -c "$verify_version_cmd" } -ErrorAction SilentlyContinue - } - catch { - Write-Output "Unable to guarantee data integrity while updating. Please run `:LvimUpdate` manually instead." - exit 1 - } - Write-Output "Your LunarVim installation is now up to date!" -} - -function create_alias { - try { - $answer = Read-Host $(` - "Would you like to create an alias inside your Powershell profile?`n" + ` - "(This enables you to start lvim with the command 'lvim') [y]es or [n]o (default: no)" ) - } - catch { - msg "Non-interactive mode detected. Skipping alias creation" - return - } - - if ("$answer" -ne "y" -or "$answer" -ne "Y") { - return - } - - $lvim_bin="$INSTALL_PREFIX\bin\lvim.ps1" - $lvim_alias = Get-Alias lvim -ErrorAction SilentlyContinue - - if ($lvim_alias.Definition -eq $lvim_bin) { - Write-Output "Alias is already set and will not be reset." - return - } - - Add-Content -Path $PROFILE -Value $("`r`nSet-Alias lvim $lvim_bin") - - Write-Host 'To use the new alias in this window reload your profile with: `. $PROFILE`' -ForegroundColor Green -} - -function print_logo(){ - Write-Output " - - 88\ 88\ - 88 | \__| - 88 |88\ 88\ 888888$\ 888888\ 888888\ 88\ 88\ 88\ 888888\8888\ - 88 |88 | 88 |88 __88\ \____88\ 88 __88\\88\ 88 |88 |88 _88 _88\ - 88 |88 | 88 |88 | 88 | 888888$ |88 | \__|\88\88 / 88 |88 / 88 / 88 | - 88 |88 | 88 |88 | 88 |88 __88 |88 | \88$ / 88 |88 | 88 | 88 | - 88 |\888888 |88 | 88 |\888888$ |88 | \$ / 88 |88 | 88 | 88 | - \__| \______/ \__| \__| \_______|\__| \_/ \__|\__| \__| \__| - - " -} - -main "$args" diff --git a/.local/share/lunarvim/lvim/utils/installer/install.sh b/.local/share/lunarvim/lvim/utils/installer/install.sh deleted file mode 100755 index ec675e6d..00000000 --- a/.local/share/lunarvim/lvim/utils/installer/install.sh +++ /dev/null @@ -1,449 +0,0 @@ -#!/usr/bin/env bash -set -eo pipefail - -#Set branch to master unless specified by the user -declare LV_BRANCH="${LV_BRANCH:-"master"}" -declare -r LV_REMOTE="${LV_REMOTE:-lunarvim/lunarvim.git}" -declare -r INSTALL_PREFIX="${INSTALL_PREFIX:-"$HOME/.local"}" - -declare -r XDG_DATA_HOME="${XDG_DATA_HOME:-"$HOME/.local/share"}" -declare -r XDG_CACHE_HOME="${XDG_CACHE_HOME:-"$HOME/.cache"}" -declare -r XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-"$HOME/.config"}" - -declare -r LUNARVIM_RUNTIME_DIR="${LUNARVIM_RUNTIME_DIR:-"$XDG_DATA_HOME/lunarvim"}" -declare -r LUNARVIM_CONFIG_DIR="${LUNARVIM_CONFIG_DIR:-"$XDG_CONFIG_HOME/lvim"}" -declare -r LUNARVIM_CACHE_DIR="${LUNARVIM_CACHE_DIR:-"$XDG_CACHE_HOME/lvim"}" -declare -r LUNARVIM_BASE_DIR="${LUNARVIM_BASE_DIR:-"$LUNARVIM_RUNTIME_DIR/lvim"}" - -declare BASEDIR -BASEDIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)" -BASEDIR="$(dirname -- "$(dirname -- "$BASEDIR")")" -readonly BASEDIR - -declare ARGS_LOCAL=0 -declare ARGS_OVERWRITE=0 -declare ARGS_INSTALL_DEPENDENCIES=1 -declare INTERACTIVE_MODE=1 - -declare -a __lvim_dirs=( - "$LUNARVIM_CONFIG_DIR" - "$LUNARVIM_RUNTIME_DIR" - "$LUNARVIM_CACHE_DIR" -) - -declare -a __npm_deps=( - "neovim" - "tree-sitter-cli" -) - -declare -a __pip_deps=( - "pynvim" -) - -function usage() { - echo "Usage: install.sh []" - echo "" - echo "Options:" - echo " -h, --help Print this help message" - echo " -l, --local Install local copy of LunarVim" - echo " -y, --yes Disable confirmation prompts (answer yes to all questions)" - echo " --overwrite Overwrite previous LunarVim configuration (a backup is always performed first)" - echo " --[no]-install-dependencies Whether to automatically install external dependencies (will prompt by default)" -} - -function parse_arguments() { - while [ "$#" -gt 0 ]; do - case "$1" in - -l | --local) - ARGS_LOCAL=1 - ;; - --overwrite) - ARGS_OVERWRITE=1 - ;; - -y | --yes) - INTERACTIVE_MODE=0 - ;; - --install-dependencies) - ARGS_INSTALL_DEPENDENCIES=1 - ;; - --no-install-dependencies) - ARGS_INSTALL_DEPENDENCIES=0 - ;; - -h | --help) - usage - exit 0 - ;; - esac - shift - done -} - -function msg() { - local text="$1" - local div_width="80" - printf "%${div_width}s\n" ' ' | tr ' ' - - printf "%s\n" "$text" -} - -function confirm() { - local question="$1" - while true; do - msg "$question" - read -p "[y]es or [n]o (default: no) : " -r answer - case "$answer" in - y | Y | yes | YES | Yes) - return 0 - ;; - n | N | no | NO | No | *[[:blank:]]* | "") - return 1 - ;; - *) - msg "Please answer [y]es or [n]o." - ;; - esac - done -} - -function main() { - parse_arguments "$@" - - print_logo - - msg "Detecting platform for managing any additional neovim dependencies" - detect_platform - - check_system_deps - - if [ "$ARGS_INSTALL_DEPENDENCIES" -eq 1 ]; then - if [ "$INTERACTIVE_MODE" -eq 1 ]; then - if confirm "Would you like to install LunarVim's NodeJS dependencies?"; then - install_nodejs_deps - fi - if confirm "Would you like to install LunarVim's Python dependencies?"; then - install_python_deps - fi - if confirm "Would you like to install LunarVim's Rust dependencies?"; then - install_rust_deps - fi - else - install_nodejs_deps - install_python_deps - install_rust_deps - fi - fi - - backup_old_config - - verify_lvim_dirs - - if [ "$ARGS_LOCAL" -eq 1 ]; then - link_local_lvim - elif [ -d "$LUNARVIM_BASE_DIR" ]; then - validate_lunarvim_files - else - clone_lvim - fi - - setup_lvim - - msg "Thank you for installing LunarVim!!" - echo "You can start it by running: $INSTALL_PREFIX/bin/lvim" - echo "Do not forget to use a font with glyphs (icons) support [https://github.com/ryanoasis/nerd-fonts]" -} - -function detect_platform() { - OS="$(uname -s)" - case "$OS" in - Linux) - if [ -f "/etc/arch-release" ] || [ -f "/etc/artix-release" ]; then - RECOMMEND_INSTALL="sudo pacman -S" - elif [ -f "/etc/fedora-release" ] || [ -f "/etc/redhat-release" ]; then - RECOMMEND_INSTALL="sudo dnf install -y" - elif [ -f "/etc/gentoo-release" ]; then - RECOMMEND_INSTALL="emerge -tv" - else # assume debian based - RECOMMEND_INSTALL="sudo apt install -y" - fi - ;; - FreeBSD) - RECOMMEND_INSTALL="sudo pkg install -y" - ;; - NetBSD) - RECOMMEND_INSTALL="sudo pkgin install" - ;; - OpenBSD) - RECOMMEND_INSTALL="doas pkg_add" - ;; - Darwin) - RECOMMEND_INSTALL="brew install" - ;; - *) - echo "OS $OS is not currently supported." - exit 1 - ;; - esac -} - -function print_missing_dep_msg() { - if [ "$#" -eq 1 ]; then - echo "[ERROR]: Unable to find dependency [$1]" - echo "Please install it first and re-run the installer. Try: $RECOMMEND_INSTALL $1" - else - local cmds - cmds=$(for i in "$@"; do echo "$RECOMMEND_INSTALL $i"; done) - printf "[ERROR]: Unable to find dependencies [%s]" "$@" - printf "Please install any one of the dependencies and re-run the installer. Try: \n%s\n" "$cmds" - fi -} - -function check_neovim_min_version() { - local verify_version_cmd='if !has("nvim-0.7") | cquit | else | quit | endif' - - # exit with an error if min_version not found - if ! nvim --headless -u NONE -c "$verify_version_cmd"; then - echo "[ERROR]: LunarVim requires at least Neovim v0.7 or higher" - exit 1 - fi -} - -function verify_core_plugins() { - msg "Verifying core plugins" - if ! bash "$LUNARVIM_BASE_DIR/utils/ci/verify_plugins.sh"; then - echo "[ERROR]: Unable to verify plugins, makde sure to manually run ':PackerSync' when starting lvim for the first time." - exit 1 - fi - echo "Verification complete!" -} - -function validate_lunarvim_files() { - local verify_version_cmd='if v:errmsg != "" | cquit | else | quit | endif' - if ! "$INSTALL_PREFIX/bin/lvim" --headless -c 'LvimUpdate' -c "$verify_version_cmd" &>/dev/null; then - msg "Removing old installation files" - rm -rf "$LUNARVIM_BASE_DIR" - clone_lvim - fi -} - -function check_system_deps() { - if ! command -v git &>/dev/null; then - print_missing_dep_msg "git" - exit 1 - fi - if ! command -v nvim &>/dev/null; then - print_missing_dep_msg "neovim" - exit 1 - fi - check_neovim_min_version -} - -function __install_nodejs_deps_pnpm() { - echo "Installing node modules with pnpm.." - pnpm install -g "${__npm_deps[@]}" - echo "All NodeJS dependencies are successfully installed" -} - -function __install_nodejs_deps_npm() { - echo "Installing node modules with npm.." - for dep in "${__npm_deps[@]}"; do - if ! npm ls -g "$dep" &>/dev/null; then - printf "installing %s .." "$dep" - npm install -g "$dep" - fi - done - - echo "All NodeJS dependencies are successfully installed" -} - -function __install_nodejs_deps_yarn() { - echo "Installing node modules with yarn.." - yarn global add "${__npm_deps[@]}" - echo "All NodeJS dependencies are successfully installed" -} - -function __validate_node_installation() { - local pkg_manager="$1" - local manager_home - - if ! command -v "$pkg_manager" &>/dev/null; then - return 1 - fi - - if [ "$pkg_manager" == "npm" ]; then - manager_home="$(npm config get prefix 2>/dev/null)" - elif [ "$pkg_manager" == "pnpm" ]; then - manager_home="$(pnpm config get prefix 2>/dev/null)" - else - manager_home="$(yarn global bin 2>/dev/null)" - fi - - if [ ! -d "$manager_home" ] || [ ! -w "$manager_home" ]; then - echo "[ERROR] Unable to install using [$pkg_manager] without administrative privileges." - return 1 - fi - - return 0 -} - -function install_nodejs_deps() { - local -a pkg_managers=("pnpm" "yarn" "npm") - for pkg_manager in "${pkg_managers[@]}"; do - if __validate_node_installation "$pkg_manager"; then - eval "__install_nodejs_deps_$pkg_manager" - return - fi - done - print_missing_dep_msg "${pkg_managers[@]}" - exit 1 -} - -function install_python_deps() { - echo "Verifying that pip is available.." - if ! python3 -m ensurepip &>/dev/null; then - if ! python3 -m pip --version &>/dev/null; then - print_missing_dep_msg "pip" - exit 1 - fi - fi - echo "Installing with pip.." - for dep in "${__pip_deps[@]}"; do - python3 -m pip install --user "$dep" - done - echo "All Python dependencies are successfully installed" -} - -function __attempt_to_install_with_cargo() { - if command -v cargo &>/dev/null; then - echo "Installing missing Rust dependency with cargo" - cargo install "$1" - else - echo "[WARN]: Unable to find cargo. Make sure to install it to avoid any problems" - exit 1 - fi -} - -# we try to install the missing one with cargo even though it's unlikely to be found -function install_rust_deps() { - local -a deps=("fd::fd-find" "rg::ripgrep") - for dep in "${deps[@]}"; do - if ! command -v "${dep%%::*}" &>/dev/null; then - __attempt_to_install_with_cargo "${dep##*::}" - fi - done - echo "All Rust dependencies are successfully installed" -} - -function verify_lvim_dirs() { - if [ "$ARGS_OVERWRITE" -eq 1 ]; then - for dir in "${__lvim_dirs[@]}"; do - [ -d "$dir" ] && rm -rf "$dir" - done - fi - - for dir in "${__lvim_dirs[@]}"; do - mkdir -p "$dir" - done -} - -function backup_old_config() { - local src="$LUNARVIM_CONFIG_DIR" - if [ ! -d "$src" ]; then - return - fi - mkdir -p "$src.old" - touch "$src/ignore" - msg "Backing up old $src to $src.old" - if command -v rsync &>/dev/null; then - rsync --archive -hh --stats --partial --copy-links --cvs-exclude "$src"/ "$src.old" - else - OS="$(uname -s)" - case "$OS" in - Linux | *BSD) - cp -r "$src/"* "$src.old/." - ;; - Darwin) - cp -R "$src/"* "$src.old/." - ;; - *) - echo "OS $OS is not currently supported." - ;; - esac - fi - msg "Backup operation complete" -} - -function clone_lvim() { - msg "Cloning LunarVim configuration" - if ! git clone --branch "$LV_BRANCH" \ - --depth 1 "https://github.com/${LV_REMOTE}" "$LUNARVIM_BASE_DIR"; then - echo "Failed to clone repository. Installation failed." - exit 1 - fi -} - -function link_local_lvim() { - echo "Linking local LunarVim repo" - - # Detect whether it's a symlink or a folder - if [ -d "$LUNARVIM_BASE_DIR" ]; then - echo "Removing old installation files" - rm -rf "$LUNARVIM_BASE_DIR" - fi - - echo " - $BASEDIR -> $LUNARVIM_BASE_DIR" - ln -s -f "$BASEDIR" "$LUNARVIM_BASE_DIR" -} - -function setup_shim() { - make -C "$LUNARVIM_BASE_DIR" install-bin -} - -function remove_old_cache_files() { - local packer_cache="$LUNARVIM_CONFIG_DIR/plugin/packer_compiled.lua" - if [ -e "$packer_cache" ]; then - msg "Removing old packer cache file" - rm -f "$packer_cache" - fi - - if [ -e "$LUNARVIM_CACHE_DIR/luacache" ] || [ -e "$LUNARVIM_CACHE_DIR/lvim_cache" ]; then - msg "Removing old startup cache file" - rm -f "$LUNARVIM_CACHE_DIR/{luacache,lvim_cache}" - fi -} - -function setup_lvim() { - - remove_old_cache_files - - msg "Installing LunarVim shim" - - setup_shim - - cp "$LUNARVIM_BASE_DIR/utils/installer/config.example.lua" "$LUNARVIM_CONFIG_DIR/config.lua" - - echo "Preparing Packer setup" - - "$INSTALL_PREFIX/bin/lvim" --headless \ - -c 'autocmd User PackerComplete quitall' \ - -c 'PackerSync' - - echo "Packer setup complete" - - verify_core_plugins -} - -function print_logo() { - cat <<'EOF' - - 88\ 88\ - 88 | \__| - 88 |88\ 88\ 888888$\ 888888\ 888888\ 88\ 88\ 88\ 888888\8888\ - 88 |88 | 88 |88 __88\ \____88\ 88 __88\\88\ 88 |88 |88 _88 _88\ - 88 |88 | 88 |88 | 88 | 888888$ |88 | \__|\88\88 / 88 |88 / 88 / 88 | - 88 |88 | 88 |88 | 88 |88 __88 |88 | \88$ / 88 |88 | 88 | 88 | - 88 |\888888 |88 | 88 |\888888$ |88 | \$ / 88 |88 | 88 | 88 | - \__| \______/ \__| \__| \_______|\__| \_/ \__|\__| \__| \__| - -EOF -} - -main "$@" diff --git a/.local/share/lunarvim/lvim/utils/installer/install_bin.sh b/.local/share/lunarvim/lvim/utils/installer/install_bin.sh deleted file mode 100755 index c6ad5181..00000000 --- a/.local/share/lunarvim/lvim/utils/installer/install_bin.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/usr/bin/env bash -set -eo pipefail - -INSTALL_PREFIX="${INSTALL_PREFIX:-"$HOME/.local"}" - -XDG_DATA_HOME="${XDG_DATA_HOME:-"$HOME/.local/share"}" -XDG_CACHE_HOME="${XDG_CACHE_HOME:-"$HOME/.cache"}" -XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-"$HOME/.config"}" - -LUNARVIM_RUNTIME_DIR="${LUNARVIM_RUNTIME_DIR:-"$XDG_DATA_HOME/lunarvim"}" -LUNARVIM_CONFIG_DIR="${LUNARVIM_CONFIG_DIR:-"$XDG_CONFIG_HOME/lvim"}" -LUNARVIM_CACHE_DIR="${LUNARVIM_CACHE_DIR:-"$XDG_CACHE_HOME/lvim"}" - -LUNARVIM_BASE_DIR="${LUNARVIM_BASE_DIR:-"$LUNARVIM_RUNTIME_DIR/lvim"}" - -function setup_shim() { - local src="$LUNARVIM_BASE_DIR/utils/bin/lvim.template" - local dst="$INSTALL_PREFIX/bin/lvim" - - [ ! -d "$INSTALL_PREFIX/bin" ] && mkdir -p "$INSTALL_PREFIX/bin" - - # remove outdated installation so that `cp` doesn't complain - rm -f "$dst" - - cp "$src" "$dst" - - sed -e s"#RUNTIME_DIR_VAR#\"${LUNARVIM_RUNTIME_DIR}\"#"g \ - -e s"#CONFIG_DIR_VAR#\"${LUNARVIM_CONFIG_DIR}\"#"g \ - -e s"#CACHE_DIR_VAR#\"${LUNARVIM_CACHE_DIR}\"#"g "$src" \ - | tee "$dst" >/dev/null - - chmod u+x "$dst" -} - -setup_shim "$@" - -echo "You can start LunarVim by running: $INSTALL_PREFIX/bin/lvim" diff --git a/.local/share/lunarvim/lvim/utils/installer/install_stylua.sh b/.local/share/lunarvim/lvim/utils/installer/install_stylua.sh deleted file mode 100755 index 963416ea..00000000 --- a/.local/share/lunarvim/lvim/utils/installer/install_stylua.sh +++ /dev/null @@ -1,63 +0,0 @@ -#!/usr/bin/env bash - -set -eu pipefall - -declare -r INSTALL_DIR="$PWD/utils" -declare -r RELEASE="0.10.0" -declare -r OS="linux" -# declare -r OS="$(uname -s)" -declare -r FILENAME="stylua-$RELEASE-$OS" - -declare -a __deps=("curl" "unzip") - -function check_deps() { - for dep in "${__deps[@]}"; do - if ! command -v "$dep" >/dev/null; then - echo "Missing depdendecy!" - echo "The \"$dep\" command was not found!. Please install and try again." - fi - done -} - -function download_stylua() { - local DOWNLOAD_DIR - local URL="https://github.com/JohnnyMorganz/StyLua/releases/download/v$RELEASE/$FILENAME.zip" - - DOWNLOAD_DIR="$(mktemp -d)" - echo "Initiating download for Stylua v$RELEASE" - if ! curl --progress-bar --fail -L "$URL" -o "$DOWNLOAD_DIR/$FILENAME.zip"; then - echo "Download failed. Check that the release/filename are correct." - exit 1 - fi - - echo "Installation in progress.." - unzip -q "$DOWNLOAD_DIR/$FILENAME.zip" -d "$DOWNLOAD_DIR" - - if [ -f "$DOWNLOAD_DIR/stylua" ]; then - mv "$DOWNLOAD_DIR/stylua" "$INSTALL_DIR/stylua" - else - mv "$DOWNLOAD_DIR/$FILENAME/stylua" "$INSTALL_DIR/." - fi - - chmod u+x "$INSTALL_DIR/stylua" -} - -function verify_install() { - echo "Verifying installation.." - local DOWNLOADED_VER - DOWNLOADED_VER="$("$INSTALL_DIR/stylua" -V | awk '{ print $2 }')" - if [ "$DOWNLOADED_VER" != "$RELEASE" ]; then - echo "Mismatched version!" - echo "Expected: v$RELEASE but got v$DOWNLOADED_VER" - exit 1 - fi - echo "Verification complete!" -} - -function main() { - check_deps - download_stylua - verify_install -} - -main "$@" diff --git a/.local/share/lunarvim/lvim/utils/installer/uninstall.ps1 b/.local/share/lunarvim/lvim/utils/installer/uninstall.ps1 deleted file mode 100644 index 2de21037..00000000 --- a/.local/share/lunarvim/lvim/utils/installer/uninstall.ps1 +++ /dev/null @@ -1,63 +0,0 @@ -#Requires -Version 7.1 -$ErrorActionPreference = "Stop" # exit when command fails - -# set script variables -$LV_BRANCH = $LV_BRANCH ?? "rolling" -$LV_REMOTE = $LV_REMOTE ?? "lunarvim/lunarvim.git" -$INSTALL_PREFIX = $INSTALL_PREFIX ?? "$HOME\.local" - -$env:XDG_DATA_HOME = $env:XDG_DATA_HOME ?? $env:APPDATA -$env:XDG_CONFIG_HOME = $env:XDG_CONFIG_HOME ?? $env:LOCALAPPDATA -$env:XDG_CACHE_HOME = $env:XDG_CACHE_HOME ?? $env:TEMP - -$env:LUNARVIM_RUNTIME_DIR = $env:LUNARVIM_RUNTIME_DIR ?? "$env:XDG_DATA_HOME\lunarvim" -$env:LUNARVIM_CONFIG_DIR = $env:LUNARVIM_CONFIG_DIR ?? "$env:XDG_CONFIG_HOME\lvim" -$env:LUNARVIM_CACHE_DIR = $env:LUNARVIM_CACHE_DIR ?? "$env:XDG_CACHE_HOME\lvim" -$env:LUNARVIM_BASE_DIR = $env:LUNARVIM_BASE_DIR ?? "$env:LUNARVIM_RUNTIME_DIR\lvim" - -$__lvim_dirs = ( - $env:LUNARVIM_BASE_DIR, - $env:LUNARVIM_RUNTIME_DIR, - $env:LUNARVIM_CONFIG_DIR, - $env:LUNARVIM_CACHE_DIR -) - -function main($cliargs) { - Write-Output "Removing LunarVim binary..." - remove_lvim_bin - Write-Output "Removing LunarVim directories..." - $force = $false - if ($cliargs.Contains("--remove-backups")) { - $force = $true - } - remove_lvim_dirs $force - Write-Output "Uninstalled LunarVim!" -} - -function remove_lvim_bin(){ - $lvim_bin="$INSTALL_PREFIX\bin\lvim" - if (Test-Path $lvim_bin) { - Remove-Item -Force $lvim_bin - } - if (Test-Path alias:lvim) { - Write-Warning "Please make sure to remove the 'lvim' alias from your `$PROFILE`: $PROFILE" - } -} - -function remove_lvim_dirs($force) { - foreach ($dir in $__lvim_dirs) { - if (Test-Path $dir) { - Remove-Item -Force -Recurse $dir - } - if ($force -eq $true) { - if (Test-Path "$dir.bak") { - Remove-Item -Force -Recurse "$dir.bak" - } - if (Test-Path "$dir.old") { - Remove-Item -Force -Recurse "$dir.old" - } - } - } -} - -main($args) \ No newline at end of file diff --git a/.local/share/lunarvim/lvim/utils/installer/uninstall.sh b/.local/share/lunarvim/lvim/utils/installer/uninstall.sh deleted file mode 100755 index 8fc8e693..00000000 --- a/.local/share/lunarvim/lvim/utils/installer/uninstall.sh +++ /dev/null @@ -1,72 +0,0 @@ -#!/usr/bin/env bash -set -eo pipefail - -ARGS_REMOVE_BACKUPS=0 - -declare -r XDG_DATA_HOME="${XDG_DATA_HOME:-"$HOME/.local/share"}" -declare -r XDG_CACHE_HOME="${XDG_CACHE_HOME:-"$HOME/.cache"}" -declare -r XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-"$HOME/.config"}" - -declare -r LUNARVIM_RUNTIME_DIR="${LUNARVIM_RUNTIME_DIR:-"$XDG_DATA_HOME/lunarvim"}" -declare -r LUNARVIM_CONFIG_DIR="${LUNARVIM_CONFIG_DIR:-"$XDG_CONFIG_HOME/lvim"}" -declare -r LUNARVIM_CACHE_DIR="${LUNARVIM_CACHE_DIR:-"$XDG_CACHE_HOME/lvim"}" - -declare -a __lvim_dirs=( - "$LUNARVIM_CONFIG_DIR" - "$LUNARVIM_RUNTIME_DIR" - "$LUNARVIM_CACHE_DIR" -) - -function usage() { - echo "Usage: uninstall.sh []" - echo "" - echo "Options:" - echo " -h, --help Print this help message" - echo " --remove-backups Remove old backup folders as well" -} - -function parse_arguments() { - while [ "$#" -gt 0 ]; do - case "$1" in - --remove-backups) - ARGS_REMOVE_BACKUPS=1 - ;; - -h | --help) - usage - exit 0 - ;; - esac - shift - done -} - -function remove_lvim_dirs() { - for dir in "${__lvim_dirs[@]}"; do - rm -rf "$dir" - if [ "$ARGS_REMOVE_BACKUPS" -eq 1 ]; then - rm -rf "$dir.{bak,old}" - fi - done -} - -function remove_lvim_bin() { - local legacy_bin="/usr/local/bin/lvim " - if [ -x "$legacy_bin" ]; then - echo "Error! Unable to remove $legacy_bin without elevation. Please remove manually." - exit 1 - fi - - lvim_bin="$(command -v lvim 2>/dev/null)" - rm -f "$lvim_bin" -} - -function main() { - parse_arguments "$@" - echo "Removing LunarVim binary..." - remove_lvim_bin - echo "Removing LunarVim directories..." - remove_lvim_dirs - echo "Uninstalled LunarVim!" -} - -main "$@" diff --git a/.local/share/lunarvim/site/after/ftplugin/OpenFOAM.lua b/.local/share/lunarvim/site/after/ftplugin/OpenFOAM.lua deleted file mode 100644 index 63704f8b..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/OpenFOAM.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("foam_ls") diff --git a/.local/share/lunarvim/site/after/ftplugin/apexcode.lua b/.local/share/lunarvim/site/after/ftplugin/apexcode.lua deleted file mode 100644 index 43addbdc..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/apexcode.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("apex_ls") diff --git a/.local/share/lunarvim/site/after/ftplugin/arduino.lua b/.local/share/lunarvim/site/after/ftplugin/arduino.lua deleted file mode 100644 index fd5c8f1b..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/arduino.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("arduino_language_server") diff --git a/.local/share/lunarvim/site/after/ftplugin/asm.lua b/.local/share/lunarvim/site/after/ftplugin/asm.lua deleted file mode 100644 index 6b8b90c6..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/asm.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("asm_lsp") diff --git a/.local/share/lunarvim/site/after/ftplugin/astro.lua b/.local/share/lunarvim/site/after/ftplugin/astro.lua deleted file mode 100644 index d0e4dabe..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/astro.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("astro") diff --git a/.local/share/lunarvim/site/after/ftplugin/awk.lua b/.local/share/lunarvim/site/after/ftplugin/awk.lua deleted file mode 100644 index 3e567905..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/awk.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("awk_ls") diff --git a/.local/share/lunarvim/site/after/ftplugin/bean.lua b/.local/share/lunarvim/site/after/ftplugin/bean.lua deleted file mode 100644 index f436fdc6..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/bean.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("beancount") diff --git a/.local/share/lunarvim/site/after/ftplugin/beancount.lua b/.local/share/lunarvim/site/after/ftplugin/beancount.lua deleted file mode 100644 index f436fdc6..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/beancount.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("beancount") diff --git a/.local/share/lunarvim/site/after/ftplugin/bib.lua b/.local/share/lunarvim/site/after/ftplugin/bib.lua deleted file mode 100644 index 79949b52..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/bib.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("texlab") diff --git a/.local/share/lunarvim/site/after/ftplugin/bicep.lua b/.local/share/lunarvim/site/after/ftplugin/bicep.lua deleted file mode 100644 index 77f54945..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/bicep.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("bicep") diff --git a/.local/share/lunarvim/site/after/ftplugin/bsl.lua b/.local/share/lunarvim/site/after/ftplugin/bsl.lua deleted file mode 100644 index 51deed04..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/bsl.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("bsl_ls") diff --git a/.local/share/lunarvim/site/after/ftplugin/c.lua b/.local/share/lunarvim/site/after/ftplugin/c.lua deleted file mode 100644 index 6c77af9b..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/c.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("clangd") diff --git a/.local/share/lunarvim/site/after/ftplugin/clar.lua b/.local/share/lunarvim/site/after/ftplugin/clar.lua deleted file mode 100644 index d0dd827c..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/clar.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("clarity_lsp") diff --git a/.local/share/lunarvim/site/after/ftplugin/clarity.lua b/.local/share/lunarvim/site/after/ftplugin/clarity.lua deleted file mode 100644 index d0dd827c..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/clarity.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("clarity_lsp") diff --git a/.local/share/lunarvim/site/after/ftplugin/clojure.lua b/.local/share/lunarvim/site/after/ftplugin/clojure.lua deleted file mode 100644 index f1a0f040..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/clojure.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("clojure_lsp") diff --git a/.local/share/lunarvim/site/after/ftplugin/cmake.lua b/.local/share/lunarvim/site/after/ftplugin/cmake.lua deleted file mode 100644 index 590ed408..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/cmake.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("cmake") diff --git a/.local/share/lunarvim/site/after/ftplugin/cpp.lua b/.local/share/lunarvim/site/after/ftplugin/cpp.lua deleted file mode 100644 index 6c77af9b..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/cpp.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("clangd") diff --git a/.local/share/lunarvim/site/after/ftplugin/crystal.lua b/.local/share/lunarvim/site/after/ftplugin/crystal.lua deleted file mode 100644 index 98b750e7..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/crystal.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("crystalline") diff --git a/.local/share/lunarvim/site/after/ftplugin/cs.lua b/.local/share/lunarvim/site/after/ftplugin/cs.lua deleted file mode 100644 index 63240414..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/cs.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("omnisharp") diff --git a/.local/share/lunarvim/site/after/ftplugin/css.lua b/.local/share/lunarvim/site/after/ftplugin/css.lua deleted file mode 100644 index 0bf4b813..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/css.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("cssls") diff --git a/.local/share/lunarvim/site/after/ftplugin/cucumber.lua b/.local/share/lunarvim/site/after/ftplugin/cucumber.lua deleted file mode 100644 index 182a9500..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/cucumber.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("cucumber_language_server") diff --git a/.local/share/lunarvim/site/after/ftplugin/cuda.lua b/.local/share/lunarvim/site/after/ftplugin/cuda.lua deleted file mode 100644 index 6c77af9b..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/cuda.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("clangd") diff --git a/.local/share/lunarvim/site/after/ftplugin/d.lua b/.local/share/lunarvim/site/after/ftplugin/d.lua deleted file mode 100644 index a08a6630..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/d.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("serve_d") diff --git a/.local/share/lunarvim/site/after/ftplugin/dart.lua b/.local/share/lunarvim/site/after/ftplugin/dart.lua deleted file mode 100644 index 460bc9dd..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/dart.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("dartls") diff --git a/.local/share/lunarvim/site/after/ftplugin/dhall.lua b/.local/share/lunarvim/site/after/ftplugin/dhall.lua deleted file mode 100644 index af363003..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/dhall.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("dhall_lsp_server") diff --git a/.local/share/lunarvim/site/after/ftplugin/dockerfile.lua b/.local/share/lunarvim/site/after/ftplugin/dockerfile.lua deleted file mode 100644 index f428e3b9..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/dockerfile.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("dockerls") diff --git a/.local/share/lunarvim/site/after/ftplugin/dot.lua b/.local/share/lunarvim/site/after/ftplugin/dot.lua deleted file mode 100644 index 54b2ce12..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/dot.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("dotls") diff --git a/.local/share/lunarvim/site/after/ftplugin/dune.lua b/.local/share/lunarvim/site/after/ftplugin/dune.lua deleted file mode 100644 index 867d4d80..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/dune.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("ocamllsp") diff --git a/.local/share/lunarvim/site/after/ftplugin/edn.lua b/.local/share/lunarvim/site/after/ftplugin/edn.lua deleted file mode 100644 index f1a0f040..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/edn.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("clojure_lsp") diff --git a/.local/share/lunarvim/site/after/ftplugin/eelixir.lua b/.local/share/lunarvim/site/after/ftplugin/eelixir.lua deleted file mode 100644 index adbe79a7..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/eelixir.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("elixirls") diff --git a/.local/share/lunarvim/site/after/ftplugin/elixir.lua b/.local/share/lunarvim/site/after/ftplugin/elixir.lua deleted file mode 100644 index adbe79a7..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/elixir.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("elixirls") diff --git a/.local/share/lunarvim/site/after/ftplugin/elm.lua b/.local/share/lunarvim/site/after/ftplugin/elm.lua deleted file mode 100644 index 8c9e3089..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/elm.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("elmls") diff --git a/.local/share/lunarvim/site/after/ftplugin/erlang.lua b/.local/share/lunarvim/site/after/ftplugin/erlang.lua deleted file mode 100644 index 21efc91c..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/erlang.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("erlangls") diff --git a/.local/share/lunarvim/site/after/ftplugin/flux.lua b/.local/share/lunarvim/site/after/ftplugin/flux.lua deleted file mode 100644 index e0c436bc..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/flux.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("flux_lsp") diff --git a/.local/share/lunarvim/site/after/ftplugin/foam.lua b/.local/share/lunarvim/site/after/ftplugin/foam.lua deleted file mode 100644 index 63704f8b..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/foam.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("foam_ls") diff --git a/.local/share/lunarvim/site/after/ftplugin/fortran.lua b/.local/share/lunarvim/site/after/ftplugin/fortran.lua deleted file mode 100644 index d9d35bf7..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/fortran.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("fortls") diff --git a/.local/share/lunarvim/site/after/ftplugin/fsharp.lua b/.local/share/lunarvim/site/after/ftplugin/fsharp.lua deleted file mode 100644 index e70886ff..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/fsharp.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("fsautocomplete") diff --git a/.local/share/lunarvim/site/after/ftplugin/genie.lua b/.local/share/lunarvim/site/after/ftplugin/genie.lua deleted file mode 100644 index 2cf2542c..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/genie.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("vala_ls") diff --git a/.local/share/lunarvim/site/after/ftplugin/go.lua b/.local/share/lunarvim/site/after/ftplugin/go.lua deleted file mode 100644 index bbd39c92..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/go.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("gopls") diff --git a/.local/share/lunarvim/site/after/ftplugin/gomod.lua b/.local/share/lunarvim/site/after/ftplugin/gomod.lua deleted file mode 100644 index bbd39c92..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/gomod.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("gopls") diff --git a/.local/share/lunarvim/site/after/ftplugin/gotmpl.lua b/.local/share/lunarvim/site/after/ftplugin/gotmpl.lua deleted file mode 100644 index bbd39c92..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/gotmpl.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("gopls") diff --git a/.local/share/lunarvim/site/after/ftplugin/groovy.lua b/.local/share/lunarvim/site/after/ftplugin/groovy.lua deleted file mode 100644 index d7d454eb..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/groovy.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("groovyls") diff --git a/.local/share/lunarvim/site/after/ftplugin/haskell.lua b/.local/share/lunarvim/site/after/ftplugin/haskell.lua deleted file mode 100644 index b5b16572..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/haskell.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("hls") diff --git a/.local/share/lunarvim/site/after/ftplugin/haxe.lua b/.local/share/lunarvim/site/after/ftplugin/haxe.lua deleted file mode 100644 index c971d7bd..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/haxe.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("haxe_language_server") diff --git a/.local/share/lunarvim/site/after/ftplugin/heex.lua b/.local/share/lunarvim/site/after/ftplugin/heex.lua deleted file mode 100644 index adbe79a7..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/heex.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("elixirls") diff --git a/.local/share/lunarvim/site/after/ftplugin/hoon.lua b/.local/share/lunarvim/site/after/ftplugin/hoon.lua deleted file mode 100644 index 574dbd7b..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/hoon.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("hoon_ls") diff --git a/.local/share/lunarvim/site/after/ftplugin/html.lua b/.local/share/lunarvim/site/after/ftplugin/html.lua deleted file mode 100644 index 6c196109..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/html.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("html") diff --git a/.local/share/lunarvim/site/after/ftplugin/java.lua b/.local/share/lunarvim/site/after/ftplugin/java.lua deleted file mode 100644 index 0f1513c6..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/java.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("jdtls") diff --git a/.local/share/lunarvim/site/after/ftplugin/javascript.jsx.lua b/.local/share/lunarvim/site/after/ftplugin/javascript.jsx.lua deleted file mode 100644 index 2dc43d87..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/javascript.jsx.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("tsserver") diff --git a/.local/share/lunarvim/site/after/ftplugin/javascript.lua b/.local/share/lunarvim/site/after/ftplugin/javascript.lua deleted file mode 100644 index 2dc43d87..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/javascript.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("tsserver") diff --git a/.local/share/lunarvim/site/after/ftplugin/javascriptreact.lua b/.local/share/lunarvim/site/after/ftplugin/javascriptreact.lua deleted file mode 100644 index 2dc43d87..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/javascriptreact.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("tsserver") diff --git a/.local/share/lunarvim/site/after/ftplugin/json.lua b/.local/share/lunarvim/site/after/ftplugin/json.lua deleted file mode 100644 index 47af6b8c..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/json.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("jsonls") diff --git a/.local/share/lunarvim/site/after/ftplugin/jsonc.lua b/.local/share/lunarvim/site/after/ftplugin/jsonc.lua deleted file mode 100644 index 47af6b8c..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/jsonc.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("jsonls") diff --git a/.local/share/lunarvim/site/after/ftplugin/jsonnet.lua b/.local/share/lunarvim/site/after/ftplugin/jsonnet.lua deleted file mode 100644 index 88eda4b2..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/jsonnet.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("jsonnet_ls") diff --git a/.local/share/lunarvim/site/after/ftplugin/julia.lua b/.local/share/lunarvim/site/after/ftplugin/julia.lua deleted file mode 100644 index ff51ee09..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/julia.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("julials") diff --git a/.local/share/lunarvim/site/after/ftplugin/kotlin.lua b/.local/share/lunarvim/site/after/ftplugin/kotlin.lua deleted file mode 100644 index c115a0ef..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/kotlin.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("kotlin_language_server") diff --git a/.local/share/lunarvim/site/after/ftplugin/less.lua b/.local/share/lunarvim/site/after/ftplugin/less.lua deleted file mode 100644 index 0bf4b813..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/less.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("cssls") diff --git a/.local/share/lunarvim/site/after/ftplugin/lhaskell.lua b/.local/share/lunarvim/site/after/ftplugin/lhaskell.lua deleted file mode 100644 index b5b16572..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/lhaskell.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("hls") diff --git a/.local/share/lunarvim/site/after/ftplugin/libsonnet.lua b/.local/share/lunarvim/site/after/ftplugin/libsonnet.lua deleted file mode 100644 index 88eda4b2..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/libsonnet.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("jsonnet_ls") diff --git a/.local/share/lunarvim/site/after/ftplugin/liquid.lua b/.local/share/lunarvim/site/after/ftplugin/liquid.lua deleted file mode 100644 index 8b70949f..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/liquid.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("theme_check") diff --git a/.local/share/lunarvim/site/after/ftplugin/llw.lua b/.local/share/lunarvim/site/after/ftplugin/llw.lua deleted file mode 100644 index 2795f0ae..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/llw.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("lelwel_ls") diff --git a/.local/share/lunarvim/site/after/ftplugin/lua.lua b/.local/share/lunarvim/site/after/ftplugin/lua.lua deleted file mode 100644 index 229c4794..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/lua.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("sumneko_lua") diff --git a/.local/share/lunarvim/site/after/ftplugin/metamath-zero.lua b/.local/share/lunarvim/site/after/ftplugin/metamath-zero.lua deleted file mode 100644 index 7b2f3875..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/metamath-zero.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("mm0_ls") diff --git a/.local/share/lunarvim/site/after/ftplugin/ncl.lua b/.local/share/lunarvim/site/after/ftplugin/ncl.lua deleted file mode 100644 index ca4225dc..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/ncl.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("nickel_ls") diff --git a/.local/share/lunarvim/site/after/ftplugin/nickel.lua b/.local/share/lunarvim/site/after/ftplugin/nickel.lua deleted file mode 100644 index ca4225dc..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/nickel.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("nickel_ls") diff --git a/.local/share/lunarvim/site/after/ftplugin/nim.lua b/.local/share/lunarvim/site/after/ftplugin/nim.lua deleted file mode 100644 index 81283ddc..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/nim.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("nimls") diff --git a/.local/share/lunarvim/site/after/ftplugin/nix.lua b/.local/share/lunarvim/site/after/ftplugin/nix.lua deleted file mode 100644 index e627ca15..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/nix.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("rnix") diff --git a/.local/share/lunarvim/site/after/ftplugin/objc.lua b/.local/share/lunarvim/site/after/ftplugin/objc.lua deleted file mode 100644 index 6c77af9b..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/objc.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("clangd") diff --git a/.local/share/lunarvim/site/after/ftplugin/objcpp.lua b/.local/share/lunarvim/site/after/ftplugin/objcpp.lua deleted file mode 100644 index 6c77af9b..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/objcpp.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("clangd") diff --git a/.local/share/lunarvim/site/after/ftplugin/ocaml.interface.lua b/.local/share/lunarvim/site/after/ftplugin/ocaml.interface.lua deleted file mode 100644 index 867d4d80..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/ocaml.interface.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("ocamllsp") diff --git a/.local/share/lunarvim/site/after/ftplugin/ocaml.lua b/.local/share/lunarvim/site/after/ftplugin/ocaml.lua deleted file mode 100644 index 867d4d80..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/ocaml.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("ocamllsp") diff --git a/.local/share/lunarvim/site/after/ftplugin/ocaml.menhir.lua b/.local/share/lunarvim/site/after/ftplugin/ocaml.menhir.lua deleted file mode 100644 index 867d4d80..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/ocaml.menhir.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("ocamllsp") diff --git a/.local/share/lunarvim/site/after/ftplugin/ocaml.ocamllex.lua b/.local/share/lunarvim/site/after/ftplugin/ocaml.ocamllex.lua deleted file mode 100644 index 867d4d80..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/ocaml.ocamllex.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("ocamllsp") diff --git a/.local/share/lunarvim/site/after/ftplugin/opencl.lua b/.local/share/lunarvim/site/after/ftplugin/opencl.lua deleted file mode 100644 index 27724f09..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/opencl.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("opencl_ls") diff --git a/.local/share/lunarvim/site/after/ftplugin/os.lua b/.local/share/lunarvim/site/after/ftplugin/os.lua deleted file mode 100644 index 51deed04..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/os.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("bsl_ls") diff --git a/.local/share/lunarvim/site/after/ftplugin/perl.lua b/.local/share/lunarvim/site/after/ftplugin/perl.lua deleted file mode 100644 index ecde412c..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/perl.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("perlnavigator") diff --git a/.local/share/lunarvim/site/after/ftplugin/php.lua b/.local/share/lunarvim/site/after/ftplugin/php.lua deleted file mode 100644 index 0b59add0..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/php.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("intelephense") diff --git a/.local/share/lunarvim/site/after/ftplugin/prisma.lua b/.local/share/lunarvim/site/after/ftplugin/prisma.lua deleted file mode 100644 index c159a369..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/prisma.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("prismals") diff --git a/.local/share/lunarvim/site/after/ftplugin/ps1.lua b/.local/share/lunarvim/site/after/ftplugin/ps1.lua deleted file mode 100644 index 1a04af77..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/ps1.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("powershell_es") diff --git a/.local/share/lunarvim/site/after/ftplugin/puppet.lua b/.local/share/lunarvim/site/after/ftplugin/puppet.lua deleted file mode 100644 index 597667e8..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/puppet.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("puppet") diff --git a/.local/share/lunarvim/site/after/ftplugin/purescript.lua b/.local/share/lunarvim/site/after/ftplugin/purescript.lua deleted file mode 100644 index baad4f55..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/purescript.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("purescriptls") diff --git a/.local/share/lunarvim/site/after/ftplugin/python.lua b/.local/share/lunarvim/site/after/ftplugin/python.lua deleted file mode 100644 index 605c223f..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/python.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("pyright") diff --git a/.local/share/lunarvim/site/after/ftplugin/ql.lua b/.local/share/lunarvim/site/after/ftplugin/ql.lua deleted file mode 100644 index ab75b2ff..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/ql.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("codeqlls") diff --git a/.local/share/lunarvim/site/after/ftplugin/r.lua b/.local/share/lunarvim/site/after/ftplugin/r.lua deleted file mode 100644 index f8a22c30..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/r.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("r_language_server") diff --git a/.local/share/lunarvim/site/after/ftplugin/reason.lua b/.local/share/lunarvim/site/after/ftplugin/reason.lua deleted file mode 100644 index 867d4d80..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/reason.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("ocamllsp") diff --git a/.local/share/lunarvim/site/after/ftplugin/rescript.lua b/.local/share/lunarvim/site/after/ftplugin/rescript.lua deleted file mode 100644 index e61d33b9..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/rescript.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("rescriptls") diff --git a/.local/share/lunarvim/site/after/ftplugin/rmd.lua b/.local/share/lunarvim/site/after/ftplugin/rmd.lua deleted file mode 100644 index f8a22c30..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/rmd.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("r_language_server") diff --git a/.local/share/lunarvim/site/after/ftplugin/robot.lua b/.local/share/lunarvim/site/after/ftplugin/robot.lua deleted file mode 100644 index 98044628..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/robot.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("robotframework_ls") diff --git a/.local/share/lunarvim/site/after/ftplugin/ruby.lua b/.local/share/lunarvim/site/after/ftplugin/ruby.lua deleted file mode 100644 index 78f45967..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/ruby.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("solargraph") diff --git a/.local/share/lunarvim/site/after/ftplugin/rust.lua b/.local/share/lunarvim/site/after/ftplugin/rust.lua deleted file mode 100644 index 59100a4a..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/rust.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("rust_analyzer") diff --git a/.local/share/lunarvim/site/after/ftplugin/scss.lua b/.local/share/lunarvim/site/after/ftplugin/scss.lua deleted file mode 100644 index 0bf4b813..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/scss.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("cssls") diff --git a/.local/share/lunarvim/site/after/ftplugin/sh.lua b/.local/share/lunarvim/site/after/ftplugin/sh.lua deleted file mode 100644 index 6a10d0b2..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/sh.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("bashls") diff --git a/.local/share/lunarvim/site/after/ftplugin/slint.lua b/.local/share/lunarvim/site/after/ftplugin/slint.lua deleted file mode 100644 index 228ca57f..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/slint.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("slint_lsp") diff --git a/.local/share/lunarvim/site/after/ftplugin/sls.lua b/.local/share/lunarvim/site/after/ftplugin/sls.lua deleted file mode 100644 index 463d0685..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/sls.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("salt_ls") diff --git a/.local/share/lunarvim/site/after/ftplugin/solidity.lua b/.local/share/lunarvim/site/after/ftplugin/solidity.lua deleted file mode 100644 index d9915e94..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/solidity.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("solc") diff --git a/.local/share/lunarvim/site/after/ftplugin/svelte.lua b/.local/share/lunarvim/site/after/ftplugin/svelte.lua deleted file mode 100644 index be877b2a..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/svelte.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("svelte") diff --git a/.local/share/lunarvim/site/after/ftplugin/svg.lua b/.local/share/lunarvim/site/after/ftplugin/svg.lua deleted file mode 100644 index 8146e7d9..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/svg.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("lemminx") diff --git a/.local/share/lunarvim/site/after/ftplugin/systemverilog.lua b/.local/share/lunarvim/site/after/ftplugin/systemverilog.lua deleted file mode 100644 index bd004ddf..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/systemverilog.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("svls") diff --git a/.local/share/lunarvim/site/after/ftplugin/teal.lua b/.local/share/lunarvim/site/after/ftplugin/teal.lua deleted file mode 100644 index fd724726..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/teal.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("teal_ls") diff --git a/.local/share/lunarvim/site/after/ftplugin/terraform.lua b/.local/share/lunarvim/site/after/ftplugin/terraform.lua deleted file mode 100644 index 794a269c..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/terraform.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("terraformls") diff --git a/.local/share/lunarvim/site/after/ftplugin/tex.lua b/.local/share/lunarvim/site/after/ftplugin/tex.lua deleted file mode 100644 index 79949b52..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/tex.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("texlab") diff --git a/.local/share/lunarvim/site/after/ftplugin/toml.lua b/.local/share/lunarvim/site/after/ftplugin/toml.lua deleted file mode 100644 index 567dd37c..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/toml.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("taplo") diff --git a/.local/share/lunarvim/site/after/ftplugin/typescript.lua b/.local/share/lunarvim/site/after/ftplugin/typescript.lua deleted file mode 100644 index 2dc43d87..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/typescript.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("tsserver") diff --git a/.local/share/lunarvim/site/after/ftplugin/typescript.tsx.lua b/.local/share/lunarvim/site/after/ftplugin/typescript.tsx.lua deleted file mode 100644 index 2dc43d87..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/typescript.tsx.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("tsserver") diff --git a/.local/share/lunarvim/site/after/ftplugin/typescriptreact.lua b/.local/share/lunarvim/site/after/ftplugin/typescriptreact.lua deleted file mode 100644 index 2dc43d87..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/typescriptreact.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("tsserver") diff --git a/.local/share/lunarvim/site/after/ftplugin/vala.lua b/.local/share/lunarvim/site/after/ftplugin/vala.lua deleted file mode 100644 index 2cf2542c..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/vala.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("vala_ls") diff --git a/.local/share/lunarvim/site/after/ftplugin/vb.lua b/.local/share/lunarvim/site/after/ftplugin/vb.lua deleted file mode 100644 index 63240414..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/vb.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("omnisharp") diff --git a/.local/share/lunarvim/site/after/ftplugin/verilog.lua b/.local/share/lunarvim/site/after/ftplugin/verilog.lua deleted file mode 100644 index bd004ddf..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/verilog.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("svls") diff --git a/.local/share/lunarvim/site/after/ftplugin/vim.lua b/.local/share/lunarvim/site/after/ftplugin/vim.lua deleted file mode 100644 index 39f217fe..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/vim.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("vimls") diff --git a/.local/share/lunarvim/site/after/ftplugin/visualforce.lua b/.local/share/lunarvim/site/after/ftplugin/visualforce.lua deleted file mode 100644 index 41e32be6..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/visualforce.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("visualforce_ls") diff --git a/.local/share/lunarvim/site/after/ftplugin/vlang.lua b/.local/share/lunarvim/site/after/ftplugin/vlang.lua deleted file mode 100644 index b28304df..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/vlang.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("vls") diff --git a/.local/share/lunarvim/site/after/ftplugin/vmasm.lua b/.local/share/lunarvim/site/after/ftplugin/vmasm.lua deleted file mode 100644 index 6b8b90c6..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/vmasm.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("asm_lsp") diff --git a/.local/share/lunarvim/site/after/ftplugin/vue.lua b/.local/share/lunarvim/site/after/ftplugin/vue.lua deleted file mode 100644 index cf45300a..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/vue.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("volar") diff --git a/.local/share/lunarvim/site/after/ftplugin/wgsl.lua b/.local/share/lunarvim/site/after/ftplugin/wgsl.lua deleted file mode 100644 index a182d697..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/wgsl.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("wgsl_analyzer") diff --git a/.local/share/lunarvim/site/after/ftplugin/xml.lua b/.local/share/lunarvim/site/after/ftplugin/xml.lua deleted file mode 100644 index 8146e7d9..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/xml.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("lemminx") diff --git a/.local/share/lunarvim/site/after/ftplugin/xsd.lua b/.local/share/lunarvim/site/after/ftplugin/xsd.lua deleted file mode 100644 index 8146e7d9..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/xsd.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("lemminx") diff --git a/.local/share/lunarvim/site/after/ftplugin/xsl.lua b/.local/share/lunarvim/site/after/ftplugin/xsl.lua deleted file mode 100644 index 8146e7d9..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/xsl.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("lemminx") diff --git a/.local/share/lunarvim/site/after/ftplugin/xslt.lua b/.local/share/lunarvim/site/after/ftplugin/xslt.lua deleted file mode 100644 index 8146e7d9..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/xslt.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("lemminx") diff --git a/.local/share/lunarvim/site/after/ftplugin/yaml.docker-compose.lua b/.local/share/lunarvim/site/after/ftplugin/yaml.docker-compose.lua deleted file mode 100644 index c01e427e..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/yaml.docker-compose.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("yamlls") diff --git a/.local/share/lunarvim/site/after/ftplugin/yaml.lua b/.local/share/lunarvim/site/after/ftplugin/yaml.lua deleted file mode 100644 index c01e427e..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/yaml.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("yamlls") diff --git a/.local/share/lunarvim/site/after/ftplugin/zig.lua b/.local/share/lunarvim/site/after/ftplugin/zig.lua deleted file mode 100644 index 40355711..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/zig.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("zls") diff --git a/.local/share/lunarvim/site/after/ftplugin/zir.lua b/.local/share/lunarvim/site/after/ftplugin/zir.lua deleted file mode 100644 index 40355711..00000000 --- a/.local/share/lunarvim/site/after/ftplugin/zir.lua +++ /dev/null @@ -1 +0,0 @@ -require("lvim.lsp.manager").setup("zls") diff --git a/.local/share/lunarvim/site/pack/packer/opt/Comment.nvim b/.local/share/lunarvim/site/pack/packer/opt/Comment.nvim deleted file mode 160000 index 3c69bab3..00000000 --- a/.local/share/lunarvim/site/pack/packer/opt/Comment.nvim +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 3c69bab36569d5d0321351ec956fc43a8d409fb0 diff --git a/.local/share/lunarvim/site/pack/packer/opt/bufferline.nvim b/.local/share/lunarvim/site/pack/packer/opt/bufferline.nvim deleted file mode 160000 index c78b3ecf..00000000 --- a/.local/share/lunarvim/site/pack/packer/opt/bufferline.nvim +++ /dev/null @@ -1 +0,0 @@ -Subproject commit c78b3ecf9539a719828bca82fc7ddb9b3ba0c353 diff --git a/.local/share/lunarvim/site/pack/packer/opt/codi.vim b/.local/share/lunarvim/site/pack/packer/opt/codi.vim deleted file mode 160000 index c120785c..00000000 --- a/.local/share/lunarvim/site/pack/packer/opt/codi.vim +++ /dev/null @@ -1 +0,0 @@ -Subproject commit c120785c950f9991d32d3d4d2f3696fa8a8b5582 diff --git a/.local/share/lunarvim/site/pack/packer/opt/diffview.nvim b/.local/share/lunarvim/site/pack/packer/opt/diffview.nvim deleted file mode 160000 index a1ab9602..00000000 --- a/.local/share/lunarvim/site/pack/packer/opt/diffview.nvim +++ /dev/null @@ -1 +0,0 @@ -Subproject commit a1ab9602ee1d4c78e81bc6032edca6df480aa296 diff --git a/.local/share/lunarvim/site/pack/packer/opt/gitsigns.nvim b/.local/share/lunarvim/site/pack/packer/opt/gitsigns.nvim deleted file mode 160000 index c18e0168..00000000 --- a/.local/share/lunarvim/site/pack/packer/opt/gitsigns.nvim +++ /dev/null @@ -1 +0,0 @@ -Subproject commit c18e016864c92ecf9775abea1baaa161c28082c3 diff --git a/.local/share/lunarvim/site/pack/packer/opt/lua-dev.nvim b/.local/share/lunarvim/site/pack/packer/opt/lua-dev.nvim deleted file mode 160000 index 54149d1a..00000000 --- a/.local/share/lunarvim/site/pack/packer/opt/lua-dev.nvim +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 54149d1a4b70ba3442d1424a2e27fd36afd02779 diff --git a/.local/share/lunarvim/site/pack/packer/opt/numb.nvim b/.local/share/lunarvim/site/pack/packer/opt/numb.nvim deleted file mode 160000 index 453c50ab..00000000 --- a/.local/share/lunarvim/site/pack/packer/opt/numb.nvim +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 453c50ab921fa066fb073d2fd0f826cb036eaf7b diff --git a/.local/share/lunarvim/site/pack/packer/opt/nvim-ts-context-commentstring b/.local/share/lunarvim/site/pack/packer/opt/nvim-ts-context-commentstring deleted file mode 160000 index 88343753..00000000 --- a/.local/share/lunarvim/site/pack/packer/opt/nvim-ts-context-commentstring +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 88343753dbe81c227a1c1fd2c8d764afb8d36269 diff --git a/.local/share/lunarvim/site/pack/packer/opt/todo-comments.nvim b/.local/share/lunarvim/site/pack/packer/opt/todo-comments.nvim deleted file mode 160000 index 98b1ebf1..00000000 --- a/.local/share/lunarvim/site/pack/packer/opt/todo-comments.nvim +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 98b1ebf198836bdc226c0562b9f906584e6c400e diff --git a/.local/share/lunarvim/site/pack/packer/opt/toggleterm.nvim b/.local/share/lunarvim/site/pack/packer/opt/toggleterm.nvim deleted file mode 160000 index aaeed9e0..00000000 --- a/.local/share/lunarvim/site/pack/packer/opt/toggleterm.nvim +++ /dev/null @@ -1 +0,0 @@ -Subproject commit aaeed9e02167c5e8f00f25156895a6fd95403af8 diff --git a/.local/share/lunarvim/site/pack/packer/opt/vim-sanegx b/.local/share/lunarvim/site/pack/packer/opt/vim-sanegx deleted file mode 160000 index e97c1040..00000000 --- a/.local/share/lunarvim/site/pack/packer/opt/vim-sanegx +++ /dev/null @@ -1 +0,0 @@ -Subproject commit e97c10401d781199ba1aecd07790d0771314f3f5 diff --git a/.local/share/lunarvim/site/pack/packer/opt/which-key.nvim b/.local/share/lunarvim/site/pack/packer/opt/which-key.nvim deleted file mode 160000 index f03a2594..00000000 --- a/.local/share/lunarvim/site/pack/packer/opt/which-key.nvim +++ /dev/null @@ -1 +0,0 @@ -Subproject commit f03a259482db55ac0d1972d977a8d1dde96e9651 diff --git a/.local/share/lunarvim/site/pack/packer/start/FixCursorHold.nvim b/.local/share/lunarvim/site/pack/packer/start/FixCursorHold.nvim deleted file mode 160000 index 1bfb32e7..00000000 --- a/.local/share/lunarvim/site/pack/packer/start/FixCursorHold.nvim +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 1bfb32e7ba1344925ad815cb0d7f901dbc0ff7c1 diff --git a/.local/share/lunarvim/site/pack/packer/start/LuaSnip b/.local/share/lunarvim/site/pack/packer/start/LuaSnip deleted file mode 160000 index 79b2019c..00000000 --- a/.local/share/lunarvim/site/pack/packer/start/LuaSnip +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 79b2019c68a2ff5ae4d732d50746c901dd45603a diff --git a/.local/share/lunarvim/site/pack/packer/start/alpha-nvim b/.local/share/lunarvim/site/pack/packer/start/alpha-nvim deleted file mode 160000 index ef27a59e..00000000 --- a/.local/share/lunarvim/site/pack/packer/start/alpha-nvim +++ /dev/null @@ -1 +0,0 @@ -Subproject commit ef27a59e5b4d7b1c2fe1950da3fe5b1c5f3b4c94 diff --git a/.local/share/lunarvim/site/pack/packer/start/cmp-buffer b/.local/share/lunarvim/site/pack/packer/start/cmp-buffer deleted file mode 160000 index 12463cfc..00000000 --- a/.local/share/lunarvim/site/pack/packer/start/cmp-buffer +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 12463cfcd9b14052f9effccbf1d84caa7a2d57f0 diff --git a/.local/share/lunarvim/site/pack/packer/start/cmp-nvim-lsp b/.local/share/lunarvim/site/pack/packer/start/cmp-nvim-lsp deleted file mode 160000 index affe808a..00000000 --- a/.local/share/lunarvim/site/pack/packer/start/cmp-nvim-lsp +++ /dev/null @@ -1 +0,0 @@ -Subproject commit affe808a5c56b71630f17aa7c38e15c59fd648a8 diff --git a/.local/share/lunarvim/site/pack/packer/start/cmp-path b/.local/share/lunarvim/site/pack/packer/start/cmp-path deleted file mode 160000 index 466b6b82..00000000 --- a/.local/share/lunarvim/site/pack/packer/start/cmp-path +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 466b6b8270f7ba89abd59f402c73f63c7331ff6e diff --git a/.local/share/lunarvim/site/pack/packer/start/cmp_luasnip b/.local/share/lunarvim/site/pack/packer/start/cmp_luasnip deleted file mode 160000 index a9de941b..00000000 --- a/.local/share/lunarvim/site/pack/packer/start/cmp_luasnip +++ /dev/null @@ -1 +0,0 @@ -Subproject commit a9de941bcbda508d0a45d28ae366bb3f08db2e36 diff --git a/.local/share/lunarvim/site/pack/packer/start/friendly-snippets b/.local/share/lunarvim/site/pack/packer/start/friendly-snippets deleted file mode 160000 index d27a83a3..00000000 --- a/.local/share/lunarvim/site/pack/packer/start/friendly-snippets +++ /dev/null @@ -1 +0,0 @@ -Subproject commit d27a83a363e61009278b6598703a763ce9c8e617 diff --git a/.local/share/lunarvim/site/pack/packer/start/lf.vim b/.local/share/lunarvim/site/pack/packer/start/lf.vim deleted file mode 160000 index eab8f04b..00000000 --- a/.local/share/lunarvim/site/pack/packer/start/lf.vim +++ /dev/null @@ -1 +0,0 @@ -Subproject commit eab8f04b2953f08e3fcd425585598d176369ae4b diff --git a/.local/share/lunarvim/site/pack/packer/start/lualine.nvim b/.local/share/lunarvim/site/pack/packer/start/lualine.nvim deleted file mode 160000 index 3362b28f..00000000 --- a/.local/share/lunarvim/site/pack/packer/start/lualine.nvim +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 3362b28f917acc37538b1047f187ff1b5645ecdd diff --git a/.local/share/lunarvim/site/pack/packer/start/nlsp-settings.nvim b/.local/share/lunarvim/site/pack/packer/start/nlsp-settings.nvim deleted file mode 160000 index 62d72bce..00000000 --- a/.local/share/lunarvim/site/pack/packer/start/nlsp-settings.nvim +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 62d72bce076222a424b87be9d191441283ee837c diff --git a/.local/share/lunarvim/site/pack/packer/start/null-ls.nvim b/.local/share/lunarvim/site/pack/packer/start/null-ls.nvim deleted file mode 160000 index ff40739e..00000000 --- a/.local/share/lunarvim/site/pack/packer/start/null-ls.nvim +++ /dev/null @@ -1 +0,0 @@ -Subproject commit ff40739e5be6581899b43385997e39eecdbf9465 diff --git a/.local/share/lunarvim/site/pack/packer/start/nvim-autopairs b/.local/share/lunarvim/site/pack/packer/start/nvim-autopairs deleted file mode 160000 index fa6876f8..00000000 --- a/.local/share/lunarvim/site/pack/packer/start/nvim-autopairs +++ /dev/null @@ -1 +0,0 @@ -Subproject commit fa6876f832ea1b71801c4e481d8feca9a36215ec diff --git a/.local/share/lunarvim/site/pack/packer/start/nvim-cmp b/.local/share/lunarvim/site/pack/packer/start/nvim-cmp deleted file mode 160000 index df6734aa..00000000 --- a/.local/share/lunarvim/site/pack/packer/start/nvim-cmp +++ /dev/null @@ -1 +0,0 @@ -Subproject commit df6734aa018d6feb4d76ba6bda94b1aeac2b378a diff --git a/.local/share/lunarvim/site/pack/packer/start/nvim-lsp-installer b/.local/share/lunarvim/site/pack/packer/start/nvim-lsp-installer deleted file mode 160000 index 2408a0f9..00000000 --- a/.local/share/lunarvim/site/pack/packer/start/nvim-lsp-installer +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 2408a0f9f7e27811e83f165ccecced0ba64ceb01 diff --git a/.local/share/lunarvim/site/pack/packer/start/nvim-lspconfig b/.local/share/lunarvim/site/pack/packer/start/nvim-lspconfig deleted file mode 160000 index 10c39343..00000000 --- a/.local/share/lunarvim/site/pack/packer/start/nvim-lspconfig +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 10c39343660594278599694e98290fb5e629c239 diff --git a/.local/share/lunarvim/site/pack/packer/start/nvim-notify b/.local/share/lunarvim/site/pack/packer/start/nvim-notify deleted file mode 160000 index 89602693..00000000 --- a/.local/share/lunarvim/site/pack/packer/start/nvim-notify +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 896026933d42d7e37854ce7be44ca3ad1b4b2dd2 diff --git a/.local/share/lunarvim/site/pack/packer/start/nvim-tree.lua b/.local/share/lunarvim/site/pack/packer/start/nvim-tree.lua deleted file mode 160000 index bdb6d4a2..00000000 --- a/.local/share/lunarvim/site/pack/packer/start/nvim-tree.lua +++ /dev/null @@ -1 +0,0 @@ -Subproject commit bdb6d4a25410da35bbf7ce0dbdaa8d60432bc243 diff --git a/.local/share/lunarvim/site/pack/packer/start/nvim-treesitter b/.local/share/lunarvim/site/pack/packer/start/nvim-treesitter deleted file mode 160000 index 518e2758..00000000 --- a/.local/share/lunarvim/site/pack/packer/start/nvim-treesitter +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 518e27589c0463af15463c9d675c65e464efc2fe diff --git a/.local/share/lunarvim/site/pack/packer/start/nvim-web-devicons b/.local/share/lunarvim/site/pack/packer/start/nvim-web-devicons deleted file mode 160000 index 8d2c5337..00000000 --- a/.local/share/lunarvim/site/pack/packer/start/nvim-web-devicons +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 8d2c5337f0a2d0a17de8e751876eeb192b32310e diff --git a/.local/share/lunarvim/site/pack/packer/start/packer.nvim b/.local/share/lunarvim/site/pack/packer/start/packer.nvim deleted file mode 160000 index 00ec5ade..00000000 --- a/.local/share/lunarvim/site/pack/packer/start/packer.nvim +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 00ec5adef58c5ff9a07f11f45903b9dbbaa1b422 diff --git a/.local/share/lunarvim/site/pack/packer/start/plenary.nvim b/.local/share/lunarvim/site/pack/packer/start/plenary.nvim deleted file mode 160000 index 968a4b9a..00000000 --- a/.local/share/lunarvim/site/pack/packer/start/plenary.nvim +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 968a4b9afec0c633bc369662e78f8c5db0eba249 diff --git a/.local/share/lunarvim/site/pack/packer/start/popup.nvim b/.local/share/lunarvim/site/pack/packer/start/popup.nvim deleted file mode 160000 index b7404d35..00000000 --- a/.local/share/lunarvim/site/pack/packer/start/popup.nvim +++ /dev/null @@ -1 +0,0 @@ -Subproject commit b7404d35d5d3548a82149238289fa71f7f6de4ac diff --git a/.local/share/lunarvim/site/pack/packer/start/project.nvim b/.local/share/lunarvim/site/pack/packer/start/project.nvim deleted file mode 160000 index 541115e7..00000000 --- a/.local/share/lunarvim/site/pack/packer/start/project.nvim +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 541115e762764bc44d7d3bf501b6e367842d3d4f diff --git a/.local/share/lunarvim/site/pack/packer/start/schemastore.nvim b/.local/share/lunarvim/site/pack/packer/start/schemastore.nvim deleted file mode 160000 index a32911d7..00000000 --- a/.local/share/lunarvim/site/pack/packer/start/schemastore.nvim +++ /dev/null @@ -1 +0,0 @@ -Subproject commit a32911d7036677a0d9823b1502d9a68a109eaf06 diff --git a/.local/share/lunarvim/site/pack/packer/start/structlog.nvim b/.local/share/lunarvim/site/pack/packer/start/structlog.nvim deleted file mode 160000 index 232a8e26..00000000 --- a/.local/share/lunarvim/site/pack/packer/start/structlog.nvim +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 232a8e26060440e0db9fefba857036442b34227d diff --git a/.local/share/lunarvim/site/pack/packer/start/telescope-fzf-native.nvim b/.local/share/lunarvim/site/pack/packer/start/telescope-fzf-native.nvim deleted file mode 160000 index 6a33ecef..00000000 --- a/.local/share/lunarvim/site/pack/packer/start/telescope-fzf-native.nvim +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 6a33ecefa9b3d9ade654f9a7a6396a00c3758ca6 diff --git a/.local/share/lunarvim/site/pack/packer/start/telescope.nvim b/.local/share/lunarvim/site/pack/packer/start/telescope.nvim deleted file mode 160000 index d96eaa91..00000000 --- a/.local/share/lunarvim/site/pack/packer/start/telescope.nvim +++ /dev/null @@ -1 +0,0 @@ -Subproject commit d96eaa914aab6cfc4adccb34af421bdd496468b0 diff --git a/.local/share/lunarvim/site/pack/packer/start/tokyonight.nvim b/.local/share/lunarvim/site/pack/packer/start/tokyonight.nvim deleted file mode 160000 index 8223c970..00000000 --- a/.local/share/lunarvim/site/pack/packer/start/tokyonight.nvim +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 8223c970677e4d88c9b6b6d81bda23daf11062bb diff --git a/.local/share/lunarvim/site/pack/packer/start/vim-floaterm b/.local/share/lunarvim/site/pack/packer/start/vim-floaterm deleted file mode 160000 index e3f2d94d..00000000 --- a/.local/share/lunarvim/site/pack/packer/start/vim-floaterm +++ /dev/null @@ -1 +0,0 @@ -Subproject commit e3f2d94d722603f8b65088ea1d7e0329951985bd diff --git a/.local/share/lunarvim/site/pack/packer/start/vim-repeat b/.local/share/lunarvim/site/pack/packer/start/vim-repeat deleted file mode 160000 index 24afe922..00000000 --- a/.local/share/lunarvim/site/pack/packer/start/vim-repeat +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 24afe922e6a05891756ecf331f39a1f6743d3d5a diff --git a/.local/src/dmenu/FUNDING.yml b/.local/src/dmenu/FUNDING.yml deleted file mode 100644 index f8e60767..00000000 --- a/.local/src/dmenu/FUNDING.yml +++ /dev/null @@ -1,3 +0,0 @@ -github: lukesmithxyz -custom: ["https://lukesmith.xyz/donate", "https://paypal.me/lukemsmith", "https://lukesmith.xyz/crypto"] -patreon: lukesmith diff --git a/.local/src/dmenu/LICENSE b/.local/src/dmenu/LICENSE deleted file mode 100644 index 3afd28ed..00000000 --- a/.local/src/dmenu/LICENSE +++ /dev/null @@ -1,30 +0,0 @@ -MIT/X Consortium License - -© 2006-2019 Anselm R Garbe -© 2006-2008 Sander van Dijk -© 2006-2007 Michał Janeczek -© 2007 Kris Maglione -© 2009 Gottox -© 2009 Markus Schnalke -© 2009 Evan Gates -© 2010-2012 Connor Lane Smith -© 2014-2020 Hiltjo Posthuma -© 2015-2019 Quentin Rameau - -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/.local/src/dmenu/Makefile b/.local/src/dmenu/Makefile deleted file mode 100644 index 244961a6..00000000 --- a/.local/src/dmenu/Makefile +++ /dev/null @@ -1,64 +0,0 @@ -# dmenu - dynamic menu -# See LICENSE file for copyright and license details. - -include config.mk - -SRC = drw.c dmenu.c stest.c util.c -OBJ = $(SRC:.c=.o) - -all: options dmenu stest - -options: - @echo dmenu build options: - @echo "CFLAGS = $(CFLAGS)" - @echo "LDFLAGS = $(LDFLAGS)" - @echo "CC = $(CC)" - -.c.o: - $(CC) -c $(CFLAGS) $< - -config.h: - cp config.def.h $@ - -$(OBJ): arg.h config.h config.mk drw.h - -dmenu: dmenu.o drw.o util.o - $(CC) -o $@ dmenu.o drw.o util.o $(LDFLAGS) - -stest: stest.o - $(CC) -o $@ stest.o $(LDFLAGS) - -clean: - rm -f dmenu stest $(OBJ) dmenu-$(VERSION).tar.gz *.rej *.orig - -dist: clean - mkdir -p dmenu-$(VERSION) - cp LICENSE Makefile README arg.h config.def.h config.mk dmenu.1\ - drw.h util.h dmenu_path dmenu_run stest.1 $(SRC)\ - dmenu-$(VERSION) - tar -cf dmenu-$(VERSION).tar dmenu-$(VERSION) - gzip dmenu-$(VERSION).tar - rm -rf dmenu-$(VERSION) - -install: all - mkdir -p $(DESTDIR)$(PREFIX)/bin - cp -f dmenu dmenu_path dmenu_run stest $(DESTDIR)$(PREFIX)/bin - chmod 755 $(DESTDIR)$(PREFIX)/bin/dmenu - chmod 755 $(DESTDIR)$(PREFIX)/bin/dmenu_path - chmod 755 $(DESTDIR)$(PREFIX)/bin/dmenu_run - chmod 755 $(DESTDIR)$(PREFIX)/bin/stest - mkdir -p $(DESTDIR)$(MANPREFIX)/man1 - sed "s/VERSION/$(VERSION)/g" < dmenu.1 > $(DESTDIR)$(MANPREFIX)/man1/dmenu.1 - sed "s/VERSION/$(VERSION)/g" < stest.1 > $(DESTDIR)$(MANPREFIX)/man1/stest.1 - chmod 644 $(DESTDIR)$(MANPREFIX)/man1/dmenu.1 - chmod 644 $(DESTDIR)$(MANPREFIX)/man1/stest.1 - -uninstall: - rm -f $(DESTDIR)$(PREFIX)/bin/dmenu\ - $(DESTDIR)$(PREFIX)/bin/dmenu_path\ - $(DESTDIR)$(PREFIX)/bin/dmenu_run\ - $(DESTDIR)$(PREFIX)/bin/stest\ - $(DESTDIR)$(MANPREFIX)/man1/dmenu.1\ - $(DESTDIR)$(MANPREFIX)/man1/stest.1 - -.PHONY: all options clean dist install uninstall diff --git a/.local/src/dmenu/README.md b/.local/src/dmenu/README.md deleted file mode 100644 index c8fb594d..00000000 --- a/.local/src/dmenu/README.md +++ /dev/null @@ -1,16 +0,0 @@ -# Luke's dmenu - -Extra stuff added to vanilla dmenu: - -- reads Xresources (ergo pywal compatible) -- alpha patch, which importantly allows this build to be embedded in transparent st -- can view color characters like emoji (libxft-bgra is required for this reason) -- `-P` for password mode: hide user input -- `-r` to reject non-matching input -- dmenu options are mouse clickable - -## Installation - -You must have `libxft-bgra` installed until the libxft upstream is fixed. - -After making any config changes that you want, but `make`, `sudo make install` it. diff --git a/.local/src/dmenu/arg.h b/.local/src/dmenu/arg.h deleted file mode 100644 index e94e02bb..00000000 --- a/.local/src/dmenu/arg.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copy me if you can. - * by 20h - */ - -#ifndef ARG_H__ -#define ARG_H__ - -extern char *argv0; - -/* use main(int argc, char *argv[]) */ -#define ARGBEGIN for (argv0 = *argv, argv++, argc--;\ - argv[0] && argv[0][0] == '-'\ - && argv[0][1];\ - argc--, argv++) {\ - char argc_;\ - char **argv_;\ - int brk_;\ - if (argv[0][1] == '-' && argv[0][2] == '\0') {\ - argv++;\ - argc--;\ - break;\ - }\ - for (brk_ = 0, argv[0]++, argv_ = argv;\ - argv[0][0] && !brk_;\ - argv[0]++) {\ - if (argv_ != argv)\ - break;\ - argc_ = argv[0][0];\ - switch (argc_) - -#define ARGEND }\ - } - -#define ARGC() argc_ - -#define EARGF(x) ((argv[0][1] == '\0' && argv[1] == NULL)?\ - ((x), abort(), (char *)0) :\ - (brk_ = 1, (argv[0][1] != '\0')?\ - (&argv[0][1]) :\ - (argc--, argv++, argv[0]))) - -#define ARGF() ((argv[0][1] == '\0' && argv[1] == NULL)?\ - (char *)0 :\ - (brk_ = 1, (argv[0][1] != '\0')?\ - (&argv[0][1]) :\ - (argc--, argv++, argv[0]))) - -#endif diff --git a/.local/src/dmenu/config.h b/.local/src/dmenu/config.h deleted file mode 100644 index 5fbe2257..00000000 --- a/.local/src/dmenu/config.h +++ /dev/null @@ -1,33 +0,0 @@ -/* See LICENSE file for copyright and license details. */ -/* Default settings; can be overriden by command line. */ - -static int topbar = 1; /* -b option; if 0, dmenu appears at bottom */ -/* -fn option overrides fonts[0]; default X11 font or font set */ -static const char *fonts[] = { - "monospace:size=10", - "JoyPixels:pixelsize=8:antialias=true:autohint=true" -}; -static const unsigned int bgalpha = 0xe0; -static const unsigned int fgalpha = OPAQUE; -static const char *prompt = NULL; /* -p option; prompt to the left of input field */ -static const char *colors[SchemeLast][2] = { - /* fg bg */ - [SchemeNorm] = { "#bbbbbb", "#222222" }, - [SchemeSel] = { "#eeeeee", "#005577" }, - [SchemeOut] = { "#000000", "#00ffff" }, -}; -static const unsigned int alphas[SchemeLast][2] = { - /* fgalpha bgalphga */ - [SchemeNorm] = { fgalpha, bgalpha }, - [SchemeSel] = { fgalpha, bgalpha }, - [SchemeOut] = { fgalpha, bgalpha }, -}; - -/* -l option; if nonzero, dmenu uses vertical list with given number of lines */ -static unsigned int lines = 0; - -/* - * Characters not considered part of a word while deleting words - * for example: " /?\"&[]" - */ -static const char worddelimiters[] = " "; diff --git a/.local/src/dmenu/config.mk b/.local/src/dmenu/config.mk deleted file mode 100644 index 8531fb99..00000000 --- a/.local/src/dmenu/config.mk +++ /dev/null @@ -1,31 +0,0 @@ -# dmenu version -VERSION = 5.0 - -# paths -PREFIX = /usr/local -MANPREFIX = $(PREFIX)/share/man - -X11INC = /usr/X11R6/include -X11LIB = /usr/X11R6/lib - -# Xinerama, comment if you don't want it -XINERAMALIBS = -lXinerama -XINERAMAFLAGS = -DXINERAMA - -# freetype -FREETYPELIBS = -lfontconfig -lXft -FREETYPEINC = /usr/include/freetype2 -# OpenBSD (uncomment) -#FREETYPEINC = $(X11INC)/freetype2 - -# includes and libs -INCS = -I$(X11INC) -I$(FREETYPEINC) -LIBS = -L$(X11LIB) -lX11 $(XINERAMALIBS) $(FREETYPELIBS) -lXrender - -# flags -CPPFLAGS = -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_XOPEN_SOURCE=700 -D_POSIX_C_SOURCE=200809L -DVERSION=\"$(VERSION)\" $(XINERAMAFLAGS) -CFLAGS = -std=c99 -pedantic -Wall -Os $(INCS) $(CPPFLAGS) -LDFLAGS = $(LIBS) - -# compiler and linker -CC = cc diff --git a/.local/src/dmenu/dmenu b/.local/src/dmenu/dmenu deleted file mode 100755 index ffc3698e..00000000 Binary files a/.local/src/dmenu/dmenu and /dev/null differ diff --git a/.local/src/dmenu/dmenu.1 b/.local/src/dmenu/dmenu.1 deleted file mode 100644 index 4c870749..00000000 --- a/.local/src/dmenu/dmenu.1 +++ /dev/null @@ -1,200 +0,0 @@ -.TH DMENU 1 dmenu\-VERSION -.SH NAME -dmenu \- dynamic menu -.SH SYNOPSIS -.B dmenu -.RB [ \-bfirvP ] -.RB [ \-l -.IR lines ] -.RB [ \-m -.IR monitor ] -.RB [ \-p -.IR prompt ] -.RB [ \-fn -.IR font ] -.RB [ \-nb -.IR color ] -.RB [ \-nf -.IR color ] -.RB [ \-sb -.IR color ] -.RB [ \-sf -.IR color ] -.RB [ \-w -.IR windowid ] -.P -.BR dmenu_run " ..." -.SH DESCRIPTION -.B dmenu -is a dynamic menu for X, which reads a list of newline\-separated items from -stdin. When the user selects an item and presses Return, their choice is printed -to stdout and dmenu terminates. Entering text will narrow the items to those -matching the tokens in the input. -.P -.B dmenu_run -is a script used by -.IR dwm (1) -which lists programs in the user's $PATH and runs the result in their $SHELL. -.SH OPTIONS -.TP -.B \-b -dmenu appears at the bottom of the screen. -.TP -.B \-f -dmenu grabs the keyboard before reading stdin if not reading from a tty. This -is faster, but will lock up X until stdin reaches end\-of\-file. -.TP -.B \-i -dmenu matches menu items case insensitively. -.TP -.B \-P -dmenu will not directly display the keyboard input, but instead replace it with dots. All data from stdin will be ignored. -.TP -.B \-r -dmenu will reject any input which would result in no matching option left. -.TP -.BI \-l " lines" -dmenu lists items vertically, with the given number of lines. -.TP -.BI \-m " monitor" -dmenu is displayed on the monitor number supplied. Monitor numbers are starting -from 0. -.TP -.BI \-p " prompt" -defines the prompt to be displayed to the left of the input field. -.TP -.BI \-fn " font" -defines the font or font set used. -.TP -.BI \-nb " color" -defines the normal background color. -.IR #RGB , -.IR #RRGGBB , -and X color names are supported. -.TP -.BI \-nf " color" -defines the normal foreground color. -.TP -.BI \-sb " color" -defines the selected background color. -.TP -.BI \-sf " color" -defines the selected foreground color. -.TP -.B \-v -prints version information to stdout, then exits. -.TP -.BI \-w " windowid" -embed into windowid. -.SH USAGE -dmenu is completely controlled by the keyboard. Items are selected using the -arrow keys, page up, page down, home, and end. -.TP -.B Tab -Copy the selected item to the input field. -.TP -.B Return -Confirm selection. Prints the selected item to stdout and exits, returning -success. -.TP -.B Ctrl-Return -Confirm selection. Prints the selected item to stdout and continues. -.TP -.B Shift\-Return -Confirm input. Prints the input text to stdout and exits, returning success. -.TP -.B Escape -Exit without selecting an item, returning failure. -.TP -.B Ctrl-Left -Move cursor to the start of the current word -.TP -.B Ctrl-Right -Move cursor to the end of the current word -.TP -.B C\-a -Home -.TP -.B C\-b -Left -.TP -.B C\-c -Escape -.TP -.B C\-d -Delete -.TP -.B C\-e -End -.TP -.B C\-f -Right -.TP -.B C\-g -Escape -.TP -.B C\-h -Backspace -.TP -.B C\-i -Tab -.TP -.B C\-j -Return -.TP -.B C\-J -Shift-Return -.TP -.B C\-k -Delete line right -.TP -.B C\-m -Return -.TP -.B C\-M -Shift-Return -.TP -.B C\-n -Down -.TP -.B C\-p -Up -.TP -.B C\-u -Delete line left -.TP -.B C\-w -Delete word left -.TP -.B C\-y -Paste from primary X selection -.TP -.B C\-Y -Paste from X clipboard -.TP -.B M\-b -Move cursor to the start of the current word -.TP -.B M\-f -Move cursor to the end of the current word -.TP -.B M\-g -Home -.TP -.B M\-G -End -.TP -.B M\-h -Up -.TP -.B M\-j -Page down -.TP -.B M\-k -Page up -.TP -.B M\-l -Down -.SH SEE ALSO -.IR dwm (1), -.IR stest (1) diff --git a/.local/src/dmenu/dmenu.c b/.local/src/dmenu/dmenu.c deleted file mode 100644 index bde0869e..00000000 --- a/.local/src/dmenu/dmenu.c +++ /dev/null @@ -1,995 +0,0 @@ -/* See LICENSE file for copyright and license details. */ -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#ifdef XINERAMA -#include -#endif -#include -#include - -#include "drw.h" -#include "util.h" - -/* macros */ -#define INTERSECT(x,y,w,h,r) (MAX(0, MIN((x)+(w),(r).x_org+(r).width) - MAX((x),(r).x_org)) \ - && MAX(0, MIN((y)+(h),(r).y_org+(r).height) - MAX((y),(r).y_org))) -#define LENGTH(X) (sizeof X / sizeof X[0]) -#define TEXTW(X) (drw_fontset_getwidth(drw, (X)) + lrpad) - -/* define opaqueness */ -#define OPAQUE 0xFFU - -/* enums */ -enum { SchemeNorm, SchemeSel, SchemeOut, SchemeLast }; /* color schemes */ - -struct item { - char *text; - struct item *left, *right; - int out; -}; - -static char text[BUFSIZ] = ""; -static char *embed; -static int bh, mw, mh; -static int inputw = 0, promptw, passwd = 0; -static int lrpad; /* sum of left and right padding */ -static int reject_no_match = 0; -static size_t cursor; -static struct item *items = NULL; -static struct item *matches, *matchend; -static struct item *prev, *curr, *next, *sel; -static int mon = -1, screen; - -static Atom clip, utf8; -static Display *dpy; -static Window root, parentwin, win; -static XIC xic; - -static Drw *drw; -static int usergb = 0; -static Visual *visual; -static int depth; -static Colormap cmap; -static Clr *scheme[SchemeLast]; - -#include "config.h" - -static int (*fstrncmp)(const char *, const char *, size_t) = strncmp; -static char *(*fstrstr)(const char *, const char *) = strstr; - - -static void -xinitvisual() -{ - XVisualInfo *infos; - XRenderPictFormat *fmt; - int nitems; - int i; - - XVisualInfo tpl = { - .screen = screen, - .depth = 32, - .class = TrueColor - }; - - long masks = VisualScreenMask | VisualDepthMask | VisualClassMask; - - infos = XGetVisualInfo(dpy, masks, &tpl, &nitems); - visual = NULL; - - for (i = 0; i < nitems; i++){ - fmt = XRenderFindVisualFormat(dpy, infos[i].visual); - if (fmt->type == PictTypeDirect && fmt->direct.alphaMask) { - visual = infos[i].visual; - depth = infos[i].depth; - cmap = XCreateColormap(dpy, root, visual, AllocNone); - usergb = 1; - break; - } - } - - XFree(infos); - - if (! visual) { - visual = DefaultVisual(dpy, screen); - depth = DefaultDepth(dpy, screen); - cmap = DefaultColormap(dpy, screen); - } -} - -static void -appenditem(struct item *item, struct item **list, struct item **last) -{ - if (*last) - (*last)->right = item; - else - *list = item; - - item->left = *last; - item->right = NULL; - *last = item; -} - -static void -calcoffsets(void) -{ - int i, n; - - if (lines > 0) - n = lines * bh; - else - n = mw - (promptw + inputw + TEXTW("<") + TEXTW(">")); - /* calculate which items will begin the next page and previous page */ - for (i = 0, next = curr; next; next = next->right) - if ((i += (lines > 0) ? bh : MIN(TEXTW(next->text), n)) > n) - break; - for (i = 0, prev = curr; prev && prev->left; prev = prev->left) - if ((i += (lines > 0) ? bh : MIN(TEXTW(prev->left->text), n)) > n) - break; -} - -static void -cleanup(void) -{ - size_t i; - - XUngrabKey(dpy, AnyKey, AnyModifier, root); - for (i = 0; i < SchemeLast; i++) - free(scheme[i]); - drw_free(drw); - XSync(dpy, False); - XCloseDisplay(dpy); -} - -static char * -cistrstr(const char *s, const char *sub) -{ - size_t len; - - for (len = strlen(sub); *s; s++) - if (!strncasecmp(s, sub, len)) - return (char *)s; - return NULL; -} - -static int -drawitem(struct item *item, int x, int y, int w) -{ - if (item == sel) - drw_setscheme(drw, scheme[SchemeSel]); - else if (item->out) - drw_setscheme(drw, scheme[SchemeOut]); - else - drw_setscheme(drw, scheme[SchemeNorm]); - - return drw_text(drw, x, y, w, bh, lrpad / 2, item->text, 0); -} - -static void -drawmenu(void) -{ - unsigned int curpos; - struct item *item; - int x = 0, y = 0, w; - char *censort; - - drw_setscheme(drw, scheme[SchemeNorm]); - drw_rect(drw, 0, 0, mw, mh, 1, 1); - - if (prompt && *prompt) { - drw_setscheme(drw, scheme[SchemeSel]); - x = drw_text(drw, x, 0, promptw, bh, lrpad / 2, prompt, 0); - } - /* draw input field */ - w = (lines > 0 || !matches) ? mw - x : inputw; - drw_setscheme(drw, scheme[SchemeNorm]); - if (passwd) { - censort = ecalloc(1, sizeof(text)); - memset(censort, '.', strlen(text)); - drw_text(drw, x, 0, w, bh, lrpad / 2, censort, 0); - free(censort); - } else drw_text(drw, x, 0, w, bh, lrpad / 2, text, 0); - - curpos = TEXTW(text) - TEXTW(&text[cursor]); - if ((curpos += lrpad / 2 - 1) < w) { - drw_setscheme(drw, scheme[SchemeNorm]); - drw_rect(drw, x + curpos, 2, 2, bh - 4, 1, 0); - } - - if (lines > 0) { - /* draw vertical list */ - for (item = curr; item != next; item = item->right) - drawitem(item, x, y += bh, mw - x); - } else if (matches) { - /* draw horizontal list */ - x += inputw; - w = TEXTW("<"); - if (curr->left) { - drw_setscheme(drw, scheme[SchemeNorm]); - drw_text(drw, x, 0, w, bh, lrpad / 2, "<", 0); - } - x += w; - for (item = curr; item != next; item = item->right) - x = drawitem(item, x, 0, MIN(TEXTW(item->text), mw - x - TEXTW(">"))); - if (next) { - w = TEXTW(">"); - drw_setscheme(drw, scheme[SchemeNorm]); - drw_text(drw, mw - w, 0, w, bh, lrpad / 2, ">", 0); - } - } - drw_map(drw, win, 0, 0, mw, mh); -} - -static void -grabfocus(void) -{ - struct timespec ts = { .tv_sec = 0, .tv_nsec = 10000000 }; - Window focuswin; - int i, revertwin; - - for (i = 0; i < 100; ++i) { - XGetInputFocus(dpy, &focuswin, &revertwin); - if (focuswin == win) - return; - XSetInputFocus(dpy, win, RevertToParent, CurrentTime); - nanosleep(&ts, NULL); - } - die("cannot grab focus"); -} - -static void -grabkeyboard(void) -{ - struct timespec ts = { .tv_sec = 0, .tv_nsec = 1000000 }; - int i; - - if (embed) - return; - /* try to grab keyboard, we may have to wait for another process to ungrab */ - for (i = 0; i < 1000; i++) { - if (XGrabKeyboard(dpy, DefaultRootWindow(dpy), True, GrabModeAsync, - GrabModeAsync, CurrentTime) == GrabSuccess) - return; - nanosleep(&ts, NULL); - } - die("cannot grab keyboard"); -} - -static void -match(void) -{ - static char **tokv = NULL; - static int tokn = 0; - - char buf[sizeof text], *s; - int i, tokc = 0; - size_t len, textsize; - struct item *item, *lprefix, *lsubstr, *prefixend, *substrend; - - strcpy(buf, text); - /* separate input text into tokens to be matched individually */ - for (s = strtok(buf, " "); s; tokv[tokc - 1] = s, s = strtok(NULL, " ")) - if (++tokc > tokn && !(tokv = realloc(tokv, ++tokn * sizeof *tokv))) - die("cannot realloc %u bytes:", tokn * sizeof *tokv); - len = tokc ? strlen(tokv[0]) : 0; - - matches = lprefix = lsubstr = matchend = prefixend = substrend = NULL; - textsize = strlen(text) + 1; - for (item = items; item && item->text; item++) { - for (i = 0; i < tokc; i++) - if (!fstrstr(item->text, tokv[i])) - break; - if (i != tokc) /* not all tokens match */ - continue; - /* exact matches go first, then prefixes, then substrings */ - if (!tokc || !fstrncmp(text, item->text, textsize)) - appenditem(item, &matches, &matchend); - else if (!fstrncmp(tokv[0], item->text, len)) - appenditem(item, &lprefix, &prefixend); - else - appenditem(item, &lsubstr, &substrend); - } - if (lprefix) { - if (matches) { - matchend->right = lprefix; - lprefix->left = matchend; - } else - matches = lprefix; - matchend = prefixend; - } - if (lsubstr) { - if (matches) { - matchend->right = lsubstr; - lsubstr->left = matchend; - } else - matches = lsubstr; - matchend = substrend; - } - curr = sel = matches; - calcoffsets(); -} - -static void -insert(const char *str, ssize_t n) -{ - if (strlen(text) + n > sizeof text - 1) - return; - - static char last[BUFSIZ] = ""; - if(reject_no_match) { - /* store last text value in case we need to revert it */ - memcpy(last, text, BUFSIZ); - } - - /* move existing text out of the way, insert new text, and update cursor */ - memmove(&text[cursor + n], &text[cursor], sizeof text - cursor - MAX(n, 0)); - if (n > 0) - memcpy(&text[cursor], str, n); - cursor += n; - match(); - - if(!matches && reject_no_match) { - /* revert to last text value if theres no match */ - memcpy(text, last, BUFSIZ); - cursor -= n; - match(); - } -} - -static size_t -nextrune(int inc) -{ - ssize_t n; - - /* return location of next utf8 rune in the given direction (+1 or -1) */ - for (n = cursor + inc; n + inc >= 0 && (text[n] & 0xc0) == 0x80; n += inc) - ; - return n; -} - -static void -movewordedge(int dir) -{ - if (dir < 0) { /* move cursor to the start of the word*/ - while (cursor > 0 && strchr(worddelimiters, text[nextrune(-1)])) - cursor = nextrune(-1); - while (cursor > 0 && !strchr(worddelimiters, text[nextrune(-1)])) - cursor = nextrune(-1); - } else { /* move cursor to the end of the word */ - while (text[cursor] && strchr(worddelimiters, text[cursor])) - cursor = nextrune(+1); - while (text[cursor] && !strchr(worddelimiters, text[cursor])) - cursor = nextrune(+1); - } -} - -static void -keypress(XKeyEvent *ev) -{ - char buf[32]; - int len; - KeySym ksym; - Status status; - - len = XmbLookupString(xic, ev, buf, sizeof buf, &ksym, &status); - switch (status) { - default: /* XLookupNone, XBufferOverflow */ - return; - case XLookupChars: - goto insert; - case XLookupKeySym: - case XLookupBoth: - break; - } - - if (ev->state & ControlMask) { - switch(ksym) { - case XK_a: ksym = XK_Home; break; - case XK_b: ksym = XK_Left; break; - case XK_c: ksym = XK_Escape; break; - case XK_d: ksym = XK_Delete; break; - case XK_e: ksym = XK_End; break; - case XK_f: ksym = XK_Right; break; - case XK_g: ksym = XK_Escape; break; - case XK_h: ksym = XK_BackSpace; break; - case XK_i: ksym = XK_Tab; break; - case XK_j: /* fallthrough */ - case XK_J: /* fallthrough */ - case XK_m: /* fallthrough */ - case XK_M: ksym = XK_Return; ev->state &= ~ControlMask; break; - case XK_n: ksym = XK_Down; break; - case XK_p: ksym = XK_Up; break; - - case XK_k: /* delete right */ - text[cursor] = '\0'; - match(); - break; - case XK_u: /* delete left */ - insert(NULL, 0 - cursor); - break; - case XK_w: /* delete word */ - while (cursor > 0 && strchr(worddelimiters, text[nextrune(-1)])) - insert(NULL, nextrune(-1) - cursor); - while (cursor > 0 && !strchr(worddelimiters, text[nextrune(-1)])) - insert(NULL, nextrune(-1) - cursor); - break; - case XK_y: /* paste selection */ - case XK_Y: - XConvertSelection(dpy, (ev->state & ShiftMask) ? clip : XA_PRIMARY, - utf8, utf8, win, CurrentTime); - return; - case XK_Left: - movewordedge(-1); - goto draw; - case XK_Right: - movewordedge(+1); - goto draw; - case XK_Return: - case XK_KP_Enter: - break; - case XK_bracketleft: - cleanup(); - exit(1); - default: - return; - } - } else if (ev->state & Mod1Mask) { - switch(ksym) { - case XK_b: - movewordedge(-1); - goto draw; - case XK_f: - movewordedge(+1); - goto draw; - case XK_g: ksym = XK_Home; break; - case XK_G: ksym = XK_End; break; - case XK_h: ksym = XK_Up; break; - case XK_j: ksym = XK_Next; break; - case XK_k: ksym = XK_Prior; break; - case XK_l: ksym = XK_Down; break; - default: - return; - } - } - - switch(ksym) { - default: -insert: - if (!iscntrl(*buf)) - insert(buf, len); - break; - case XK_Delete: - if (text[cursor] == '\0') - return; - cursor = nextrune(+1); - /* fallthrough */ - case XK_BackSpace: - if (cursor == 0) - return; - insert(NULL, nextrune(-1) - cursor); - break; - case XK_End: - if (text[cursor] != '\0') { - cursor = strlen(text); - break; - } - if (next) { - /* jump to end of list and position items in reverse */ - curr = matchend; - calcoffsets(); - curr = prev; - calcoffsets(); - while (next && (curr = curr->right)) - calcoffsets(); - } - sel = matchend; - break; - case XK_Escape: - cleanup(); - exit(1); - case XK_Home: - if (sel == matches) { - cursor = 0; - break; - } - sel = curr = matches; - calcoffsets(); - break; - case XK_Left: - if (cursor > 0 && (!sel || !sel->left || lines > 0)) { - cursor = nextrune(-1); - break; - } - if (lines > 0) - return; - /* fallthrough */ - case XK_Up: - if (sel && sel->left && (sel = sel->left)->right == curr) { - curr = prev; - calcoffsets(); - } - break; - case XK_Next: - if (!next) - return; - sel = curr = next; - calcoffsets(); - break; - case XK_Prior: - if (!prev) - return; - sel = curr = prev; - calcoffsets(); - break; - case XK_Return: - case XK_KP_Enter: - puts((sel && !(ev->state & ShiftMask)) ? sel->text : text); - if (!(ev->state & ControlMask)) { - cleanup(); - exit(0); - } - if (sel) - sel->out = 1; - break; - case XK_Right: - if (text[cursor] != '\0') { - cursor = nextrune(+1); - break; - } - if (lines > 0) - return; - /* fallthrough */ - case XK_Down: - if (sel && sel->right && (sel = sel->right) == next) { - curr = next; - calcoffsets(); - } - break; - case XK_Tab: - if (!sel) - return; - strncpy(text, sel->text, sizeof text - 1); - text[sizeof text - 1] = '\0'; - cursor = strlen(text); - match(); - break; - } - -draw: - drawmenu(); -} - -static void -buttonpress(XEvent *e) -{ - struct item *item; - XButtonPressedEvent *ev = &e->xbutton; - int x = 0, y = 0, h = bh, w; - - if (ev->window != win) - return; - - /* right-click: exit */ - if (ev->button == Button3) - exit(1); - - if (prompt && *prompt) - x += promptw; - - /* input field */ - w = (lines > 0 || !matches) ? mw - x : inputw; - - /* left-click on input: clear input, - * NOTE: if there is no left-arrow the space for < is reserved so - * add that to the input width */ - if (ev->button == Button1 && - ((lines <= 0 && ev->x >= 0 && ev->x <= x + w + - ((!prev || !curr->left) ? TEXTW("<") : 0)) || - (lines > 0 && ev->y >= y && ev->y <= y + h))) { - insert(NULL, -cursor); - drawmenu(); - return; - } - /* middle-mouse click: paste selection */ - if (ev->button == Button2) { - XConvertSelection(dpy, (ev->state & ShiftMask) ? clip : XA_PRIMARY, - utf8, utf8, win, CurrentTime); - drawmenu(); - return; - } - /* scroll up */ - if (ev->button == Button4 && prev) { - sel = curr = prev; - calcoffsets(); - drawmenu(); - return; - } - /* scroll down */ - if (ev->button == Button5 && next) { - sel = curr = next; - calcoffsets(); - drawmenu(); - return; - } - if (ev->button != Button1) - return; - if (ev->state & ~ControlMask) - return; - if (lines > 0) { - /* vertical list: (ctrl)left-click on item */ - w = mw - x; - for (item = curr; item != next; item = item->right) { - y += h; - if (ev->y >= y && ev->y <= (y + h)) { - puts(item->text); - if (!(ev->state & ControlMask)) - exit(0); - sel = item; - if (sel) { - sel->out = 1; - drawmenu(); - } - return; - } - } - } else if (matches) { - /* left-click on left arrow */ - x += inputw; - w = TEXTW("<"); - if (prev && curr->left) { - if (ev->x >= x && ev->x <= x + w) { - sel = curr = prev; - calcoffsets(); - drawmenu(); - return; - } - } - /* horizontal list: (ctrl)left-click on item */ - for (item = curr; item != next; item = item->right) { - x += w; - w = MIN(TEXTW(item->text), mw - x - TEXTW(">")); - if (ev->x >= x && ev->x <= x + w) { - puts(item->text); - if (!(ev->state & ControlMask)) - exit(0); - sel = item; - if (sel) { - sel->out = 1; - drawmenu(); - } - return; - } - } - /* left-click on right arrow */ - w = TEXTW(">"); - x = mw - w; - if (next && ev->x >= x && ev->x <= x + w) { - sel = curr = next; - calcoffsets(); - drawmenu(); - return; - } - } -} - -static void -paste(void) -{ - char *p, *q; - int di; - unsigned long dl; - Atom da; - - /* we have been given the current selection, now insert it into input */ - if (XGetWindowProperty(dpy, win, utf8, 0, (sizeof text / 4) + 1, False, - utf8, &da, &di, &dl, &dl, (unsigned char **)&p) - == Success && p) { - insert(p, (q = strchr(p, '\n')) ? q - p : (ssize_t)strlen(p)); - XFree(p); - } - drawmenu(); -} - -static void -readstdin(void) -{ - char buf[sizeof text], *p; - size_t i, imax = 0, size = 0; - unsigned int tmpmax = 0; - - if(passwd){ - inputw = lines = 0; - return; - } - - /* read each line from stdin and add it to the item list */ - for (i = 0; fgets(buf, sizeof buf, stdin); i++) { - if (i + 1 >= size / sizeof *items) - if (!(items = realloc(items, (size += BUFSIZ)))) - die("cannot realloc %u bytes:", size); - if ((p = strchr(buf, '\n'))) - *p = '\0'; - if (!(items[i].text = strdup(buf))) - die("cannot strdup %u bytes:", strlen(buf) + 1); - items[i].out = 0; - drw_font_getexts(drw->fonts, buf, strlen(buf), &tmpmax, NULL); - if (tmpmax > inputw) { - inputw = tmpmax; - imax = i; - } - } - if (items) - items[i].text = NULL; - inputw = items ? TEXTW(items[imax].text) : 0; - lines = MIN(lines, i); -} - -static void -run(void) -{ - XEvent ev; - - while (!XNextEvent(dpy, &ev)) { - if (XFilterEvent(&ev, win)) - continue; - switch(ev.type) { - case ButtonPress: - buttonpress(&ev); - break; - case DestroyNotify: - if (ev.xdestroywindow.window != win) - break; - cleanup(); - exit(1); - case Expose: - if (ev.xexpose.count == 0) - drw_map(drw, win, 0, 0, mw, mh); - break; - case FocusIn: - /* regrab focus from parent window */ - if (ev.xfocus.window != win) - grabfocus(); - break; - case KeyPress: - keypress(&ev.xkey); - break; - case SelectionNotify: - if (ev.xselection.property == utf8) - paste(); - break; - case VisibilityNotify: - if (ev.xvisibility.state != VisibilityUnobscured) - XRaiseWindow(dpy, win); - break; - } - } -} - -static void -setup(void) -{ - int x, y, i, j; - unsigned int du; - XSetWindowAttributes swa; - XIM xim; - Window w, dw, *dws; - XWindowAttributes wa; - XClassHint ch = {"dmenu", "dmenu"}; -#ifdef XINERAMA - XineramaScreenInfo *info; - Window pw; - int a, di, n, area = 0; -#endif - /* init appearance */ - for (j = 0; j < SchemeLast; j++) - scheme[j] = drw_scm_create(drw, colors[j], alphas[j], 2); - - clip = XInternAtom(dpy, "CLIPBOARD", False); - utf8 = XInternAtom(dpy, "UTF8_STRING", False); - - /* calculate menu geometry */ - bh = drw->fonts->h + 2; - lines = MAX(lines, 0); - mh = (lines + 1) * bh; -#ifdef XINERAMA - i = 0; - if (parentwin == root && (info = XineramaQueryScreens(dpy, &n))) { - XGetInputFocus(dpy, &w, &di); - if (mon >= 0 && mon < n) - i = mon; - else if (w != root && w != PointerRoot && w != None) { - /* find top-level window containing current input focus */ - do { - if (XQueryTree(dpy, (pw = w), &dw, &w, &dws, &du) && dws) - XFree(dws); - } while (w != root && w != pw); - /* find xinerama screen with which the window intersects most */ - if (XGetWindowAttributes(dpy, pw, &wa)) - for (j = 0; j < n; j++) - if ((a = INTERSECT(wa.x, wa.y, wa.width, wa.height, info[j])) > area) { - area = a; - i = j; - } - } - /* no focused window is on screen, so use pointer location instead */ - if (mon < 0 && !area && XQueryPointer(dpy, root, &dw, &dw, &x, &y, &di, &di, &du)) - for (i = 0; i < n; i++) - if (INTERSECT(x, y, 1, 1, info[i])) - break; - - x = info[i].x_org; - y = info[i].y_org + (topbar ? 0 : info[i].height - mh); - mw = info[i].width; - XFree(info); - } else -#endif - { - if (!XGetWindowAttributes(dpy, parentwin, &wa)) - die("could not get embedding window attributes: 0x%lx", - parentwin); - x = 0; - y = topbar ? 0 : wa.height - mh; - mw = wa.width; - } - promptw = (prompt && *prompt) ? TEXTW(prompt) - lrpad / 4 : 0; - inputw = MIN(inputw, mw/3); - match(); - - /* create menu window */ - swa.override_redirect = True; - swa.background_pixel = scheme[SchemeNorm][ColBg].pixel; - swa.border_pixel = 0; - swa.colormap = cmap; - swa.event_mask = ExposureMask | KeyPressMask | VisibilityChangeMask | - ButtonPressMask; - win = XCreateWindow(dpy, parentwin, x, y, mw, mh, 0, - depth, InputOutput, visual, - CWOverrideRedirect | CWBackPixel | CWColormap | CWEventMask | CWBorderPixel, &swa); - XSetClassHint(dpy, win, &ch); - - - /* input methods */ - if ((xim = XOpenIM(dpy, NULL, NULL, NULL)) == NULL) - die("XOpenIM failed: could not open input device"); - - xic = XCreateIC(xim, XNInputStyle, XIMPreeditNothing | XIMStatusNothing, - XNClientWindow, win, XNFocusWindow, win, NULL); - - XMapRaised(dpy, win); - if (embed) { - XSelectInput(dpy, parentwin, FocusChangeMask | SubstructureNotifyMask); - if (XQueryTree(dpy, parentwin, &dw, &w, &dws, &du) && dws) { - for (i = 0; i < du && dws[i] != win; ++i) - XSelectInput(dpy, dws[i], FocusChangeMask); - XFree(dws); - } - grabfocus(); - } - drw_resize(drw, mw, mh); - drawmenu(); -} - -static void -usage(void) -{ - fputs("usage: dmenu [-bfiPrv] [-l lines] [-p prompt] [-fn font] [-m monitor]\n" - " [-nb color] [-nf color] [-sb color] [-sf color] [-w windowid]\n", stderr); - exit(1); -} - -void -read_Xresources(void) { - XrmInitialize(); - - char* xrm; - if ((xrm = XResourceManagerString(drw->dpy))) { - char *type; - XrmDatabase xdb = XrmGetStringDatabase(xrm); - XrmValue xval; - - if (XrmGetResource(xdb, "dmenu.font", "*", &type, &xval) == True) /* font or font set */ - fonts[0] = strdup(xval.addr); - if (XrmGetResource(xdb, "dmenu.color0", "*", &type, &xval) == True) /* normal background color */ - colors[SchemeNorm][ColBg] = strdup(xval.addr); - if (XrmGetResource(xdb, "dmenu.color4", "*", &type, &xval) == True) /* normal foreground color */ - colors[SchemeNorm][ColFg] = strdup(xval.addr); - if (XrmGetResource(xdb, "dmenu.color4", "*", &type, &xval) == True) /* selected background color */ - colors[SchemeSel][ColBg] = strdup(xval.addr); - if (XrmGetResource(xdb, "dmenu.color0", "*", &type, &xval) == True) /* selected foreground color */ - colors[SchemeSel][ColFg] = strdup(xval.addr); - - XrmDestroyDatabase(xdb); - } -} - -int -main(int argc, char *argv[]) -{ - XWindowAttributes wa; - int i, fast = 0; - - for (i = 1; i < argc; i++) - /* these options take no arguments */ - if (!strcmp(argv[i], "-v")) { /* prints version information */ - puts("dmenu-"VERSION); - exit(0); - } else if (!strcmp(argv[i], "-b")) /* appears at the bottom of the screen */ - topbar = 0; - else if (!strcmp(argv[i], "-f")) /* grabs keyboard before reading stdin */ - fast = 1; - else if (!strcmp(argv[i], "-i")) { /* case-insensitive item matching */ - fstrncmp = strncasecmp; - fstrstr = cistrstr; - } else if (!strcmp(argv[i], "-P")) /* is the input a password */ - passwd = 1; - else if (!strcmp(argv[i], "-r")) /* reject input which results in no match */ - reject_no_match = 1; - else if (i + 1 == argc) - usage(); - /* these options take one argument */ - else if (!strcmp(argv[i], "-l")) /* number of lines in vertical list */ - lines = atoi(argv[++i]); - else if (!strcmp(argv[i], "-m")) - mon = atoi(argv[++i]); - else if (!strcmp(argv[i], "-p")) /* adds prompt to left of input field */ - prompt = argv[++i]; - else if (!strcmp(argv[i], "-fn")) /* font or font set */ - fonts[0] = argv[++i]; - else if (!strcmp(argv[i], "-nb")) /* normal background color */ - colors[SchemeNorm][ColBg] = argv[++i]; - else if (!strcmp(argv[i], "-nf")) /* normal foreground color */ - colors[SchemeNorm][ColFg] = argv[++i]; - else if (!strcmp(argv[i], "-sb")) /* selected background color */ - colors[SchemeSel][ColBg] = argv[++i]; - else if (!strcmp(argv[i], "-sf")) /* selected foreground color */ - colors[SchemeSel][ColFg] = argv[++i]; - else if (!strcmp(argv[i], "-w")) /* embedding window id */ - embed = argv[++i]; - else - usage(); - - if (!setlocale(LC_CTYPE, "") || !XSupportsLocale()) - fputs("warning: no locale support\n", stderr); - if (!(dpy = XOpenDisplay(NULL))) - die("cannot open display"); - screen = DefaultScreen(dpy); - root = RootWindow(dpy, screen); - if (!embed || !(parentwin = strtol(embed, NULL, 0))) - parentwin = root; - if (!XGetWindowAttributes(dpy, parentwin, &wa)) - die("could not get embedding window attributes: 0x%lx", - parentwin); - xinitvisual(); - drw = drw_create(dpy, screen, root, wa.width, wa.height, visual, depth, cmap); - read_Xresources(); - if (!drw_fontset_create(drw, fonts, LENGTH(fonts))) - die("no fonts could be loaded."); - lrpad = drw->fonts->h; - -#ifdef __OpenBSD__ - if (pledge("stdio rpath", NULL) == -1) - die("pledge"); -#endif - - if (fast && !isatty(0)) { - grabkeyboard(); - readstdin(); - } else { - readstdin(); - grabkeyboard(); - } - setup(); - run(); - - return 1; /* unreachable */ -} diff --git a/.local/src/dmenu/dmenu.o b/.local/src/dmenu/dmenu.o deleted file mode 100644 index 80b23094..00000000 Binary files a/.local/src/dmenu/dmenu.o and /dev/null differ diff --git a/.local/src/dmenu/dmenu_path b/.local/src/dmenu/dmenu_path deleted file mode 100755 index 3a7cda79..00000000 --- a/.local/src/dmenu/dmenu_path +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/sh - -cachedir="${XDG_CACHE_HOME:-"$HOME/.cache"}" -cache="$cachedir/dmenu_run" - -[ ! -e "$cachedir" ] && mkdir -p "$cachedir" - -IFS=: -if stest -dqr -n "$cache" $PATH; then - stest -flx $PATH | sort -u | tee "$cache" -else - cat "$cache" -fi diff --git a/.local/src/dmenu/dmenu_run b/.local/src/dmenu/dmenu_run deleted file mode 100755 index 834ede54..00000000 --- a/.local/src/dmenu/dmenu_run +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -dmenu_path | dmenu "$@" | ${SHELL:-"/bin/sh"} & diff --git a/.local/src/dmenu/drw.c b/.local/src/dmenu/drw.c deleted file mode 100644 index 76949555..00000000 --- a/.local/src/dmenu/drw.c +++ /dev/null @@ -1,424 +0,0 @@ -/* See LICENSE file for copyright and license details. */ -#include -#include -#include -#include -#include - -#include "drw.h" -#include "util.h" - -#define UTF_INVALID 0xFFFD -#define UTF_SIZ 4 - -static const unsigned char utfbyte[UTF_SIZ + 1] = {0x80, 0, 0xC0, 0xE0, 0xF0}; -static const unsigned char utfmask[UTF_SIZ + 1] = {0xC0, 0x80, 0xE0, 0xF0, 0xF8}; -static const long utfmin[UTF_SIZ + 1] = { 0, 0, 0x80, 0x800, 0x10000}; -static const long utfmax[UTF_SIZ + 1] = {0x10FFFF, 0x7F, 0x7FF, 0xFFFF, 0x10FFFF}; - -static long -utf8decodebyte(const char c, size_t *i) -{ - for (*i = 0; *i < (UTF_SIZ + 1); ++(*i)) - if (((unsigned char)c & utfmask[*i]) == utfbyte[*i]) - return (unsigned char)c & ~utfmask[*i]; - return 0; -} - -static size_t -utf8validate(long *u, size_t i) -{ - if (!BETWEEN(*u, utfmin[i], utfmax[i]) || BETWEEN(*u, 0xD800, 0xDFFF)) - *u = UTF_INVALID; - for (i = 1; *u > utfmax[i]; ++i) - ; - return i; -} - -static size_t -utf8decode(const char *c, long *u, size_t clen) -{ - size_t i, j, len, type; - long udecoded; - - *u = UTF_INVALID; - if (!clen) - return 0; - udecoded = utf8decodebyte(c[0], &len); - if (!BETWEEN(len, 1, UTF_SIZ)) - return 1; - for (i = 1, j = 1; i < clen && j < len; ++i, ++j) { - udecoded = (udecoded << 6) | utf8decodebyte(c[i], &type); - if (type) - return j; - } - if (j < len) - return 0; - *u = udecoded; - utf8validate(u, len); - - return len; -} - -Drw * -drw_create(Display *dpy, int screen, Window root, unsigned int w, unsigned int h, Visual *visual, unsigned int depth, Colormap cmap) -{ - Drw *drw = ecalloc(1, sizeof(Drw)); - - drw->dpy = dpy; - drw->screen = screen; - drw->root = root; - drw->w = w; - drw->h = h; - drw->visual = visual; - drw->depth = depth; - drw->cmap = cmap; - drw->drawable = XCreatePixmap(dpy, root, w, h, depth); - drw->gc = XCreateGC(dpy, drw->drawable, 0, NULL); - XSetLineAttributes(dpy, drw->gc, 1, LineSolid, CapButt, JoinMiter); - - return drw; -} - -void -drw_resize(Drw *drw, unsigned int w, unsigned int h) -{ - if (!drw) - return; - - drw->w = w; - drw->h = h; - if (drw->drawable) - XFreePixmap(drw->dpy, drw->drawable); - drw->drawable = XCreatePixmap(drw->dpy, drw->root, w, h, drw->depth); -} - -void -drw_free(Drw *drw) -{ - XFreePixmap(drw->dpy, drw->drawable); - XFreeGC(drw->dpy, drw->gc); - drw_fontset_free(drw->fonts); - free(drw); -} - -/* This function is an implementation detail. Library users should use - * drw_fontset_create instead. - */ -static Fnt * -xfont_create(Drw *drw, const char *fontname, FcPattern *fontpattern) -{ - Fnt *font; - XftFont *xfont = NULL; - FcPattern *pattern = NULL; - - if (fontname) { - /* Using the pattern found at font->xfont->pattern does not yield the - * same substitution results as using the pattern returned by - * FcNameParse; using the latter results in the desired fallback - * behaviour whereas the former just results in missing-character - * rectangles being drawn, at least with some fonts. */ - if (!(xfont = XftFontOpenName(drw->dpy, drw->screen, fontname))) { - fprintf(stderr, "error, cannot load font from name: '%s'\n", fontname); - return NULL; - } - if (!(pattern = FcNameParse((FcChar8 *) fontname))) { - fprintf(stderr, "error, cannot parse font name to pattern: '%s'\n", fontname); - XftFontClose(drw->dpy, xfont); - return NULL; - } - } else if (fontpattern) { - if (!(xfont = XftFontOpenPattern(drw->dpy, fontpattern))) { - fprintf(stderr, "error, cannot load font from pattern.\n"); - return NULL; - } - } else { - die("no font specified."); - } - - font = ecalloc(1, sizeof(Fnt)); - font->xfont = xfont; - font->pattern = pattern; - font->h = xfont->ascent + xfont->descent; - font->dpy = drw->dpy; - - return font; -} - -static void -xfont_free(Fnt *font) -{ - if (!font) - return; - if (font->pattern) - FcPatternDestroy(font->pattern); - XftFontClose(font->dpy, font->xfont); - free(font); -} - -Fnt* -drw_fontset_create(Drw* drw, const char *fonts[], size_t fontcount) -{ - Fnt *cur, *ret = NULL; - size_t i; - - if (!drw || !fonts) - return NULL; - - for (i = 1; i <= fontcount; i++) { - if ((cur = xfont_create(drw, fonts[fontcount - i], NULL))) { - cur->next = ret; - ret = cur; - } - } - return (drw->fonts = ret); -} - -void -drw_fontset_free(Fnt *font) -{ - if (font) { - drw_fontset_free(font->next); - xfont_free(font); - } -} - -void -drw_clr_create(Drw *drw, Clr *dest, const char *clrname, unsigned int alpha) -{ - if (!drw || !dest || !clrname) - return; - - if (!XftColorAllocName(drw->dpy, drw->visual, drw->cmap, - clrname, dest)) - die("error, cannot allocate color '%s'", clrname); - dest->pixel = (dest->pixel & 0x00FFFFFFFU) | alpha << 24; -} - -/* Wrapper to create color schemes. The caller has to call free(3) on the - * returned color scheme when done using it. */ -Clr * -drw_scm_create(Drw *drw, const char *clrnames[], const unsigned int alphas[], size_t clrcount) -{ - size_t i; - Clr *ret; - - /* need at least two colors for a scheme */ - if (!drw || !clrnames || clrcount < 2 || !(ret = ecalloc(clrcount, sizeof(XftColor)))) - return NULL; - - for (i = 0; i < clrcount; i++) - drw_clr_create(drw, &ret[i], clrnames[i], alphas[i]); - return ret; -} - -void -drw_setfontset(Drw *drw, Fnt *set) -{ - if (drw) - drw->fonts = set; -} - -void -drw_setscheme(Drw *drw, Clr *scm) -{ - if (drw) - drw->scheme = scm; -} - -void -drw_rect(Drw *drw, int x, int y, unsigned int w, unsigned int h, int filled, int invert) -{ - if (!drw || !drw->scheme) - return; - XSetForeground(drw->dpy, drw->gc, invert ? drw->scheme[ColBg].pixel : drw->scheme[ColFg].pixel); - if (filled) - XFillRectangle(drw->dpy, drw->drawable, drw->gc, x, y, w, h); - else - XDrawRectangle(drw->dpy, drw->drawable, drw->gc, x, y, w - 1, h - 1); -} - -int -drw_text(Drw *drw, int x, int y, unsigned int w, unsigned int h, unsigned int lpad, const char *text, int invert) -{ - char buf[1024]; - int ty; - unsigned int ew; - XftDraw *d = NULL; - Fnt *usedfont, *curfont, *nextfont; - size_t i, len; - int utf8strlen, utf8charlen, render = x || y || w || h; - long utf8codepoint = 0; - const char *utf8str; - FcCharSet *fccharset; - FcPattern *fcpattern; - FcPattern *match; - XftResult result; - int charexists = 0; - - if (!drw || (render && !drw->scheme) || !text || !drw->fonts) - return 0; - - if (!render) { - w = ~w; - } else { - XSetForeground(drw->dpy, drw->gc, drw->scheme[invert ? ColFg : ColBg].pixel); - XFillRectangle(drw->dpy, drw->drawable, drw->gc, x, y, w, h); - d = XftDrawCreate(drw->dpy, drw->drawable, drw->visual, drw->cmap); - x += lpad; - w -= lpad; - } - - usedfont = drw->fonts; - while (1) { - utf8strlen = 0; - utf8str = text; - nextfont = NULL; - while (*text) { - utf8charlen = utf8decode(text, &utf8codepoint, UTF_SIZ); - for (curfont = drw->fonts; curfont; curfont = curfont->next) { - charexists = charexists || XftCharExists(drw->dpy, curfont->xfont, utf8codepoint); - if (charexists) { - if (curfont == usedfont) { - utf8strlen += utf8charlen; - text += utf8charlen; - } else { - nextfont = curfont; - } - break; - } - } - - if (!charexists || nextfont) - break; - else - charexists = 0; - } - - if (utf8strlen) { - drw_font_getexts(usedfont, utf8str, utf8strlen, &ew, NULL); - /* shorten text if necessary */ - for (len = MIN(utf8strlen, sizeof(buf) - 1); len && ew > w; len--) - drw_font_getexts(usedfont, utf8str, len, &ew, NULL); - - if (len) { - memcpy(buf, utf8str, len); - buf[len] = '\0'; - if (len < utf8strlen) - for (i = len; i && i > len - 3; buf[--i] = '.') - ; /* NOP */ - - if (render) { - ty = y + (h - usedfont->h) / 2 + usedfont->xfont->ascent; - XftDrawStringUtf8(d, &drw->scheme[invert ? ColBg : ColFg], - usedfont->xfont, x, ty, (XftChar8 *)buf, len); - } - x += ew; - w -= ew; - } - } - - if (!*text) { - break; - } else if (nextfont) { - charexists = 0; - usedfont = nextfont; - } else { - /* Regardless of whether or not a fallback font is found, the - * character must be drawn. */ - charexists = 1; - - fccharset = FcCharSetCreate(); - FcCharSetAddChar(fccharset, utf8codepoint); - - if (!drw->fonts->pattern) { - /* Refer to the comment in xfont_create for more information. */ - die("the first font in the cache must be loaded from a font string."); - } - - fcpattern = FcPatternDuplicate(drw->fonts->pattern); - FcPatternAddCharSet(fcpattern, FC_CHARSET, fccharset); - FcPatternAddBool(fcpattern, FC_SCALABLE, FcTrue); - FcPatternAddBool(fcpattern, FC_COLOR, FcFalse); - - FcConfigSubstitute(NULL, fcpattern, FcMatchPattern); - FcDefaultSubstitute(fcpattern); - match = XftFontMatch(drw->dpy, drw->screen, fcpattern, &result); - - FcCharSetDestroy(fccharset); - FcPatternDestroy(fcpattern); - - if (match) { - usedfont = xfont_create(drw, NULL, match); - if (usedfont && XftCharExists(drw->dpy, usedfont->xfont, utf8codepoint)) { - for (curfont = drw->fonts; curfont->next; curfont = curfont->next) - ; /* NOP */ - curfont->next = usedfont; - } else { - xfont_free(usedfont); - usedfont = drw->fonts; - } - } - } - } - if (d) - XftDrawDestroy(d); - - return x + (render ? w : 0); -} - -void -drw_map(Drw *drw, Window win, int x, int y, unsigned int w, unsigned int h) -{ - if (!drw) - return; - - XCopyArea(drw->dpy, drw->drawable, win, drw->gc, x, y, w, h, x, y); - XSync(drw->dpy, False); -} - -unsigned int -drw_fontset_getwidth(Drw *drw, const char *text) -{ - if (!drw || !drw->fonts || !text) - return 0; - return drw_text(drw, 0, 0, 0, 0, 0, text, 0); -} - -void -drw_font_getexts(Fnt *font, const char *text, unsigned int len, unsigned int *w, unsigned int *h) -{ - XGlyphInfo ext; - - if (!font || !text) - return; - - XftTextExtentsUtf8(font->dpy, font->xfont, (XftChar8 *)text, len, &ext); - if (w) - *w = ext.xOff; - if (h) - *h = font->h; -} - -Cur * -drw_cur_create(Drw *drw, int shape) -{ - Cur *cur; - - if (!drw || !(cur = ecalloc(1, sizeof(Cur)))) - return NULL; - - cur->cursor = XCreateFontCursor(drw->dpy, shape); - - return cur; -} - -void -drw_cur_free(Drw *drw, Cur *cursor) -{ - if (!cursor) - return; - - XFreeCursor(drw->dpy, cursor->cursor); - free(cursor); -} diff --git a/.local/src/dmenu/drw.h b/.local/src/dmenu/drw.h deleted file mode 100644 index 4f66f0d6..00000000 --- a/.local/src/dmenu/drw.h +++ /dev/null @@ -1,60 +0,0 @@ -/* See LICENSE file for copyright and license details. */ - -typedef struct { - Cursor cursor; -} Cur; - -typedef struct Fnt { - Display *dpy; - unsigned int h; - XftFont *xfont; - FcPattern *pattern; - struct Fnt *next; -} Fnt; - -enum { ColFg, ColBg }; /* Clr scheme index */ -typedef XftColor Clr; - -typedef struct { - unsigned int w, h; - Display *dpy; - int screen; - Window root; - Visual *visual; - unsigned int depth; - Colormap cmap; - Drawable drawable; - GC gc; - Clr *scheme; - Fnt *fonts; -} Drw; - -/* Drawable abstraction */ -Drw *drw_create(Display *dpy, int screen, Window win, unsigned int w, unsigned int h, Visual *visual, unsigned int depth, Colormap cmap); -void drw_resize(Drw *drw, unsigned int w, unsigned int h); -void drw_free(Drw *drw); - -/* Fnt abstraction */ -Fnt *drw_fontset_create(Drw* drw, const char *fonts[], size_t fontcount); -void drw_fontset_free(Fnt* set); -unsigned int drw_fontset_getwidth(Drw *drw, const char *text); -void drw_font_getexts(Fnt *font, const char *text, unsigned int len, unsigned int *w, unsigned int *h); - -/* Colorscheme abstraction */ -void drw_clr_create(Drw *drw, Clr *dest, const char *clrname, unsigned int alpha); -Clr *drw_scm_create(Drw *drw, const char *clrnames[], const unsigned int alphas[], size_t clrcount); - -/* Cursor abstraction */ -Cur *drw_cur_create(Drw *drw, int shape); -void drw_cur_free(Drw *drw, Cur *cursor); - -/* Drawing context manipulation */ -void drw_setfontset(Drw *drw, Fnt *set); -void drw_setscheme(Drw *drw, Clr *scm); - -/* Drawing functions */ -void drw_rect(Drw *drw, int x, int y, unsigned int w, unsigned int h, int filled, int invert); -int drw_text(Drw *drw, int x, int y, unsigned int w, unsigned int h, unsigned int lpad, const char *text, int invert); - -/* Map functions */ -void drw_map(Drw *drw, Window win, int x, int y, unsigned int w, unsigned int h); diff --git a/.local/src/dmenu/drw.o b/.local/src/dmenu/drw.o deleted file mode 100644 index 07d5ef0f..00000000 Binary files a/.local/src/dmenu/drw.o and /dev/null differ diff --git a/.local/src/dmenu/stest b/.local/src/dmenu/stest deleted file mode 100755 index 532383f4..00000000 Binary files a/.local/src/dmenu/stest and /dev/null differ diff --git a/.local/src/dmenu/stest.1 b/.local/src/dmenu/stest.1 deleted file mode 100644 index 2667d8aa..00000000 --- a/.local/src/dmenu/stest.1 +++ /dev/null @@ -1,90 +0,0 @@ -.TH STEST 1 dmenu\-VERSION -.SH NAME -stest \- filter a list of files by properties -.SH SYNOPSIS -.B stest -.RB [ -abcdefghlpqrsuwx ] -.RB [ -n -.IR file ] -.RB [ -o -.IR file ] -.RI [ file ...] -.SH DESCRIPTION -.B stest -takes a list of files and filters by the files' properties, analogous to -.IR test (1). -Files which pass all tests are printed to stdout. If no files are given, stest -reads files from stdin. -.SH OPTIONS -.TP -.B \-a -Test hidden files. -.TP -.B \-b -Test that files are block specials. -.TP -.B \-c -Test that files are character specials. -.TP -.B \-d -Test that files are directories. -.TP -.B \-e -Test that files exist. -.TP -.B \-f -Test that files are regular files. -.TP -.B \-g -Test that files have their set-group-ID flag set. -.TP -.B \-h -Test that files are symbolic links. -.TP -.B \-l -Test the contents of a directory given as an argument. -.TP -.BI \-n " file" -Test that files are newer than -.IR file . -.TP -.BI \-o " file" -Test that files are older than -.IR file . -.TP -.B \-p -Test that files are named pipes. -.TP -.B \-q -No files are printed, only the exit status is returned. -.TP -.B \-r -Test that files are readable. -.TP -.B \-s -Test that files are not empty. -.TP -.B \-u -Test that files have their set-user-ID flag set. -.TP -.B \-v -Invert the sense of tests, only failing files pass. -.TP -.B \-w -Test that files are writable. -.TP -.B \-x -Test that files are executable. -.SH EXIT STATUS -.TP -.B 0 -At least one file passed all tests. -.TP -.B 1 -No files passed all tests. -.TP -.B 2 -An error occurred. -.SH SEE ALSO -.IR dmenu (1), -.IR test (1) diff --git a/.local/src/dmenu/stest.c b/.local/src/dmenu/stest.c deleted file mode 100644 index 7a7b0bcf..00000000 --- a/.local/src/dmenu/stest.c +++ /dev/null @@ -1,109 +0,0 @@ -/* See LICENSE file for copyright and license details. */ -#include - -#include -#include -#include -#include -#include -#include - -#include "arg.h" -char *argv0; - -#define FLAG(x) (flag[(x)-'a']) - -static void test(const char *, const char *); -static void usage(void); - -static int match = 0; -static int flag[26]; -static struct stat old, new; - -static void -test(const char *path, const char *name) -{ - struct stat st, ln; - - if ((!stat(path, &st) && (FLAG('a') || name[0] != '.') /* hidden files */ - && (!FLAG('b') || S_ISBLK(st.st_mode)) /* block special */ - && (!FLAG('c') || S_ISCHR(st.st_mode)) /* character special */ - && (!FLAG('d') || S_ISDIR(st.st_mode)) /* directory */ - && (!FLAG('e') || access(path, F_OK) == 0) /* exists */ - && (!FLAG('f') || S_ISREG(st.st_mode)) /* regular file */ - && (!FLAG('g') || st.st_mode & S_ISGID) /* set-group-id flag */ - && (!FLAG('h') || (!lstat(path, &ln) && S_ISLNK(ln.st_mode))) /* symbolic link */ - && (!FLAG('n') || st.st_mtime > new.st_mtime) /* newer than file */ - && (!FLAG('o') || st.st_mtime < old.st_mtime) /* older than file */ - && (!FLAG('p') || S_ISFIFO(st.st_mode)) /* named pipe */ - && (!FLAG('r') || access(path, R_OK) == 0) /* readable */ - && (!FLAG('s') || st.st_size > 0) /* not empty */ - && (!FLAG('u') || st.st_mode & S_ISUID) /* set-user-id flag */ - && (!FLAG('w') || access(path, W_OK) == 0) /* writable */ - && (!FLAG('x') || access(path, X_OK) == 0)) != FLAG('v')) { /* executable */ - if (FLAG('q')) - exit(0); - match = 1; - puts(name); - } -} - -static void -usage(void) -{ - fprintf(stderr, "usage: %s [-abcdefghlpqrsuvwx] " - "[-n file] [-o file] [file...]\n", argv0); - exit(2); /* like test(1) return > 1 on error */ -} - -int -main(int argc, char *argv[]) -{ - struct dirent *d; - char path[PATH_MAX], *line = NULL, *file; - size_t linesiz = 0; - ssize_t n; - DIR *dir; - int r; - - ARGBEGIN { - case 'n': /* newer than file */ - case 'o': /* older than file */ - file = EARGF(usage()); - if (!(FLAG(ARGC()) = !stat(file, (ARGC() == 'n' ? &new : &old)))) - perror(file); - break; - default: - /* miscellaneous operators */ - if (strchr("abcdefghlpqrsuvwx", ARGC())) - FLAG(ARGC()) = 1; - else - usage(); /* unknown flag */ - } ARGEND; - - if (!argc) { - /* read list from stdin */ - while ((n = getline(&line, &linesiz, stdin)) > 0) { - if (n && line[n - 1] == '\n') - line[n - 1] = '\0'; - test(line, line); - } - free(line); - } else { - for (; argc; argc--, argv++) { - if (FLAG('l') && (dir = opendir(*argv))) { - /* test directory contents */ - while ((d = readdir(dir))) { - r = snprintf(path, sizeof path, "%s/%s", - *argv, d->d_name); - if (r >= 0 && (size_t)r < sizeof path) - test(path, d->d_name); - } - closedir(dir); - } else { - test(*argv, *argv); - } - } - } - return match ? 0 : 1; -} diff --git a/.local/src/dmenu/stest.o b/.local/src/dmenu/stest.o deleted file mode 100644 index 4ffa3578..00000000 Binary files a/.local/src/dmenu/stest.o and /dev/null differ diff --git a/.local/src/dmenu/util.c b/.local/src/dmenu/util.c deleted file mode 100644 index fe044fc7..00000000 --- a/.local/src/dmenu/util.c +++ /dev/null @@ -1,35 +0,0 @@ -/* See LICENSE file for copyright and license details. */ -#include -#include -#include -#include - -#include "util.h" - -void * -ecalloc(size_t nmemb, size_t size) -{ - void *p; - - if (!(p = calloc(nmemb, size))) - die("calloc:"); - return p; -} - -void -die(const char *fmt, ...) { - va_list ap; - - va_start(ap, fmt); - vfprintf(stderr, fmt, ap); - va_end(ap); - - if (fmt[0] && fmt[strlen(fmt)-1] == ':') { - fputc(' ', stderr); - perror(NULL); - } else { - fputc('\n', stderr); - } - - exit(1); -} diff --git a/.local/src/dmenu/util.h b/.local/src/dmenu/util.h deleted file mode 100644 index f633b517..00000000 --- a/.local/src/dmenu/util.h +++ /dev/null @@ -1,8 +0,0 @@ -/* See LICENSE file for copyright and license details. */ - -#define MAX(A, B) ((A) > (B) ? (A) : (B)) -#define MIN(A, B) ((A) < (B) ? (A) : (B)) -#define BETWEEN(X, A, B) ((A) <= (X) && (X) <= (B)) - -void die(const char *fmt, ...); -void *ecalloc(size_t nmemb, size_t size); diff --git a/.local/src/dmenu/util.o b/.local/src/dmenu/util.o deleted file mode 100644 index 3b48c2f6..00000000 Binary files a/.local/src/dmenu/util.o and /dev/null differ diff --git a/.local/src/dwm/FUNDING.yml b/.local/src/dwm/FUNDING.yml deleted file mode 100644 index c7c9a22e..00000000 --- a/.local/src/dwm/FUNDING.yml +++ /dev/null @@ -1,2 +0,0 @@ -custom: ["https://lukesmith.xyz/donate.html"] -github: lukesmithxyz diff --git a/.local/src/dwm/LICENSE b/.local/src/dwm/LICENSE deleted file mode 100644 index 1e1b5a43..00000000 --- a/.local/src/dwm/LICENSE +++ /dev/null @@ -1,38 +0,0 @@ -MIT/X Consortium License - -© 2006-2019 Anselm R Garbe -© 2006-2009 Jukka Salmi -© 2006-2007 Sander van Dijk -© 2007-2011 Peter Hartlich -© 2007-2009 Szabolcs Nagy -© 2007-2009 Christof Musik -© 2007-2009 Premysl Hruby -© 2007-2008 Enno Gottox Boland -© 2008 Martin Hurton -© 2008 Neale Pickett -© 2009 Mate Nagy -© 2010-2016 Hiltjo Posthuma -© 2010-2012 Connor Lane Smith -© 2011 Christoph Lohmann <20h@r-36.net> -© 2015-2016 Quentin Rameau -© 2015-2016 Eric Pruitt -© 2016-2017 Markus Teich -© 2019-2020 Luke Smith - -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/.local/src/dwm/Makefile b/.local/src/dwm/Makefile deleted file mode 100644 index fe9df31d..00000000 --- a/.local/src/dwm/Makefile +++ /dev/null @@ -1,52 +0,0 @@ -# dwm - dynamic window manager -# See LICENSE file for copyright and license details. - -include config.mk - -SRC = drw.c dwm.c util.c -OBJ = ${SRC:.c=.o} - -all: options dwm - -options: - @echo dwm build options: - @echo "CFLAGS = ${CFLAGS}" - @echo "LDFLAGS = ${LDFLAGS}" - @echo "CC = ${CC}" - -.c.o: - ${CC} -c ${CFLAGS} $< - -${OBJ}: config.h config.mk - -dwm: ${OBJ} - ${CC} -o $@ ${OBJ} ${LDFLAGS} - -clean: - rm -f dwm ${OBJ} dwm-${VERSION}.tar.gz *.orig *.rej - -dist: clean - mkdir -p dwm-${VERSION} - cp -R LICENSE Makefile README config.mk\ - dwm.1 drw.h util.h ${SRC} transient.c dwm-${VERSION} - tar -cf dwm-${VERSION}.tar dwm-${VERSION} - gzip dwm-${VERSION}.tar - rm -rf dwm-${VERSION} - -install: all - mkdir -p ${DESTDIR}${PREFIX}/bin - cp -f dwm ${DESTDIR}${PREFIX}/bin - chmod 755 ${DESTDIR}${PREFIX}/bin/dwm - mkdir -p ${DESTDIR}${MANPREFIX}/man1 - sed "s/VERSION/${VERSION}/g" < dwm.1 > ${DESTDIR}${MANPREFIX}/man1/dwm.1 - chmod 644 ${DESTDIR}${MANPREFIX}/man1/dwm.1 - mkdir -p ${DESTDIR}${PREFIX}/share/dwm - cp -f larbs.mom ${DESTDIR}${PREFIX}/share/dwm - chmod 644 ${DESTDIR}${PREFIX}/share/dwm/larbs.mom - -uninstall: - rm -f ${DESTDIR}${PREFIX}/bin/dwm\ - ${DESTDIR}${PREFIX}/share/dwm/larbs.mom\ - ${DESTDIR}${MANPREFIX}/man1/dwm.1 - -.PHONY: all options clean dist install uninstall diff --git a/.local/src/dwm/README.md b/.local/src/dwm/README.md deleted file mode 100644 index cdc1ab46..00000000 --- a/.local/src/dwm/README.md +++ /dev/null @@ -1,36 +0,0 @@ -# Luke's build of dwm - -## FAQ - -> What are the bindings? - -This is suckless, mmmbud, the source code is the documentation! Check out [config.h](config.h). - -Okay, okay, actually I keep a readme in `larbs.mom` for my whole system, including the binds here. -Press `super+F1` to view it in dwm (zathura is required for that binding). -I haven't kept `man dwm`/`dwm.1` updated though. PRs welcome on that, lol. - -## Patches and features - -- [Clickable statusbar](https://dwm.suckless.org/patches/statuscmd/) with my build of [dwmblocks](https://github.com/lukesmithxyz/dwmblocks). -- Reads [xresources](https://dwm.suckless.org/patches/xresources/) colors/variables (i.e. works with `pywal`, etc.). -- scratchpad: Accessible with mod+shift+enter. -- New layouts: bstack, fibonacci, deck, centered master and more. All bound to keys `super+(shift+)t/y/u/i`. -- True fullscreen (`super+f`) and prevents focus shifting. -- Windows can be made sticky (`super+s`). -- [stacker](https://dwm.suckless.org/patches/stacker/): Move windows up the stack manually (`super-K/J`). -- [shiftview](https://dwm.suckless.org/patches/nextprev/): Cycle through tags (`super+g/;`). -- [vanitygaps](https://dwm.suckless.org/patches/vanitygaps/): Gaps allowed across all layouts. -- [swallow patch](https://dwm.suckless.org/patches/swallow/): if a program run from a terminal would make it inoperable, it temporarily takes its place to save space. - -## Installation for newbs - -``` -git clone https://github.com/LukeSmithxyz/dwm -cd dwm -sudo make install -``` - -## Please install `libxft-bgra`! - -This build of dwm does not block color emoji in the status/info bar, so you must install [libxft-bgra](https://aur.archlinux.org/packages/libxft-bgra/) from the AUR, which fixes a libxft color emoji rendering problem, otherwise dwm will crash upon trying to render one. Hopefully this fix will be in all libxft soon enough. diff --git a/.local/src/dwm/config.h b/.local/src/dwm/config.h deleted file mode 100644 index 4bea7198..00000000 --- a/.local/src/dwm/config.h +++ /dev/null @@ -1,415 +0,0 @@ -/* See LICENSE file for copyright and license details. */ - -/* Constants */ -#define TERMINAL "kitty" -#define TERMCLASS "Kitty" - -/* appearance */ -static unsigned int borderpx = 2; /* border pixel of windows */ -static unsigned int snap = 33; /* snap pixel */ -static unsigned int gappih = 10; /* horiz inner gap between windows */ -static unsigned int gappiv = 10; /* vert inner gap between windows */ -static unsigned int gappoh = - 10; /* horiz outer gap between windows and screen edge */ -static unsigned int gappov = - 10; /* vert outer gap between windows and screen edge */ -static int swallowfloating = - 0; /* 1 means swallow floating windows by default */ -static int smartgaps = - 0; /* 1 means no outer gap when there is only one window */ -static int showbar = 1; /* 0 means no bar */ -static int topbar = 1; /* 0 means bottom bar */ -static char *fonts[] = { - "FiraCode Nerd Font Mono:size=10:antialias=true:autohint=true"}; -static char normbgcolor[] = "#222222"; -static char normbordercolor[] = "#444444"; -static char normfgcolor[] = "#bbbbbb"; -static char selfgcolor[] = "#eeeeee"; -static char selbordercolor[] = "#770000"; -static char selbgcolor[] = "#005577"; -static char *colors[][3] = { - /* fg bg border */ - [SchemeNorm] = {normfgcolor, normbgcolor, normbordercolor}, - [SchemeSel] = {selfgcolor, selbgcolor, selbordercolor}, -}; - -typedef struct { - const char *name; - const void *cmd; -} Sp; -const char *spcmd1[] = {TERMINAL, "-n", "spterm", "-g", "120x34", NULL}; -const char *spcmd2[] = {TERMINAL, "-n", "spcalc", "-f", "monospace:size=16", - "-g", "50x20", "-e", "bc", "-lq", - NULL}; -static Sp scratchpads[] = { - /* name cmd */ - {"spterm", spcmd1}, - {"spcalc", spcmd2}, -}; - -/* tagging */ -static const char *tags[] = {"1", "2", "3", "4", "5", "6", "7", "8", "9"}; - -static const Rule rules[] = { - /* xprop(1): - * WM_CLASS(STRING) = instance, class - * WM_NAME(STRING) = title - */ - /* class instance title tags mask isfloating - isterminal noswallow monitor */ - {"Gimp", NULL, NULL, 1 << 8, 0, 0, 0, -1}, - {TERMCLASS, NULL, NULL, 0, 0, 1, 0, -1}, - {NULL, NULL, "Event Tester", 0, 0, 0, 1, -1}, - {NULL, "spterm", NULL, SPTAG(0), 1, 1, 0, -1}, - {NULL, "spcalc", NULL, SPTAG(1), 1, 1, 0, -1}, -}; - -/* layout(s) */ -static float mfact = 0.6; /* factor of master area size [0.05..0.95] */ -static int nmaster = 1; /* number of clients in master area */ -static int resizehints = 0; /* 1 means respect size hints in tiled resizals */ -#define FORCE_VSPLIT \ - 1 /* nrowgrid layout: force two clients to always split vertically */ -#include "vanitygaps.c" -static const Layout layouts[] = { - /* symbol arrange function */ - {"[]=", tile}, /* Default: Master on left, slaves on right */ - {"TTT", bstack}, /* Master on top, slaves on bottom */ - - {"[@]", spiral}, /* Fibonacci spiral */ - {"[\\]", dwindle}, /* Decreasing in size right and leftward */ - - {"[D]", deck}, /* Master on left, slaves in monocle-like mode on right */ - {"[M]", monocle}, /* All windows on top of eachother */ - - {"|M|", centeredmaster}, /* Master in middle, slaves on sides */ - {">M>", centeredfloatingmaster}, /* Same but master floats */ - - {"><>", NULL}, /* no layout function means floating behavior */ - {NULL, NULL}, -}; - -/* key definitions */ -#define MODKEY Mod4Mask -#define TAGKEYS(KEY, TAG) \ - {MODKEY, KEY, view, {.ui = 1 << TAG}}, \ - {MODKEY | ControlMask, KEY, toggleview, {.ui = 1 << TAG}}, \ - {MODKEY | ShiftMask, KEY, tag, {.ui = 1 << TAG}}, \ - {MODKEY | ControlMask | ShiftMask, KEY, toggletag, {.ui = 1 << TAG}}, -#define STACKKEYS(MOD, ACTION) \ - {MOD, XK_j, ACTION##stack, {.i = INC(+1)}}, \ - {MOD, XK_k, ACTION##stack, {.i = INC(-1)}}, \ - {MOD, \ - XK_v, \ - ACTION##stack, \ - {.i = 0}}, /* { MOD, XK_grave, ACTION##stack, {.i = PREVSEL } }, \ */ - /* { MOD, XK_a, ACTION##stack, {.i = 1 } }, \ */ - /* { MOD, XK_z, ACTION##stack, {.i = 2 } }, \ */ - /* { MOD, XK_x, ACTION##stack, {.i = -1 } }, */ - -/* helper for spawning shell commands in the pre dwm-5.0 fashion */ -#define SHCMD(cmd) \ - { \ - .v = (const char *[]) { "/bin/sh", "-c", cmd, NULL } \ - } - -/* commands */ -static const char *termcmd[] = {TERMINAL, NULL}; - -/* - * Xresources preferences to load at startup - */ -ResourcePref resources[] = { - {"color0", STRING, &normbordercolor}, - {"color8", STRING, &selbordercolor}, - {"color8", STRING, &normbgcolor}, - {"color12", STRING, &normfgcolor}, - {"color0", STRING, &selfgcolor}, - {"color4", STRING, &selbgcolor}, - {"borderpx", INTEGER, &borderpx}, - {"snap", INTEGER, &snap}, - {"showbar", INTEGER, &showbar}, - {"topbar", INTEGER, &topbar}, - {"nmaster", INTEGER, &nmaster}, - {"resizehints", INTEGER, &resizehints}, - {"mfact", FLOAT, &mfact}, - {"gappih", INTEGER, &gappih}, - {"gappiv", INTEGER, &gappiv}, - {"gappoh", INTEGER, &gappoh}, - {"gappov", INTEGER, &gappov}, - {"swallowfloating", INTEGER, &swallowfloating}, - {"smartgaps", INTEGER, &smartgaps}, -}; - -#include "shiftview.c" -#include - -static Key keys[] = { - /* modifier key function argument */ - STACKKEYS(MODKEY, focus) STACKKEYS(MODKEY | ShiftMask, push) - /* { MODKEY|ShiftMask, XK_Escape, spawn, SHCMD("") }, */ - {MODKEY, XK_dead_circumflex, spawn, SHCMD("dmenuunicode")}, - /* { MODKEY|ShiftMask, XK_grave, togglescratch, - * SHCMD("") - * }, - */ - TAGKEYS(XK_1, 0) TAGKEYS(XK_2, 1) TAGKEYS(XK_3, 2) TAGKEYS(XK_4, 3) - TAGKEYS(XK_5, 4) TAGKEYS(XK_6, 5) TAGKEYS(XK_7, 6) TAGKEYS(XK_8, 7) - TAGKEYS(XK_9, 8){MODKEY, XK_0, view, {.ui = ~0}}, - {MODKEY | ShiftMask, XK_0, tag, {.ui = ~0}}, - {MODKEY, XK_ssharp, spawn, - SHCMD("pamixer --allow-boost -d 5; kill -44 $(pidof dwmblocks)")}, - {MODKEY | ShiftMask, XK_ssharp, spawn, - SHCMD("pamixer --allow-boost -d 15; kill -44 $(pidof dwmblocks)")}, - {MODKEY, XK_dead_acute, spawn, - SHCMD("pamixer --allow-boost -i 5; kill -44 $(pidof dwmblocks)")}, - {MODKEY | ShiftMask, XK_dead_acute, spawn, - SHCMD("pamixer --allow-boost -i 15; kill -44 $(pidof dwmblocks)")}, - {MODKEY, XK_BackSpace, spawn, SHCMD("sysact")}, - {MODKEY | ShiftMask, XK_BackSpace, spawn, SHCMD("sysact")}, - - {MODKEY, XK_Tab, view, {0}}, - /* { MODKEY|ShiftMask, XK_Tab, spawn, - * SHCMD("") - * }, - */ - {MODKEY, XK_q, killclient, {0}}, - {MODKEY | ShiftMask, XK_q, spawn, SHCMD("sysact")}, - {MODKEY, XK_w, spawn, SHCMD("$BROWSER")}, - {MODKEY | ShiftMask, XK_w, spawn, SHCMD(TERMINAL " -e sudo nmtui")}, - {MODKEY, XK_e, spawn, - SHCMD( - TERMINAL - " -e neomutt ; pkill -RTMIN+12 dwmblocks; rmdir ~/.abook")}, // REPLACE - {MODKEY | ShiftMask, XK_e, spawn, - SHCMD(TERMINAL " -e abook -C ~/.config/abook/abookrc --datafile " - "~/.config/abook/addressbook")}, // REPLACE - {MODKEY, XK_r, spawn, SHCMD(TERMINAL " -e lf")}, - {MODKEY | ShiftMask, XK_r, spawn, SHCMD(TERMINAL " -e htop")}, - {MODKEY, XK_t, setlayout, {.v = &layouts[0]}}, /* tile */ - {MODKEY | ShiftMask, XK_t, setlayout, {.v = &layouts[1]}}, /* bstack */ - {MODKEY, XK_z, setlayout, {.v = &layouts[2]}}, /* spiral */ - {MODKEY | ShiftMask, XK_z, setlayout, {.v = &layouts[3]}}, /* dwindle */ - {MODKEY, XK_u, setlayout, {.v = &layouts[4]}}, /* deck */ - {MODKEY | ShiftMask, XK_u, setlayout, {.v = &layouts[5]}}, /* monocle */ - {MODKEY, XK_i, setlayout, {.v = &layouts[6]}}, /* centeredmaster */ - {MODKEY | ShiftMask, - XK_i, - setlayout, - {.v = &layouts[7]}}, /* centeredfloatingmaster */ - {MODKEY, XK_o, incnmaster, {.i = +1}}, - {MODKEY | ShiftMask, XK_o, incnmaster, {.i = -1}}, - {MODKEY, XK_p, spawn, SHCMD("mpc toggle")}, - {MODKEY | ShiftMask, XK_p, spawn, SHCMD("mpc pause ; pauseallmpv")}, - {MODKEY, XK_udiaeresis, spawn, SHCMD("mpc seek -10")}, - {MODKEY | ShiftMask, XK_udiaeresis, spawn, SHCMD("mpc seek -60")}, - {MODKEY, XK_plus, spawn, SHCMD("mpc seek +10")}, - {MODKEY | ShiftMask, XK_plus, spawn, SHCMD("mpc seek +60")}, - {MODKEY, XK_numbersign, spawn, SHCMD(TERMINAL " -e bc -l")}, - /* { MODKEY|ShiftMask, XK_backslash, spawn, SHCMD("") - * }, - */ - - {MODKEY, XK_a, togglegaps, {0}}, - {MODKEY | ShiftMask, XK_a, defaultgaps, {0}}, - {MODKEY, XK_s, togglesticky, {0}}, - /* { MODKEY|ShiftMask, XK_s, spawn, - * SHCMD("") - * }, - */ - {MODKEY, XK_d, spawn, SHCMD("dmenu_run")}, - {MODKEY | ShiftMask, XK_d, spawn, SHCMD("passmenu")}, - {MODKEY, XK_f, togglefullscr, {0}}, - {MODKEY | ShiftMask, XK_f, setlayout, {.v = &layouts[8]}}, - {MODKEY, XK_g, shiftview, {.i = -1}}, - {MODKEY | ShiftMask, XK_g, shifttag, {.i = -1}}, - {MODKEY, XK_h, setmfact, {.f = -0.05}}, - /* J and K are automatically bound above in STACKEYS */ - {MODKEY, XK_l, setmfact, {.f = +0.05}}, - {MODKEY, XK_odiaeresis, shiftview, {.i = 1}}, - {MODKEY | ShiftMask, XK_odiaeresis, shifttag, {.i = 1}}, - {MODKEY, XK_adiaeresis, togglescratch, {.ui = 1}}, - /* { MODKEY|ShiftMask, XK_adiaeresis, spawn, SHCMD("") - * }, - */ - {MODKEY | ShiftMask, XK_adiaeresis, togglesmartgaps, {0}}, - {MODKEY, XK_Return, spawn, {.v = termcmd}}, - {MODKEY | ShiftMask, XK_Return, togglescratch, {.ui = 0}}, - - {MODKEY, XK_y, incrgaps, {.i = +3}}, - /* { MODKEY|ShiftMask, XK_y, spawn, - * SHCMD("") - * }, - */ - {MODKEY, XK_x, incrgaps, {.i = -3}}, - /* { MODKEY|ShiftMask, XK_x, spawn, - * SHCMD("") - * }, - */ - /* { MODKEY, XK_c, spawn, - * SHCMD("") - * }, - */ - /* { MODKEY|ShiftMask, XK_c, spawn, - * SHCMD("") - * }, - */ - /* V is automatically bound above in STACKKEYS */ - {MODKEY, XK_b, togglebar, {0}}, - /* { MODKEY|ShiftMask, XK_b, spawn, - * SHCMD("") - * }, - */ - {MODKEY, XK_n, spawn, SHCMD(TERMINAL " -e nvim -c VimwikiIndex")}, - {MODKEY | ShiftMask, XK_n, spawn, - SHCMD(TERMINAL " -e newsboat; pkill -RTMIN+6 dwmblocks")}, // REPLACE - {MODKEY, XK_m, spawn, SHCMD(TERMINAL " -e ncmpcpp")}, - {MODKEY | ShiftMask, XK_m, spawn, - SHCMD("pamixer -t; kill -44 $(pidof dwmblocks)")}, - {MODKEY, XK_comma, spawn, SHCMD("mpc prev")}, - {MODKEY | ShiftMask, XK_comma, spawn, SHCMD("mpc seek 0%")}, - {MODKEY, XK_period, spawn, SHCMD("mpc next")}, - {MODKEY | ShiftMask, XK_period, spawn, SHCMD("mpc repeat")}, - - {MODKEY, XK_Left, focusmon, {.i = -1}}, - {MODKEY | ShiftMask, XK_Left, tagmon, {.i = -1}}, - {MODKEY, XK_Right, focusmon, {.i = +1}}, - {MODKEY | ShiftMask, XK_Right, tagmon, {.i = +1}}, - - {MODKEY, XK_Page_Up, shiftview, {.i = -1}}, - {MODKEY | ShiftMask, XK_Page_Up, shifttag, {.i = -1}}, - {MODKEY, XK_Page_Down, shiftview, {.i = +1}}, - {MODKEY | ShiftMask, XK_Page_Down, shifttag, {.i = +1}}, - {MODKEY, XK_Insert, spawn, - SHCMD("xdotool type $(grep -v '^#' ~/.local/share/snippets | dmenu -i -l " - "50 | cut -d' ' -f1)")}, - - {MODKEY, XK_F1, spawn, - SHCMD("groff -mom /usr/local/share/dwm/keybinds.mom -Tpdf | zathura -")}, - {MODKEY, XK_F2, spawn, SHCMD("$TERMINAL -e deluge-gtk")}, - {MODKEY, XK_F3, spawn, SHCMD("librewolf")}, - {MODKEY, XK_F4, spawn, - SHCMD(TERMINAL " -e pulsemixer; kill -44 $(pidof dwmblocks)")}, - {MODKEY, XK_F5, spawn, SHCMD("")}, - {MODKEY, XK_F6, spawn, SHCMD("")}, - {MODKEY, XK_F7, spawn, SHCMD("")}, - {MODKEY, XK_F8, spawn, SHCMD("")}, - {MODKEY, XK_F9, spawn, SHCMD("")}, - {MODKEY, XK_F10, spawn, SHCMD("dmenumount")}, - {MODKEY, XK_F11, spawn, SHCMD("dmenuumount")}, - {MODKEY, XK_F12, spawn, - SHCMD( - "remaps & notify-send \\\" Keyboard remapping...\\\" \\\"Re-running " - "keyboard defaults for any newly plugged-in keyboards.\\\"")}, - {MODKEY, XK_space, zoom, {0}}, - {MODKEY | ShiftMask, XK_space, togglefloating, {0}}, - - {0, XK_Print, spawn, SHCMD("maim pic-full-$(date '+%y%m%d-%H%M-%S').png")}, - {ShiftMask, XK_Print, spawn, SHCMD("maimpick")}, - {MODKEY, XK_Print, spawn, SHCMD("dmenurecord")}, - {MODKEY | ShiftMask, XK_Print, spawn, SHCMD("dmenurecord kill")}, - {MODKEY, XK_Delete, spawn, SHCMD("dmenurecord kill")}, - {MODKEY, XK_Scroll_Lock, spawn, SHCMD("killall screenkey || screenkey &")}, - - {0, XF86XK_AudioMute, spawn, - SHCMD("pamixer -t; kill -44 $(pidof dwmblocks)")}, - {0, XF86XK_AudioRaiseVolume, spawn, - SHCMD("pamixer --allow-boost -i 3; kill -44 $(pidof dwmblocks)")}, - {0, XF86XK_AudioLowerVolume, spawn, - SHCMD("pamixer --allow-boost -d 3; kill -44 $(pidof dwmblocks)")}, - {0, XF86XK_AudioPrev, spawn, SHCMD("mpc prev")}, - {0, XF86XK_AudioNext, spawn, SHCMD("mpc next")}, - {0, XF86XK_AudioPause, spawn, SHCMD("mpc pause")}, - {0, XF86XK_AudioPlay, spawn, SHCMD("mpc play")}, - {0, XF86XK_AudioStop, spawn, SHCMD("mpc stop")}, - {0, XF86XK_AudioRewind, spawn, SHCMD("mpc seek -10")}, - {0, XF86XK_AudioForward, spawn, SHCMD("mpc seek +10")}, - {0, XF86XK_AudioMedia, spawn, SHCMD(TERMINAL " -e ncmpcpp")}, - {0, XF86XK_AudioMicMute, spawn, - SHCMD("pactl set-source-mute @DEFAULT_SOURCE@ toggle")}, - {0, XF86XK_PowerOff, spawn, SHCMD("sysact")}, - {0, XF86XK_Calculator, spawn, SHCMD(TERMINAL " -e bc -l")}, - {0, XF86XK_Sleep, spawn, SHCMD("sudo -A zzz")}, - {0, XF86XK_WWW, spawn, SHCMD("$BROWSER")}, - {0, XF86XK_DOS, spawn, SHCMD(TERMINAL)}, - {0, XF86XK_ScreenSaver, spawn, - SHCMD("slock & xset dpms force off; mpc pause; pauseallmpv")}, - {0, XF86XK_TaskPane, spawn, SHCMD(TERMINAL " -e htop")}, - {0, XF86XK_Mail, spawn, - SHCMD(TERMINAL " -e neomutt ; pkill -RTMIN+12 dwmblocks")}, - {0, XF86XK_MyComputer, spawn, SHCMD(TERMINAL " -e lf /")}, - /* { 0, XF86XK_Battery, spawn, - * SHCMD("") - * }, - */ - {0, XF86XK_Launch1, spawn, SHCMD("xset dpms force off")}, - {0, XF86XK_TouchpadToggle, spawn, - SHCMD("(synclient | grep 'TouchpadOff.*1' && synclient TouchpadOff=0) || " - "synclient TouchpadOff=1")}, - {0, XF86XK_TouchpadOff, spawn, SHCMD("synclient TouchpadOff=1")}, - {0, XF86XK_TouchpadOn, spawn, SHCMD("synclient TouchpadOff=0")}, - {0, XF86XK_MonBrightnessUp, spawn, SHCMD("xbacklight -inc 15")}, - {0, XF86XK_MonBrightnessDown, spawn, SHCMD("xbacklight -dec 15")}, - - /* { MODKEY|Mod4Mask, XK_h, incrgaps, {.i = +1 } }, - */ - /* { MODKEY|Mod4Mask, XK_l, incrgaps, {.i = -1 } }, - */ - /* { MODKEY|Mod4Mask|ShiftMask, XK_h, incrogaps, {.i = +1 } }, - */ - /* { MODKEY|Mod4Mask|ShiftMask, XK_l, incrogaps, {.i = -1 } }, - */ - /* { MODKEY|Mod4Mask|ControlMask, XK_h, incrigaps, {.i = +1 } }, - */ - /* { MODKEY|Mod4Mask|ControlMask, XK_l, incrigaps, {.i = -1 } }, - */ - /* { MODKEY|Mod4Mask|ShiftMask, XK_0, defaultgaps, {0} }, */ - /* { MODKEY, XK_y, incrihgaps, {.i = +1 } }, - */ - /* { MODKEY, XK_o, incrihgaps, {.i = -1 } }, - */ - /* { MODKEY|ControlMask, XK_y, incrivgaps, {.i = +1 } }, - */ - /* { MODKEY|ControlMask, XK_o, incrivgaps, {.i = -1 } }, - */ - /* { MODKEY|Mod4Mask, XK_y, incrohgaps, {.i = +1 } }, - */ - /* { MODKEY|Mod4Mask, XK_o, incrohgaps, {.i = -1 } }, - */ - /* { MODKEY|ShiftMask, XK_y, incrovgaps, {.i = +1 } }, - */ - /* { MODKEY|ShiftMask, XK_o, incrovgaps, {.i = -1 } }, - */ - -}; - -/* button definitions */ -/* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, - * ClkClientWin, or ClkRootWin */ -static Button buttons[] = { -/* click event mask button function argument - */ -#ifndef __OpenBSD__ - {ClkWinTitle, 0, Button2, zoom, {0}}, - {ClkStatusText, 0, Button1, sigdwmblocks, {.i = 1}}, - {ClkStatusText, 0, Button2, sigdwmblocks, {.i = 2}}, - {ClkStatusText, 0, Button3, sigdwmblocks, {.i = 3}}, - {ClkStatusText, 0, Button4, sigdwmblocks, {.i = 4}}, - {ClkStatusText, 0, Button5, sigdwmblocks, {.i = 5}}, - {ClkStatusText, ShiftMask, Button1, sigdwmblocks, {.i = 6}}, -#endif - {ClkStatusText, ShiftMask, Button3, spawn, - SHCMD(TERMINAL " -e nvim ~/.local/src/dwmblocks/config.h")}, - {ClkClientWin, MODKEY, Button1, movemouse, {0}}, - {ClkClientWin, MODKEY, Button2, defaultgaps, {0}}, - {ClkClientWin, MODKEY, Button3, resizemouse, {0}}, - {ClkClientWin, MODKEY, Button4, incrgaps, {.i = +1}}, - {ClkClientWin, MODKEY, Button5, incrgaps, {.i = -1}}, - {ClkTagBar, 0, Button1, view, {0}}, - {ClkTagBar, 0, Button3, toggleview, {0}}, - {ClkTagBar, MODKEY, Button1, tag, {0}}, - {ClkTagBar, MODKEY, Button3, toggletag, {0}}, - {ClkTagBar, 0, Button4, shiftview, {.i = -1}}, - {ClkTagBar, 0, Button5, shiftview, {.i = 1}}, - {ClkRootWin, 0, Button2, togglebar, {0}}, -}; diff --git a/.local/src/dwm/config.mk b/.local/src/dwm/config.mk deleted file mode 100644 index b77641d6..00000000 --- a/.local/src/dwm/config.mk +++ /dev/null @@ -1,38 +0,0 @@ -# dwm version -VERSION = 6.2 - -# Customize below to fit your system - -# paths -PREFIX = /usr/local -MANPREFIX = ${PREFIX}/share/man - -X11INC = /usr/X11R6/include -X11LIB = /usr/X11R6/lib - -# Xinerama, comment if you don't want it -XINERAMALIBS = -lXinerama -XINERAMAFLAGS = -DXINERAMA - -# freetype -FREETYPELIBS = -lfontconfig -lXft -FREETYPEINC = /usr/include/freetype2 -# OpenBSD (uncomment) -#FREETYPEINC = ${X11INC}/freetype2 - -# includes and libs -INCS = -I${X11INC} -I${FREETYPEINC} -LIBS = -L${X11LIB} -lX11 ${XINERAMALIBS} ${FREETYPELIBS} -lX11-xcb -lxcb -lxcb-res - -# flags -CPPFLAGS = -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_POSIX_C_SOURCE=200809L -DVERSION=\"${VERSION}\" ${XINERAMAFLAGS} -#CFLAGS = -g -std=c99 -pedantic -Wall -O0 ${INCS} ${CPPFLAGS} -CFLAGS = -std=c99 -pedantic -Wall -Wno-deprecated-declarations -Os ${INCS} ${CPPFLAGS} -LDFLAGS = ${LIBS} - -# Solaris -#CFLAGS = -fast ${INCS} -DVERSION=\"${VERSION}\" -#LDFLAGS = ${LIBS} - -# compiler and linker -CC = cc diff --git a/.local/src/dwm/drw.c b/.local/src/dwm/drw.c deleted file mode 100644 index 56175a83..00000000 --- a/.local/src/dwm/drw.c +++ /dev/null @@ -1,424 +0,0 @@ -/* See LICENSE file for copyright and license details. */ -#include -#include -#include -#include -#include - -#include "drw.h" -#include "util.h" - -#define UTF_INVALID 0xFFFD -#define UTF_SIZ 4 - -static const unsigned char utfbyte[UTF_SIZ + 1] = {0x80, 0, 0xC0, 0xE0, 0xF0}; -static const unsigned char utfmask[UTF_SIZ + 1] = {0xC0, 0x80, 0xE0, 0xF0, 0xF8}; -static const long utfmin[UTF_SIZ + 1] = { 0, 0, 0x80, 0x800, 0x10000}; -static const long utfmax[UTF_SIZ + 1] = {0x10FFFF, 0x7F, 0x7FF, 0xFFFF, 0x10FFFF}; - -static long -utf8decodebyte(const char c, size_t *i) -{ - for (*i = 0; *i < (UTF_SIZ + 1); ++(*i)) - if (((unsigned char)c & utfmask[*i]) == utfbyte[*i]) - return (unsigned char)c & ~utfmask[*i]; - return 0; -} - -static size_t -utf8validate(long *u, size_t i) -{ - if (!BETWEEN(*u, utfmin[i], utfmax[i]) || BETWEEN(*u, 0xD800, 0xDFFF)) - *u = UTF_INVALID; - for (i = 1; *u > utfmax[i]; ++i) - ; - return i; -} - -static size_t -utf8decode(const char *c, long *u, size_t clen) -{ - size_t i, j, len, type; - long udecoded; - - *u = UTF_INVALID; - if (!clen) - return 0; - udecoded = utf8decodebyte(c[0], &len); - if (!BETWEEN(len, 1, UTF_SIZ)) - return 1; - for (i = 1, j = 1; i < clen && j < len; ++i, ++j) { - udecoded = (udecoded << 6) | utf8decodebyte(c[i], &type); - if (type) - return j; - } - if (j < len) - return 0; - *u = udecoded; - utf8validate(u, len); - - return len; -} - -Drw * -drw_create(Display *dpy, int screen, Window root, unsigned int w, unsigned int h) -{ - Drw *drw = ecalloc(1, sizeof(Drw)); - - drw->dpy = dpy; - drw->screen = screen; - drw->root = root; - drw->w = w; - drw->h = h; - drw->drawable = XCreatePixmap(dpy, root, w, h, DefaultDepth(dpy, screen)); - drw->gc = XCreateGC(dpy, root, 0, NULL); - XSetLineAttributes(dpy, drw->gc, 1, LineSolid, CapButt, JoinMiter); - - return drw; -} - -void -drw_resize(Drw *drw, unsigned int w, unsigned int h) -{ - if (!drw) - return; - - drw->w = w; - drw->h = h; - if (drw->drawable) - XFreePixmap(drw->dpy, drw->drawable); - drw->drawable = XCreatePixmap(drw->dpy, drw->root, w, h, DefaultDepth(drw->dpy, drw->screen)); -} - -void -drw_free(Drw *drw) -{ - XFreePixmap(drw->dpy, drw->drawable); - XFreeGC(drw->dpy, drw->gc); - free(drw); -} - -/* This function is an implementation detail. Library users should use - * drw_fontset_create instead. - */ -static Fnt * -xfont_create(Drw *drw, const char *fontname, FcPattern *fontpattern) -{ - Fnt *font; - XftFont *xfont = NULL; - FcPattern *pattern = NULL; - - if (fontname) { - /* Using the pattern found at font->xfont->pattern does not yield the - * same substitution results as using the pattern returned by - * FcNameParse; using the latter results in the desired fallback - * behaviour whereas the former just results in missing-character - * rectangles being drawn, at least with some fonts. */ - if (!(xfont = XftFontOpenName(drw->dpy, drw->screen, fontname))) { - fprintf(stderr, "error, cannot load font from name: '%s'\n", fontname); - return NULL; - } - if (!(pattern = FcNameParse((FcChar8 *) fontname))) { - fprintf(stderr, "error, cannot parse font name to pattern: '%s'\n", fontname); - XftFontClose(drw->dpy, xfont); - return NULL; - } - } else if (fontpattern) { - if (!(xfont = XftFontOpenPattern(drw->dpy, fontpattern))) { - fprintf(stderr, "error, cannot load font from pattern.\n"); - return NULL; - } - } else { - die("no font specified."); - } - - font = ecalloc(1, sizeof(Fnt)); - font->xfont = xfont; - font->pattern = pattern; - font->h = xfont->ascent + xfont->descent; - font->dpy = drw->dpy; - - return font; -} - -static void -xfont_free(Fnt *font) -{ - if (!font) - return; - if (font->pattern) - FcPatternDestroy(font->pattern); - XftFontClose(font->dpy, font->xfont); - free(font); -} - -Fnt* -drw_fontset_create(Drw* drw, char *fonts[], size_t fontcount) -{ - Fnt *cur, *ret = NULL; - size_t i; - - if (!drw || !fonts) - return NULL; - - for (i = 1; i <= fontcount; i++) { - if ((cur = xfont_create(drw, fonts[fontcount - i], NULL))) { - cur->next = ret; - ret = cur; - } - } - return (drw->fonts = ret); -} - -void -drw_fontset_free(Fnt *font) -{ - if (font) { - drw_fontset_free(font->next); - xfont_free(font); - } -} - -void -drw_clr_create(Drw *drw, Clr *dest, const char *clrname) -{ - if (!drw || !dest || !clrname) - return; - - if (!XftColorAllocName(drw->dpy, DefaultVisual(drw->dpy, drw->screen), - DefaultColormap(drw->dpy, drw->screen), - clrname, dest)) - die("error, cannot allocate color '%s'", clrname); - - dest->pixel |= 0xff << 24; -} - -/* Wrapper to create color schemes. The caller has to call free(3) on the - * returned color scheme when done using it. */ -Clr * -drw_scm_create(Drw *drw, char *clrnames[], size_t clrcount) -{ - size_t i; - Clr *ret; - - /* need at least two colors for a scheme */ - if (!drw || !clrnames || clrcount < 2 || !(ret = ecalloc(clrcount, sizeof(XftColor)))) - return NULL; - - for (i = 0; i < clrcount; i++) - drw_clr_create(drw, &ret[i], clrnames[i]); - return ret; -} - -void -drw_setfontset(Drw *drw, Fnt *set) -{ - if (drw) - drw->fonts = set; -} - -void -drw_setscheme(Drw *drw, Clr *scm) -{ - if (drw) - drw->scheme = scm; -} - -void -drw_rect(Drw *drw, int x, int y, unsigned int w, unsigned int h, int filled, int invert) -{ - if (!drw || !drw->scheme) - return; - XSetForeground(drw->dpy, drw->gc, invert ? drw->scheme[ColBg].pixel : drw->scheme[ColFg].pixel); - if (filled) - XFillRectangle(drw->dpy, drw->drawable, drw->gc, x, y, w, h); - else - XDrawRectangle(drw->dpy, drw->drawable, drw->gc, x, y, w - 1, h - 1); -} - -int -drw_text(Drw *drw, int x, int y, unsigned int w, unsigned int h, unsigned int lpad, const char *text, int invert) -{ - char buf[1024]; - int ty; - unsigned int ew; - XftDraw *d = NULL; - Fnt *usedfont, *curfont, *nextfont; - size_t i, len; - int utf8strlen, utf8charlen, render = x || y || w || h; - long utf8codepoint = 0; - const char *utf8str; - FcCharSet *fccharset; - FcPattern *fcpattern; - FcPattern *match; - XftResult result; - int charexists = 0; - - if (!drw || (render && !drw->scheme) || !text || !drw->fonts) - return 0; - - if (!render) { - w = ~w; - } else { - XSetForeground(drw->dpy, drw->gc, drw->scheme[invert ? ColFg : ColBg].pixel); - XFillRectangle(drw->dpy, drw->drawable, drw->gc, x, y, w, h); - d = XftDrawCreate(drw->dpy, drw->drawable, - DefaultVisual(drw->dpy, drw->screen), - DefaultColormap(drw->dpy, drw->screen)); - x += lpad; - w -= lpad; - } - - usedfont = drw->fonts; - while (1) { - utf8strlen = 0; - utf8str = text; - nextfont = NULL; - while (*text) { - utf8charlen = utf8decode(text, &utf8codepoint, UTF_SIZ); - for (curfont = drw->fonts; curfont; curfont = curfont->next) { - charexists = charexists || XftCharExists(drw->dpy, curfont->xfont, utf8codepoint); - if (charexists) { - if (curfont == usedfont) { - utf8strlen += utf8charlen; - text += utf8charlen; - } else { - nextfont = curfont; - } - break; - } - } - - if (!charexists || nextfont) - break; - else - charexists = 0; - } - - if (utf8strlen) { - drw_font_getexts(usedfont, utf8str, utf8strlen, &ew, NULL); - /* shorten text if necessary */ - for (len = MIN(utf8strlen, sizeof(buf) - 1); len && ew > w; len--) - drw_font_getexts(usedfont, utf8str, len, &ew, NULL); - - if (len) { - memcpy(buf, utf8str, len); - buf[len] = '\0'; - if (len < utf8strlen) - for (i = len; i && i > len - 3; buf[--i] = '.') - ; /* NOP */ - - if (render) { - ty = y + (h - usedfont->h) / 2 + usedfont->xfont->ascent; - XftDrawStringUtf8(d, &drw->scheme[invert ? ColBg : ColFg], - usedfont->xfont, x, ty, (XftChar8 *)buf, len); - } - x += ew; - w -= ew; - } - } - - if (!*text) { - break; - } else if (nextfont) { - charexists = 0; - usedfont = nextfont; - } else { - /* Regardless of whether or not a fallback font is found, the - * character must be drawn. */ - charexists = 1; - - fccharset = FcCharSetCreate(); - FcCharSetAddChar(fccharset, utf8codepoint); - - if (!drw->fonts->pattern) { - /* Refer to the comment in xfont_create for more information. */ - die("the first font in the cache must be loaded from a font string."); - } - - fcpattern = FcPatternDuplicate(drw->fonts->pattern); - FcPatternAddCharSet(fcpattern, FC_CHARSET, fccharset); - FcPatternAddBool(fcpattern, FC_SCALABLE, FcTrue); - FcPatternAddBool(fcpattern, FC_COLOR, FcFalse); - - FcConfigSubstitute(NULL, fcpattern, FcMatchPattern); - FcDefaultSubstitute(fcpattern); - match = XftFontMatch(drw->dpy, drw->screen, fcpattern, &result); - - FcCharSetDestroy(fccharset); - FcPatternDestroy(fcpattern); - - if (match) { - usedfont = xfont_create(drw, NULL, match); - if (usedfont && XftCharExists(drw->dpy, usedfont->xfont, utf8codepoint)) { - for (curfont = drw->fonts; curfont->next; curfont = curfont->next) - ; /* NOP */ - curfont->next = usedfont; - } else { - xfont_free(usedfont); - usedfont = drw->fonts; - } - } - } - } - if (d) - XftDrawDestroy(d); - - return x + (render ? w : 0); -} - -void -drw_map(Drw *drw, Window win, int x, int y, unsigned int w, unsigned int h) -{ - if (!drw) - return; - - XCopyArea(drw->dpy, drw->drawable, win, drw->gc, x, y, w, h, x, y); - XSync(drw->dpy, False); -} - -unsigned int -drw_fontset_getwidth(Drw *drw, const char *text) -{ - if (!drw || !drw->fonts || !text) - return 0; - return drw_text(drw, 0, 0, 0, 0, 0, text, 0); -} - -void -drw_font_getexts(Fnt *font, const char *text, unsigned int len, unsigned int *w, unsigned int *h) -{ - XGlyphInfo ext; - - if (!font || !text) - return; - - XftTextExtentsUtf8(font->dpy, font->xfont, (XftChar8 *)text, len, &ext); - if (w) - *w = ext.xOff; - if (h) - *h = font->h; -} - -Cur * -drw_cur_create(Drw *drw, int shape) -{ - Cur *cur; - - if (!drw || !(cur = ecalloc(1, sizeof(Cur)))) - return NULL; - - cur->cursor = XCreateFontCursor(drw->dpy, shape); - - return cur; -} - -void -drw_cur_free(Drw *drw, Cur *cursor) -{ - if (!cursor) - return; - - XFreeCursor(drw->dpy, cursor->cursor); - free(cursor); -} diff --git a/.local/src/dwm/drw.h b/.local/src/dwm/drw.h deleted file mode 100644 index 09617cf9..00000000 --- a/.local/src/dwm/drw.h +++ /dev/null @@ -1,57 +0,0 @@ -/* See LICENSE file for copyright and license details. */ - -typedef struct { - Cursor cursor; -} Cur; - -typedef struct Fnt { - Display *dpy; - unsigned int h; - XftFont *xfont; - FcPattern *pattern; - struct Fnt *next; -} Fnt; - -enum { ColFg, ColBg, ColBorder }; /* Clr scheme index */ -typedef XftColor Clr; - -typedef struct { - unsigned int w, h; - Display *dpy; - int screen; - Window root; - Drawable drawable; - GC gc; - Clr *scheme; - Fnt *fonts; -} Drw; - -/* Drawable abstraction */ -Drw *drw_create(Display *dpy, int screen, Window win, unsigned int w, unsigned int h); -void drw_resize(Drw *drw, unsigned int w, unsigned int h); -void drw_free(Drw *drw); - -/* Fnt abstraction */ -Fnt *drw_fontset_create(Drw* drw, char *fonts[], size_t fontcount); -void drw_fontset_free(Fnt* set); -unsigned int drw_fontset_getwidth(Drw *drw, const char *text); -void drw_font_getexts(Fnt *font, const char *text, unsigned int len, unsigned int *w, unsigned int *h); - -/* Colorscheme abstraction */ -void drw_clr_create(Drw *drw, Clr *dest, const char *clrname); -Clr *drw_scm_create(Drw *drw, char *clrnames[], size_t clrcount); - -/* Cursor abstraction */ -Cur *drw_cur_create(Drw *drw, int shape); -void drw_cur_free(Drw *drw, Cur *cursor); - -/* Drawing context manipulation */ -void drw_setfontset(Drw *drw, Fnt *set); -void drw_setscheme(Drw *drw, Clr *scm); - -/* Drawing functions */ -void drw_rect(Drw *drw, int x, int y, unsigned int w, unsigned int h, int filled, int invert); -int drw_text(Drw *drw, int x, int y, unsigned int w, unsigned int h, unsigned int lpad, const char *text, int invert); - -/* Map functions */ -void drw_map(Drw *drw, Window win, int x, int y, unsigned int w, unsigned int h); diff --git a/.local/src/dwm/drw.o b/.local/src/dwm/drw.o deleted file mode 100644 index 209fff1a..00000000 Binary files a/.local/src/dwm/drw.o and /dev/null differ diff --git a/.local/src/dwm/dwm b/.local/src/dwm/dwm deleted file mode 100755 index e5b95183..00000000 Binary files a/.local/src/dwm/dwm and /dev/null differ diff --git a/.local/src/dwm/dwm.1 b/.local/src/dwm/dwm.1 deleted file mode 100644 index 94dbd945..00000000 --- a/.local/src/dwm/dwm.1 +++ /dev/null @@ -1,214 +0,0 @@ -.TH DWM 1 dwm\-VERSION -.SH NAME -dwm \- dynamic window manager (Luke Smith 's build) -.SH SYNOPSIS -.B dwm -.RB [ \-v ] -.SH DESCRIPTION -dwm is a dynamic window manager for X. -.P -dwm "orders" windows based on recency and primacy, while dwm layouts may -change, the most recent "master" window is shown in the most prominent -position. There are bindings for cycling through and promoting windows to the -master position. -.P -Windows are grouped by tags. Each window can be tagged with one or multiple -tags. Selecting certain tags displays all windows with these tags. -.P -Each screen contains a small status bar which displays all available tags, the -layout, the title of the focused window, and the text read from the root window -name property, if the screen is focused. A floating window is indicated with an -empty square and a maximised floating window is indicated with a filled square -before the windows title. The selected tags are indicated with a different -color. The tags of the focused window are indicated with a filled square in the -top left corner. The tags which are applied to one or more windows are -indicated with an empty square in the top left corner. -.P -dwm draws a small border around windows to indicate the focus state. -.P -.I -libxft-bgra -should be installed for this build of dwm. Arch users may install it via the -AUR. Color characters and emoji are enabled, but these will cause crashes -without the fix -.I -libxft-bgra -offers. -.SH OPTIONS -.TP -.B \-v -prints version information to standard output, then exits. -.SH USAGE -.SS Status bar -.TP -.B X root window name -is read and displayed in the status text area. It can be set with the -.BR xsetroot (1) -command. -.TP -.B Left click -click on a tag label to display all windows with that tag, click on the layout -label toggles between tiled and floating layout. -.TP -.B Right click -click on a tag label adds/removes all windows with that tag to/from the view. -.TP -.B Super\-Left click -click on a tag label applies that tag to the focused window. -.TP -.B Super\-Right click -click on a tag label adds/removes that tag to/from the focused window. -.SS Keyboard commands -.TP -.B Super\-Return -Start terminal, -.BR st(1). -.TP -.B Super\-d -Spawn -.BR dmenu(1) -for launching other programs. -.TP -.B Super\-b -Toggles bar on and off. -.TP -.B Super\-q -Close focused window. -.TP -.B Super\-t/T -Sets tiled/bstack layouts. -.TP -.B Super\-f -Toggle fullscreen window. -.TP -.B Super\-F -Toggle floating layout. -.TP -.B Super\-y/Y -Sets Fibonacci spiral/dwinde layouts. -.TP -.B Super\-u/U -Sets centered master layout. -.TP -.B Super\-i/I -Sets centered master or floating master layouts. -.TP -.B Super\-space -Zooms/cycles focused window to/from master area. -.TP -.B Super\-j/k -Focus next/previous window. -.TP -.B Super\-Shift\-j/k -Move selected window down/up in stack. -.TP -.B Super\-o/O -Increase/decrease number of windows in master area. -.TP -.B Super\-l -Increase master area size. -.TP -.B Super\-h -Decrease master area size. -.TP -.B Super\-Shift\-space -Toggle focused window between tiled and floating state. -.TP -.B Super\-Tab -Toggles to the previously selected tags. -.TP -.B Super\-g -Moves to the previous tag. -.TP -.B Super\-Shift\-g -Moves selected window to the previous tag. -.TP -.B Super\-; -Moves to the next tag. -.TP -.B Super\-Shift\-; -Moves selected window to the next tag. -.TP -.B Super\-PageUp -Moves to the previous tag. -.TP -.B Super\-Shift\-PageUp -Moves selected window to the previous tag. -.TP -.B Super\-Pagedown -Moves to the next tag. -.TP -.B Super\-Shift\-PageDown -Moves selected window to the next tag. -.TP -.B Super\-a -Toggle gaps. -.TP -.B Super\-z -Increase gaps between windows. -.TP -.B Super\-x -Decrease gaps between windows. -.TP -.B Super\-Shift\-[1..n] -Apply nth tag to focused window. -.TP -.B Super\-Shift\-0 -Apply all tags to focused window. -.TP -.B Super\-Control\-Shift\-[1..n] -Add/remove nth tag to/from focused window. -.TP -.B Super\-[1..n] -View all windows with nth tag. -.TP -.B Super\-0 -View all windows with any tag. -.TP -.B Super\-Control\-[1..n] -Add/remove all windows with nth tag to/from the view. -.TP -.B Super\-Shift\-q -Quit dwm. -.TP -.B Mod1\-Control\-Shift\-q -Menu to refresh/quit/reboot/shutdown. -.SS Mouse commands -.TP -.B Super\-Left click -Move focused window while dragging. Tiled windows will be toggled to the floating state. -.TP -.B Super\-Middle click -Toggles focused window between floating and tiled state. -.TP -.B Super\-Right click -Resize focused window while dragging. Tiled windows will be toggled to the floating state. -.SH CUSTOMIZATION -dwm is customized by creating a custom config.h and (re)compiling the source -code. This keeps it fast, secure and simple. -.SH SIGNALS -.TP -.B SIGHUP - 1 -Restart the dwm process. -.TP -.B SIGTERM - 15 -Cleanly terminate the dwm process. -.SH SEE ALSO -.BR dmenu (1), -.BR st (1) -.SH ISSUES -Java applications which use the XToolkit/XAWT backend may draw grey windows -only. The XToolkit/XAWT backend breaks ICCCM-compliance in recent JDK 1.5 and early -JDK 1.6 versions, because it assumes a reparenting window manager. Possible workarounds -are using JDK 1.4 (which doesn't contain the XToolkit/XAWT backend) or setting the -environment variable -.BR AWT_TOOLKIT=MToolkit -(to use the older Motif backend instead) or running -.B xprop -root -f _NET_WM_NAME 32a -set _NET_WM_NAME LG3D -or -.B wmname LG3D -(to pretend that a non-reparenting window manager is running that the -XToolkit/XAWT backend can recognize) or when using OpenJDK setting the environment variable -.BR _JAVA_AWT_WM_NONREPARENTING=1 . -.SH BUGS -Send all bug reports with a patch to hackers@suckless.org. diff --git a/.local/src/dwm/dwm.c b/.local/src/dwm/dwm.c deleted file mode 100644 index c0d141db..00000000 --- a/.local/src/dwm/dwm.c +++ /dev/null @@ -1,2629 +0,0 @@ -/* See LICENSE file for copyright and license details. - * - * dynamic window manager is designed like any other X client as well. It is - * driven through handling X events. In contrast to other X clients, a window - * manager selects for SubstructureRedirectMask on the root window, to receive - * events about window (dis-)appearance. Only one X connection at a time is - * allowed to select for this event mask. - * - * The event handlers of dwm are organized in an array which is accessed - * whenever a new event has been fetched. This allows event dispatching - * in O(1) time. - * - * Each child of the root window is called a client, except windows which have - * set the override_redirect flag. Clients are organized in a linked client - * list on each monitor, the focus history is remembered through a stack list - * on each monitor. Each client contains a bit array to indicate the tags of a - * client. - * - * Keys and tagging rules are organized as arrays and defined in config.h. - * - * To understand everything else, start reading main(). - */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#ifdef XINERAMA -#include -#endif /* XINERAMA */ -#include -#include -#include - -#include "drw.h" -#include "util.h" - -/* macros */ -#define BUTTONMASK (ButtonPressMask|ButtonReleaseMask) -#define CLEANMASK(mask) (mask & ~(numlockmask|LockMask) & (ShiftMask|ControlMask|Mod1Mask|Mod2Mask|Mod3Mask|Mod4Mask|Mod5Mask)) -#define GETINC(X) ((X) - 2000) -#define INC(X) ((X) + 2000) -#define INTERSECT(x,y,w,h,m) (MAX(0, MIN((x)+(w),(m)->wx+(m)->ww) - MAX((x),(m)->wx)) \ - * MAX(0, MIN((y)+(h),(m)->wy+(m)->wh) - MAX((y),(m)->wy))) -#define ISINC(X) ((X) > 1000 && (X) < 3000) -#define ISVISIBLE(C) ((C->tags & C->mon->tagset[C->mon->seltags]) || C->issticky) -#define PREVSEL 3000 -#define LENGTH(X) (sizeof X / sizeof X[0]) -#define MOUSEMASK (BUTTONMASK|PointerMotionMask) -#define MOD(N,M) ((N)%(M) < 0 ? (N)%(M) + (M) : (N)%(M)) -#define WIDTH(X) ((X)->w + 2 * (X)->bw) -#define HEIGHT(X) ((X)->h + 2 * (X)->bw) -#define NUMTAGS (LENGTH(tags) + LENGTH(scratchpads)) -#define TAGMASK ((1 << NUMTAGS) - 1) -#define SPTAG(i) ((1 << LENGTH(tags)) << (i)) -#define SPTAGMASK (((1 << LENGTH(scratchpads))-1) << LENGTH(tags)) -#define TEXTW(X) (drw_fontset_getwidth(drw, (X)) + lrpad) -#define TRUNC(X,A,B) (MAX((A), MIN((X), (B)))) - -/* enums */ -enum { CurNormal, CurResize, CurMove, CurLast }; /* cursor */ -enum { SchemeNorm, SchemeSel }; /* color schemes */ -enum { NetSupported, NetWMName, NetWMState, NetWMCheck, - NetWMFullscreen, NetActiveWindow, NetWMWindowType, - NetWMWindowTypeDialog, NetClientList, NetLast }; /* EWMH atoms */ -enum { WMProtocols, WMDelete, WMState, WMTakeFocus, WMLast }; /* default atoms */ -enum { ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, - ClkClientWin, ClkRootWin, ClkLast }; /* clicks */ - -typedef union { - int i; - unsigned int ui; - float f; - const void *v; -} Arg; - -typedef struct { - unsigned int click; - unsigned int mask; - unsigned int button; - void (*func)(const Arg *arg); - const Arg arg; -} Button; - -typedef struct Monitor Monitor; -typedef struct Client Client; -struct Client { - char name[256]; - float mina, maxa; - int x, y, w, h; - int oldx, oldy, oldw, oldh; - int basew, baseh, incw, inch, maxw, maxh, minw, minh; - int bw, oldbw; - unsigned int tags; - int isfixed, isfloating, isurgent, neverfocus, oldstate, isfullscreen, isterminal, noswallow, issticky; - pid_t pid; - Client *next; - Client *snext; - Client *swallowing; - Monitor *mon; - Window win; -}; - -typedef struct { - unsigned int mod; - KeySym keysym; - void (*func)(const Arg *); - const Arg arg; -} Key; - -typedef struct { - const char *symbol; - void (*arrange)(Monitor *); -} Layout; - -struct Monitor { - char ltsymbol[16]; - float mfact; - int nmaster; - int num; - int by; /* bar geometry */ - int mx, my, mw, mh; /* screen size */ - int wx, wy, ww, wh; /* window area */ - int gappih; /* horizontal gap between windows */ - int gappiv; /* vertical gap between windows */ - int gappoh; /* horizontal outer gaps */ - int gappov; /* vertical outer gaps */ - unsigned int seltags; - unsigned int sellt; - unsigned int tagset[2]; - int showbar; - int topbar; - Client *clients; - Client *sel; - Client *stack; - Monitor *next; - Window barwin; - const Layout *lt[2]; -}; - -typedef struct { - const char *class; - const char *instance; - const char *title; - unsigned int tags; - int isfloating; - int isterminal; - int noswallow; - int monitor; -} Rule; - -/* Xresources preferences */ -enum resource_type { - STRING = 0, - INTEGER = 1, - FLOAT = 2 -}; - -typedef struct { - char *name; - enum resource_type type; - void *dst; -} ResourcePref; - -/* function declarations */ -static void applyrules(Client *c); -static int applysizehints(Client *c, int *x, int *y, int *w, int *h, int interact); -static void arrange(Monitor *m); -static void arrangemon(Monitor *m); -static void attach(Client *c); -static void attachstack(Client *c); -static void buttonpress(XEvent *e); -static void checkotherwm(void); -static void cleanup(void); -static void cleanupmon(Monitor *mon); -static void clientmessage(XEvent *e); -static void configure(Client *c); -static void configurenotify(XEvent *e); -static void configurerequest(XEvent *e); -static void copyvalidchars(char *text, char *rawtext); -static Monitor *createmon(void); -static void destroynotify(XEvent *e); -static void detach(Client *c); -static void detachstack(Client *c); -static Monitor *dirtomon(int dir); -static void drawbar(Monitor *m); -static void drawbars(void); -static void enternotify(XEvent *e); -static void expose(XEvent *e); -static void focus(Client *c); -static void focusin(XEvent *e); -static void focusmon(const Arg *arg); -static void focusstack(const Arg *arg); -static Atom getatomprop(Client *c, Atom prop); -static int getrootptr(int *x, int *y); -static long getstate(Window w); -static int gettextprop(Window w, Atom atom, char *text, unsigned int size); -static void grabbuttons(Client *c, int focused); -static void grabkeys(void); -static void incnmaster(const Arg *arg); -static void keypress(XEvent *e); -static void killclient(const Arg *arg); -static void manage(Window w, XWindowAttributes *wa); -static void mappingnotify(XEvent *e); -static void maprequest(XEvent *e); -static void monocle(Monitor *m); -static void motionnotify(XEvent *e); -static void movemouse(const Arg *arg); -static Client *nexttiled(Client *c); -static void pop(Client *); -static void propertynotify(XEvent *e); -static void pushstack(const Arg *arg); -static void quit(const Arg *arg); -static Monitor *recttomon(int x, int y, int w, int h); -static void resize(Client *c, int x, int y, int w, int h, int interact); -static void resizeclient(Client *c, int x, int y, int w, int h); -static void resizemouse(const Arg *arg); -static void restack(Monitor *m); -static void run(void); -static void runAutostart(void); -static void scan(void); -static int sendevent(Client *c, Atom proto); -static void sendmon(Client *c, Monitor *m); -static void setclientstate(Client *c, long state); -static void setfocus(Client *c); -static void setfullscreen(Client *c, int fullscreen); -static void setlayout(const Arg *arg); -static void setmfact(const Arg *arg); -static void setup(void); -static void seturgent(Client *c, int urg); -static void showhide(Client *c); -static void sigchld(int unused); -#ifndef __OpenBSD__ -static int getdwmblockspid(); -static void sigdwmblocks(const Arg *arg); -#endif -static void sighup(int unused); -static void sigterm(int unused); -static void spawn(const Arg *arg); -static int stackpos(const Arg *arg); -static void tag(const Arg *arg); -static void tagmon(const Arg *arg); -static void togglebar(const Arg *arg); -static void togglefloating(const Arg *arg); -static void togglescratch(const Arg *arg); -static void togglesticky(const Arg *arg); -static void togglefullscr(const Arg *arg); -static void toggletag(const Arg *arg); -static void toggleview(const Arg *arg); -static void unfocus(Client *c, int setfocus); -static void unmanage(Client *c, int destroyed); -static void unmapnotify(XEvent *e); -static void updatebarpos(Monitor *m); -static void updatebars(void); -static void updateclientlist(void); -static int updategeom(void); -static void updatenumlockmask(void); -static void updatesizehints(Client *c); -static void updatestatus(void); -static void updatetitle(Client *c); -static void updatewindowtype(Client *c); -static void updatewmhints(Client *c); -static void view(const Arg *arg); -static Client *wintoclient(Window w); -static Monitor *wintomon(Window w); -static int xerror(Display *dpy, XErrorEvent *ee); -static int xerrordummy(Display *dpy, XErrorEvent *ee); -static int xerrorstart(Display *dpy, XErrorEvent *ee); -static void zoom(const Arg *arg); -static void load_xresources(void); -static void resource_load(XrmDatabase db, char *name, enum resource_type rtype, void *dst); - -static pid_t getparentprocess(pid_t p); -static int isdescprocess(pid_t p, pid_t c); -static Client *swallowingclient(Window w); -static Client *termforwin(const Client *c); -static pid_t winpid(Window w); - - -/* variables */ -static const char broken[] = "broken"; -static char stext[256]; -static char rawstext[256]; -static int dwmblockssig; -pid_t dwmblockspid = 0; -static int screen; -static int sw, sh; /* X display screen geometry width, height */ -static int bh, blw = 0; /* bar geometry */ -static int lrpad; /* sum of left and right padding for text */ -static int (*xerrorxlib)(Display *, XErrorEvent *); -static unsigned int numlockmask = 0; -static void (*handler[LASTEvent]) (XEvent *) = { - [ButtonPress] = buttonpress, - [ClientMessage] = clientmessage, - [ConfigureRequest] = configurerequest, - [ConfigureNotify] = configurenotify, - [DestroyNotify] = destroynotify, - [EnterNotify] = enternotify, - [Expose] = expose, - [FocusIn] = focusin, - [KeyPress] = keypress, - [MappingNotify] = mappingnotify, - [MapRequest] = maprequest, - [MotionNotify] = motionnotify, - [PropertyNotify] = propertynotify, - [UnmapNotify] = unmapnotify -}; -static Atom wmatom[WMLast], netatom[NetLast]; -static int restart = 0; -static int running = 1; -static Cur *cursor[CurLast]; -static Clr **scheme; -static Display *dpy; -static Drw *drw; -static Monitor *mons, *selmon; -static Window root, wmcheckwin; - -static xcb_connection_t *xcon; - -/* configuration, allows nested code to access above variables */ -#include "config.h" - -/* compile-time check if all tags fit into an unsigned int bit array. */ -struct NumTags { char limitexceeded[LENGTH(tags) > 31 ? -1 : 1]; }; - -/* function implementations */ -void -applyrules(Client *c) -{ - const char *class, *instance; - unsigned int i; - const Rule *r; - Monitor *m; - XClassHint ch = { NULL, NULL }; - - /* rule matching */ - c->isfloating = 0; - c->tags = 0; - XGetClassHint(dpy, c->win, &ch); - class = ch.res_class ? ch.res_class : broken; - instance = ch.res_name ? ch.res_name : broken; - - for (i = 0; i < LENGTH(rules); i++) { - r = &rules[i]; - if ((!r->title || strstr(c->name, r->title)) - && (!r->class || strstr(class, r->class)) - && (!r->instance || strstr(instance, r->instance))) - { - c->isterminal = r->isterminal; - c->isfloating = r->isfloating; - c->noswallow = r->noswallow; - c->tags |= r->tags; - if ((r->tags & SPTAGMASK) && r->isfloating) { - c->x = c->mon->wx + (c->mon->ww / 2 - WIDTH(c) / 2); - c->y = c->mon->wy + (c->mon->wh / 2 - HEIGHT(c) / 2); - } - - for (m = mons; m && m->num != r->monitor; m = m->next); - if (m) - c->mon = m; - } - } - if (ch.res_class) - XFree(ch.res_class); - if (ch.res_name) - XFree(ch.res_name); - c->tags = c->tags & TAGMASK ? c->tags & TAGMASK : (c->mon->tagset[c->mon->seltags] & ~SPTAGMASK); -} - -int -applysizehints(Client *c, int *x, int *y, int *w, int *h, int interact) -{ - int baseismin; - Monitor *m = c->mon; - - /* set minimum possible */ - *w = MAX(1, *w); - *h = MAX(1, *h); - if (interact) { - if (*x > sw) - *x = sw - WIDTH(c); - if (*y > sh) - *y = sh - HEIGHT(c); - if (*x + *w + 2 * c->bw < 0) - *x = 0; - if (*y + *h + 2 * c->bw < 0) - *y = 0; - } else { - if (*x >= m->wx + m->ww) - *x = m->wx + m->ww - WIDTH(c); - if (*y >= m->wy + m->wh) - *y = m->wy + m->wh - HEIGHT(c); - if (*x + *w + 2 * c->bw <= m->wx) - *x = m->wx; - if (*y + *h + 2 * c->bw <= m->wy) - *y = m->wy; - } - if (*h < bh) - *h = bh; - if (*w < bh) - *w = bh; - if (resizehints || c->isfloating || !c->mon->lt[c->mon->sellt]->arrange) { - /* see last two sentences in ICCCM 4.1.2.3 */ - baseismin = c->basew == c->minw && c->baseh == c->minh; - if (!baseismin) { /* temporarily remove base dimensions */ - *w -= c->basew; - *h -= c->baseh; - } - /* adjust for aspect limits */ - if (c->mina > 0 && c->maxa > 0) { - if (c->maxa < (float)*w / *h) - *w = *h * c->maxa + 0.5; - else if (c->mina < (float)*h / *w) - *h = *w * c->mina + 0.5; - } - if (baseismin) { /* increment calculation requires this */ - *w -= c->basew; - *h -= c->baseh; - } - /* adjust for increment value */ - if (c->incw) - *w -= *w % c->incw; - if (c->inch) - *h -= *h % c->inch; - /* restore base dimensions */ - *w = MAX(*w + c->basew, c->minw); - *h = MAX(*h + c->baseh, c->minh); - if (c->maxw) - *w = MIN(*w, c->maxw); - if (c->maxh) - *h = MIN(*h, c->maxh); - } - return *x != c->x || *y != c->y || *w != c->w || *h != c->h; -} - -void -arrange(Monitor *m) -{ - if (m) - showhide(m->stack); - else for (m = mons; m; m = m->next) - showhide(m->stack); - if (m) { - arrangemon(m); - restack(m); - } else for (m = mons; m; m = m->next) - arrangemon(m); -} - -void -arrangemon(Monitor *m) -{ - strncpy(m->ltsymbol, m->lt[m->sellt]->symbol, sizeof m->ltsymbol); - if (m->lt[m->sellt]->arrange) - m->lt[m->sellt]->arrange(m); -} - -void -attach(Client *c) -{ - c->next = c->mon->clients; - c->mon->clients = c; -} - -void -attachstack(Client *c) -{ - c->snext = c->mon->stack; - c->mon->stack = c; -} - -void -swallow(Client *p, Client *c) -{ - if (c->noswallow || c->isterminal) - return; - if (!swallowfloating && c->isfloating) - return; - - detach(c); - detachstack(c); - - setclientstate(c, WithdrawnState); - XUnmapWindow(dpy, p->win); - - p->swallowing = c; - c->mon = p->mon; - - Window w = p->win; - p->win = c->win; - c->win = w; - updatetitle(p); - - XWindowChanges wc; - wc.border_width = p->bw; - XConfigureWindow(dpy, p->win, CWBorderWidth, &wc); - XMoveResizeWindow(dpy, p->win, p->x, p->y, p->w, p->h); - XSetWindowBorder(dpy, p->win, scheme[SchemeNorm][ColBorder].pixel); - - arrange(p->mon); - configure(p); - updateclientlist(); -} - -void -unswallow(Client *c) -{ - c->win = c->swallowing->win; - - free(c->swallowing); - c->swallowing = NULL; - - /* unfullscreen the client */ - setfullscreen(c, 0); - updatetitle(c); - arrange(c->mon); - XMapWindow(dpy, c->win); - - XWindowChanges wc; - wc.border_width = c->bw; - XConfigureWindow(dpy, c->win, CWBorderWidth, &wc); - XMoveResizeWindow(dpy, c->win, c->x, c->y, c->w, c->h); - XSetWindowBorder(dpy, c->win, scheme[SchemeNorm][ColBorder].pixel); - - setclientstate(c, NormalState); - focus(NULL); - arrange(c->mon); -} - -void -buttonpress(XEvent *e) -{ - unsigned int i, x, click, occ = 0; - Arg arg = {0}; - Client *c; - Monitor *m; - XButtonPressedEvent *ev = &e->xbutton; - - click = ClkRootWin; - /* focus monitor if necessary */ - if ((m = wintomon(ev->window)) && m != selmon) { - unfocus(selmon->sel, 1); - selmon = m; - focus(NULL); - } - if (ev->window == selmon->barwin) { - i = x = 0; - for (c = m->clients; c; c = c->next) - occ |= c->tags == 255 ? 0 : c->tags; - do { - /* do not reserve space for vacant tags */ - if (!(occ & 1 << i || m->tagset[m->seltags] & 1 << i)) - continue; - x += TEXTW(tags[i]); - } while (ev->x >= x && ++i < LENGTH(tags)); - if (i < LENGTH(tags)) { - click = ClkTagBar; - arg.ui = 1 << i; - } else if (ev->x < x + blw) - click = ClkLtSymbol; - else if (ev->x > (x = selmon->ww - TEXTW(stext) + lrpad)) { - click = ClkStatusText; - - char *text = rawstext; - int i = -1; - char ch; - dwmblockssig = 0; - while (text[++i]) { - if ((unsigned char)text[i] < ' ') { - ch = text[i]; - text[i] = '\0'; - x += TEXTW(text) - lrpad; - text[i] = ch; - text += i+1; - i = -1; - if (x >= ev->x) break; - dwmblockssig = ch; - } - } - } else - click = ClkWinTitle; - } else if ((c = wintoclient(ev->window))) { - focus(c); - restack(selmon); - XAllowEvents(dpy, ReplayPointer, CurrentTime); - click = ClkClientWin; - } - for (i = 0; i < LENGTH(buttons); i++) - if (click == buttons[i].click && buttons[i].func && buttons[i].button == ev->button - && CLEANMASK(buttons[i].mask) == CLEANMASK(ev->state)) - buttons[i].func(click == ClkTagBar && buttons[i].arg.i == 0 ? &arg : &buttons[i].arg); -} - -void -checkotherwm(void) -{ - xerrorxlib = XSetErrorHandler(xerrorstart); - /* this causes an error if some other window manager is running */ - XSelectInput(dpy, DefaultRootWindow(dpy), SubstructureRedirectMask); - XSync(dpy, False); - XSetErrorHandler(xerror); - XSync(dpy, False); -} - -void -cleanup(void) -{ - Arg a = {.ui = ~0}; - Layout foo = { "", NULL }; - Monitor *m; - size_t i; - - view(&a); - selmon->lt[selmon->sellt] = &foo; - for (m = mons; m; m = m->next) - while (m->stack) - unmanage(m->stack, 0); - XUngrabKey(dpy, AnyKey, AnyModifier, root); - while (mons) - cleanupmon(mons); - for (i = 0; i < CurLast; i++) - drw_cur_free(drw, cursor[i]); - for (i = 0; i < LENGTH(colors); i++) - free(scheme[i]); - XDestroyWindow(dpy, wmcheckwin); - drw_free(drw); - XSync(dpy, False); - XSetInputFocus(dpy, PointerRoot, RevertToPointerRoot, CurrentTime); - XDeleteProperty(dpy, root, netatom[NetActiveWindow]); -} - -void -cleanupmon(Monitor *mon) -{ - Monitor *m; - - if (mon == mons) - mons = mons->next; - else { - for (m = mons; m && m->next != mon; m = m->next); - m->next = mon->next; - } - XUnmapWindow(dpy, mon->barwin); - XDestroyWindow(dpy, mon->barwin); - free(mon); -} - -void -clientmessage(XEvent *e) -{ - XClientMessageEvent *cme = &e->xclient; - Client *c = wintoclient(cme->window); - - if (!c) - return; - if (cme->message_type == netatom[NetWMState]) { - if (cme->data.l[1] == netatom[NetWMFullscreen] - || cme->data.l[2] == netatom[NetWMFullscreen]) - setfullscreen(c, (cme->data.l[0] == 1 /* _NET_WM_STATE_ADD */ - || (cme->data.l[0] == 2 /* _NET_WM_STATE_TOGGLE */ && !c->isfullscreen))); - } else if (cme->message_type == netatom[NetActiveWindow]) { - if (c != selmon->sel && !c->isurgent) - seturgent(c, 1); - } -} - -void -configure(Client *c) -{ - XConfigureEvent ce; - - ce.type = ConfigureNotify; - ce.display = dpy; - ce.event = c->win; - ce.window = c->win; - ce.x = c->x; - ce.y = c->y; - ce.width = c->w; - ce.height = c->h; - ce.border_width = c->bw; - ce.above = None; - ce.override_redirect = False; - XSendEvent(dpy, c->win, False, StructureNotifyMask, (XEvent *)&ce); -} - -void -configurenotify(XEvent *e) -{ - Monitor *m; - Client *c; - XConfigureEvent *ev = &e->xconfigure; - int dirty; - - /* TODO: updategeom handling sucks, needs to be simplified */ - if (ev->window == root) { - dirty = (sw != ev->width || sh != ev->height); - sw = ev->width; - sh = ev->height; - if (updategeom() || dirty) { - drw_resize(drw, sw, bh); - updatebars(); - for (m = mons; m; m = m->next) { - for (c = m->clients; c; c = c->next) - if (c->isfullscreen) - resizeclient(c, m->mx, m->my, m->mw, m->mh); - XMoveResizeWindow(dpy, m->barwin, m->wx, m->by, m->ww, bh); - } - focus(NULL); - arrange(NULL); - } - } -} - -void -configurerequest(XEvent *e) -{ - Client *c; - Monitor *m; - XConfigureRequestEvent *ev = &e->xconfigurerequest; - XWindowChanges wc; - - if ((c = wintoclient(ev->window))) { - if (ev->value_mask & CWBorderWidth) - c->bw = ev->border_width; - else if (c->isfloating || !selmon->lt[selmon->sellt]->arrange) { - m = c->mon; - if (ev->value_mask & CWX) { - c->oldx = c->x; - c->x = m->mx + ev->x; - } - if (ev->value_mask & CWY) { - c->oldy = c->y; - c->y = m->my + ev->y; - } - if (ev->value_mask & CWWidth) { - c->oldw = c->w; - c->w = ev->width; - } - if (ev->value_mask & CWHeight) { - c->oldh = c->h; - c->h = ev->height; - } - if ((c->x + c->w) > m->mx + m->mw && c->isfloating) - c->x = m->mx + (m->mw / 2 - WIDTH(c) / 2); /* center in x direction */ - if ((c->y + c->h) > m->my + m->mh && c->isfloating) - c->y = m->my + (m->mh / 2 - HEIGHT(c) / 2); /* center in y direction */ - if ((ev->value_mask & (CWX|CWY)) && !(ev->value_mask & (CWWidth|CWHeight))) - configure(c); - if (ISVISIBLE(c)) - XMoveResizeWindow(dpy, c->win, c->x, c->y, c->w, c->h); - } else - configure(c); - } else { - wc.x = ev->x; - wc.y = ev->y; - wc.width = ev->width; - wc.height = ev->height; - wc.border_width = ev->border_width; - wc.sibling = ev->above; - wc.stack_mode = ev->detail; - XConfigureWindow(dpy, ev->window, ev->value_mask, &wc); - } - XSync(dpy, False); -} - -void -copyvalidchars(char *text, char *rawtext) -{ - int i = -1, j = 0; - - while(rawtext[++i]) { - if ((unsigned char)rawtext[i] >= ' ') { - text[j++] = rawtext[i]; - } - } - text[j] = '\0'; -} - -Monitor * -createmon(void) -{ - Monitor *m; - - m = ecalloc(1, sizeof(Monitor)); - m->tagset[0] = m->tagset[1] = 1; - m->mfact = mfact; - m->nmaster = nmaster; - m->showbar = showbar; - m->topbar = topbar; - m->gappih = gappih; - m->gappiv = gappiv; - m->gappoh = gappoh; - m->gappov = gappov; - m->lt[0] = &layouts[0]; - m->lt[1] = &layouts[1 % LENGTH(layouts)]; - strncpy(m->ltsymbol, layouts[0].symbol, sizeof m->ltsymbol); - return m; -} - -void -destroynotify(XEvent *e) -{ - Client *c; - XDestroyWindowEvent *ev = &e->xdestroywindow; - - if ((c = wintoclient(ev->window))) - unmanage(c, 1); - - else if ((c = swallowingclient(ev->window))) - unmanage(c->swallowing, 1); -} - -void -detach(Client *c) -{ - Client **tc; - - for (tc = &c->mon->clients; *tc && *tc != c; tc = &(*tc)->next); - *tc = c->next; -} - -void -detachstack(Client *c) -{ - Client **tc, *t; - - for (tc = &c->mon->stack; *tc && *tc != c; tc = &(*tc)->snext); - *tc = c->snext; - - if (c == c->mon->sel) { - for (t = c->mon->stack; t && !ISVISIBLE(t); t = t->snext); - c->mon->sel = t; - } -} - -Monitor * -dirtomon(int dir) -{ - Monitor *m = NULL; - - if (dir > 0) { - if (!(m = selmon->next)) - m = mons; - } else if (selmon == mons) - for (m = mons; m->next; m = m->next); - else - for (m = mons; m->next != selmon; m = m->next); - return m; -} - -void -drawbar(Monitor *m) -{ - int x, w, tw = 0; - int boxs = drw->fonts->h / 9; - int boxw = drw->fonts->h / 6 + 2; - unsigned int i, occ = 0, urg = 0; - Client *c; - - /* draw status first so it can be overdrawn by tags later */ - if (m == selmon) { /* status is only drawn on selected monitor */ - drw_setscheme(drw, scheme[SchemeNorm]); - tw = TEXTW(stext) - lrpad + 2; /* 2px right padding */ - drw_text(drw, m->ww - tw, 0, tw, bh, 0, stext, 0); - } - - for (c = m->clients; c; c = c->next) { - occ |= c->tags == 255 ? 0 : c->tags; - if (c->isurgent) - urg |= c->tags; - } - x = 0; - for (i = 0; i < LENGTH(tags); i++) { - /* do not draw vacant tags */ - if (!(occ & 1 << i || m->tagset[m->seltags] & 1 << i)) - continue; - - w = TEXTW(tags[i]); - drw_setscheme(drw, scheme[m->tagset[m->seltags] & 1 << i ? SchemeSel : SchemeNorm]); - drw_text(drw, x, 0, w, bh, lrpad / 2, tags[i], urg & 1 << i); - x += w; - } - w = blw = TEXTW(m->ltsymbol); - drw_setscheme(drw, scheme[SchemeNorm]); - x = drw_text(drw, x, 0, w, bh, lrpad / 2, m->ltsymbol, 0); - - if ((w = m->ww - tw - x) > bh) { - if (m->sel) { - drw_setscheme(drw, scheme[m == selmon ? SchemeSel : SchemeNorm]); - drw_text(drw, x, 0, w, bh, lrpad / 2, m->sel->name, 0); - if (m->sel->isfloating) - drw_rect(drw, x + boxs, boxs, boxw, boxw, m->sel->isfixed, 0); - } else { - drw_setscheme(drw, scheme[SchemeNorm]); - drw_rect(drw, x, 0, w, bh, 1, 1); - } - } - drw_map(drw, m->barwin, 0, 0, m->ww, bh); -} - -void -drawbars(void) -{ - Monitor *m; - - for (m = mons; m; m = m->next) - drawbar(m); -} - -void -enternotify(XEvent *e) -{ - Client *c; - Monitor *m; - XCrossingEvent *ev = &e->xcrossing; - - if ((ev->mode != NotifyNormal || ev->detail == NotifyInferior) && ev->window != root) - return; - c = wintoclient(ev->window); - m = c ? c->mon : wintomon(ev->window); - if (m != selmon) { - unfocus(selmon->sel, 1); - selmon = m; - } else if (!c || c == selmon->sel) - return; - focus(c); -} - -void -expose(XEvent *e) -{ - Monitor *m; - XExposeEvent *ev = &e->xexpose; - - if (ev->count == 0 && (m = wintomon(ev->window))) - drawbar(m); -} - -void -focus(Client *c) -{ - if (!c || !ISVISIBLE(c)) { - for (c = selmon->stack; c && (!ISVISIBLE(c) || (c->issticky && !selmon->sel->issticky)); c = c->snext); - - if (!c) /* No windows found; check for available stickies */ - for (c = selmon->stack; c && !ISVISIBLE(c); c = c->snext); - } - - if (selmon->sel && selmon->sel != c) - unfocus(selmon->sel, 0); - if (c) { - if (c->mon != selmon) - selmon = c->mon; - if (c->isurgent) - seturgent(c, 0); - detachstack(c); - attachstack(c); - grabbuttons(c, 1); - XSetWindowBorder(dpy, c->win, scheme[SchemeSel][ColBorder].pixel); - setfocus(c); - } else { - XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime); - XDeleteProperty(dpy, root, netatom[NetActiveWindow]); - } - selmon->sel = c; - drawbars(); -} - -/* there are some broken focus acquiring clients needing extra handling */ -void -focusin(XEvent *e) -{ - XFocusChangeEvent *ev = &e->xfocus; - - if (selmon->sel && ev->window != selmon->sel->win) - setfocus(selmon->sel); -} - -void -focusmon(const Arg *arg) -{ - Monitor *m; - - if (!mons->next) - return; - if ((m = dirtomon(arg->i)) == selmon) - return; - unfocus(selmon->sel, 0); - selmon = m; - focus(NULL); -} - -void -focusstack(const Arg *arg) -{ - int i = stackpos(arg); - Client *c, *p; - - if (i < 0 || !selmon->sel || selmon->sel->isfullscreen) - return; - - for(p = NULL, c = selmon->clients; c && (i || !ISVISIBLE(c)); - i -= ISVISIBLE(c) ? 1 : 0, p = c, c = c->next); - focus(c ? c : p); - restack(selmon); -} - -Atom -getatomprop(Client *c, Atom prop) -{ - int di; - unsigned long dl; - unsigned char *p = NULL; - Atom da, atom = None; - - if (XGetWindowProperty(dpy, c->win, prop, 0L, sizeof atom, False, XA_ATOM, - &da, &di, &dl, &dl, &p) == Success && p) { - atom = *(Atom *)p; - XFree(p); - } - return atom; -} - -#ifndef __OpenBSD__ -int -getdwmblockspid() -{ - char buf[16]; - FILE *fp = popen("pidof -s dwmblocks", "r"); - fgets(buf, sizeof(buf), fp); - pid_t pid = strtoul(buf, NULL, 10); - pclose(fp); - dwmblockspid = pid; - return pid != 0 ? 0 : -1; -} -#endif - -int -getrootptr(int *x, int *y) -{ - int di; - unsigned int dui; - Window dummy; - - return XQueryPointer(dpy, root, &dummy, &dummy, x, y, &di, &di, &dui); -} - -long -getstate(Window w) -{ - int format; - long result = -1; - unsigned char *p = NULL; - unsigned long n, extra; - Atom real; - - if (XGetWindowProperty(dpy, w, wmatom[WMState], 0L, 2L, False, wmatom[WMState], - &real, &format, &n, &extra, (unsigned char **)&p) != Success) - return -1; - if (n != 0) - result = *p; - XFree(p); - return result; -} - -int -gettextprop(Window w, Atom atom, char *text, unsigned int size) -{ - char **list = NULL; - int n; - XTextProperty name; - - if (!text || size == 0) - return 0; - text[0] = '\0'; - if (!XGetTextProperty(dpy, w, &name, atom) || !name.nitems) - return 0; - if (name.encoding == XA_STRING) - strncpy(text, (char *)name.value, size - 1); - else { - if (XmbTextPropertyToTextList(dpy, &name, &list, &n) >= Success && n > 0 && *list) { - strncpy(text, *list, size - 1); - XFreeStringList(list); - } - } - text[size - 1] = '\0'; - XFree(name.value); - return 1; -} - -void -grabbuttons(Client *c, int focused) -{ - updatenumlockmask(); - { - unsigned int i, j; - unsigned int modifiers[] = { 0, LockMask, numlockmask, numlockmask|LockMask }; - XUngrabButton(dpy, AnyButton, AnyModifier, c->win); - if (!focused) - XGrabButton(dpy, AnyButton, AnyModifier, c->win, False, - BUTTONMASK, GrabModeSync, GrabModeSync, None, None); - for (i = 0; i < LENGTH(buttons); i++) - if (buttons[i].click == ClkClientWin) - for (j = 0; j < LENGTH(modifiers); j++) - XGrabButton(dpy, buttons[i].button, - buttons[i].mask | modifiers[j], - c->win, False, BUTTONMASK, - GrabModeAsync, GrabModeSync, None, None); - } -} - -void -grabkeys(void) -{ - updatenumlockmask(); - { - unsigned int i, j; - unsigned int modifiers[] = { 0, LockMask, numlockmask, numlockmask|LockMask }; - KeyCode code; - - XUngrabKey(dpy, AnyKey, AnyModifier, root); - for (i = 0; i < LENGTH(keys); i++) - if ((code = XKeysymToKeycode(dpy, keys[i].keysym))) - for (j = 0; j < LENGTH(modifiers); j++) - XGrabKey(dpy, code, keys[i].mod | modifiers[j], root, - True, GrabModeAsync, GrabModeAsync); - } -} - -void -incnmaster(const Arg *arg) -{ - selmon->nmaster = MAX(selmon->nmaster + arg->i, 0); - arrange(selmon); -} - -#ifdef XINERAMA -static int -isuniquegeom(XineramaScreenInfo *unique, size_t n, XineramaScreenInfo *info) -{ - while (n--) - if (unique[n].x_org == info->x_org && unique[n].y_org == info->y_org - && unique[n].width == info->width && unique[n].height == info->height) - return 0; - return 1; -} -#endif /* XINERAMA */ - -void -keypress(XEvent *e) -{ - unsigned int i; - KeySym keysym; - XKeyEvent *ev; - - ev = &e->xkey; - keysym = XKeycodeToKeysym(dpy, (KeyCode)ev->keycode, 0); - for (i = 0; i < LENGTH(keys); i++) - if (keysym == keys[i].keysym - && CLEANMASK(keys[i].mod) == CLEANMASK(ev->state) - && keys[i].func) - keys[i].func(&(keys[i].arg)); -} - -void -killclient(const Arg *arg) -{ - if (!selmon->sel) - return; - if (!sendevent(selmon->sel, wmatom[WMDelete])) { - XGrabServer(dpy); - XSetErrorHandler(xerrordummy); - XSetCloseDownMode(dpy, DestroyAll); - XKillClient(dpy, selmon->sel->win); - XSync(dpy, False); - XSetErrorHandler(xerror); - XUngrabServer(dpy); - } -} - -void -manage(Window w, XWindowAttributes *wa) -{ - Client *c, *t = NULL, *term = NULL; - Window trans = None; - XWindowChanges wc; - - c = ecalloc(1, sizeof(Client)); - c->win = w; - c->pid = winpid(w); - /* geometry */ - c->x = c->oldx = wa->x; - c->y = c->oldy = wa->y; - c->w = c->oldw = wa->width; - c->h = c->oldh = wa->height; - c->oldbw = wa->border_width; - - updatetitle(c); - if (XGetTransientForHint(dpy, w, &trans) && (t = wintoclient(trans))) { - c->mon = t->mon; - c->tags = t->tags; - } else { - c->mon = selmon; - applyrules(c); - term = termforwin(c); - } - - if (c->x + WIDTH(c) > c->mon->mx + c->mon->mw) - c->x = c->mon->mx + c->mon->mw - WIDTH(c); - if (c->y + HEIGHT(c) > c->mon->my + c->mon->mh) - c->y = c->mon->my + c->mon->mh - HEIGHT(c); - c->x = MAX(c->x, c->mon->mx); - /* only fix client y-offset, if the client center might cover the bar */ - c->y = MAX(c->y, ((c->mon->by == c->mon->my) && (c->x + (c->w / 2) >= c->mon->wx) - && (c->x + (c->w / 2) < c->mon->wx + c->mon->ww)) ? bh : c->mon->my); - c->bw = borderpx; - - wc.border_width = c->bw; - XConfigureWindow(dpy, w, CWBorderWidth, &wc); - XSetWindowBorder(dpy, w, scheme[SchemeNorm][ColBorder].pixel); - configure(c); /* propagates border_width, if size doesn't change */ - updatewindowtype(c); - updatesizehints(c); - updatewmhints(c); - c->x = c->mon->mx + (c->mon->mw - WIDTH(c)) / 2; - c->y = c->mon->my + (c->mon->mh - HEIGHT(c)) / 2; - XSelectInput(dpy, w, EnterWindowMask|FocusChangeMask|PropertyChangeMask|StructureNotifyMask); - grabbuttons(c, 0); - if (!c->isfloating) - c->isfloating = c->oldstate = trans != None || c->isfixed; - if (c->isfloating) - XRaiseWindow(dpy, c->win); - attach(c); - attachstack(c); - XChangeProperty(dpy, root, netatom[NetClientList], XA_WINDOW, 32, PropModeAppend, - (unsigned char *) &(c->win), 1); - XMoveResizeWindow(dpy, c->win, c->x + 2 * sw, c->y, c->w, c->h); /* some windows require this */ - setclientstate(c, NormalState); - if(selmon->sel && selmon->sel->isfullscreen && !c->isfloating) - setfullscreen(selmon->sel, 0); - if (c->mon == selmon) - unfocus(selmon->sel, 0); - c->mon->sel = c; - arrange(c->mon); - XMapWindow(dpy, c->win); - if (term) - swallow(term, c); - focus(NULL); -} - -void -mappingnotify(XEvent *e) -{ - XMappingEvent *ev = &e->xmapping; - - XRefreshKeyboardMapping(ev); - if (ev->request == MappingKeyboard) - grabkeys(); -} - -void -maprequest(XEvent *e) -{ - static XWindowAttributes wa; - XMapRequestEvent *ev = &e->xmaprequest; - - if (!XGetWindowAttributes(dpy, ev->window, &wa)) - return; - if (wa.override_redirect) - return; - if (!wintoclient(ev->window)) - manage(ev->window, &wa); -} - -void -monocle(Monitor *m) -{ - unsigned int n; - int oh, ov, ih, iv; - Client *c; - - getgaps(m, &oh, &ov, &ih, &iv, &n); - - if (n > 0) /* override layout symbol */ - snprintf(m->ltsymbol, sizeof m->ltsymbol, "[%d]", n); - for (c = nexttiled(m->clients); c; c = nexttiled(c->next)) - resize(c, m->wx + ov, m->wy + oh, m->ww - 2 * c->bw - 2 * ov, m->wh - 2 * c->bw - 2 * oh, 0); -} - -void -motionnotify(XEvent *e) -{ - static Monitor *mon = NULL; - Monitor *m; - XMotionEvent *ev = &e->xmotion; - - if (ev->window != root) - return; - if ((m = recttomon(ev->x_root, ev->y_root, 1, 1)) != mon && mon) { - unfocus(selmon->sel, 1); - selmon = m; - focus(NULL); - } - mon = m; -} - -void -movemouse(const Arg *arg) -{ - int x, y, ocx, ocy, nx, ny; - Client *c; - Monitor *m; - XEvent ev; - Time lasttime = 0; - - if (!(c = selmon->sel)) - return; - if (c->isfullscreen) /* no support moving fullscreen windows by mouse */ - return; - restack(selmon); - ocx = c->x; - ocy = c->y; - if (XGrabPointer(dpy, root, False, MOUSEMASK, GrabModeAsync, GrabModeAsync, - None, cursor[CurMove]->cursor, CurrentTime) != GrabSuccess) - return; - if (!getrootptr(&x, &y)) - return; - do { - XMaskEvent(dpy, MOUSEMASK|ExposureMask|SubstructureRedirectMask, &ev); - switch(ev.type) { - case ConfigureRequest: - case Expose: - case MapRequest: - handler[ev.type](&ev); - break; - case MotionNotify: - if ((ev.xmotion.time - lasttime) <= (1000 / 60)) - continue; - lasttime = ev.xmotion.time; - - nx = ocx + (ev.xmotion.x - x); - ny = ocy + (ev.xmotion.y - y); - if (abs(selmon->wx - nx) < snap) - nx = selmon->wx; - else if (abs((selmon->wx + selmon->ww) - (nx + WIDTH(c))) < snap) - nx = selmon->wx + selmon->ww - WIDTH(c); - if (abs(selmon->wy - ny) < snap) - ny = selmon->wy; - else if (abs((selmon->wy + selmon->wh) - (ny + HEIGHT(c))) < snap) - ny = selmon->wy + selmon->wh - HEIGHT(c); - if (!c->isfloating && selmon->lt[selmon->sellt]->arrange - && (abs(nx - c->x) > snap || abs(ny - c->y) > snap)) - togglefloating(NULL); - if (!selmon->lt[selmon->sellt]->arrange || c->isfloating) - resize(c, nx, ny, c->w, c->h, 1); - break; - } - } while (ev.type != ButtonRelease); - XUngrabPointer(dpy, CurrentTime); - if ((m = recttomon(c->x, c->y, c->w, c->h)) != selmon) { - sendmon(c, m); - selmon = m; - focus(NULL); - } -} - -Client * -nexttiled(Client *c) -{ - for (; c && (c->isfloating || !ISVISIBLE(c)); c = c->next); - return c; -} - -void -pop(Client *c) -{ - detach(c); - attach(c); - focus(c); - arrange(c->mon); -} - -void -pushstack(const Arg *arg) { - int i = stackpos(arg); - Client *sel = selmon->sel, *c, *p; - - if(i < 0 || !sel) - return; - else if(i == 0) { - detach(sel); - attach(sel); - } - else { - for(p = NULL, c = selmon->clients; c; p = c, c = c->next) - if(!(i -= (ISVISIBLE(c) && c != sel))) - break; - c = c ? c : p; - detach(sel); - sel->next = c->next; - c->next = sel; - } - arrange(selmon); -} - -void -propertynotify(XEvent *e) -{ - Client *c; - Window trans; - XPropertyEvent *ev = &e->xproperty; - - if ((ev->window == root) && (ev->atom == XA_WM_NAME)) { - updatestatus(); - } else if (ev->state == PropertyDelete) { - return; /* ignore */ - } else if ((c = wintoclient(ev->window))) { - switch(ev->atom) { - default: break; - case XA_WM_TRANSIENT_FOR: - if (!c->isfloating && (XGetTransientForHint(dpy, c->win, &trans)) && - (c->isfloating = (wintoclient(trans)) != NULL)) - arrange(c->mon); - break; - case XA_WM_NORMAL_HINTS: - updatesizehints(c); - break; - case XA_WM_HINTS: - updatewmhints(c); - drawbars(); - break; - } - if (ev->atom == XA_WM_NAME || ev->atom == netatom[NetWMName]) { - updatetitle(c); - if (c == c->mon->sel) - drawbar(c->mon); - } - if (ev->atom == netatom[NetWMWindowType]) - updatewindowtype(c); - } -} - -void -quit(const Arg *arg) -{ - if(arg->i) restart = 1; - running = 0; -} - -Monitor * -recttomon(int x, int y, int w, int h) -{ - Monitor *m, *r = selmon; - int a, area = 0; - - for (m = mons; m; m = m->next) - if ((a = INTERSECT(x, y, w, h, m)) > area) { - area = a; - r = m; - } - return r; -} - -void -resize(Client *c, int x, int y, int w, int h, int interact) -{ - if (applysizehints(c, &x, &y, &w, &h, interact)) - resizeclient(c, x, y, w, h); -} - -void -resizeclient(Client *c, int x, int y, int w, int h) -{ - XWindowChanges wc; - - c->oldx = c->x; c->x = wc.x = x; - c->oldy = c->y; c->y = wc.y = y; - c->oldw = c->w; c->w = wc.width = w; - c->oldh = c->h; c->h = wc.height = h; - wc.border_width = c->bw; - XConfigureWindow(dpy, c->win, CWX|CWY|CWWidth|CWHeight|CWBorderWidth, &wc); - configure(c); - XSync(dpy, False); -} - -void -resizemouse(const Arg *arg) -{ - int ocx, ocy, nw, nh; - Client *c; - Monitor *m; - XEvent ev; - Time lasttime = 0; - - if (!(c = selmon->sel)) - return; - if (c->isfullscreen) /* no support resizing fullscreen windows by mouse */ - return; - restack(selmon); - ocx = c->x; - ocy = c->y; - if (XGrabPointer(dpy, root, False, MOUSEMASK, GrabModeAsync, GrabModeAsync, - None, cursor[CurResize]->cursor, CurrentTime) != GrabSuccess) - return; - XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, c->w + c->bw - 1, c->h + c->bw - 1); - do { - XMaskEvent(dpy, MOUSEMASK|ExposureMask|SubstructureRedirectMask, &ev); - switch(ev.type) { - case ConfigureRequest: - case Expose: - case MapRequest: - handler[ev.type](&ev); - break; - case MotionNotify: - if ((ev.xmotion.time - lasttime) <= (1000 / 60)) - continue; - lasttime = ev.xmotion.time; - - nw = MAX(ev.xmotion.x - ocx - 2 * c->bw + 1, 1); - nh = MAX(ev.xmotion.y - ocy - 2 * c->bw + 1, 1); - if (c->mon->wx + nw >= selmon->wx && c->mon->wx + nw <= selmon->wx + selmon->ww - && c->mon->wy + nh >= selmon->wy && c->mon->wy + nh <= selmon->wy + selmon->wh) - { - if (!c->isfloating && selmon->lt[selmon->sellt]->arrange - && (abs(nw - c->w) > snap || abs(nh - c->h) > snap)) - togglefloating(NULL); - } - if (!selmon->lt[selmon->sellt]->arrange || c->isfloating) - resize(c, c->x, c->y, nw, nh, 1); - break; - } - } while (ev.type != ButtonRelease); - XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, c->w + c->bw - 1, c->h + c->bw - 1); - XUngrabPointer(dpy, CurrentTime); - while (XCheckMaskEvent(dpy, EnterWindowMask, &ev)); - if ((m = recttomon(c->x, c->y, c->w, c->h)) != selmon) { - sendmon(c, m); - selmon = m; - focus(NULL); - } -} - -void -restack(Monitor *m) -{ - Client *c; - XEvent ev; - XWindowChanges wc; - - drawbar(m); - if (!m->sel) - return; - if (m->sel->isfloating || !m->lt[m->sellt]->arrange) - XRaiseWindow(dpy, m->sel->win); - if (m->lt[m->sellt]->arrange) { - wc.stack_mode = Below; - wc.sibling = m->barwin; - for (c = m->stack; c; c = c->snext) - if (!c->isfloating && ISVISIBLE(c)) { - XConfigureWindow(dpy, c->win, CWSibling|CWStackMode, &wc); - wc.sibling = c->win; - } - } - XSync(dpy, False); - while (XCheckMaskEvent(dpy, EnterWindowMask, &ev)); -} - -void -run(void) -{ - XEvent ev; - /* main event loop */ - XSync(dpy, False); - while (running && !XNextEvent(dpy, &ev)) - if (handler[ev.type]) - handler[ev.type](&ev); /* call handler */ -} - -void -runAutostart(void) { - system("killall -q dwmblocks; dwmblocks &"); -} - -void -scan(void) -{ - unsigned int i, num; - Window d1, d2, *wins = NULL; - XWindowAttributes wa; - - if (XQueryTree(dpy, root, &d1, &d2, &wins, &num)) { - for (i = 0; i < num; i++) { - if (!XGetWindowAttributes(dpy, wins[i], &wa) - || wa.override_redirect || XGetTransientForHint(dpy, wins[i], &d1)) - continue; - if (wa.map_state == IsViewable || getstate(wins[i]) == IconicState) - manage(wins[i], &wa); - } - for (i = 0; i < num; i++) { /* now the transients */ - if (!XGetWindowAttributes(dpy, wins[i], &wa)) - continue; - if (XGetTransientForHint(dpy, wins[i], &d1) - && (wa.map_state == IsViewable || getstate(wins[i]) == IconicState)) - manage(wins[i], &wa); - } - if (wins) - XFree(wins); - } -} - -void -sendmon(Client *c, Monitor *m) -{ - if (c->mon == m) - return; - unfocus(c, 1); - detach(c); - detachstack(c); - c->mon = m; - c->tags = m->tagset[m->seltags]; /* assign tags of target monitor */ - attach(c); - attachstack(c); - focus(NULL); - arrange(NULL); -} - -void -setclientstate(Client *c, long state) -{ - long data[] = { state, None }; - - XChangeProperty(dpy, c->win, wmatom[WMState], wmatom[WMState], 32, - PropModeReplace, (unsigned char *)data, 2); -} - -int -sendevent(Client *c, Atom proto) -{ - int n; - Atom *protocols; - int exists = 0; - XEvent ev; - - if (XGetWMProtocols(dpy, c->win, &protocols, &n)) { - while (!exists && n--) - exists = protocols[n] == proto; - XFree(protocols); - } - if (exists) { - ev.type = ClientMessage; - ev.xclient.window = c->win; - ev.xclient.message_type = wmatom[WMProtocols]; - ev.xclient.format = 32; - ev.xclient.data.l[0] = proto; - ev.xclient.data.l[1] = CurrentTime; - XSendEvent(dpy, c->win, False, NoEventMask, &ev); - } - return exists; -} - -void -setfocus(Client *c) -{ - if (!c->neverfocus) { - XSetInputFocus(dpy, c->win, RevertToPointerRoot, CurrentTime); - XChangeProperty(dpy, root, netatom[NetActiveWindow], - XA_WINDOW, 32, PropModeReplace, - (unsigned char *) &(c->win), 1); - } - sendevent(c, wmatom[WMTakeFocus]); -} - -void -setfullscreen(Client *c, int fullscreen) -{ - if (fullscreen && !c->isfullscreen) { - XChangeProperty(dpy, c->win, netatom[NetWMState], XA_ATOM, 32, - PropModeReplace, (unsigned char*)&netatom[NetWMFullscreen], 1); - c->isfullscreen = 1; - c->oldstate = c->isfloating; - c->oldbw = c->bw; - c->bw = 0; - c->isfloating = 1; - resizeclient(c, c->mon->mx, c->mon->my, c->mon->mw, c->mon->mh); - XRaiseWindow(dpy, c->win); - } else if (!fullscreen && c->isfullscreen){ - XChangeProperty(dpy, c->win, netatom[NetWMState], XA_ATOM, 32, - PropModeReplace, (unsigned char*)0, 0); - c->isfullscreen = 0; - c->isfloating = c->oldstate; - c->bw = c->oldbw; - c->x = c->oldx; - c->y = c->oldy; - c->w = c->oldw; - c->h = c->oldh; - resizeclient(c, c->x, c->y, c->w, c->h); - arrange(c->mon); - } -} - -int -stackpos(const Arg *arg) { - int n, i; - Client *c, *l; - - if(!selmon->clients) - return -1; - - if(arg->i == PREVSEL) { - for(l = selmon->stack; l && (!ISVISIBLE(l) || l == selmon->sel); l = l->snext); - if(!l) - return -1; - for(i = 0, c = selmon->clients; c != l; i += ISVISIBLE(c) ? 1 : 0, c = c->next); - return i; - } - else if(ISINC(arg->i)) { - if(!selmon->sel) - return -1; - for(i = 0, c = selmon->clients; c != selmon->sel; i += ISVISIBLE(c) ? 1 : 0, c = c->next); - for(n = i; c; n += ISVISIBLE(c) ? 1 : 0, c = c->next); - return MOD(i + GETINC(arg->i), n); - } - else if(arg->i < 0) { - for(i = 0, c = selmon->clients; c; i += ISVISIBLE(c) ? 1 : 0, c = c->next); - return MAX(i + arg->i, 0); - } - else - return arg->i; -} - -void -setlayout(const Arg *arg) -{ - if (!arg || !arg->v || arg->v != selmon->lt[selmon->sellt]) - selmon->sellt ^= 1; - if (arg && arg->v) - selmon->lt[selmon->sellt] = (Layout *)arg->v; - strncpy(selmon->ltsymbol, selmon->lt[selmon->sellt]->symbol, sizeof selmon->ltsymbol); - if (selmon->sel) - arrange(selmon); - else - drawbar(selmon); -} - -/* arg > 1.0 will set mfact absolutely */ -void -setmfact(const Arg *arg) -{ - float f; - - if (!arg || !selmon->lt[selmon->sellt]->arrange) - return; - f = arg->f < 1.0 ? arg->f + selmon->mfact : arg->f - 1.0; - if (f < 0.05 || f > 0.95) - return; - selmon->mfact = f; - arrange(selmon); -} - -void -setup(void) -{ - int i; - XSetWindowAttributes wa; - Atom utf8string; - - /* clean up any zombies immediately */ - sigchld(0); - - signal(SIGHUP, sighup); - signal(SIGTERM, sigterm); - - /* init screen */ - screen = DefaultScreen(dpy); - sw = DisplayWidth(dpy, screen); - sh = DisplayHeight(dpy, screen); - root = RootWindow(dpy, screen); - drw = drw_create(dpy, screen, root, sw, sh); - if (!drw_fontset_create(drw, fonts, LENGTH(fonts))) - die("no fonts could be loaded."); - lrpad = drw->fonts->h; - bh = drw->fonts->h + 2; - updategeom(); - /* init atoms */ - utf8string = XInternAtom(dpy, "UTF8_STRING", False); - wmatom[WMProtocols] = XInternAtom(dpy, "WM_PROTOCOLS", False); - wmatom[WMDelete] = XInternAtom(dpy, "WM_DELETE_WINDOW", False); - wmatom[WMState] = XInternAtom(dpy, "WM_STATE", False); - wmatom[WMTakeFocus] = XInternAtom(dpy, "WM_TAKE_FOCUS", False); - netatom[NetActiveWindow] = XInternAtom(dpy, "_NET_ACTIVE_WINDOW", False); - netatom[NetSupported] = XInternAtom(dpy, "_NET_SUPPORTED", False); - netatom[NetWMName] = XInternAtom(dpy, "_NET_WM_NAME", False); - netatom[NetWMState] = XInternAtom(dpy, "_NET_WM_STATE", False); - netatom[NetWMCheck] = XInternAtom(dpy, "_NET_SUPPORTING_WM_CHECK", False); - netatom[NetWMFullscreen] = XInternAtom(dpy, "_NET_WM_STATE_FULLSCREEN", False); - netatom[NetWMWindowType] = XInternAtom(dpy, "_NET_WM_WINDOW_TYPE", False); - netatom[NetWMWindowTypeDialog] = XInternAtom(dpy, "_NET_WM_WINDOW_TYPE_DIALOG", False); - netatom[NetClientList] = XInternAtom(dpy, "_NET_CLIENT_LIST", False); - /* init cursors */ - cursor[CurNormal] = drw_cur_create(drw, XC_left_ptr); - cursor[CurResize] = drw_cur_create(drw, XC_sizing); - cursor[CurMove] = drw_cur_create(drw, XC_fleur); - /* init appearance */ - scheme = ecalloc(LENGTH(colors), sizeof(Clr *)); - for (i = 0; i < LENGTH(colors); i++) - scheme[i] = drw_scm_create(drw, colors[i], 3); - /* init bars */ - updatebars(); - updatestatus(); - /* supporting window for NetWMCheck */ - wmcheckwin = XCreateSimpleWindow(dpy, root, 0, 0, 1, 1, 0, 0, 0); - XChangeProperty(dpy, wmcheckwin, netatom[NetWMCheck], XA_WINDOW, 32, - PropModeReplace, (unsigned char *) &wmcheckwin, 1); - XChangeProperty(dpy, wmcheckwin, netatom[NetWMName], utf8string, 8, - PropModeReplace, (unsigned char *) "dwm", 3); - XChangeProperty(dpy, root, netatom[NetWMCheck], XA_WINDOW, 32, - PropModeReplace, (unsigned char *) &wmcheckwin, 1); - /* EWMH support per view */ - XChangeProperty(dpy, root, netatom[NetSupported], XA_ATOM, 32, - PropModeReplace, (unsigned char *) netatom, NetLast); - XDeleteProperty(dpy, root, netatom[NetClientList]); - /* select events */ - wa.cursor = cursor[CurNormal]->cursor; - wa.event_mask = SubstructureRedirectMask|SubstructureNotifyMask - |ButtonPressMask|PointerMotionMask|EnterWindowMask - |LeaveWindowMask|StructureNotifyMask|PropertyChangeMask; - XChangeWindowAttributes(dpy, root, CWEventMask|CWCursor, &wa); - XSelectInput(dpy, root, wa.event_mask); - grabkeys(); - focus(NULL); -} - - -void -seturgent(Client *c, int urg) -{ - XWMHints *wmh; - - c->isurgent = urg; - if (!(wmh = XGetWMHints(dpy, c->win))) - return; - wmh->flags = urg ? (wmh->flags | XUrgencyHint) : (wmh->flags & ~XUrgencyHint); - XSetWMHints(dpy, c->win, wmh); - XFree(wmh); -} - -void -showhide(Client *c) -{ - if (!c) - return; - if (ISVISIBLE(c)) { - if ((c->tags & SPTAGMASK) && c->isfloating) { - c->x = c->mon->wx + (c->mon->ww / 2 - WIDTH(c) / 2); - c->y = c->mon->wy + (c->mon->wh / 2 - HEIGHT(c) / 2); - } - /* show clients top down */ - XMoveWindow(dpy, c->win, c->x, c->y); - if ((!c->mon->lt[c->mon->sellt]->arrange || c->isfloating) && !c->isfullscreen) - resize(c, c->x, c->y, c->w, c->h, 0); - showhide(c->snext); - } else { - /* hide clients bottom up */ - showhide(c->snext); - XMoveWindow(dpy, c->win, WIDTH(c) * -2, c->y); - } -} - -void -sigchld(int unused) -{ - if (signal(SIGCHLD, sigchld) == SIG_ERR) - die("can't install SIGCHLD handler:"); - while (0 < waitpid(-1, NULL, WNOHANG)); -} - -void -sighup(int unused) -{ - Arg a = {.i = 1}; - quit(&a); -} - -void -sigterm(int unused) -{ - Arg a = {.i = 0}; - quit(&a); -} - -#ifndef __OpenBSD__ -void -sigdwmblocks(const Arg *arg) -{ - union sigval sv; - sv.sival_int = 0 | (dwmblockssig << 8) | arg->i; - if (!dwmblockspid) - if (getdwmblockspid() == -1) - return; - - if (sigqueue(dwmblockspid, SIGUSR1, sv) == -1) { - if (errno == ESRCH) { - if (!getdwmblockspid()) - sigqueue(dwmblockspid, SIGUSR1, sv); - } - } -} -#endif - -void -spawn(const Arg *arg) -{ - if (fork() == 0) { - if (dpy) - close(ConnectionNumber(dpy)); - setsid(); - execvp(((char **)arg->v)[0], (char **)arg->v); - fprintf(stderr, "dwm: execvp %s", ((char **)arg->v)[0]); - perror(" failed"); - exit(EXIT_SUCCESS); - } -} - -void -tag(const Arg *arg) -{ - if (selmon->sel && arg->ui & TAGMASK) { - selmon->sel->tags = arg->ui & TAGMASK; - focus(NULL); - arrange(selmon); - } -} - -void -tagmon(const Arg *arg) -{ - if (!selmon->sel || !mons->next) - return; - sendmon(selmon->sel, dirtomon(arg->i)); -} - -void -togglebar(const Arg *arg) -{ - selmon->showbar = !selmon->showbar; - updatebarpos(selmon); - XMoveResizeWindow(dpy, selmon->barwin, selmon->wx, selmon->by, selmon->ww, bh); - arrange(selmon); -} - -void -togglefloating(const Arg *arg) -{ - if (!selmon->sel) - return; - if (selmon->sel->isfullscreen) /* no support for fullscreen windows */ - return; - selmon->sel->isfloating = !selmon->sel->isfloating || selmon->sel->isfixed; - if (selmon->sel->isfloating) - resize(selmon->sel, selmon->sel->x, selmon->sel->y, - selmon->sel->w, selmon->sel->h, 0); - arrange(selmon); -} - -void -togglefullscr(const Arg *arg) -{ - if(selmon->sel) - setfullscreen(selmon->sel, !selmon->sel->isfullscreen); -} - -void -togglesticky(const Arg *arg) -{ - if (!selmon->sel) - return; - selmon->sel->issticky = !selmon->sel->issticky; - arrange(selmon); -} - -void -togglescratch(const Arg *arg) -{ - Client *c; - unsigned int found = 0; - unsigned int scratchtag = SPTAG(arg->ui); - Arg sparg = {.v = scratchpads[arg->ui].cmd}; - - for (c = selmon->clients; c && !(found = c->tags & scratchtag); c = c->next); - if (found) { - unsigned int newtagset = selmon->tagset[selmon->seltags] ^ scratchtag; - if (newtagset) { - selmon->tagset[selmon->seltags] = newtagset; - focus(NULL); - arrange(selmon); - } - if (ISVISIBLE(c)) { - focus(c); - restack(selmon); - } - } else { - selmon->tagset[selmon->seltags] |= scratchtag; - spawn(&sparg); - } -} - -void -toggletag(const Arg *arg) -{ - unsigned int newtags; - - if (!selmon->sel) - return; - newtags = selmon->sel->tags ^ (arg->ui & TAGMASK); - if (newtags) { - selmon->sel->tags = newtags; - focus(NULL); - arrange(selmon); - } -} - -void -toggleview(const Arg *arg) -{ - unsigned int newtagset = selmon->tagset[selmon->seltags] ^ (arg->ui & TAGMASK); - - if (newtagset) { - selmon->tagset[selmon->seltags] = newtagset; - focus(NULL); - arrange(selmon); - } -} - -void -unfocus(Client *c, int setfocus) -{ - if (!c) - return; - grabbuttons(c, 0); - XSetWindowBorder(dpy, c->win, scheme[SchemeNorm][ColBorder].pixel); - if (setfocus) { - XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime); - XDeleteProperty(dpy, root, netatom[NetActiveWindow]); - } -} - -void -unmanage(Client *c, int destroyed) -{ - Monitor *m = c->mon; - XWindowChanges wc; - - if (c->swallowing) { - unswallow(c); - return; - } - - Client *s = swallowingclient(c->win); - if (s) { - free(s->swallowing); - s->swallowing = NULL; - arrange(m); - focus(NULL); - return; - } - - detach(c); - detachstack(c); - if (!destroyed) { - wc.border_width = c->oldbw; - XGrabServer(dpy); /* avoid race conditions */ - XSetErrorHandler(xerrordummy); - XConfigureWindow(dpy, c->win, CWBorderWidth, &wc); /* restore border */ - XUngrabButton(dpy, AnyButton, AnyModifier, c->win); - setclientstate(c, WithdrawnState); - XSync(dpy, False); - XSetErrorHandler(xerror); - XUngrabServer(dpy); - } - free(c); - - if (!s) { - arrange(m); - focus(NULL); - updateclientlist(); - } -} - -void -unmapnotify(XEvent *e) -{ - Client *c; - XUnmapEvent *ev = &e->xunmap; - - if ((c = wintoclient(ev->window))) { - if (ev->send_event) - setclientstate(c, WithdrawnState); - else - unmanage(c, 0); - } -} - -void -updatebars(void) -{ - Monitor *m; - XSetWindowAttributes wa = { - .override_redirect = True, - .background_pixmap = ParentRelative, - .event_mask = ButtonPressMask|ExposureMask - }; - XClassHint ch = {"dwm", "dwm"}; - for (m = mons; m; m = m->next) { - if (m->barwin) - continue; - m->barwin = XCreateWindow(dpy, root, m->wx, m->by, m->ww, bh, 0, DefaultDepth(dpy, screen), - CopyFromParent, DefaultVisual(dpy, screen), - CWOverrideRedirect|CWBackPixmap|CWEventMask, &wa); - XDefineCursor(dpy, m->barwin, cursor[CurNormal]->cursor); - XMapRaised(dpy, m->barwin); - XSetClassHint(dpy, m->barwin, &ch); - } -} - -void -updatebarpos(Monitor *m) -{ - m->wy = m->my; - m->wh = m->mh; - if (m->showbar) { - m->wh -= bh; - m->by = m->topbar ? m->wy : m->wy + m->wh; - m->wy = m->topbar ? m->wy + bh : m->wy; - } else - m->by = -bh; -} - -void -updateclientlist() -{ - Client *c; - Monitor *m; - - XDeleteProperty(dpy, root, netatom[NetClientList]); - for (m = mons; m; m = m->next) - for (c = m->clients; c; c = c->next) - XChangeProperty(dpy, root, netatom[NetClientList], - XA_WINDOW, 32, PropModeAppend, - (unsigned char *) &(c->win), 1); -} - -int -updategeom(void) -{ - int dirty = 0; - -#ifdef XINERAMA - if (XineramaIsActive(dpy)) { - int i, j, n, nn; - Client *c; - Monitor *m; - XineramaScreenInfo *info = XineramaQueryScreens(dpy, &nn); - XineramaScreenInfo *unique = NULL; - - for (n = 0, m = mons; m; m = m->next, n++); - /* only consider unique geometries as separate screens */ - unique = ecalloc(nn, sizeof(XineramaScreenInfo)); - for (i = 0, j = 0; i < nn; i++) - if (isuniquegeom(unique, j, &info[i])) - memcpy(&unique[j++], &info[i], sizeof(XineramaScreenInfo)); - XFree(info); - nn = j; - if (n <= nn) { /* new monitors available */ - for (i = 0; i < (nn - n); i++) { - for (m = mons; m && m->next; m = m->next); - if (m) - m->next = createmon(); - else - mons = createmon(); - } - for (i = 0, m = mons; i < nn && m; m = m->next, i++) - if (i >= n - || unique[i].x_org != m->mx || unique[i].y_org != m->my - || unique[i].width != m->mw || unique[i].height != m->mh) - { - dirty = 1; - m->num = i; - m->mx = m->wx = unique[i].x_org; - m->my = m->wy = unique[i].y_org; - m->mw = m->ww = unique[i].width; - m->mh = m->wh = unique[i].height; - updatebarpos(m); - } - } else { /* less monitors available nn < n */ - for (i = nn; i < n; i++) { - for (m = mons; m && m->next; m = m->next); - while ((c = m->clients)) { - dirty = 1; - m->clients = c->next; - detachstack(c); - c->mon = mons; - attach(c); - attachstack(c); - } - if (m == selmon) - selmon = mons; - cleanupmon(m); - } - } - free(unique); - } else -#endif /* XINERAMA */ - { /* default monitor setup */ - if (!mons) - mons = createmon(); - if (mons->mw != sw || mons->mh != sh) { - dirty = 1; - mons->mw = mons->ww = sw; - mons->mh = mons->wh = sh; - updatebarpos(mons); - } - } - if (dirty) { - selmon = mons; - selmon = wintomon(root); - } - return dirty; -} - -void -updatenumlockmask(void) -{ - unsigned int i, j; - XModifierKeymap *modmap; - - numlockmask = 0; - modmap = XGetModifierMapping(dpy); - for (i = 0; i < 8; i++) - for (j = 0; j < modmap->max_keypermod; j++) - if (modmap->modifiermap[i * modmap->max_keypermod + j] - == XKeysymToKeycode(dpy, XK_Num_Lock)) - numlockmask = (1 << i); - XFreeModifiermap(modmap); -} - -void -updatesizehints(Client *c) -{ - long msize; - XSizeHints size; - - if (!XGetWMNormalHints(dpy, c->win, &size, &msize)) - /* size is uninitialized, ensure that size.flags aren't used */ - size.flags = PSize; - if (size.flags & PBaseSize) { - c->basew = size.base_width; - c->baseh = size.base_height; - } else if (size.flags & PMinSize) { - c->basew = size.min_width; - c->baseh = size.min_height; - } else - c->basew = c->baseh = 0; - if (size.flags & PResizeInc) { - c->incw = size.width_inc; - c->inch = size.height_inc; - } else - c->incw = c->inch = 0; - if (size.flags & PMaxSize) { - c->maxw = size.max_width; - c->maxh = size.max_height; - } else - c->maxw = c->maxh = 0; - if (size.flags & PMinSize) { - c->minw = size.min_width; - c->minh = size.min_height; - } else if (size.flags & PBaseSize) { - c->minw = size.base_width; - c->minh = size.base_height; - } else - c->minw = c->minh = 0; - if (size.flags & PAspect) { - c->mina = (float)size.min_aspect.y / size.min_aspect.x; - c->maxa = (float)size.max_aspect.x / size.max_aspect.y; - } else - c->maxa = c->mina = 0.0; - c->isfixed = (c->maxw && c->maxh && c->maxw == c->minw && c->maxh == c->minh); -} - -void -updatestatus(void) -{ - if (!gettextprop(root, XA_WM_NAME, rawstext, sizeof(rawstext))) - strcpy(stext, "dwm-"VERSION); - else - copyvalidchars(stext, rawstext); - drawbar(selmon); -} - -void -updatetitle(Client *c) -{ - if (!gettextprop(c->win, netatom[NetWMName], c->name, sizeof c->name)) - gettextprop(c->win, XA_WM_NAME, c->name, sizeof c->name); - if (c->name[0] == '\0') /* hack to mark broken clients */ - strcpy(c->name, broken); -} - -void -updatewindowtype(Client *c) -{ - Atom state = getatomprop(c, netatom[NetWMState]); - Atom wtype = getatomprop(c, netatom[NetWMWindowType]); - - if (state == netatom[NetWMFullscreen]) - setfullscreen(c, 1); - if (wtype == netatom[NetWMWindowTypeDialog]) - c->isfloating = 1; -} - -void -updatewmhints(Client *c) -{ - XWMHints *wmh; - - if ((wmh = XGetWMHints(dpy, c->win))) { - if (c == selmon->sel && wmh->flags & XUrgencyHint) { - wmh->flags &= ~XUrgencyHint; - XSetWMHints(dpy, c->win, wmh); - } else - c->isurgent = (wmh->flags & XUrgencyHint) ? 1 : 0; - if (wmh->flags & InputHint) - c->neverfocus = !wmh->input; - else - c->neverfocus = 0; - XFree(wmh); - } -} - -void -view(const Arg *arg) -{ - if ((arg->ui & TAGMASK) == selmon->tagset[selmon->seltags]) - return; - selmon->seltags ^= 1; /* toggle sel tagset */ - if (arg->ui & TAGMASK) - selmon->tagset[selmon->seltags] = arg->ui & TAGMASK; - focus(NULL); - arrange(selmon); -} - -pid_t -winpid(Window w) -{ - pid_t result = 0; - - xcb_res_client_id_spec_t spec = {0}; - spec.client = w; - spec.mask = XCB_RES_CLIENT_ID_MASK_LOCAL_CLIENT_PID; - - xcb_generic_error_t *e = NULL; - xcb_res_query_client_ids_cookie_t c = xcb_res_query_client_ids(xcon, 1, &spec); - xcb_res_query_client_ids_reply_t *r = xcb_res_query_client_ids_reply(xcon, c, &e); - - if (!r) - return (pid_t)0; - - xcb_res_client_id_value_iterator_t i = xcb_res_query_client_ids_ids_iterator(r); - for (; i.rem; xcb_res_client_id_value_next(&i)) { - spec = i.data->spec; - if (spec.mask & XCB_RES_CLIENT_ID_MASK_LOCAL_CLIENT_PID) { - uint32_t *t = xcb_res_client_id_value_value(i.data); - result = *t; - break; - } - } - - free(r); - - if (result == (pid_t)-1) - result = 0; - return result; -} - -pid_t -getparentprocess(pid_t p) -{ - unsigned int v = 0; - -#if defined(__linux__) - FILE *f; - char buf[256]; - snprintf(buf, sizeof(buf) - 1, "/proc/%u/stat", (unsigned)p); - - if (!(f = fopen(buf, "r"))) - return (pid_t)0; - - if (fscanf(f, "%*u %*s %*c %u", (unsigned *)&v) != 1) - v = (pid_t)0; - fclose(f); -#elif defined(__FreeBSD__) - struct kinfo_proc *proc = kinfo_getproc(p); - if (!proc) - return (pid_t)0; - - v = proc->ki_ppid; - free(proc); -#endif - return (pid_t)v; -} - -int -isdescprocess(pid_t p, pid_t c) -{ - while (p != c && c != 0) - c = getparentprocess(c); - - return (int)c; -} - -Client * -termforwin(const Client *w) -{ - Client *c; - Monitor *m; - - if (!w->pid || w->isterminal) - return NULL; - - for (m = mons; m; m = m->next) { - for (c = m->clients; c; c = c->next) { - if (c->isterminal && !c->swallowing && c->pid && isdescprocess(c->pid, w->pid)) - return c; - } - } - - return NULL; -} - -Client * -swallowingclient(Window w) -{ - Client *c; - Monitor *m; - - for (m = mons; m; m = m->next) { - for (c = m->clients; c; c = c->next) { - if (c->swallowing && c->swallowing->win == w) - return c; - } - } - - return NULL; -} - -Client * -wintoclient(Window w) -{ - Client *c; - Monitor *m; - - for (m = mons; m; m = m->next) - for (c = m->clients; c; c = c->next) - if (c->win == w) - return c; - return NULL; -} - -Monitor * -wintomon(Window w) -{ - int x, y; - Client *c; - Monitor *m; - - if (w == root && getrootptr(&x, &y)) - return recttomon(x, y, 1, 1); - for (m = mons; m; m = m->next) - if (w == m->barwin) - return m; - if ((c = wintoclient(w))) - return c->mon; - return selmon; -} - -/* There's no way to check accesses to destroyed windows, thus those cases are - * ignored (especially on UnmapNotify's). Other types of errors call Xlibs - * default error handler, which may call exit. */ -int -xerror(Display *dpy, XErrorEvent *ee) -{ - if (ee->error_code == BadWindow - || (ee->request_code == X_SetInputFocus && ee->error_code == BadMatch) - || (ee->request_code == X_PolyText8 && ee->error_code == BadDrawable) - || (ee->request_code == X_PolyFillRectangle && ee->error_code == BadDrawable) - || (ee->request_code == X_PolySegment && ee->error_code == BadDrawable) - || (ee->request_code == X_ConfigureWindow && ee->error_code == BadMatch) - || (ee->request_code == X_GrabButton && ee->error_code == BadAccess) - || (ee->request_code == X_GrabKey && ee->error_code == BadAccess) - || (ee->request_code == X_CopyArea && ee->error_code == BadDrawable)) - return 0; - fprintf(stderr, "dwm: fatal error: request code=%d, error code=%d\n", - ee->request_code, ee->error_code); - return xerrorxlib(dpy, ee); /* may call exit */ -} - -int -xerrordummy(Display *dpy, XErrorEvent *ee) -{ - return 0; -} - -/* Startup Error handler to check if another window manager - * is already running. */ -int -xerrorstart(Display *dpy, XErrorEvent *ee) -{ - die("dwm: another window manager is already running"); - return -1; -} - -void -zoom(const Arg *arg) -{ - Client *c = selmon->sel; - - if (!selmon->lt[selmon->sellt]->arrange - || (selmon->sel && selmon->sel->isfloating)) - return; - if (c == nexttiled(selmon->clients)) - if (!c || !(c = nexttiled(c->next))) - return; - pop(c); -} - -void -resource_load(XrmDatabase db, char *name, enum resource_type rtype, void *dst) -{ - char *sdst = NULL; - int *idst = NULL; - float *fdst = NULL; - - sdst = dst; - idst = dst; - fdst = dst; - - char fullname[256]; - char *type; - XrmValue ret; - - snprintf(fullname, sizeof(fullname), "%s.%s", "dwm", name); - fullname[sizeof(fullname) - 1] = '\0'; - - XrmGetResource(db, fullname, "*", &type, &ret); - if (!(ret.addr == NULL || strncmp("String", type, 64))) - { - switch (rtype) { - case STRING: - strcpy(sdst, ret.addr); - break; - case INTEGER: - *idst = strtoul(ret.addr, NULL, 10); - break; - case FLOAT: - *fdst = strtof(ret.addr, NULL); - break; - } - } -} - -void -load_xresources(void) -{ - Display *display; - char *resm; - XrmDatabase db; - ResourcePref *p; - - display = XOpenDisplay(NULL); - resm = XResourceManagerString(display); - if (!resm) - return; - - db = XrmGetStringDatabase(resm); - for (p = resources; p < resources + LENGTH(resources); p++) - resource_load(db, p->name, p->type, p->dst); - XCloseDisplay(display); -} - -int -main(int argc, char *argv[]) -{ - if (argc == 2 && !strcmp("-v", argv[1])) - die("dwm-"VERSION); - else if (argc != 1) - die("usage: dwm [-v]"); - if (!setlocale(LC_CTYPE, "") || !XSupportsLocale()) - fputs("warning: no locale support\n", stderr); - if (!(dpy = XOpenDisplay(NULL))) - die("dwm: cannot open display"); - if (!(xcon = XGetXCBConnection(dpy))) - die("dwm: cannot get xcb connection\n"); - checkotherwm(); - XrmInitialize(); - load_xresources(); - setup(); -#ifdef __OpenBSD__ - if (pledge("stdio rpath proc exec", NULL) == -1) - die("pledge"); -#endif /* __OpenBSD__ */ - scan(); - runAutostart(); - run(); - if(restart) execvp(argv[0], argv); - cleanup(); - XCloseDisplay(dpy); - return EXIT_SUCCESS; -} diff --git a/.local/src/dwm/dwm.o b/.local/src/dwm/dwm.o deleted file mode 100644 index 956d5862..00000000 Binary files a/.local/src/dwm/dwm.o and /dev/null differ diff --git a/.local/src/dwm/larbs.mom b/.local/src/dwm/larbs.mom deleted file mode 100644 index a1fa49ec..00000000 --- a/.local/src/dwm/larbs.mom +++ /dev/null @@ -1,358 +0,0 @@ -.de LI -.LIST -.SHIFT_LIST 10p -.. -.PARA_SPACE 1m -.TITLE "\s+(10A Friendly Guide to LARBS!\s0" -.AUTHOR "\s+5Luke Smith\s0" -.DOCTYPE DEFAULT -.COPYSTYLE FINAL -.PRINTSTYLE TYPESET -.PT_SIZE 12 -.START -Use vim keys (\f(CWh/j/k/l\fP) to navigate this document. -Pressing \f(CWs\fP will fit it to window width (\f(CWa\fP to revert). -\f(CWK\fP and \f(CWJ\fP zoom in and out. -\f(CWSuper+f\fP to toggle fullscreen. -\f(CWq\fP to quit. -(These are general binds set for \fBzathura\fP, the pdf reader.) -.LI -.ITEM -\f(CWMod+F1\fP will show this document at any time. -.ITEM -By \f(CWMod\fP, I mean the Super Key, usually known as "the Windows Key." -.LIST OFF -.PP -FAQs are at the end of this document. -.HEADING 1 "Welcome!" -.HEADING 2 "Basic goals and principles of this system:" -.LI -.ITEM -\fBNaturalness\fP \(en -Remove the border between mind and matter: -everything important should be as few keypresses as possible away from you, -and you shouldn't have to think about what you're doing. -Immersion. -.ITEM -\fBEconomy\fP \(en -Programs should be simple and light on system resources and highly extensible. -Because of this, many are terminal or small ncurses programs that have all the magic inside of them. -.ITEM -\fBKeyboard/vim-centrality\fP \(en -All terminal programs (and other programs) use vim keys when possible. -Your hands never need leave the home row or thereabout. -.ITEM -\fBDecentralization\fP \(en -This system is a web of small, modifiable and replaceable programs that users can easily customize. -.LIST OFF -.HEADING 2 "General keyboard changes" -.LI -.ITEM -Capslock is a useless key in high quality space. -It's now remapped. -If you press it alone, it will function as escape, making vimcraft much more natural, -but you can also hold it down and it will act as another Windows/super/mod key. -.ITEM -The menu button (usually between the right Alt and Ctrl) is an alternative Super/Mod button. -This is to make one-handing on laptops easier. -.LIST OFF -.PP -If you'd like to change any of these keyboard changes, you need only open and change the \f(CWremaps\fP script. -All custom scripts in LARBS are located in \f(CW~/.local/bin/\fP. -Actually, this should go without saying, but \fIeverything\fP here can easily be changed. -Below in this document, there is information about where to change programs/components. -.PP -Additionally, while this isn't a part of the desktop environment, the default editing mode in the shell is using vi bindings. -If you want to learn more of this, run \f(CWMod+F2\fP and type and select the option for "vi mode in shell". -This setting can be changed if you don't like it by deleting or commenting out the contents of \f(CW~/.config/shell/inputrc\fP. -.HEADING 2 "The Status Bar" -.PP -To the left, you'll see the numbers of your current workspace/tag(s). -On the right, you'll see various system status notifiers, the date, volume, even music and local weather if possible, etc. -Each module on the right of the statusbar is a script located in \f(CW~/.local/bin/statusbar/\fP. -You can see what they do and modify them from there. -I'm sure you can figure it out. -You can also right click on the module to see what it does. -.PP -The program dwmblocks is what is run to generate the statusbar from those scripts. -You can edit its config/source code in \f(CW~/.local/src/dwmblocks/\fP to tell it what scripts/commands you want it to display. -.HEADING 2 "Deeper Tutorials" -.PP -Press \f(CWmod+F2\fP at any time to get a menu of programs to watch videos about streaming directly from YouTube. -You can also check the config files for programs which detail a lot of the specific bindings. -.HEADING 1 "Key Bindings" -.PP -The window manager dwm abstractly orders all of your windows into a stack from most important to least based on when you last manipulated it. -dwm is an easy to use window manager, but you should understand that it makes use of that stack layout. -If you're not familiar, I recommend you press \f(CWMod+F2\fP and select the "dwm" option to watch my brief tutorial (note that the bindings I discuss in the video are the default dwm binds, which are different (inferior) to those here). -.PP -Notice also the case sensitivity of the shortcuts\c -.FOOTNOTE -To type capital letters, hold down the \f(CWShift\fP key\(emthat might sound like an obvious and condescending thing to tell you, but there have literally been multiple people (Boomers) who have emailed me asking how to type a capital letter since caps lock isn't enabled. -.FOOTNOTE OFF - , Be sure you play around with these. Be flexible with the basic commands and the system will grow on you quick. -.LI -.ITEM -\f(CWMod+Enter\fP \(en Spawn terminal (the default terminal is \f(CWst\fP; run \f(CWman st\fP for more.) -.ITEM -\f(CWMod+q\fP \(en Close window -.ITEM -\f(CWMod+d\fP \(en dmenu (For running commands or programs without shortcuts) -.ITEM -\f(CWMod+j/k\fP \(en Cycle thru windows by their stack order -.ITEM -\f(CWMod+Space\fP \(en Make selected window the master (or switch master with 2nd) -.ITEM -\f(CWMod+h/l\fP \(en Change width of master window -.ITEM -\f(CWMod+z/x\fP \(en Increase/decrease gaps (may also hold \f(CWMod\fP and scroll mouse) -.ITEM -\f(CWMod+a\fP \(en Toggle gaps -.ITEM -\f(CWMod+A\fP \(en Gaps return to default values (may also hold \f(CWMod\fP and middle click) -.ITEM -\f(CWMod+Shift+Space\fP \(en Make a window float (move and resize with \f(CWMod+\fPleft/right click). -.ITEM -\f(CWMod+s\fP \(en Make/unmake a window "sticky" (follows you from tag to tag) -.ITEM -\f(CWMod+b\fP \(en Toggle statusbar (may also middle click on desktop) -.ITEM -\f(CWMod+v\fP \(en Jump to master window -.LIST OFF -.HEADING 2 "Window layouts" -.LI -.ITEM -\f(CWMod+t\fP \(en Tiling mode (active by default) -.ITEM -\f(CWMod+T\fP \(en Bottom stack mode (just like tiling, but master is on top) -.ITEM -\f(CWMod+f\fP \(en Fullscreen mode -.ITEM -\f(CWMod+F\fP \(en Floating (AKA normie) mode -.ITEM -\f(CWMod+y\fP \(en Fibbonacci spiral mode -.ITEM -\f(CWMod+Y\fP \(en Dwindle mode (similar to Fibonacci) -.ITEM -\f(CWMod+u\fP \(en Master on left, other windows in monocle mode -.ITEM -\f(CWMod+U\fP \(en Monocle mode (all windows fullscreen and cycle through) -.ITEM -\f(CWMod+i\fP \(en Center the master window -.ITEM -\f(CWMod+I\fP \(en Center and float the master window -.ITEM -\f(CWMod+o/O\fP \(en Increase/decrease the number of master windows -.LIST OFF -.HEADING 2 "Basic Programs" -.LI -.ITEM -\f(CWMod+r\fP \(en lf (file browser/manager) -.ITEM -\f(CWMod+R\fP \(en htop (task manager, system monitor that R*dditors use to look cool) -.ITEM -\f(CWMod+e\fP \(en neomutt (email) \(en Must be first configured by running \f(CWmw add\fP. -.ITEM -\f(CWMod+E\fP \(en abook (contacts, addressbook, emails) -.ITEM -\f(CWMod+m\fP \(en ncmpcpp (music player) -.ITEM -\f(CWMod+w\fP \(en Web browser (Brave by default) -.ITEM -\f(CWMod+W\fP \(en nmtui (for connecting to wireless internet) -.ITEM -\f(CWMod+n\fP \(en vimwiki (for notes) -.ITEM -\f(CWMod+N\fP \(en newsboat (RSS feed reader) -.ITEM -\f(CWMod+F4\fP \(en pulsemixer (audio system control) -.ITEM -\f(CWMod+Shift+Enter\fP \(en Show/hide dropdown terminal -.ITEM -\f(CWMod+'\fP \(en Show/hide dropdown calculator -.ITEM -\f(CWMod+D\fP \(en passmenu (password manager) -.LIST OFF -.HEADING 2 "Tags/Workspaces" -.PP -There are nine tags, active tags are highlighted in the top left. -.LI -.ITEM -\f(CWMod+(Number)\fP \(en Go to that number tag -.ITEM -\f(CWMod+Shift+(Number)\fP \(en Send window to that tag -.ITEM -\f(CWMod+Tab\fP \(en Go to previous tag (may also use \f(CW\\\fP for Tab) -.ITEM -\f(CWMod+g\fP \(en Go to left tag (hold shift to send window there) -.ITEM -\f(CWMod+;\fP \(en Go to right tag (hold shift to send window there) -.ITEM -\f(CWMod+Left/Right\fP \(en Go to another display -.ITEM -\f(CWMod+Shift+Left/+Right\fP \(en Move window to another display -.LIST OFF -.HEADING 2 "System" -.LI -.ITEM -\f(CWMod+BackSpace\fP \(enChoose to lock screen, logout, shutdown, reboot, etc. -.ITEM -\f(CWMod+F1\fP \(en Show this document -.ITEM -\f(CWMod+F2\fP \(en Watch tutorial videos on a subject -.ITEM -\f(CWMod+F3\fP \(en Select screen/display to use -.ITEM -\f(CWMod+F4\fP \(en pulsemixer (audio control) -.ITEM -\f(CWMod+F6\fP \(en Transmission torrent client (not installed by default) -.ITEM -\f(CWMod+F7\fP \(en Toggle on/off transmission client via dmenu -.ITEM -\f(CWMod+F8\fP \(en Check mail, if mutt-wizard is configured. (Run \f(CWmw add\fP to set up.) -.ITEM -\f(CWMod+F9\fP \(en Mount a USB drive/hard drive or Android -.ITEM -\f(CWMod+F10\fP \(en Unmount a non-essential drive or Android -.ITEM -\f(CWMod+F11\fP \(en View webcam -.ITEM -\f(CWMod+F12\fP \(en Rerun kayboard mapping scripts if new keyboard is attached -.ITEM -\f(CWMod+`\fP \(en Select an emoji to copy to clipboard -.ITEM -\f(CWMod+Insert\fP \(en Show contents of clipboard/primary selection -.LIST OFF -.HEADING 2 "Audio" -.PP -I use ncmpcpp as a music player, which is a front end for mpd. -.LI -.ITEM -\f(CWMod+m\fP \(en ncmpcpp, the music player -.ITEM -\f(CWMod+.\fP \(en Next track -.ITEM -\f(CWMod+,\fP \(en Previous track -.ITEM -\f(CWMod+<\fP \(en Restart track -.ITEM -\f(CWMod+>\fP \(en Toggle playlist looping -.ITEM -\f(CWMod+p\fP \(en Toggle pause -.ITEM -\f(CWMod+p\fP \(en Force pause music player daemon and all mpv videos -.ITEM -\f(CWMod+M\fP \(en Mute all audio -.ITEM -\f(CWMod+-\fP \(en Decrease volume (holding shift increases amount) -.ITEM -\f(CWMod++\fP \(en Increase volume (holding shift increases amount) -.ITEM -\f(CWMod+[\fP \(en Back 10 seconds (holding shift moves by one minute) -.ITEM -\f(CWMod+]\fP \(en Forward 10 seconds (holding shift moves by one minute) -.ITEM -\f(CWMod+F4\fP \(en pulsemixer (general audio/volume sink/source control) -.LIST OFF -.HEADING 2 "Recording" -.PP -I use maim and ffmpeg to make different recordings of the desktop and audio. -All of these recording shortcuts will output into \f(CW~\fP, and will not overwrite -previous recordings as their names are based on their exact times. -.LI -.ITEM -\f(CWPrintScreen\fP \(en Take a screenshot -.ITEM -\f(CWShift+PrintScreen\fP \(en Select area to screenshot -.ITEM -\f(CWMod+PrintScreen\fP \(en Opens dmenu menu to select kind of audio/video recording -.ITEM -\f(CWMod+Delete\fP \(en Kills any recording started in the above way. -.ITEM -\f(CWMod+Shift+c\fP \(en Toggles a webcam in the bottom right for screencasting. -.ITEM -\f(CWMod+ScrollLock\fP \(en Toggle screenkey (if installed) to show keypresses -.LIST OFF -.HEADING 2 "Other buttons" -.PP -I've mapped those extra buttons that some keyboards have (play and pause -buttons, screen brightness, email, web browsing buttons, etc.) to what you -would expect. -.HEADING 1 "Configuration" -.PP -Dotfiles/settings files are located in \f(CW~/.config/\fP. -.PP -Suckless programs, dwm (the window manager), st (the terminal) and dmenu among others do not have traditional config files, but have their source code location in \f(CW~/.local/src/\fP (press \f(CWrr\fP to jump to that directory). -There you can modify their \f(CWconfig.h\fP files or other source code, then \f(CWsudo make install\fP to reinstall. -.PP -vim is set to automatically recompile and install these programs whenever you save changes to any \f(CWconfig.h\fP file -(compilation will be nearly instantaneous). -You'll have to restart the program to see its effects obviously. -.HEADING 1 "Frequently Asked Questions (FAQs)" -.HEADING 2 "My keyboard isn't working as expected!" -.PP -As mentioned above, LARBS makes some keyboard changes with the \f(CWremaps\fP script. -These settings may override your preferred settings, so you should open this file and comment out troublesome lines if you have issues. -.HEADING 2 "My audio isn't working!" -.PP -On fresh install, the Linux audio system often mutes outputs. -You may also need to set your preferred default output sink which you can do by the command line, or by selecting one with \f(CWpulsemixer\fP (\f(CWMod+F4\fP). -.HEADING 2 "How do I copy and paste?" -.PP -Copying and pasting is always program-specific on any system. -In most graphical programs, copy and paste will be the same as they are on Windows: \f(CWctrl-c\fP and \f(CWctrl-v\fP. -In the Linux terminal, those binds have other more important purposes, so you can run \f(CWman st\fP to see how to copy and paste in my terminal build. -.PP -Additionally, I've set vim to use the clipboard as the default buffer, which means when you yank or delete something in vim, it will be in your system clipboard as well, so you can \f(CWctrl-v\fP it into your browser instance, etc. You can also paste material copied from other programs into vim with the typical vim bindings. -.HEADING 2 "How do I change the background/wallpaper?" -.PP -The system will always read the file \f(CW~/.config/wall.png\fP as the wallpaper. -The script \f(CWsetbg\fP, if run on an image will set it as the persistent background. -When using the file manager, you can simply hover over an image name and type \f(CWb\fP and this will run \f(CWsetbg\fP. -.HEADING 2 "How I change the colorscheme?" -.PP -LARBS no longer deploys Xresources by default, but check \f(CW~/.config/x11/xresources\fP for a list of color schemes you can activate or add your own. When you save the file, vim will automatically update the colorscheme. If you'd like these colors activated by default on login, there is a line in \f(CW~/.config/x11/xprofile\fP you can uncomment to allow that. -.PP -Or, if you want to use \f(CWwal\fP to automatically generate colorschemes from your wallpapers, just install it and \f(CWsetbg\fP will automatically detect and run it on startup and wallpaper change. -.HEADING 2 "How do I set up my email?" -.PP -LARBS comes with mutt-wizard, which gives the ability to receive and send all your email and keep an offline store of it all in your terminal, without the need for browser. -You can add email accounts by running \f(CWmw -a your@email.com\fP. -See \f(CWman mw\fP for all the information you need about mutt-wizard. -.PP -Once you have successfully added your email address(es), you can open your mail with \f(CWneomutt\fP which is also bound to \f(CWMod+e\fP. -You can sync your mail by pressing \f(CWMod+F8\fP and you can set a cronjob to sync mail every 10 minutes by running \f(CWmw -t 10\fP. -.PP -You may also want to install \f(CWpam-gnupg-git\fP, which can be set up to automatically unlock your GPG key on login, which will allow you avoid having put in a password to sync and send, all while keeping your password safe and encypted on your machine. -.HEADING 2 "How do I set up my music?" -.PP -By default, mpd, the music daemon assumes that \f(CW~/Music\fP is your music directory. -This can be changed in \f(CW~/.config/mpd/mpd.conf\fP. -When you add music to your music folder, you may have to run \f(CWmpc up\fP in the terminal to update the database. -mpd is controlled by ncmpcpp, which is accessible by \f(CWMod+m\fP. -.HEADING 2 "How do I update LARBS?" -.PP -LARBS is deployed as a git repository in your home directory. -You can use it as such to fetch, diff and merge changes from the remote repository. -If you don't want to do that or don't know how to use git, you can actually just rerun the script (as root) and reinstall LARBS and it will automatically update an existing install if you select the same username. -This will overwrite the original config files though, including changes you made for them, but this is an easier brute force approach that will also install any new dependencies. -.HEADING 1 "Important Links" -.PP -You can follow links via the keyboard in this pdf reader by pressing \f(CWf\fP followed by the number that appears on the desired link. -.LI -.ITEM -.PDF_WWW_LINK "mailto:luke@lukesmith.xyz" "luke@lukesmith.xyz" -\(en For questions! -.ITEM -.PDF_WWW_LINK "http://lukesmith.xyz" "https://lukesmith.xyz" -\(en For stalking! -.ITEM -.PDF_WWW_LINK "https://lukesmith.xyz/donate" "https://lukesmith.xyz/donate" -\(en To incentivize more development of LARBS! -.ITEM -.PDF_WWW_LINK "https://github.com/LukeSmithxyz" "My Github Page" -\(en For the code behind it! -.ITEM -.PDF_WWW_LINK "http://lukesmith.xyz/rss.xml" "RSS" -\(en For updates! -.LIST OFF diff --git a/.local/src/dwm/shiftview.c b/.local/src/dwm/shiftview.c deleted file mode 100644 index 3d2706b8..00000000 --- a/.local/src/dwm/shiftview.c +++ /dev/null @@ -1,64 +0,0 @@ -/** Function to shift the current view to the left/right - * - * @param: "arg->i" stores the number of tags to shift right (positive value) - * or left (negative value) - */ -void -shiftview(const Arg *arg) -{ - Arg shifted; - Client *c; - unsigned int tagmask = 0; - - for (c = selmon->clients; c; c = c->next) - if (!(c->tags & SPTAGMASK)) - tagmask = tagmask | c->tags; - - shifted.ui = selmon->tagset[selmon->seltags] & ~SPTAGMASK; - if (arg->i > 0) /* left circular shift */ - do { - shifted.ui = (shifted.ui << arg->i) - | (shifted.ui >> (LENGTH(tags) - arg->i)); - shifted.ui &= ~SPTAGMASK; - } while (tagmask && !(shifted.ui & tagmask)); - else /* right circular shift */ - do { - shifted.ui = (shifted.ui >> (- arg->i) - | shifted.ui << (LENGTH(tags) + arg->i)); - shifted.ui &= ~SPTAGMASK; - } while (tagmask && !(shifted.ui & tagmask)); - - view(&shifted); -} - -void -shifttag(const Arg *arg) -{ - Arg a; - Client *c; - unsigned visible = 0; - int i = arg->i; - int count = 0; - int nextseltags, curseltags = selmon->tagset[selmon->seltags]; - - do { - if(i > 0) // left circular shift - nextseltags = (curseltags << i) | (curseltags >> (LENGTH(tags) - i)); - - else // right circular shift - nextseltags = curseltags >> (- i) | (curseltags << (LENGTH(tags) + i)); - - // Check if tag is visible - for (c = selmon->clients; c && !visible; c = c->next) - if (nextseltags & c->tags) { - visible = 1; - break; - } - i += arg->i; - } while (!visible && ++count < 10); - - if (count < 10) { - a.i = nextseltags; - tag(&a); - } -} diff --git a/.local/src/dwm/transient.c b/.local/src/dwm/transient.c deleted file mode 100644 index 040adb5b..00000000 --- a/.local/src/dwm/transient.c +++ /dev/null @@ -1,42 +0,0 @@ -/* cc transient.c -o transient -lX11 */ - -#include -#include -#include -#include - -int main(void) { - Display *d; - Window r, f, t = None; - XSizeHints h; - XEvent e; - - d = XOpenDisplay(NULL); - if (!d) - exit(1); - r = DefaultRootWindow(d); - - f = XCreateSimpleWindow(d, r, 100, 100, 400, 400, 0, 0, 0); - h.min_width = h.max_width = h.min_height = h.max_height = 400; - h.flags = PMinSize | PMaxSize; - XSetWMNormalHints(d, f, &h); - XStoreName(d, f, "floating"); - XMapWindow(d, f); - - XSelectInput(d, f, ExposureMask); - while (1) { - XNextEvent(d, &e); - - if (t == None) { - sleep(5); - t = XCreateSimpleWindow(d, r, 50, 50, 100, 100, 0, 0, 0); - XSetTransientForHint(d, t, f); - XStoreName(d, t, "transient"); - XMapWindow(d, t); - XSelectInput(d, t, ExposureMask); - } - } - - XCloseDisplay(d); - exit(0); -} diff --git a/.local/src/dwm/util.c b/.local/src/dwm/util.c deleted file mode 100644 index fe044fc7..00000000 --- a/.local/src/dwm/util.c +++ /dev/null @@ -1,35 +0,0 @@ -/* See LICENSE file for copyright and license details. */ -#include -#include -#include -#include - -#include "util.h" - -void * -ecalloc(size_t nmemb, size_t size) -{ - void *p; - - if (!(p = calloc(nmemb, size))) - die("calloc:"); - return p; -} - -void -die(const char *fmt, ...) { - va_list ap; - - va_start(ap, fmt); - vfprintf(stderr, fmt, ap); - va_end(ap); - - if (fmt[0] && fmt[strlen(fmt)-1] == ':') { - fputc(' ', stderr); - perror(NULL); - } else { - fputc('\n', stderr); - } - - exit(1); -} diff --git a/.local/src/dwm/util.h b/.local/src/dwm/util.h deleted file mode 100644 index f633b517..00000000 --- a/.local/src/dwm/util.h +++ /dev/null @@ -1,8 +0,0 @@ -/* See LICENSE file for copyright and license details. */ - -#define MAX(A, B) ((A) > (B) ? (A) : (B)) -#define MIN(A, B) ((A) < (B) ? (A) : (B)) -#define BETWEEN(X, A, B) ((A) <= (X) && (X) <= (B)) - -void die(const char *fmt, ...); -void *ecalloc(size_t nmemb, size_t size); diff --git a/.local/src/dwm/util.o b/.local/src/dwm/util.o deleted file mode 100644 index b1b45c32..00000000 Binary files a/.local/src/dwm/util.o and /dev/null differ diff --git a/.local/src/dwm/vanitygaps.c b/.local/src/dwm/vanitygaps.c deleted file mode 100644 index 4c98e694..00000000 --- a/.local/src/dwm/vanitygaps.c +++ /dev/null @@ -1,550 +0,0 @@ -/* Key binding functions */ -static void defaultgaps(const Arg *arg); -static void incrgaps(const Arg *arg); -/* static void incrigaps(const Arg *arg); */ -/* static void incrogaps(const Arg *arg); */ -/* static void incrohgaps(const Arg *arg); */ -/* static void incrovgaps(const Arg *arg); */ -/* static void incrihgaps(const Arg *arg); */ -/* static void incrivgaps(const Arg *arg); */ -static void togglegaps(const Arg *arg); -static void togglesmartgaps(const Arg *arg); - -/* Layouts */ -static void bstack(Monitor *m); -static void centeredmaster(Monitor *m); -static void centeredfloatingmaster(Monitor *m); -static void deck(Monitor *m); -static void dwindle(Monitor *m); -static void fibonacci(Monitor *m, int s); -static void spiral(Monitor *m); -static void tile(Monitor *); - -/* Internals */ -static void getgaps(Monitor *m, int *oh, int *ov, int *ih, int *iv, unsigned int *nc); -static void setgaps(int oh, int ov, int ih, int iv); - -/* Settings */ -static int enablegaps = 1; - -static void -setgaps(int oh, int ov, int ih, int iv) -{ - if (oh < 0) oh = 0; - if (ov < 0) ov = 0; - if (ih < 0) ih = 0; - if (iv < 0) iv = 0; - - selmon->gappoh = oh; - selmon->gappov = ov; - selmon->gappih = ih; - selmon->gappiv = iv; - arrange(selmon); -} - -static void -togglegaps(const Arg *arg) -{ - enablegaps = !enablegaps; - arrange(NULL); -} - -static void -togglesmartgaps(const Arg *arg) -{ - smartgaps = !smartgaps; - arrange(NULL); -} - -static void -defaultgaps(const Arg *arg) -{ - setgaps(gappoh, gappov, gappih, gappiv); -} - -static void -incrgaps(const Arg *arg) -{ - setgaps( - selmon->gappoh + arg->i, - selmon->gappov + arg->i, - selmon->gappih + arg->i, - selmon->gappiv + arg->i - ); -} - -/* static void */ -/* incrigaps(const Arg *arg) */ -/* { */ -/* setgaps( */ -/* selmon->gappoh, */ -/* selmon->gappov, */ -/* selmon->gappih + arg->i, */ -/* selmon->gappiv + arg->i */ -/* ); */ -/* } */ - -/* static void */ -/* incrogaps(const Arg *arg) */ -/* { */ -/* setgaps( */ -/* selmon->gappoh + arg->i, */ -/* selmon->gappov + arg->i, */ -/* selmon->gappih, */ -/* selmon->gappiv */ -/* ); */ -/* } */ - -/* static void */ -/* incrohgaps(const Arg *arg) */ -/* { */ -/* setgaps( */ -/* selmon->gappoh + arg->i, */ -/* selmon->gappov, */ -/* selmon->gappih, */ -/* selmon->gappiv */ -/* ); */ -/* } */ - -/* static void */ -/* incrovgaps(const Arg *arg) */ -/* { */ -/* setgaps( */ -/* selmon->gappoh, */ -/* selmon->gappov + arg->i, */ -/* selmon->gappih, */ -/* selmon->gappiv */ -/* ); */ -/* } */ - -/* static void */ -/* incrihgaps(const Arg *arg) */ -/* { */ -/* setgaps( */ -/* selmon->gappoh, */ -/* selmon->gappov, */ -/* selmon->gappih + arg->i, */ -/* selmon->gappiv */ -/* ); */ -/* } */ - -/* static void */ -/* incrivgaps(const Arg *arg) */ -/* { */ -/* setgaps( */ -/* selmon->gappoh, */ -/* selmon->gappov, */ -/* selmon->gappih, */ -/* selmon->gappiv + arg->i */ -/* ); */ -/* } */ - -static void -getgaps(Monitor *m, int *oh, int *ov, int *ih, int *iv, unsigned int *nc) -{ - unsigned int n, oe, ie; - oe = ie = enablegaps; - Client *c; - - for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++); - if (smartgaps && n == 1) { - oe = 0; // outer gaps disabled when only one client - } - - *oh = m->gappoh*oe; // outer horizontal gap - *ov = m->gappov*oe; // outer vertical gap - *ih = m->gappih*ie; // inner horizontal gap - *iv = m->gappiv*ie; // inner vertical gap - *nc = n; // number of clients -} - -void -getfacts(Monitor *m, int msize, int ssize, float *mf, float *sf, int *mr, int *sr) -{ - unsigned int n; - float mfacts, sfacts; - int mtotal = 0, stotal = 0; - Client *c; - - for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++); - mfacts = MIN(n, m->nmaster); - sfacts = n - m->nmaster; - - for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++) - if (n < m->nmaster) - mtotal += msize / mfacts; - else - stotal += ssize / sfacts; - - *mf = mfacts; // total factor of master area - *sf = sfacts; // total factor of stack area - *mr = msize - mtotal; // the remainder (rest) of pixels after an even master split - *sr = ssize - stotal; // the remainder (rest) of pixels after an even stack split -} - -/*** - * Layouts - */ - -/* - * Bottomstack layout + gaps - * https://dwm.suckless.org/patches/bottomstack/ - */ - -static void -bstack(Monitor *m) -{ - unsigned int i, n; - int mx = 0, my = 0, mh = 0, mw = 0; - int sx = 0, sy = 0, sh = 0, sw = 0; - float mfacts, sfacts; - int mrest, srest; - Client *c; - - int oh, ov, ih, iv; - getgaps(m, &oh, &ov, &ih, &iv, &n); - - if (n == 0) - return; - - sx = mx = m->wx + ov; - sy = my = m->wy + oh; - sh = mh = m->wh - 2*oh; - mw = m->ww - 2*ov - iv * (MIN(n, m->nmaster) - 1); - sw = m->ww - 2*ov - iv * (n - m->nmaster - 1); - - if (m->nmaster && n > m->nmaster) { - sh = (mh - ih) * (1 - m->mfact); - mh = (mh - ih) * m->mfact; - sx = mx; - sy = my + mh + ih; - } - - getfacts(m, mw, sw, &mfacts, &sfacts, &mrest, &srest); - - for (i = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) { - if (i < m->nmaster) { - resize(c, mx, my, (mw / mfacts) + (i < mrest ? 1 : 0) - (2*c->bw), mh - (2*c->bw), 0); - mx += WIDTH(c) + iv; - } else { - resize(c, sx, sy, (sw / sfacts) + ((i - m->nmaster) < srest ? 1 : 0) - (2*c->bw), sh - (2*c->bw), 0); - sx += WIDTH(c) + iv; - } - } -} - -/* - * Centred master layout + gaps - * https://dwm.suckless.org/patches/centeredmaster/ - */ - -void -centeredmaster(Monitor *m) -{ - unsigned int i, n; - int mx = 0, my = 0, mh = 0, mw = 0; - int lx = 0, ly = 0, lw = 0, lh = 0; - int rx = 0, ry = 0, rw = 0, rh = 0; - float mfacts = 0, lfacts = 0, rfacts = 0; - int mtotal = 0, ltotal = 0, rtotal = 0; - int mrest = 0, lrest = 0, rrest = 0; - Client *c; - - int oh, ov, ih, iv; - getgaps(m, &oh, &ov, &ih, &iv, &n); - - if (n == 0) - return; - - /* initialize areas */ - mx = m->wx + ov; - my = m->wy + oh; - mh = m->wh - 2*oh - ih * ((!m->nmaster ? n : MIN(n, m->nmaster)) - 1); - mw = m->ww - 2*ov; - lh = m->wh - 2*oh - ih * (((n - m->nmaster) / 2) - 1); - rh = m->wh - 2*oh - ih * (((n - m->nmaster) / 2) - ((n - m->nmaster) % 2 ? 0 : 1)); - - if (m->nmaster && n > m->nmaster) { - /* go mfact box in the center if more than nmaster clients */ - if (n - m->nmaster > 1) { - /* ||<-S->|<---M--->|<-S->|| */ - mw = (m->ww - 2*ov - 2*iv) * m->mfact; - lw = (m->ww - mw - 2*ov - 2*iv) / 2; - mx += lw + iv; - } else { - /* ||<---M--->|<-S->|| */ - mw = (mw - iv) * m->mfact; - lw = m->ww - mw - iv - 2*ov; - } - rw = lw; - lx = m->wx + ov; - ly = m->wy + oh; - rx = mx + mw + iv; - ry = m->wy + oh; - } - - /* calculate facts */ - for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++) { - if (!m->nmaster || n < m->nmaster) - mfacts += 1; - else if ((n - m->nmaster) % 2) - lfacts += 1; // total factor of left hand stack area - else - rfacts += 1; // total factor of right hand stack area - } - - for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++) - if (!m->nmaster || n < m->nmaster) - mtotal += mh / mfacts; - else if ((n - m->nmaster) % 2) - ltotal += lh / lfacts; - else - rtotal += rh / rfacts; - - mrest = mh - mtotal; - lrest = lh - ltotal; - rrest = rh - rtotal; - - for (i = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) { - if (!m->nmaster || i < m->nmaster) { - /* nmaster clients are stacked vertically, in the center of the screen */ - resize(c, mx, my, mw - (2*c->bw), (mh / mfacts) + (i < mrest ? 1 : 0) - (2*c->bw), 0); - my += HEIGHT(c) + ih; - } else { - /* stack clients are stacked vertically */ - if ((i - m->nmaster) % 2 ) { - resize(c, lx, ly, lw - (2*c->bw), (lh / lfacts) + ((i - 2*m->nmaster) < 2*lrest ? 1 : 0) - (2*c->bw), 0); - ly += HEIGHT(c) + ih; - } else { - resize(c, rx, ry, rw - (2*c->bw), (rh / rfacts) + ((i - 2*m->nmaster) < 2*rrest ? 1 : 0) - (2*c->bw), 0); - ry += HEIGHT(c) + ih; - } - } - } -} - -void -centeredfloatingmaster(Monitor *m) -{ - unsigned int i, n; - float mfacts, sfacts; - int mrest, srest; - int mx = 0, my = 0, mh = 0, mw = 0; - int sx = 0, sy = 0, sh = 0, sw = 0; - Client *c; - - float mivf = 1.0; // master inner vertical gap factor - int oh, ov, ih, iv; - getgaps(m, &oh, &ov, &ih, &iv, &n); - - if (n == 0) - return; - - sx = mx = m->wx + ov; - sy = my = m->wy + oh; - sh = mh = m->wh - 2*oh; - mw = m->ww - 2*ov - iv*(n - 1); - sw = m->ww - 2*ov - iv*(n - m->nmaster - 1); - - if (m->nmaster && n > m->nmaster) { - mivf = 0.8; - /* go mfact box in the center if more than nmaster clients */ - if (m->ww > m->wh) { - mw = m->ww * m->mfact - iv*mivf*(MIN(n, m->nmaster) - 1); - mh = m->wh * 0.9 - 2*oh; - } else { - mw = m->ww * 0.9 - iv*mivf*(MIN(n, m->nmaster) - 1); - mh = m->wh * m->mfact; - } - mx = m->wx + (m->ww - mw) / 2; - my = m->wy + (m->wh - mh) / 2; - - sx = m->wx + ov; - sy = m->wy + oh; - sh = m->wh - 2*oh; - } - - getfacts(m, mw, sw, &mfacts, &sfacts, &mrest, &srest); - - for (i = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) - if (i < m->nmaster) { - /* nmaster clients are stacked horizontally, in the center of the screen */ - resize(c, mx, my, (mw / mfacts) + (i < mrest ? 1 : 0) - (2*c->bw), mh - (2*c->bw), 0); - mx += WIDTH(c) + iv*mivf; - } else { - /* stack clients are stacked horizontally */ - resize(c, sx, sy, (sw / sfacts) + ((i - m->nmaster) < srest ? 1 : 0) - (2*c->bw), sh - (2*c->bw), 0); - sx += WIDTH(c) + iv; - } -} - -/* - * Deck layout + gaps - * https://dwm.suckless.org/patches/deck/ - */ - -static void -deck(Monitor *m) -{ - unsigned int i, n; - int mx = 0, my = 0, mh = 0, mw = 0; - int sx = 0, sy = 0, sh = 0, sw = 0; - float mfacts, sfacts; - int mrest, srest; - Client *c; - - int oh, ov, ih, iv; - getgaps(m, &oh, &ov, &ih, &iv, &n); - - if (n == 0) - return; - - sx = mx = m->wx + ov; - sy = my = m->wy + oh; - sh = mh = m->wh - 2*oh - ih * (MIN(n, m->nmaster) - 1); - sw = mw = m->ww - 2*ov; - - if (m->nmaster && n > m->nmaster) { - sw = (mw - iv) * (1 - m->mfact); - mw = (mw - iv) * m->mfact; - sx = mx + mw + iv; - sh = m->wh - 2*oh; - } - - getfacts(m, mh, sh, &mfacts, &sfacts, &mrest, &srest); - - if (n - m->nmaster > 0) /* override layout symbol */ - snprintf(m->ltsymbol, sizeof m->ltsymbol, "D %d", n - m->nmaster); - - for (i = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) - if (i < m->nmaster) { - resize(c, mx, my, mw - (2*c->bw), (mh / mfacts) + (i < mrest ? 1 : 0) - (2*c->bw), 0); - my += HEIGHT(c) + ih; - } else { - resize(c, sx, sy, sw - (2*c->bw), sh - (2*c->bw), 0); - } -} - -/* - * Fibonacci layout + gaps - * https://dwm.suckless.org/patches/fibonacci/ - */ - -static void -fibonacci(Monitor *m, int s) -{ - unsigned int i, n; - int nx, ny, nw, nh; - int oh, ov, ih, iv; - Client *c; - - getgaps(m, &oh, &ov, &ih, &iv, &n); - - if (n == 0) - return; - - nx = m->wx + ov; - ny = oh; - nw = m->ww - 2*ov; - nh = m->wh - 2*oh; - - for (i = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next)) { - if ((i % 2 && nh / 2 > 2*c->bw) - || (!(i % 2) && nw / 2 > 2*c->bw)) { - if (i < n - 1) { - if (i % 2) - nh = (nh - ih) / 2; - else - nw = (nw - iv) / 2; - - if ((i % 4) == 2 && !s) - nx += nw + iv; - else if ((i % 4) == 3 && !s) - ny += nh + ih; - } - if ((i % 4) == 0) { - if (s) - ny += nh + ih; - else - ny -= nh + ih; - } - else if ((i % 4) == 1) - nx += nw + iv; - else if ((i % 4) == 2) - ny += nh + ih; - else if ((i % 4) == 3) { - if (s) - nx += nw + iv; - else - nx -= nw + iv; - } - if (i == 0) { - if (n != 1) - nw = (m->ww - 2*ov - iv) * m->mfact; - ny = m->wy + oh; - } - else if (i == 1) - nw = m->ww - nw - iv - 2*ov; - i++; - } - - resize(c, nx, ny, nw - (2*c->bw), nh - (2*c->bw), False); - } -} - -static void -dwindle(Monitor *m) -{ - fibonacci(m, 1); -} - -static void -spiral(Monitor *m) -{ - fibonacci(m, 0); -} - -/* - * Default tile layout + gaps - */ - -static void -tile(Monitor *m) -{ - unsigned int i, n; - int mx = 0, my = 0, mh = 0, mw = 0; - int sx = 0, sy = 0, sh = 0, sw = 0; - float mfacts, sfacts; - int mrest, srest; - Client *c; - - - int oh, ov, ih, iv; - getgaps(m, &oh, &ov, &ih, &iv, &n); - - if (n == 0) - return; - - sx = mx = m->wx + ov; - sy = my = m->wy + oh; - mh = m->wh - 2*oh - ih * (MIN(n, m->nmaster) - 1); - sh = m->wh - 2*oh - ih * (n - m->nmaster - 1); - sw = mw = m->ww - 2*ov; - - if (m->nmaster && n > m->nmaster) { - sw = (mw - iv) * (1 - m->mfact); - mw = (mw - iv) * m->mfact; - sx = mx + mw + iv; - } - - getfacts(m, mh, sh, &mfacts, &sfacts, &mrest, &srest); - - for (i = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) - if (i < m->nmaster) { - resize(c, mx, my, mw - (2*c->bw), (mh / mfacts) + (i < mrest ? 1 : 0) - (2*c->bw), 0); - my += HEIGHT(c) + ih; - } else { - resize(c, sx, sy, sw - (2*c->bw), (sh / sfacts) + ((i - m->nmaster) < srest ? 1 : 0) - (2*c->bw), 0); - sy += HEIGHT(c) + ih; - } -} diff --git a/.local/src/dwmblocks/.gitignore b/.local/src/dwmblocks/.gitignore deleted file mode 100644 index c4bb9708..00000000 --- a/.local/src/dwmblocks/.gitignore +++ /dev/null @@ -1,53 +0,0 @@ -# Prerequisites -*.d - -# Object files -*.o -*.ko -*.obj -*.elf - -# Linker output -*.ilk -*.map -*.exp - -# Precompiled Headers -*.gch -*.pch - -# Libraries -*.lib -*.a -*.la -*.lo - -# Shared objects (inc. Windows DLLs) -*.dll -*.so -*.so.* -*.dylib - -# Executables -*.exe -*.out -*.app -*.i*86 -*.x86_64 -*.hex -dwmblocks - -# Debug files -*.dSYM/ -*.su -*.idb -*.pdb - -# Kernel Module Compile Results -*.mod* -*.cmd -.tmp_versions/ -modules.order -Module.symvers -Mkfile.old -dkms.conf diff --git a/.local/src/dwmblocks/FUNDING.yml b/.local/src/dwmblocks/FUNDING.yml deleted file mode 100644 index f8e60767..00000000 --- a/.local/src/dwmblocks/FUNDING.yml +++ /dev/null @@ -1,3 +0,0 @@ -github: lukesmithxyz -custom: ["https://lukesmith.xyz/donate", "https://paypal.me/lukemsmith", "https://lukesmith.xyz/crypto"] -patreon: lukesmith diff --git a/.local/src/dwmblocks/LICENSE b/.local/src/dwmblocks/LICENSE deleted file mode 100644 index d159169d..00000000 --- a/.local/src/dwmblocks/LICENSE +++ /dev/null @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - 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 2 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, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. diff --git a/.local/src/dwmblocks/Makefile b/.local/src/dwmblocks/Makefile deleted file mode 100644 index 5cfbb5a8..00000000 --- a/.local/src/dwmblocks/Makefile +++ /dev/null @@ -1,19 +0,0 @@ -.POSIX: - -PREFIX = /usr/local -CC = gcc - -dwmblocks: dwmblocks.o - $(CC) dwmblocks.o -lX11 -o dwmblocks -dwmblocks.o: dwmblocks.c config.h - $(CC) -c dwmblocks.c -clean: - rm -f *.o *.gch dwmblocks -install: dwmblocks - mkdir -p $(DESTDIR)$(PREFIX)/bin - cp -f dwmblocks $(DESTDIR)$(PREFIX)/bin - chmod 755 $(DESTDIR)$(PREFIX)/bin/dwmblocks -uninstall: - rm -f $(DESTDIR)$(PREFIX)/bin/dwmblocks - -.PHONY: clean install uninstall diff --git a/.local/src/dwmblocks/README.md b/.local/src/dwmblocks/README.md deleted file mode 100644 index 7d21e309..00000000 --- a/.local/src/dwmblocks/README.md +++ /dev/null @@ -1,44 +0,0 @@ -# dwmblocks - -Modular status bar for dwm written in c. - -# Modifying blocks - -The statusbar is made from text output from commandline programs. Blocks are -added and removed by editing the config.h file. - -# Luke's build - -I have dwmblocks read my preexisting scripts -[here in my dotfiles repo](https://github.com/LukeSmithxyz/voidrice/tree/master/.local/bin/statusbar). -So if you want my build out of the box, download those and put them in your -`$PATH`. I do this to avoid redundancy in LARBS, both i3 and dwm use the same -statusbar scripts. - -# Signaling changes - -Most statusbars constantly rerun every script every several seconds to update. -This is an option here, but a superior choice is giving your module a signal -that you can signal to it to update on a relevant event, rather than having it -rerun idly. - -For example, the audio module has the update signal 10 by default. Thus, -running `pkill -RTMIN+10 dwmblocks` will update it. - -You can also run `kill -44 $(pidof dwmblocks)` which will have the same effect, -but is faster. Just add 34 to your typical signal number. - -My volume module *never* updates on its own, instead I have this command run -along side my volume shortcuts in dwm to only update it when relevant. - -Note that all modules must have different signal numbers. - -# Clickable modules - -Like i3blocks, this build allows you to build in additional actions into your -scripts in response to click events. See the above linked scripts for examples -of this using the `$BLOCK_BUTTON` variable. - -For this feature to work, you need the appropriate patch in dwm as well. See -[here](https://dwm.suckless.org/patches/statuscmd/). -Credit for those patches goes to Daniel Bylinka (daniel.bylinka@gmail.com). diff --git a/.local/src/dwmblocks/config.h b/.local/src/dwmblocks/config.h deleted file mode 100644 index 5287e789..00000000 --- a/.local/src/dwmblocks/config.h +++ /dev/null @@ -1,32 +0,0 @@ -//Modify this file to change what commands output to your statusbar, and recompile using the make command. -static const Block blocks[] = { - /*Icon*//*Command*/ /*Update Interval*/ /*Update Signal*/ - // {"⌨","sb-kbselect", 0, 30}, - {"", "cat /tmp/recordingicon 2>/dev/null", 0, 9}, - {"", "sb-tasks", 10, 26}, - {"", "sb-music", 0, 11}, - {"", "sb-pacpackages", 0, 8}, - {"", "sb-news", 0, 6}, - // {"", "sb-price btc Bitcoin ", 9000, 21}, - {"", "sb-torrent", 20, 7}, - // {"", "sb-memory", 10, 14}, - // {"", "sb-cpu", 10, 18}, - // {"", "sb-moonphase", 21600, 17}, - {"", "sb-mailbox", 180, 12}, - {"", "sb-forecast", 3600, 5}, - // {"", "sb-nettraf", 1, 16}, - // {"", "sb-battery", 5, 3}, - {"", "sb-volume", 0, 10}, - {"", "sb-clock", 60, 1}, - {"", "sb-internet", 5, 4}, - // {"", "sb-help-icon", 0, 15}, -}; - -//Sets delimiter between status commands. NULL character ('\0') means no delimiter. -static char *delim = " │ "; - -// Have dwmblocks automatically recompile and run when you edit this file in -// vim with the following line in your vimrc/init.vim: - -// autocmd BufWritePost ~/.local/src/dwmblocks/config.h !cd ~/.local/src/dwmblocks/; sudo make install && { killall -q dwmblocks;setsid dwmblocks & } - diff --git a/.local/src/dwmblocks/dwmblocks.c b/.local/src/dwmblocks/dwmblocks.c deleted file mode 100644 index 0969ed7a..00000000 --- a/.local/src/dwmblocks/dwmblocks.c +++ /dev/null @@ -1,294 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#define LENGTH(X) (sizeof(X) / sizeof (X[0])) -#define CMDLENGTH 50 - -typedef struct { - char* icon; - char* command; - unsigned int interval; - unsigned int signal; -} Block; -void sighandler(int num); -void buttonhandler(int sig, siginfo_t *si, void *ucontext); -void replace(char *str, char old, char new); -void remove_all(char *str, char to_remove); -void getcmds(int time); -#ifndef __OpenBSD__ -void getsigcmds(int signal); -void setupsignals(); -void sighandler(int signum); -#endif -int getstatus(char *str, char *last); -void setroot(); -void statusloop(); -void termhandler(int signum); - - -#include "config.h" - -static Display *dpy; -static int screen; -static Window root; -static char statusbar[LENGTH(blocks)][CMDLENGTH] = {0}; -static char statusstr[2][256]; -static int statusContinue = 1; -static void (*writestatus) () = setroot; - -void replace(char *str, char old, char new) -{ - for(char * c = str; *c; c++) - if(*c == old) - *c = new; -} - -// the previous function looked nice but unfortunately it didnt work if to_remove was in any position other than the last character -// theres probably still a better way of doing this -void remove_all(char *str, char to_remove) { - char *read = str; - char *write = str; - while (*read) { - if (*read != to_remove) { - *write++ = *read; - } - ++read; - } - *write = '\0'; -} - -int gcd(int a, int b) -{ - int temp; - while (b > 0){ - temp = a % b; - - a = b; - b = temp; - } - return a; -} - - -//opens process *cmd and stores output in *output -void getcmd(const Block *block, char *output) -{ - if (block->signal) - { - output[0] = block->signal; - output++; - } - char *cmd = block->command; - FILE *cmdf = popen(cmd,"r"); - if (!cmdf){ - //printf("failed to run: %s, %d\n", block->command, errno); - return; - } - char tmpstr[CMDLENGTH] = ""; - // TODO decide whether its better to use the last value till next time or just keep trying while the error was the interrupt - // this keeps trying to read if it got nothing and the error was an interrupt - // could also just read to a separate buffer and not move the data over if interrupted - // this way will take longer trying to complete 1 thing but will get it done - // the other way will move on to keep going with everything and the part that failed to read will be wrong till its updated again - // either way you have to save the data to a temp buffer because when it fails it writes nothing and then then it gets displayed before this finishes - char * s; - int e; - do { - errno = 0; - s = fgets(tmpstr, CMDLENGTH-(strlen(delim)+1), cmdf); - e = errno; - } while (!s && e == EINTR); - pclose(cmdf); - int i = strlen(block->icon); - strcpy(output, block->icon); - strcpy(output+i, tmpstr); - remove_all(output, '\n'); - i = strlen(output); - if ((i > 0 && block != &blocks[LENGTH(blocks) - 1])){ - strcat(output, delim); - } - i+=strlen(delim); - output[i++] = '\0'; -} - -void getcmds(int time) -{ - const Block* current; - for(int i = 0; i < LENGTH(blocks); i++) - { - current = blocks + i; - if ((current->interval != 0 && time % current->interval == 0) || time == -1){ - getcmd(current,statusbar[i]); - } - } -} - -#ifndef __OpenBSD__ -void getsigcmds(int signal) -{ - const Block *current; - for (int i = 0; i < LENGTH(blocks); i++) - { - current = blocks + i; - if (current->signal == signal){ - getcmd(current,statusbar[i]); - } - } -} - -void setupsignals() -{ - struct sigaction sa; - - for(int i = SIGRTMIN; i <= SIGRTMAX; i++) - signal(i, SIG_IGN); - - for(int i = 0; i < LENGTH(blocks); i++) - { - if (blocks[i].signal > 0) - { - signal(SIGRTMIN+blocks[i].signal, sighandler); - sigaddset(&sa.sa_mask, SIGRTMIN+blocks[i].signal); - } - } - sa.sa_sigaction = buttonhandler; - sa.sa_flags = SA_SIGINFO; - sigaction(SIGUSR1, &sa, NULL); - struct sigaction sigchld_action = { - .sa_handler = SIG_DFL, - .sa_flags = SA_NOCLDWAIT - }; - sigaction(SIGCHLD, &sigchld_action, NULL); - -} -#endif - -int getstatus(char *str, char *last) -{ - strcpy(last, str); - str[0] = '\0'; - for(int i = 0; i < LENGTH(blocks); i++) { - strcat(str, statusbar[i]); - if (i == LENGTH(blocks) - 1) - strcat(str, " "); - } - str[strlen(str)-1] = '\0'; - return strcmp(str, last);//0 if they are the same -} - -void setroot() -{ - if (!getstatus(statusstr[0], statusstr[1]))//Only set root if text has changed. - return; - Display *d = XOpenDisplay(NULL); - if (d) { - dpy = d; - } - screen = DefaultScreen(dpy); - root = RootWindow(dpy, screen); - XStoreName(dpy, root, statusstr[0]); - XCloseDisplay(dpy); -} - -void pstdout() -{ - if (!getstatus(statusstr[0], statusstr[1]))//Only write out if text has changed. - return; - printf("%s\n",statusstr[0]); - fflush(stdout); -} - - -void statusloop() -{ -#ifndef __OpenBSD__ - setupsignals(); -#endif - // first figure out the default wait interval by finding the - // greatest common denominator of the intervals - unsigned int interval = -1; - for(int i = 0; i < LENGTH(blocks); i++){ - if(blocks[i].interval){ - interval = gcd(blocks[i].interval, interval); - } - } - unsigned int i = 0; - int interrupted = 0; - const struct timespec sleeptime = {interval, 0}; - struct timespec tosleep = sleeptime; - getcmds(-1); - while(statusContinue) - { - // sleep for tosleep (should be a sleeptime of interval seconds) and put what was left if interrupted back into tosleep - interrupted = nanosleep(&tosleep, &tosleep); - // if interrupted then just go sleep again for the remaining time - if(interrupted == -1){ - continue; - } - // if not interrupted then do the calling and writing - getcmds(i); - writestatus(); - // then increment since its actually been a second (plus the time it took the commands to run) - i += interval; - // set the time to sleep back to the sleeptime of 1s - tosleep = sleeptime; - } -} - -#ifndef __OpenBSD__ -void sighandler(int signum) -{ - getsigcmds(signum-SIGRTMIN); - writestatus(); -} - -void buttonhandler(int sig, siginfo_t *si, void *ucontext) -{ - char button[2] = {'0' + si->si_value.sival_int & 0xff, '\0'}; - pid_t process_id = getpid(); - sig = si->si_value.sival_int >> 8; - if (fork() == 0) - { - const Block *current; - for (int i = 0; i < LENGTH(blocks); i++) - { - current = blocks + i; - if (current->signal == sig) - break; - } - char shcmd[1024]; - sprintf(shcmd,"%s && kill -%d %d",current->command, current->signal+34,process_id); - char *command[] = { "/bin/sh", "-c", shcmd, NULL }; - setenv("BLOCK_BUTTON", button, 1); - setsid(); - execvp(command[0], command); - exit(EXIT_SUCCESS); - } -} - -#endif - -void termhandler(int signum) -{ - statusContinue = 0; - exit(0); -} - -int main(int argc, char** argv) -{ - for(int i = 0; i < argc; i++) - { - if (!strcmp("-d",argv[i])) - delim = argv[++i]; - else if(!strcmp("-p",argv[i])) - writestatus = pstdout; - } - signal(SIGTERM, termhandler); - signal(SIGINT, termhandler); - statusloop(); -} diff --git a/.local/src/dwmblocks/patches/dwmblocks-statuscmd-fork.diff b/.local/src/dwmblocks/patches/dwmblocks-statuscmd-fork.diff deleted file mode 100644 index 1ae7d7a1..00000000 --- a/.local/src/dwmblocks/patches/dwmblocks-statuscmd-fork.diff +++ /dev/null @@ -1,77 +0,0 @@ -diff --git a/dwmblocks.c b/dwmblocks.c -index 7d7a564..e2c5dd0 100644 ---- a/dwmblocks.c -+++ b/dwmblocks.c -@@ -34,8 +34,6 @@ static int screen; - static Window root; - static char statusbar[LENGTH(blocks)][CMDLENGTH] = {0}; - static char statusstr[2][256]; --static char exportstring[CMDLENGTH + 22] = "export BLOCK_BUTTON=-;"; --static int button = 0; - static int statusContinue = 1; - static void (*writestatus) () = setroot; - -@@ -55,21 +53,8 @@ void getcmd(const Block *block, char *output) - output[0] = block->signal; - output++; - } -- char* cmd; -- FILE *cmdf; -- if (button) -- { -- cmd = strcat(exportstring, block->command); -- cmd[20] = '0' + button; -- button = 0; -- cmdf = popen(cmd,"r"); -- cmd[22] = '\0'; -- } -- else -- { -- cmd = block->command; -- cmdf = popen(cmd,"r"); -- } -+ char *cmd = block->command; -+ FILE *cmdf = popen(cmd,"r"); - if (!cmdf) - return; - fgets(output, CMDLENGTH, cmdf); -@@ -117,6 +102,7 @@ void setupsignals() - sa.sa_sigaction = buttonhandler; - sa.sa_flags = SA_SIGINFO; - sigaction(SIGUSR1, &sa, NULL); -+ signal(SIGCHLD, SIG_IGN); - - } - #endif -@@ -179,9 +165,29 @@ void sighandler(int signum) - - void buttonhandler(int sig, siginfo_t *si, void *ucontext) - { -- button = si->si_value.sival_int & 0xff; -- getsigcmds(si->si_value.sival_int >> 8); -+ int button = si->si_value.sival_int & 0xff; -+ sig = si->si_value.sival_int >> 8; -+ getsigcmds(sig); - writestatus(); -+ if (fork() == 0) -+ { -+ static char exportstring[CMDLENGTH + 22] = "export BLOCK_BUTTON=-;"; -+ const Block *current; -+ int i; -+ for (i = 0; i < LENGTH(blocks); i++) -+ { -+ current = blocks + i; -+ if (current->signal == sig) -+ break; -+ } -+ char *cmd = strcat(exportstring, blocks[i].command); -+ cmd[20] = '0' + button; -+ char *command[] = { "/bin/sh", "-c", cmd, NULL }; -+ setsid(); -+ execvp(command[0], command); -+ exit(EXIT_SUCCESS); -+ cmd[22] = '\0'; -+ } - } - - #endif diff --git a/.local/src/dwmblocks/patches/dwmblocks-statuscmd-signal.diff b/.local/src/dwmblocks/patches/dwmblocks-statuscmd-signal.diff deleted file mode 100644 index c2092e77..00000000 --- a/.local/src/dwmblocks/patches/dwmblocks-statuscmd-signal.diff +++ /dev/null @@ -1,93 +0,0 @@ -diff --git a/dwmblocks.c b/dwmblocks.c -index 88bdfb0..7bd14df 100644 ---- a/dwmblocks.c -+++ b/dwmblocks.c -@@ -14,6 +14,7 @@ typedef struct { - unsigned int signal; - } Block; - void sighandler(int num); -+void buttonhandler(int sig, siginfo_t *si, void *ucontext); - void replace(char *str, char old, char new); - void getcmds(int time); - #ifndef __OpenBSD__ -@@ -34,6 +35,8 @@ static int screen; - static Window root; - static char statusbar[LENGTH(blocks)][CMDLENGTH] = {0}; - static char statusstr[2][256]; -+static char exportstring[CMDLENGTH + 16] = "export BUTTON=-;"; -+static int button = 0; - static int statusContinue = 1; - static void (*writestatus) () = setroot; - -@@ -48,16 +51,34 @@ void replace(char *str, char old, char new) - //opens process *cmd and stores output in *output - void getcmd(const Block *block, char *output) - { -+ if (block->signal) -+ { -+ output[0] = block->signal; -+ output++; -+ } - strcpy(output, block->icon); -- char *cmd = block->command; -- FILE *cmdf = popen(cmd,"r"); -+ char* cmd; -+ FILE *cmdf; -+ if (button) -+ { -+ cmd = strcat(exportstring, block->command); -+ cmd[14] = '0' + button; -+ button = 0; -+ cmdf = popen(cmd,"r"); -+ cmd[16] = '\0'; -+ } -+ else -+ { -+ cmd = block->command; -+ cmdf = popen(cmd,"r"); -+ } - if (!cmdf) - return; - char c; - int i = strlen(block->icon); - fgets(output+i, CMDLENGTH-i, cmdf); - i = strlen(output); -- if (delim != '\0' && --i) -+ if (delim != '\0' && i) - output[i++] = delim; - output[i++] = '\0'; - pclose(cmdf); -@@ -88,11 +106,18 @@ void getsigcmds(int signal) - - void setupsignals() - { -+ struct sigaction sa; - for(int i = 0; i < LENGTH(blocks); i++) - { - if (blocks[i].signal > 0) -+ { - signal(SIGRTMIN+blocks[i].signal, sighandler); -+ sigaddset(&sa.sa_mask, SIGRTMIN+blocks[i].signal); -+ } - } -+ sa.sa_sigaction = buttonhandler; -+ sa.sa_flags = SA_SIGINFO; -+ sigaction(SIGUSR1, &sa, NULL); - - } - #endif -@@ -152,6 +177,14 @@ void sighandler(int signum) - getsigcmds(signum-SIGRTMIN); - writestatus(); - } -+ -+void buttonhandler(int sig, siginfo_t *si, void *ucontext) -+{ -+ button = si->si_value.sival_int & 0xff; -+ getsigcmds(si->si_value.sival_int >> 8); -+ writestatus(); -+} -+ - #endif - - void termhandler(int signum) diff --git a/.local/src/slock/LICENSE b/.local/src/slock/LICENSE deleted file mode 100644 index 2e4419b7..00000000 --- a/.local/src/slock/LICENSE +++ /dev/null @@ -1,24 +0,0 @@ -MIT/X Consortium License - -© 2015-2016 Markus Teich -© 2014 Dimitris Papastamos -© 2006-2014 Anselm R Garbe -© 2014-2016 Laslo Hunhold - -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/.local/src/slock/Makefile b/.local/src/slock/Makefile deleted file mode 100644 index 0d211fb8..00000000 --- a/.local/src/slock/Makefile +++ /dev/null @@ -1,60 +0,0 @@ -# slock - simple screen locker -# See LICENSE file for copyright and license details. - -include config.mk - -SRC = slock.c ${COMPATSRC} -OBJ = ${SRC:.c=.o} - -all: options slock - -options: - @echo slock build options: - @echo "CFLAGS = ${CFLAGS}" - @echo "LDFLAGS = ${LDFLAGS}" - @echo "CC = ${CC}" - -.c.o: - @echo CC $< - @${CC} -c ${CFLAGS} $< - -${OBJ}: config.h config.mk arg.h util.h - -config.h: - @echo creating $@ from config.def.h - @cp config.def.h $@ - -slock: ${OBJ} - @echo CC -o $@ - @${CC} -o $@ ${OBJ} ${LDFLAGS} - -clean: - @echo cleaning - @rm -f slock ${OBJ} slock-${VERSION}.tar.gz - -dist: clean - @echo creating dist tarball - @mkdir -p slock-${VERSION} - @cp -R LICENSE Makefile README slock.1 config.mk \ - ${SRC} explicit_bzero.c config.def.h arg.h util.h slock-${VERSION} - @tar -cf slock-${VERSION}.tar slock-${VERSION} - @gzip slock-${VERSION}.tar - @rm -rf slock-${VERSION} - -install: all - @echo installing executable file to ${DESTDIR}${PREFIX}/bin - @mkdir -p ${DESTDIR}${PREFIX}/bin - @cp -f slock ${DESTDIR}${PREFIX}/bin - @chmod 755 ${DESTDIR}${PREFIX}/bin/slock - @echo installing manual page to ${DESTDIR}${MANPREFIX}/man1 - @mkdir -p ${DESTDIR}${MANPREFIX}/man1 - @sed "s/VERSION/${VERSION}/g" ${DESTDIR}${MANPREFIX}/man1/slock.1 - @chmod 644 ${DESTDIR}${MANPREFIX}/man1/slock.1 - -uninstall: - @echo removing executable file from ${DESTDIR}${PREFIX}/bin - @rm -f ${DESTDIR}${PREFIX}/bin/slock - @echo removing manual page from ${DESTDIR}${MANPREFIX}/man1 - @rm -f ${DESTDIR}${MANPREFIX}/man1/slock.1 - -.PHONY: all options clean dist install uninstall diff --git a/.local/src/slock/README b/.local/src/slock/README deleted file mode 100644 index dcacd01b..00000000 --- a/.local/src/slock/README +++ /dev/null @@ -1,24 +0,0 @@ -slock - simple screen locker -============================ -simple screen locker utility for X. - - -Requirements ------------- -In order to build slock you need the Xlib header files. - - -Installation ------------- -Edit config.mk to match your local setup (slock is installed into -the /usr/local namespace by default). - -Afterwards enter the following command to build and install slock -(if necessary as root): - - make clean install - - -Running slock -------------- -Simply invoke the 'slock' command. To get out of it, enter your password. diff --git a/.local/src/slock/arg.h b/.local/src/slock/arg.h deleted file mode 100644 index 0b23c53a..00000000 --- a/.local/src/slock/arg.h +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copy me if you can. - * by 20h - */ - -#ifndef ARG_H__ -#define ARG_H__ - -extern char *argv0; - -/* use main(int argc, char *argv[]) */ -#define ARGBEGIN for (argv0 = *argv, argv++, argc--;\ - argv[0] && argv[0][0] == '-'\ - && argv[0][1];\ - argc--, argv++) {\ - char argc_;\ - char **argv_;\ - int brk_;\ - if (argv[0][1] == '-' && argv[0][2] == '\0') {\ - argv++;\ - argc--;\ - break;\ - }\ - for (brk_ = 0, argv[0]++, argv_ = argv;\ - argv[0][0] && !brk_;\ - argv[0]++) {\ - if (argv_ != argv)\ - break;\ - argc_ = argv[0][0];\ - switch (argc_) - -/* Handles obsolete -NUM syntax */ -#define ARGNUM case '0':\ - case '1':\ - case '2':\ - case '3':\ - case '4':\ - case '5':\ - case '6':\ - case '7':\ - case '8':\ - case '9' - -#define ARGEND }\ - } - -#define ARGC() argc_ - -#define ARGNUMF() (brk_ = 1, estrtonum(argv[0], 0, INT_MAX)) - -#define EARGF(x) ((argv[0][1] == '\0' && argv[1] == NULL)?\ - ((x), abort(), (char *)0) :\ - (brk_ = 1, (argv[0][1] != '\0')?\ - (&argv[0][1]) :\ - (argc--, argv++, argv[0]))) - -#define ARGF() ((argv[0][1] == '\0' && argv[1] == NULL)?\ - (char *)0 :\ - (brk_ = 1, (argv[0][1] != '\0')?\ - (&argv[0][1]) :\ - (argc--, argv++, argv[0]))) - -#define LNGARG() &argv[0][0] - -#endif diff --git a/.local/src/slock/config.h b/.local/src/slock/config.h deleted file mode 100644 index fd902409..00000000 --- a/.local/src/slock/config.h +++ /dev/null @@ -1,38 +0,0 @@ -/* user and group to drop privileges to */ -static const char *user = "nobody"; -static const char *group = "nogroup"; - -static const char *colorname[NUMCOLS] = { - [INIT] = "black", /* after initialization */ - [INPUT] = "#005577", /* during input */ - [FAILED] = "#CC3333", /* wrong password */ - [PAM] = "#9400D3", /* waiting for PAM */ -}; - -/* Xresources preferences to load at startup */ -ResourcePref resources[] = { - { "color0", STRING, &colorname[INIT] }, - { "color4", STRING, &colorname[INPUT] }, - { "color1", STRING, &colorname[FAILED] }, - { "color5", STRING, &colorname[PAM] }, -}; - -/* treat a cleared input like a wrong password (color) */ -static const int failonclear = 1; - -/* Offset for the lockscreen message in pixels */ -static const int xoffset = 1920; -static const int yoffset = 0; - -/* PAM service that's used for authentication */ -static const char * pam_service = "login"; - -/* default message */ -static const char * message = "Check your xsidle.sh and xinitrc to make sure you're properly running slock"; - -/* text color */ -static const char * text_color = "#ffffff"; - -/* text size (must be a valid size) */ -static const char * font_name = "6x13"; - diff --git a/.local/src/slock/config.mk b/.local/src/slock/config.mk deleted file mode 100644 index 0524807b..00000000 --- a/.local/src/slock/config.mk +++ /dev/null @@ -1,32 +0,0 @@ -# slock version -VERSION = 1.4 - -# Customize below to fit your system - -# paths -PREFIX = /usr/local -MANPREFIX = ${PREFIX}/share/man - -X11INC = /usr/X11R6/include -X11LIB = /usr/X11R6/lib - -# includes and libs -INCS = -I. -I/usr/include -I${X11INC} -LIBS = -L/usr/lib -lc -lcrypt -L${X11LIB} -lX11 -lXext -lXrandr -lXinerama -lpam - -# flags -CPPFLAGS = -DVERSION=\"${VERSION}\" -D_DEFAULT_SOURCE -DHAVE_SHADOW_H -CFLAGS = -std=c99 -pedantic -Wall -Os ${INCS} ${CPPFLAGS} -LDFLAGS = -s ${LIBS} -COMPATSRC = explicit_bzero.c - -# On OpenBSD and Darwin remove -lcrypt from LIBS -#LIBS = -L/usr/lib -lc -L${X11LIB} -lX11 -lXext -lXrandr -# On *BSD remove -DHAVE_SHADOW_H from CPPFLAGS -# On NetBSD add -D_NETBSD_SOURCE to CPPFLAGS -#CPPFLAGS = -DVERSION=\"${VERSION}\" -D_BSD_SOURCE -D_NETBSD_SOURCE -# On OpenBSD set COMPATSRC to empty -#COMPATSRC = - -# compiler and linker -CC = cc diff --git a/.local/src/slock/explicit_bzero.c b/.local/src/slock/explicit_bzero.c deleted file mode 100644 index 3e33ca85..00000000 --- a/.local/src/slock/explicit_bzero.c +++ /dev/null @@ -1,19 +0,0 @@ -/* $OpenBSD: explicit_bzero.c,v 1.3 2014/06/21 02:34:26 matthew Exp $ */ -/* - * Public domain. - * Written by Matthew Dempsky. - */ - -#include - -__attribute__((weak)) void -__explicit_bzero_hook(void *buf, size_t len) -{ -} - -void -explicit_bzero(void *buf, size_t len) -{ - memset(buf, 0, len); - __explicit_bzero_hook(buf, len); -} diff --git a/.local/src/slock/explicit_bzero.o b/.local/src/slock/explicit_bzero.o deleted file mode 100644 index 64dc4a35..00000000 Binary files a/.local/src/slock/explicit_bzero.o and /dev/null differ diff --git a/.local/src/slock/slock b/.local/src/slock/slock deleted file mode 100755 index f43efc87..00000000 Binary files a/.local/src/slock/slock and /dev/null differ diff --git a/.local/src/slock/slock-colormessage-20200210-35633d4.diff b/.local/src/slock/slock-colormessage-20200210-35633d4.diff deleted file mode 100644 index 0ef08474..00000000 --- a/.local/src/slock/slock-colormessage-20200210-35633d4.diff +++ /dev/null @@ -1,284 +0,0 @@ -From 53ba5a8d3608ca9c9c406b12c51c2bfdfb3e01d3 Mon Sep 17 00:00:00 2001 -From: Guy Shefy -Date: Wed, 10 Feb 2021 00:17:46 +0200 -Subject: [PATCH] Add a message command with 24 bit color support - ---- - config.def.h | 9 +++ - config.mk | 2 +- - slock.1 | 7 +++ - slock.c | 154 +++++++++++++++++++++++++++++++++++++++++++++++++-- - 4 files changed, 167 insertions(+), 5 deletions(-) - -diff --git a/config.def.h b/config.def.h -index 9855e21..c2a0ab2 100644 ---- a/config.def.h -+++ b/config.def.h -@@ -10,3 +10,12 @@ static const char *colorname[NUMCOLS] = { - - /* treat a cleared input like a wrong password (color) */ - static const int failonclear = 1; -+ -+/* default message */ -+static const char * message = "Suckless: Software that sucks less."; -+ -+/* text color */ -+static const char * text_color = "#ffffff"; -+ -+/* text size (must be a valid size) */ -+static const char * font_name = "6x10"; -diff --git a/config.mk b/config.mk -index 74429ae..c4ccf66 100644 ---- a/config.mk -+++ b/config.mk -@@ -12,7 +12,7 @@ X11LIB = /usr/X11R6/lib - - # includes and libs - INCS = -I. -I/usr/include -I${X11INC} --LIBS = -L/usr/lib -lc -lcrypt -L${X11LIB} -lX11 -lXext -lXrandr -+LIBS = -L/usr/lib -lc -lcrypt -L${X11LIB} -lX11 -lXext -lXrandr -lXinerama - - # flags - CPPFLAGS = -DVERSION=\"${VERSION}\" -D_DEFAULT_SOURCE -DHAVE_SHADOW_H -diff --git a/slock.1 b/slock.1 -index 82cdcd6..946165f 100644 ---- a/slock.1 -+++ b/slock.1 -@@ -6,6 +6,8 @@ - .Sh SYNOPSIS - .Nm - .Op Fl v -+.Op Fl f -+.Op Fl m Ar message - .Op Ar cmd Op Ar arg ... - .Sh DESCRIPTION - .Nm -@@ -16,6 +18,11 @@ is executed after the screen has been locked. - .Bl -tag -width Ds - .It Fl v - Print version information to stdout and exit. -+.It Fl f -+List all valid X fonts and exit. -+.It Fl m Ar message -+Overrides default slock lock message. -+.TP - .El - .Sh SECURITY CONSIDERATIONS - To make sure a locked screen can not be bypassed by switching VTs -diff --git a/slock.c b/slock.c -index 5ae738c..b8b7fe4 100644 ---- a/slock.c -+++ b/slock.c -@@ -15,6 +15,7 @@ - #include - #include - #include -+#include - #include - #include - #include -@@ -24,6 +25,9 @@ - - char *argv0; - -+/* global count to prevent repeated error messages */ -+int count_error = 0; -+ - enum { - INIT, - INPUT, -@@ -83,6 +87,132 @@ dontkillme(void) - } - #endif - -+static int -+readescapedint(const char *str, int *i) { -+ int n = 0; -+ if (str[*i]) -+ ++*i; -+ while(str[*i] && str[*i] != ';' && str[*i] != 'm') { -+ n = 10 * n + str[*i] - '0'; -+ ++*i; -+ } -+ return n; -+} -+ -+static void -+writemessage(Display *dpy, Window win, int screen) -+{ -+ int len, line_len, width, height, s_width, s_height, i, k, tab_size, r, g, b, escaped_int, curr_line_len; -+ XGCValues gr_values; -+ XFontStruct *fontinfo; -+ XColor color, dummy; -+ XineramaScreenInfo *xsi; -+ GC gc; -+ fontinfo = XLoadQueryFont(dpy, font_name); -+ -+ if (fontinfo == NULL) { -+ if (count_error == 0) { -+ fprintf(stderr, "slock: Unable to load font \"%s\"\n", font_name); -+ fprintf(stderr, "slock: Try listing fonts with 'slock -f'\n"); -+ count_error++; -+ } -+ return; -+ } -+ -+ tab_size = 8 * XTextWidth(fontinfo, " ", 1); -+ -+ XAllocNamedColor(dpy, DefaultColormap(dpy, screen), -+ text_color, &color, &dummy); -+ -+ gr_values.font = fontinfo->fid; -+ gr_values.foreground = color.pixel; -+ gc=XCreateGC(dpy,win,GCFont+GCForeground, &gr_values); -+ -+ /* To prevent "Uninitialized" warnings. */ -+ xsi = NULL; -+ -+ /* -+ * Start formatting and drawing text -+ */ -+ -+ len = strlen(message); -+ -+ /* Max max line length (cut at '\n') */ -+ line_len = curr_line_len = 0; -+ k = 0; -+ for (i = 0; i < len; i++) { -+ if (message[i] == '\n') { -+ curr_line_len = 0; -+ k++; -+ } else if (message[i] == 0x1b) { -+ while (i < len && message[i] != 'm') { -+ i++; -+ } -+ if (i == len) -+ die("slock: unclosed escape sequence\n"); -+ } else { -+ curr_line_len += XTextWidth(fontinfo, message + i, 1); -+ if (curr_line_len > line_len) -+ line_len = curr_line_len; -+ } -+ } -+ /* If there is only one line */ -+ if (line_len == 0) -+ line_len = len; -+ -+ if (XineramaIsActive(dpy)) { -+ xsi = XineramaQueryScreens(dpy, &i); -+ s_width = xsi[0].width; -+ s_height = xsi[0].height; -+ } else { -+ s_width = DisplayWidth(dpy, screen); -+ s_height = DisplayHeight(dpy, screen); -+ } -+ height = s_height*3/7 - (k*20)/3; -+ width = (s_width - line_len)/2; -+ -+ line_len = 0; -+ /* print the text while parsing 24 bit color ANSI escape codes*/ -+ for (i = k = 0; i < len; i++) { -+ switch (message[i]) { -+ case '\n': -+ line_len = 0; -+ while (message[i + 1] == '\t') { -+ line_len += tab_size; -+ i++; -+ } -+ k++; -+ break; -+ case 0x1b: -+ i++; -+ if (message[i] == '[') { -+ escaped_int = readescapedint(message, &i); -+ if (escaped_int == 39) -+ continue; -+ if (escaped_int != 38) -+ die("slock: unknown escape sequence%d\n", escaped_int); -+ if (readescapedint(message, &i) != 2) -+ die("slock: only 24 bit color supported\n"); -+ r = readescapedint(message, &i) & 0xff; -+ g = readescapedint(message, &i) & 0xff; -+ b = readescapedint(message, &i) & 0xff; -+ XSetForeground(dpy, gc, r << 16 | g << 8 | b); -+ } else -+ die("slock: unknown escape sequence\n"); -+ break; -+ default: -+ XDrawString(dpy, win, gc, width + line_len, height + 20 * k, message + i, 1); -+ line_len += XTextWidth(fontinfo, message + i, 1); -+ } -+ } -+ -+ /* xsi should not be NULL anyway if Xinerama is active, but to be safe */ -+ if (XineramaIsActive(dpy) && xsi != NULL) -+ XFree(xsi); -+} -+ -+ -+ - static const char * - gethash(void) - { -@@ -194,6 +324,7 @@ readpw(Display *dpy, struct xrandr *rr, struct lock **locks, int nscreens, - locks[screen]->win, - locks[screen]->colors[color]); - XClearWindow(dpy, locks[screen]->win); -+ writemessage(dpy, locks[screen]->win, screen); - } - oldc = color; - } -@@ -300,7 +431,7 @@ lockscreen(Display *dpy, struct xrandr *rr, int screen) - static void - usage(void) - { -- die("usage: slock [-v] [cmd [arg ...]]\n"); -+ die("usage: slock [-v] [-f] [-m message] [cmd [arg ...]]\n"); - } - - int -@@ -313,12 +444,25 @@ main(int argc, char **argv) { - gid_t dgid; - const char *hash; - Display *dpy; -- int s, nlocks, nscreens; -+ int i, s, nlocks, nscreens; -+ int count_fonts; -+ char **font_names; - - ARGBEGIN { - case 'v': - fprintf(stderr, "slock-"VERSION"\n"); - return 0; -+ case 'm': -+ message = EARGF(usage()); -+ break; -+ case 'f': -+ if (!(dpy = XOpenDisplay(NULL))) -+ die("slock: cannot open display\n"); -+ font_names = XListFonts(dpy, "*", 10000 /* list 10000 fonts*/, &count_fonts); -+ for (i=0; iwin, s); - nlocks++; -- else -+ } else { - break; -+ } - } - XSync(dpy, 0); - --- -2.30.0 - diff --git a/.local/src/slock/slock-pam_auth-20190207-35633d4.diff b/.local/src/slock/slock-pam_auth-20190207-35633d4.diff deleted file mode 100644 index 136f4b57..00000000 --- a/.local/src/slock/slock-pam_auth-20190207-35633d4.diff +++ /dev/null @@ -1,154 +0,0 @@ -diff --git a/config.def.h b/config.def.h -index 9855e21..19e7f62 100644 ---- a/config.def.h -+++ b/config.def.h -@@ -6,7 +6,11 @@ static const char *colorname[NUMCOLS] = { - [INIT] = "black", /* after initialization */ - [INPUT] = "#005577", /* during input */ - [FAILED] = "#CC3333", /* wrong password */ -+ [PAM] = "#9400D3", /* waiting for PAM */ - }; - - /* treat a cleared input like a wrong password (color) */ - static const int failonclear = 1; -+ -+/* PAM service that's used for authentication */ -+static const char* pam_service = "login"; -diff --git a/config.mk b/config.mk -index 74429ae..6e82074 100644 ---- a/config.mk -+++ b/config.mk -@@ -12,7 +12,7 @@ X11LIB = /usr/X11R6/lib - - # includes and libs - INCS = -I. -I/usr/include -I${X11INC} --LIBS = -L/usr/lib -lc -lcrypt -L${X11LIB} -lX11 -lXext -lXrandr -+LIBS = -L/usr/lib -lc -lcrypt -L${X11LIB} -lX11 -lXext -lXrandr -lpam - - # flags - CPPFLAGS = -DVERSION=\"${VERSION}\" -D_DEFAULT_SOURCE -DHAVE_SHADOW_H -diff --git a/slock.c b/slock.c -index 5ae738c..3a8da42 100644 ---- a/slock.c -+++ b/slock.c -@@ -18,16 +18,22 @@ - #include - #include - #include -+#include -+#include - - #include "arg.h" - #include "util.h" - - char *argv0; -+static int pam_conv(int num_msg, const struct pam_message **msg, struct pam_response **resp, void *appdata_ptr); -+struct pam_conv pamc = {pam_conv, NULL}; -+char passwd[256]; - - enum { - INIT, - INPUT, - FAILED, -+ PAM, - NUMCOLS - }; - -@@ -57,6 +63,31 @@ die(const char *errstr, ...) - exit(1); - } - -+static int -+pam_conv(int num_msg, const struct pam_message **msg, -+ struct pam_response **resp, void *appdata_ptr) -+{ -+ int retval = PAM_CONV_ERR; -+ for(int i=0; imsg_style == PAM_PROMPT_ECHO_OFF && -+ strncmp(msg[i]->msg, "Password: ", 10) == 0) { -+ struct pam_response *resp_msg = malloc(sizeof(struct pam_response)); -+ if (!resp_msg) -+ die("malloc failed\n"); -+ char *password = malloc(strlen(passwd) + 1); -+ if (!password) -+ die("malloc failed\n"); -+ memset(password, 0, strlen(passwd) + 1); -+ strcpy(password, passwd); -+ resp_msg->resp_retcode = 0; -+ resp_msg->resp = password; -+ resp[i] = resp_msg; -+ retval = PAM_SUCCESS; -+ } -+ } -+ return retval; -+} -+ - #ifdef __linux__ - #include - #include -@@ -121,6 +152,8 @@ gethash(void) - } - #endif /* HAVE_SHADOW_H */ - -+ /* pam, store user name */ -+ hash = pw->pw_name; - return hash; - } - -@@ -129,11 +162,12 @@ readpw(Display *dpy, struct xrandr *rr, struct lock **locks, int nscreens, - const char *hash) - { - XRRScreenChangeNotifyEvent *rre; -- char buf[32], passwd[256], *inputhash; -- int num, screen, running, failure, oldc; -+ char buf[32]; -+ int num, screen, running, failure, oldc, retval; - unsigned int len, color; - KeySym ksym; - XEvent ev; -+ pam_handle_t *pamh; - - len = 0; - running = 1; -@@ -160,10 +194,26 @@ readpw(Display *dpy, struct xrandr *rr, struct lock **locks, int nscreens, - case XK_Return: - passwd[len] = '\0'; - errno = 0; -- if (!(inputhash = crypt(passwd, hash))) -- fprintf(stderr, "slock: crypt: %s\n", strerror(errno)); -+ retval = pam_start(pam_service, hash, &pamc, &pamh); -+ color = PAM; -+ for (screen = 0; screen < nscreens; screen++) { -+ XSetWindowBackground(dpy, locks[screen]->win, locks[screen]->colors[color]); -+ XClearWindow(dpy, locks[screen]->win); -+ XRaiseWindow(dpy, locks[screen]->win); -+ } -+ XSync(dpy, False); -+ -+ if (retval == PAM_SUCCESS) -+ retval = pam_authenticate(pamh, 0); -+ if (retval == PAM_SUCCESS) -+ retval = pam_acct_mgmt(pamh, 0); -+ -+ running = 1; -+ if (retval == PAM_SUCCESS) -+ running = 0; - else -- running = !!strcmp(inputhash, hash); -+ fprintf(stderr, "slock: %s\n", pam_strerror(pamh, retval)); -+ pam_end(pamh, retval); - if (running) { - XBell(dpy, 100); - failure = 1; -@@ -339,10 +389,9 @@ main(int argc, char **argv) { - dontkillme(); - #endif - -+ /* the contents of hash are used to transport the current user name */ - hash = gethash(); - errno = 0; -- if (!crypt("", hash)) -- die("slock: crypt: %s\n", strerror(errno)); - - if (!(dpy = XOpenDisplay(NULL))) - die("slock: cannot open display\n"); diff --git a/.local/src/slock/slock-xresources-20191126-53e56c7.diff b/.local/src/slock/slock-xresources-20191126-53e56c7.diff deleted file mode 100644 index d49d39b0..00000000 --- a/.local/src/slock/slock-xresources-20191126-53e56c7.diff +++ /dev/null @@ -1,158 +0,0 @@ -From 53e56c751b3f2be4154760788850c51dbffc0add Mon Sep 17 00:00:00 2001 -From: Arnas Udovicius -Date: Tue, 26 Nov 2019 16:16:15 +0200 -Subject: [PATCH] Read colors from Xresources - ---- - config.def.h | 14 +++++++++-- - slock.c | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++++ - util.h | 3 +++ - 3 files changed, 83 insertions(+), 2 deletions(-) - -diff --git a/config.def.h b/config.def.h -index 6288856..bfc1ba0 100644 ---- a/config.def.h -+++ b/config.def.h -@@ -3,11 +3,21 @@ static const char *user = "nobody"; - static const char *group = "nogroup"; - - static const char *colorname[NUMCOLS] = { -- [INIT] = "black", /* after initialization */ -- [INPUT] = "#005577", /* during input */ -+ [INIT] = "black", /* after initialization */ -+ [INPUT] = "#005577", /* during input */ - [FAILED] = "#CC3333", /* wrong password */ - [CAPS] = "red", /* CapsLock on */ - }; - -+/* -+ * Xresources preferences to load at startup -+ */ -+ResourcePref resources[] = { -+ { "color0", STRING, &colorname[INIT] }, -+ { "color4", STRING, &colorname[INPUT] }, -+ { "color1", STRING, &colorname[FAILED] }, -+ { "color3", STRING, &colorname[CAPS] }, -+}; -+ - /* treat a cleared input like a wrong password (color) */ - static const int failonclear = 1; -diff --git a/slock.c b/slock.c -index 5f4fb7a..2395547 100644 ---- a/slock.c -+++ b/slock.c -@@ -6,6 +6,7 @@ - - #include - #include -+#include - #include - #include - #include -@@ -19,6 +20,7 @@ - #include - #include - #include -+#include - - #include "arg.h" - #include "util.h" -@@ -46,6 +48,19 @@ struct xrandr { - int errbase; - }; - -+/* Xresources preferences */ -+enum resource_type { -+ STRING = 0, -+ INTEGER = 1, -+ FLOAT = 2 -+}; -+ -+typedef struct { -+ char *name; -+ enum resource_type type; -+ void *dst; -+} ResourcePref; -+ - #include "config.h" - - static void -@@ -306,6 +321,57 @@ lockscreen(Display *dpy, struct xrandr *rr, int screen) - return NULL; - } - -+int -+resource_load(XrmDatabase db, char *name, enum resource_type rtype, void *dst) -+{ -+ char **sdst = dst; -+ int *idst = dst; -+ float *fdst = dst; -+ -+ char fullname[256]; -+ char fullclass[256]; -+ char *type; -+ XrmValue ret; -+ -+ snprintf(fullname, sizeof(fullname), "%s.%s", "slock", name); -+ snprintf(fullclass, sizeof(fullclass), "%s.%s", "Slock", name); -+ fullname[sizeof(fullname) - 1] = fullclass[sizeof(fullclass) - 1] = '\0'; -+ -+ XrmGetResource(db, fullname, fullclass, &type, &ret); -+ if (ret.addr == NULL || strncmp("String", type, 64)) -+ return 1; -+ -+ switch (rtype) { -+ case STRING: -+ *sdst = ret.addr; -+ break; -+ case INTEGER: -+ *idst = strtoul(ret.addr, NULL, 10); -+ break; -+ case FLOAT: -+ *fdst = strtof(ret.addr, NULL); -+ break; -+ } -+ return 0; -+} -+ -+void -+config_init(Display *dpy) -+{ -+ char *resm; -+ XrmDatabase db; -+ ResourcePref *p; -+ -+ XrmInitialize(); -+ resm = XResourceManagerString(dpy); -+ if (!resm) -+ return; -+ -+ db = XrmGetStringDatabase(resm); -+ for (p = resources; p < resources + LEN(resources); p++) -+ resource_load(db, p->name, p->type, p->dst); -+} -+ - static void - usage(void) - { -@@ -364,6 +430,8 @@ main(int argc, char **argv) { - if (setuid(duid) < 0) - die("slock: setuid: %s\n", strerror(errno)); - -+ config_init(dpy); -+ - /* check for Xrandr support */ - rr.active = XRRQueryExtension(dpy, &rr.evbase, &rr.errbase); - -diff --git a/util.h b/util.h -index 6f748b8..148dbc1 100644 ---- a/util.h -+++ b/util.h -@@ -1,2 +1,5 @@ -+/* macros */ -+#define LEN(a) (sizeof(a) / sizeof(a)[0]) -+ - #undef explicit_bzero - void explicit_bzero(void *, size_t); --- -2.24.0 diff --git a/.local/src/slock/slock.1 b/.local/src/slock/slock.1 deleted file mode 100644 index 946165fa..00000000 --- a/.local/src/slock/slock.1 +++ /dev/null @@ -1,46 +0,0 @@ -.Dd 2016-08-23 -.Dt SLOCK 1 -.Sh NAME -.Nm slock -.Nd simple X screen locker -.Sh SYNOPSIS -.Nm -.Op Fl v -.Op Fl f -.Op Fl m Ar message -.Op Ar cmd Op Ar arg ... -.Sh DESCRIPTION -.Nm -is a simple X screen locker. If provided, -.Ar cmd Op Ar arg ... -is executed after the screen has been locked. -.Sh OPTIONS -.Bl -tag -width Ds -.It Fl v -Print version information to stdout and exit. -.It Fl f -List all valid X fonts and exit. -.It Fl m Ar message -Overrides default slock lock message. -.TP -.El -.Sh SECURITY CONSIDERATIONS -To make sure a locked screen can not be bypassed by switching VTs -or killing the X server with Ctrl+Alt+Backspace, it is recommended -to disable both in -.Xr xorg.conf 5 -for maximum security: -.Bd -literal -offset left -Section "ServerFlags" - Option "DontVTSwitch" "True" - Option "DontZap" "True" -EndSection -.Ed -.Sh EXAMPLES -$ -.Nm -/usr/sbin/s2ram -.Sh CUSTOMIZATION -.Nm -can be customized by creating a custom config.h from config.def.h and -(re)compiling the source code. This keeps it fast, secure and simple. diff --git a/.local/src/slock/slock.c b/.local/src/slock/slock.c deleted file mode 100644 index 04f32ebe..00000000 --- a/.local/src/slock/slock.c +++ /dev/null @@ -1,579 +0,0 @@ -/* See LICENSE file for license details. */ -#define _XOPEN_SOURCE 500 -#if HAVE_SHADOW_H -#include -#endif - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "arg.h" -#include "util.h" - -char *argv0; -static int pam_conv(int num_msg, const struct pam_message **msg, struct pam_response **resp, void *appdata_ptr); -struct pam_conv pamc = {pam_conv, NULL}; -char passwd[256]; - -/* global count to prevent repeated error messages */ -int count_error = 0; - -enum { - INIT, - INPUT, - FAILED, - PAM, - NUMCOLS -}; - -struct lock { - int screen; - Window root, win; - Pixmap pmap; - unsigned long colors[NUMCOLS]; -}; - -struct xrandr { - int active; - int evbase; - int errbase; -}; - -/* Xresources preferences */ -enum resource_type { - STRING = 0, - INTEGER = 1, - FLOAT = 2 -}; - -typedef struct { - char *name; - enum resource_type type; - void *dst; -} ResourcePref; - -#include "config.h" - -static void -die(const char *errstr, ...) -{ - va_list ap; - - va_start(ap, errstr); - vfprintf(stderr, errstr, ap); - va_end(ap); - exit(1); -} - -static int -pam_conv(int num_msg, const struct pam_message **msg, - struct pam_response **resp, void *appdata_ptr) -{ - int retval = PAM_CONV_ERR; - for(int i=0; imsg_style == PAM_PROMPT_ECHO_OFF && - strncmp(msg[i]->msg, "Password: ", 10) == 0) { - struct pam_response *resp_msg = malloc(sizeof(struct pam_response)); - if (!resp_msg) - die("malloc failed\n"); - char *password = malloc(strlen(passwd) + 1); - if (!password) - die("malloc failed\n"); - memset(password, 0, strlen(passwd) + 1); - strcpy(password, passwd); - resp_msg->resp_retcode = 0; - resp_msg->resp = password; - resp[i] = resp_msg; - retval = PAM_SUCCESS; - } - } - return retval; -} - -static int -readescapedint(const char *str, int *i) { - int n = 0; - if (str[*i]) - ++*i; - while(str[*i] && str[*i] != ';' && str[*i] != 'm') { - n = 10 * n + str[*i] - '0'; - ++*i; - } - return n; -} - -static void -writemessage(Display *dpy, Window win, int screen) -{ - int len, line_len, width, height, s_width, s_height, i, k, tab_size, r, g, b, escaped_int, curr_line_len; - XGCValues gr_values; - XFontStruct *fontinfo; - XColor color, dummy; - XineramaScreenInfo *xsi; - GC gc; - fontinfo = XLoadQueryFont(dpy, font_name); - - if (fontinfo == NULL) { - if (count_error == 0) { - fprintf(stderr, "slock: Unable to load font \"%s\"\n", font_name); - fprintf(stderr, "slock: Try listing fonts with 'slock -f'\n"); - count_error++; - } - return; - } - - tab_size = 8 * XTextWidth(fontinfo, " ", 1); - - XAllocNamedColor(dpy, DefaultColormap(dpy, screen), - text_color, &color, &dummy); - - gr_values.font = fontinfo->fid; - gr_values.foreground = color.pixel; - gc=XCreateGC(dpy,win,GCFont+GCForeground, &gr_values); - - /* To prevent "Uninitialized" warnings. */ - xsi = NULL; - - /* - * Start formatting and drawing text - */ - - len = strlen(message); - - /* Max max line length (cut at '\n') */ - line_len = curr_line_len = 0; - k = 0; - for (i = 0; i < len; i++) { - if (message[i] == '\n') { - curr_line_len = 0; - k++; - } else if (message[i] == 0x1b) { - while (i < len && message[i] != 'm') { - i++; - } - if (i == len) - die("slock: unclosed escape sequence\n"); - } else { - curr_line_len += XTextWidth(fontinfo, message + i, 1); - if (curr_line_len > line_len) - line_len = curr_line_len; - } - } - /* If there is only one line */ - if (line_len == 0) - line_len = len; - - if (XineramaIsActive(dpy)) { - xsi = XineramaQueryScreens(dpy, &i); - s_width = xsi[0].width; - s_height = xsi[0].height; - } else { - s_width = DisplayWidth(dpy, screen); - s_height = DisplayHeight(dpy, screen); - } - height = s_height*3/7 - (k*20)/3; - width = (s_width - line_len)/2; - - line_len = 0; - /* print the text while parsing 24 bit color ANSI escape codes*/ - for (i = k = 0; i < len; i++) { - switch (message[i]) { - case '\n': - line_len = 0; - while (message[i + 1] == '\t') { - line_len += tab_size; - i++; - } - k++; - break; - case 0x1b: - i++; - if (message[i] == '[') { - escaped_int = readescapedint(message, &i); - if (escaped_int == 39) - continue; - if (escaped_int != 38) - die("slock: unknown escape sequence%d\n", escaped_int); - if (readescapedint(message, &i) != 2) - die("slock: only 24 bit color supported\n"); - r = readescapedint(message, &i) & 0xff; - g = readescapedint(message, &i) & 0xff; - b = readescapedint(message, &i) & 0xff; - XSetForeground(dpy, gc, r << 16 | g << 8 | b); - } else - die("slock: unknown escape sequence\n"); - break; - default: - XDrawString(dpy, win, gc, width + line_len + xoffset, height + 20 * k + yoffset, message + i, 1); - line_len += XTextWidth(fontinfo, message + i, 1); - } - } - - /* xsi should not be NULL anyway if Xinerama is active, but to be safe */ - if (XineramaIsActive(dpy) && xsi != NULL) - XFree(xsi); -} - -static const char * -gethash(void) -{ - struct passwd *pw; - - /* Check if the current user has a password entry */ - errno = 0; - if (!(pw = getpwuid(getuid()))) { - if (errno) - die("slock: getpwuid: %s\n", strerror(errno)); - else - die("slock: cannot retrieve password entry\n"); - } - return pw->pw_name; -} - -static void -readpw(Display *dpy, struct xrandr *rr, struct lock **locks, int nscreens, - const char *hash) -{ - XRRScreenChangeNotifyEvent *rre; - char buf[32]; - int num, screen, running, failure, oldc, retval; - - unsigned int len, color; - KeySym ksym; - XEvent ev; - pam_handle_t *pamh; - - len = 0; - running = 1; - failure = 0; - oldc = INIT; - - while (running && !XNextEvent(dpy, &ev)) { - if (ev.type == KeyPress) { - explicit_bzero(&buf, sizeof(buf)); - num = XLookupString(&ev.xkey, buf, sizeof(buf), &ksym, 0); - if (IsKeypadKey(ksym)) { - if (ksym == XK_KP_Enter) - ksym = XK_Return; - else if (ksym >= XK_KP_0 && ksym <= XK_KP_9) - ksym = (ksym - XK_KP_0) + XK_0; - } - if (IsFunctionKey(ksym) || - IsKeypadKey(ksym) || - IsMiscFunctionKey(ksym) || - IsPFKey(ksym) || - IsPrivateKeypadKey(ksym)) - continue; - switch (ksym) { - case XK_Return: - passwd[len] = '\0'; - errno = 0; - retval = pam_start(pam_service, hash, &pamc, &pamh); - color = PAM; - for (screen = 0; screen < nscreens; screen++) { - XSetWindowBackground(dpy, locks[screen]->win, locks[screen]->colors[color]); - XClearWindow(dpy, locks[screen]->win); - XRaiseWindow(dpy, locks[screen]->win); - } - XSync(dpy, False); - - if (retval == PAM_SUCCESS) - retval = pam_authenticate(pamh, 0); - if (retval == PAM_SUCCESS) - retval = pam_acct_mgmt(pamh, 0); - - running = 1; - if (retval == PAM_SUCCESS) - running = 0; - else - fprintf(stderr, "slock: %s\n", pam_strerror(pamh, retval)); - pam_end(pamh, retval); - if (running) { - XBell(dpy, 100); - failure = 1; - } - explicit_bzero(&passwd, sizeof(passwd)); - len = 0; - break; - case XK_Escape: - explicit_bzero(&passwd, sizeof(passwd)); - len = 0; - break; - case XK_BackSpace: - if (len) - passwd[--len] = '\0'; - break; - default: - if (num && !iscntrl((int)buf[0]) && - (len + num < sizeof(passwd))) { - memcpy(passwd + len, buf, num); - len += num; - } - break; - } - color = len ? INPUT : ((failure || failonclear) ? FAILED : INIT); - if (running && oldc != color) { - for (screen = 0; screen < nscreens; screen++) { - XSetWindowBackground(dpy, - locks[screen]->win, - locks[screen]->colors[color]); - XClearWindow(dpy, locks[screen]->win); - writemessage(dpy, locks[screen]->win, screen); - } - oldc = color; - } - } else if (rr->active && ev.type == rr->evbase + RRScreenChangeNotify) { - rre = (XRRScreenChangeNotifyEvent*)&ev; - for (screen = 0; screen < nscreens; screen++) { - if (locks[screen]->win == rre->window) { - if (rre->rotation == RR_Rotate_90 || - rre->rotation == RR_Rotate_270) - XResizeWindow(dpy, locks[screen]->win, - rre->height, rre->width); - else - XResizeWindow(dpy, locks[screen]->win, - rre->width, rre->height); - XClearWindow(dpy, locks[screen]->win); - break; - } - } - } else { - for (screen = 0; screen < nscreens; screen++) - XRaiseWindow(dpy, locks[screen]->win); - } - } -} - -static struct lock * -lockscreen(Display *dpy, struct xrandr *rr, int screen) -{ - char curs[] = {0, 0, 0, 0, 0, 0, 0, 0}; - int i, ptgrab, kbgrab; - struct lock *lock; - XColor color, dummy; - XSetWindowAttributes wa; - Cursor invisible; - - if (dpy == NULL || screen < 0 || !(lock = malloc(sizeof(struct lock)))) - return NULL; - - lock->screen = screen; - lock->root = RootWindow(dpy, lock->screen); - - for (i = 0; i < NUMCOLS; i++) { - XAllocNamedColor(dpy, DefaultColormap(dpy, lock->screen), - colorname[i], &color, &dummy); - lock->colors[i] = color.pixel; - } - - /* init */ - wa.override_redirect = 1; - wa.background_pixel = lock->colors[INIT]; - lock->win = XCreateWindow(dpy, lock->root, 0, 0, - DisplayWidth(dpy, lock->screen), - DisplayHeight(dpy, lock->screen), - 0, DefaultDepth(dpy, lock->screen), - CopyFromParent, - DefaultVisual(dpy, lock->screen), - CWOverrideRedirect | CWBackPixel, &wa); - lock->pmap = XCreateBitmapFromData(dpy, lock->win, curs, 8, 8); - invisible = XCreatePixmapCursor(dpy, lock->pmap, lock->pmap, - &color, &color, 0, 0); - XDefineCursor(dpy, lock->win, invisible); - - /* Try to grab mouse pointer *and* keyboard for 600ms, else fail the lock */ - for (i = 0, ptgrab = kbgrab = -1; i < 6; i++) { - if (ptgrab != GrabSuccess) { - ptgrab = XGrabPointer(dpy, lock->root, False, - ButtonPressMask | ButtonReleaseMask | - PointerMotionMask, GrabModeAsync, - GrabModeAsync, None, invisible, CurrentTime); - } - if (kbgrab != GrabSuccess) { - kbgrab = XGrabKeyboard(dpy, lock->root, True, - GrabModeAsync, GrabModeAsync, CurrentTime); - } - - /* input is grabbed: we can lock the screen */ - if (ptgrab == GrabSuccess && kbgrab == GrabSuccess) { - XMapRaised(dpy, lock->win); - if (rr->active) - XRRSelectInput(dpy, lock->win, RRScreenChangeNotifyMask); - - XSelectInput(dpy, lock->root, SubstructureNotifyMask); - return lock; - } - - /* retry on AlreadyGrabbed but fail on other errors */ - if ((ptgrab != AlreadyGrabbed && ptgrab != GrabSuccess) || - (kbgrab != AlreadyGrabbed && kbgrab != GrabSuccess)) - break; - - usleep(100000); - } - - /* we couldn't grab all input: fail out */ - if (ptgrab != GrabSuccess) - fprintf(stderr, "slock: unable to grab mouse pointer for screen %d\n", - screen); - if (kbgrab != GrabSuccess) - fprintf(stderr, "slock: unable to grab keyboard for screen %d\n", - screen); - return NULL; -} - -int -resource_load(XrmDatabase db, char *name, enum resource_type rtype, void *dst) -{ - char **sdst = dst; - int *idst = dst; - float *fdst = dst; - - char fullname[256]; - char fullclass[256]; - char *type; - XrmValue ret; - - snprintf(fullname, sizeof(fullname), "%s.%s", "slock", name); - snprintf(fullclass, sizeof(fullclass), "%s.%s", "Slock", name); - fullname[sizeof(fullname) - 1] = fullclass[sizeof(fullclass) - 1] = '\0'; - - XrmGetResource(db, fullname, fullclass, &type, &ret); - if (ret.addr == NULL || strncmp("String", type, 64)) - return 1; - - switch (rtype) { - case STRING: - *sdst = ret.addr; - break; - case INTEGER: - *idst = strtoul(ret.addr, NULL, 10); - break; - case FLOAT: - *fdst = strtof(ret.addr, NULL); - break; - } - return 0; -} - -void -config_init(Display *dpy) -{ - char *resm; - XrmDatabase db; - ResourcePref *p; - - XrmInitialize(); - resm = XResourceManagerString(dpy); - if (!resm) - return; - - db = XrmGetStringDatabase(resm); - for (p = resources; p < resources + LEN(resources); p++) - resource_load(db, p->name, p->type, p->dst); -} - -static void -usage(void) -{ - die("usage: slock [-v] [-f] [-m message] [cmd [arg ...]]\n"); -} - -int -main(int argc, char **argv) { - struct xrandr rr; - struct lock **locks; - struct passwd *pwd; - struct group *grp; - uid_t duid; - gid_t dgid; - const char *hash; - Display *dpy; - int i, s, nlocks, nscreens; - int count_fonts; - char **font_names; - - ARGBEGIN { - case 'v': - fprintf(stderr, "slock-"VERSION"\n"); - return 0; - case 'm': - message = EARGF(usage()); - break; - case 'f': - if (!(dpy = XOpenDisplay(NULL))) - die("slock: cannot open display\n"); - font_names = XListFonts(dpy, "*", 10000 /* list 10000 fonts*/, &count_fonts); - for (i=0; iwin, s); - nlocks++; - } else { - break; - } - } - XSync(dpy, 0); - - /* did we manage to lock everything? */ - if (nlocks != nscreens) - return 1; - - /* run post-lock command */ - if (argc > 0) { - switch (fork()) { - case -1: - die("slock: fork failed: %s\n", strerror(errno)); - case 0: - if (close(ConnectionNumber(dpy)) < 0) - die("slock: close: %s\n", strerror(errno)); - execvp(argv[0], argv); - fprintf(stderr, "slock: execvp %s: %s\n", argv[0], strerror(errno)); - _exit(1); - } - } - - /* everything is now blank. Wait for the correct password */ - readpw(dpy, &rr, locks, nscreens, hash); - - return 0; -} - diff --git a/.local/src/slock/slock.o b/.local/src/slock/slock.o deleted file mode 100644 index 771d94b4..00000000 Binary files a/.local/src/slock/slock.o and /dev/null differ diff --git a/.local/src/slock/util.h b/.local/src/slock/util.h deleted file mode 100644 index 6b2d31db..00000000 --- a/.local/src/slock/util.h +++ /dev/null @@ -1,6 +0,0 @@ -/* macros */ -#define LEN(a) (sizeof(a) / sizeof(a)[0]) - -#undef explicit_bzero -void explicit_bzero(void *, size_t); -