From 2cb1bacacb1cca0c6900ffe222ed34ca857a31fe Mon Sep 17 00:00:00 2001 From: Anton Shuvalov Date: Fri, 13 Dec 2024 17:05:13 +0700 Subject: [PATCH] Updates --- bin/update-hyprland-git | 18 ++ configs/hypr/config.d/10-autostart.conf | 4 +- configs/hypr/config.d/10-display.conf | 3 +- configs/hypr/config.d/10-input.conf | 3 + configs/hypr/config.d/20-key-bindings.conf | 4 +- configs/hypr/config.d/20-trackball.conf | 5 +- configs/hypr/config.d/90-theme.conf | 13 +- configs/hypr/config.d/90-window-rules.conf | 7 +- configs/hypr/hyprland.conf | 1 + configs/kitty/kitty.conf | 2 + configs/newsboat/config | 36 +++ configs/newsboat/urls | 8 +- .../after/queries/markdown/highlights.scm | 212 +++++++++--------- .../queries/markdown_inline/highlights.scm | 22 +- configs/nvim/lazy-lock.json | 4 + configs/nvim/lua/lib/obsidian/obsidian.lua | 1 - configs/nvim/lua/plugins/codecompanion.lua | 159 +++++++++++++ configs/tmux/tmux.conf | 27 ++- configs/waybar/bin/docker.sh | 1 - configs/waybar/bin/newsboat-stats.sh | 2 +- configs/waybar/bottom.config | 7 + configs/waybar/restart | 5 +- configs/waybar/top.config | 51 ++--- configs/waybar/top_debug.config | 162 +++++++++++++ 24 files changed, 573 insertions(+), 184 deletions(-) create mode 100755 bin/update-hyprland-git create mode 100644 configs/nvim/lua/plugins/codecompanion.lua create mode 100644 configs/waybar/top_debug.config diff --git a/bin/update-hyprland-git b/bin/update-hyprland-git new file mode 100755 index 0000000..f7f4c81 --- /dev/null +++ b/bin/update-hyprland-git @@ -0,0 +1,18 @@ +#!/bin/bash + +paru -S \ + hyprland-git \ + hyprgraphics-git \ + hyprwayland-scanner-git \ + hyprutils-git \ + hyprprop-git \ + hyprlock-git \ + hyprlang-git \ + hyprevents-git \ + hyprcursor-git \ + aquamarine-git \ + hyprprop-git \ + hyprpicker-git \ + hyprpaper-git \ + hyprland-protocols-git \ + xdg-desktop-portal-hyprland-git diff --git a/configs/hypr/config.d/10-autostart.conf b/configs/hypr/config.d/10-autostart.conf index fbb9065..66e4115 100644 --- a/configs/hypr/config.d/10-autostart.conf +++ b/configs/hypr/config.d/10-autostart.conf @@ -1,12 +1,10 @@ -exec-once = zsh -c "waybar --config ~/.config/waybar/top.config --style ~/.config/waybar/top.style.css" -exec-once = zsh -c "waybar --config ~/.config/waybar/bottom.config --style ~/.config/waybar/bottom.style.css" +exec-once = ~/.config/waybar/restart exec-once = swaync & exec-once = blueman-applet & exec-once = nm-applet --indicator & exec-once = udiskie -an --tray -f thunar & exec-once = pasystray & -exec-once = ~/.config/hypr/bin/wallpapers.py > ~/.tmp/logs/wallpapers.py.log exec-once = ~/.config/hypr/bin/uair.sh exec-once = avizo-service exec-once = ~/.config/hypr/bin/xdg-portal.sh diff --git a/configs/hypr/config.d/10-display.conf b/configs/hypr/config.d/10-display.conf index 706a7cf..f1c111f 100644 --- a/configs/hypr/config.d/10-display.conf +++ b/configs/hypr/config.d/10-display.conf @@ -4,7 +4,7 @@ monitor=eDP-1, 2560x1600@60Hz, 0x0, 1.666667 monitor=desc:Samsung Electric Company LU28R55 HNMN700388, 3840x2160@30Hz, 0x-1080, 2 # Office -monitor=desc:Samsung Electric Company LU28R55 H4ZT400899, 3840x2160@30Hz, -360x-1440, 1.5 +monitor=desc:Samsung Electric Company LU28R55 H4ZT400899, 3840x2160@30Hz, 1536x-800, 1.33 # Portable monitor=desc:Invalid Vendor Codename - RTK 0x2775 0x20230814, 2520x1680@60.00000, -840x0, 2, transform, 3 @@ -15,3 +15,4 @@ monitor=desc:Invalid Vendor Codename - RTK 0x2775 0x20230814, 2520x1680@60.00000 monitor=desc:Samsung Electric Company C34H89x H4ZT300037, 3440x1440@60Hz, -600x-1152, 1.25 exec-once = hyprpaper & +exec-once = ~/.config/hypr/bin/wallpapers.py > ~/.tmp/logs/wallpapers.py.log diff --git a/configs/hypr/config.d/10-input.conf b/configs/hypr/config.d/10-input.conf index 4ca8526..114bc26 100644 --- a/configs/hypr/config.d/10-input.conf +++ b/configs/hypr/config.d/10-input.conf @@ -4,6 +4,9 @@ input { kb_variant = ,mac kb_options = grp:caps_toggle + scroll_factor = 0.5 + + follow_mouse = 1 touchpad { diff --git a/configs/hypr/config.d/20-key-bindings.conf b/configs/hypr/config.d/20-key-bindings.conf index b0eb800..a36bc56 100644 --- a/configs/hypr/config.d/20-key-bindings.conf +++ b/configs/hypr/config.d/20-key-bindings.conf @@ -16,7 +16,8 @@ $brightnessDown = brightnessctl set 2%- # Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more bind = $mainModShift, return, exec, ~/.bin/add-todo -bind = $mainMod, F, fullscreen +bind = $mainModShift, F, fullscreen, 2 +bind = $mainMod, F, fullscreen, 1 bind = $mainMod, R, togglesplit # Speaker volume @@ -164,6 +165,7 @@ bind = $mainMod, mouse_up, workspace, e-1 # Move/resize windows with mainMod + LMB/RMB and dragging bindm = $mainMod, mouse:272, movewindow bindm = $mainMod, mouse:273, resizewindow +bindr = , mouse:274, exec, # Brightness bind = ,XF86MonBrightnessUp, exec, brightnessctl set 2%+ diff --git a/configs/hypr/config.d/20-trackball.conf b/configs/hypr/config.d/20-trackball.conf index 4fc6c1c..8dcdaf6 100644 --- a/configs/hypr/config.d/20-trackball.conf +++ b/configs/hypr/config.d/20-trackball.conf @@ -1,9 +1,6 @@ device { name = jomaa-mouse01-mouse - # sensitivity = 1 accel_profile = adaptive scroll_method = on_button_down - scroll_button = 275 + scroll_button = 274 } - -# bind = , mouse:274, killactive, diff --git a/configs/hypr/config.d/90-theme.conf b/configs/hypr/config.d/90-theme.conf index 2c0a877..89c9c32 100644 --- a/configs/hypr/config.d/90-theme.conf +++ b/configs/hypr/config.d/90-theme.conf @@ -28,19 +28,22 @@ group { decoration { rounding = 3 - drop_shadow = yes - shadow_range = 8 - shadow_render_power = 2 - col.shadow = rgba(00000044) + shadow { + enabled = true + range = 8 + render_power = 2 + color = rgba(00000044) + } dim_inactive = false blur { enabled = true + xray = false size = 3 passes = 3 new_optimizations = on - noise = 0.01 + noise = 0.2 contrast = 0.9 brightness = 0.8 } diff --git a/configs/hypr/config.d/90-window-rules.conf b/configs/hypr/config.d/90-window-rules.conf index 2a0fcf3..ebaa188 100644 --- a/configs/hypr/config.d/90-window-rules.conf +++ b/configs/hypr/config.d/90-window-rules.conf @@ -1,6 +1,7 @@ -# Example windowrule v1 windowrule = float, class:(float) +windowrulev2 = bordercolor rgb(d8dee8) rgb(7F848D),fullscreen:1 + # 1Password windowrule = float, ^(1Password)$ windowrulev2 = size 60% 60%, class:(1Password) @@ -24,6 +25,10 @@ windowrulev2 = size 60% 60%, title:^(Picture-in-Picture)$ windowrulev2 = center, class:^(chatgpt-nativefier.*)$ # --- +# Waydroid +windowrulev2 = float, class:^Waydroid$ +windowrulev2 = move 100%-w-20 100%-w-100, class:^Waydroid$ + # Chrome PiP windowrulev2 = float, title:^(Picture in picture)$ windowrulev2 = size 20% 20%, title:^(Picture in picture)$ diff --git a/configs/hypr/hyprland.conf b/configs/hypr/hyprland.conf index 267eb9b..ed90a9a 100644 --- a/configs/hypr/hyprland.conf +++ b/configs/hypr/hyprland.conf @@ -27,6 +27,7 @@ misc { vrr = 1 mouse_move_enables_dpms = false key_press_enables_dpms = true + middle_click_paste = false } master { diff --git a/configs/kitty/kitty.conf b/configs/kitty/kitty.conf index bef8316..d2ef429 100644 --- a/configs/kitty/kitty.conf +++ b/configs/kitty/kitty.conf @@ -7,6 +7,8 @@ background_opacity 0.8 dynamic_background_opacity no remember_window_size no +show_hyperlink_targets yes + sync_to_monitor yes enable_audio_bell no diff --git a/configs/newsboat/config b/configs/newsboat/config index 78edb62..7504fcb 100644 --- a/configs/newsboat/config +++ b/configs/newsboat/config @@ -6,6 +6,42 @@ datetime-format "%Y-%m-%d" bookmark-cmd "/usr/share/doc/newsboat/contrib/getpocket.com/send-to-pocket.sh" +color info color15 color9 bold +color listfocus color15 color9 +color listfocus_unread color15 color9 bold + + +highlight article "(^Feed:|^Title:|^Date:|^Link:|^Author:)" color0 default bold +highlight article "https?://[^ ]+" color0 default +highlight article "\\[[0-9][0-9]*\\]" color0 default bold +highlight article "\\[image\\ [0-9]+\\]" color0 default bold +highlight article "\\[embedded flash: [0-9][0-9]*\\]" color0 default bold +highlight article ":.*\\(link\\)$" color0 default bold +highlight article ":.*\\(image\\)$" color0 default bold +highlight article ":.*\\(embedded flash\\)$" color0 default bold + + +highlight-article "title =~ \"react\"" color0 color12 +highlight-article "title =~ \"frontend\"" color0 color12 +highlight-article "title =~ \" js|js |javascript|typescript| ts \"" color0 color12 +highlight-article "title =~ \" ai|ai \"" color0 color12 +highlight-article "title =~ \"python\"" color0 color12 +highlight-article "title =~ \"django|drf\"" color0 color12 +highlight-article "title =~ \"vim|nvim|neovim\"" color0 color12 +highlight-article "title =~ \"rust\"" color0 color12 +highlight-article "title =~ \"database\"" color0 color12 +highlight-article "title =~ \"archlinux| arch \"" color0 color12 +highlight-article "title =~ \"openai\"" color0 color12 +highlight-article "title =~ \"google\"" color0 color12 +highlight-article "title =~ \"aws\"" color0 color12 +highlight-article "title =~ \"github\"" color0 color12 +highlight-article "title =~ \"btc|bitcoin\"" color0 color12 +highlight-article "title =~ \"thinkpad|lenovo| x1 \"" color0 color12 +highlight-article "title =~ \"^fed | fed \"" color0 color12 + +ignore-article "*" "title =~ \"died\"" +ignore-article "*" "title =~ \"cancer\"" +ignore-article "*" "title =~ \"autism\"" ignore-article "*" "title =~ \"Apple Watch\"" ignore-article "*" "title =~ \"IDEA\"" ignore-article "*" "title =~ \"Windows 11\"" diff --git a/configs/newsboat/urls b/configs/newsboat/urls index 8bd2049..1647366 100644 --- a/configs/newsboat/urls +++ b/configs/newsboat/urls @@ -7,14 +7,14 @@ "query:* AI:(title =~ \"AI \" or title =~\"AI's\")" "query:* BITCOIN:(title =~ \"bitcoin \" or title =~\"btc \")" -"query:* MUSIC:( tags # \"music\" and unread == \"yes\" )" +# "query:* MUSIC:( tags # \"music\" and unread == \"yes\" )" "query:* DEV:( tags # \"dev\" and unread == \"yes\" )" "query:* NEWS:( tags # \"news\" and unread == \"yes\" )" -https://canthisevenbecalledmusic.com/feed/ "~Can This Even Be Called Music?" music -https://theprogressivesubway.com/feed/ "~The Progressive Subway" music +# https://canthisevenbecalledmusic.com/feed/ "~Can This Even Be Called Music?" music +# https://theprogressivesubway.com/feed/ "~The Progressive Subway" music -https://archlinux.org/feeds/news/ "~Arch News" dev +sttps://archlinux.org/feeds/news/ "~Arch News" dev https://monthly-reports.archlinux.page/index.xml "~Arch Monthly Reports" dev https://マリウス.com/index.xml dev https://junegunn.kr/atom.xml dev diff --git a/configs/nvim/after/queries/markdown/highlights.scm b/configs/nvim/after/queries/markdown/highlights.scm index d714b1c..b229240 100644 --- a/configs/nvim/after/queries/markdown/highlights.scm +++ b/configs/nvim/after/queries/markdown/highlights.scm @@ -1,106 +1,106 @@ -;; inherits: markdown -;; extends - -;From MDeiml/tree-sitter-markdown & Helix - -(list_item (task_list_marker_checked)) @comment (#set! "priority" 90) - -[ - (list_marker_plus) - (list_marker_minus) - (list_marker_star) - (list_marker_dot) - (list_marker_parenthesis) - (thematic_break) -] @string - -[ - (task_list_marker_checked) - (task_list_marker_unchecked) -] @task_marker - -[ - (atx_h1_marker) - (atx_h2_marker) - (atx_h3_marker) - (atx_h4_marker) - (atx_h5_marker) - (atx_h6_marker) -] @header_marker - -(atx_heading) @header_content - -;; concealing -((atx_h1_marker) @header_marker.h1 - (#offset! @header_marker.h1 0 0 0 0) - (#set! conceal "󰉫 ") -) - -((atx_h2_marker) @header_marker.h2 - (#offset! @header_marker.h2 0 0 0 0) - (#set! conceal "󰉬 ") -) - -((atx_h3_marker) @header_marker.h3 - (#offset! @header_marker.h3 0 0 0 0) - (#set! conceal "󰉭 ") -) - -((atx_h4_marker) @header_marker.h4 - (#offset! @header_marker.h4 0 0 0 0) - (#set! conceal "󰉮 ") -) - -((atx_h5_marker) @header_marker.h5 - (#offset! @header_marker.h5 0 0 0 0) - (#set! conceal "󰉯 ") -) - -((atx_h6_marker) @header_marker.h6 - (#offset! @header_marker.h6 0 0 0 0) - (#set! conceal "󰉰 ") -) - -((list_marker_plus) @list_marker.plus - (#offset! @list_marker.plus 0 0 0 -1) - (#set! conceal "⁃") -) -((list_marker_minus) @list_marker.minus - (#offset! @list_marker.minus 0 0 0 -1) - (#set! conceal "⁃") -) - -((list_marker_star) @list_marker.star - (#offset! @list_marker.star 0 0 0 -1) - (#set! conceal "⁃") -) - -; ((list_marker_dot) @list_marker.dot -; (#offset! @list_marker.dot 0 0 0 -1) -; (#set! conceal "") -; ) - -((list_marker_parenthesis) @list_marker.parenthesis - (#offset! @list_marker.parenthesis 0 0 0 -1) - (#set! conceal "⁃") -) - -;; replace '[x]' with 󰄲 -((task_list_marker_checked) @text.todo.checked - (#offset! @text.todo.checked 0 -2 0 0) - (#set! conceal "•") -) - -;; replace '[ ]' with 󰄱 -((task_list_marker_unchecked) @text.todo.unchecked - (#offset! @text.todo.unchecked 0 -2 0 0) - (#set! conceal "◦") -) - -([(minus_metadata)] @comment) - -(fenced_code_block - (fenced_code_block_delimiter) @markup.raw.block - - (#set! conceal "`")) - +;;; inherits: markdown +;;; extends +; +;;From MDeiml/tree-sitter-markdown & Helix +; +;(list_item (task_list_marker_checked)) @comment (#set! "priority" 90) +; +;[ +; (list_marker_plus) +; (list_marker_minus) +; (list_marker_star) +; (list_marker_dot) +; (list_marker_parenthesis) +; (thematic_break) +;] @string +; +;[ +; (task_list_marker_checked) +; (task_list_marker_unchecked) +;] @task_marker +; +;[ +; (atx_h1_marker) +; (atx_h2_marker) +; (atx_h3_marker) +; (atx_h4_marker) +; (atx_h5_marker) +; (atx_h6_marker) +;] @header_marker +; +;(atx_heading) @header_content +; +;;; concealing +;((atx_h1_marker) @header_marker.h1 +; (#offset! @header_marker.h1 0 0 0 0) +; (#set! conceal "󰉫 ") +;) +; +;((atx_h2_marker) @header_marker.h2 +; (#offset! @header_marker.h2 0 0 0 0) +; (#set! conceal "󰉬 ") +;) +; +;((atx_h3_marker) @header_marker.h3 +; (#offset! @header_marker.h3 0 0 0 0) +; (#set! conceal "󰉭 ") +;) +; +;((atx_h4_marker) @header_marker.h4 +; (#offset! @header_marker.h4 0 0 0 0) +; (#set! conceal "󰉮 ") +;) +; +;((atx_h5_marker) @header_marker.h5 +; (#offset! @header_marker.h5 0 0 0 0) +; (#set! conceal "󰉯 ") +;) +; +;((atx_h6_marker) @header_marker.h6 +; (#offset! @header_marker.h6 0 0 0 0) +; (#set! conceal "󰉰 ") +;) +; +;((list_marker_plus) @list_marker.plus +; (#offset! @list_marker.plus 0 0 0 -1) +; (#set! conceal "⁃") +;) +;((list_marker_minus) @list_marker.minus +; (#offset! @list_marker.minus 0 0 0 -1) +; (#set! conceal "⁃") +;) +; +;((list_marker_star) @list_marker.star +; (#offset! @list_marker.star 0 0 0 -1) +; (#set! conceal "⁃") +;) +; +;; ((list_marker_dot) @list_marker.dot +;; (#offset! @list_marker.dot 0 0 0 -1) +;; (#set! conceal "") +;; ) +; +;((list_marker_parenthesis) @list_marker.parenthesis +; (#offset! @list_marker.parenthesis 0 0 0 -1) +; (#set! conceal "⁃") +;) +; +;;; replace '[x]' with 󰄲 +;((task_list_marker_checked) @text.todo.checked +; (#offset! @text.todo.checked 0 -2 0 0) +; (#set! conceal "•") +;) +; +;;; replace '[ ]' with 󰄱 +;((task_list_marker_unchecked) @text.todo.unchecked +; (#offset! @text.todo.unchecked 0 -2 0 0) +; (#set! conceal "◦") +;) +; +;([(minus_metadata)] @comment) +; +;(fenced_code_block +; (fenced_code_block_delimiter) @markup.raw.block +; +; (#set! conceal "`")) +; diff --git a/configs/nvim/after/queries/markdown_inline/highlights.scm b/configs/nvim/after/queries/markdown_inline/highlights.scm index ab0a7f4..d3c894c 100644 --- a/configs/nvim/after/queries/markdown_inline/highlights.scm +++ b/configs/nvim/after/queries/markdown_inline/highlights.scm @@ -1,11 +1,11 @@ -;; inherits: markdown_inline -;; extends - -([ - (code_span_delimiter) - (shortcut_link) -] @comment) - -([ - (link_text) -] @string) +;;; inherits: markdown_inline +;;; extends +; +;([ +; (code_span_delimiter) +; (shortcut_link) +;] @comment) +; +;([ +; (link_text) +;] @string) diff --git a/configs/nvim/lazy-lock.json b/configs/nvim/lazy-lock.json index 5fe85f2..20d0f98 100644 --- a/configs/nvim/lazy-lock.json +++ b/configs/nvim/lazy-lock.json @@ -9,6 +9,7 @@ "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, "cmp-spell": { "branch": "master", "commit": "694a4e50809d6d645c1ea29015dad0c293f019d6" }, "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, + "codecompanion.nvim": { "branch": "main", "commit": "988fbdc9be2c339e1a41157e51869b436e038804" }, "conform.nvim": { "branch": "master", "commit": "1a99fdc1d3aa9ccdf3021e67982a679a8c5c740c" }, "editorconfig-vim": { "branch": "master", "commit": "8b7da79e9daee7a3f3a8d4fe29886b9756305aff" }, "friendly-snippets": { "branch": "main", "commit": "00ba9dd3df89509f95437b8d595553707c46d5ea" }, @@ -26,6 +27,7 @@ "mason-lspconfig.nvim": { "branch": "main", "commit": "25c11854aa25558ee6c03432edfa0df0217324be" }, "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" }, "mini.icons": { "branch": "main", "commit": "a2742459f0ee32806c2438ca06b4d8b331f3f4d4" }, + "mini.nvim": { "branch": "main", "commit": "690a3b4c78c4956f7ecf770124b522d32084b872" }, "nerdtree": { "branch": "master", "commit": "9b465acb2745beb988eff3c1e4aa75f349738230" }, "nerdtree-git-plugin": { "branch": "master", "commit": "e1fe727127a813095854a5b063c15e955a77eafb" }, "nui.nvim": { "branch": "main", "commit": "b58e2bfda5cea347c9d58b7f11cf3012c7b3953f" }, @@ -41,7 +43,9 @@ "playground": { "branch": "master", "commit": "ba48c6a62a280eefb7c85725b0915e021a1a0749" }, "plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" }, "pretty-fold.nvim": { "branch": "master", "commit": "a7d8b424abe0eedf50116c460fbe6dfd5783b1d5" }, + "render-markdown.nvim": { "branch": "main", "commit": "b6b903cc09df1441602fc04665fb12cef576a914" }, "tailwind-tools": { "branch": "master", "commit": "4b2d88cc7d49a92f28b9942712f1a53d2c3d5b27" }, + "telescope.nvim": { "branch": "master", "commit": "eae0d8fbde590b0eaa2f9481948cd6fd7dd21656" }, "vim-fugitive": { "branch": "master", "commit": "d4877e54cef67f5af4f950935b1ade19ed6b7370" }, "vim-rhubarb": { "branch": "master", "commit": "ee69335de176d9325267b0fd2597a22901d927b1" }, "which-key.nvim": { "branch": "main", "commit": "8badb359f7ab8711e2575ef75dfe6fbbd87e4821" } diff --git a/configs/nvim/lua/lib/obsidian/obsidian.lua b/configs/nvim/lua/lib/obsidian/obsidian.lua index ef00d55..b9a4f88 100644 --- a/configs/nvim/lua/lib/obsidian/obsidian.lua +++ b/configs/nvim/lua/lib/obsidian/obsidian.lua @@ -16,7 +16,6 @@ local function setup_cmp() end local function setup() - print(123123) setup_cmp() require("lib/obsidian/md_buffer_au") -- require("lib/obsidian/wikilinks") diff --git a/configs/nvim/lua/plugins/codecompanion.lua b/configs/nvim/lua/plugins/codecompanion.lua new file mode 100644 index 0000000..998cff8 --- /dev/null +++ b/configs/nvim/lua/plugins/codecompanion.lua @@ -0,0 +1,159 @@ +local mode = { "n", "x" } + +return { + "olimorris/codecompanion.nvim", + dependencies = { + "nvim-lua/plenary.nvim", + "nvim-treesitter/nvim-treesitter", + { "MeanderingProgrammer/render-markdown.nvim", ft = { "markdown", "codecompanion" } }, + "nvim-telescope/telescope.nvim", + "echasnovski/mini.nvim", + }, + config = function() + require("codecompanion").setup({ + display = { + diff = { + provider = "mini_diff", + }, + action_palette = { + provider = "telescope", + }, + }, + adapters = { + openai = function() + return require("codecompanion.adapters").extend("openai", { + env = { + api_key = os.getenv("OPENAI_API_KEY"), + }, + }) + end, + }, + + strategies = { + chat = { + adapter = "openai", + }, + inline = { + adapter = "openai", + }, + }, + prompt_library = { + ["Review"] = { + strategy = "chat", + description = "Review code in a buffer", + opts = { + mapping = "ar", + modes = { "v" }, + short_name = "review", + auto_submit = true, + stop_context_insertion = true, + user_prompt = false, + }, + prompts = { + { + role = "system", + content = function(context) + return "I want you to act as a senior " + .. context.filetype + .. " developer." + .. " You need to review the given code and provide concise summary of issues, unoptimal solutions, and possible risks in the code." + .. " I will ask you specific questions and I want you to return concise explanations and codeblock examples." + end, + }, + { + role = "user", + content = function(context) + local text + if context.is_visual then + text = require("codecompanion.helpers.actions").get_code(context.start_line, context.end_line) + else + local buf_utils = require("codecompanion.utils.buffers") + text = buf_utils.get_content(context.bufnr) + end + + return "Review the following code:\n\n```" .. context.filetype .. "\n" .. text .. "\n```\n\n" + end, + opts = { + contains_code = true, + }, + }, + }, + }, + ["Optimize"] = { + strategy = "inline", + description = "Optimize given code", + opts = { + mapping = "ao", + short_name = "optimize", + }, + prompts = { + { + role = "system", + content = function(context) + return "I want you to act as a senior " + .. context.filetype + .. " developer." + .. " I will give code and I want you in response to return a code that can replace this code without any additional explanations or new comments. " + end, + }, + { + role = "user", + content = function(context) + local text = require("codecompanion.helpers.actions").get_code(context.start_line, context.end_line) + + return "Please optimize following code:\n\n```" .. context.filetype .. "\n" .. text .. "\n```\n\n" + end, + opts = { + contains_code = true, + }, + }, + }, + }, + }, + }) + end, + + keys = { + { "aa", vim.cmd.CodeCompanionActions, mode = mode, desc = "Code Companion Actions" }, + { + "ac", + function() + vim.cmd.CodeCompanionChat("Toggle") + end, + mode = mode, + desc = "Code Companion Chat", + }, + { + "ad", + function() + require("codecompanion").prompt("lsp") + end, + mode = mode, + desc = "Debug Diagnostics", + }, + { + "af", + function() + require("codecompanion").prompt("fix") + end, + mode = mode, + desc = "Fix Code", + }, + { + "ao", + function() + require("codecompanion").prompt("optimize") + end, + mode = mode, + desc = "Optimize", + }, + { + "ar", + function() + require("codecompanion").prompt("review") + end, + mode = mode, + desc = "Review", + }, + }, +} diff --git a/configs/tmux/tmux.conf b/configs/tmux/tmux.conf index a5ef4af..cee4aab 100644 --- a/configs/tmux/tmux.conf +++ b/configs/tmux/tmux.conf @@ -15,10 +15,7 @@ set -s escape-time 0 set -g main-pane-height 60 set -g status-fg black set -g status-bg colour15 -set -g status-left '\ - #{online_status}\ - #H\ -' +set -g status-left ' #U@#H.#S' set -g window-status-format " | #I.#W" @@ -34,34 +31,40 @@ set -g pane-active-border-style "bg=default fg=blue" set -g status-right ":#(cd #{pane_current_path}; git rev-parse --abbrev-ref HEAD) " set -g status-interval 10 +bind -n M-1 select-window -t 1 +bind -n M-2 select-window -t 2 +bind -n M-3 select-window -t 3 +bind -n M-4 select-window -t 4 +bind -n M-5 select-window -t 5 +bind -n M-6 select-window -t 6 +bind -n M-7 select-window -t 7 +bind -n M-8 select-window -t 8 +bind -n M-9 select-window -t 9 +bind -n M-0 select-window -t 0 + # Have new windows and panes open in the current directory bind c new-window -c '#{pane_current_path}' bind \\ split-window -c '#{pane_current_path}' bind | split-window -c '#{pane_current_path}' -h bind f set-option status -bind -n C-l send-keys 'C-l' -bind i command-prompt -p 'Insert window at:' 'run-shell "if tmux select-window -t %1; then tmux new-window -a; tmux swap-window -s %1 -t \$((%1+1)); else tmux new-window; tmux move-window -t %1; fi; tmux select-window -t #I; tmux select-window -t %1;"' -# bind -T root S-Left select-pane -L -# bind -T root S-Right select-pane -R -# bind -T root S-Up select-pane -U -# bind -T root S-Down select-pane -D +bind i command-prompt -p 'Insert window at:' 'run-shell "if tmux select-window -t %1; then tmux new-window -a; tmux swap-window -s %1 -t \$((%1+1)); else tmux new-window; tmux move-window -t %1; fi; tmux select-window -t #I; tmux select-window -t %1;"' bind -n S-Left run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys S-Left) || tmux select-pane -L" bind -n S-Down run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys S-Down) || tmux select-pane -D" bind -n S-Up run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys S-Up) || tmux select-pane -U" bind -n S-Right run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys S-Right) || tmux select-pane -R" - # List of plugins set -g @plugin 'tmux-plugins/tpm' set -g @plugin 'tmux-plugins/tmux-sensible' set -g @plugin 'tmux-plugins/tmux-cpu' set -g @plugin 'nhdaly/tmux-better-mouse-mode' +set -g @plugin 'soyuka/tmux-current-pane-hostname' # Scroll through send up and down keys on mouse wheel in legacy apps -tmux_commands_with_legacy_scroll="nano less more man git" +tmux_commands_with_legacy_scroll="nano less more man git newsboat" bind-key -T root WheelUpPane \ if-shell -Ft= '#{?mouse_any_flag,1,#{pane_in_mode}}' \ diff --git a/configs/waybar/bin/docker.sh b/configs/waybar/bin/docker.sh index 446f5cf..8f04d82 100755 --- a/configs/waybar/bin/docker.sh +++ b/configs/waybar/bin/docker.sh @@ -1,7 +1,6 @@ #!/bin/sh RUNNING_CONTAINERS=$(docker ps --format "{{.ID}} | {{.Names}}") -# RUNNING_CONTAINERS=$(docker ps --format "{{.ID}} | {{.Names}} | {{.Image}} | {{.Ports}} | {{.Status}}") RUNNING_CONTAINERS_STR=$(printf "%s" "$RUNNING_CONTAINERS" | sed ':a;N;$!ba;s/\n/\\n/g; s/"/\\"/g') NUMBER_RUNNING_CONTAINERS=$(printf "%s\n" "$RUNNING_CONTAINERS" | wc -l) NUMBER_TOTAL_CONTAINERS=$(docker ps -qa | wc -l) diff --git a/configs/waybar/bin/newsboat-stats.sh b/configs/waybar/bin/newsboat-stats.sh index a5b00cd..dfd54c8 100755 --- a/configs/waybar/bin/newsboat-stats.sh +++ b/configs/waybar/bin/newsboat-stats.sh @@ -1,4 +1,4 @@ -#/bin/bash +#!/bin/bash if pgrep -x "newsboat" > /dev/null; then cat ~/.tmp/newsboat-current diff --git a/configs/waybar/bottom.config b/configs/waybar/bottom.config index 482bfc2..e440718 100644 --- a/configs/waybar/bottom.config +++ b/configs/waybar/bottom.config @@ -17,6 +17,7 @@ "modules-center": [], "modules-right": [ "custom/swap", + "custom/zram", "custom/root-free-space", "custom/home-free-space", "cpu", @@ -149,6 +150,12 @@ "interval": 300, "exec": "swapon --show | awk '/nvme/{print $4}'" }, + "custom/zram": { + "tooltip": false, + "format": "Z:{}", + "interval": 300, + "exec": "zramctl | awk '/zram/{print $4\"  \"$6}'" + }, "custom/home-free-space": { "tooltip": false, "format": "/home:{}GB", diff --git a/configs/waybar/restart b/configs/waybar/restart index 1096dbc..11906d9 100755 --- a/configs/waybar/restart +++ b/configs/waybar/restart @@ -2,5 +2,6 @@ source ~/.zshrc killall waybar > /dev/null -waybar --config ~/.config/waybar/top.config --style ~/.config/waybar/top.style.css > /dev/null 2>&1 & -waybar --config ~/.config/waybar/bottom.config --style ~/.config/waybar/bottom.style.css > /dev/null 2>&1 & + +systemd-run --user --scope -G -p MemoryMax=100M -p MemorySwapMax=100M waybar --config ~/.config/waybar/top.config --style ~/.config/waybar/top.style.css > /dev/null 2>&1 & +systemd-run --user --scope -G -p MemoryMax=100M -p MemorySwapMax=100M waybar --config ~/.config/waybar/bottom.config --style ~/.config/waybar/bottom.style.css > /dev/null 2>&1 & diff --git a/configs/waybar/top.config b/configs/waybar/top.config index fbd55f7..d350b49 100644 --- a/configs/waybar/top.config +++ b/configs/waybar/top.config @@ -9,11 +9,10 @@ "modules-left": [ "custom/wlogout", "hyprland/workspaces", - // "custom/jobs", "custom/zapusk" ], "modules-center": [ - "custom/dela", + // "custom/dela", "custom/newsboat", "custom/pacman", "custom/docker", @@ -55,13 +54,13 @@ "interval": 180 }, - "custom/deadbeef": { - "format": "󰝚 {}", - "exec-if": "pgrep -f /usr/bin/deadbeef", - "exec": "deadbeef --nowplaying '%a - %t'", - "on-click": "deadbeef --toggle-pause", - "interval": 3 - }, + //"custom/deadbeef": { + // "format": "󰝚 {}", + // "exec-if": "pgrep -f /usr/bin/deadbeef", + // "exec": "deadbeef --nowplaying '%a - %t'", + // "on-click": "deadbeef --toggle-pause", + // "interval": 3 + //}, "mpris": { "format": "{player_icon} {dynamic}", @@ -75,21 +74,19 @@ "status-icons": { "paused": " " }, - // "ignored-players": ["firefox"] "max-length": 1000, - "interval": 1 + "interval": 5 }, // paru -S waybar-module-pacman-updates-git "custom/pacman": { - "format": "󰣇 {}", + "format": "󰣇 {}", "return-type": "json", "exec-if": "which waybar-module-pacman-updates", "exec": "waybar-module-pacman-updates", }, "custom/docker": { - // "exec": "count=$(docker ps -q | wc -l); [[ $count -gt 0 ]] && echo $count", "exec": "~/.config/waybar/bin/docker.sh", "exec-if": "pgrep docker", "return-type": "json", @@ -100,17 +97,16 @@ "custom/notification": { "tooltip": false, - "format": "{icon} {}", + "format": "{icon} {text}", "format-icons": { - "notification": " ", - "none": " ", - "dnd-notification": " ", - "dnd-none": " ", - - "inhibited-notification": "", - "inhibited-none": "", - "dnd-inhibited-notification": "", - "dnd-inhibited-none": "" + "notification": "", + "none": "", + "dnd-notification": "", + "dnd-none": "", + "inhibited-notification": "", + "inhibited-none": "", + "dnd-inhibited-notification": "", + "dnd-inhibited-none": "" }, "return-type": "json", "exec-if": "which swaync-client", @@ -144,18 +140,11 @@ }, "custom/pipewire": { - "exec": "wpctl inspect @DEFAULT_AUDIO_SINK@ | awk '/alsa.card_name|media.name/ { print }' | cut -d '\"' -f2", + "exec": "wpctl inspect @DEFAULT_AUDIO_SINK@ | awk '/alsa.card_name|media.name|node.description/ { print }' | cut -d '\"' -f2", "tooltip": false, "format": "󰓃 {}", "interval": 5, }, - - "custom/jobs": { - "exec": "~/.bin/job-status", - "tooltip": false, - "format": "{}", - "interval": 1, - }, "custom/zapusk": { "exec": "zapusk waybar", "on-click": "zapusk config_jobs --no-colors | jq -r \".[].id\" | wofi --dmenu | xargs -I{} zapusk run {}", diff --git a/configs/waybar/top_debug.config b/configs/waybar/top_debug.config new file mode 100644 index 0000000..ef32d1f --- /dev/null +++ b/configs/waybar/top_debug.config @@ -0,0 +1,162 @@ +{ + "layer": "top", + "position": "top", + "reload_style_on_change": true , + "output": "!DP-1", + "height": 36, + "spacing": 8, + "margin": "0 6px -10px", + "modules-left": [ + "hyprland/workspaces", + ], + "modules-center": [ + "custom/pacman", + ], + "modules-right": [], + "hyprland/workspaces": { + "format": "{name}", + "format-icons": { + "active": "", + "default": "", + "persistent": "" + }, + "on-scroll-up": "hyprctl dispatch workspace r-1", + "on-scroll-down": "hyprctl dispatch workspace r+1", + "all-outputs": true, + "show-special": true, + }, + + "tray": { + "icon-size": 16, + "spacing": 8 + }, + + "custom/dela": { + "format": " {}", + "exec": "dela list --today --format='$title' '/home/anton/Dev/@A/notes/*.md' | wc -l", + //"on-click": "hyprctl dispatch -- exec kitty", + "on-click": "hyprctl dispatch -- exec kitty --hold --directory ~/Dev/@A/notes zsh -c 'nvim'", + "interval": 300, + "on-click": "" + }, + + "custom/newsboat": { + "format": "󰑬 {}", + "exec-if": "whereis newsboat", + "exec": "~/.config/waybar/bin/newsboat-stats.sh", + "on-click": "kitty --class float --hold zsh -c 'sleep 1; newsboat'", + "interval": 180 + }, + + //"custom/deadbeef": { + // "format": "󰝚 {}", + // "exec-if": "pgrep -f /usr/bin/deadbeef", + // "exec": "deadbeef --nowplaying '%a - %t'", + // "on-click": "deadbeef --toggle-pause", + // "interval": 3 + //}, + + "mpris": { + "format": "{player_icon} {dynamic}", + "format-paused": "{status_icon} {dynamic}", + "dynamic-order": ["position", "length", "artist", "title"], + "player-icons": { + "default": " ", + "deadbeef": "󰝚 ", + "chromium": "󰊯 " + }, + "status-icons": { + "paused": " " + }, + "max-length": 1000, + "interval": 5 + }, + + // paru -S waybar-module-pacman-updates-git + "custom/pacman": { + "format": "󰣇 {}", + "return-type": "json", + //"exec-if": "which waybar-module-pacman-updates", + "exec": "waybar-module-pacman-updates", + }, + + "custom/docker": { + "exec": "~/.config/waybar/bin/docker.sh", + "exec-if": "pgrep docker", + "return-type": "json", + "format": "󰡨 {}", + "interval": 60, + "max-length": 5 + }, + + "custom/notification": { + "tooltip": false, + "format": "{icon} {text}", + "format-icons": { + "notification": "", + "none": "", + "dnd-notification": "", + "dnd-none": "", + "inhibited-notification": "", + "inhibited-none": "", + "dnd-inhibited-notification": "", + "dnd-inhibited-none": "" + }, + "return-type": "json", + "exec-if": "which swaync-client", + "exec": "swaync-client -swb", + "on-click": "swaync-client -t -sw", + "on-click-right": "swaync-client -d -sw", + "escape": true + }, + + "custom/timer": { + "exec": "uairctl fetch '{name}:{time}'", + "tooltip": false, + "format": " {}", + "on-click": "uairctl toggle", + "on-click-right": "uairctl next", + "on-click-middle": "uairctl prev", + "interval": 1, + }, + + "custom/timer-stats": { + "exec": "~/.config/waybar/bin/uair-stats.sh", + "tooltip": false, + "format": "{}", + "interval": 60, + }, + + "custom/wlogout": { + "format": "⏻", + "on-click": "wlogout", + "tooltip": false + }, + + "custom/pipewire": { + "exec": "wpctl inspect @DEFAULT_AUDIO_SINK@ | awk '/alsa.card_name|media.name|node.description/ { print }' | cut -d '\"' -f2", + "tooltip": false, + "format": "󰓃 {}", + "interval": 5, + }, + "custom/zapusk": { + "exec": "zapusk waybar", + "on-click": "zapusk config_jobs --no-colors | jq -r \".[].id\" | wofi --dmenu | xargs -I{} zapusk run {}", + "tooltip": true, + "return-type": "json", + "format": "{}", + "interval": 1, + }, + "bluetooth": { + "format": " {status}", + "format-connected": " {device_alias}", + "format-connected-battery": " {device_alias} {device_battery_percentage}%", + // "format-device-preference": [ "device1", "device2" ], // preference list deciding the displayed device + "tooltip-format": "{controller_alias}\t{controller_address}\n\n{num_connections} connected", + "tooltip-format-connected": "{controller_alias}\t{controller_address}\n\n{num_connections} connected\n\n{device_enumerate}", + "tooltip-format-enumerate-connected": "{device_alias}\t{device_address}", + "tooltip-format-enumerate-connected-battery": "{device_alias}\t{device_address}\t{device_battery_percentage}%" + } +} + +