diff --git a/flake.lock b/flake.lock index a687f1d..3fd2aea 100644 --- a/flake.lock +++ b/flake.lock @@ -1390,11 +1390,11 @@ "rust-overlay": "rust-overlay_2" }, "locked": { - "lastModified": 1738824893, - "narHash": "sha256-QjsYBpcCzaQ8E8hCXYuWTZS4YnUm/7WrNvjd79YOUsk=", + "lastModified": 1738867873, + "narHash": "sha256-/xJnHYYIQ3SeRqKaQEZ1VpAJA24iWUYPLIv78OygAP4=", "owner": "sxyazi", "repo": "yazi", - "rev": "b1d2be067f1270a6c5728f62c754d6b2c8fdaa4b", + "rev": "a8477059fd2c7366c31af46a44081898f938ca34", "type": "github" }, "original": { diff --git a/homes/emenel/default.nix b/homes/emenel/default.nix index db8d777..82f048b 100644 --- a/homes/emenel/default.nix +++ b/homes/emenel/default.nix @@ -22,7 +22,7 @@ gnome niri shikane - ]; + ]; home = { packages = lib.mkMerge [ @@ -342,7 +342,6 @@ }; - programs = { home-manager.enable = true; @@ -437,9 +436,7 @@ enable = true; packages = [ "com.github.tchx84.Flatseal" - "nl.hjdskes.gcolor3" "dev.qwery.AddWater" - "tv.plex.PlexDesktop" ]; }; diff --git a/homes/emenel/dotfiles/dot_config/wezterm/wezterm.lua b/homes/emenel/dotfiles/dot_config/wezterm/wezterm.lua index c9c6346..58ca070 100644 --- a/homes/emenel/dotfiles/dot_config/wezterm/wezterm.lua +++ b/homes/emenel/dotfiles/dot_config/wezterm/wezterm.lua @@ -52,15 +52,16 @@ config.font = wezterm.font { -- config.enable_scroll_bar = true config.color_scheme = 'Adventure' +-- config.color_scheme = 'Molokai' config.colors = { background = "#111111", - tab_bar = { - background = "#111111", - inactive_tab = { - fg_color = "#444444", - bg_color = "#111111" - } - } + -- tab_bar = { + -- background = "#111111", + -- inactive_tab = { + -- fg_color = "#444444", + -- bg_color = "#111111" + -- } + -- } } config.background = { @@ -77,8 +78,8 @@ config.background = { config.window_decorations = "RESIZE" config.window_padding = { - left = 12, - right = 12, + left = 6, + right = 6, top = 6, bottom = 6, } @@ -161,16 +162,16 @@ tabline.setup({ background = "#111111", tab = { active = { fg = '#eeeeee', bg = '#111111' }, - inactive = { fg = '#999999', bg = '#111111' }, - inactive_hover = { fg = '#cccccc', bg = '#111111' }, + inactive = { fg = '#999999', bg = '#222222' }, + inactive_hover = { fg = '#cccccc', bg = '#222222' }, }, normal_mode = { - a = { bg = "#111111", fg = "#eeeeee" }, - b = { bg = "#111111", fg = "#eeeeee" }, - c = { bg = "#111111", fg = "#eeeeee" }, - x = { bg = "#111111", fg = "#eeeeee" }, - y = { bg = "#111111", fg = "#eeeeee" }, - z = { bg = "#111111", fg = "#eeeeee" }, + a = { bg = "#222222", fg = "#eeeeee" }, + b = { bg = "#222222", fg = "#eeeeee" }, + c = { bg = "#222222", fg = "#eeeeee" }, + x = { bg = "#222222", fg = "#eeeeee" }, + y = { bg = "#222222", fg = "#eeeeee" }, + z = { bg = "#222222", fg = "#eeeeee" }, }, copy_mode = { b = { bg = "#222222", fg = "#eeeeee" } diff --git a/homes/emenel/dotfiles/dot_config/yazi/flavors/ayu-dark.yazi/LICENSE b/homes/emenel/dotfiles/dot_config/yazi/flavors/ayu-dark.yazi/LICENSE new file mode 100755 index 0000000..894ccc9 --- /dev/null +++ b/homes/emenel/dotfiles/dot_config/yazi/flavors/ayu-dark.yazi/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 Kamal Chandra Upreti + +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/homes/emenel/dotfiles/dot_config/yazi/flavors/ayu-dark.yazi/LICENSE-tmtheme b/homes/emenel/dotfiles/dot_config/yazi/flavors/ayu-dark.yazi/LICENSE-tmtheme new file mode 100755 index 0000000..97c6154 --- /dev/null +++ b/homes/emenel/dotfiles/dot_config/yazi/flavors/ayu-dark.yazi/LICENSE-tmtheme @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2016 Ike Ku + +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/homes/emenel/dotfiles/dot_config/yazi/flavors/ayu-dark.yazi/README.md b/homes/emenel/dotfiles/dot_config/yazi/flavors/ayu-dark.yazi/README.md new file mode 100644 index 0000000..afad50e --- /dev/null +++ b/homes/emenel/dotfiles/dot_config/yazi/flavors/ayu-dark.yazi/README.md @@ -0,0 +1,32 @@ +
+ Yazi logo +
+ +

+ Ayu Dark Flavor for Yazi +

+ +## 👀 Preview + + + +## 🎨 Installation + +```bash +ya pack -a kmlupreti/ayu-dark +``` + +## ⚙️ Usage + +Add the these lines to your `theme.toml` configuration file to use it: + +```toml +[flavor] +use = "ayu-dark" +``` + +## 📜 License + +The flavor is MIT-licensed, and the included tmTheme is also MIT-licensed. + +Check the [LICENSE](LICENSE) and [LICENSE-tmtheme](LICENSE-tmtheme) file for more details. diff --git a/homes/emenel/dotfiles/dot_config/yazi/flavors/ayu-dark.yazi/flavor.toml b/homes/emenel/dotfiles/dot_config/yazi/flavors/ayu-dark.yazi/flavor.toml new file mode 100755 index 0000000..7b9defa --- /dev/null +++ b/homes/emenel/dotfiles/dot_config/yazi/flavors/ayu-dark.yazi/flavor.toml @@ -0,0 +1,129 @@ +[manager] +cwd = { fg = "#5c6773" } + +# tab +tab_active = { fg = "#0a0e14", bg = "#c2a05c", bold = true } +tab_inactive = { fg = "#5c6773", bg = "#0a0e14" } +tab_width = 1 + +# find +find_keyword = { fg = "#1f6f88", bold = true, italic = true, underline = true } +find_position = { fg = "#1f6f88", bold = true, italic = true } + +# marker +marker_copied = { fg = "#0a0e14", bg = "#7e9350" } +marker_cut = { fg = "#0a0e14", bg = "#a85361" } +marker_marked = { fg = "#0a0e14", bg = "#1f6f88" } +marker_selected = { fg = "#0a0e14", bg = "#c2a05c" } + +# count +count_copied = { fg = "#0a0e14", bg = "#7e9350" } +count_cut = { fg = "#5c6773", bg = "#a85361" } +count_selected = { fg = "#0a0e14", bg = "#c2a05c" } + +# border +border_symbol = " " + +[mode] +normal_main = { fg = "#0a0e14", bg = "#c2a05c", bold = true } +normal_alt = { fg = "#1f6f88", bg = "#2d3640", bold = true } + +select_main = { fg = "#0a0e14", bg = "#1f6f88", bold = true } +select_alt = { fg = "#0a0e14", bg = "#1f6f88", bold = true } + +unset_main = { fg = "#0a0e14", bg = "#a85361", bold = true } +unset_alt = { fg = "#0a0e14", bg = "#a85361", bold = true } + + +[status] +separator_open = "" +separator_close = "" +separator_style = { bg = "#2d3640", fg = "#c2a05c" } + +# Progress +progress_label = { fg = "#c2a05c", bold = true } +progress_normal = { fg = "#c2a05c", bg = "#0a0e14" } +progress_error = { fg = "#a85361", bg = "#0a0e14" } + +# permissions +perm_type = { fg = "#c2c2c2" } +perm_write = { fg = "#a85361" } +perm_exec = { fg = "#7e9350" } +perm_read = { fg = "#1f6f88" } +perm_sep = { fg = "#5c6773" } + +[select] +border = { fg = "#c2a05c" } +active = { fg = "#a85361", bold = true } +inactive = { fg = "#5c6773", bg = "#0a0e14" } + +[input] +border = { fg = "#c2a05c" } +value = { fg = "#5c6773" } + +[completion] +border = { fg = "#c2a05c", bg = "#0a0e14" } + +[tasks] +border = { fg = "#c2a05c" } +title = { fg = "#5c6773" } +hovered = { fg = "#7e9350", underline = true } + +[which] +cols = 3 +mask = { bg = "#0a0e14" } +cand = { fg = "#c2a05c" } +rest = { fg = "#0a0e14" } +desc = { fg = "#5c6773" } +separator = " ⯈ " +separator_style = { fg = "#5c6773" } + +[help] +on = { fg = "#c2a05c" } +run = { fg = "#7e9350" } +footer = { fg = "#0a0e14", bg = "#5c6773" } + +[notify] +title_info = { fg = "#7e9350" } +title_warn = { fg = "#c2a05c" } +title_error = { fg = "#a85361" } + +[filetype] +rules = [ + # directories + { name = "*/", fg = "#1f6f88" }, + + # executables + { name = "*", is = "exec", fg = "#7e9350" }, + + # images + { mime = "image/*", fg = "#c2a05c" }, + + # media + { mime = "{audio,video}/*", fg = "#7e9350" }, + + # archives + { mime = "application/{,g}zip", fg = "#a85361" }, + { mime = "application/x-{tar,bzip*,7z-compressed,xz,rar}", fg = "#a85361" }, + + # documents + { mime = "application/{pdf,doc,rtf,vnd.*}", fg = "#1f6f88" }, + + # scripts and code + { mime = "application/{x-shellscript,x-python,x-ruby,x-javascript}", fg = "#c2a05c" }, + { mime = "text/x-{c,c++}", fg = "#1f6f88" }, + + # config files + { name = "*.json", fg = "#c2a05c" }, + { name = "*.yml", fg = "#1f6f88" }, + { name = "*.toml", fg = "#9464b6" }, + + # special files + { name = "*", is = "orphan", bg = "#0a0e14" }, + + # dummy files + { name = "*", is = "dummy", bg = "#0a0e14" }, + + # fallback + { name = "*/", fg = "#1f6f88" }, +] diff --git a/homes/emenel/dotfiles/dot_config/yazi/flavors/ayu-dark.yazi/preview.png b/homes/emenel/dotfiles/dot_config/yazi/flavors/ayu-dark.yazi/preview.png new file mode 100644 index 0000000..90fdab2 Binary files /dev/null and b/homes/emenel/dotfiles/dot_config/yazi/flavors/ayu-dark.yazi/preview.png differ diff --git a/homes/emenel/dotfiles/dot_config/yazi/flavors/ayu-dark.yazi/tmtheme.xml b/homes/emenel/dotfiles/dot_config/yazi/flavors/ayu-dark.yazi/tmtheme.xml new file mode 100755 index 0000000..a6d90da --- /dev/null +++ b/homes/emenel/dotfiles/dot_config/yazi/flavors/ayu-dark.yazi/tmtheme.xml @@ -0,0 +1,1025 @@ + + + + + author + Ike Ku + colorSpaceName + sRGB + name + ayu + semanticClass + ayu.dark + settings + + + settings + + accent + #F29718 + activeGuide + #363F46 + background + #0F1419 + caret + #F29718 + findHighlight + #F29718 + findHighlightForeground + #0F1419 + foreground + #BFBAB0 + guide + #20272C + gutter + #0F1419 + gutterForeground + #252D33 + inactiveBackground + #0F1419 + inactiveSelection + #131E27 + invisibles + #252D33 + lineHighlight + #0A0E12 + popupCss + html, body { + background-color: #13181D; + color: #BFBAB0; +} +body { + padding: 1px 3px; +} +a { + color: rgba(57, 186, 230, .7); +} + + selection + #16242E + selectionBorder + #192B37 + shadow + #00000010 + stackGuide + #20272C + + + + name + Comment + scope + comment, punctuation.definition.comment + settings + + fontStyle + italic + foreground + #5C6773 + + + + name + Variable + scope + variable + settings + + foreground + #BFBAB0 + + + + name + String + scope + string, constant.other.symbol + settings + + foreground + #C2D94C + + + + name + Number + scope + constant.numeric + settings + + foreground + #F29718 + + + + name + Regular Expressions and Escape Characters + scope + string.regexp, constant.character.escape + settings + + foreground + #95E6CB + + + + name + Built-in constant + scope + constant.language + settings + + foreground + #F29718 + + + + name + User-defined constant + scope + constant.character, constant.other + settings + + foreground + #F29718 + + + + name + Member Variable + scope + variable.member + settings + + foreground + #ec5f67 + + + + name + Keyword + scope + keyword - keyword.operator, keyword.operator.word + settings + + foreground + #FF7733 + + + + name + Operators + scope + keyword.operator + settings + + foreground + #F29668 + + + + name + Punctuation + scope + punctuation.separator, punctuation.terminator + settings + + foreground + #BFBAB0CC + + + + name + Punctuation + scope + punctuation.section + settings + + foreground + #BFBAB0 + + + + name + Accessor + scope + punctuation.accessor + settings + + foreground + #F29668 + + + + name + Annotation Punctuation + scope + punctuation.definition.annotation + settings + + foreground + #BFBAB0CC + + + + name + JavaScript Dollar + scope + variable.other.dollar.only.js, variable.other.object.dollar.only.js, variable.type.dollar.only.js, support.class.dollar.only.js + settings + + foreground + #E6B673 + + + + name + Storage + scope + storage + settings + + foreground + #FF7733 + + + + name + Storage type + scope + storage.type + settings + + foreground + #FF7733 + + + + name + Function name + scope + entity.name.function + settings + + foreground + #FFB454 + + + + name + Entity name + scope + entity.name - (entity.name.section | entity.name.tag | entity.name.label) + settings + + foreground + #59C2FF + + + + name + Inherited class + scope + entity.other.inherited-class + settings + + fontStyle + underline + foreground + #59C2FF + + + + name + Function argument + scope + variable.parameter + settings + + foreground + #F29718 + + + + name + Language variable + scope + variable.language + settings + + fontStyle + italic + foreground + #39BAE6 + + + + name + Tag + scope + entity.name.tag, meta.tag.sgml + settings + + foreground + #39BAE6 + + + + name + Tag start/end + scope + punctuation.definition.tag.end, punctuation.definition.tag.begin, punctuation.definition.tag + settings + + foreground + #39BAE690 + + + + name + Tag attribute + scope + entity.other.attribute-name + settings + + foreground + #FFB454 + + + + name + Function call + scope + variable.function, variable.annotation + settings + + foreground + #FFB454 + + + + name + Library function + scope + support.function, support.macro + settings + + foreground + #F07178 + + + + name + Library constant + scope + support.constant + settings + + fontStyle + italic + foreground + #F29668 + + + + name + Library class/type + scope + support.type, support.class + settings + + fontStyle + italic + foreground + #39BAE6 + + + + name + Invalid + scope + invalid + settings + + foreground + #FF3333 + + + + name + Invalid deprecated + scope + invalid.deprecated + settings + + background + #FF7733 + foreground + #FFFFFF + + + + name + diff.header + scope + meta.diff, meta.diff.header + settings + + foreground + #c594c5 + + + + name + Ruby class methods + scope + source.ruby variable.other.readwrite + settings + + foreground + #FFB454 + + + + name + CSS tag names + scope + source.css entity.name.tag, source.sass entity.name.tag, source.scss entity.name.tag, source.less entity.name.tag, source.stylus entity.name.tag + settings + + foreground + #59C2FF + + + + name + CSS browser prefix + scope + source.css support.type, source.sass support.type, source.scss support.type, source.less support.type, source.stylus support.type + settings + + foreground + #5C6773 + + + + name + CSS Properties + scope + support.type.property-name + settings + + fontStyle + normal + foreground + #39BAE6 + + + + name + Search Results Nums + scope + constant.numeric.line-number.find-in-files - match + settings + + foreground + #5C6773 + + + + name + Search Results Match Nums + scope + constant.numeric.line-number.match + settings + + foreground + #FF7733 + + + + name + Search Results Lines + scope + entity.name.filename.find-in-files + settings + + foreground + #C2D94C + + + + scope + message.error + settings + + foreground + #FF3333 + + + + name + JSON Key - Level 8 + scope + source.json meta meta meta meta meta meta meta meta meta meta meta meta meta meta meta meta.structure.dictionary.json string.quoted.double.json - meta meta meta meta meta meta meta meta meta meta meta meta meta meta meta meta.structure.dictionary.json meta.structure.dictionary.value.json string.quoted.double.json, source.json meta meta meta meta meta meta meta meta meta meta meta meta meta meta meta meta.structure.dictionary.json punctuation.definition.string - meta meta meta meta meta meta meta meta meta meta meta meta meta meta meta meta.structure.dictionary.json meta.structure.dictionary.value.json punctuation.definition.string + settings + + foreground + #39BAE6 + + + + name + JSON Key - Level 7 + scope + source.json meta meta meta meta meta meta meta meta meta meta meta meta meta meta.structure.dictionary.json string.quoted.double.json - meta meta meta meta meta meta meta meta meta meta meta meta meta meta.structure.dictionary.json meta.structure.dictionary.value.json string.quoted.double.json, source.json meta meta meta meta meta meta meta meta meta meta meta meta meta meta.structure.dictionary.json punctuation.definition.string - meta meta meta meta meta meta meta meta meta meta meta meta meta meta.structure.dictionary.json meta.structure.dictionary.value.json punctuation.definition.string + settings + + foreground + #39BAE6 + + + + name + JSON Key - Level 6 + scope + source.json meta meta meta meta meta meta meta meta meta meta meta meta.structure.dictionary.json string.quoted.double.json - meta meta meta meta meta meta meta meta meta meta meta meta.structure.dictionary.json meta.structure.dictionary.value.json string.quoted.double.json, source.json meta meta meta meta meta meta meta meta meta meta meta meta.structure.dictionary.json punctuation.definition.string - meta meta meta meta meta meta meta meta meta meta meta meta.structure.dictionary.json meta.structure.dictionary.value.json punctuation.definition.string + settings + + foreground + #39BAE6 + + + + name + JSON Key - Level 5 + scope + source.json meta meta meta meta meta meta meta meta meta meta.structure.dictionary.json string.quoted.double.json - meta meta meta meta meta meta meta meta meta meta.structure.dictionary.json meta.structure.dictionary.value.json string.quoted.double.json, source.json meta meta meta meta meta meta meta meta meta meta.structure.dictionary.json punctuation.definition.string - meta meta meta meta meta meta meta meta meta meta.structure.dictionary.json meta.structure.dictionary.value.json punctuation.definition.string + settings + + foreground + #39BAE6 + + + + name + JSON Key - Level 4 + scope + source.json meta meta meta meta meta meta meta meta.structure.dictionary.json string.quoted.double.json - meta meta meta meta meta meta meta meta.structure.dictionary.json meta.structure.dictionary.value.json string.quoted.double.json, source.json meta meta meta meta meta meta meta meta.structure.dictionary.json punctuation.definition.string - meta meta meta meta meta meta meta meta.structure.dictionary.json meta.structure.dictionary.value.json punctuation.definition.string + settings + + foreground + #39BAE6 + + + + name + JSON Key - Level 3 + scope + source.json meta meta meta meta meta meta.structure.dictionary.json string.quoted.double.json - meta meta meta meta meta meta.structure.dictionary.json meta.structure.dictionary.value.json string.quoted.double.json, source.json meta meta meta meta meta meta.structure.dictionary.json punctuation.definition.string - meta meta meta meta meta meta.structure.dictionary.json meta.structure.dictionary.value.json punctuation.definition.string + settings + + foreground + #39BAE6 + + + + name + JSON Key - Level 2 + scope + source.json meta meta meta meta.structure.dictionary.json string.quoted.double.json - meta meta meta meta.structure.dictionary.json meta.structure.dictionary.value.json string.quoted.double.json, source.json meta meta meta meta.structure.dictionary.json punctuation.definition.string - meta meta meta meta.structure.dictionary.json meta.structure.dictionary.value.json punctuation.definition.string + settings + + foreground + #39BAE6 + + + + name + JSON Key - Level 1 + scope + source.json meta meta.structure.dictionary.json string.quoted.double.json - meta meta.structure.dictionary.json meta.structure.dictionary.value.json string.quoted.double.json, source.json meta meta.structure.dictionary.json punctuation.definition.string - meta meta.structure.dictionary.json meta.structure.dictionary.value.json punctuation.definition.string + settings + + foreground + #39BAE6 + + + + name + JSON Key - Level 0 + scope + source.json meta.structure.dictionary.json string.quoted.double.json - meta.structure.dictionary.json meta.structure.dictionary.value.json string.quoted.double.json, source.json meta.structure.dictionary.json punctuation.definition.string - meta.structure.dictionary.json meta.structure.dictionary.value.json punctuation.definition.string + settings + + foreground + #39BAE6 + + + + name + Markup Heading + scope + markup.heading + settings + + fontStyle + bold + foreground + #FF7733 + + + + name + Markup Links + scope + string.other.link, markup.underline.link + settings + + fontStyle + italic underline + foreground + #95E6CB + + + + name + Markup image + scope + punctuation.definition.image + settings + + foreground + #FFB454 + + + + name + Markup Italic + scope + markup.italic + settings + + fontStyle + italic + foreground + #F07178 + + + + name + Markup Bold + scope + markup.bold + settings + + fontStyle + bold + foreground + #F07178 + + + + name + Markup Bold/italic + scope + markup.italic markup.bold | markup.bold markup.italic + settings + + fontStyle + bold italic + + + + name + Markup Code + scope + markup.raw + settings + + background + #BFBAB007 + + + + name + Markup Code Inline + scope + markup.raw.inline + settings + + background + #BFBAB010 + + + + name + Markdown Separator + scope + meta.separator + settings + + background + #BFBAB010 + fontStyle + bold + foreground + #5C6773 + + + + name + Markup Blockquote + scope + markup.quote + settings + + fontStyle + italic + foreground + #F29718 + + + + name + Markup List Bullet + scope + markup.list.numbered.bullet, markup.list punctuation.definition.list_item + settings + + foreground + #95E6CB + + + + name + Markup Inserted + scope + markup.inserted + settings + + foreground + #C2D94C + + + + name + Markup Changed + scope + markup.changed + settings + + foreground + #39BAE6 + + + + name + Markup Deleted + scope + markup.deleted + settings + + foreground + #F07178 + + + + name + Markup Strike + scope + markup.strike + settings + + foreground + #E6B673 + + + + name + Markup Table + scope + markup.table + settings + + background + #BFBAB010 + foreground + #39BAE6 + + + + name + Markup Raw Inline + scope + text.html.markdown markup.raw.inline + settings + + foreground + #F29668 + + + + name + Markdown - Line Break + scope + text.html.markdown meta.dummy.line-break + settings + + foreground + #5C6773 + + + + name + Markdown - Raw Block Fenced + scope + markup.raw.block.fenced.markdown + settings + + background + #BFBAB010 + foreground + #BFBAB0 + + + + name + Markdown - Fenced Bode Block + scope + punctuation.definition.fenced.markdown, variable.language.fenced.markdown + settings + + background + #BFBAB010 + foreground + #5C6773 + + + + name + Markdown - Fenced Language + scope + variable.language.fenced.markdown + settings + + foreground + #5C6773 + + + + name + GitGutter Added + scope + markup.inserted.git_gutter + settings + + foreground + #C2D94C + + + + name + GitGutter Changed + scope + markup.changed.git_gutter + settings + + foreground + #39BAE6 + + + + name + GitGutter Deleted + scope + markup.deleted.git_gutter + settings + + foreground + #FF3333 + + + + name + GitGutter Ignored + scope + markup.ignored.git_gutter + settings + + foreground + #20272C + + + + name + GitGutter Untracked + scope + markup.untracked.git_gutter + settings + + foreground + #20272C + + + + name + GutterColor + scope + gutter_color + settings + + foreground + #FFFFFF + + + + name + AceJump Label - Blue + scope + acejump.label.blue + settings + + background + #39BAE6 + foreground + #FFFFFF + + + + name + AceJump Label - Green + scope + acejump.label.green + settings + + background + #C2D94C + foreground + #FFFFFF + + + + name + AceJump Label - Orange + scope + acejump.label.orange + settings + + background + #FF7733 + foreground + #FFFFFF + + + + name + AceJump Label - Purple + scope + acejump.label.purple + settings + + background + #F07178 + foreground + #FFFFFF + + + + name + SublimeLinter Warning + scope + sublimelinter.mark.warning + settings + + foreground + #39BAE6 + + + + name + SublimeLinter Gutter Mark + scope + sublimelinter.gutter-mark + settings + + foreground + #FFFFFF + + + + name + SublimeLinter Error + scope + sublimelinter.mark.error + settings + + foreground + #FF3333 + + + + uuid + 0e709986-46a0-40a0-b3bf-c8dfe525c455 + + diff --git a/homes/emenel/dotfiles/dot_config/yazi/flavors/kanagawa-dragon.yazi/LICENSE b/homes/emenel/dotfiles/dot_config/yazi/flavors/kanagawa-dragon.yazi/LICENSE new file mode 100644 index 0000000..1b1dfdc --- /dev/null +++ b/homes/emenel/dotfiles/dot_config/yazi/flavors/kanagawa-dragon.yazi/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 Dmitry Nefedov + +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/homes/emenel/dotfiles/dot_config/yazi/flavors/kanagawa-dragon.yazi/LICENSE-tmtheme b/homes/emenel/dotfiles/dot_config/yazi/flavors/kanagawa-dragon.yazi/LICENSE-tmtheme new file mode 100644 index 0000000..1b1dfdc --- /dev/null +++ b/homes/emenel/dotfiles/dot_config/yazi/flavors/kanagawa-dragon.yazi/LICENSE-tmtheme @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 Dmitry Nefedov + +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/homes/emenel/dotfiles/dot_config/yazi/flavors/kanagawa-dragon.yazi/README.md b/homes/emenel/dotfiles/dot_config/yazi/flavors/kanagawa-dragon.yazi/README.md new file mode 100644 index 0000000..7616fd8 --- /dev/null +++ b/homes/emenel/dotfiles/dot_config/yazi/flavors/kanagawa-dragon.yazi/README.md @@ -0,0 +1,32 @@ +
+ Yazi logo +
+ +

+ Kanagawa Dragon Flavor for Yazi +

+ +## 👀 Preview + + + +## 🎨 Installation + +```bash +ya pack -a marcosvnmelo/kanagawa-dragon +``` + +## ⚙️ Usage + +Add these lines to your `theme.toml` configuration file to use it: + +```toml +[flavor] +use = "kanagawa-dragon" +``` + +## 📜 License + +The flavor is MIT-licensed, and the included tmTheme is also MIT-licensed. + +Check the [LICENSE](LICENSE) and [LICENSE-tmtheme](LICENSE-tmtheme) file for more details. diff --git a/homes/emenel/dotfiles/dot_config/yazi/flavors/kanagawa-dragon.yazi/flavor.toml b/homes/emenel/dotfiles/dot_config/yazi/flavors/kanagawa-dragon.yazi/flavor.toml new file mode 100644 index 0000000..191a107 --- /dev/null +++ b/homes/emenel/dotfiles/dot_config/yazi/flavors/kanagawa-dragon.yazi/flavor.toml @@ -0,0 +1,100 @@ +# general +[manager] +marker_copied = { fg = "#87a987", bg = "#87a987" } # green +marker_cut = { fg = "#e46876", bg = "#e46876" } # red +marker_marked = { fg = "#a292a3", bg = "#a292a3" } # magenta +marker_selected = { fg = "#b6927b", bg = "#b6927b" } # cyan + +cwd = { fg = "#e6c384" } # yellow +hovered = { reversed = true } +preview_hovered = { reversed = true } + +tab_active = { reversed = true } +tab_inactive = {} +tab_width = 1 + +# default bg +count_copied = { fg = "#1f1f28", bg = "#87a987" } # green +count_cut = { fg = "#1f1f28", bg = "#e46876" } # red +count_selected = { fg = "#1f1f28", bg = "#e6c384" } # yellow + +border_symbol = "│" +border_style = { fg = "#c5c9c5"} # white + +# status-line +[status] +separator_open = "" +separator_close = "" +separator_style = { fg = "reset", bg = "#363646" } # light bg + +# default bg +mode_normal = { fg = "#1f1f28", bg = "#8ba4b0", bold = true } # blue +mode_select = { fg = "#1f1f28", bg = "#a292a3", bold = true } # magenta +mode_unset = { fg = "#1f1f28", bg = "#e6c384", bold = true } # yellow + +# blue - light bg +progress_label = { fg = "#8ba4b0", bg = "#363646", bold = true } +# light bg - default bg +progress_normal = { fg = "#363646", bg = "#1f1f28" } +progress_error = { fg = "#363646", bg = "#1f1f28" } + +permissions_t = { fg = "#87a987" } # green +permissions_r = { fg = "#e6c384" } # yellow +permissions_w = { fg = "#E46876" } # red +permissions_x = { fg = "#7aa89f" } # cyan +permissions_s = { fg = "#938aa9" } # magenta + +[select] +border = { fg = "#7fb4ca" } # blue +active = { fg = "#938aa9", bold = true } # magenta +inactive = {} + +[input] +border = { fg = "#7fb4ca" } # blue +title = {} +value = {} +selected = { reversed = true } + +[completion] +border = { fg = "#7fb4ca" } # blue +active = { reversed = true } +inactive = {} + +[tasks] +border = { fg = "#7fb4ca" } # blue +title = {} +hovered = { fg = "#938aa9" } # magenta + +[which] +cols = 2 +separator = " - " +separator_style = { fg = "#727169" } # darkgrey +mask = { bg = "#16161d" } # dark bg +rest = { fg = "#727169" } # darkgrey +cand = { fg = "#8ba4b0" } +desc = { fg = "#565666" } + +[help] +on = { fg = "#7aa89f" } # cyan +run = { fg = "#938aa9" } # magenta +desc = {} +hovered = { reversed = true, bold = true } +footer = { fg = "#090618", bg = "#c5c9c5" } # white + +[notify] +title_info = { fg = "#87a987" } # green +title_warn = { fg = "#e6c384" } # yellow +title_error = { fg = "#E46876" } # red + +# files +[filetype] +rules = [ + { mime = "image/*", fg = "#e6c384" }, + { mime = "{audio,video}/*", fg = "#a292a3" }, + { mime = "application/{,g}zip", fg = "#e46876" }, + { mime = "application/x-{tar,bzip*,7z-compressed,xz,rar}", fg = "#e46876" }, + { mime = "application/{pdf,doc,rtf,vnd.*}", fg = "#6a9589" }, + { name = "*", is = "orphan", fg = "#e46876" }, + { name = "*", is = "exec", fg = "#a292a3" }, + { name = "*/", fg = "#8ba4b0"} +] diff --git a/homes/emenel/dotfiles/dot_config/yazi/flavors/kanagawa-dragon.yazi/preview.png b/homes/emenel/dotfiles/dot_config/yazi/flavors/kanagawa-dragon.yazi/preview.png new file mode 100644 index 0000000..4e662ca Binary files /dev/null and b/homes/emenel/dotfiles/dot_config/yazi/flavors/kanagawa-dragon.yazi/preview.png differ diff --git a/homes/emenel/dotfiles/dot_config/yazi/flavors/kanagawa-dragon.yazi/tmtheme.xml b/homes/emenel/dotfiles/dot_config/yazi/flavors/kanagawa-dragon.yazi/tmtheme.xml new file mode 100644 index 0000000..4a38718 --- /dev/null +++ b/homes/emenel/dotfiles/dot_config/yazi/flavors/kanagawa-dragon.yazi/tmtheme.xml @@ -0,0 +1,448 @@ + + + + + name + Kanagawa Dragon + settings + + + settings + + background + #1F1F28 + caret + #C8C093 + foreground + #c5c9c5 + invisibles + #54546D + lineHighlight + #2D4F67 + selection + #2D4F67 + findHighlight + #2D4F67 + selectionBorder + #222218 + gutterForeground + #54546D + + + + name + Comment + scope + comment + settings + + foreground + #a6a69c + + + + name + String + scope + string + settings + + foreground + #87a987 + + + + name + Number + scope + constant.numeric + settings + + foreground + #D27E99 + + + + name + Built-in constant + scope + constant.language + settings + + foreground + #b6927b + + + + name + User-defined constant + scope + constant.character, constant.other + settings + + foreground + #E6C384 + + + + name + Variable + scope + variable + settings + + fontStyle + #E6C384 + + + + name + Ruby's @variable + scope + variable.other.readwrite.instance + settings + + fontStyle + + foreground + #E6C384 + + + + name + String interpolation + scope + constant.character.escaped, constant.character.escape, string source, string source.ruby + settings + + fontStyle + + foreground + #c4b28a + + + + name + Keyword + scope + keyword + settings + + foreground + #E46876 + + + + name + Storage + scope + storage + settings + + fontStyle + + foreground + #a292a3 + + + + name + Storage type + scope + storage.type + settings + + foreground + #a292a3 + + + + name + Class name + scope + entity.name.class + settings + + foreground + #7AA89F + + + + name + Inherited class + scope + entity.other.inherited-class + settings + + foreground + #7AA89F + + + + name + Function name + scope + entity.name.function + settings + + fontStyle + + foreground + #8ba4b0 + + + + name + Function argument + scope + variable.parameter + settings + + foreground + #b8b4d0 + + + + name + Tag name + scope + entity.name.tag + settings + + fontStyle + + foreground + #7FB4CA + + + + name + Tag attribute + scope + entity.other.attribute-name + settings + + fontStyle + + foreground + #E6C384 + + + + name + Library function + scope + support.function + settings + + fontStyle + + foreground + #7FB4CA + + + + name + Library constant + scope + support.constant + settings + + fontStyle + + foreground + #7FB4CA + + + + name + Library class/type + scope + support.type, support.class + settings + + foreground + #7AA89F + + + + name + Library variable + scope + support.other.variable + settings + + foreground + #b6927b + + + + name + Invalid + scope + invalid + settings + + fontStyle + + foreground + #b98d7b + + + + name + Invalid deprecated + scope + invalid.deprecated + settings + + foreground + #717C7C + + + + name + JSON String + scope + meta.structure.dictionary.json string.quoted.double.json + settings + + foreground + #a292a3 + + + + name + diff.header + scope + meta.diff, meta.diff.header + settings + + foreground + #8ba4b0 + + + + name + diff.deleted + scope + markup.deleted + settings + + background + #43242B + + + + name + diff.inserted + scope + markup.inserted + settings + + background + #2B3328 + + + + name + diff.changed + scope + markup.changed + settings + + background + #49443C + + + + scope + constant.numeric.line-number.find-in-files - match + settings + + foreground + #54546D + + + + scope + entity.name.filename + settings + + foreground + #C8C093 + + + + scope + message.error + settings + + foreground + #E46876 + + + + name + JSON Punctuation + scope + punctuation.definition.string.begin.json - meta.structure.dictionary.value.json, punctuation.definition.string.end.json - meta.structure.dictionary.value.json + settings + + foreground + #9CABCA + + + + name + JSON Structure + scope + meta.structure.dictionary.json string.quoted.double.json + settings + + foreground + #a292a3 + + + + name + JSON String + scope + meta.structure.dictionary.value.json string.quoted.double.json + settings + + foreground + #ffffff + + + + name + Escape Characters + scope + constant.character.escape + settings + + foreground + #b98d7b + + + + name + Regular Expressions + scope + string.regexp + settings + + foreground + #E6C384 + + + + uuid + 592FC036-6BB7-4676-A2F5-2894D48C8E33 + colorSpaceName + sRGB + semanticClass + theme.dark.kanagawa-dragon + + diff --git a/homes/emenel/dotfiles/dot_config/yazi/flavors/kanagawa.yazi/LICENSE b/homes/emenel/dotfiles/dot_config/yazi/flavors/kanagawa.yazi/LICENSE new file mode 100644 index 0000000..1b1dfdc --- /dev/null +++ b/homes/emenel/dotfiles/dot_config/yazi/flavors/kanagawa.yazi/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 Dmitry Nefedov + +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/homes/emenel/dotfiles/dot_config/yazi/flavors/kanagawa.yazi/LICENSE-tmtheme b/homes/emenel/dotfiles/dot_config/yazi/flavors/kanagawa.yazi/LICENSE-tmtheme new file mode 100644 index 0000000..1b1dfdc --- /dev/null +++ b/homes/emenel/dotfiles/dot_config/yazi/flavors/kanagawa.yazi/LICENSE-tmtheme @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 Dmitry Nefedov + +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/homes/emenel/dotfiles/dot_config/yazi/flavors/kanagawa.yazi/README.md b/homes/emenel/dotfiles/dot_config/yazi/flavors/kanagawa.yazi/README.md new file mode 100644 index 0000000..5211d9d --- /dev/null +++ b/homes/emenel/dotfiles/dot_config/yazi/flavors/kanagawa.yazi/README.md @@ -0,0 +1,32 @@ +
+ Yazi logo +
+ +

+ Kanagawa Flavor for Yazi +

+ +## 👀 Preview + + + +## 🎨 Installation + +```bash +ya pack -a dangooddd/kanagawa +``` + +## ⚙️ Usage + +Add these lines to your `theme.toml` configuration file to use it: + +```toml +[flavor] +dark = "kanagawa" +``` + +## 📜 License + +The flavor is MIT-licensed, and the included tmTheme is also MIT-licensed. + +Check the [LICENSE](LICENSE) and [LICENSE-tmtheme](LICENSE-tmtheme) file for more details. diff --git a/homes/emenel/dotfiles/dot_config/yazi/flavors/kanagawa.yazi/flavor.toml b/homes/emenel/dotfiles/dot_config/yazi/flavors/kanagawa.yazi/flavor.toml new file mode 100644 index 0000000..5090402 --- /dev/null +++ b/homes/emenel/dotfiles/dot_config/yazi/flavors/kanagawa.yazi/flavor.toml @@ -0,0 +1,136 @@ +## Color palette +## Check https://github.com/rebelot/kanagawa.nvim for more details +# sumiInk0 "#16161d" +# sumiInk3 "#1f1f28" bg +# sumiInk4 "#2a2a37" +# sumiInk6 "#54546d" +# fujiWhite "#dcd7ba" fg +# fujiGray "#727169" +# peachRed "#ff5d62" +# autumnRed "#c34043" +# crystalBlue "#7e9cd8" +# waveRed "#e46876" +# carpYellow "#e6c384" +# springGreen "#98bb6c" +# autumnGreen "#76946a" +# oniViolet "#957fb8" +# waveAqua1 "#6a9589" +# surimiOrange "#ffa066" +# waveAqua2 "#7aa89f" + +[manager] +marker_copied = { fg = "#98bb6c", bg = "#98bb6c" } +marker_cut = { fg = "#e46876", bg = "#e46876" } +marker_marked = { fg = "#957fb8", bg = "#957fb8" } +marker_selected = { fg = "#ffa066", bg = "#ffa066" } + +cwd = { fg = "#e6c384" } +hovered = { reversed = true } +preview_hovered = { reversed = true } + +find_keyword = { fg = "#ffa066", bg = "#1f1f28" } +find_position = {} + +tab_active = { reversed = true } +tab_inactive = {} +tab_width = 1 + +count_copied = { fg = "#1f1f28", bg = "#98bb6c" } +count_cut = { fg = "#1f1f28", bg = "#e46876" } +count_selected = { fg = "#1f1f28", bg = "#e6c384" } + +border_symbol = "│" +border_style = { fg = "#dcd7ba" } + + +[mode] +normal_main = { fg = "#1f1f28", bg = "#7e9cd8" } +normal_alt = { fg = "#7e9cd8", bg = "#2a2a37" } +select_main = { fg = "#1f1f28", bg = "#957fb8" } +select_alt = { fg = "#957fb8", bg = "#2a2a37" } +unset_main = { fg = "#1f1f28", bg = "#e6c384" } +unset_alt = { fg = "#e6c384", bg = "#2a2a37" } + + +[status] +separator_open = "" +separator_close = "" +separator_style = { fg = "reset", bg = "#2a2a37" } + +progress_label = { fg = "#7e9cd8", bg = "#2a2a37", bold = true } +progress_normal = { fg = "#2a2a37", bg = "#1f1f28" } +progress_error = { fg = "#2a2a37", bg = "#1f1f28" } + +perm_type = { fg = "#98bb6c" } +perm_read = { fg = "#e6c384" } +perm_write = { fg = "#ff5d62" } +perm_exec = { fg = "#7aa89f" } +perm_sep = { fg = "#957fb8" } + + +[pick] +border = { fg = "#7fb4ca" } +active = { fg = "#957fb8", bold = true } +inactive = {} + +[input] +border = { fg = "#7fb4ca" } +title = {} +value = {} +selected = { reversed = true } + +[completion] +border = { fg = "#7fb4ca" } +active = { reversed = true } +inactive = {} + +[tasks] +border = { fg = "#7fb4ca" } +title = {} +hovered = { fg = "#957fb8" } + +[which] +cols = 2 +separator = " - " +separator_style = { fg = "#727169" } +mask = { bg = "#16161d" } +rest = { fg = "#727169" } +cand = { fg = "#7e9cd8" } +desc = { fg = "#54546d" } + +[help] +on = { fg = "#7aa89f" } +run = { fg = "#957fb8" } +desc = {} +hovered = { reversed = true, bold = true } +footer = { fg = "#1f1f28", bg = "#dcd7ba" } + +[notify] +title_info = { fg = "#98bb6c" } +title_warn = { fg = "#e6c384" } +title_error = { fg = "#ff5d62" } + +[filetype] +rules = [ + # images + { mime = "image/*", fg = "#e6c384" }, + + # media + { mime = "{audio,video}/*", fg = "#957fb8" }, + + # archives + { mime = "application/{zip,rar,7z*,tar,gzip,xz,zstd,bzip*,lzma,compress,archive,cpio,arj,xar,ms-cab*}", fg = "#e46876" }, + + # documents + { mime = "application/{pdf,doc,rtf,vnd.*}", fg = "#6a9589" }, + + # broken links + { name = "*", is = "orphan", fg = "#c34043" }, + + # executables + { name = "*", is = "exec", fg = "#76946a" }, + + # fallback + { name = "*", fg = "#dcd7ba" }, + { name = "*/", fg = "#7e9cd8" }, +] diff --git a/homes/emenel/dotfiles/dot_config/yazi/flavors/kanagawa.yazi/preview.png b/homes/emenel/dotfiles/dot_config/yazi/flavors/kanagawa.yazi/preview.png new file mode 100644 index 0000000..3d61c5e Binary files /dev/null and b/homes/emenel/dotfiles/dot_config/yazi/flavors/kanagawa.yazi/preview.png differ diff --git a/homes/emenel/dotfiles/dot_config/yazi/flavors/kanagawa.yazi/tmtheme.xml b/homes/emenel/dotfiles/dot_config/yazi/flavors/kanagawa.yazi/tmtheme.xml new file mode 100644 index 0000000..737e459 --- /dev/null +++ b/homes/emenel/dotfiles/dot_config/yazi/flavors/kanagawa.yazi/tmtheme.xml @@ -0,0 +1,448 @@ + + + + + name + Kanagawa + settings + + + settings + + background + #1F1F28 + caret + #C8C093 + foreground + #DCD7BA + invisibles + #54546D + lineHighlight + #2D4F67 + selection + #2D4F67 + findHighlight + #2D4F67 + selectionBorder + #222218 + gutterForeground + #54546D + + + + name + Comment + scope + comment + settings + + foreground + #727169 + + + + name + String + scope + string + settings + + foreground + #98BB6C + + + + name + Number + scope + constant.numeric + settings + + foreground + #D27E99 + + + + name + Built-in constant + scope + constant.language + settings + + foreground + #FFA066 + + + + name + User-defined constant + scope + constant.character, constant.other + settings + + foreground + #E6C384 + + + + name + Variable + scope + variable + settings + + fontStyle + #E6C384 + + + + name + Ruby's @variable + scope + variable.other.readwrite.instance + settings + + fontStyle + + foreground + #E6C384 + + + + name + String interpolation + scope + constant.character.escaped, constant.character.escape, string source, string source.ruby + settings + + fontStyle + + foreground + #C0A36E + + + + name + Keyword + scope + keyword + settings + + foreground + #E46876 + + + + name + Storage + scope + storage + settings + + fontStyle + + foreground + #957FB8 + + + + name + Storage type + scope + storage.type + settings + + foreground + #957FB8 + + + + name + Class name + scope + entity.name.class + settings + + foreground + #7AA89F + + + + name + Inherited class + scope + entity.other.inherited-class + settings + + foreground + #7AA89F + + + + name + Function name + scope + entity.name.function + settings + + fontStyle + + foreground + #7E9CD8 + + + + name + Function argument + scope + variable.parameter + settings + + foreground + #b8b4d0 + + + + name + Tag name + scope + entity.name.tag + settings + + fontStyle + + foreground + #7FB4CA + + + + name + Tag attribute + scope + entity.other.attribute-name + settings + + fontStyle + + foreground + #E6C384 + + + + name + Library function + scope + support.function + settings + + fontStyle + + foreground + #7FB4CA + + + + name + Library constant + scope + support.constant + settings + + fontStyle + + foreground + #7FB4CA + + + + name + Library class/type + scope + support.type, support.class + settings + + foreground + #7AA89F + + + + name + Library variable + scope + support.other.variable + settings + + foreground + #FFA066 + + + + name + Invalid + scope + invalid + settings + + fontStyle + + foreground + #FF5D62 + + + + name + Invalid deprecated + scope + invalid.deprecated + settings + + foreground + #717C7C + + + + name + JSON String + scope + meta.structure.dictionary.json string.quoted.double.json + settings + + foreground + #957FB8 + + + + name + diff.header + scope + meta.diff, meta.diff.header + settings + + foreground + #7E9CD8 + + + + name + diff.deleted + scope + markup.deleted + settings + + background + #43242B + + + + name + diff.inserted + scope + markup.inserted + settings + + background + #2B3328 + + + + name + diff.changed + scope + markup.changed + settings + + background + #49443C + + + + scope + constant.numeric.line-number.find-in-files - match + settings + + foreground + #54546D + + + + scope + entity.name.filename + settings + + foreground + #C8C093 + + + + scope + message.error + settings + + foreground + #E82424 + + + + name + JSON Punctuation + scope + punctuation.definition.string.begin.json - meta.structure.dictionary.value.json, punctuation.definition.string.end.json - meta.structure.dictionary.value.json + settings + + foreground + #9CABCA + + + + name + JSON Structure + scope + meta.structure.dictionary.json string.quoted.double.json + settings + + foreground + #957FB8 + + + + name + JSON String + scope + meta.structure.dictionary.value.json string.quoted.double.json + settings + + foreground + #ffffff + + + + name + Escape Characters + scope + constant.character.escape + settings + + foreground + #FF5D62 + + + + name + Regular Expressions + scope + string.regexp + settings + + foreground + #E6C384 + + + + uuid + 592FC036-6BB7-4676-A2F5-2894D48C8E33 + colorSpaceName + sRGB + semanticClass + theme.dark.kanagawa + + diff --git a/homes/emenel/dotfiles/dot_config/yazi/flavors/moonfly.yazi/LICENSE b/homes/emenel/dotfiles/dot_config/yazi/flavors/moonfly.yazi/LICENSE new file mode 100644 index 0000000..01f679a --- /dev/null +++ b/homes/emenel/dotfiles/dot_config/yazi/flavors/moonfly.yazi/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 Tomasz Kapias + +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/homes/emenel/dotfiles/dot_config/yazi/flavors/moonfly.yazi/LICENSE-tmtheme b/homes/emenel/dotfiles/dot_config/yazi/flavors/moonfly.yazi/LICENSE-tmtheme new file mode 100644 index 0000000..13228c2 --- /dev/null +++ b/homes/emenel/dotfiles/dot_config/yazi/flavors/moonfly.yazi/LICENSE-tmtheme @@ -0,0 +1,22 @@ +MIT License + +Copyright (c) 2018-2021 bat-developers (https://github.com/sharkdp/bat) and +Copyright (c) 2021 fly16-bat authors + +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/homes/emenel/dotfiles/dot_config/yazi/flavors/moonfly.yazi/README.md b/homes/emenel/dotfiles/dot_config/yazi/flavors/moonfly.yazi/README.md new file mode 100644 index 0000000..95fdd28 --- /dev/null +++ b/homes/emenel/dotfiles/dot_config/yazi/flavors/moonfly.yazi/README.md @@ -0,0 +1,32 @@ +
+ Yazi logo +
+ +## moonfly flavor for [Yazi](https://github.com/sxyazi/yazi) + +moonfly.yazi is based on [moonfly](https://github.com/bluz71/vim-moonfly-colors)'s colors and [fly16](https://github.com/bluz71/fly16-bat) .tmTheme template. It is usable standalone or with associated terminal themes found in moonfly's [extras section](https://github.com/bluz71/vim-moonfly-colors#extras). + +## 👀 Preview + + + +## 🎨 Installation + +```bash +ya pack -a tkapias/moonfly.yazi +``` + +## ⚙️ Usage + +Add the these lines to your `theme.toml` configuration file to use it: + +```toml +[flavor] +use = "moonfly" +``` + +## 📜 License + +The flavor is MIT-licensed, and the included tmTheme is also MIT-licensed. + +Check the [LICENSE](LICENSE) and [LICENSE-tmtheme](LICENSE-tmtheme) file for more details. diff --git a/homes/emenel/dotfiles/dot_config/yazi/flavors/moonfly.yazi/flavor.toml b/homes/emenel/dotfiles/dot_config/yazi/flavors/moonfly.yazi/flavor.toml new file mode 100644 index 0000000..09c8ab8 --- /dev/null +++ b/homes/emenel/dotfiles/dot_config/yazi/flavors/moonfly.yazi/flavor.toml @@ -0,0 +1,781 @@ +# vim:fileencoding=utf-8:foldmethod=marker +# : Manager {{{ + +[manager] +cwd = { fg = "#36c692" } + +# Hovered +hovered = { reversed = true } +preview_hovered = { underline = true } + +# Find +find_keyword = { fg = "#e3c78a", bold = true, italic = true, underline = true } +find_position = { fg = "#ff5189", bg = "reset", bold = true, italic = true } + +# Marker +marker_copied = { fg = "#36c692", bg = "#36c692" } +marker_cut = { fg = "#ff5189", bg = "#ff5189" } +marker_marked = { fg = "#74b2ff", bg = "#74b2ff" } +marker_selected = { fg = "#c6c684", bg = "#c6c684" } + +# Tab +tab_active = { reversed = true } +tab_inactive = {} +tab_width = 1 + +# Count +count_copied = { fg = "#323437", bg = "#36c692" } +count_cut = { fg = "#323437", bg = "#ff5189" } +count_selected = { fg = "#323437", bg = "#c6c684" } + +# Border +border_symbol = "│" +border_style = { fg = "#323437" } + + +# : Status {{{ + +[status] +separator_open = "" +separator_close = "" +separator_style = { fg = "#323437", bg = "#323437" } + +# Mode +mode_normal = { fg = "#080808", bg = "#80a0ff", bold = true } +mode_select = { fg = "#080808", bg = "#e3c78a", bold = true } +mode_unset = { fg = "#080808", bg = "#ff5454", bold = true } + +# Progress +progress_label = { fg = "#bdbdbd", bold = true } +progress_normal = { fg = "#74b2ff", bg = "#323437" } +progress_error = { fg = "#ff5189", bg = "#323437" } + +# Permissions +permissions_t = { fg = "#8cc85f" } +permissions_r = { fg = "#e3c78a" } +permissions_w = { fg = "#ff5454" } +permissions_x = { fg = "#79dac8" } +permissions_s = { fg = "#c6c6c6" } + +# : }}} + +# : Pick {{{ + +[pick] +border = { fg = "#323437" } +active = { fg = "#80a0ff", bold = true } +inactive = {} + +# : }}} + + +# : Input {{{ + +[input] +border = { fg = "#80a0ff" } +title = {} +value = {} +selected = { reversed = true } + +# : }}} + + +# : Confirm {{{ + +[confirm] +border = { fg = "#80a0ff" } +title = { fg = "#cf87e8" } +content = {} +list = {} +btn_yes = { reversed = true } +btn_no = {} +btn_labels = [ " [Y]es ", " (N)o " ] + +# : }}} + + +# : Completion {{{ + +[completion] +border = { fg = "#80a0ff" } +active = { reversed = true } +inactive = {} + +# Icons +icon_file = "" +icon_folder = "" +icon_command = "" + +# : }}} + + +# : Tasks {{{ + +[tasks] +border = { fg = "#80a0ff" } +title = {} +hovered = { fg = "#cf87e8", underline = true } + +# : }}} + + +# : Which {{{ + +[which] +cols = 3 +mask = { bg = "#323437" } +cand = { fg = "#79dac8" } +rest = { fg = "#d6deeb" } +desc = { fg = "#cf87e8" } +separator = "  " +separator_style = { fg = "#949494" } + +# : }}} + + +# : Help {{{ + +[help] +on = { fg = "#79dac8" } +run = { fg = "#cf87e8" } +desc = {} +hovered = { reversed = true, bold = true } +footer = { fg = "#323437", bg = "#c6c6c6" } + +# : }}} + + +# : Notify {{{ + +[notify] +title_info = { fg = "#8cc85f" } +title_warn = { fg = "#e3c78a" } +title_error = { fg = "#ff5454" } + +# Icons +icon_info = "" +icon_warn = "" +icon_error = "" + +# : }}} + +# : File-specific styles {{{ + +[filetype] + +rules = [ + # Images + { mime = "image/*", fg = "#c6c684" }, + + # Media + { mime = "{audio,video}/*", fg = "#ae81ff" }, + + # Archives + { mime = "application/{,g}zip", fg = "#ff5189" }, + { mime = "application/x-{tar,bzip*,7z-compressed,xz,rar}", fg = "#ff5189" }, + + # Documents + { mime = "application/{pdf,doc,rtf,vnd.*}", fg = "#36c692" }, + + # Empty files + { mime = "inode/x-empty", fg = "#ff5454" }, + + # Special files + { name = "*", is = "orphan", bg = "#ff5189" }, + { name = "*", is = "exec" , fg = "#36c692" }, + + # Dummy files + { name = "*", is = "dummy", bg = "#ff5189" }, + { name = "*/", is = "dummy", bg = "#ff5189" }, + + # Fallback + { name = "*", fg = "#e4e4e4" }, + { name = "*/", fg = "#80a0ff" } +] + +[icon] + +globs = [] +dirs = [ + { name = ".config", text = "" }, + { name = ".git", text = "" }, + { name = "Desktop", text = "" }, + { name = "Development", text = "" }, + { name = "Documents", text = "" }, + { name = "Downloads", text = "" }, + { name = "Library", text = "" }, + { name = "Movies", text = "" }, + { name = "Music", text = "" }, + { name = "Pictures", text = "" }, + { name = "Public", text = "" }, + { name = "Videos", text = "" }, +] +files = [ + { name = ".babelrc", text = "", fg_dark = "#cbcb41", fg_light = "#666620" }, + { name = ".bash_profile", text = "", fg_dark = "#89e051", fg_light = "#447028" }, + { name = ".bashrc", text = "", fg_dark = "#89e051", fg_light = "#447028" }, + { name = ".dockerignore", text = "󰡨", fg_dark = "#458ee6", fg_light = "#2e5f99" }, + { name = ".ds_store", text = "", fg_dark = "#41535b", fg_light = "#41535b" }, + { name = ".editorconfig", text = "", fg_dark = "#fff2f2", fg_light = "#333030" }, + { name = ".env", text = "", fg_dark = "#faf743", fg_light = "#32310d" }, + { name = ".eslintignore", text = "", fg_dark = "#4b32c3", fg_light = "#4b32c3" }, + { name = ".eslintrc", text = "", fg_dark = "#4b32c3", fg_light = "#4b32c3" }, + { name = ".gitattributes", text = "", fg_dark = "#f54d27", fg_light = "#b83a1d" }, + { name = ".gitconfig", text = "", fg_dark = "#f54d27", fg_light = "#b83a1d" }, + { name = ".gitignore", text = "", fg_dark = "#f54d27", fg_light = "#b83a1d" }, + { name = ".gitlab-ci.yml", text = "", fg_dark = "#e24329", fg_light = "#aa321f" }, + { name = ".gitmodules", text = "", fg_dark = "#f54d27", fg_light = "#b83a1d" }, + { name = ".gtkrc-2.0", text = "", fg_dark = "#ffffff", fg_light = "#333333" }, + { name = ".gvimrc", text = "", fg_dark = "#019833", fg_light = "#017226" }, + { name = ".luaurc", text = "", fg_dark = "#00a2ff", fg_light = "#007abf" }, + { name = ".mailmap", text = "󰊢", fg_dark = "#41535b", fg_light = "#41535b" }, + { name = ".npmignore", text = "", fg_dark = "#e8274b", fg_light = "#ae1d38" }, + { name = ".npmrc", text = "", fg_dark = "#e8274b", fg_light = "#ae1d38" }, + { name = ".prettierrc", text = "", fg_dark = "#4285f4", fg_light = "#3264b7" }, + { name = ".settings.json", text = "", fg_dark = "#854cc7", fg_light = "#643995" }, + { name = ".SRCINFO", text = "󰣇", fg_dark = "#0f94d2", fg_light = "#0b6f9e" }, + { name = ".vimrc", text = "", fg_dark = "#019833", fg_light = "#017226" }, + { name = ".Xauthority", text = "", fg_dark = "#e54d18", fg_light = "#ac3a12" }, + { name = ".xinitrc", text = "", fg_dark = "#e54d18", fg_light = "#ac3a12" }, + { name = ".Xresources", text = "", fg_dark = "#e54d18", fg_light = "#ac3a12" }, + { name = ".xsession", text = "", fg_dark = "#e54d18", fg_light = "#ac3a12" }, + { name = ".zprofile", text = "", fg_dark = "#89e051", fg_light = "#447028" }, + { name = ".zshenv", text = "", fg_dark = "#89e051", fg_light = "#447028" }, + { name = ".zshrc", text = "", fg_dark = "#89e051", fg_light = "#447028" }, + { name = "_gvimrc", text = "", fg_dark = "#019833", fg_light = "#017226" }, + { name = "_vimrc", text = "", fg_dark = "#019833", fg_light = "#017226" }, + { name = "avif", text = "", fg_dark = "#a074c4", fg_light = "#6b4d83" }, + { name = "brewfile", text = "", fg_dark = "#701516", fg_light = "#701516" }, + { name = "bspwmrc", text = "", fg_dark = "#2f2f2f", fg_light = "#2f2f2f" }, + { name = "build", text = "", fg_dark = "#89e051", fg_light = "#447028" }, + { name = "build.gradle", text = "", fg_dark = "#005f87", fg_light = "#005f87" }, + { name = "build.zig.zon", text = "", fg_dark = "#f69a1b", fg_light = "#7b4d0e" }, + { name = "cantorrc", text = "", fg_dark = "#1c99f3", fg_light = "#1573b6" }, + { name = "checkhealth", text = "󰓙", fg_dark = "#75b4fb", fg_light = "#3a5a7e" }, + { name = "cmakelists.txt", text = "", fg_dark = "#6d8086", fg_light = "#526064" }, + { name = "commit_editmsg", text = "", fg_dark = "#f54d27", fg_light = "#b83a1d" }, + { name = "compose.yaml", text = "󰡨", fg_dark = "#458ee6", fg_light = "#2e5f99" }, + { name = "compose.yml", text = "󰡨", fg_dark = "#458ee6", fg_light = "#2e5f99" }, + { name = "config", text = "", fg_dark = "#6d8086", fg_light = "#526064" }, + { name = "containerfile", text = "󰡨", fg_dark = "#458ee6", fg_light = "#2e5f99" }, + { name = "copying", text = "", fg_dark = "#cbcb41", fg_light = "#666620" }, + { name = "copying.lesser", text = "", fg_dark = "#cbcb41", fg_light = "#666620" }, + { name = "docker-compose.yaml", text = "󰡨", fg_dark = "#458ee6", fg_light = "#2e5f99" }, + { name = "docker-compose.yml", text = "󰡨", fg_dark = "#458ee6", fg_light = "#2e5f99" }, + { name = "dockerfile", text = "󰡨", fg_dark = "#458ee6", fg_light = "#2e5f99" }, + { name = "ext_typoscript_setup.txt", text = "", fg_dark = "#ff8700", fg_light = "#aa5a00" }, + { name = "favicon.ico", text = "", fg_dark = "#cbcb41", fg_light = "#666620" }, + { name = "fp-info-cache", text = "", fg_dark = "#ffffff", fg_light = "#333333" }, + { name = "fp-lib-table", text = "", fg_dark = "#ffffff", fg_light = "#333333" }, + { name = "FreeCAD.conf", text = "", fg_dark = "#cb0d0d", fg_light = "#cb0d0d" }, + { name = "gemfile$", text = "", fg_dark = "#701516", fg_light = "#701516" }, + { name = "gnumakefile", text = "", fg_dark = "#6d8086", fg_light = "#526064" }, + { name = "gradle-wrapper.properties", text = "", fg_dark = "#005f87", fg_light = "#005f87" }, + { name = "gradle.properties", text = "", fg_dark = "#005f87", fg_light = "#005f87" }, + { name = "gradlew", text = "", fg_dark = "#005f87", fg_light = "#005f87" }, + { name = "groovy", text = "", fg_dark = "#4a687c", fg_light = "#384e5d" }, + { name = "gruntfile.babel.js", text = "", fg_dark = "#e37933", fg_light = "#975122" }, + { name = "gruntfile.coffee", text = "", fg_dark = "#e37933", fg_light = "#975122" }, + { name = "gruntfile.js", text = "", fg_dark = "#e37933", fg_light = "#975122" }, + { name = "gruntfile.ts", text = "", fg_dark = "#e37933", fg_light = "#975122" }, + { name = "gtkrc", text = "", fg_dark = "#ffffff", fg_light = "#333333" }, + { name = "gulpfile.babel.js", text = "", fg_dark = "#cc3e44", fg_light = "#992e33" }, + { name = "gulpfile.coffee", text = "", fg_dark = "#cc3e44", fg_light = "#992e33" }, + { name = "gulpfile.js", text = "", fg_dark = "#cc3e44", fg_light = "#992e33" }, + { name = "gulpfile.ts", text = "", fg_dark = "#cc3e44", fg_light = "#992e33" }, + { name = "hyprland.conf", text = "", fg_dark = "#00aaae", fg_light = "#008082" }, + { name = "i3blocks.conf", text = "", fg_dark = "#e8ebee", fg_light = "#2e2f30" }, + { name = "i3status.conf", text = "", fg_dark = "#e8ebee", fg_light = "#2e2f30" }, + { name = "kalgebrarc", text = "", fg_dark = "#1c99f3", fg_light = "#1573b6" }, + { name = "kdeglobals", text = "", fg_dark = "#1c99f3", fg_light = "#1573b6" }, + { name = "kdenlive-layoutsrc", text = "", fg_dark = "#83b8f2", fg_light = "#425c79" }, + { name = "kdenliverc", text = "", fg_dark = "#83b8f2", fg_light = "#425c79" }, + { name = "kritadisplayrc", text = "", fg_dark = "#f245fb", fg_light = "#a12ea7" }, + { name = "kritarc", text = "", fg_dark = "#f245fb", fg_light = "#a12ea7" }, + { name = "license", text = "", fg_dark = "#d0bf41", fg_light = "#686020" }, + { name = "lxde-rc.xml", text = "", fg_dark = "#909090", fg_light = "#606060" }, + { name = "lxqt.conf", text = "", fg_dark = "#0192d3", fg_light = "#016e9e" }, + { name = "makefile", text = "", fg_dark = "#6d8086", fg_light = "#526064" }, + { name = "mix.lock", text = "", fg_dark = "#a074c4", fg_light = "#6b4d83" }, + { name = "mpv.conf", text = "", fg_dark = "#3b1342", fg_light = "#3b1342" }, + { name = "node_modules", text = "", fg_dark = "#e8274b", fg_light = "#ae1d38" }, + { name = "package-lock.json", text = "", fg_dark = "#7a0d21", fg_light = "#7a0d21" }, + { name = "package.json", text = "", fg_dark = "#e8274b", fg_light = "#ae1d38" }, + { name = "PKGBUILD", text = "", fg_dark = "#0f94d2", fg_light = "#0b6f9e" }, + { name = "platformio.ini", text = "", fg_dark = "#f6822b", fg_light = "#a4571d" }, + { name = "pom.xml", text = "", fg_dark = "#7a0d21", fg_light = "#7a0d21" }, + { name = "procfile", text = "", fg_dark = "#a074c4", fg_light = "#6b4d83" }, + { name = "PrusaSlicer.ini", text = "", fg_dark = "#ec6b23", fg_light = "#9d4717" }, + { name = "PrusaSlicerGcodeViewer.ini", text = "", fg_dark = "#ec6b23", fg_light = "#9d4717" }, + { name = "py.typed", text = "", fg_dark = "#ffbc03", fg_light = "#805e02" }, + { name = "QtProject.conf", text = "", fg_dark = "#40cd52", fg_light = "#2b8937" }, + { name = "R", text = "󰟔", fg_dark = "#2266ba", fg_light = "#1a4c8c" }, + { name = "r", text = "󰟔", fg_dark = "#2266ba", fg_light = "#1a4c8c" }, + { name = "rakefile", text = "", fg_dark = "#701516", fg_light = "#701516" }, + { name = "rmd", text = "", fg_dark = "#519aba", fg_light = "#36677c" }, + { name = "settings.gradle", text = "", fg_dark = "#005f87", fg_light = "#005f87" }, + { name = "svelte.config.js", text = "", fg_dark = "#ff3e00", fg_light = "#bf2e00" }, + { name = "sxhkdrc", text = "", fg_dark = "#2f2f2f", fg_light = "#2f2f2f" }, + { name = "sym-lib-table", text = "", fg_dark = "#ffffff", fg_light = "#333333" }, + { name = "tailwind.config.js", text = "󱏿", fg_dark = "#20c2e3", fg_light = "#158197" }, + { name = "tailwind.config.mjs", text = "󱏿", fg_dark = "#20c2e3", fg_light = "#158197" }, + { name = "tailwind.config.ts", text = "󱏿", fg_dark = "#20c2e3", fg_light = "#158197" }, + { name = "tmux.conf", text = "", fg_dark = "#14ba19", fg_light = "#0f8c13" }, + { name = "tmux.conf.local", text = "", fg_dark = "#14ba19", fg_light = "#0f8c13" }, + { name = "tsconfig.json", text = "", fg_dark = "#519aba", fg_light = "#36677c" }, + { name = "unlicense", text = "", fg_dark = "#d0bf41", fg_light = "#686020" }, + { name = "vagrantfile$", text = "", fg_dark = "#1563ff", fg_light = "#104abf" }, + { name = "vlcrc", text = "󰕼", fg_dark = "#ee7a00", fg_light = "#9f5100" }, + { name = "webpack", text = "󰜫", fg_dark = "#519aba", fg_light = "#36677c" }, + { name = "weston.ini", text = "", fg_dark = "#ffbb01", fg_light = "#805e00" }, + { name = "workspace", text = "", fg_dark = "#89e051", fg_light = "#447028" }, + { name = "xmobarrc", text = "", fg_dark = "#fd4d5d", fg_light = "#a9333e" }, + { name = "xmobarrc.hs", text = "", fg_dark = "#fd4d5d", fg_light = "#a9333e" }, + { name = "xmonad.hs", text = "", fg_dark = "#fd4d5d", fg_light = "#a9333e" }, + { name = "xorg.conf", text = "", fg_dark = "#e54d18", fg_light = "#ac3a12" }, + { name = "xsettingsd.conf", text = "", fg_dark = "#e54d18", fg_light = "#ac3a12" }, +] +exts = [ + { name = "3gp", text = "", fg_dark = "#fd971f", fg_light = "#7e4c10" }, + { name = "3mf", text = "󰆧", fg_dark = "#888888", fg_light = "#5b5b5b" }, + { name = "7z", text = "", fg_dark = "#eca517", fg_light = "#76520c" }, + { name = "a", text = "", fg_dark = "#dcddd6", fg_light = "#494a47" }, + { name = "aac", text = "", fg_dark = "#00afff", fg_light = "#0075aa" }, + { name = "ai", text = "", fg_dark = "#cbcb41", fg_light = "#666620" }, + { name = "aif", text = "", fg_dark = "#00afff", fg_light = "#0075aa" }, + { name = "aiff", text = "", fg_dark = "#00afff", fg_light = "#0075aa" }, + { name = "android", text = "", fg_dark = "#34a853", fg_light = "#277e3e" }, + { name = "ape", text = "", fg_dark = "#00afff", fg_light = "#0075aa" }, + { name = "apk", text = "", fg_dark = "#34a853", fg_light = "#277e3e" }, + { name = "app", text = "", fg_dark = "#9f0500", fg_light = "#9f0500" }, + { name = "applescript", text = "", fg_dark = "#6d8085", fg_light = "#526064" }, + { name = "asc", text = "󰦝", fg_dark = "#576d7f", fg_light = "#41525f" }, + { name = "ass", text = "󰨖", fg_dark = "#ffb713", fg_light = "#805c0a" }, + { name = "astro", text = "", fg_dark = "#e23f67", fg_light = "#aa2f4d" }, + { name = "awk", text = "", fg_dark = "#4d5a5e", fg_light = "#3a4446" }, + { name = "azcli", text = "", fg_dark = "#0078d4", fg_light = "#005a9f" }, + { name = "bak", text = "󰁯", fg_dark = "#6d8086", fg_light = "#526064" }, + { name = "bash", text = "", fg_dark = "#89e051", fg_light = "#447028" }, + { name = "bat", text = "", fg_dark = "#c1f12e", fg_light = "#40500f" }, + { name = "bazel", text = "", fg_dark = "#89e051", fg_light = "#447028" }, + { name = "bib", text = "󱉟", fg_dark = "#cbcb41", fg_light = "#666620" }, + { name = "bicep", text = "", fg_dark = "#519aba", fg_light = "#36677c" }, + { name = "bicepparam", text = "", fg_dark = "#9f74b3", fg_light = "#6a4d77" }, + { name = "bin", text = "", fg_dark = "#9f0500", fg_light = "#9f0500" }, + { name = "blade.php", text = "", fg_dark = "#f05340", fg_light = "#a0372b" }, + { name = "blend", text = "󰂫", fg_dark = "#ea7600", fg_light = "#9c4f00" }, + { name = "blp", text = "󰺾", fg_dark = "#5796e2", fg_light = "#3a6497" }, + { name = "bmp", text = "", fg_dark = "#a074c4", fg_light = "#6b4d83" }, + { name = "brep", text = "󰻫", fg_dark = "#839463", fg_light = "#576342" }, + { name = "bz", text = "", fg_dark = "#eca517", fg_light = "#76520c" }, + { name = "bz2", text = "", fg_dark = "#eca517", fg_light = "#76520c" }, + { name = "bz3", text = "", fg_dark = "#eca517", fg_light = "#76520c" }, + { name = "bzl", text = "", fg_dark = "#89e051", fg_light = "#447028" }, + { name = "c", text = "", fg_dark = "#599eff", fg_light = "#3b69aa" }, + { name = "c++", text = "", fg_dark = "#f34b7d", fg_light = "#a23253" }, + { name = "cache", text = "", fg_dark = "#ffffff", fg_light = "#333333" }, + { name = "cast", text = "", fg_dark = "#fd971f", fg_light = "#7e4c10" }, + { name = "cbl", text = "⚙", fg_dark = "#005ca5", fg_light = "#005ca5" }, + { name = "cc", text = "", fg_dark = "#f34b7d", fg_light = "#a23253" }, + { name = "ccm", text = "", fg_dark = "#f34b7d", fg_light = "#a23253" }, + { name = "cfg", text = "", fg_dark = "#6d8086", fg_light = "#526064" }, + { name = "cjs", text = "", fg_dark = "#cbcb41", fg_light = "#666620" }, + { name = "clj", text = "", fg_dark = "#8dc149", fg_light = "#466024" }, + { name = "cljc", text = "", fg_dark = "#8dc149", fg_light = "#466024" }, + { name = "cljd", text = "", fg_dark = "#519aba", fg_light = "#36677c" }, + { name = "cljs", text = "", fg_dark = "#519aba", fg_light = "#36677c" }, + { name = "cmake", text = "", fg_dark = "#6d8086", fg_light = "#526064" }, + { name = "cob", text = "⚙", fg_dark = "#005ca5", fg_light = "#005ca5" }, + { name = "cobol", text = "⚙", fg_dark = "#005ca5", fg_light = "#005ca5" }, + { name = "coffee", text = "", fg_dark = "#cbcb41", fg_light = "#666620" }, + { name = "conf", text = "", fg_dark = "#6d8086", fg_light = "#526064" }, + { name = "config.ru", text = "", fg_dark = "#701516", fg_light = "#701516" }, + { name = "cp", text = "", fg_dark = "#519aba", fg_light = "#36677c" }, + { name = "cpp", text = "", fg_dark = "#519aba", fg_light = "#36677c" }, + { name = "cppm", text = "", fg_dark = "#519aba", fg_light = "#36677c" }, + { name = "cpy", text = "⚙", fg_dark = "#005ca5", fg_light = "#005ca5" }, + { name = "cr", text = "", fg_dark = "#c8c8c8", fg_light = "#434343" }, + { name = "crdownload", text = "", fg_dark = "#44cda8", fg_light = "#226654" }, + { name = "cs", text = "󰌛", fg_dark = "#596706", fg_light = "#434d04" }, + { name = "csh", text = "", fg_dark = "#4d5a5e", fg_light = "#3a4446" }, + { name = "cshtml", text = "󱦗", fg_dark = "#512bd4", fg_light = "#512bd4" }, + { name = "cson", text = "", fg_dark = "#cbcb41", fg_light = "#666620" }, + { name = "csproj", text = "󰪮", fg_dark = "#512bd4", fg_light = "#512bd4" }, + { name = "css", text = "", fg_dark = "#42a5f5", fg_light = "#2c6ea3" }, + { name = "csv", text = "", fg_dark = "#89e051", fg_light = "#447028" }, + { name = "cts", text = "", fg_dark = "#519aba", fg_light = "#36677c" }, + { name = "cu", text = "", fg_dark = "#89e051", fg_light = "#447028" }, + { name = "cue", text = "󰲹", fg_dark = "#ed95ae", fg_light = "#764a57" }, + { name = "cuh", text = "", fg_dark = "#a074c4", fg_light = "#6b4d83" }, + { name = "cxx", text = "", fg_dark = "#519aba", fg_light = "#36677c" }, + { name = "cxxm", text = "", fg_dark = "#519aba", fg_light = "#36677c" }, + { name = "d", text = "", fg_dark = "#427819", fg_light = "#325a13" }, + { name = "d.ts", text = "", fg_dark = "#d59855", fg_light = "#6a4c2a" }, + { name = "dart", text = "", fg_dark = "#03589c", fg_light = "#03589c" }, + { name = "db", text = "", fg_dark = "#dad8d8", fg_light = "#494848" }, + { name = "dconf", text = "", fg_dark = "#ffffff", fg_light = "#333333" }, + { name = "desktop", text = "", fg_dark = "#563d7c", fg_light = "#563d7c" }, + { name = "diff", text = "", fg_dark = "#41535b", fg_light = "#41535b" }, + { name = "dll", text = "", fg_dark = "#4d2c0b", fg_light = "#4d2c0b" }, + { name = "doc", text = "󰈬", fg_dark = "#185abd", fg_light = "#185abd" }, + { name = "Dockerfile", text = "󰡨", fg_dark = "#458ee6", fg_light = "#2e5f99" }, + { name = "docx", text = "󰈬", fg_dark = "#185abd", fg_light = "#185abd" }, + { name = "dot", text = "󱁉", fg_dark = "#30638e", fg_light = "#244a6a" }, + { name = "download", text = "", fg_dark = "#44cda8", fg_light = "#226654" }, + { name = "drl", text = "", fg_dark = "#ffafaf", fg_light = "#553a3a" }, + { name = "dropbox", text = "", fg_dark = "#0061fe", fg_light = "#0049be" }, + { name = "dump", text = "", fg_dark = "#dad8d8", fg_light = "#494848" }, + { name = "dwg", text = "󰻫", fg_dark = "#839463", fg_light = "#576342" }, + { name = "dxf", text = "󰻫", fg_dark = "#839463", fg_light = "#576342" }, + { name = "ebook", text = "", fg_dark = "#eab16d", fg_light = "#755836" }, + { name = "edn", text = "", fg_dark = "#519aba", fg_light = "#36677c" }, + { name = "eex", text = "", fg_dark = "#a074c4", fg_light = "#6b4d83" }, + { name = "ejs", text = "", fg_dark = "#cbcb41", fg_light = "#666620" }, + { name = "el", text = "", fg_dark = "#8172be", fg_light = "#61568e" }, + { name = "elc", text = "", fg_dark = "#8172be", fg_light = "#61568e" }, + { name = "elf", text = "", fg_dark = "#9f0500", fg_light = "#9f0500" }, + { name = "elm", text = "", fg_dark = "#519aba", fg_light = "#36677c" }, + { name = "eln", text = "", fg_dark = "#8172be", fg_light = "#61568e" }, + { name = "env", text = "", fg_dark = "#faf743", fg_light = "#32310d" }, + { name = "eot", text = "", fg_dark = "#ececec", fg_light = "#2f2f2f" }, + { name = "epp", text = "", fg_dark = "#ffa61a", fg_light = "#80530d" }, + { name = "epub", text = "", fg_dark = "#eab16d", fg_light = "#755836" }, + { name = "erb", text = "", fg_dark = "#701516", fg_light = "#701516" }, + { name = "erl", text = "", fg_dark = "#b83998", fg_light = "#8a2b72" }, + { name = "ex", text = "", fg_dark = "#a074c4", fg_light = "#6b4d83" }, + { name = "exe", text = "", fg_dark = "#9f0500", fg_light = "#9f0500" }, + { name = "exs", text = "", fg_dark = "#a074c4", fg_light = "#6b4d83" }, + { name = "f#", text = "", fg_dark = "#519aba", fg_light = "#36677c" }, + { name = "f3d", text = "󰻫", fg_dark = "#839463", fg_light = "#576342" }, + { name = "f90", text = "󱈚", fg_dark = "#734f96", fg_light = "#563b70" }, + { name = "fbx", text = "󰆧", fg_dark = "#888888", fg_light = "#5b5b5b" }, + { name = "fcbak", text = "", fg_dark = "#cb0d0d", fg_light = "#cb0d0d" }, + { name = "fcmacro", text = "", fg_dark = "#cb0d0d", fg_light = "#cb0d0d" }, + { name = "fcmat", text = "", fg_dark = "#cb0d0d", fg_light = "#cb0d0d" }, + { name = "fcparam", text = "", fg_dark = "#cb0d0d", fg_light = "#cb0d0d" }, + { name = "fcscript", text = "", fg_dark = "#cb0d0d", fg_light = "#cb0d0d" }, + { name = "fcstd", text = "", fg_dark = "#cb0d0d", fg_light = "#cb0d0d" }, + { name = "fcstd1", text = "", fg_dark = "#cb0d0d", fg_light = "#cb0d0d" }, + { name = "fctb", text = "", fg_dark = "#cb0d0d", fg_light = "#cb0d0d" }, + { name = "fctl", text = "", fg_dark = "#cb0d0d", fg_light = "#cb0d0d" }, + { name = "fdmdownload", text = "", fg_dark = "#44cda8", fg_light = "#226654" }, + { name = "fish", text = "", fg_dark = "#4d5a5e", fg_light = "#3a4446" }, + { name = "flac", text = "", fg_dark = "#0075aa", fg_light = "#005880" }, + { name = "flc", text = "", fg_dark = "#ececec", fg_light = "#2f2f2f" }, + { name = "flf", text = "", fg_dark = "#ececec", fg_light = "#2f2f2f" }, + { name = "fnl", text = "", fg_dark = "#fff3d7", fg_light = "#33312b" }, + { name = "fs", text = "", fg_dark = "#519aba", fg_light = "#36677c" }, + { name = "fsi", text = "", fg_dark = "#519aba", fg_light = "#36677c" }, + { name = "fsscript", text = "", fg_dark = "#519aba", fg_light = "#36677c" }, + { name = "fsx", text = "", fg_dark = "#519aba", fg_light = "#36677c" }, + { name = "gcode", text = "󰐫", fg_dark = "#1471ad", fg_light = "#0f5582" }, + { name = "gd", text = "", fg_dark = "#6d8086", fg_light = "#526064" }, + { name = "gemspec", text = "", fg_dark = "#701516", fg_light = "#701516" }, + { name = "gif", text = "", fg_dark = "#a074c4", fg_light = "#6b4d83" }, + { name = "git", text = "", fg_dark = "#f14c28", fg_light = "#b5391e" }, + { name = "glb", text = "", fg_dark = "#ffb13b", fg_light = "#80581e" }, + { name = "gnumakefile", text = "", fg_dark = "#6d8086", fg_light = "#526064" }, + { name = "go", text = "", fg_dark = "#519aba", fg_light = "#36677c" }, + { name = "godot", text = "", fg_dark = "#6d8086", fg_light = "#526064" }, + { name = "gql", text = "", fg_dark = "#e535ab", fg_light = "#ac2880" }, + { name = "graphql", text = "", fg_dark = "#e535ab", fg_light = "#ac2880" }, + { name = "gresource", text = "", fg_dark = "#ffffff", fg_light = "#333333" }, + { name = "gv", text = "󱁉", fg_dark = "#30638e", fg_light = "#244a6a" }, + { name = "gz", text = "", fg_dark = "#eca517", fg_light = "#76520c" }, + { name = "h", text = "", fg_dark = "#a074c4", fg_light = "#6b4d83" }, + { name = "haml", text = "", fg_dark = "#eaeae1", fg_light = "#2f2f2d" }, + { name = "hbs", text = "", fg_dark = "#f0772b", fg_light = "#a04f1d" }, + { name = "heex", text = "", fg_dark = "#a074c4", fg_light = "#6b4d83" }, + { name = "hex", text = "", fg_dark = "#2e63ff", fg_light = "#224abf" }, + { name = "hh", text = "", fg_dark = "#a074c4", fg_light = "#6b4d83" }, + { name = "hpp", text = "", fg_dark = "#a074c4", fg_light = "#6b4d83" }, + { name = "hrl", text = "", fg_dark = "#b83998", fg_light = "#8a2b72" }, + { name = "hs", text = "", fg_dark = "#a074c4", fg_light = "#6b4d83" }, + { name = "htm", text = "", fg_dark = "#e34c26", fg_light = "#aa391c" }, + { name = "html", text = "", fg_dark = "#e44d26", fg_light = "#ab3a1c" }, + { name = "huff", text = "󰡘", fg_dark = "#4242c7", fg_light = "#4242c7" }, + { name = "hurl", text = "", fg_dark = "#ff0288", fg_light = "#bf0266" }, + { name = "hx", text = "", fg_dark = "#ea8220", fg_light = "#9c5715" }, + { name = "hxx", text = "", fg_dark = "#a074c4", fg_light = "#6b4d83" }, + { name = "ical", text = "", fg_dark = "#2b2e83", fg_light = "#2b2e83" }, + { name = "icalendar", text = "", fg_dark = "#2b2e83", fg_light = "#2b2e83" }, + { name = "ico", text = "", fg_dark = "#cbcb41", fg_light = "#666620" }, + { name = "ics", text = "", fg_dark = "#2b2e83", fg_light = "#2b2e83" }, + { name = "ifb", text = "", fg_dark = "#2b2e83", fg_light = "#2b2e83" }, + { name = "ifc", text = "󰻫", fg_dark = "#839463", fg_light = "#576342" }, + { name = "ige", text = "󰻫", fg_dark = "#839463", fg_light = "#576342" }, + { name = "iges", text = "󰻫", fg_dark = "#839463", fg_light = "#576342" }, + { name = "igs", text = "󰻫", fg_dark = "#839463", fg_light = "#576342" }, + { name = "image", text = "", fg_dark = "#d0bec8", fg_light = "#453f43" }, + { name = "img", text = "", fg_dark = "#d0bec8", fg_light = "#453f43" }, + { name = "import", text = "", fg_dark = "#ececec", fg_light = "#2f2f2f" }, + { name = "info", text = "", fg_dark = "#ffffcd", fg_light = "#333329" }, + { name = "ini", text = "", fg_dark = "#6d8086", fg_light = "#526064" }, + { name = "ino", text = "", fg_dark = "#56b6c2", fg_light = "#397981" }, + { name = "ipynb", text = "", fg_dark = "#51a0cf", fg_light = "#366b8a" }, + { name = "iso", text = "", fg_dark = "#d0bec8", fg_light = "#453f43" }, + { name = "ixx", text = "", fg_dark = "#519aba", fg_light = "#36677c" }, + { name = "java", text = "", fg_dark = "#cc3e44", fg_light = "#992e33" }, + { name = "jl", text = "", fg_dark = "#a270ba", fg_light = "#6c4b7c" }, + { name = "jpeg", text = "", fg_dark = "#a074c4", fg_light = "#6b4d83" }, + { name = "jpg", text = "", fg_dark = "#a074c4", fg_light = "#6b4d83" }, + { name = "js", text = "", fg_dark = "#cbcb41", fg_light = "#666620" }, + { name = "json", text = "", fg_dark = "#cbcb41", fg_light = "#666620" }, + { name = "json5", text = "", fg_dark = "#cbcb41", fg_light = "#666620" }, + { name = "jsonc", text = "", fg_dark = "#cbcb41", fg_light = "#666620" }, + { name = "jsx", text = "", fg_dark = "#20c2e3", fg_light = "#158197" }, + { name = "jwmrc", text = "", fg_dark = "#0078cd", fg_light = "#005a9a" }, + { name = "jxl", text = "", fg_dark = "#a074c4", fg_light = "#6b4d83" }, + { name = "kbx", text = "󰯄", fg_dark = "#737672", fg_light = "#565856" }, + { name = "kdb", text = "", fg_dark = "#529b34", fg_light = "#3e7427" }, + { name = "kdbx", text = "", fg_dark = "#529b34", fg_light = "#3e7427" }, + { name = "kdenlive", text = "", fg_dark = "#83b8f2", fg_light = "#425c79" }, + { name = "kdenlivetitle", text = "", fg_dark = "#83b8f2", fg_light = "#425c79" }, + { name = "kicad_dru", text = "", fg_dark = "#ffffff", fg_light = "#333333" }, + { name = "kicad_mod", text = "", fg_dark = "#ffffff", fg_light = "#333333" }, + { name = "kicad_pcb", text = "", fg_dark = "#ffffff", fg_light = "#333333" }, + { name = "kicad_prl", text = "", fg_dark = "#ffffff", fg_light = "#333333" }, + { name = "kicad_pro", text = "", fg_dark = "#ffffff", fg_light = "#333333" }, + { name = "kicad_sch", text = "", fg_dark = "#ffffff", fg_light = "#333333" }, + { name = "kicad_sym", text = "", fg_dark = "#ffffff", fg_light = "#333333" }, + { name = "kicad_wks", text = "", fg_dark = "#ffffff", fg_light = "#333333" }, + { name = "ko", text = "", fg_dark = "#dcddd6", fg_light = "#494a47" }, + { name = "kpp", text = "", fg_dark = "#f245fb", fg_light = "#a12ea7" }, + { name = "kra", text = "", fg_dark = "#f245fb", fg_light = "#a12ea7" }, + { name = "krz", text = "", fg_dark = "#f245fb", fg_light = "#a12ea7" }, + { name = "ksh", text = "", fg_dark = "#4d5a5e", fg_light = "#3a4446" }, + { name = "kt", text = "", fg_dark = "#7f52ff", fg_light = "#5f3ebf" }, + { name = "kts", text = "", fg_dark = "#7f52ff", fg_light = "#5f3ebf" }, + { name = "lck", text = "", fg_dark = "#bbbbbb", fg_light = "#5e5e5e" }, + { name = "leex", text = "", fg_dark = "#a074c4", fg_light = "#6b4d83" }, + { name = "less", text = "", fg_dark = "#563d7c", fg_light = "#563d7c" }, + { name = "lff", text = "", fg_dark = "#ececec", fg_light = "#2f2f2f" }, + { name = "lhs", text = "", fg_dark = "#a074c4", fg_light = "#6b4d83" }, + { name = "lib", text = "", fg_dark = "#4d2c0b", fg_light = "#4d2c0b" }, + { name = "license", text = "", fg_dark = "#cbcb41", fg_light = "#666620" }, + { name = "liquid", text = "", fg_dark = "#95bf47", fg_light = "#4a6024" }, + { name = "lock", text = "", fg_dark = "#bbbbbb", fg_light = "#5e5e5e" }, + { name = "log", text = "󰌱", fg_dark = "#dddddd", fg_light = "#4a4a4a" }, + { name = "lrc", text = "󰨖", fg_dark = "#ffb713", fg_light = "#805c0a" }, + { name = "lua", text = "", fg_dark = "#51a0cf", fg_light = "#366b8a" }, + { name = "luac", text = "", fg_dark = "#51a0cf", fg_light = "#366b8a" }, + { name = "luau", text = "", fg_dark = "#00a2ff", fg_light = "#007abf" }, + { name = "m", text = "", fg_dark = "#599eff", fg_light = "#3b69aa" }, + { name = "m3u", text = "󰲹", fg_dark = "#ed95ae", fg_light = "#764a57" }, + { name = "m3u8", text = "󰲹", fg_dark = "#ed95ae", fg_light = "#764a57" }, + { name = "m4a", text = "", fg_dark = "#00afff", fg_light = "#0075aa" }, + { name = "m4v", text = "", fg_dark = "#fd971f", fg_light = "#7e4c10" }, + { name = "magnet", text = "", fg_dark = "#a51b16", fg_light = "#a51b16" }, + { name = "makefile", text = "", fg_dark = "#6d8086", fg_light = "#526064" }, + { name = "markdown", text = "", fg_dark = "#dddddd", fg_light = "#4a4a4a" }, + { name = "material", text = "󰔉", fg_dark = "#b83998", fg_light = "#8a2b72" }, + { name = "md", text = "", fg_dark = "#dddddd", fg_light = "#4a4a4a" }, + { name = "md5", text = "󰕥", fg_dark = "#8c86af", fg_light = "#5d5975" }, + { name = "mdx", text = "", fg_dark = "#519aba", fg_light = "#36677c" }, + { name = "mint", text = "󰌪", fg_dark = "#87c095", fg_light = "#44604a" }, + { name = "mjs", text = "", fg_dark = "#f1e05a", fg_light = "#504b1e" }, + { name = "mk", text = "", fg_dark = "#6d8086", fg_light = "#526064" }, + { name = "mkv", text = "", fg_dark = "#fd971f", fg_light = "#7e4c10" }, + { name = "ml", text = "", fg_dark = "#e37933", fg_light = "#975122" }, + { name = "mli", text = "", fg_dark = "#e37933", fg_light = "#975122" }, + { name = "mm", text = "", fg_dark = "#519aba", fg_light = "#36677c" }, + { name = "mo", text = "∞", fg_dark = "#9772fb", fg_light = "#654ca7" }, + { name = "mobi", text = "", fg_dark = "#eab16d", fg_light = "#755836" }, + { name = "mov", text = "", fg_dark = "#fd971f", fg_light = "#7e4c10" }, + { name = "mp3", text = "", fg_dark = "#00afff", fg_light = "#0075aa" }, + { name = "mp4", text = "", fg_dark = "#fd971f", fg_light = "#7e4c10" }, + { name = "mpp", text = "", fg_dark = "#519aba", fg_light = "#36677c" }, + { name = "msf", text = "", fg_dark = "#137be1", fg_light = "#0e5ca9" }, + { name = "mts", text = "", fg_dark = "#519aba", fg_light = "#36677c" }, + { name = "mustache", text = "", fg_dark = "#e37933", fg_light = "#975122" }, + { name = "nfo", text = "", fg_dark = "#ffffcd", fg_light = "#333329" }, + { name = "nim", text = "", fg_dark = "#f3d400", fg_light = "#514700" }, + { name = "nix", text = "", fg_dark = "#7ebae4", fg_light = "#3f5d72" }, + { name = "nswag", text = "", fg_dark = "#85ea2d", fg_light = "#427516" }, + { name = "nu", text = ">", fg_dark = "#3aa675", fg_light = "#276f4e" }, + { name = "o", text = "", fg_dark = "#9f0500", fg_light = "#9f0500" }, + { name = "obj", text = "󰆧", fg_dark = "#888888", fg_light = "#5b5b5b" }, + { name = "ogg", text = "", fg_dark = "#0075aa", fg_light = "#005880" }, + { name = "opus", text = "", fg_dark = "#0075aa", fg_light = "#005880" }, + { name = "org", text = "", fg_dark = "#77aa99", fg_light = "#4f7166" }, + { name = "otf", text = "", fg_dark = "#ececec", fg_light = "#2f2f2f" }, + { name = "out", text = "", fg_dark = "#9f0500", fg_light = "#9f0500" }, + { name = "part", text = "", fg_dark = "#44cda8", fg_light = "#226654" }, + { name = "patch", text = "", fg_dark = "#41535b", fg_light = "#41535b" }, + { name = "pck", text = "", fg_dark = "#6d8086", fg_light = "#526064" }, + { name = "pcm", text = "", fg_dark = "#0075aa", fg_light = "#005880" }, + { name = "pdf", text = "", fg_dark = "#b30b00", fg_light = "#b30b00" }, + { name = "php", text = "", fg_dark = "#a074c4", fg_light = "#6b4d83" }, + { name = "pl", text = "", fg_dark = "#519aba", fg_light = "#36677c" }, + { name = "pls", text = "󰲹", fg_dark = "#ed95ae", fg_light = "#764a57" }, + { name = "ply", text = "󰆧", fg_dark = "#888888", fg_light = "#5b5b5b" }, + { name = "pm", text = "", fg_dark = "#519aba", fg_light = "#36677c" }, + { name = "png", text = "", fg_dark = "#a074c4", fg_light = "#6b4d83" }, + { name = "po", text = "", fg_dark = "#2596be", fg_light = "#1c708e" }, + { name = "pot", text = "", fg_dark = "#2596be", fg_light = "#1c708e" }, + { name = "pp", text = "", fg_dark = "#ffa61a", fg_light = "#80530d" }, + { name = "ppt", text = "󰈧", fg_dark = "#cb4a32", fg_light = "#983826" }, + { name = "prisma", text = "", fg_dark = "#5a67d8", fg_light = "#444da2" }, + { name = "pro", text = "", fg_dark = "#e4b854", fg_light = "#725c2a" }, + { name = "ps1", text = "󰨊", fg_dark = "#4273ca", fg_light = "#325698" }, + { name = "psb", text = "", fg_dark = "#519aba", fg_light = "#36677c" }, + { name = "psd", text = "", fg_dark = "#519aba", fg_light = "#36677c" }, + { name = "psd1", text = "󰨊", fg_dark = "#6975c4", fg_light = "#4f5893" }, + { name = "psm1", text = "󰨊", fg_dark = "#6975c4", fg_light = "#4f5893" }, + { name = "pub", text = "󰷖", fg_dark = "#e3c58e", fg_light = "#4c422f" }, + { name = "pxd", text = "", fg_dark = "#5aa7e4", fg_light = "#3c6f98" }, + { name = "pxi", text = "", fg_dark = "#5aa7e4", fg_light = "#3c6f98" }, + { name = "py", text = "", fg_dark = "#ffbc03", fg_light = "#805e02" }, + { name = "pyc", text = "", fg_dark = "#ffe291", fg_light = "#332d1d" }, + { name = "pyd", text = "", fg_dark = "#ffe291", fg_light = "#332d1d" }, + { name = "pyi", text = "", fg_dark = "#ffbc03", fg_light = "#805e02" }, + { name = "pyo", text = "", fg_dark = "#ffe291", fg_light = "#332d1d" }, + { name = "pyx", text = "", fg_dark = "#5aa7e4", fg_light = "#3c6f98" }, + { name = "qm", text = "", fg_dark = "#2596be", fg_light = "#1c708e" }, + { name = "qml", text = "", fg_dark = "#40cd52", fg_light = "#2b8937" }, + { name = "qrc", text = "", fg_dark = "#40cd52", fg_light = "#2b8937" }, + { name = "qss", text = "", fg_dark = "#40cd52", fg_light = "#2b8937" }, + { name = "query", text = "", fg_dark = "#90a850", fg_light = "#607035" }, + { name = "r", text = "󰟔", fg_dark = "#2266ba", fg_light = "#1a4c8c" }, + { name = "rake", text = "", fg_dark = "#701516", fg_light = "#701516" }, + { name = "rar", text = "", fg_dark = "#eca517", fg_light = "#76520c" }, + { name = "razor", text = "󱦘", fg_dark = "#512bd4", fg_light = "#512bd4" }, + { name = "rb", text = "", fg_dark = "#701516", fg_light = "#701516" }, + { name = "res", text = "", fg_dark = "#cc3e44", fg_light = "#992e33" }, + { name = "resi", text = "", fg_dark = "#f55385", fg_light = "#a33759" }, + { name = "rlib", text = "", fg_dark = "#dea584", fg_light = "#6f5242" }, + { name = "rmd", text = "", fg_dark = "#519aba", fg_light = "#36677c" }, + { name = "rproj", text = "󰗆", fg_dark = "#358a5b", fg_light = "#286844" }, + { name = "rs", text = "", fg_dark = "#dea584", fg_light = "#6f5242" }, + { name = "rss", text = "", fg_dark = "#fb9d3b", fg_light = "#7e4e1e" }, + { name = "sass", text = "", fg_dark = "#f55385", fg_light = "#a33759" }, + { name = "sbt", text = "", fg_dark = "#cc3e44", fg_light = "#992e33" }, + { name = "sc", text = "", fg_dark = "#cc3e44", fg_light = "#992e33" }, + { name = "scad", text = "", fg_dark = "#f9d72c", fg_light = "#53480f" }, + { name = "scala", text = "", fg_dark = "#cc3e44", fg_light = "#992e33" }, + { name = "scm", text = "󰘧", fg_dark = "#eeeeee", fg_light = "#303030" }, + { name = "scss", text = "", fg_dark = "#f55385", fg_light = "#a33759" }, + { name = "sh", text = "", fg_dark = "#4d5a5e", fg_light = "#3a4446" }, + { name = "sha1", text = "󰕥", fg_dark = "#8c86af", fg_light = "#5d5975" }, + { name = "sha224", text = "󰕥", fg_dark = "#8c86af", fg_light = "#5d5975" }, + { name = "sha256", text = "󰕥", fg_dark = "#8c86af", fg_light = "#5d5975" }, + { name = "sha384", text = "󰕥", fg_dark = "#8c86af", fg_light = "#5d5975" }, + { name = "sha512", text = "󰕥", fg_dark = "#8c86af", fg_light = "#5d5975" }, + { name = "sig", text = "λ", fg_dark = "#e37933", fg_light = "#975122" }, + { name = "signature", text = "λ", fg_dark = "#e37933", fg_light = "#975122" }, + { name = "skp", text = "󰻫", fg_dark = "#839463", fg_light = "#576342" }, + { name = "sldasm", text = "󰻫", fg_dark = "#839463", fg_light = "#576342" }, + { name = "sldprt", text = "󰻫", fg_dark = "#839463", fg_light = "#576342" }, + { name = "slim", text = "", fg_dark = "#e34c26", fg_light = "#aa391c" }, + { name = "sln", text = "", fg_dark = "#854cc7", fg_light = "#643995" }, + { name = "slvs", text = "󰻫", fg_dark = "#839463", fg_light = "#576342" }, + { name = "sml", text = "λ", fg_dark = "#e37933", fg_light = "#975122" }, + { name = "so", text = "", fg_dark = "#dcddd6", fg_light = "#494a47" }, + { name = "sol", text = "", fg_dark = "#519aba", fg_light = "#36677c" }, + { name = "spec.js", text = "", fg_dark = "#cbcb41", fg_light = "#666620" }, + { name = "spec.jsx", text = "", fg_dark = "#20c2e3", fg_light = "#158197" }, + { name = "spec.ts", text = "", fg_dark = "#519aba", fg_light = "#36677c" }, + { name = "spec.tsx", text = "", fg_dark = "#1354bf", fg_light = "#1354bf" }, + { name = "sql", text = "", fg_dark = "#dad8d8", fg_light = "#494848" }, + { name = "sqlite", text = "", fg_dark = "#dad8d8", fg_light = "#494848" }, + { name = "sqlite3", text = "", fg_dark = "#dad8d8", fg_light = "#494848" }, + { name = "srt", text = "󰨖", fg_dark = "#ffb713", fg_light = "#805c0a" }, + { name = "ssa", text = "󰨖", fg_dark = "#ffb713", fg_light = "#805c0a" }, + { name = "ste", text = "󰻫", fg_dark = "#839463", fg_light = "#576342" }, + { name = "step", text = "󰻫", fg_dark = "#839463", fg_light = "#576342" }, + { name = "stl", text = "󰆧", fg_dark = "#888888", fg_light = "#5b5b5b" }, + { name = "stp", text = "󰻫", fg_dark = "#839463", fg_light = "#576342" }, + { name = "strings", text = "", fg_dark = "#2596be", fg_light = "#1c708e" }, + { name = "styl", text = "", fg_dark = "#8dc149", fg_light = "#466024" }, + { name = "sub", text = "󰨖", fg_dark = "#ffb713", fg_light = "#805c0a" }, + { name = "sublime", text = "", fg_dark = "#e37933", fg_light = "#975122" }, + { name = "suo", text = "", fg_dark = "#854cc7", fg_light = "#643995" }, + { name = "sv", text = "󰍛", fg_dark = "#019833", fg_light = "#017226" }, + { name = "svelte", text = "", fg_dark = "#ff3e00", fg_light = "#bf2e00" }, + { name = "svg", text = "󰜡", fg_dark = "#ffb13b", fg_light = "#80581e" }, + { name = "svh", text = "󰍛", fg_dark = "#019833", fg_light = "#017226" }, + { name = "swift", text = "", fg_dark = "#e37933", fg_light = "#975122" }, + { name = "t", text = "", fg_dark = "#519aba", fg_light = "#36677c" }, + { name = "tbc", text = "󰛓", fg_dark = "#1e5cb3", fg_light = "#1e5cb3" }, + { name = "tcl", text = "󰛓", fg_dark = "#1e5cb3", fg_light = "#1e5cb3" }, + { name = "templ", text = "", fg_dark = "#dbbd30", fg_light = "#6e5e18" }, + { name = "terminal", text = "", fg_dark = "#31b53e", fg_light = "#217929" }, + { name = "test.js", text = "", fg_dark = "#cbcb41", fg_light = "#666620" }, + { name = "test.jsx", text = "", fg_dark = "#20c2e3", fg_light = "#158197" }, + { name = "test.ts", text = "", fg_dark = "#519aba", fg_light = "#36677c" }, + { name = "test.tsx", text = "", fg_dark = "#1354bf", fg_light = "#1354bf" }, + { name = "tex", text = "", fg_dark = "#3d6117", fg_light = "#3d6117" }, + { name = "tf", text = "", fg_dark = "#5f43e9", fg_light = "#4732af" }, + { name = "tfvars", text = "", fg_dark = "#5f43e9", fg_light = "#4732af" }, + { name = "tgz", text = "", fg_dark = "#eca517", fg_light = "#76520c" }, + { name = "tmux", text = "", fg_dark = "#14ba19", fg_light = "#0f8c13" }, + { name = "toml", text = "", fg_dark = "#9c4221", fg_light = "#753219" }, + { name = "torrent", text = "", fg_dark = "#44cda8", fg_light = "#226654" }, + { name = "tres", text = "", fg_dark = "#6d8086", fg_light = "#526064" }, + { name = "ts", text = "", fg_dark = "#519aba", fg_light = "#36677c" }, + { name = "tscn", text = "", fg_dark = "#6d8086", fg_light = "#526064" }, + { name = "tsconfig", text = "", fg_dark = "#ff8700", fg_light = "#aa5a00" }, + { name = "tsx", text = "", fg_dark = "#1354bf", fg_light = "#1354bf" }, + { name = "ttf", text = "", fg_dark = "#ececec", fg_light = "#2f2f2f" }, + { name = "twig", text = "", fg_dark = "#8dc149", fg_light = "#466024" }, + { name = "txt", text = "󰈙", fg_dark = "#89e051", fg_light = "#447028" }, + { name = "txz", text = "", fg_dark = "#eca517", fg_light = "#76520c" }, + { name = "typoscript", text = "", fg_dark = "#ff8700", fg_light = "#aa5a00" }, + { name = "ui", text = "", fg_dark = "#0c306e", fg_light = "#0c306e" }, + { name = "v", text = "󰍛", fg_dark = "#019833", fg_light = "#017226" }, + { name = "vala", text = "", fg_dark = "#7239b3", fg_light = "#562b86" }, + { name = "vh", text = "󰍛", fg_dark = "#019833", fg_light = "#017226" }, + { name = "vhd", text = "󰍛", fg_dark = "#019833", fg_light = "#017226" }, + { name = "vhdl", text = "󰍛", fg_dark = "#019833", fg_light = "#017226" }, + { name = "vim", text = "", fg_dark = "#019833", fg_light = "#017226" }, + { name = "vsh", text = "", fg_dark = "#5d87bf", fg_light = "#3e5a7f" }, + { name = "vsix", text = "", fg_dark = "#854cc7", fg_light = "#643995" }, + { name = "vue", text = "", fg_dark = "#8dc149", fg_light = "#466024" }, + { name = "wasm", text = "", fg_dark = "#5c4cdb", fg_light = "#4539a4" }, + { name = "wav", text = "", fg_dark = "#00afff", fg_light = "#0075aa" }, + { name = "webm", text = "", fg_dark = "#fd971f", fg_light = "#7e4c10" }, + { name = "webmanifest", text = "", fg_dark = "#f1e05a", fg_light = "#504b1e" }, + { name = "webp", text = "", fg_dark = "#a074c4", fg_light = "#6b4d83" }, + { name = "webpack", text = "󰜫", fg_dark = "#519aba", fg_light = "#36677c" }, + { name = "wma", text = "", fg_dark = "#00afff", fg_light = "#0075aa" }, + { name = "woff", text = "", fg_dark = "#ececec", fg_light = "#2f2f2f" }, + { name = "woff2", text = "", fg_dark = "#ececec", fg_light = "#2f2f2f" }, + { name = "wrl", text = "󰆧", fg_dark = "#888888", fg_light = "#5b5b5b" }, + { name = "wrz", text = "󰆧", fg_dark = "#888888", fg_light = "#5b5b5b" }, + { name = "x", text = "", fg_dark = "#599eff", fg_light = "#3b69aa" }, + { name = "xaml", text = "󰙳", fg_dark = "#512bd4", fg_light = "#512bd4" }, + { name = "xcf", text = "", fg_dark = "#635b46", fg_light = "#4a4434" }, + { name = "xcplayground", text = "", fg_dark = "#e37933", fg_light = "#975122" }, + { name = "xcstrings", text = "", fg_dark = "#2596be", fg_light = "#1c708e" }, + { name = "xls", text = "󰈛", fg_dark = "#207245", fg_light = "#207245" }, + { name = "xlsx", text = "󰈛", fg_dark = "#207245", fg_light = "#207245" }, + { name = "xm", text = "", fg_dark = "#519aba", fg_light = "#36677c" }, + { name = "xml", text = "󰗀", fg_dark = "#e37933", fg_light = "#975122" }, + { name = "xpi", text = "", fg_dark = "#ff1b01", fg_light = "#bf1401" }, + { name = "xul", text = "", fg_dark = "#e37933", fg_light = "#975122" }, + { name = "xz", text = "", fg_dark = "#eca517", fg_light = "#76520c" }, + { name = "yaml", text = "", fg_dark = "#6d8086", fg_light = "#526064" }, + { name = "yml", text = "", fg_dark = "#6d8086", fg_light = "#526064" }, + { name = "zig", text = "", fg_dark = "#f69a1b", fg_light = "#7b4d0e" }, + { name = "zip", text = "", fg_dark = "#eca517", fg_light = "#76520c" }, + { name = "zsh", text = "", fg_dark = "#89e051", fg_light = "#447028" }, + { name = "zst", text = "", fg_dark = "#eca517", fg_light = "#76520c" }, +] +conds = [ + # Special files + { if = "orphan", text = "" }, + { if = "link" , text = "" }, + { if = "block" , text = "" }, + { if = "char" , text = "" }, + { if = "fifo" , text = "" }, + { if = "sock" , text = "" }, + { if = "sticky", text = "" }, + { if = "dummy", text = "" }, + + # Fallback + { if = "dir", text = "󰉋" }, + { if = "exec", text = "" }, + { if = "!dir", text = "󰈔" }, +] + +# : }}} diff --git a/homes/emenel/dotfiles/dot_config/yazi/flavors/moonfly.yazi/preview.png b/homes/emenel/dotfiles/dot_config/yazi/flavors/moonfly.yazi/preview.png new file mode 100644 index 0000000..557100c Binary files /dev/null and b/homes/emenel/dotfiles/dot_config/yazi/flavors/moonfly.yazi/preview.png differ diff --git a/homes/emenel/dotfiles/dot_config/yazi/flavors/moonfly.yazi/tmtheme.xml b/homes/emenel/dotfiles/dot_config/yazi/flavors/moonfly.yazi/tmtheme.xml new file mode 100644 index 0000000..85cf37b --- /dev/null +++ b/homes/emenel/dotfiles/dot_config/yazi/flavors/moonfly.yazi/tmtheme.xml @@ -0,0 +1,799 @@ + + + + + + author + Template: bluz71 + name + fly16 + colorSpaceName + sRGB + settings + + + settings + + background + #323437 + caret + #c6c6c6 + foreground + #c6c6c6 + invisibles + #949494 + lineHighlight + #323437 + selection + #c6c684 + gutter + #36c692 + gutterForeground + #949494 + + + + name + Text + scope + variable.parameter.function + settings + + foreground + #c6c6c6 + + + + name + Comments + scope + comment, punctuation.definition.comment + settings + + foreground + #949494 + fontStyle + italic + + + + name + Punctuation + scope + punctuation.definition.string, punctuation.definition.string, punctuation.definition.parameters, punctuation.definition.string, punctuation.definition.array + settings + + foreground + #c6c6c6 + + + + name + Delimiters + scope + none + settings + + foreground + #c6c6c6 + + + + name + Operators + scope + keyword.operator + settings + + foreground + #cf87e8 + + + + name + Keywords + scope + keyword + settings + + foreground + #cf87e8 + + + + name + Variables + scope + variable + settings + + foreground + #c6c6c6 + + + + name + Functions + scope + entity.name.function, meta.require, support.function.any-method + settings + + foreground + #74b2ff + + + + name + Labels + scope + entity.name.label + settings + + foreground + #85dc85 + + + + name + Classes + scope + support.class, entity.name.class, entity.name.type.class, entity.name.type + settings + + foreground + #36c692 + + + + name + Classes + scope + meta.class + settings + + foreground + #c6c6c6 + + + + name + Methods + scope + keyword.other.special-method + settings + + foreground + #74b2ff + + + + name + Storage + scope + storage + settings + + foreground + #cf87e8 + + + + name + Support + scope + support.function + settings + + foreground + #74b2ff + + + + name + Strings + scope + string + settings + + foreground + #c6c684 + + + + name + Symbol + scope + constant.other.symbol + settings + + foreground + #ae81ff + + + + name + Inherited Class + scope + entity.other.inherited-class + settings + + foreground + #36c692 + + + + name + Integers + scope + constant.numeric + settings + + foreground + #ae81ff + + + + name + Floats + scope + none + settings + + foreground + #ae81ff + + + + name + Boolean + scope + none + settings + + foreground + #e3c78a + + + + name + Constants + scope + constant + settings + + foreground + #e3c78a + + + + name + Tags + scope + entity.name.tag + settings + + foreground + #80a0ff + + + + name + Attributes + scope + entity.other.attribute-name + settings + + foreground + #79dac8 + + + + name + Attribute IDs + scope + entity.other.attribute-name.id, punctuation.definition.entity + settings + + foreground + #74b2ff + + + + name + Selector + scope + meta.selector + settings + + foreground + #cf87e8 + + + + name + Values + scope + none + settings + + foreground + #79dac8 + + + + name + Headings + scope + markup.heading punctuation.definition.heading, entity.name.section + settings + + fontStyle + + foreground + #80a0ff + + + + name + Units + scope + keyword.other.unit + settings + + foreground + #e4e4e4 + + + + name + Bold + scope + markup.bold, punctuation.definition.bold + settings + + fontStyle + bold + foreground + #e3c78a + + + + name + Italic + scope + markup.italic, punctuation.definition.italic + settings + + fontStyle + italic + foreground + #cf87e8 + + + + name + Code + scope + markup.raw.inline + settings + + foreground + #8cc85f + + + + name + Link Text + scope + string.other.link, punctuation.definition.string.end.markdown, punctuation.definition.string.begin.markdown + settings + + foreground + #ff5454 + + + + name + Link Url + scope + meta.link + settings + + foreground + #8cc85f + + + + name + Quotes + scope + markup.quote + settings + + foreground + #e4e4e4 + + + + name + Separator + scope + meta.separator + settings + + background + #c6c684 + foreground + #c6c6c6 + + + + name + Inserted + scope + markup.inserted + settings + + foreground + #8cc85f + + + + name + Deleted + scope + markup.deleted + settings + + foreground + #ff5454 + + + + name + Changed + scope + markup.changed + settings + + foreground + #cf87e8 + + + + name + Colors + scope + constant.other.color + settings + + foreground + #79dac8 + + + + name + Regular Expressions + scope + string.regexp + settings + + foreground + #c6c684 + + + + name + Escape Characters + scope + constant.character.escape + settings + + foreground + #ff5189 + + + + name + Embedded + scope + punctuation.section.embedded, variable.interpolation + settings + + foreground + #cf87e8 + + + + name + Illegal + scope + invalid.illegal + settings + + background + #ff5454 + foreground + #e4e4e4 + + + + name + Broken + scope + invalid.broken + settings + + background + #ff5189 + foreground + #323437 + + + + name + Deprecated + scope + invalid.deprecated + settings + + background + #85dc85 + foreground + #e4e4e4 + + + + name + Unimplemented + scope + invalid.unimplemented + settings + + background + #949494 + foreground + #e4e4e4 + + + + + name + Variable Function + scope + variable.function + settings + + foreground + #74b2ff + + + + name + Entity Name Constant Ruby + scope + entity.name.constant.ruby + settings + + foreground + #ae81ff + + + + name + JSON Strings + scope + meta.mapping.key.json string.quoted.double.json, punctuation.separator.sequence.csv + settings + + foreground + #74b2ff + + + + name + JavaScript unquoted label + scope + string.unquoted.label.js + settings + + foreground + #79dac8 + + + + name + Ruby @variable + scope + variable.other.readwrite.instance + settings + + fontStyle + + foreground + #79dac8 + + + + name + Language Variable + scope + variable.language + settings + + fontStyle + + foreground + #85dc85 + + + + name + Markup Link Text + scope + text.html.markdown markup.raw.inline + settings + + foreground + #c6c684 + + + + name + Markup Underline + scope + markup.underline + settings + + foreground + #ae81ff + + + + name + YAML Entity Name Tags + scope + entity.name.tag.yaml + settings + + foreground + #74b2ff + + + + name + Library class type + scope + support.type, support.class + settings + + foreground + #36c692 + + + + name + CSS Keyword Other Unit + scope + keyword.other.unit.css + settings + + foreground + #c6c684 + + + + name + CSS Attribute Name + scope + entity.other.attribute-name.class.css + settings + + foreground + #36c692 + + + + name + CSS Punctuation + scope + punctuation.definition.entity.css, punctuation.separator.key-value.css + settings + + foreground + #cf87e8 + + + + name + YAML Plain + scope + string.unquoted.plain.out.yaml + settings + + foreground + #c6c6c6 + + + + name + Vim Function + scope + support.function.viml + settings + + foreground + #cf87e8 + + + + name + Vim Type + scope + support.type.viml + settings + + foreground + #80a0ff + + + + name + CSS Property + scope + support.type.property-name.css + settings + + foreground + #79dac8 + + + + name + Shell Alias + scope + support.function.alias.shell + settings + + foreground + #79dac8 + + + + name + Shell Brace + scope + support.function.double-brace.begin.shell, support.function.double-brace.end.shell + settings + + foreground + #c6c6c6 + + + + uuid + uuid + + diff --git a/homes/emenel/dotfiles/dot_config/yazi/flavors/onedark.yazi/LICENSE b/homes/emenel/dotfiles/dot_config/yazi/flavors/onedark.yazi/LICENSE new file mode 100644 index 0000000..9a5124e --- /dev/null +++ b/homes/emenel/dotfiles/dot_config/yazi/flavors/onedark.yazi/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2023 - sxyazi + +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/homes/emenel/dotfiles/dot_config/yazi/flavors/onedark.yazi/LICENSE-tmtheme b/homes/emenel/dotfiles/dot_config/yazi/flavors/onedark.yazi/LICENSE-tmtheme new file mode 100644 index 0000000..44b4479 --- /dev/null +++ b/homes/emenel/dotfiles/dot_config/yazi/flavors/onedark.yazi/LICENSE-tmtheme @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 Himanshu + +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/homes/emenel/dotfiles/dot_config/yazi/flavors/onedark.yazi/README.md b/homes/emenel/dotfiles/dot_config/yazi/flavors/onedark.yazi/README.md new file mode 100644 index 0000000..99cf33f --- /dev/null +++ b/homes/emenel/dotfiles/dot_config/yazi/flavors/onedark.yazi/README.md @@ -0,0 +1,37 @@ +
+ Yazi logo +
+ +

+ Onedark Flavor for Yazi +

+ +## 👀 Preview + + + +## 🎨 Installation + +```bash +# Linux/macOS +git clone https://github.com/BennyOe/onedark.yazi.git ~/.config/yazi/flavors/onedark.yazi + +# Windows +git clone https://github.com/BennyOe/onedark.yazi.git %AppData%\yazi\config\flavors\onedark.yazi +``` + +## ⚙️ Usage + +Add the these lines to your `theme.toml` configuration file to use it: + + +```toml +[flavor] +use = "onedark" +``` + +## 📜 License + +The flavor is MIT-licensed, and the included tmTheme is also MIT-licensed. + +Check the [LICENSE](LICENSE) and [LICENSE-tmtheme](LICENSE-tmtheme) file for more details. diff --git a/homes/emenel/dotfiles/dot_config/yazi/flavors/onedark.yazi/flavor.toml b/homes/emenel/dotfiles/dot_config/yazi/flavors/onedark.yazi/flavor.toml new file mode 100644 index 0000000..8bd1615 --- /dev/null +++ b/homes/emenel/dotfiles/dot_config/yazi/flavors/onedark.yazi/flavor.toml @@ -0,0 +1,151 @@ +# : Manager {{{ +[manager] +cwd = { fg = "#61AFEF" } # Blue + +# Hovered +hovered = { bg = "#282C34" } # Darkened background +preview_hovered = { underline = true } + +# Find +find_keyword = { fg = "#E06C75", italic = true, underline = true } # Red +find_position = { fg = "#E5C07B", italic = true } # Orange + +# Marker +marker_copied = { fg = "#ABB2BF", bg = "#98C379" } # Light gray on Green +marker_cut = { fg = "#ABB2BF", bg = "#E06C75" } # Light gray on Red +marker_marked = { fg = "#ABB2BF", bg = "#56B6C2" } # Light gray on cyan +marker_selected = { fg = "#ABB2BF", bg = "#E5C07B" } # Light gray on Orange + +# Tab +tab_active = { bg = "#282C34", fg = "#61AFEF" } # Darkened background, Blue text +tab_inactive = {} +tab_width = 1 + +# Count +count_copied = { fg = "#98C379", bg = "#282C34" } # Green on Darkened background +count_cut = { fg = "#E06C75", bg = "#282C34" } # Red on Darkened background +count_selected = { fg = "#98C379", bg = "#282C34" } # Green on Darkened background + +# Border +border_symbol = "│" +border_style = { fg = "#282C34" } # Darkened background + +# : }}} + +# : Status {{{ +[status] +separator_open = "" +separator_close = "" +separator_style = { fg = "#61AFEF", bg = "#282C34" } # Blue on Darkened background + +# Mode +mode_normal = { fg = "#282C34", bg = "#61AFEF", bold = true } # Dark gray on Blue +mode_select = { fg = "#282C34", bg = "#61AFEF", bold = true } # Dark gray on Blue +mode_unset = { fg = "#282C34", bg = "#61AFEF", bold = true } # Dark gray on Blue + +# Progress +progress_label = { fg = "#ABB2BF", bold = true } # Light gray +progress_normal = { fg = "#98C379", bg = "#282C34" } # Green on Darkened background +progress_error = { fg = "#E06C75", bg = "#282C34" } # Red on Darkened background + +# Permissions +permissions_t = { fg = "#98C379" } # Green +permissions_r = { fg = "#E06C75" } # Red +permissions_w = { fg = "#E5C07B" } # Orange +permissions_x = { fg = "#98C379" } # Green +permissions_s = { fg = "#ABB2BF" } # Light gray + +# : }}} + +# : Select {{{ +[select] +border = { fg = "#98C379" } # Green +active = { fg = "#E5C07B", bold = true } # Orange +inactive = {} + +# : }}} + +# : Input {{{ +[input] +border = { fg = "#98C379" } # Green +title = {} +value = {} +selected = { reversed = true } + +# : }}} + +# : Completion {{{ +[completion] +border = { fg = "#98C379" } # Green + +# : }}} + +# : Tasks {{{ +[tasks] +border = { fg = "#98C379" } # Green +title = {} +hovered = { fg = "#E5C07B", underline = true } # Orange + +# : }}} + +# : Which {{{ +[which] +mask = { bg = "#282C34" } # Darkened background +cand = { fg = "#98C379" } # Green +rest = { fg = "#ABB2BF" } # Light gray +desc = { fg = "#E5C07B" } # Orange +separator = "  " +separator_style = { fg = "#ABB2BF" } # Light gray + +# : }}} + +# : Help {{{ +[help] +on = { fg = "#98C379" } # Green +run = { fg = "#E5C07B" } # Orange +hovered = { reversed = true, bold = true } +footer = { fg = "#ABB2BF", bg = "#000000" } # Light gray on Black + +# : }}} + +# : Notify {{{ +[notify] +title_info = { fg = "#98C379" } # Green +title_warn = { fg = "#E06C75" } # Red +title_error = { fg = "#E5C07B" } # Orange + +# : }}} + +# : File-specific styles {{{ + +[filetype] + +rules = [ + # Images + { mime = "image/*", fg = "#E5C07B" }, # Orange + + # Media + { mime = "video/*", fg = "#E06C75" }, # Red + { mime = "audio/*", fg = "#E06C75" }, # Red + + # Archives + { mime = "application/zip", fg = "#C678DD" }, # Magenta + { mime = "application/x-tar", fg = "#C678DD" }, # Magenta + { mime = "application/x-bzip*", fg = "#C678DD" }, # Magenta + { mime = "application/x-bzip2", fg = "#C678DD" }, # Magenta + { mime = "application/x-7z-compressed", fg = "#C678DD" }, # Magenta + { mime = "application/x-rar", fg = "#C678DD" }, # Magenta + { mime = "application/x-xz", fg = "#C678DD" }, # Magenta + + # Documents + { mime = "application/doc", fg = "#98C379" }, # Green + { mime = "application/pdf", fg = "#98C379" }, # Green + { mime = "application/rtf", fg = "#98C379" }, # Green + { mime = "application/vnd.*", fg = "#98C379" }, # Green + + # Fallback + { name = "*", fg = "#ABB2BF" }, # Blue + { name = "*/", fg = "#61AFEF" } # Blue +] + +# : }}} diff --git a/homes/emenel/dotfiles/dot_config/yazi/flavors/onedark.yazi/preview.png b/homes/emenel/dotfiles/dot_config/yazi/flavors/onedark.yazi/preview.png new file mode 100644 index 0000000..61c9d70 Binary files /dev/null and b/homes/emenel/dotfiles/dot_config/yazi/flavors/onedark.yazi/preview.png differ diff --git a/homes/emenel/dotfiles/dot_config/yazi/flavors/onedark.yazi/tmtheme.xml b/homes/emenel/dotfiles/dot_config/yazi/flavors/onedark.yazi/tmtheme.xml new file mode 100644 index 0000000..3214d2a --- /dev/null +++ b/homes/emenel/dotfiles/dot_config/yazi/flavors/onedark.yazi/tmtheme.xml @@ -0,0 +1,560 @@ + + + + + author + Template: Chris Kempson, Scheme: Lalit Magant (http://github.com/tilal6991) + name + Base16 OneDark + semanticClass + theme.base16.onedark + colorSpaceName + sRGB + gutterSettings + + background + #353b45 + divider + #353b45 + foreground + #545862 + selectionBackground + #3e4451 + selectionForeground + #565c64 + + settings + + + settings + + background + #282c34 + caret + #abb2bf + foreground + #abb2bf + invisibles + #545862 + lineHighlight + #54586255 + selection + #3e4451 + + + + name + Text + scope + variable.parameter.function + settings + + foreground + #abb2bf + + + + name + Comments + scope + comment, punctuation.definition.comment + settings + + foreground + #545862 + + + + name + Punctuation + scope + punctuation.definition.string, punctuation.definition.variable, punctuation.definition.string, punctuation.definition.parameters, punctuation.definition.string, punctuation.definition.array + settings + + foreground + #abb2bf + + + + name + Delimiters + scope + none + settings + + foreground + #abb2bf + + + + name + Operators + scope + keyword.operator + settings + + foreground + #abb2bf + + + + name + Keywords + scope + keyword + settings + + foreground + #c678dd + + + + name + Variables + scope + variable + settings + + foreground + #e06c75 + + + + name + Functions + scope + entity.name.function, meta.require, support.function.any-method, variable.function, variable.annotation, support.macro + settings + + foreground + #61afef + + + + name + Labels + scope + entity.name.label + settings + + foreground + #be5046 + + + + name + Classes + scope + support.class, entity.name.class, entity.name.type.class + settings + + foreground + #e5c07b + + + + name + Classes + scope + meta.class + settings + + foreground + #c8ccd4 + + + + name + Methods + scope + keyword.other.special-method + settings + + foreground + #61afef + + + + name + Storage + scope + storage + settings + + foreground + #c678dd + + + + name + Support + scope + support.function + settings + + foreground + #56b6c2 + + + + name + Strings, Inherited Class + scope + string, constant.other.symbol, entity.other.inherited-class + settings + + foreground + #98c379 + + + + name + Integers + scope + constant.numeric + settings + + foreground + #d19a66 + + + + name + Floats + scope + none + settings + + foreground + #d19a66 + + + + name + Boolean + scope + none + settings + + foreground + #d19a66 + + + + name + Constants + scope + constant + settings + + foreground + #d19a66 + + + + name + Tags + scope + entity.name.tag + settings + + foreground + #e06c75 + + + + name + Attributes + scope + entity.other.attribute-name + settings + + foreground + #d19a66 + + + + name + Attribute IDs + scope + entity.other.attribute-name.id, punctuation.definition.entity + settings + + foreground + #61afef + + + + name + Selector + scope + meta.selector + settings + + foreground + #c678dd + + + + name + Values + scope + none + settings + + foreground + #d19a66 + + + + name + Headings + scope + markup.heading punctuation.definition.heading, entity.name.section + settings + + fontStyle + + foreground + #61afef + + + + name + Units + scope + keyword.other.unit + settings + + foreground + #d19a66 + + + + name + Bold + scope + markup.bold, punctuation.definition.bold + settings + + fontStyle + bold + foreground + #e5c07b + + + + name + Italic + scope + markup.italic, punctuation.definition.italic + settings + + fontStyle + italic + foreground + #c678dd + + + + name + Code + scope + markup.raw.inline + settings + + foreground + #98c379 + + + + name + Link Text + scope + string.other.link, punctuation.definition.string.end.markdown, punctuation.definition.string.begin.markdown + settings + + foreground + #e06c75 + + + + name + Link Url + scope + meta.link + settings + + foreground + #d19a66 + + + + name + Lists + scope + markup.list + settings + + foreground + #e06c75 + + + + name + Quotes + scope + markup.quote + settings + + foreground + #d19a66 + + + + name + Separator + scope + meta.separator + settings + + background + #3e4451 + foreground + #abb2bf + + + + name + Inserted + scope + markup.inserted + settings + + foreground + #98c379 + + + + name + Deleted + scope + markup.deleted + settings + + foreground + #e06c75 + + + + name + Changed + scope + markup.changed + settings + + foreground + #c678dd + + + + name + Colors + scope + constant.other.color + settings + + foreground + #56b6c2 + + + + name + Regular Expressions + scope + string.regexp + settings + + foreground + #56b6c2 + + + + name + Escape Characters + scope + constant.character.escape + settings + + foreground + #56b6c2 + + + + name + Embedded + scope + punctuation.section.embedded, variable.interpolation + settings + + foreground + #c678dd + + + + name + Illegal + scope + invalid.illegal + settings + + background + #e06c75 + foreground + #c8ccd4 + + + + name + Broken + scope + invalid.broken + settings + + background + #d19a66 + foreground + #282c34 + + + + name + Deprecated + scope + invalid.deprecated + settings + + background + #be5046 + foreground + #c8ccd4 + + + + name + Unimplemented + scope + invalid.unimplemented + settings + + background + #545862 + foreground + #c8ccd4 + + + + uuid + uuid + + diff --git a/homes/emenel/dotfiles/dot_config/yazi/init.lua b/homes/emenel/dotfiles/dot_config/yazi/init.lua index 4102d2c..d5f396a 100644 --- a/homes/emenel/dotfiles/dot_config/yazi/init.lua +++ b/homes/emenel/dotfiles/dot_config/yazi/init.lua @@ -1,22 +1,94 @@ -Status:children_add(function(self) - local h = self._current.hovered - if h and h.link_to then - return " -> " .. tostring(h.link_to) - else - return "" - end -end, 3300, Status.LEFT) +require("git"):setup() +require("yatline-symlink"):setup() -Status:children_add(function() - local h = cx.active.current.hovered - if h == nil or ya.target_family() ~= "unix" then - return "" - end +require("yatline"):setup({ + --theme = my_theme, + section_separator = { open = "", close = "" }, + part_separator = { open = "", close = "" }, + inverse_separator = { open = "", close = "" }, - return ui.Line { - ui.Span(ya.user_name(h.cha.uid) or tostring(h.cha.uid)):fg("magenta"), - ":", - ui.Span(ya.group_name(h.cha.gid) or tostring(h.cha.gid)):fg("magenta"), - " ", - } -end, 500, Status.RIGHT) + style_a = { + fg = "black", + bg_mode = { + normal = "white", + select = "brightyellow", + un_set = "brightred" + } + }, + style_b = { bg = "#111111", fg = "brightwhite" }, + style_c = { bg = "#111111", fg = "brightwhite" }, + + permissions_t_fg = "green", + permissions_r_fg = "yellow", + permissions_w_fg = "red", + permissions_x_fg = "cyan", + permissions_s_fg = "white", + + tab_width = 20, + tab_use_inverse = false, + + selected = { icon = "󰻭", fg = "yellow" }, + copied = { icon = "", fg = "green" }, + cut = { icon = "", fg = "red" }, + + total = { icon = "󰮍", fg = "yellow" }, + succ = { icon = "", fg = "green" }, + fail = { icon = "", fg = "red" }, + found = { icon = "󰮕", fg = "blue" }, + processed = { icon = "󰐍", fg = "green" }, + + show_background = true, + + display_header_line = true, + display_status_line = true, + + component_positions = { "header", "tab", "status" }, + + header_line = { + left = { + section_a = { + {type = "line", custom = false, name = "tabs", params = {"left"}}, + }, + section_b = { + }, + section_c = { + } + }, + right = { + section_a = { + }, + section_b = { + }, + section_c = { + } + } + }, + + status_line = { + left = { + section_a = { + {type = "string", custom = false, name = "tab_mode"}, + }, + section_b = { + {type = "string", custom = false, name = "hovered_size"}, + }, + section_c = { + {type = "string", custom = false, name = "hovered_path"}, + { type = "coloreds", custom = false, name = "symlink" }, + {type = "coloreds", custom = false, name = "count"}, + } + }, + right = { + section_a = { + {type = "string", custom = false, name = "cursor_position"}, + }, + section_b = { + {type = "string", custom = false, name = "cursor_percentage"}, + }, + section_c = { + {type = "string", custom = false, name = "hovered_file_extension", params = {true}}, + {type = "coloreds", custom = false, name = "permissions"}, + } + } + } +}) diff --git a/homes/emenel/dotfiles/dot_config/yazi/plugins/chmod.yazi/LICENSE b/homes/emenel/dotfiles/dot_config/yazi/plugins/chmod.yazi/LICENSE new file mode 100644 index 0000000..fb5b1d6 --- /dev/null +++ b/homes/emenel/dotfiles/dot_config/yazi/plugins/chmod.yazi/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2023 yazi-rs + +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/homes/emenel/dotfiles/dot_config/yazi/plugins/chmod.yazi/README.md b/homes/emenel/dotfiles/dot_config/yazi/plugins/chmod.yazi/README.md new file mode 100644 index 0000000..e8a6614 --- /dev/null +++ b/homes/emenel/dotfiles/dot_config/yazi/plugins/chmod.yazi/README.md @@ -0,0 +1,28 @@ +# chmod.yazi + +Execute `chmod` on the selected files to change their mode. This plugin is only available on Unix platforms since it relies on [`chmod(2)`](https://man7.org/linux/man-pages/man2/chmod.2.html). + +https://github.com/yazi-rs/plugins/assets/17523360/7aa3abc2-d057-498c-8473-a6282c59c464 + +## Installation + +```sh +ya pack -a yazi-rs/plugins:chmod +``` + +## Usage + +Add this to your `~/.config/yazi/keymap.toml`: + +```toml +[[manager.prepend_keymap]] +on = [ "c", "m" ] +run = "plugin chmod" +desc = "Chmod on selected files" +``` + +Make sure the c => m key is not used elsewhere. + +## License + +This plugin is MIT-licensed. For more information check the [LICENSE](LICENSE) file. diff --git a/homes/emenel/dotfiles/dot_config/yazi/plugins/chmod.yazi/main.lua b/homes/emenel/dotfiles/dot_config/yazi/plugins/chmod.yazi/main.lua new file mode 100644 index 0000000..183c31e --- /dev/null +++ b/homes/emenel/dotfiles/dot_config/yazi/plugins/chmod.yazi/main.lua @@ -0,0 +1,39 @@ +local selected_or_hovered = ya.sync(function() + local tab, paths = cx.active, {} + for _, u in pairs(tab.selected) do + paths[#paths + 1] = tostring(u) + end + if #paths == 0 and tab.current.hovered then + paths[1] = tostring(tab.current.hovered.url) + end + return paths +end) + +return { + entry = function() + ya.manager_emit("escape", { visual = true }) + + local urls = selected_or_hovered() + if #urls == 0 then + return ya.notify { title = "Chmod", content = "No file selected", level = "warn", timeout = 5 } + end + + local value, event = ya.input { + title = "Chmod:", + position = { "top-center", y = 3, w = 40 }, + } + if event ~= 1 then + return + end + + local status, err = Command("chmod"):arg(value):args(urls):spawn():wait() + if not status or not status.success then + ya.notify { + title = "Chmod", + content = string.format("Chmod on selected files failed, error: %s", status and status.code or err), + level = "error", + timeout = 5, + } + end + end, +} diff --git a/homes/emenel/dotfiles/dot_config/yazi/plugins/file-extra-metadata.yazi/LICENSE b/homes/emenel/dotfiles/dot_config/yazi/plugins/file-extra-metadata.yazi/LICENSE new file mode 100644 index 0000000..fb10e72 --- /dev/null +++ b/homes/emenel/dotfiles/dot_config/yazi/plugins/file-extra-metadata.yazi/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2024 boydaihungst + +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/homes/emenel/dotfiles/dot_config/yazi/plugins/file-extra-metadata.yazi/README.md b/homes/emenel/dotfiles/dot_config/yazi/plugins/file-extra-metadata.yazi/README.md new file mode 100644 index 0000000..29259b8 --- /dev/null +++ b/homes/emenel/dotfiles/dot_config/yazi/plugins/file-extra-metadata.yazi/README.md @@ -0,0 +1,102 @@ +# file-extra-metadata + + + +- [file-extra-metadata](#file-extra-metadata) + - [Preview](#preview) + - [Before:](#before) + - [After:](#after) + - [Requirements](#requirements) + - [Installation](#installation) + - [For developer](#for-developer) + + +This is a Yazi plugin that replaces the default file previewer and spotter with extra information. + +## Preview + +### Before: + +- Previewer + + ![Before preview](statics/2024-11-17-12-06-24.png) + +- Spotter (yazi >= v0.4 after 21/11/2024) + + ![Before spot](statics/2024-11-21-04-19-01.png) + +### After: + +- Previewer + +![After previewer](statics/2024-11-21-05-27-48.png) + +- Spotter (yazi >= v0.4 after 21/11/2024) + +![After spotter](statics/2024-11-21-05-29-50.png) + +## Requirements + +- [yazi >=0.4](https://github.com/sxyazi/yazi) +- Tested on Linux. For MacOS, Windows: some fields will shows empty values. + +## Installation + +Install the plugin: + +```sh +ya pack -a boydaihungst/file-extra-metadata +``` + +Add spotter keybind, makes sure not conflict with other `` keybind in +`manager` section: + +```toml +[manager] +keymap = [ + # ... + # Spotting + { on = "", run = "spot", desc = "Spot hovered file" }, +] +``` + +Create `~/.config/yazi/yazi.toml` and add: + +```toml +[plugin] + append_previewers = [ + { name = "*", run = "file-extra-metadata" }, + ] + # yazi v0.4 after 21/11/2024 + # Setup keybind for spotter: https://github.com/sxyazi/yazi/pull/1802 + append_spotters = [ + { name = "*", run = "file-extra-metadata" }, + ] +``` + +or + +```toml +[plugin] + previewers = [ + # ... the rest + # disable default file plugin { name = "*", run = "file" }, + { name = "*", run = "file-extra-metadata" }, + ] + # yazi v0.4 after 21/11/2024 + # Setup keybind for spotter: https://github.com/sxyazi/yazi/pull/1802 + spotters = [ + # ... the rest + # Fallback + # { name = "*", run = "file" }, + { name = "*", run = "file-extra-metadata" }, + ] +``` + +## For developer + +If you want to compile this with other spotter/previewer: + +```lua +require("file-extra-metadata"):render_table(job, { show_plugins_section = true }) +``` diff --git a/homes/emenel/dotfiles/dot_config/yazi/plugins/file-extra-metadata.yazi/main.lua b/homes/emenel/dotfiles/dot_config/yazi/plugins/file-extra-metadata.yazi/main.lua new file mode 100644 index 0000000..e4b6f75 --- /dev/null +++ b/homes/emenel/dotfiles/dot_config/yazi/plugins/file-extra-metadata.yazi/main.lua @@ -0,0 +1,489 @@ +local M = {} + +local function permission(file) + local h = file + if not h then + return "" + end + + local perm = h.cha:perm() + if not perm then + return "" + end + + local spans = "" + for i = 1, #perm do + local c = perm:sub(i, i) + spans = spans .. c + end + return spans +end + +local function link_count(file) + local h = file + if h == nil or ya.target_family() ~= "unix" then + return "" + end + + return h.cha.nlink +end + +local function owner_group(file) + local h = file + if h == nil or ya.target_family() ~= "unix" then + return "" + end + return (ya.user_name(h.cha.uid) or tostring(h.cha.uid)) .. "/" .. (ya.group_name(h.cha.gid) or tostring(h.cha.gid)) +end + +local file_size_and_folder_childs = function(file) + local h = file + if not h or h.cha.is_link then + return "" + end + + return h.cha.len and ya.readable_size(h.cha.len) or "" +end + +--- get file timestamp +---@param file any +---@param type "mtime" | "atime" | "btime" +---@return any +local function fileTimestamp(file, type) + local h = file + if not h or h.cha.is_link then + return "" + end + local time = math.floor(h.cha[type] or 0) + if time == 0 then + return "" + else + return os.date("%Y-%m-%d %H:%M", time) + end +end + +-- Function to split a string by spaces (considering multiple spaces as one delimiter) +local function split_by_whitespace(input) + local result = {} + for word in string.gmatch(input, "%S+") do + table.insert(result, word) + end + return result +end + +local function get_filesystem_extra(file) + local result = { + filesystem = "", + device = "", + type = "", + used_space = "", + avail_space = "", + total_space = "", + used_space_percent = "", + avail_space_percent = "", + error = nil, + } + local h = file + local file_url = tostring(h.url) + if not h or ya.target_family() ~= "unix" then + return result + end + + local output, _ = Command("tail") + :args({ "-n", "-1" }) + :stdin(Command("df"):args({ "-P", "-T", "-h", file_url }):stdout(Command.PIPED):spawn():take_stdout()) + :stdout(Command.PIPED) + :output() + + if output then + -- Splitting the data + local parts = split_by_whitespace(output.stdout) + + -- Display the result + for i, part in ipairs(parts) do + if i == 1 then + result.filesystem = part + elseif i == 2 then + result.device = part + elseif i == 3 then + result.total_space = part + elseif i == 4 then + result.used_space = part + elseif i == 5 then + result.avail_space = part + elseif i == 6 then + result.used_space_percent = part + result.avail_space_percent = 100 - tonumber((string.match(part, "%d+") or "0")) + elseif i == 7 then + result.type = part + end + end + else + result.error = "tail, df are installed?" + end + return result +end + +local function attributes(file) + local h = file + local file_url = tostring(h.url) + if not h or ya.target_family() ~= "unix" then + return "" + end + + local output, _ = Command("lsattr"):args({ "-d", file_url }):stdout(Command.PIPED):output() + + if output then + -- Splitting the data + local parts = split_by_whitespace(output.stdout) + + -- Display the result + for i, part in ipairs(parts) do + if i == 1 then + return part + end + end + return "" + else + return "lsattr is installed?" + end +end + +---shorten string +---@param _s string string +---@param _t string tail +---@param _w number max characters +---@return string +local shorten = function(_s, _t, _w) + local s = _s or utf8.len(_s) + local t = _t or "" + local ellipsis = "…" .. t + local w = _w < utf8.len(ellipsis) and utf8.len(ellipsis) or _w + local n_ellipsis = utf8.len(ellipsis) or 0 + if utf8.len(s) > w then + return s:sub(1, (utf8.offset(s, w - n_ellipsis + 1) or 2) - 1) .. ellipsis + end + return s +end + +local is_supported_table = type(ui.Table) ~= "nil" and type(ui.Row) ~= "nil" + +local styles = { + header = ui.Style():fg("green"), + row_label = ui.Style():fg("reset"), + row_value = ui.Style():fg("blue"), + row_value_spot_hovered = ui.Style():fg("blue"):reverse(), +} + +function M:render_table(job, opts) + local filesystem_extra = get_filesystem_extra(job.file) + local prefix = " " + local label_lines, value_lines, rows = {}, {}, {} + local label_max_length = 15 + local file_name_extension = job.file.cha.is_dir and "…" or ("." .. (job.file.url.ext(job.file.url) or "")) + + local row = function(key, value) + local h = type(value) == "table" and #value or 1 + rows[#rows + 1] = ui.Row({ ui.Line(key):style(styles.row_label), ui.Line(value):style(styles.row_value) }) + :height(h) + end + + local file_name = shorten( + job.file.name, + file_name_extension, + math.floor(job.area.w - label_max_length - utf8.len(file_name_extension)) + ) + local location = + shorten(tostring(job.file.url:parent()), "", math.floor(job.area.w - label_max_length - utf8.len(prefix))) + local filesystem_error = filesystem_extra.error + and shorten(filesystem_extra.error, "", math.floor(job.area.w - label_max_length - utf8.len(prefix))) + or nil + local filesystem = + shorten(filesystem_extra.filesystem, "", math.floor(job.area.w - label_max_length - utf8.len(prefix))) + + if not is_supported_table then + table.insert( + label_lines, + ui.Line({ + ui.Span("Metadata:"), + }):style(styles.header) + ) + table.insert( + value_lines, + ui.Line({ + ui.Span(""), + }) + ) + + table.insert( + label_lines, + ui.Line({ + ui.Span(prefix), + ui.Span("File:"), + }):style(styles.row_label) + ) + table.insert( + value_lines, + ui.Line({ + ui.Span(file_name), + }):style(styles.row_value) + ) + + table.insert( + label_lines, + ui.Line({ + ui.Span(prefix), + ui.Span("Mimetype: "), + }):style(styles.row_label) + ) + table.insert(value_lines, ui.Line(ui.Span(job._mime or job.mime)):style(styles.row_value)) + + table.insert( + label_lines, + ui.Line({ + ui.Span(prefix), + ui.Span("Location: "), + }):style(styles.row_label) + ) + table.insert( + value_lines, + ui.Line({ + ui.Span(location), + }):style(styles.row_value) + ) + + table.insert( + label_lines, + ui.Line({ + ui.Span(prefix), + ui.Span("Mode: "), + }):style(styles.row_label) + ) + table.insert(value_lines, ui.Line(permission(job.file)):style(styles.row_value)) + + table.insert( + label_lines, + ui.Line({ + ui.Span(prefix), + ui.Span("Attributes: "), + }):style(styles.row_label) + ) + table.insert(value_lines, ui.Line(ui.Span(attributes(job.file))):style(styles.row_value)) + + table.insert( + label_lines, + ui.Line({ + ui.Span(prefix), + ui.Span("Links: "), + }):style(styles.row_label) + ) + table.insert( + value_lines, + ui.Line({ + ui.Span(tostring(link_count(job.file))), + }):style(styles.row_value) + ) + + table.insert( + label_lines, + ui.Line({ + ui.Span(prefix), + ui.Span("Owner: "), + }):style(styles.row_label) + ) + table.insert(value_lines, ui.Line(ui.Span(owner_group(job.file))):style(styles.row_value)) + + table.insert( + label_lines, + ui.Line({ + ui.Span(prefix), + ui.Span("Size: "), + }):style(styles.row_label) + ) + table.insert(value_lines, ui.Line(ui.Span(file_size_and_folder_childs(job.file))):style(styles.row_value)) + + table.insert( + label_lines, + ui.Line({ + ui.Span(prefix), + ui.Span("Created: "), + }):style(styles.row_label) + ) + table.insert(value_lines, ui.Line(ui.Span(fileTimestamp(job.file, "btime"))):style(styles.row_value)) + + table.insert( + label_lines, + ui.Line({ + ui.Span(prefix), + ui.Span("Modified: "), + }):style(styles.row_label) + ) + table.insert(value_lines, ui.Line(ui.Span(fileTimestamp(job.file, "mtime"))):style(styles.row_value)) + + table.insert( + label_lines, + ui.Line({ + ui.Span(prefix), + ui.Span("Accessed: "), + }):style(styles.row_label) + ) + table.insert(value_lines, ui.Line(ui.Span(fileTimestamp(job.file, "atime"))):style(styles.row_value)) + + table.insert( + label_lines, + ui.Line({ + ui.Span(prefix), + ui.Span("Filesystem: "), + }):style(styles.row_label) + ) + table.insert(value_lines, ui.Line(ui.Span(filesystem_error or filesystem)):style(styles.row_value)) + + table.insert( + label_lines, + ui.Line({ + ui.Span(prefix), + ui.Span("Device: "), + }):style(styles.row_label) + ) + table.insert(value_lines, ui.Line(ui.Span(filesystem_error or filesystem_extra.device)):style(styles.row_value)) + + table.insert( + label_lines, + ui.Line({ + ui.Span(prefix), + ui.Span("Type: "), + }):style(styles.row_label) + ) + table.insert(value_lines, ui.Line(ui.Span(filesystem_error or filesystem_extra.type)):style(styles.row_value)) + + table.insert( + label_lines, + ui.Line({ + ui.Span(prefix), + ui.Span("Free space: "), + }):style(styles.row_label) + ) + table.insert( + value_lines, + ui.Line( + ui.Span( + filesystem_extra.error + or ( + filesystem_extra.avail_space + .. " / " + .. filesystem_extra.total_space + .. " (" + .. filesystem_extra.avail_space_percent + .. "%)" + ) + ) + ):style(styles.row_value) + ) + else + rows[#rows + 1] = ui.Row({ "Metadata", "" }):style(styles.header) + row(prefix .. "File:", file_name) + row(prefix .. "Mimetype:", job.mime) + row(prefix .. "Location:", location) + row(prefix .. "Mode:", permission(job.file)) + row(prefix .. "Attributes:", attributes(job.file)) + row(prefix .. "Links:", tostring(link_count(job.file))) + row(prefix .. "Owner:", owner_group(job.file)) + row(prefix .. "Size:", file_size_and_folder_childs(job.file)) + row(prefix .. "Created:", fileTimestamp(job.file, "btime")) + row(prefix .. "Modified:", fileTimestamp(job.file, "mtime")) + row(prefix .. "Accessed:", fileTimestamp(job.file, "atime")) + row(prefix .. "Filesystem:", filesystem_error or filesystem) + row(prefix .. "Device:", filesystem_error or filesystem_extra.device) + row(prefix .. "Type:", filesystem_error or filesystem_extra.type) + row( + prefix .. "Free space:", + filesystem_error + or ( + ( + filesystem_extra.avail_space + and filesystem_extra.total_space + and filesystem_extra.avail_space_percent + ) + and (filesystem_extra.avail_space .. " / " .. filesystem_extra.total_space .. " (" .. filesystem_extra.avail_space_percent .. "%)") + or "" + ) + ) + if opts and opts.show_plugins_section and PLUGIN then + local spotter = PLUGIN.spotter(job.file.url, job.mime) + local previewer = PLUGIN.previewer(job.file.url, job.mime) + local fetchers = PLUGIN.fetchers(job.file, job.mime) + local preloaders = PLUGIN.preloaders(job.file.url, job.mime) + + for i, v in ipairs(fetchers) do + fetchers[i] = v.cmd + end + for i, v in ipairs(preloaders) do + preloaders[i] = v.cmd + end + + rows[#rows + 1] = ui.Row({ { "", "Plugins" }, "" }):height(2):style(styles.header) + row(prefix .. "Spotter:", spotter and spotter.cmd or "") + row(prefix .. "Previewer:", previewer and previewer.cmd or "") + row(prefix .. "Fetchers:", #fetchers ~= 0 and fetchers or "") + row(prefix .. "Preloaders:", #preloaders ~= 0 and preloaders or "") + end + end + + if not is_supported_table then + local areas = ui.Layout() + :direction(ui.Layout.HORIZONTAL) + :constraints({ ui.Constraint.Length(label_max_length), ui.Constraint.Fill(1) }) + :split(job.area) + local label_area = areas[1] + local value_area = areas[2] + return { + ui.Text(label_lines):area(label_area):align(ui.Text.LEFT):wrap(ui.Text.WRAP_NO), + ui.Text(value_lines):area(value_area):align(ui.Text.LEFT):wrap(ui.Text.WRAP_NO), + } + else + return { + ui.Table(rows):area(job.area):row(1):col(1):col_style(styles.row_value):widths({ + ui.Constraint.Length(label_max_length), + ui.Constraint.Fill(1), + }), + } + end +end + +function M:peek(job) + local start, cache = os.clock(), ya.file_cache(job) + if not cache or self:preload(job) ~= 1 then + return 1 + end + ya.sleep(math.max(0, PREVIEW.image_delay / 1000 + start - os.clock())) + ya.preview_widgets(job, self:render_table(job)) +end + +function M:seek(job) + local h = cx.active.current.hovered + if h and h.url == job.file.url then + local step = math.floor(job.units * job.area.h / 10) + ya.manager_emit("peek", { + tostring(math.max(0, cx.active.preview.skip + step)), + only_if = tostring(job.file.url), + }) + end +end + +function M:preload(job) + local cache = ya.file_cache(job) + if not cache or fs.cha(cache) then + return 1 + end + return 1 +end + +function M:spot(job) + job.area = ui.Pos({ "center", w = 80, h = 25 }) + ya.spot_table( + job, + self:render_table(job, { show_plugins_section = true })[1]:cell_style(styles.row_value_spot_hovered) + ) +end + +return M diff --git a/homes/emenel/dotfiles/dot_config/yazi/plugins/git.yazi/LICENSE b/homes/emenel/dotfiles/dot_config/yazi/plugins/git.yazi/LICENSE new file mode 100644 index 0000000..fb5b1d6 --- /dev/null +++ b/homes/emenel/dotfiles/dot_config/yazi/plugins/git.yazi/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2023 yazi-rs + +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/homes/emenel/dotfiles/dot_config/yazi/plugins/git.yazi/README.md b/homes/emenel/dotfiles/dot_config/yazi/plugins/git.yazi/README.md new file mode 100644 index 0000000..f17d7b3 --- /dev/null +++ b/homes/emenel/dotfiles/dot_config/yazi/plugins/git.yazi/README.md @@ -0,0 +1,78 @@ +# git.yazi + +> [!NOTE] +> Yazi v0.4.1 or later is required for this plugin to work. + +Show the status of Git file changes as linemode in the file list. + +https://github.com/user-attachments/assets/34976be9-a871-4ffe-9d5a-c4cdd0bf4576 + +## Installation + +```sh +ya pack -a yazi-rs/plugins:git +``` + +## Setup + +Add the following to your `~/.config/yazi/init.lua`: + +```lua +require("git"):setup() +``` + +And register it as fetchers in your `~/.config/yazi/yazi.toml`: + +```toml +[[plugin.prepend_fetchers]] +id = "git" +name = "*" +run = "git" + +[[plugin.prepend_fetchers]] +id = "git" +name = "*/" +run = "git" +``` + +## Advanced + +You can customize the [Style](https://yazi-rs.github.io/docs/plugins/layout#style) of the status sign with: + +- `THEME.git.modified` +- `THEME.git.added` +- `THEME.git.untracked` +- `THEME.git.ignored` +- `THEME.git.deleted` +- `THEME.git.updated` + +For example: + +```lua +-- ~/.config/yazi/init.lua +THEME.git = THEME.git or {} +THEME.git.modified = ui.Style():fg("blue") +THEME.git.deleted = ui.Style():fg("red"):bold() +``` + +You can also customize the text of the status sign with: + +- `THEME.git.modified_sign` +- `THEME.git.added_sign` +- `THEME.git.untracked_sign` +- `THEME.git.ignored_sign` +- `THEME.git.deleted_sign` +- `THEME.git.updated_sign` + +For example: + +```lua +-- ~/.config/yazi/init.lua +THEME.git = THEME.git or {} +THEME.git.modified_sign = "M" +THEME.git.deleted_sign = "D" +``` + +## License + +This plugin is MIT-licensed. For more information check the [LICENSE](LICENSE) file. diff --git a/homes/emenel/dotfiles/dot_config/yazi/plugins/git.yazi/main.lua b/homes/emenel/dotfiles/dot_config/yazi/plugins/git.yazi/main.lua new file mode 100644 index 0000000..d629d7d --- /dev/null +++ b/homes/emenel/dotfiles/dot_config/yazi/plugins/git.yazi/main.lua @@ -0,0 +1,217 @@ +local WIN = ya.target_family() == "windows" +local PATS = { + { "[MT]", 6 }, -- Modified + { "[AC]", 5 }, -- Added + { "?$", 4 }, -- Untracked + { "!$", 3 }, -- Ignored + { "D", 2 }, -- Deleted + { "U", 1 }, -- Updated + { "[AD][AD]", 1 }, -- Updated +} + +local function match(line) + local signs = line:sub(1, 2) + for _, p in ipairs(PATS) do + local path + if signs:find(p[1]) then + path = line:sub(4, 4) == '"' and line:sub(5, -2) or line:sub(4) + path = WIN and path:gsub("/", "\\") or path + end + if not path then + elseif path:find("[/\\]$") then + return p[2] == 3 and 30 or p[2], path:sub(1, -2) + else + return p[2], path + end + end +end + +local function root(cwd) + local is_worktree = function(url) + local file, head = io.open(tostring(url)), nil + if file then + head = file:read(8) + file:close() + end + return head == "gitdir: " + end + + repeat + local next = cwd:join(".git") + local cha = fs.cha(next) + if cha and (cha.is_dir or is_worktree(next)) then + return tostring(cwd) + end + cwd = cwd:parent() + until not cwd +end + +local function bubble_up(changed) + local new, empty = {}, Url("") + for k, v in pairs(changed) do + if v ~= 3 and v ~= 30 then + local url = Url(k):parent() + while url and url ~= empty do + local s = tostring(url) + new[s] = (new[s] or 0) > v and new[s] or v + url = url:parent() + end + end + end + return new +end + +local function propagate_down(ignored, cwd, repo) + local new, rel = {}, cwd:strip_prefix(repo) + for k, v in pairs(ignored) do + if v == 30 then + if rel:starts_with(k) then + new[tostring(repo:join(rel))] = 30 + elseif cwd == repo:join(k):parent() then + new[k] = 3 + end + end + end + return new +end + +local add = ya.sync(function(st, cwd, repo, changed) + st.dirs[cwd] = repo + st.repos[repo] = st.repos[repo] or {} + for k, v in pairs(changed) do + if v == 0 then + st.repos[repo][k] = nil + elseif v == 30 then + st.dirs[k] = "" + else + st.repos[repo][k] = v + end + end + ya.render() +end) + +local remove = ya.sync(function(st, cwd) + local dir = st.dirs[cwd] + if not dir then + return + end + + ya.render() + st.dirs[cwd] = nil + if not st.repos[dir] then + return + end + + for _, r in pairs(st.dirs) do + if r == dir then + return + end + end + st.repos[dir] = nil +end) + +local function setup(st, opts) + st.dirs = {} + st.repos = {} + + opts = opts or {} + opts.order = opts.order or 1500 + + -- Chosen by ChatGPT fairly, PRs are welcome to adjust them + local t = THEME.git or {} + local styles = { + [6] = t.modified and ui.Style(t.modified) or ui.Style():fg("#ffa500"), + [5] = t.added and ui.Style(t.added) or ui.Style():fg("#32cd32"), + [4] = t.untracked and ui.Style(t.untracked) or ui.Style():fg("#a9a9a9"), + [3] = t.ignored and ui.Style(t.ignored) or ui.Style():fg("#696969"), + [2] = t.deleted and ui.Style(t.deleted) or ui.Style():fg("#ff4500"), + [1] = t.updated and ui.Style(t.updated) or ui.Style():fg("#1e90ff"), + } + local signs = { + [6] = t.modified_sign and t.modified_sign or "", + [5] = t.added_sign and t.added_sign or "", + [4] = t.untracked_sign and t.untracked_sign or "", + [3] = t.ignored_sign and t.ignored_sign or "", + [2] = t.deleted_sign and t.deleted_sign or "", + [1] = t.updated_sign and t.updated_sign or "U", + } + + Linemode:children_add(function(self) + local url = self._file.url + local dir = st.dirs[tostring(url:parent())] + local change + if dir then + change = dir == "" and 3 or st.repos[dir][tostring(url):sub(#dir + 2)] + end + + if not change or signs[change] == "" then + return "" + elseif self._file:is_hovered() then + return ui.Line { " ", signs[change] } + else + return ui.Line { " ", ui.Span(signs[change]):style(styles[change]) } + end + end, opts.order) +end + +local function fetch(_, job) + local cwd = job.files[1].url:parent() + local repo = root(cwd) + if not repo then + remove(tostring(cwd)) + if not ya.__250127 then -- TODO: remove this + return 1 + end + return true + end + + local paths = {} + for _, f in ipairs(job.files) do + paths[#paths + 1] = tostring(f.url) + end + + -- stylua: ignore + local output, err = Command("git") + :cwd(tostring(cwd)) + :args({ "--no-optional-locks", "-c", "core.quotePath=", "status", "--porcelain", "-unormal", "--no-renames", "--ignored=matching" }) + :args(paths) + :stdout(Command.PIPED) + :output() + if not output then + if not ya.__250127 then -- TODO: remove this + ya.err("Cannot spawn git command, error: " .. err) + return 0 + end + return true, Err("Cannot spawn `git` command, error: %s", err) + end + + local changed, ignored = {}, {} + for line in output.stdout:gmatch("[^\r\n]+") do + local sign, path = match(line) + if sign == 30 then + ignored[path] = sign + else + changed[path] = sign + end + end + + if job.files[1].cha.is_dir then + ya.dict_merge(changed, bubble_up(changed)) + ya.dict_merge(changed, propagate_down(ignored, cwd, Url(repo))) + else + ya.dict_merge(changed, propagate_down(ignored, cwd, Url(repo))) + end + + for _, p in ipairs(paths) do + local s = p:sub(#repo + 2) + changed[s] = changed[s] or 0 + end + add(tostring(cwd), repo, changed) + + if not ya.__250127 then -- TODO: remove this + return 3 + end + return false +end + +return { setup = setup, fetch = fetch } diff --git a/homes/emenel/dotfiles/dot_config/yazi/plugins/glow.yazi/LICENSE b/homes/emenel/dotfiles/dot_config/yazi/plugins/glow.yazi/LICENSE new file mode 100644 index 0000000..de882e5 --- /dev/null +++ b/homes/emenel/dotfiles/dot_config/yazi/plugins/glow.yazi/LICENSE @@ -0,0 +1,7 @@ +Copyright © 2024 Reledia + +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/homes/emenel/dotfiles/dot_config/yazi/plugins/glow.yazi/README.md b/homes/emenel/dotfiles/dot_config/yazi/plugins/glow.yazi/README.md new file mode 100644 index 0000000..c67f7cc --- /dev/null +++ b/homes/emenel/dotfiles/dot_config/yazi/plugins/glow.yazi/README.md @@ -0,0 +1,30 @@ +# glow.yazi + +Plugin for [Yazi](https://github.com/sxyazi/yazi) to preview markdown files with [glow](https://github.com/charmbracelet/glow). To install, run the below mentioned command: + +```bash +ya pack -a Reledia/glow +``` + +then include it in your `yazi.toml` to use: + +```toml +[plugin] +prepend_previewers = [ + { name = "*.md", run = "glow" }, +] +``` + +Make sure you have [glow](https://github.com/charmbracelet/glow) installed, and can be found in `PATH`. + +## Feature + ++ You can modify line wrap in `init.lua`, the current value is 55. ++ You can press `ctrl+e` to scroll up and `ctrl+y` to scroll down the readme file in preview panel in yazi: (add this to `keymap.toml`) +```toml +prepend_keymap = [ + # glow.yazi + { on = [""], run = "seek 5" }, + { on = [""], run = "seek -5" }, +] +``` diff --git a/homes/emenel/dotfiles/dot_config/yazi/plugins/glow.yazi/main.lua b/homes/emenel/dotfiles/dot_config/yazi/plugins/glow.yazi/main.lua new file mode 100644 index 0000000..cc813e9 --- /dev/null +++ b/homes/emenel/dotfiles/dot_config/yazi/plugins/glow.yazi/main.lua @@ -0,0 +1,76 @@ +local M = {} + +function M:peek(job) + -- Set a fixed width of 55 characters for the preview + local preview_width = 55 + + local child = Command("glow") + :args({ + "--style", + "dark", + "--width", + tostring(preview_width), -- Use fixed width instead of job.area.w + tostring(job.file.url), + }) + :env("CLICOLOR_FORCE", "1") + :stdout(Command.PIPED) + :stderr(Command.PIPED) + :spawn() + + if not child then + return require("code").peek(job) + end + + local limit = job.area.h + local i, lines = 0, "" + repeat + local next, event = child:read_line() + if event == 1 then + return require("code").peek(job) + elseif event ~= 0 then + break + end + + i = i + 1 + if i > job.skip then + lines = lines .. next + end + until i >= job.skip + limit + + child:start_kill() + if job.skip > 0 and i < job.skip + limit then + ya.manager_emit("peek", { + tostring(math.max(0, i - limit)), + only_if = job.file.url, + upper_bound = true + }) + else + lines = lines:gsub("\t", string.rep(" ", PREVIEW.tab_size)) + ya.preview_widgets(job, { ui.Text.parse(lines):area(job.area) }) + end +end + +function M:seek(job) + local h = cx.active.current.hovered + if not h or h.url ~= job.file.url then + return + end + + local scroll_amount = 1 + local scroll_offset = job.units + + if job.key == "ctrl-e" then + scroll_offset = scroll_amount + elseif job.key == "ctrl-y" then + scroll_offset = -scroll_amount + else + scroll_offset = job.units + end + + ya.manager_emit('peek', { + math.max(0, cx.active.preview.skip + scroll_offset), + only_if = job.file.url, + }) +end + +return M diff --git a/homes/emenel/dotfiles/dot_config/yazi/plugins/mediainfo.yazi/LICENSE b/homes/emenel/dotfiles/dot_config/yazi/plugins/mediainfo.yazi/LICENSE new file mode 100644 index 0000000..0399f1c --- /dev/null +++ b/homes/emenel/dotfiles/dot_config/yazi/plugins/mediainfo.yazi/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2024 Lauri Niskanen + +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/homes/emenel/dotfiles/dot_config/yazi/plugins/mediainfo.yazi/README.md b/homes/emenel/dotfiles/dot_config/yazi/plugins/mediainfo.yazi/README.md new file mode 100644 index 0000000..2568a01 --- /dev/null +++ b/homes/emenel/dotfiles/dot_config/yazi/plugins/mediainfo.yazi/README.md @@ -0,0 +1,26 @@ +> [!NOTE] +> Please use **boydaihungst**'s fork for the latest version of this plugin: +> https://github.com/boydaihungst/mediainfo.yazi + +# mediainfo.yazi + +This is a Yazi plugin for previewing media files. The preview shows thumbnail +using `ffmpegthumbnailer` if available and media metadata using `mediainfo`. + +## Installation + +Install the plugin: + +``` +ya pack -a Ape/mediainfo +``` + +Create `~/.config/yazi/yazi.toml` and add: + +``` +[plugin] +prepend_previewers = [ + { mime = "{image,audio,video}/*", run = "mediainfo"}, + { mime = "application/x-subrip", run = "mediainfo"}, +] +``` diff --git a/homes/emenel/dotfiles/dot_config/yazi/plugins/mediainfo.yazi/main.lua b/homes/emenel/dotfiles/dot_config/yazi/plugins/mediainfo.yazi/main.lua new file mode 100644 index 0000000..aa74285 --- /dev/null +++ b/homes/emenel/dotfiles/dot_config/yazi/plugins/mediainfo.yazi/main.lua @@ -0,0 +1,111 @@ +local skip_labels = { + ["Complete name"] = true, + ["CompleteName_Last"] = true, + ["Unique ID"] = true, + ["File size"] = true, + ["Format/Info"] = true, + ["Codec ID/Info"] = true, + ["MD5 of the unencoded content"] = true, +} + +local M = {} + +function M:peek() + local image_height = 0 + + if self:preload() == 1 then + local cache = ya.file_cache(self) + if cache and fs.cha(cache).length > 0 then + image_height = ya.image_show(cache, self.area).h + end + end + + local cmd = "mediainfo" + local output, code = Command(cmd) + :args({ tostring(self.file.url) }) + :stdout(Command.PIPED) + :output() + + local lines = {} + + if output then + local i = 0 + for str in output.stdout:gmatch("[^\n]*") do + local label, value = str:match("(.*[^ ]) +: (.*)") + local line + + if label then + if not skip_labels[label] then + line = ui.Line({ + ui.Span(label .. ": "):bold(), + ui.Span(value), + }) + end + elseif str ~= "General" then + line = ui.Line({ ui.Span(str):underline() }) + end + + if line then + if i >= self.skip then + table.insert(lines, line) + end + + local max_width = math.max(1, self.area.w - 3) + i = i + math.max(1, math.ceil(line:width() / max_width)) + end + end + else + local error = string.format("Spawn `%s` command returns %s", cmd, code) + table.insert(lines, ui.Line(error)) + end + + ya.preview_widgets(self, { + ui.Paragraph( + ui.Rect({ + x = self.area.x, + y = self.area.y + image_height, + w = self.area.w, + h = self.area.h - image_height, + }), + lines + ):wrap(ui.Paragraph.WRAP), + }) +end + +function M:seek(units) + local h = cx.active.current.hovered + if h and h.url == self.file.url then + local step = math.floor(units * self.area.h / 10) + ya.manager_emit("peek", { + math.max(0, cx.active.preview.skip + step), + only_if = self.file.url, + }) + end +end + +function M:preload() + local cache = ya.file_cache(self) + if not cache or fs.cha(cache) then + return 1 + end + + local cmd = "ffmpegthumbnailer" + local child, code = Command(cmd):args({ + "-q", "6", + "-c", "jpeg", + "-i", tostring(self.file.url), + "-o", tostring(cache), + "-t", "5", + "-s", tostring(PREVIEW.max_width), + }):spawn() + + if not child then + ya.err(string.format("spawn `%s` command returns %s", cmd, code)) + return 0 + end + + local status = child:wait() + return status and status.success and 1 or 2 +end + +return M diff --git a/homes/emenel/dotfiles/dot_config/yazi/plugins/mount.yazi/LICENSE b/homes/emenel/dotfiles/dot_config/yazi/plugins/mount.yazi/LICENSE new file mode 100644 index 0000000..fb5b1d6 --- /dev/null +++ b/homes/emenel/dotfiles/dot_config/yazi/plugins/mount.yazi/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2023 yazi-rs + +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/homes/emenel/dotfiles/dot_config/yazi/plugins/mount.yazi/README.md b/homes/emenel/dotfiles/dot_config/yazi/plugins/mount.yazi/README.md new file mode 100644 index 0000000..d1749f3 --- /dev/null +++ b/homes/emenel/dotfiles/dot_config/yazi/plugins/mount.yazi/README.md @@ -0,0 +1,51 @@ +# mount.yazi + +> [!NOTE] +> The plugin is currently very experimental, and the newest Yazi nightly is required for it to work. + +A mount manager for Yazi, providing disk mount, unmount, and eject functionality. + +Supported platforms: + +- Linux with [`udisksctl`](https://github.com/storaged-project/udisks) and [`lsblk`](https://github.com/util-linux/util-linux) +- macOS with `diskutil` + +https://github.com/user-attachments/assets/c6f780ab-458b-420f-85cf-2fc45fcfe3a2 + +## Installation + +```sh +ya pack -a yazi-rs/plugins:mount +``` + +## Usage + +Add this to your `~/.config/yazi/keymap.toml`: + +```toml +[[manager.prepend_keymap]] +on = "M" +run = "plugin mount" +``` + +Available keybindings: + +| Key binding | Alternate key | Action | +| ------------ | ------------- | --------------------- | +| q | - | Quit the plugin | +| k | | Move up | +| j | | Move down | +| l | | Enter the mount point | +| m | - | Mount the partition | +| u | - | Unmount the partition | +| e | - | Eject the disk | + +## TODO + +- Custom keybindings +- Windows support (I don't have an Windows machine for testing, PRs welcome!) +- Support mount, unmount, and eject the entire disk + +## License + +This plugin is MIT-licensed. For more information check the [LICENSE](LICENSE) file. diff --git a/homes/emenel/dotfiles/dot_config/yazi/plugins/mount.yazi/main.lua b/homes/emenel/dotfiles/dot_config/yazi/plugins/mount.yazi/main.lua new file mode 100644 index 0000000..82a4da1 --- /dev/null +++ b/homes/emenel/dotfiles/dot_config/yazi/plugins/mount.yazi/main.lua @@ -0,0 +1,266 @@ +local toggle_ui = ya.sync(function(self) + if self.children then + Modal:children_remove(self.children) + self.children = nil + else + self.children = Modal:children_add(self, 10) + end + ya.render() +end) + +local subscribe = ya.sync(function(self) + ps.unsub("mount") + ps.sub("mount", function() ya.manager_emit("plugin", { self._id, args = "refresh" }) end) +end) + +local update_partitions = ya.sync(function(self, partitions) + self.partitions = partitions + self.cursor = math.max(0, math.min(self.cursor or 0, #self.partitions - 1)) + ya.render() +end) + +local active_partition = ya.sync(function(self) return self.partitions[self.cursor + 1] end) + +local update_cursor = ya.sync(function(self, cursor) + if #self.partitions == 0 then + self.cursor = 0 + else + self.cursor = ya.clamp(0, self.cursor + cursor, #self.partitions - 1) + end + ya.render() +end) + +local M = { + keys = { + { on = "q", run = "quit" }, + + { on = "k", run = "up" }, + { on = "j", run = "down" }, + { on = "l", run = { "enter", "quit" } }, + + { on = "", run = "up" }, + { on = "", run = "down" }, + { on = "", run = { "enter", "quit" } }, + + { on = "m", run = "mount" }, + { on = "u", run = "unmount" }, + { on = "e", run = "eject" }, + }, +} + +function M:new(area) + self:layout(area) + return self +end + +function M:layout(area) + local chunks = ui.Layout() + :constraints({ + ui.Constraint.Percentage(10), + ui.Constraint.Percentage(80), + ui.Constraint.Percentage(10), + }) + :split(area) + + local chunks = ui.Layout() + :direction(ui.Layout.HORIZONTAL) + :constraints({ + ui.Constraint.Percentage(10), + ui.Constraint.Percentage(80), + ui.Constraint.Percentage(10), + }) + :split(chunks[2]) + + self._area = chunks[2] +end + +function M:entry(job) + if job.args[1] == "refresh" then + return update_partitions(self.obtain()) + end + + toggle_ui() + update_partitions(self.obtain()) + subscribe() + + local tx1, rx1 = ya.chan("mpsc") + local tx2, rx2 = ya.chan("mpsc") + function producer() + while true do + local cand = self.keys[ya.which { cands = self.keys, silent = true }] or { run = {} } + for _, r in ipairs(type(cand.run) == "table" and cand.run or { cand.run }) do + tx1:send(r) + if r == "quit" then + toggle_ui() + return + end + end + end + end + + function consumer1() + repeat + local run = rx1:recv() + if run == "quit" then + tx2:send(run) + break + elseif run == "up" then + update_cursor(-1) + elseif run == "down" then + update_cursor(1) + elseif run == "enter" then + local active = active_partition() + if active and active.dist then + ya.manager_emit("cd", { active.dist }) + end + else + tx2:send(run) + end + until not run + end + + function consumer2() + repeat + local run = rx2:recv() + if run == "quit" then + break + elseif run == "mount" then + self.operate("mount") + elseif run == "unmount" then + self.operate("unmount") + elseif run == "eject" then + self.operate("eject") + end + until not run + end + + ya.join(producer, consumer1, consumer2) +end + +function M:reflow() return { self } end + +function M:redraw() + local rows = {} + for _, p in ipairs(self.partitions or {}) do + if p.sub == "" then + rows[#rows + 1] = ui.Row { p.main } + else + rows[#rows + 1] = ui.Row { p.sub, p.label or "", p.dist or "", p.fstype or "" } + end + end + + return { + ui.Clear(self._area), + ui.Border(ui.Border.ALL) + :area(self._area) + :type(ui.Border.ROUNDED) + :style(ui.Style():fg("blue")) + :title(ui.Line("Mount"):align(ui.Line.CENTER)), + ui.Table(rows) + :area(self._area:pad(ui.Pad(1, 2, 1, 2))) + :header(ui.Row({ "Src", "Label", "Dist", "FSType" }):style(ui.Style():bold())) + :row(self.cursor) + :row_style(ui.Style():fg("blue"):underline()) + :widths { + ui.Constraint.Length(20), + ui.Constraint.Length(20), + ui.Constraint.Percentage(70), + ui.Constraint.Length(10), + }, + } +end + +function M.obtain() + local tbl = {} + local last + for _, p in ipairs(fs.partitions()) do + local main, sub + if ya.target_os() == "macos" then + main, sub = p.src:match("^(/dev/disk%d+)(.+)$") + elseif p.src:find("/dev/nvme", 1, true) == 1 then -- /dev/nvme0n1p1 + main, sub = p.src:match("^(/dev/nvme%d+n%d+)(p%d+)$") + elseif p.src:find("/dev/sd", 1, true) == 1 then -- /dev/sda1 + main, sub = p.src:match("^(/dev/sd[a-z])(%d+)$") + end + if sub then + if last ~= main then + last, tbl[#tbl + 1] = main, { src = main, main = main, sub = "" } + end + p.main, p.sub, tbl[#tbl + 1] = main, " " .. sub, p + end + end + table.sort(M.fillin(tbl), function(a, b) + if a.main == b.main then + return a.sub < b.sub + else + return a.main > b.main + end + end) + return tbl +end + +function M.fillin(tbl) + if ya.target_os() ~= "linux" then + return tbl + end + + local sources, indices = {}, {} + for i, p in ipairs(tbl) do + if p.sub ~= "" and not p.fstype then + sources[#sources + 1], indices[p.src] = p.src, i + end + end + if #sources == 0 then + return tbl + end + + local output, err = Command("lsblk"):args({ "-p", "-o", "name,fstype", "-J" }):args(sources):output() + if err then + ya.dbg("Failed to fetch filesystem types for unmounted partitions: " .. err) + return tbl + end + + local t = ya.json_decode(output and output.stdout or "") + for _, p in ipairs(t and t.blockdevices or {}) do + tbl[indices[p.name]].fstype = p.fstype + end + return tbl +end + +function M.operate(type) + local active = active_partition() + if not active then + return + elseif active.sub == "" then + return -- TODO: mount/unmount main disk + end + + local output, err + if ya.target_os() == "macos" then + output, err = Command("diskutil"):args({ type, active.src }):output() + end + if ya.target_os() == "linux" then + if type == "eject" then + Command("udisksctl"):args({ "unmount", "-b", active.src }):status() + output, err = Command("udisksctl"):args({ "power-off", "-b", active.src }):output() + else + output, err = Command("udisksctl"):args({ type, "-b", active.src }):output() + end + end + + if not output then + M.fail("Failed to %s `%s`: %s", type, active.src, err) + elseif not output.status.success then + M.fail("Failed to %s `%s`: %s", type, active.src, output.stderr) + end +end + +function M.fail(s, ...) ya.notify { title = "Mount", content = string.format(s, ...), timeout = 10, level = "error" } end + +function M:click() end + +function M:scroll() end + +function M:touch() end + +return M diff --git a/homes/emenel/dotfiles/dot_config/yazi/plugins/ouch.yazi/LICENSE b/homes/emenel/dotfiles/dot_config/yazi/plugins/ouch.yazi/LICENSE new file mode 100644 index 0000000..3f9d766 --- /dev/null +++ b/homes/emenel/dotfiles/dot_config/yazi/plugins/ouch.yazi/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 ndtoan96 + +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/homes/emenel/dotfiles/dot_config/yazi/plugins/ouch.yazi/README.md b/homes/emenel/dotfiles/dot_config/yazi/plugins/ouch.yazi/README.md new file mode 100644 index 0000000..fd2ee08 --- /dev/null +++ b/homes/emenel/dotfiles/dot_config/yazi/plugins/ouch.yazi/README.md @@ -0,0 +1,83 @@ +# ouch.yazi + +[ouch](https://github.com/ouch-org/ouch) plugin for [Yazi](https://github.com/sxyazi/yazi). + +![ouch.yazi](https://github.com/ndtoan96/ouch.yazi/assets/33489972/946397ec-b37b-4bf4-93f1-c676fc8e59f2) + +## Features +- Archive preview +- Compression + +## Installation + +If you use Yazi from latest main branch +```bash +# Linux/macOS +git clone https://github.com/ndtoan96/ouch.yazi.git ~/.config/yazi/plugins/ouch.yazi + +# Windows with cmd +git clone https://github.com/ndtoan96/ouch.yazi.git %AppData%\yazi\config\plugins\ouch.yazi + +# Windows with powershell +git clone https://github.com/ndtoan96/ouch.yazi.git "$($env:APPDATA)\yazi\config\plugins\ouch.yazi" +``` + +If you use Yazi < 0.4.3 +```bash +# Linux/macOS +git clone --branch v0.4.0 --single-branch https://github.com/ndtoan96/ouch.yazi.git ~/.config/yazi/plugins/ouch.yazi + +# Windows with cmd +git clone --branch v0.4.0 --single-branch https://github.com/ndtoan96/ouch.yazi.git %AppData%\yazi\config\plugins\ouch.yazi + +# Windows with powershell +git clone --branch v0.4.0 --single-branch https://github.com/ndtoan96/ouch.yazi.git "$($env:APPDATA)\yazi\config\plugins\ouch.yazi" +``` + +Make sure you have [ouch](https://github.com/ouch-org/ouch) installed and in your `PATH`. + +## Usage + +### Preview +For archive preview, add this to your `yazi.toml`: + +```toml +[plugin] +prepend_previewers = [ + # Archive previewer + { mime = "application/*zip", run = "ouch" }, + { mime = "application/x-tar", run = "ouch" }, + { mime = "application/x-bzip2", run = "ouch" }, + { mime = "application/x-7z-compressed", run = "ouch" }, + { mime = "application/x-rar", run = "ouch" }, + { mime = "application/x-xz", run = "ouch" }, +] +``` + +Now go to an archive on Yazi, you should see the archive's content in the preview pane. You can use `J` and `K` to roll up and down the preview. + +If you want to change the icon or the style of text, you can modify the `peek` function in `init.lua` file (all of them are stored in the `lines` variable). + +### Compression +For compession, add this to your `keymap.toml`: + +```toml +[[manager.prepend_keymap]] +on = ["C"] +run = "plugin ouch --args=zip" +desc = "Compress with ouch" +``` + +The `--args=zip` part tells the plugin that default format is `zip`. You can change that to whatever format you want. + +### Decompression +This plugin does not provide a decompression feature because it already is supported by Yazi. +To decompress with `ouch`, configure the opener in `yazi.toml`. + +```toml +[opener] +extract = [ + { run = 'ouch d -y "%*"', desc = "Extract here with ouch", for = "windows" }, + { run = 'ouch d -y "$@"', desc = "Extract here with ouch", for = "unix" }, +] +``` diff --git a/homes/emenel/dotfiles/dot_config/yazi/plugins/ouch.yazi/main.lua b/homes/emenel/dotfiles/dot_config/yazi/plugins/ouch.yazi/main.lua new file mode 100644 index 0000000..6e5c9a6 --- /dev/null +++ b/homes/emenel/dotfiles/dot_config/yazi/plugins/ouch.yazi/main.lua @@ -0,0 +1,145 @@ +local M = {} + +function M:peek(job) + local child = Command("ouch") + :args({ "l", "-t", "-y", tostring(job.file.url) }) + :stdout(Command.PIPED) + :stderr(Command.PIPED) + :spawn() + local limit = job.area.h + local file_name = string.match(tostring(job.file.url), ".*[/\\](.*)") + local lines = string.format("📁 \x1b[2m%s\x1b[0m\n", file_name) + local num_lines = 1 + local num_skip = 0 + repeat + local line, event = child:read_line() + if event == 1 then + ya.err(tostring(event)) + elseif event ~= 0 then + break + end + + if line:find('Archive', 1, true) ~= 1 and line:find('[INFO]', 1, true) ~= 1 then + if num_skip >= job.skip then + lines = lines .. line + num_lines = num_lines + 1 + else + num_skip = num_skip + 1 + end + end + until num_lines >= limit + + child:start_kill() + if job.skip > 0 and num_lines < limit then + ya.manager_emit( + "peek", + { tostring(math.max(0, job.skip - (limit - num_lines))), only_if = tostring(job.file.url), upper_bound = "" } + ) + else + ya.preview_widgets(job, { ui.Text(lines):area(job.area) }) + end +end + +function M:seek(job) + local h = cx.active.current.hovered + if h and h.url == job.file.url then + local step = math.floor(job.units * job.area.h / 10) + ya.manager_emit("peek", { + math.max(0, cx.active.preview.skip + step), + only_if = tostring(job.file.url), + }) + end +end + +-- Check if file exists +local function file_exists(name) + local f = io.open(name, "r") + if f ~= nil then + io.close(f) + return true + else + return false + end +end + +-- Get the files that need to be compressed and infer a default archive name +local get_compression_target = ya.sync(function() + local tab = cx.active + local default_name + local paths = {} + if #tab.selected == 0 then + if tab.current.hovered then + local name = tab.current.hovered.name + default_name = name + table.insert(paths, name) + else + return + end + else + default_name = tab.current.cwd:name() + for _, url in pairs(tab.selected) do + table.insert(paths, tostring(url)) + end + -- The compression targets are aquired, now unselect them + ya.manager_emit("escape", {}) + end + return paths, default_name +end) + +local function invoke_compress_command(paths, name) + local cmd_output, err_code = Command("ouch") + :args({ "c", "-y" }) + :args(paths) + :arg(name) + :stderr(Command.PIPED) + :output() + if err_code ~= nil then + ya.notify({ + title = "Failed to run ouch command", + content = "Status: " .. err_code, + timeout = 5.0, + level = "error", + }) + elseif not cmd_output.status.success then + ya.notify({ + title = "Compression failed: status code " .. cmd_output.status.code, + content = cmd_output.stderr, + timeout = 5.0, + level = "error", + }) + end +end + +function M:entry(job) + local default_fmt = job.args[1] + + ya.manager_emit("escape", { visual = true }) + + -- Get the files that need to be compressed and infer a default archive name + local paths, default_name = get_compression_target() + + -- Get archive name from user + local output_name, name_event = ya.input({ + title = "Create archive:", + value = default_name .. "." .. default_fmt, + position = { "top-center", y = 3, w = 40 }, + }) + if name_event ~= 1 then + return + end + + -- Get confirmation if file exists + if file_exists(output_name) then + local confirm, confirm_event = ya.input({ + title = "Overwrite " .. output_name .. "? (y/N)", + position = { "top-center", y = 3, w = 40 }, + }) + if not (confirm_event == 1 and confirm:lower() == "y") then + return + end + end + + invoke_compress_command(paths, output_name) +end + +return M diff --git a/homes/emenel/dotfiles/dot_config/yazi/plugins/smart-paste.yazi/main.lua b/homes/emenel/dotfiles/dot_config/yazi/plugins/smart-paste.yazi/main.lua new file mode 100644 index 0000000..3ca0a22 --- /dev/null +++ b/homes/emenel/dotfiles/dot_config/yazi/plugins/smart-paste.yazi/main.lua @@ -0,0 +1,13 @@ +--- @sync entry +return { + entry = function() + local h = cx.active.current.hovered + if h and h.cha.is_dir then + ya.manager_emit("enter", {}) + ya.manager_emit("paste", {}) + ya.manager_emit("leave", {}) + else + ya.manager_emit("paste", {}) + end + end, +} diff --git a/homes/emenel/dotfiles/dot_config/yazi/plugins/toggle-view.yazi/LICENSE b/homes/emenel/dotfiles/dot_config/yazi/plugins/toggle-view.yazi/LICENSE new file mode 100644 index 0000000..c85eb72 --- /dev/null +++ b/homes/emenel/dotfiles/dot_config/yazi/plugins/toggle-view.yazi/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 dawsers + +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/homes/emenel/dotfiles/dot_config/yazi/plugins/toggle-view.yazi/README.md b/homes/emenel/dotfiles/dot_config/yazi/plugins/toggle-view.yazi/README.md new file mode 100644 index 0000000..73d4d53 --- /dev/null +++ b/homes/emenel/dotfiles/dot_config/yazi/plugins/toggle-view.yazi/README.md @@ -0,0 +1,32 @@ +# toggle-view.yazi + +Toggle the different views: parent, current and preview. + +## Requirements + +- [Yazi](https://github.com/sxyazi/yazi/) v0.4 or later. + +## Installation + +```sh +ya pack -a dawsers/toggle-view +``` + +## Usage + +Add this to your `~/.config/yazi/keymap.toml`: + +``` toml +[manager] +prepend_keymap = [ + { on = "", run = "plugin toggle-view --args=parent", desc = "Toggle parent" }, + { on = "", run = "plugin toggle-view --args=current", desc = "Toggle current" }, + { on = "", run = "plugin toggle-view --args=preview", desc = "Toggle preview" }, +] +``` + +Now each key will toggle on/off one of the three panels: `Ctrl+1` for +*parent*, `Ctrl+2` for *current* and `Ctrl+3` for *preview*. + +You can set your own key bindings. + diff --git a/homes/emenel/dotfiles/dot_config/yazi/plugins/toggle-view.yazi/main.lua b/homes/emenel/dotfiles/dot_config/yazi/plugins/toggle-view.yazi/main.lua new file mode 100644 index 0000000..7078681 --- /dev/null +++ b/homes/emenel/dotfiles/dot_config/yazi/plugins/toggle-view.yazi/main.lua @@ -0,0 +1,63 @@ +--- @sync entry +-- Toggle different views on/off: parent, current, preview +local function entry(st, job) + local args = job.args or job + local action = args[1] + if not action then + return + end + + if st.view == nil then + st.old_parent = MANAGER.ratio.parent + st.old_current = MANAGER.ratio.current + st.old_preview = MANAGER.ratio.preview + + -- Get current tab ratios + local all_old = st.old_parent + st.old_current + st.old_preview + local area = ui.Rect { x= 0, y = 0, w = all_old, h = 10 } + local tab = Tab:new(area, cx.active) + st.parent = tab._chunks[1].w + st.current = tab._chunks[2].w + st.preview = tab._chunks[3].w + st.layout = Tab.layout + st.view = true -- initialized + end + + if action == "parent" then + if st.parent > 0 then + st.parent = 0 + else + st.parent = st.old_parent + end + elseif action == "current" then + if st.current > 0 then + st.current = 0 + else + st.current = st.old_current + end + elseif action == "preview" then + if st.preview > 0 then + st.preview = 0 + else + st.preview = st.old_preview + end + else + return + end + Tab.layout = function(self) + local all = st.parent + st.current + st.preview + self._chunks = ui.Layout() + :direction(ui.Layout.HORIZONTAL) + :constraints({ + ui.Constraint.Ratio(st.parent, all), + ui.Constraint.Ratio(st.current, all), + ui.Constraint.Ratio(st.preview, all), + }) + :split(self._area) + end + ya.app_emit("resize", {}) +end + +local function enabled(st) return st.view ~= nil end + +return { entry = entry, enabled = enabled } diff --git a/homes/emenel/dotfiles/dot_config/yazi/plugins/yatline-symlink.yazi/LICENSE b/homes/emenel/dotfiles/dot_config/yazi/plugins/yatline-symlink.yazi/LICENSE new file mode 100644 index 0000000..0c37e85 --- /dev/null +++ b/homes/emenel/dotfiles/dot_config/yazi/plugins/yatline-symlink.yazi/LICENSE @@ -0,0 +1,22 @@ +MIT License + +Copyright (c) 2024 imsi32 +Copyright (c) 2024 llanosrocas + +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/homes/emenel/dotfiles/dot_config/yazi/plugins/yatline-symlink.yazi/README.md b/homes/emenel/dotfiles/dot_config/yazi/plugins/yatline-symlink.yazi/README.md new file mode 100644 index 0000000..c138a10 --- /dev/null +++ b/homes/emenel/dotfiles/dot_config/yazi/plugins/yatline-symlink.yazi/README.md @@ -0,0 +1,39 @@ +# yatline-symlink.yazi + +An addon to show symlink target in your [yatline.yazi](https://github.com/imsi32/yatline.yazi)'s status or header line. + +![yatline-symlink example screenshot](2024-10-06-@13-18-32-scrot.png) + +## Requirements + +- yazi version >= 0.3.0 +- [yatline.yazi](https://github.com/imsi32/yatline.yazi) + +## Installation + +```sh +ya pack -a lpanebr/yazi-plugins:yatline-symlink +``` + +## Usage + +> [!IMPORTANT] +> Add this to your `~/.config/yazi/init.lua` after yatline.yazi's initialization. + +```lua +require("yatline-symlink"):setup() +``` + +Then, add it in one of your sections in the yatline configuration using: + +```lua +{ type = "coloreds", custom = false, name = "symlink" } +``` + +**Optional configuration:** + +```lua +require("githead"):setup({ + symlink_color = "white" +} +``` diff --git a/homes/emenel/dotfiles/dot_config/yazi/plugins/yatline-symlink.yazi/main.lua b/homes/emenel/dotfiles/dot_config/yazi/plugins/yatline-symlink.yazi/main.lua new file mode 100644 index 0000000..a049e5a --- /dev/null +++ b/homes/emenel/dotfiles/dot_config/yazi/plugins/yatline-symlink.yazi/main.lua @@ -0,0 +1,33 @@ +function hovered() + local hovered = cx.active.current.hovered + if hovered then + return hovered + else + return "" + end +end + +local function setup(_, options) + options = options or {} + + local config = { + symlink_color = options.symlink_color or "silver", + } + + if Yatline ~= nil then + function Yatline.coloreds.get:symlink() + local symlink = {} + local linked = "" + + local h = hovered() + if h.link_to ~= nil then + linked = " -> " .. tostring(h.link_to) + end + + table.insert(symlink, { linked, config.symlink_color }) + return symlink + end + end +end + +return { setup = setup } diff --git a/homes/emenel/dotfiles/dot_config/yazi/plugins/yatline.yazi/LICENSE b/homes/emenel/dotfiles/dot_config/yazi/plugins/yatline.yazi/LICENSE new file mode 100644 index 0000000..6374a66 --- /dev/null +++ b/homes/emenel/dotfiles/dot_config/yazi/plugins/yatline.yazi/LICENSE @@ -0,0 +1,23 @@ +MIT License + +Copyright (c) 2024 imsi32 +Copyright (c) 2023 - sxyazi +Copyright (c) 2023 yazi-rs + +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/homes/emenel/dotfiles/dot_config/yazi/plugins/yatline.yazi/README.md b/homes/emenel/dotfiles/dot_config/yazi/plugins/yatline.yazi/README.md new file mode 100644 index 0000000..6e38134 --- /dev/null +++ b/homes/emenel/dotfiles/dot_config/yazi/plugins/yatline.yazi/README.md @@ -0,0 +1,19 @@ +# yatline.yazi +The first Yazi plugin for customizing both header-line and status-line. + +![yatline](https://github.com/user-attachments/assets/61013ec8-7fd9-42df-a9f4-f254663871fe) + +> [!NOTE] +> Check out [wiki](https://github.com/imsi32/yatline.yazi/wiki) for installation steps, configuration and further information. + +## Features +- Lualine-like Design +- Flexible +- Simple +- Automatic Configuration +- Themes (See: [yatline-themes](https://github.com/imsi32/yatline-themes)) +- Add-ons (See: [yatline-addons](https://github.com/imsi32/yatline-addons)) + +## Credits +- [Lualine](https://github.com/nvim-lualine/lualine.nvim) +- [Yazi](https://github.com/sxyazi/yazi) diff --git a/homes/emenel/dotfiles/dot_config/yazi/plugins/yatline.yazi/main.lua b/homes/emenel/dotfiles/dot_config/yazi/plugins/yatline.yazi/main.lua new file mode 100644 index 0000000..712ae14 --- /dev/null +++ b/homes/emenel/dotfiles/dot_config/yazi/plugins/yatline.yazi/main.lua @@ -0,0 +1,1312 @@ +--- @diagnostic disable: undefined-global, undefined-field +--- @alias Mode Mode Comes from Yazi. +--- @alias Rect Rect Comes from Yazi. +--- @alias Paragraph Paragraph Comes from Yazi. +--- @alias Line Line Comes from Yazi. +--- @alias Span Span Comes from Yazi. +--- @alias Color Color Comes from Yazi. +--- @alias Config Config The config used for setup. +--- @alias Coloreds Coloreds The array returned by colorizer in {{string, Color}, {string, Color} ... } format +--- @alias Side # [ LEFT ... RIGHT ] +--- | `enums.LEFT` # The left side of either the header-line or status-line. [ LEFT ... ] +--- | `enums.RIGHT` # The right side of either the header-line or status-line. [ ... RIGHT] +--- @alias SeparatorType +--- | `enums.OUTER` # Separators on the outer side of sections. [ c o | c o | c o ... ] or [ ... o c | o c | o c ] +--- | `enums.INNER` # Separators on the inner side of sections. [ c i c | c i c | c i c ... ] or [ ... c i c | c i c | c i c ] +--- @alias ComponentType +--- | `enums.A` # Components on the first section. [ A | | ... ] or [ ... | | A ] +--- | `enums.B` # Components on the second section. [ | B | ... ] or [ ... | B | ] +--- | `enums.C` # Components on the third section. [ | | C ... ] or [ ... C | | ] + +--==================-- +-- Type Declaration -- +--==================-- + +Yatline = {} + +local Side = { LEFT = 0, RIGHT = 1 } +local SeparatorType = { OUTER = 0, INNER = 1 } +local ComponentType = { A = 0, B = 1, C = 2 } + +--=========================-- +-- Variable Initialization -- +--=========================-- + +local section_separator_open +local section_separator_close + +local inverse_separator_open +local inverse_separator_close + +local part_separator_open +local part_separator_close + +local separator_style = { bg = nil, fg = nil } + +local style_a +local style_b +local style_c + +local style_a_normal_bg +local style_a_select_bg +local style_a_un_set_bg + +local permissions_t_fg +local permissions_r_fg +local permissions_w_fg +local permissions_x_fg +local permissions_s_fg + +local tab_width + +local selected_icon +local copied_icon +local cut_icon + +local selected_fg +local copied_fg +local cut_fg + +local task_total_icon +local task_succ_icon +local task_fail_icon +local task_found_icon +local task_processed_icon + +local task_total_fg +local task_succ_fg +local task_fail_fg +local task_found_fg +local task_processed_fg + +local show_background + +local section_order = { "section_a", "section_b", "section_c" } + +--=================-- +-- Component Setup -- +--=================-- + +--- Sets the background of style_a according to the tab's mode. +--- @param mode Mode The mode of the active tab. +--- @see cx.active.mode To get the active tab's mode. +local function set_mode_style(mode) + if mode.is_select then + style_a.bg = style_a_select_bg + elseif mode.is_unset then + style_a.bg = style_a_un_set_bg + else + style_a.bg = style_a_normal_bg + end +end + +--- Sets the style of the component according to the its type. +--- @param component Span Component that will be styled. +--- @param component_type ComponentType Which section component will be in [ a | b | c ]. +--- @see Style To see how to style, in Yazi's documentation. +local function set_component_style(component, component_type) + if component_type == ComponentType.A then + component:style(style_a):bold() + elseif component_type == ComponentType.B then + component:style(style_b) + else + component:style(style_c) + end +end + +--- Connects component to a separator. +--- @param component Span Component that will be connected to separator. +--- @param side Side Left or right side of the either header-line or status-line. +--- @param separator_type SeparatorType Where will there be a separator in the section. +--- @return Line line A Line which has component and separator. +local function connect_separator(component, side, separator_type) + local open, close + if + separator_type == SeparatorType.OUTER and not (separator_style.bg == "reset" and separator_style.fg == "reset") + then + open = ui.Span(section_separator_open) + close = ui.Span(section_separator_close) + + if separator_style.fg == "reset" then + if separator_style.bg ~= "reset" and separator_style.bg ~= nil then + open = ui.Span(inverse_separator_open) + close = ui.Span(inverse_separator_close) + + separator_style.fg, separator_style.bg = separator_style.bg, separator_style.fg + else + return ui.Line({ component }) + end + end + else + open = ui.Span(part_separator_open) + close = ui.Span(part_separator_close) + end + + open:style(separator_style) + close:style(separator_style) + + if side == Side.LEFT then + return ui.Line({ component, close }) + else + return ui.Line({ open, component }) + end +end + +--==================-- +-- Helper Functions -- +--==================-- + +--- Gets the file name from given file extension. +--- @param file_name string The name of a file whose extension will be taken. +--- @return string file_extension Extension of a file. +local function get_file_extension(file_name) + local extension = file_name:match("^.+%.(.+)$") + + if extension == nil or extension == "" then + return "null" + else + return extension + end +end + +--- Reverse the order of given array +--- @param array Line Array which wants to be reversed. +--- @return table reversed Reversed ordered given array. +local function reverse_order(array) + local reversed = {} + for i = #array, 1, -1 do + table.insert(reversed, array[i]) + end + + return reversed +end + +--- the number of characters in a UTF-8 string +--- @param s string The string to process. +--- @return integer The number of characters in the string. +local function utf8len(s) + -- count the number of non-continuing bytes + return select(2, s:gsub("[^\128-\193]", "")) +end + +--- like string.sub() but i, j are utf8 strings +--- a utf8-safe string.sub() +--- @param s string The string to process. +--- @param i integer The start position. +--- @param j integer The end position. +--- @return string The substring. +local function utf8sub(s, i, j) + -- pattern for matching UTF-8 characters + local pattern = "[%z\1-\127\194-\244][\128-\191]*" + + -- helper function for position calculation + --- @param pos integer The position of the character. + --- @param len integer The length of the string. + --- @return integer The relative position of the character. + local function posrelat(pos, len) + if pos < 0 then + pos = len + pos + 1 + end + return pos + end + + -- helper function to iterate over UTF-8 chars + local function chars(_s, no_subs) + local function map(f) + local _i = 0 + if no_subs then + for b, e in _s:gmatch("()" .. pattern .. "()") do + _i = _i + 1 + local c = e - b + f(_i, c, b) + end + else + for b, c in _s:gmatch("()(" .. pattern .. ")") do + _i = _i + 1 + f(_i, c, b) + end + end + end + return coroutine.wrap(function() + return map(coroutine.yield) + end) + end + + local l = utf8len(s) + + i = posrelat(i, l) + j = j and posrelat(j, l) or l + + if i < 1 then + i = 1 + end + if j > l then + j = l + end + + if i > j then + return "" + end + + local diff = j - i + local iter = chars(s, true) + + -- advance up to i + for _ = 1, i - 1 do + iter() + end + + local c, b = select(2, iter()) + + -- becareful with the edge case of empty string + if not b then + return "" + end + + -- i and j are the same, single-character sub + if diff == 0 then + return string.sub(s, b, b + c - 1) + end + + i = b + + -- advance up to j + for _ = 1, diff - 1 do + iter() + end + + c, b = select(2, iter()) + + return string.sub(s, i, b + c - 1) +end + +--- Trims the filename if it is longer than the max_length. +--- @param filename string The name of a file which will be trimmed. +--- @param max_length integer Maximum length of the filename. +--- @param trim_length integer Length of the trimmed filename. +--- @return string trimmed_filename Trimmed filename. +local function trim_filename(filename, max_length, trim_length) + if not max_length or not trim_length then + return filename + end + + -- Count UTF-8 characters + local len = utf8len(filename) + + if len <= max_length then + return filename + end + + if len <= trim_length * 2 then + return filename + end + + return utf8sub(filename, 1, trim_length) .. "..." .. utf8sub(filename, len - trim_length + 1, len) +end + +--========================-- +-- Component String Group -- +--========================-- + +Yatline.string = {} +Yatline.string.get = {} +Yatline.string.has_separator = true + +--- Creates a component from given string according to other parameters. +--- @param string string The text which will be shown inside of the component. +--- @param component_type ComponentType Which section component will be in [ a | b | c ]. +--- @return Line line Customized Line which follows desired style of the parameters. +--- @see set_mode_style To know how mode style selected. +--- @see set_component_style To know how component style applied. +function Yatline.string.create(string, component_type) + local span = ui.Span(" " .. string .. " ") + set_mode_style(cx.active.mode) + set_component_style(span, component_type) + + return ui.Line({ span }) +end + +--- Configuration for getting hovered file's name +--- @class HoveredNameConfig +--- @field trimed? boolean Whether to trim the filename if it's too long (default: false) +--- @field max_length? integer Maximum length of the filename (default: 24) +--- @field trim_length? integer Length of each end when trimming (default: 10) +--- @field show_symlink? boolean Whether to show symlink target (default: false) +--- Gets the hovered file's name of the current active tab. +--- @param config? HoveredNameConfig Configuration for getting hovered file's name +--- @return string name Current active tab's hovered file's name +function Yatline.string.get:hovered_name(config) + local hovered = cx.active.current.hovered + if not hovered then + return "" + end + + if not config then + return hovered.name + end + + local trimed = config.trimed or false + local max_length = config.max_length or 24 + local trim_length = config.trim_length or 10 + local show_symlink = config.show_symlink or false + + local link_delimiter = " -> " + local linked = (show_symlink and hovered.link_to ~= nil) and (link_delimiter .. tostring(hovered.link_to)) or "" + + if trimed then + local trimmed_name = trim_filename(hovered.name, max_length, trim_length) + local trimmed_linked = #linked ~= 0 + and link_delimiter .. trim_filename( + string.sub(linked, #link_delimiter + 1, -1), + max_length, + trim_length + ) + or "" + return trimmed_name .. trimmed_linked + else + return hovered.name .. linked + end +end + +--- Configuration for getting hovered file's path +--- @class HoveredPathConfig +--- @field trimed? boolean Whether to trim the file path if it's too long (default: false) +--- @field max_length? integer Maximum length of the file path (default: 24) +--- @field trim_length? integer Length of each end when trimming (default: 10) +--- Gets the hovered file's path of the current active tab. +--- @param config? HoveredPathConfig Configuration for getting hovered file's path +--- @return string path Current active tab's hovered file's path. +function Yatline.string.get:hovered_path(config) + local hovered = cx.active.current.hovered + if not hovered then + return "" + end + + if not config then + return ya.readable_path(tostring(hovered.url)) + end + + local trimed = config.trimed or false + local max_length = config.max_length or 24 + local trim_length = config.trim_length or 10 + + if trimed then + return trim_filename(ya.readable_path(tostring(hovered.url)), max_length, trim_length) + else + return ya.readable_path(tostring(hovered.url)) + end +end + +--- Gets the hovered file's size of the current active tab. +--- @return string size Current active tab's hovered file's size. +function Yatline.string.get:hovered_size() + local hovered = cx.active.current.hovered + if hovered then + return ya.readable_size(hovered:size() or hovered.cha.len) + else + return "" + end +end + +--- Gets the hovered file's path of the current active tab. +--- @return string mime Current active tab's hovered file's mime. +function Yatline.string.get:hovered_mime() + local hovered = cx.active.current.hovered + if hovered then + return hovered:mime() + else + return "" + end +end + +--- Gets the hovered file's user and group ownership of the current active tab. +--- @return string ownership Current active tab's hovered file's user and group ownership. +function Yatline.string.get:hovered_ownership() + local hovered = cx.active.current.hovered + + if hovered then + return ya.user_name(hovered.cha.uid) .. ":" .. ya.group_name(hovered.cha.gid) + else + return "" + end +end + +--- Gets the hovered file's extension of the current active tab. +--- @param show_icon boolean Whether or not an icon will be shown. +--- @return string file_extension Current active tab's hovered file's extension. +function Yatline.string.get:hovered_file_extension(show_icon) + local hovered = cx.active.current.hovered + + if hovered then + local cha = hovered.cha + + local name + if cha.is_dir then + name = "dir" + else + name = get_file_extension(hovered.url:name()) + end + + if show_icon then + local icon = hovered:icon().text + return icon .. " " .. name + else + return name + end + else + return "" + end +end + +--- Configuration for getting curent active tab's path +--- @class TabPathConfig +--- @field trimed? boolean Whether to trim the current active tab's path if it's too long (default: false) +--- @field max_length? integer Maximum length of the current active tab's path (default: 24) +--- @field trim_length? integer Length of each end when trimming (default: 10) +--- Gets the path of the current active tab. +--- @param config? TabPathConfig Configuration for getting current active tab's path +--- @return string path Current active tab's path. +function Yatline.string.get:tab_path(config) + local cwd = cx.active.current.cwd + local filter = cx.active.current.files.filter + + local search = cwd.is_search and string.format(" (search: %s", cwd:frag()) or "" + + local suffix + if not filter then + suffix = search == "" and search or search .. ")" + elseif search == "" then + suffix = string.format(" (filter: %s)", tostring(filter)) + else + suffix = string.format("%s, filter: %s)", search, tostring(filter)) + end + + if not config then + return ya.readable_path(tostring(cwd)) .. suffix + end + + local trimed = config.trimed or false + local max_length = config.max_length or 24 + local trim_length = config.trim_length or 10 + + if trimed then + return trim_filename(ya.readable_path(tostring(cwd)), max_length, trim_length) .. suffix + else + return ya.readable_path(tostring(cwd)) .. suffix + end +end + +--- Gets the mode of active tab. +--- @return string mode Active tab's mode. +function Yatline.string.get:tab_mode() + local mode = tostring(cx.active.mode):upper() + if mode == "UNSET" then + mode = "UN-SET" + end + + return mode +end + +--- Gets the number of files in the current active tab. +--- @return string num_files Number of files in the current active tab. +function Yatline.string.get:tab_num_files() + return tostring(#cx.active.current.files) +end + +--- Gets the cursor position in the current active tab. +--- @return string cursor_position Current active tab's cursor position. +function Yatline.string.get:cursor_position() + local cursor = cx.active.current.cursor + local length = #cx.active.current.files + + if length ~= 0 then + return string.format(" %2d/%-2d", cursor + 1, length) + else + return "0" + end +end + +--- Gets the cursor position as percentage which is according to the number of files inside of current active tab. +--- @return string percentage Percentage of current active tab's cursor position and number of percentages. +function Yatline.string.get:cursor_percentage() + local percentage = 0 + local cursor = cx.active.current.cursor + local length = #cx.active.current.files + if cursor ~= 0 and length ~= 0 then + percentage = math.floor((cursor + 1) * 100 / length) + end + + if percentage == 0 then + return " Top " + elseif percentage == 100 then + return " Bot " + else + return string.format("%3d%% ", percentage) + end +end + +--- Gets the local date or time values. +--- @param format string Format for giving desired date or time values. +--- @return string date Date or time values. +--- @see os.date To see how format works. +function Yatline.string.get:date(format) + return tostring(os.date(format)) +end + +--======================-- +-- Component Line Group -- +--======================-- + +Yatline.line = {} +Yatline.line.get = {} +Yatline.line.has_separator = false + +--- To follow component group naming and functions, returns the given line without any changes. +--- @param line Line The line already pre-defined. +--- @param component_type ComponentType Which section component will be in [ a | b | c ]. Will not be used. +--- @return Line line The given line as an input. +function Yatline.line.create(line, component_type) + return line +end + +--- Creates and returns line component for tabs. +--- @param side Side Left or right side of the either header-line or status-line. +--- @return Line line Customized Line which contains tabs. +--- @see set_mode_style To know how mode style selected. +--- @see set_component_style To know how component style applied. +--- @see connect_separator To know how component and separator connected. +function Yatline.line.get:tabs(side) + local tabs = #cx.tabs + local lines = {} + + local in_side + if side == "left" then + in_side = Side.LEFT + else + in_side = Side.RIGHT + end + + for i = 1, tabs do + local text = i + if tab_width > 2 then + text = ya.truncate(text .. " " .. cx.tabs[i]:name(), { max = tab_width }) + end + + separator_style = { bg = nil, fg = nil } + if i == cx.tabs.idx then + local span = ui.Span(" " .. text .. " ") + set_mode_style(cx.tabs[i].mode) + set_component_style(span, ComponentType.A) + + if style_a.bg ~= "reset" or show_background then + separator_style.fg = style_a.bg + if show_background then + separator_style.bg = style_c.bg + end + + lines[#lines + 1] = connect_separator(span, in_side, SeparatorType.OUTER) + else + separator_style.fg = style_a.fg + + lines[#lines + 1] = connect_separator(span, in_side, SeparatorType.INNER) + end + else + local span = ui.Span(" " .. text .. " ") + if show_background then + set_component_style(span, ComponentType.C) + else + span:style({ fg = style_c.fg }) + end + + if i == cx.tabs.idx - 1 then + set_mode_style(cx.tabs[i + 1].mode) + + local open, close + if style_a.bg ~= "reset" or (show_background and style_c.bg ~= "reset") then + if not show_background or (show_background and style_c.bg == "reset") then + separator_style.fg = style_a.bg + if show_background then + separator_style.bg = style_c.bg + end + + open = ui.Span(inverse_separator_open) + close = ui.Span(inverse_separator_close) + else + separator_style.bg = style_a.bg + if show_background then + separator_style.fg = style_c.bg + end + + open = ui.Span(section_separator_open) + close = ui.Span(section_separator_close) + end + else + separator_style.fg = style_c.fg + + open = ui.Span(part_separator_open) + close = ui.Span(part_separator_close) + end + + open:style(separator_style) + close:style(separator_style) + + if in_side == Side.LEFT then + lines[#lines + 1] = ui.Line({ span, close }) + else + lines[#lines + 1] = ui.Line({ open, span }) + end + else + separator_style.fg = style_c.fg + if show_background then + separator_style.bg = style_c.bg + end + + lines[#lines + 1] = connect_separator(span, in_side, SeparatorType.INNER) + end + end + end + + if in_side == Side.RIGHT then + local lines_in_right = {} + for i = #lines, 1, -1 do + lines_in_right[#lines_in_right + 1] = lines[i] + end + + return ui.Line(lines_in_right) + else + return ui.Line(lines) + end +end + +--==========================-- +-- Component Coloreds Group -- +--==========================-- + +Yatline.coloreds = {} +Yatline.coloreds.get = {} +Yatline.coloreds.has_separator = true + +--- Creates a component from given Coloreds according to other parameters. +--- The component it created, can contain multiple strings with different foreground color. +--- @param coloreds Coloreds The array which contains an array which contains text which will be shown inside of the component and its foreground color. +--- @param component_type ComponentType Which section component will be in [ a | b | c ]. +--- @return Line line Customized Line which follows desired style of the parameters. +--- @see set_mode_style To know how mode style selected. +--- @see set_component_style To know how component style applied. +function Yatline.coloreds.create(coloreds, component_type) + set_mode_style(cx.active.mode) + + local spans = {} + for i, colored in ipairs(coloreds) do + local span = ui.Span(colored[1]) + set_component_style(span, component_type) + span:fg(colored[2]) + + spans[i] = span + end + + return ui.Line(spans) +end + +--- Gets the hovered file's permissions of the current active tab. +--- @return Coloreds coloreds Current active tab's hovered file's permissions +function Yatline.coloreds.get:permissions() + local hovered = cx.active.current.hovered + + if hovered then + local perm = hovered.cha:perm() + + if perm then + local coloreds = {} + coloreds[1] = { " ", "black" } + + for i = 1, #perm do + local c = perm:sub(i, i) + + local fg = permissions_t_fg + if c == "-" then + fg = permissions_s_fg + elseif c == "r" then + fg = permissions_r_fg + elseif c == "w" then + fg = permissions_w_fg + elseif c == "x" or c == "s" or c == "S" or c == "t" or c == "T" then + fg = permissions_x_fg + end + + coloreds[i + 1] = { c, fg } + end + + coloreds[#perm + 2] = { " ", "black" } + + return coloreds + else + return "" + end + else + return "" + end +end + +--- Gets the number of selected and yanked files of the active tab. +--- @return Coloreds coloreds Active tab's number of selected and yanked files. +function Yatline.coloreds.get:count() + local num_yanked = #cx.yanked + local num_selected = #cx.active.selected + + local yanked_fg, yanked_icon + if cx.yanked.is_cut then + yanked_fg = cut_fg + yanked_icon = cut_icon + else + yanked_fg = copied_fg + yanked_icon = copied_icon + end + + local coloreds = { + { string.format(" %s %d ", selected_icon, num_selected), selected_fg }, + { string.format(" %s %d ", yanked_icon, num_yanked), yanked_fg }, + } + + return coloreds +end + +--- Gets the number of task states. +--- @return Coloreds coloreds Number of task states. +function Yatline.coloreds.get:task_states() + local tasks = cx.tasks.progress + + local coloreds = { + { string.format(" %s %d ", task_total_icon, tasks.total), task_total_fg }, + { string.format(" %s %d ", task_succ_icon, tasks.succ), task_succ_fg }, + { string.format(" %s %d ", task_fail_icon, tasks.fail), task_fail_fg }, + } + + return coloreds +end + +--- Gets the number of task workloads. +--- @return Coloreds coloreds Number of task workloads. +function Yatline.coloreds.get:task_workload() + local tasks = cx.tasks.progress + + local coloreds = { + { string.format(" %s %d ", task_found_icon, tasks.found), task_found_fg }, + { string.format(" %s %d ", task_processed_icon, tasks.processed), task_processed_fg }, + } + + return coloreds +end + +--- Gets colored which contains string based component's string and desired foreground color. +--- @param component_name string String based component's name. +--- @param fg Color Desired foreground color. +--- @param params? table Array of parameters of string based component. It is optional. +--- @return Coloreds coloreds Array of solely array of string based component's string and desired foreground color. +function Yatline.coloreds.get:string_based_component(component_name, fg, params) + local getter = Yatline.string.get[component_name] + + if getter then + local output + if params then + output = getter(Yatline.string.get, table.unpack(params)) + else + output = getter() + end + + if output ~= nil and output ~= "" then + return { { " " .. output .. " ", fg } } + else + return "" + end + else + return "" + end +end + +--===============-- +-- Configuration -- +--===============-- + +--- Configure separators if it is need to be added to the components. +--- Connects them with each component. +--- @param section_components table Array of components in one of the sections. +--- @param component_type ComponentType Which section component will be in [ a | b | c ]. +--- @param in_side Side Left or right side of the either header-line or status-line. +--- @param num_section_b_components integer Number of components in section-b. +--- @param num_section_c_components integer Number of components in section-c. +--- @return table section_line_components Array of line components whether or not connected with separators. +--- @see connect_separator To know how component and separator connected. +local function config_components_separators( + section_components, + component_type, + in_side, + num_section_b_components, + num_section_c_components +) + local num_section_components = #section_components + local section_line_components = {} + for i, component in ipairs(section_components) do + if component[2] == true then + separator_style = { bg = nil, fg = nil } + + local separator_type + if i ~= num_section_components then + if component_type == ComponentType.A then + separator_style = style_a + elseif component_type == ComponentType.B then + separator_style = style_b + else + separator_style = style_c + end + + separator_type = SeparatorType.INNER + else + if component_type == ComponentType.A then + separator_style.fg = style_a.bg + elseif component_type == ComponentType.B then + separator_style.fg = style_b.bg + else + separator_style.fg = style_c.bg + end + + if component_type == ComponentType.A and num_section_b_components ~= 0 then + separator_style.bg = style_b.bg + else + if num_section_c_components == 0 or component_type == ComponentType.C then + if show_background then + separator_style.bg = style_c.bg + end + else + separator_style.bg = style_c.bg + end + end + + separator_type = SeparatorType.OUTER + end + + section_line_components[i] = connect_separator(component[1], in_side, separator_type) + else + if in_side == Side.LEFT then + section_line_components[i] = component[1] + else + section_line_components[i] = component[1] + end + end + end + + return section_line_components +end + +--- Leads the given parameters to the other functions. +--- @param section_a_components table Components array whose components are in section-a of either side. +--- @param section_b_components table Components array whose components are in section-b of either side. +--- @param section_c_components table Components array whose components are in section-c of either side. +--- @param in_side Side Left or right side of the either header-line or status-line. +--- @return table section_a_line_components Array of components whose components are connected to separator and are in section-a of either side. +--- @return table section_b_line_components Array of components whose components are connected to separator and are in section-b of either side. +--- @return table section_c_line_components Array of components whose components are connected to separator and are in section-c of either side. +--- @see config_components_separators To know how separators are configured. +local function config_components(section_a_components, section_b_components, section_c_components, in_side) + local num_section_b_components = #section_b_components + local num_section_c_components = #section_c_components + + local section_a_line_components = config_components_separators( + section_a_components, + ComponentType.A, + in_side, + num_section_b_components, + num_section_c_components + ) + local section_b_line_components = config_components_separators( + section_b_components, + ComponentType.B, + in_side, + num_section_b_components, + num_section_c_components + ) + local section_c_line_components = config_components_separators( + section_c_components, + ComponentType.C, + in_side, + num_section_b_components, + num_section_c_components + ) + + return section_a_line_components, section_b_line_components, section_c_line_components +end + +--- Automatically creates and configures either left or right side according to their config. +--- @param side Config Configuration of either left or right side. +--- @return table section_a_components Components array whose components are in section-a of either side. +--- @return table section_b_components Components array whose components are in section-b of either side. +--- @return table section_c_components Components array whose components are in section-c of either side. +local function config_side(side) + local section_a_components = {} + local section_b_components = {} + local section_c_components = {} + + for _, section in ipairs(section_order) do + local components = side[section] + + local in_section, section_components + if section == "section_a" then + in_section = ComponentType.A + section_components = section_a_components + elseif section == "section_b" then + in_section = ComponentType.B + section_components = section_b_components + else + in_section = ComponentType.C + section_components = section_c_components + end + + for _, component in ipairs(components) do + local component_group = Yatline[component.type] + + if component_group then + if component.custom then + section_components[#section_components + 1] = + { component_group.create(component.name, in_section), component_group.has_separator } + else + local getter = component_group.get[component.name] + + if getter then + local output + if component.params then + output = getter(component_group.get, table.unpack(component.params)) + else + output = getter() + end + + if output ~= nil and output ~= "" then + section_components[#section_components + 1] = + { component_group.create(output, in_section), component_group.has_separator } + end + end + end + end + end + end + + return section_a_components, section_b_components, section_c_components +end + +--- Automatically creates and configures either header-line or status-line. +--- @param side Config Configuration of either left or right side. +--- @return table left_components Components array whose components are in left side of the line. +--- @return table right_components Components array whose components are in right side of the line. +--- @see config_side To know how components are gotten from side's config. +--- @see config_components To know how components are configured. +local function config_line(side, in_side) + local section_a_components, section_b_components, section_c_components = config_side(side) + + local section_a_line_components, section_b_line_components, section_c_line_components = + config_components(section_a_components, section_b_components, section_c_components, in_side) + + if in_side == Side.RIGHT then + section_a_line_components = reverse_order(section_a_line_components) + section_b_line_components = reverse_order(section_b_line_components) + section_c_line_components = reverse_order(section_c_line_components) + end + + local section_a_line = ui.Line(section_a_line_components) + local section_b_line = ui.Line(section_b_line_components) + local section_c_line = ui.Line(section_c_line_components) + + if in_side == Side.LEFT then + return ui.Line({ section_a_line, section_b_line, section_c_line }) + else + return ui.Line({ section_c_line, section_b_line, section_a_line }) + end +end + +--- Checks if either header-line or status-line contains components. +--- @param line Config Configuration of either header-line or status-line. +--- @return boolean show_line Returns yes if it contains components, otherwise returns no. +local function show_line(line) + local total_components = 0 + + for _, side in pairs(line) do + for _, section in pairs(side) do + total_components = total_components + #section + end + end + + return total_components ~= 0 +end + +--- Creates and configures paragraph which is used as left or right of either +--- header-line or status-line. +--- @param area Rect The area where paragraph will be placed in. +--- @param line? Line The line which used in paragraph. It is optional. +--- @return Paragraph paragraph Configured parapgraph. +local function config_paragraph(area, line) + local line_array = { line } or {} + if show_background then + return ui.Text(line_array):area(area):style(style_c) + else + return ui.Text(line_array):area(area) + end +end + +return { + setup = function(_, config) + config = config or {} + + tab_width = config.tab_width or 20 + + local component_positions = config.component_positions or { "header", "tab", "status" } + + show_background = config.show_background or false + + local display_header_line = config.display_header_line + if display_header_line == nil then + display_header_line = true + end + + local display_status_line = config.display_status_line + if display_status_line == nil then + display_status_line = true + end + + local header_line = config.header_line + or { + left = { section_a = {}, section_b = {}, section_c = {} }, + right = { section_a = {}, section_b = {}, section_c = {} }, + } + local status_line = config.status_line + or { + left = { section_a = {}, section_b = {}, section_c = {} }, + right = { section_a = {}, section_b = {}, section_c = {} }, + } + + if config.theme then + config = config.theme + end + + if config.section_separator then + section_separator_open = config.section_separator.open + section_separator_close = config.section_separator.close + else + section_separator_open = "" + section_separator_close = "" + end + + if config.inverse_separator then + inverse_separator_open = config.inverse_separator.open + inverse_separator_close = config.inverse_separator.close + else + inverse_separator_open = "" + inverse_separator_close = "" + end + + if config.part_separator then + part_separator_open = config.part_separator.open + part_separator_close = config.part_separator.close + else + part_separator_open = "" + part_separator_close = "" + end + + if config.style_a then + style_a = { bg = config.style_a.bg_mode.normal, fg = config.style_a.fg } + + style_a_normal_bg = config.style_a.bg_mode.normal + style_a_select_bg = config.style_a.bg_mode.select + style_a_un_set_bg = config.style_a.bg_mode.un_set + else + style_a = { bg = "white", fg = "black" } + + style_a_normal_bg = "white" + style_a_select_bg = "brightyellow" + style_a_un_set_bg = "brightred" + end + + style_b = config.style_b or { bg = "brightblack", fg = "brightwhite" } + style_c = config.style_c or { bg = "black", fg = "brightwhite" } + + permissions_t_fg = config.permissions_t_fg or "green" + permissions_r_fg = config.permissions_r_fg or "yellow" + permissions_w_fg = config.permissions_w_fg or "red" + permissions_x_fg = config.permissions_x_fg or "cyan" + permissions_s_fg = config.permissions_s_fg or "white" + + if config.selected then + selected_fg = config.selected.fg + selected_icon = config.selected.icon + else + selected_fg = "yellow" + selected_icon = "󰻭" + end + + if config.copied then + copied_fg = config.copied.fg + copied_icon = config.copied.icon + else + copied_fg = "green" + copied_icon = "" + end + + if config.cut then + cut_icon = config.cut.icon + cut_fg = config.cut.fg + else + cut_icon = "" + cut_fg = "red" + end + + if config.total then + task_total_icon = config.total.icon + task_total_fg = config.total.fg + else + task_total_icon = "󰮍" + task_total_fg = "yellow" + end + + if config.succ then + task_succ_icon = config.succ.icon + task_succ_fg = config.succ.fg + else + task_succ_icon = "" + task_succ_fg = "green" + end + + if config.fail then + task_fail_icon = config.fail.icon + task_fail_fg = config.fail.fg + else + task_fail_icon = "" + task_fail_fg = "red" + end + + if config.found then + task_found_icon = config.found.icon + task_found_fg = config.found.fg + else + task_found_icon = "󰮕" + task_found_fg = "blue" + end + + if config.processed then + task_processed_icon = config.processed.icon + task_processed_fg = config.processed.fg + else + task_processed_icon = "󰐍" + task_processed_fg = "green" + end + + Progress.partial_render = function(self) + local progress = cx.tasks.progress + if progress.total == 0 then + return { config_paragraph(self._area) } + end + + local gauge = ui.Gauge():area(self._area) + if progress.fail == 0 then + gauge = gauge:gauge_style(THEME.status.progress_normal) + else + gauge = gauge:gauge_style(THEME.status.progress_error) + end + + local percent = 99 + if progress.found ~= 0 then + percent = math.min(99, ya.round(progress.processed * 100 / progress.found)) + end + + local left = progress.total - progress.succ + return { + gauge + :percent(percent) + :label(ui.Span(string.format("%3d%%, %d left", percent, left)):style(THEME.status.progress_label)), + } + end + + if display_header_line then + if show_line(header_line) then + Header.redraw = function(self) + local left_line = config_line(header_line.left, Side.LEFT) + local right_line = config_line(header_line.right, Side.RIGHT) + + return { + config_paragraph(self._area, left_line), + ui.Text(right_line):area(self._area):align(ui.Text.RIGHT), + } + end + + Header.children_add = function() + return {} + end + Header.children_remove = function() + return {} + end + end + else + Header.redraw = function() + return {} + end + end + + if display_status_line then + if show_line(status_line) then + Status.redraw = function(self) + local left_line = config_line(status_line.left, Side.LEFT) + local right_line = config_line(status_line.right, Side.RIGHT) + local right_width = right_line:width() + + return { + config_paragraph(self._area, left_line), + ui.Text(right_line):area(self._area):align(ui.Text.RIGHT), + table.unpack(Progress:new(self._area, right_width):redraw()), + } + end + + Status.children_add = function() + return {} + end + Status.children_remove = function() + return {} + end + end + else + Status.redraw = function() + return {} + end + end + + Root.layout = function(self) + local constraints = {} + for _, component in ipairs(component_positions) do + if + (component == "header" and display_header_line) or (component == "status" and display_status_line) + then + table.insert(constraints, ui.Constraint.Length(1)) + elseif component == "tab" then + table.insert(constraints, ui.Constraint.Fill(1)) + end + end + + self._chunks = ui.Layout():direction(ui.Layout.VERTICAL):constraints(constraints):split(self._area) + end + + Root.build = function(self) + local childrens = {} + + local i = 1 + for _, component in ipairs(component_positions) do + if component == "header" and display_header_line then + table.insert(childrens, Header:new(self._chunks[i], cx.active)) + i = i + 1 + elseif component == "tab" then + table.insert(childrens, Tab:new(self._chunks[i], cx.active)) + i = i + 1 + elseif component == "status" and display_status_line then + table.insert(childrens, Status:new(self._chunks[i], cx.active)) + i = i + 1 + end + end + + self._children = childrens + end + end, +} diff --git a/homes/emenel/dotfiles/dot_config/yazi/theme.toml b/homes/emenel/dotfiles/dot_config/yazi/theme.toml index 0f5f387..0dddaae 100644 --- a/homes/emenel/dotfiles/dot_config/yazi/theme.toml +++ b/homes/emenel/dotfiles/dot_config/yazi/theme.toml @@ -1,3 +1,2 @@ [flavor] dark = "monokai-vibrant" -light = "monokai-vibrant" diff --git a/hosts/eddie/configuration.nix b/hosts/eddie/configuration.nix index 096f782..25b2e65 100644 --- a/hosts/eddie/configuration.nix +++ b/hosts/eddie/configuration.nix @@ -7,12 +7,12 @@ { imports = with nix-config.nixosModules; - [ # Include the results of the hardware scan. - ./hardware-configuration.nix - ./razer-speaker-fix.nix + [ # Include the results of the hardware scan. + ./hardware-configuration.nix + ./razer-speaker-fix.nix niri - ]; + ]; nixpkgs = { config = { @@ -219,8 +219,6 @@ services.xserver.videoDrivers = [ "nvidia" "modesetting" ]; - programs.nm-applet.enable = true; - networking = { hostName = "eddie"; domain = "local"; diff --git a/modules/home/hypridle.nix b/modules/home/hypridle.nix index 7f27fb6..9a7fd40 100644 --- a/modules/home/hypridle.nix +++ b/modules/home/hypridle.nix @@ -13,8 +13,8 @@ listener = [ { timeout = "30"; - on-timeout = "systemd-ac-power || light -S 0 && light -s razer/0003:1532:02B6.0004/backlight -S 0"; - on-resume = "systemd-ac-power || light -I && light -s razer/0003:1532:02B6.0004/backlight -S 40"; + on-timeout = "systemd-ac-power || light -S 0 && light -s razer/0003:1532:02B6.0003/backlight -S 0"; + on-resume = "systemd-ac-power || light -I && light -s razer/0003:1532:02B6.0003/backlight -S 40"; } { @@ -30,8 +30,8 @@ # ac power timers { timeout = "60"; - on-timeout = "systemd-ac-power && light -S 0 && light -s razer/0003:1532:02B6.0004/backlight -S 0"; - on-resume = "systemd-ac-power && light -I && light -s razer/0003:1532:02B6.0004/backlight -S 40"; + on-timeout = "systemd-ac-power && light -S 0 && light -s razer/0003:1532:02B6.0003/backlight -S 0"; + on-resume = "systemd-ac-power && light -I && light -s razer/0003:1532:02B6.0003/backlight -S 40"; } { timeout = "180"; diff --git a/modules/home/niri.nix b/modules/home/niri.nix index 02d7448..f262413 100644 --- a/modules/home/niri.nix +++ b/modules/home/niri.nix @@ -1,7 +1,6 @@ { config, pkgs, ... }: { - programs = { waybar = { enable = true; @@ -22,13 +21,10 @@ spawn-at-startup = [ { command = ["maestral_qt"]; } - # { command = ["xwayland-satellite" ":0"]; } { command = ["clipse" "-listen"]; } - # { command = ["waybar"]; } { command = ["swayosd-server"]; } { command = ["plexamp"]; } - { command = [ "systemctl --user restart waybar.service mako.service hypridle.service xwayland-satellite.service" ]; } - # { command = ["hypridle"]; } + { command = [ "systemctl" "--user" "restart" "waybar.service" "mako.service" "hypridle.service" "xwayland-satellite.service" ]; } ]; workspaces = { @@ -60,18 +56,18 @@ outputs = { "eDP-1" = { mode = { - height = 2560; - width = 1600; + width = 2560; + height = 1600; }; background-color = "#000000"; scale = 1; + variable-refresh-rate = true; }; "PNP(BNQ) BenQ PD2725U N2N00414019" = { mode = { - height = 3840; - width = 2160; - refresh = 59.997; + width = 3840; + height = 2160; }; background-color = "#000000"; scale = 1; @@ -174,6 +170,11 @@ open-floating = true; } ]; + switch-events = with config.lib.niri.actions; { + lid-close.action = spawn "niri msg output eDP-1 off"; + lid-open.action = spawn "niri msg output eDP-1 on && shikanectl switch desk-clam"; + }; + binds = with config.lib.niri.actions; let wez = spawn "wezterm" "--config-file" "/home/emenel/.config/wezterm/launcher.lua" "start" "--always-new-process"; wezlaunch = wez "--class" "launcher"; diff --git a/modules/home/shell-conf.nix b/modules/home/shell-conf.nix index 3519235..c173a64 100644 --- a/modules/home/shell-conf.nix +++ b/modules/home/shell-conf.nix @@ -13,7 +13,7 @@ age figlet ffmpeg-full - + ouch pinentry gcr gnutar @@ -22,6 +22,7 @@ zip stdenv tldr + glow delta htop gnupg @@ -37,7 +38,8 @@ coreutils binutils editorconfig-core-c - openssl.out + openssl + exiftool libsecret samba4Full shellcheck diff --git a/modules/home/shikane.nix b/modules/home/shikane.nix index b23b8a0..3098e68 100644 --- a/modules/home/shikane.nix +++ b/modules/home/shikane.nix @@ -13,7 +13,7 @@ }; Service = { Type = "simple"; - ExecStart = "shikane"; + ExecStart = "${pkgs.shikane}/bin/shikane"; }; }; diff --git a/modules/home/yazi.nix b/modules/home/yazi.nix index 9ac0360..70e2034 100644 --- a/modules/home/yazi.nix +++ b/modules/home/yazi.nix @@ -6,14 +6,71 @@ package = inputs.yazi.packages.x86_64-linux.default; initLua = ../../homes/emenel/dotfiles/dot_config/yazi/init.lua; keymap = { - input.prepend_keymap = [ - { on = ""; run = "shell 'ripdrag \"$@\" -x 2>/dev/null &' --confirm"; } + manager.prepend_keymap = [ + { on = ["c" "d"]; run = "shell 'ripdrag \"$@\" -x 2>/dev/null &' --confirm"; desc = "drag selection";} { on = "y"; run = ["shell 'for path in \"$@\"; do echo \"file://$path\"; done | wl-copy -t text/uri-list'\n" "yank"]; } - { on = ["g" "r"]; run = "shell 'ya emit cd \"$(git rev-parse --show-toplevel)\"'\n"; } + { on = ["g" "r"]; run = "shell 'ya emit cd \"$(git rev-parse --show-toplevel)\"'\n"; desc = "go to top of git repo"; } + { on = ["t" "p"]; run = "plugin toggle-view parent"; desc = "Toggle parent"; } + { on = ["t" "c"]; run = "plugin toggle-view current"; desc = "Toggle current"; } + { on = ["t" "r"]; run = "plugin toggle-view preview"; desc = "Toggle preview"; } + { on = ""; run ="tab_create"; } + { on = ""; run ="tab_close"; } + { on = ""; run ="tab_switch 1 --relative"; } + { on = ""; run ="tab_switch -1 --relative"; } + { on = ""; run = "spot"; desc = "Spot hovered file"; } + { on = "M"; run = "plugin mount"; } + { on = "p"; run = "plugin smart-paste"; desc = "Paste into the hovered directory or CWD"; } + { on = ""; run = "close"; desc = "cancel input"; } ]; }; + settings = { + manager = { + sort_dir_first = false; + }; + opener = { + edit = [ + { run = "em \"$@\""; } + ]; + extract = [ + { run = "ouch d -y \"%*\""; desc = "Extract here with ouch"; for = "windows"; } + { run = "ouch d -y \"$@\""; desc = "Extract here with ouch"; for = "unix"; } + ]; + }; + plugin = { + append_previewers = [ + { name = "*"; run = "file-extra-metadata"; } + { name = "*.md"; run = "glow"; } + { mime = "{image,audio,video}/*"; run = "mediainfo";} + { mime = "application/x-subrip"; run = "mediainfo";} + + # Archive previewer + { mime = "application/*zip"; run = "ouch"; } + { mime = "application/x-tar"; run = "ouch"; } + { mime = "application/x-bzip2"; run = "ouch"; } + { mime = "application/x-7z-compressed"; run = "ouch"; } + { mime = "application/x-rar"; run = "ouch"; } + { mime = "application/x-xz"; run = "ouch"; } + ]; + append_spotters = [ + { name = "*"; run = "file-extra-metadata"; } + ]; + prepend_fetchers = [ + { + id = "git"; + name = "*"; + run = "git"; + } + { + id = "git"; + name = "*/"; + run = "git"; + } + ]; + }; + }; }; xdg.configFile."yazi/theme.toml".source = ../../homes/emenel/dotfiles/dot_config/yazi/theme.toml; xdg.configFile."yazi/flavors".source = ../../homes/emenel/dotfiles/dot_config/yazi/flavors; + xdg.configFile."yazi/plugins".source = ../../homes/emenel/dotfiles/dot_config/yazi/plugins; }