Skip to content

Commit f36ed22

Browse files
committed
✨ (config/waybar) Update waybar config
1 parent ad91f8e commit f36ed22

File tree

10 files changed

+360
-227
lines changed

10 files changed

+360
-227
lines changed

config/nvim/lua/configs/kastel.lua

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
11
vim.api.nvim_create_autocmd("FileType", {
2-
pattern = "gleam",
3-
callback = function()
4-
vim.b.symbol_list = { "->", "|>", "<>", "<-", "_ ->" }
5-
end,
2+
pattern = "gleam",
3+
callback = function()
4+
vim.b.symbol_list = { "->", "|>", "<>", "<-", "_ ->" }
5+
end,
66
})
77

88
function _G.symbol_cmp()
9-
local triggers = vim.fn.split('hjklnmfdsavcuiorew',[[\zs]])
9+
local triggers = vim.fn.split("hjklnmfdsavcuiorew", [[\zs]])
1010

11-
local comp_list = vim.fn.map(vim.fn.copy(vim.b.symbol_list), function (i, v)
12-
return { word = v, menu = vim.fn.get(triggers, i, '') }
11+
local comp_list = vim.fn.map(vim.fn.copy(vim.b.symbol_list), function(i, v)
12+
return { word = v, menu = vim.fn.get(triggers, i, "") }
1313
end)
1414

1515
-- vim.on_key(symbol_select)
1616

17-
vim.fn.complete(vim.fn.col('.')-1, comp_list)
17+
vim.fn.complete(vim.fn.col(".") - 1, comp_list)
1818
end
1919

2020
function _G.symbol_select(key, typed)
21-
local items = vim.fn.complete_info({"items"}).items
22-
local idx = vim.fn.indexof(items, function (_, v)
23-
return vim.fn.get(v, 'menu', '') == key
21+
local items = vim.fn.complete_info({ "items" }).items
22+
local idx = vim.fn.indexof(items, function(_, v)
23+
return vim.fn.get(v, "menu", "") == key
2424
end)
2525

26-
if (idx >= 0) then
26+
if idx >= 0 then
2727
vim.print(idx)
2828
-- vim.fn.feedkeys("i<BS>" .. items[idx].word,"i")
2929

@@ -32,11 +32,8 @@ function _G.symbol_select(key, typed)
3232
-- vim.print(items[idx].word)
3333
return ""
3434
end
35-
3635
end
3736

38-
vim.keymap.set("i", ",", function ()
39-
return vim.fn.exists('b:symbol_list')
40-
and ',<cmd>lua symbol_cmp()<cr>'
41-
or ','
37+
vim.keymap.set("i", ",", function()
38+
return vim.fn.exists("b:symbol_list") and ",<cmd>lua symbol_cmp()<cr>" or ","
4239
end, { expr = true, noremap = true })

config/nvim/lua/configs/keymap.lua

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ keymap("i", "jj", "<ESC>", opts)
1717

1818
keymap("i", "<C-g>", "<C-[><C-[>")
1919

20-
keymap("n", "q", "<C-[><C-[>")
20+
-- keymap("n", "q", "<C-[><C-[>")
2121

2222
-- keymap("n", "<S-k>", "{", opts)
2323
-- keymap("n", "<S-j>", "}", opts)
@@ -90,10 +90,10 @@ vim.fn.filter(vim.fn.getwininfo(), function(key, val)
9090
end)
9191
vim.print()
9292

93-
keymap("n", "q", function()
94-
if vim.fn.empty(vim.fn.filter(vim.fn.getwininfo(), "v:val.quickfix")) then
95-
vim.cmd("copen")
96-
else
97-
vim.cmd("cclose")
98-
end
99-
end)
93+
-- keymap("n", "q", function()
94+
-- if vim.fn.empty(vim.fn.filter(vim.fn.getwininfo(), "v:val.quickfix")) then
95+
-- vim.cmd("copen")
96+
-- else
97+
-- vim.cmd("cclose")
98+
-- end
99+
-- end)

config/sway/config

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ font pango:monospace 8
4646
# https://wiki.archlinux.org/index.php/XDG_Autostart
4747
# exec --no-startup-id dex --autostart --environment i3
4848

49-
bar {
50-
status_command waybar
51-
}
49+
# bar {
50+
# status_command
51+
# }
5252

5353
# The combination of xss-lock, nm-applet and pactl is a popular choice, so
5454
# they are included here as an example. Modify as you see fit.
@@ -60,6 +60,7 @@ exec --no-startup-id xss-lock --transfer-sleep-lock -- i3lock --nofork
6060
# NetworkManager is the most popular way to manage wireless networks on Linux,
6161
# and nm-applet is a desktop environment-independent system tray GUI for it.
6262
exec --no-startup-id nm-applet
63+
exec waybar
6364

6465
# Use pactl to adjust volume in PulseAudio.
6566
set $refresh_i3status killall -SIGUSR1 i3status

config/vim/.netrwhist

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
let g:netrw_dirhistmax =10
2-
let g:netrw_dirhistcnt =1
2+
let g:netrw_dirhistcnt =2
3+
let g:netrw_dirhist_2='/home/coma/.ghq/github.com/Comamoca/dotfiles/config/vim'
34
let g:netrw_dirhist_1='/home/coma/.ghq/github.com/Comamoca/dotfiles/vim'

config/waybar/config

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"cpu",
77
"memory",
88
"tray",
9-
"hyprland/workspaces"
9+
"sway/workspaces"
1010
],
1111
"modules-center": ["custom/media"],
1212
"modules-right": [
@@ -28,6 +28,11 @@
2828
"default": ["", "", ""]
2929
}
3030
},
31+
"sway/workspaces": {
32+
"format": "{icon}",
33+
"on-scroll-up": "hyprctl dispatch workspace e+1",
34+
"on-scroll-down": "hyprctl dispatch workspace e-1"
35+
},
3136
"hyprland/workspaces": {
3237
"format": "{icon}",
3338
"on-scroll-up": "hyprctl dispatch workspace e+1",

config/waybar/style.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@
2626
margin-right: 2px;
2727
}
2828

29+
#workspaces button.focused {
30+
border-radius: 10px;
31+
color: @mantle;
32+
background: @lavender;
33+
}
34+
2935
#workspaces button.active {
3036
border-radius: 10px;
3137
color: @mantle;

