A bunch of things
Anirudh Oppiliappan x@icyphox.sh
Sun, 23 Jan 2022 17:02:56 +0530
8 files changed,
61 insertions(+),
39 deletions(-)
A
bin/bar
@@ -0,0 +1,11 @@
+#!/bin/sh + +while :; do + vol="$(sndioctl -n output.level)" + bat="$(bat -q)" + time="$(date +"%H:%M")" + date="$(date.sh)" +# printf '%s\t\t\t\t%s\t\t\t\t%s\t\t\t%s' "$bat" "vol $(echo $vol*100 / 1 | bc)" "$date" "$time" + echo "$(date)" + sleep 0.5 +done | ~/code/barito/barito
M
config/nvim/lua/fzy/jump.lua
→
config/nvim/lua/fzy/jump.lua
@@ -42,7 +42,6 @@ -- strip '\n'
local selected, _ = stdout:gsub('\n', '') cmd('bd!') - print(get_line_nr(selected)) -- jump to line cmd(':' .. get_line_nr(selected)) -- housekeeping
A
config/nvim/lua/lsp/c.lua
@@ -0,0 +1,7 @@
+require('lspconfig').ccls.setup { + init_options = { + cache = { + directory = ".ccls-cache"; + }; + } +}
M
home/.cwmrc
→
home/.cwmrc
@@ -25,7 +25,9 @@ bind-key CS-backslash "/home/icy/bin/scr -s"
bind-key C-backslash "/home/icy/bin/scr -f" bind-key 4-n "st -e nvim /home/icy/notes" bind-key 4-l "/home/icy/bin/log" -bind-key 4C-q "xlock -mode space" +bind-key 4C-q "slock zzz" +bind-key C-space "setxkbmap ru" +bind-key CS-space "xmodmap /home/icy/.xmodmap" # keybinds bind-key 4-d menu-exec@@ -53,12 +55,14 @@
# other borderwidth 1 snapdist 10 -ignore icybar +ignore barito gap 0 0 0 0 -autogroup 0 icybar +autogroup 0 barito # colors color menufg "#f4f4f4" color menubg "#676767" color font "#f4f4f4" color selfont "#676767" +color activeborder "#232323" +color inactiveborder "#aaaaaa"
M
home/.tmux.conf
→
home/.tmux.conf
@@ -70,8 +70,11 @@
set -g window-status-current-format "#[fg=colour15] #W" set -g window-status-format "#[fg=colour8] #W" +set -g @resurrect-strategy-nvim 'session' set -g status-left-length 100 set -g status-left "#[fg=colour8]time #[fg=colour15]#(date +"%H:%M") " set -ag status-left "#[fg=colour8]date #[fg=colour15]#(date.sh) " set -ag status-left "#[fg=colour8]bat #[fg=colour15]#(~/bin/bat -q) " set -ag status-left "#[fg=colour8]#(~/bin/np.sh -a) #[fg=colour15]#(~/bin/np.sh -t)" + +run-shell ~/leet/tmux-resurrect/resurrect.tmux
M
prompt/git.go
→
prompt/git.go
@@ -25,31 +25,31 @@ }
} // Returns the current git branch or current ref sha. -func gitBranch(repo *git.Repository) string { +func getGitBranch(repo *git.Repository) { ref, _ := repo.Head() // Quick hack to fix crash when ref is nil; // i.e., new repo with no commits. if ref == nil { - return "no commit" + branchCh <- "no commit" } if ref.IsBranch() { name, _ := ref.Branch().Name() - return name + branchCh <- name } else { - return ref.Target().String()[:8] + branchCh <- ref.Target().String()[:8] } } // Returns • if clean, else ×. -func gitStatus(repo *git.Repository) string { +func getGitStatus(repo *git.Repository) { sl, _ := repo.StatusList(&git.StatusOptions{ Show: git.StatusShowIndexAndWorkdir, Flags: git.StatusOptIncludeUntracked, }) n, _ := sl.EntryCount() if n != 0 { - return "×" + statusCh <- "×" } else { - return "•" + statusCh <- "•" } }
M
prompt/prompt.go
→
prompt/prompt.go
@@ -38,19 +38,38 @@ }
return filepath.Join(truncItems...) } +var branchCh = make(chan string) +var statusCh = make(chan string) + func makePrompt() string { cwd, _ := os.Getwd() home := os.Getenv("HOME") gitDir := getGitDir() + if len(gitDir) > 0 { repo, _ := git.OpenRepository(getGitDir()) - return fmt.Sprintf( - "\n%s (%s %s)\n%s", - trimPath(cwd, home), - gitBranch(repo), - gitStatus(repo), - promptSym, - ) + + go getGitBranch(repo) + go getGitStatus(repo) + + select { + case status := <-statusCh: + return fmt.Sprintf( + "\n%s (%s %s)\n%s", + trimPath(cwd, home), + <-branchCh, + status, + promptSym, + ) + default: + return fmt.Sprintf( + "\n%s (%s %s)\n%s", + trimPath(cwd, home), + <-branchCh, + <-statusCh, + promptSym, + ) + } } return fmt.Sprintf( "\n%s\n%s",
M
weechat/weechat.conf
→
weechat/weechat.conf
@@ -400,27 +400,6 @@ title.type = window
[layout] default.buffer = "core;weechat;1" -default.buffer = "irc;server.libera;2" -default.buffer = "irc;libera.##crustaceans;3" -default.buffer = "irc;libera.#go-nuts;4" -default.buffer = "irc;libera.#kisslinux;5" -default.buffer = "irc;libera.#kubernetes;6" -default.buffer = "irc;libera.#libera;7" -default.buffer = "irc;libera.#linux;8" -default.buffer = "irc;libera.#lobsters;9" -default.buffer = "irc;libera.#neovim;10" -default.buffer = "irc;libera.#nixers;11" -default.buffer = "irc;libera.#openbsd;12" -default.buffer = "irc;libera.#opsec;13" -default.buffer = "irc;libera.#plan9;14" -default.buffer = "irc;libera.#python;15" -default.buffer = "irc;libera.#security;16" -default.buffer = "irc;server.rizon;17" -default.buffer = "irc;rizon.#buddy;18" -default.buffer = "irc;rizon.#homescreen;19" -default.buffer = "irc;rizon.#rice;20" -default.buffer = "irc;rizon.#taigobot-test;21" -default.buffer = "irc;rizon.#vizon;22" default.window = "1;0;0;0;irc;rizon.Carp" default.current = on