From 6e8bb638eeb8120df6fa07de04de2a4ede6d19ff Mon Sep 17 00:00:00 2001 From: mitchell Date: Thu, 4 Jul 2024 18:25:22 -0400 Subject: [PATCH] Add rofi, update fish cfg/scripts, update nvim cfg, update wezterm cfg --- .config/bspwm/bspwmrc | 7 ++-- .config/fish/config.fish | 1 + .../functions/define_global_variables.fish | 9 ++--- .../functions/fish_user_key_bindings.fish | 6 ++-- .config/fish/functions/glance.fish | 8 ----- .config/fish/functions/jmpv.fish | 5 +++ .config/fish/functions/m.fish | 8 +++++ .config/fish/functions/n.fish | 36 ------------------- .config/fish/functions/ytmpv.fish | 9 +++++ .config/nvim/config.vim | 3 ++ .config/nvim/init.lua | 14 +++++++- .config/picom/picom.conf | 2 -- .config/rofi/config.rasi | 19 ++++++++++ .config/sxhkd/sxhkdrc | 11 +----- .wezterm.lua | 2 +- fish_universal_vars.fish | 10 +++--- scripts/glance | 2 -- scripts/jmpv | 2 +- scripts/streamlink-twitch-gui | 6 ++++ scripts/vban | 2 +- scripts/wezterm | 8 +++++ scripts/wezterm-gui | 8 +++++ scripts/ytmpv | 2 +- sync | 1 + 24 files changed, 104 insertions(+), 77 deletions(-) delete mode 100644 .config/fish/functions/glance.fish create mode 100644 .config/fish/functions/m.fish delete mode 100644 .config/fish/functions/n.fish create mode 100644 .config/rofi/config.rasi delete mode 100755 scripts/glance create mode 100755 scripts/streamlink-twitch-gui create mode 100755 scripts/wezterm create mode 100755 scripts/wezterm-gui diff --git a/.config/bspwm/bspwmrc b/.config/bspwm/bspwmrc index 5c0d244..5e609fc 100755 --- a/.config/bspwm/bspwmrc +++ b/.config/bspwm/bspwmrc @@ -16,19 +16,20 @@ end sxhkd & if test $DISPLAY = ":0" - picom -b --blur-background + picom -b else picom -b --backend xrender end #wmname LG3D -~/.fehbg & - if test $DISPLAY = ":0" killall -q polybar pasystray barrier barrierc barrier & keepassxc & + feh --no-fehbg --bg-scale '/home/m/sync/capitol_city.jpg' +else + feh --no-fehbg --bg-scale '/home/m/sync/maelstrom.jpg' end polybar m-bar & diff --git a/.config/fish/config.fish b/.config/fish/config.fish index 22fd72f..91582eb 100644 --- a/.config/fish/config.fish +++ b/.config/fish/config.fish @@ -13,6 +13,7 @@ function configure_fish ssh_agent_startup starship init fish | source zoxide init fish | source + fzf --fish | source end configure_fish diff --git a/.config/fish/functions/define_global_variables.fish b/.config/fish/functions/define_global_variables.fish index ab164de..da0950a 100644 --- a/.config/fish/functions/define_global_variables.fish +++ b/.config/fish/functions/define_global_variables.fish @@ -8,20 +8,21 @@ function define_global_variables -d 'Defines all and exclusively globally export set -gx BROWSER firefox set -gx DIFFPROG nvim -d - set -gx FZF_CTRL_T_COMMAND 'ag --hidden --ignore .git -g ""' - set -gx FZF_DEFAULT_COMMAND 'ag --hidden --ignore .git -g ""' + set -gx FZF_CTRL_T_COMMAND 'fd --type f --type d --hidden --exclude ".git/"' + set -gx FZF_DEFAULT_COMMAND 'fd --type f --type d --hidden --exclude ".git/"' + set -gx FZF_ALT_C_COMMAND 'fd --type d --hidden --exclude ".git/"' set -gx GOPATH $HOME/code/go set -gx GOBIN $GOPATH/bin + set -gx GTK_THEME Kanagawa-BL + set -gx BUN_INSTALL $HOME/.bun set -gx LIBVIRT_DEFAULT_URI 'qemu:///system' set -gx ANDROID_HOME $HOME/Android/Sdk - set -gx LIBVA_DRIVER_NAME nvidia - fish_add_path $GOBIN \ $HOME/.local/bin \ $HOME/.pub-cache/bin \ diff --git a/.config/fish/functions/fish_user_key_bindings.fish b/.config/fish/functions/fish_user_key_bindings.fish index de9df86..659faf4 100644 --- a/.config/fish/functions/fish_user_key_bindings.fish +++ b/.config/fish/functions/fish_user_key_bindings.fish @@ -1,10 +1,12 @@ function fish_user_key_bindings bind --mode insert jj "if commandline -P; commandline -f cancel; else; set fish_bind_mode default; commandline -f backward-char repaint-mode; end" bind --mode insert ,a 'ssh_add; commandline -f repaint' - bind --mode insert ,j 'joplin; commandline -f repaint' bind --mode insert ,p 'nvim +"Telescope git_files"; commandline -f repaint' bind --mode insert ,f 'nvim +"Telescope find_files"; commandline -f repaint' bind --mode insert ,n 'nvim +Neotree; commandline -f repaint' - bind --mode insert ,v 'neovide; commandline -f repaint' bind --mode insert ,s 'sysz; commandline -f repaint' + bind --mode insert ,z 'zi; commandline -f repaint' + bind --mode insert ,t 'fzf-file-widget' + bind --mode insert ,r 'fzf-history-widget' + bind --mode insert ,c 'fzf-cd-widget' end diff --git a/.config/fish/functions/glance.fish b/.config/fish/functions/glance.fish deleted file mode 100644 index 3b0923f..0000000 --- a/.config/fish/functions/glance.fish +++ /dev/null @@ -1,8 +0,0 @@ -function glance -d 'Open glances on a preset of machines' - tmux new -s glance mosh arch@khetanna.lan -- glances --disable-process --sparkline\; \ - neww mosh arch@kamino.lan -- glances --disable-process --sparkline\; \ - neww mosh arch@marauder.lan -- glances --disable-process --sparkline\; \ - neww mosh serenity.lan -- glances --sparkline\; \ - neww mosh venator.lan -- glances --sparkline - or tmux attach-session -t glance -end diff --git a/.config/fish/functions/jmpv.fish b/.config/fish/functions/jmpv.fish index 6598696..8c597a5 100644 --- a/.config/fish/functions/jmpv.fish +++ b/.config/fish/functions/jmpv.fish @@ -1,4 +1,9 @@ function jmpv -d 'Open jellyfin-mpv-shim in a tmux session of its own' + if command --query prime-run + set --function --export __NV_PRIME_RENDER_OFFLOAD 1 + set --function --export __GLX_VENDOR_LIBRARY_NAME nvidia + end + tmux new-session -s jmpv jellyfin-mpv-shim or tmux attach-session -t jmpv end diff --git a/.config/fish/functions/m.fish b/.config/fish/functions/m.fish new file mode 100644 index 0000000..1d10001 --- /dev/null +++ b/.config/fish/functions/m.fish @@ -0,0 +1,8 @@ +function m --wraps yazi + set tmp (mktemp -t "yazi-cwd.XXXXXX") + yazi $argv --cwd-file="$tmp" + if set cwd (cat -- "$tmp"); and [ -n "$cwd" ]; and [ "$cwd" != "$PWD" ] + cd -- "$cwd" + end + rm -f -- "$tmp" +end diff --git a/.config/fish/functions/n.fish b/.config/fish/functions/n.fish deleted file mode 100644 index a8c3dc4..0000000 --- a/.config/fish/functions/n.fish +++ /dev/null @@ -1,36 +0,0 @@ -# Rename this file to match the name of the function -# e.g. ~/.config/fish/functions/n.fish -# or, add the lines to the 'config.fish' file. - -function n --wraps nnn --description 'support nnn quit and change directory' - # Block nesting of nnn in subshells - if test -n "$NNNLVL" -a "$NNNLVL" -ge 1 - echo "nnn is already running" - return - end - - # The behaviour is set to cd on quit (nnn checks if NNN_TMPFILE is set) - # If NNN_TMPFILE is set to a custom path, it must be exported for nnn to - # see. To cd on quit only on ^G, remove the "-x" from both lines below, - # without changing the paths. - if test -n "$XDG_CONFIG_HOME" - set -x NNN_TMPFILE "$XDG_CONFIG_HOME/nnn/.lastd" - else - set -x NNN_TMPFILE "$HOME/.config/nnn/.lastd" - end - - # Unmask ^Q (, ^V etc.) (if required, see `stty -a`) to Quit nnn - # stty start undef - # stty stop undef - # stty lwrap undef - # stty lnext undef - - # The command function allows one to alias this function to `nnn` without - # making an infinitely recursive alias - command nnn $argv - - if test -e $NNN_TMPFILE - source $NNN_TMPFILE - rm $NNN_TMPFILE - end -end diff --git a/.config/fish/functions/ytmpv.fish b/.config/fish/functions/ytmpv.fish index c7c7ecb..29e7d4f 100644 --- a/.config/fish/functions/ytmpv.fish +++ b/.config/fish/functions/ytmpv.fish @@ -1,6 +1,12 @@ function ytmpv -d 'A script to help queue youtube videos on MPV' set -l queue ~/.ytmpv_queue + if command --query prime-run + set --function --export __NV_PRIME_RENDER_OFFLOAD 1 + set --function --export __GLX_VENDOR_LIBRARY_NAME nvidia + end + + if not test -f $queue touch $queue end @@ -54,6 +60,9 @@ function ytmpv -d 'A script to help queue youtube videos on MPV' (cat $queue) \ best break + case dwl destroy-watch-later + rm -r ~/.local/state/mpv/watch_later/ + break case '*' if test -z "$video" tmux attach -t ytmpv diff --git a/.config/nvim/config.vim b/.config/nvim/config.vim index a5b3be6..07db54a 100644 --- a/.config/nvim/config.vim +++ b/.config/nvim/config.vim @@ -19,6 +19,7 @@ set shortmess+=c set foldmethod=expr set foldexpr=nvim_treesitter#foldexpr() set nofoldenable " Disable folding at startup. +set termguicolors inoremap jj @@ -39,6 +40,8 @@ nnoremap o SymbolsOutline nnoremap z ZenMode nnoremap l Twilight nnoremap c COQnow +nnoremap j BufferLinePick +nnoremap J BufferLinePickClose tnoremap diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index b0cc5b2..e0817cc 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -25,6 +25,7 @@ plug("folke/zen-mode.nvim") plug("folke/twilight.nvim") plug("neovim/nvim-lspconfig") plug("rebelot/kanagawa.nvim") +plug("akinsho/bufferline.nvim") plug("nvim-lualine/lualine.nvim") plug("nvim-neo-tree/neo-tree.nvim") plug("pmizio/typescript-tools.nvim") @@ -44,7 +45,18 @@ require("kanagawa").setup({ transparent = true, }) -require("lualine").setup() +require("bufferline").setup({ + options = { + separator_style = "slant", + }, +}) + +require("lualine").setup({ + extensions = { + "neo-tree", + "symbols-outline", + }, +}) require("zen-mode").setup({ window = { diff --git a/.config/picom/picom.conf b/.config/picom/picom.conf index 7130b3a..c546214 100644 --- a/.config/picom/picom.conf +++ b/.config/picom/picom.conf @@ -7,8 +7,6 @@ shadow-radius = 12 fading = true fade-delta = 5 -blur-kern = "11x11gaussian" - vsync = true wintypes: diff --git a/.config/rofi/config.rasi b/.config/rofi/config.rasi new file mode 100644 index 0000000..84f5c33 --- /dev/null +++ b/.config/rofi/config.rasi @@ -0,0 +1,19 @@ +configuration{ + combi-modi: "window,drun,run"; + modi: "combi"; + font: "JetBrainsMono Nerd Font 9"; + icon-theme: "Adwaita"; + show-icons: true; + terminal: "wezterm"; + location: 2; + yoffset: 100; + disable-history: false; + hide-scrollbar: true; + display-combi: " Open"; + display-run: "  "; + display-drun: "  "; + display-window: " 󰕰 "; + sidebar-mode: false; +} + +@theme "DarkBlue" diff --git a/.config/sxhkd/sxhkdrc b/.config/sxhkd/sxhkdrc index 80c12dc..907aceb 100644 --- a/.config/sxhkd/sxhkdrc +++ b/.config/sxhkd/sxhkdrc @@ -15,16 +15,7 @@ super + shift + ctrl + Return # program launcher super + @space - rofi -width 30 \ - -lines 10 \ - -font 'JetBrains Mono 10' \ - -location 2 \ - -yoffset 100 \ - -terminal kitty \ - -theme gruvbox-light \ - -combi-modi window,drun,run \ - -show combi \ - -modi combi + rofi -show combi # make sxhkd reload its configuration files: super + Escape diff --git a/.wezterm.lua b/.wezterm.lua index c562e31..e39826b 100644 --- a/.wezterm.lua +++ b/.wezterm.lua @@ -26,7 +26,7 @@ config.colors = { indexed = { [16] = "#ffa066", [17] = "#ff5d62" }, } -config.window_background_opacity = is_darwin() and 0.8 or 0.5 +config.window_background_opacity = is_darwin() and 0.7 or 0.65 config.window_decorations = "RESIZE" config.font_size = is_darwin() and 13 or 11 diff --git a/fish_universal_vars.fish b/fish_universal_vars.fish index e2182b2..c9d027a 100644 --- a/fish_universal_vars.fish +++ b/fish_universal_vars.fish @@ -11,23 +11,23 @@ set -l pink D27E99 brmagenta # Syntax Highlighting Colors set -U fish_color_normal $foreground -set -U fish_color_command $cyan +set -U fish_color_command $purple set -U fish_color_keyword $pink set -U fish_color_quote $yellow -set -U fish_color_redirection $foreground +set -U fish_color_redirection $green set -U fish_color_end $orange set -U fish_color_error $red -set -U fish_color_param $purple +set -U fish_color_param $foreground set -U fish_color_comment $comment set -U fish_color_selection --background=$selection set -U fish_color_search_match --background=$selection -set -U fish_color_operator $green +set -U fish_color_operator $cyan set -U fish_color_escape $pink set -U fish_color_autosuggestion $comment # Completion Pager Colors set -U fish_pager_color_progress $comment -set -U fish_pager_color_prefix $cyan +set -U fish_pager_color_prefix $purple set -U fish_pager_color_completion $foreground set -U fish_pager_color_description $comment diff --git a/scripts/glance b/scripts/glance deleted file mode 100755 index 6b5aae2..0000000 --- a/scripts/glance +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -wezterm start -- fish -c glance diff --git a/scripts/jmpv b/scripts/jmpv index 3fa29d8..ae490ed 100755 --- a/scripts/jmpv +++ b/scripts/jmpv @@ -1,2 +1,2 @@ -#!/usr/bin/sh +#!/usr/bin/env bash wezterm start -- fish -c jmpv diff --git a/scripts/streamlink-twitch-gui b/scripts/streamlink-twitch-gui new file mode 100755 index 0000000..c4ce93d --- /dev/null +++ b/scripts/streamlink-twitch-gui @@ -0,0 +1,6 @@ +#!/usr/bin/env fish +if command -q prime-run + prime-run /usr/bin/streamlink-twitch-gui +else + /usr/bin/streamlink-twitch-gui +end diff --git a/scripts/vban b/scripts/vban index 4816991..58a27de 100755 --- a/scripts/vban +++ b/scripts/vban @@ -1,2 +1,2 @@ -#!/usr/bin/sh +#!/usr/bin/env bash wezterm start -- fish -c vban diff --git a/scripts/wezterm b/scripts/wezterm new file mode 100755 index 0000000..269349e --- /dev/null +++ b/scripts/wezterm @@ -0,0 +1,8 @@ +#!/usr/bin/env fish +if command -q prime-run + set -lx __NV_PRIME_RENDER_OFFLOAD 1 + set -lx __VK_LAYER_NV_optimus NVIDIA_only + /usr/bin/wezterm $argv +else + /usr/bin/wezterm $argv +end diff --git a/scripts/wezterm-gui b/scripts/wezterm-gui new file mode 100755 index 0000000..a830072 --- /dev/null +++ b/scripts/wezterm-gui @@ -0,0 +1,8 @@ +#!/usr/bin/env fish +if command -q prime-run + set -lx __NV_PRIME_RENDER_OFFLOAD 1 + set -lx __VK_LAYER_NV_optimus NVIDIA_only + /usr/bin/wezterm-gui $argv +else + /usr/bin/wezterm-gui $argv +end diff --git a/scripts/ytmpv b/scripts/ytmpv index d90ef84..951eb45 100755 --- a/scripts/ytmpv +++ b/scripts/ytmpv @@ -1,2 +1,2 @@ -#!/usr/bin/sh +#!/usr/bin/env bash wezterm start -- fish -c ytmpv diff --git a/sync b/sync index 288b57d..584aa05 100755 --- a/sync +++ b/sync @@ -80,6 +80,7 @@ function sync_desktop_env -a uname and rsync -aP ./.config/sxhkd ~/.config/ and rsync -aP ./.config/picom ~/.config/ and rsync -aP ./.config/polybar ~/.config/ + and rsync -aP ./.config/rofi ~/.config/ end end