configuration.nix

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -284,8 +284,11 @@ in
284284
};
285285

286286
# services.flatpak.enable = true;
287-
# xdg.portal.enable = pkgs.lib.mkDefault true;
288-
xdg.portal.wlr.enable = true;
287+
xdg.portal = {
288+
xdgOpenUsePortal = true;
289+
enable = pkgs.lib.mkDefault true;
290+
wlr.enable = true;
291+
};
289292

290293
# List packages installed in system profile. To search, run:
291294
# $ nix search wget

emacs.d/init.el

Lines changed: 83 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -70,13 +70,16 @@
7070

7171
;; Emacs evil-mode
7272
(leaf evil
73-
:defer-config
73+
:config
7474
;; (define-key evil-insert-state-map "jk" #'evil-normal-state)
7575
;; (define-key evil-normal-state-map (kbd "S-j") nil)
7676
;; (define-key evil-normal-state-map (kbd "S-j") #'evil-scroll-down)
77+
(define-key global-map (kbd "C-<return>") #'vterm-toggle-show)
78+
(define-key vterm-mode-map (kbd "C-<return>") #'vterm-toggle-hide)
7779

7880
(define-key evil-normal-state-map (kbd "C-k") #'evil-scroll-up)
7981
(define-key evil-normal-state-map (kbd "C-j") #'evil-scroll-down)
82+
(define-key evil-insert-state-map (kbd "C-j") #'newline-and-indent)
8083

8184
(define-key evil-normal-state-map (kbd "M-g") #'projectile-switch-project)
8285
(define-key evil-normal-state-map (kbd "C-o") #'projectile-find-file)
@@ -117,6 +120,8 @@
117120
(global-treesit-auto-mode))
118121

119122
(leaf treesit
123+
:config
124+
(setq treesit-extra-load-path `(,(expand-file-name "~/.cache/dpp/_generated/nvim-treesitter/parser")))
120125
:init
121126
(add-to-list 'auto-mode-alist '("\\.cshtml\\'" . web-mode))
122127
(add-to-list 'auto-mode-alist '("\\.cs\\'" . csharp-ts-mode))
@@ -248,8 +253,7 @@
248253
;; org-modern
249254
(leaf org-modern
250255
:init
251-
;; (with-eval-after-load 'org (global-org-modern-mode))
252-
)
256+
(with-eval-after-load 'org (global-org-modern-mode)))
253257

254258
(leaf org-modern-indent)
255259

@@ -331,20 +335,32 @@
331335

332336

333337
;; LSP
334-
;; (leaf lsp-bridge :require t
335-
;; :config
336-
;; (setq acm-enable-capf t)
337-
;; :init
338-
;; (global-lsp-bridge-mode))
338+
(leaf lsp-bridge :require t
339+
:config
340+
(setq acm-enable-capf t)
341+
:init
342+
(global-lsp-bridge-mode))
339343

340344

341-
(leaf lsp-mode :require t
345+
(leaf lsp-mode
346+
:require t
342347
:config
348+
(setenv "LSP_USE_PLISTS" "true")
349+
(setq lsp-completion-provider :none)
350+
343351
(define-key evil-normal-state-map (kbd "K") 'lsp-ui-doc-glance)
344-
:hook
345-
(add-hook 'prog-mode-hook #'lsp-deferred)
346-
;; (add-hook 'prog-mode-hook #'lsp-deferred)
347-
)
352+
353+
(add-to-list 'lsp-language-id-configuration
354+
'(nix-mode . "nil")
355+
'(python-mode . "python"))
356+
357+
(defun corfu-lsp-setup ()
358+
(setq completion-at-point-functions '(lsp-completion-at-point))
359+
(setq-local completion-styles '(orderless)
360+
completion-category-defaults nil))
361+
362+
(add-hook 'lsp-mode-hook #'corfu-lsp-setup)
363+
(add-hook 'prog-mode-hook #'lsp-deferred))
348364

349365
;; Eglot
350366
;; (defun node-project-p ()
@@ -416,12 +432,25 @@
416432

417433
(advice-add 'lsp-resolve-final-command :around #'lsp-booster--advice-final-command)
418434

435+
;; Auto Formatting
436+
(leaf reformatter
437+
:config
438+
(reformatter-define dprint
439+
:program "dprint" :args `("fmt" "--stdin" ,buffer-file-name))
440+
(reformatter-define deno
441+
:program "deno" :args `("fmt" ,buffer-file-name))
442+
(reformatter-define black
443+
:program "black" :args '("-"))
444+
(reformatter-define nixfmt
445+
:program "nixfmt-rfcstyle" :args '("-")))
446+
419447
;; Lua support
420448
(leaf lua-mode)
421449

422450
;; Completion
423451
(leaf corfu
424452
:config
453+
(setq corfu-cycle t)
425454
(setq corfu-auto t)
426455
(setq corfu-auto-prefix 1)
427456
:init
@@ -747,19 +776,10 @@
747776
:stream t
748777
:models '(starcoder2))))
749778

750-
(leaf dash)
751-
752779
(leaf editorconfig
753780
:config
754781
(editorconfig-mode 1))
755782

756-
(leaf reformatter
757-
:config
758-
(reformatter-define dprint
759-
:program "dprint" :args `("fmt" "--stdin" ,buffer-file-name))
760-
(reformatter-define deno
761-
:program "deno" :args `("fmt" ,buffer-file-name)))
762-
763783
(leaf ledger
764784
:config)
765785

@@ -790,6 +810,42 @@
790810

791811
(leaf iscroll)
792812

813+
(leaf folding-mode
814+
:require t)
815+
816+
(leaf rg
817+
:require t)
818+
819+
(leaf open-junk-file :require t)
820+
821+
(leaf fold-this)
822+
823+
(leaf alert
824+
:config
825+
(setq alert-default-style 'libnotify))
826+
827+
(leaf dashboard
828+
:config
829+
(setq dashboard-startup-banner (expand-file-name "~/Pictures/.emacs-logos/gnu_color_resize.png"))
830+
(setq dashboard-startup-banner 'logo))
831+
832+
(leaf aas
833+
:config
834+
(aas-set-snippets 'text-mode
835+
"" "「」"
836+
"" "『』"
837+
"`" "``")
838+
(aas-set-snippets 'prog-mode
839+
"`" "``"))
840+
841+
(leaf vterm)
842+
843+
(leaf vterm-toggle)
844+
845+
(leaf multi-vterm
846+
:config
847+
(setq multi-vterm-dedicated-window-height 50))
848+
793849

794850
;; ================ My extentions ================
795851

@@ -1014,16 +1070,6 @@
10141070

10151071
(find-file (org-roam-node-file select-node))))
10161072

1017-
;; Search
1018-
(leaf rg
1019-
:require t)
1020-
1021-
(leaf open-junk-file
1022-
:bind (("C-x j" . open-junk-file))
1023-
:config
1024-
(setq open-junk-file-format "/tmp/junk/%Y_%m_%d_%H%M%S."))
1025-
1026-
10271073
;; nano-tools
10281074
;; (leaf nano-theme)
10291075
;; (leaf nano-popup)
@@ -1070,6 +1116,11 @@
10701116

10711117
(setq create-lockfiles nil)
10721118

1119+
;; For lsp-mode
1120+
(setq gc-cons-threshold 100000000)
1121+
(setq read-process-output-max (* 1024 1024))
1122+
1123+
10731124
;; Key mapping
10741125
(define-key global-map (kbd "C-x s") 'blackening-region)
10751126
(define-key global-map (kbd "C-;") 'comment-dwim)

0 commit comments

Comments
 (0)