aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.config/BetterDiscord/data/stable/settings.json18
-rw-r--r--.config/BetterDiscord/data/stable/themes.json4
-rw-r--r--.config/BetterDiscord/themes/HorizontalServerList.theme.css20
-rw-r--r--.config/X11/base13
-rw-r--r--.config/X11/base##template20
-rw-r--r--.config/clangd/config.yaml9
-rw-r--r--.config/coc/extensions/package.json12
-rw-r--r--.config/fcitx5/conf/imselector.conf11
-rw-r--r--.config/fontconfig/conf.d/10-inter-features.conf14
-rw-r--r--.config/fontconfig/conf.d/10-sub-pixel-rgb.conf8
l---------[-rw-r--r--].config/fzmp/conf4
-rw-r--r--.config/git/config##template2
-rwxr-xr-x.config/i3/autostart##template2
-rw-r--r--.config/i3/config##template4
-rw-r--r--.config/kitty/kitty.conf14
-rw-r--r--.config/latexmk/latexmkrc5
-rw-r--r--.config/lf/lfrc12
-rw-r--r--.config/mpcplus/fzmp.conf3
-rw-r--r--.config/mpd/mpd.conf##default (renamed from .config/mpd/mpd.conf##hostname.thoncc)0
-rw-r--r--.config/neomutt/neomuttrc8
-rw-r--r--.config/nvim/init.vim72
-rw-r--r--.config/picom.conf16
-rw-r--r--.config/polybar/config.ini##template11
-rw-r--r--.config/rofi/config.rasi##template15
-rw-r--r--.config/xbindkeys/main (renamed from .config/xbindkeys/main##template)20
-rw-r--r--.config/zathura/zathurarc (renamed from .config/zathura/zathurarc##template)5
-rw-r--r--.local/share/applications/discord.desktop1
-rw-r--r--.local/share/applications/mozc-dictionary.desktop11
-rw-r--r--.local/share/applications/mozc-settings.desktop11
-rwxr-xr-x.local/share/bin/=18
-rwxr-xr-x.local/share/bin/brightness29
-rwxr-xr-x.local/share/bin/ccpreview46
-rwxr-xr-x.local/share/bin/hide4
-rwxr-xr-x.local/share/bin/lrc2labels11
-rwxr-xr-x.local/share/bin/mk7
-rwxr-xr-x.local/share/bin/nginx-dev86
-rwxr-xr-x.local/share/bin/now2
-rwxr-xr-x.local/share/bin/preview33
-rwxr-xr-x.local/share/bin/rofi2
-rwxr-xr-x.local/share/bin/screenrecord7
-rwxr-xr-x.local/share/bin/set-default32
-rwxr-xr-x.local/share/mode/mode34
-rw-r--r--.local/share/mode/plug.d/10_lib41
-rw-r--r--.local/share/mode/plug.d/20_export_colors2
-rw-r--r--.local/share/mode/plug.d/20_export_mode2
-rw-r--r--.local/share/mode/plug.d/20_export_vim_theme2
-rw-r--r--.local/share/mode/plug.d/50_accent17
-rwxr-xr-x.local/share/mode/reload.d/dunst3
-rw-r--r--.local/share/mode/reload.d/gtk8
-rwxr-xr-x.local/share/mode/reload.d/nvim1
-rwxr-xr-x.local/share/mode/reload.d/polybar2
-rwxr-xr-x.local/share/mode/reload.d/term2
-rwxr-xr-x.local/share/mode/switch.d/chromium9
-rwxr-xr-x.local/share/mode/switch.d/discord3
-rwxr-xr-x.local/share/mode/switch.d/dunst3
-rwxr-xr-x.local/share/mode/switch.d/fcitx52
-rwxr-xr-x.local/share/mode/switch.d/kitty25
-rwxr-xr-x.local/share/mode/switch.d/mode10
-rwxr-xr-x.local/share/mode/switch.d/polybar3
-rwxr-xr-x.local/share/mode/switch.d/rofi8
-rwxr-xr-x.local/share/mode/switch.d/vim11
-rwxr-xr-x.local/share/mode/switch.d/zathura3
-rw-r--r--.local/share/mode/themes/github-black25
-rw-r--r--.local/share/mode/themes/xcode-dark24
-rwxr-xr-x.local/share/pass-extensions/duplicates.bash13
-rwxr-xr-x.local/share/pass-extensions/g.bash2
-rw-r--r--.profile10
-rw-r--r--.zshrc14
68 files changed, 659 insertions, 242 deletions
diff --git a/.config/BetterDiscord/data/stable/settings.json b/.config/BetterDiscord/data/stable/settings.json
index 42a2be1..eb9ab27 100644
--- a/.config/BetterDiscord/data/stable/settings.json
+++ b/.config/BetterDiscord/data/stable/settings.json
@@ -3,11 +3,19 @@
"voiceDisconnect": false,
"showToasts": true,
"mediaKeys": false,
- "bdContextMenu": true
+ "bdContextMenu": true,
+ "themeAttributes": true
},
"addons": {
"addonErrors": true,
- "editAction": "detached"
+ "editAction": "detached",
+ "checkForUpdates": true,
+ "updateInterval": 4
+ },
+ "store": {
+ "bdAddonStore": true,
+ "alwaysEnable": false,
+ "addonEmbeds": true
},
"customcss": {
"customcss": true,
@@ -25,7 +33,8 @@
"window": {
"transparency": false,
"removeMinimumSize": true,
- "frame": false
+ "frame": false,
+ "inAppTrafficLights": false
},
"developer": {
"debugLogs": false,
@@ -33,6 +42,7 @@
"debuggerHotkey": false,
"reactDevTools": false,
"inspectElement": false,
- "devToolsWarning": false
+ "devToolsWarning": false,
+ "recovery": true
}
} \ No newline at end of file
diff --git a/.config/BetterDiscord/data/stable/themes.json b/.config/BetterDiscord/data/stable/themes.json
index 3afcd03..419725e 100644
--- a/.config/BetterDiscord/data/stable/themes.json
+++ b/.config/BetterDiscord/data/stable/themes.json
@@ -1,5 +1,5 @@
{
"Horizontal Server List": true,
- "flat": true,
- "mode": true
+ "flat": false,
+ "mode": false
} \ No newline at end of file
diff --git a/.config/BetterDiscord/themes/HorizontalServerList.theme.css b/.config/BetterDiscord/themes/HorizontalServerList.theme.css
deleted file mode 100644
index 5b82210..0000000
--- a/.config/BetterDiscord/themes/HorizontalServerList.theme.css
+++ /dev/null
@@ -1,20 +0,0 @@
-/**
- * @name Horizontal Server List
- * @author Gibbu#1211
- * @version 2.1.0
- * @invite ZHthyCw
- * @description Moves the server list from the left to the top of Discord. Compatible with Server Folders and most basic transparent themes
- * @source https://github.com/DiscordStyles/HorizontalServerList
- * @website https://www.gibbu.me
-*/
-
-@import url("https://discordstyles.github.io/HorizontalServerList/dist/HorizontalServerList.css");
-
-/* Bottom HorizontalServerList. Simply remove the comments surrounding the @import to enable it. */
-/* @import url("https://discordstyles.github.io/Addons/bottomhsl.css"); */
-
-:root {
- --HSL-server-icon-size: 40px; /* Size of the server icons | DEFAULT: 40px */
- --HSL-server-spacing: 10px; /* Spacing between each server icon | DEFAULT: 10px */
- --HSL-server-direction: column; /* Direct of the server list. | Options: column, column-reverse | DEFAULT: column */
-}
diff --git a/.config/X11/base b/.config/X11/base
new file mode 100644
index 0000000..a538320
--- /dev/null
+++ b/.config/X11/base
@@ -0,0 +1,13 @@
+*.font: monospace:size=7.5:antialias=true:autohint=true
+*.borderpx: 10
+*.termname: st-256color
+*.tabspaces: 2
+
+Xft.dpi: 96
+Xft.hinting: 1
+Xft.hintstyle: hintslight
+Xft.antialias: 1
+Xft.rgba: rgb
+
+Xcursor.theme: OpenZone_Black_Slim
+
diff --git a/.config/X11/base##template b/.config/X11/base##template
deleted file mode 100644
index 04bf1d1..0000000
--- a/.config/X11/base##template
+++ /dev/null
@@ -1,20 +0,0 @@
-{% if yadm.hostname == "thoncc" %}
-*.font: JetBrainsMono Nerd Font:size=7.5:antialias=true:autohint=true
-*.borderpx: 8
-{% else %}
-*.font: JetBrainsMono Nerd Font:size=9:antialias=true:autohint=true
-*.borderpx: 16
-{% endif %}
-Xcursor.theme: OpenZone_Black_Slim
-
-*.termname: st-256color
-*.shell: /bin/sh
-
-*.tabspaces: 4
-
-Xft.dpi: 96
-Xft.hinting: 1
-Xft.hintstyle: hintslight
-Xft.antialias: 1
-Xft.rgba: rgb
-
diff --git a/.config/clangd/config.yaml b/.config/clangd/config.yaml
new file mode 100644
index 0000000..f4fa3e0
--- /dev/null
+++ b/.config/clangd/config.yaml
@@ -0,0 +1,9 @@
+CompileFlags:
+ Add:
+ # ignore unknown (gcc) compiler flags
+ - -Wno-unknown-warning-option
+ - -Wno-gnu-folding-constant
+ Remove:
+ - -m*
+ - -f*
+
diff --git a/.config/coc/extensions/package.json b/.config/coc/extensions/package.json
index 03b7e7d..83449e0 100644
--- a/.config/coc/extensions/package.json
+++ b/.config/coc/extensions/package.json
@@ -2,20 +2,20 @@
"dependencies": {
"coc-css": ">=2.1.0",
"coc-emmet": ">=1.1.6",
- "coc-go": ">=1.3.33",
+ "coc-go": ">=1.3.35",
"coc-html": ">=1.8.0",
"coc-java": ">=1.15.2",
"coc-json": ">=1.9.2",
"coc-python": ">=1.2.13",
- "coc-rust-analyzer": ">=0.75.2",
- "coc-tsserver": ">=2.1.4",
+ "coc-rust-analyzer": ">=0.80.2",
+ "coc-tsserver": ">=2.2.0",
"coc-vimtex": ">=1.1.5",
"coc-lua": ">=2.0.6",
- "coc-deno": ">=3.13.0",
- "coc-sh": ">=1.2.2",
+ "coc-deno": ">=3.15.0",
+ "coc-sh": ">=1.2.4",
"coc-solargraph": ">=1.2.4"
},
"disabled": [],
"locked": [],
- "lastUpdate": 1716395488358
+ "lastUpdate": 1747831306039
} \ No newline at end of file
diff --git a/.config/fcitx5/conf/imselector.conf b/.config/fcitx5/conf/imselector.conf
index 87428a1..de02872 100644
--- a/.config/fcitx5/conf/imselector.conf
+++ b/.config/fcitx5/conf/imselector.conf
@@ -1,10 +1,13 @@
-# Trigger Key for only current input context
+# 現在の入力コンテキストのみのトリガーキー
TriggerKeyLocal=
-# Hotkey for switching to the N-th input method
-SwitchKey=
-# Hotkey for switching to the N-th input method for only current input context
+# 現在の入力コンテキストのみをN番目の入力メソッドに切り替えるホットキー
SwitchKeyLocal=
[TriggerKey]
0=Super+Z
+[SwitchKey]
+0=Launch5
+1=Launch6
+2=Launch7
+
diff --git a/.config/fontconfig/conf.d/10-inter-features.conf b/.config/fontconfig/conf.d/10-inter-features.conf
new file mode 100644
index 0000000..5a641d6
--- /dev/null
+++ b/.config/fontconfig/conf.d/10-inter-features.conf
@@ -0,0 +1,14 @@
+<?xml version="1.0"?>
+<!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd">
+<fontconfig>
+ <description>Enable font features for Inter</description>
+ <match target="font">
+ <test name="family" compare="eq" ignore-blanks="true">
+ <string>Inter</string>
+ </test>
+ <edit name="fontfeatures" mode="append">
+ <string>ss07 on</string> <!-- Square punctuation -->
+ <string>ss08 on</string> <!-- Square quotes -->
+ </edit>
+ </match>
+</fontconfig>
diff --git a/.config/fontconfig/conf.d/10-sub-pixel-rgb.conf b/.config/fontconfig/conf.d/10-sub-pixel-rgb.conf
new file mode 100644
index 0000000..fcd51f3
--- /dev/null
+++ b/.config/fontconfig/conf.d/10-sub-pixel-rgb.conf
@@ -0,0 +1,8 @@
+<?xml version="1.0"?>
+<!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd">
+<fontconfig>
+ <description>Enable sub-pixel font rendering</description>
+ <match target="pattern">
+ <edit name="rgba" mode="append"><const>rgb</const></edit>
+ </match>
+</fontconfig>
diff --git a/.config/fzmp/conf b/.config/fzmp/conf
index 22439c3..a51f36d 100644..120000
--- a/.config/fzmp/conf
+++ b/.config/fzmp/conf
@@ -1,3 +1 @@
-default_view songs
-full_song_format [[[%artist% - %album% / ][%title%]]|%file%]
-fzf_options --ignore-case
+../mpcplus/fzmp.conf \ No newline at end of file
diff --git a/.config/git/config##template b/.config/git/config##template
index f8c16b2..edae109 100644
--- a/.config/git/config##template
+++ b/.config/git/config##template
@@ -1,5 +1,7 @@
[init]
defaultBranch = master
+[core]
+ quotepath = off
[user]
email = loek@pipeframe.xyz
name = Loek Le Blansch
diff --git a/.config/i3/autostart##template b/.config/i3/autostart##template
index 6b7f908..3c61922 100755
--- a/.config/i3/autostart##template
+++ b/.config/i3/autostart##template
@@ -13,13 +13,11 @@ fcitx5 &
xbindkeys --nodaemon &
{% if yadm.hostname == "thoncc" %}
xdimmer -t 45 -p 3 &
-light-locker --no-late-locking &
{% else %}
redshift -l 52:6 &
nicotine --hidden &
desktop2mqtt --config "$XDG_CONFIG_HOME/desktop2mqtt/config.yml" &
{% endif %}
-flashfocus &
# auto start lazy script after everything else
[ -x "$HOME/do.sh" ] && "$HOME/do.sh" &
diff --git a/.config/i3/config##template b/.config/i3/config##template
index 2af8c10..66874a0 100644
--- a/.config/i3/config##template
+++ b/.config/i3/config##template
@@ -1,10 +1,6 @@
# variables
set $mod Mod4
-{% if yadm.hostname == "thoncc" %}
set $inner_gaps 8
-{% else %}
-set $inner_gaps 10
-{% endif %}
set $outer_gaps 0
# set gaps
diff --git a/.config/kitty/kitty.conf b/.config/kitty/kitty.conf
new file mode 100644
index 0000000..b3af114
--- /dev/null
+++ b/.config/kitty/kitty.conf
@@ -0,0 +1,14 @@
+font_size 7.5
+disable_ligatures never
+window_padding_width 10
+placement_strategy top-left
+cursor_shape block
+
+modify_font cell_width 95%
+modify_font cell_height 120%
+modify_font baseline -1
+
+copy_on_select yes
+
+include color.conf
+
diff --git a/.config/latexmk/latexmkrc b/.config/latexmk/latexmkrc
index ad6c178..6d6ec09 100644
--- a/.config/latexmk/latexmkrc
+++ b/.config/latexmk/latexmkrc
@@ -1,4 +1 @@
-$pdflatex = "xelatex %O %S";
-$pdf_mode = 1;
-$dvi_mode = 0;
-$postscript_mode = 0;
+$pdf_previewer = "fork xdg-open %O %S";
diff --git a/.config/lf/lfrc b/.config/lf/lfrc
index 88560a8..3134b11 100644
--- a/.config/lf/lfrc
+++ b/.config/lf/lfrc
@@ -1,6 +1,10 @@
set shell sh
set shellopts '-eu'
+set ifs "\n"
+set filesep "\n"
set scrolloff 10
+set info size
+set dircounts
set previewer preview
cmd open $open $fx
@@ -8,13 +12,17 @@ cmd open $open $fx
set cursorpreviewfmt ""
set errorfmt "\033[31m"
set promptfmt "\033[34;1m%d\033[0m\033[1m%f\033[0m"
-set statfmt "\033[36m%p\033[0m| %S| -> %l"
+set statfmt "\033[36m%p| -> %l"
+set rulerfmt " %a| %p| \033[7;31m mv %m \033[0m| \033[7;33m cp %c \033[0m| \033[7;35m sel %s \033[0m| \033[7;34m %f \033[0m"
map v :toggle ; down
map V invert
map <backspace> set hidden! # <C-h>
+map u
+map uv unselect
+map uc clear
-cmd bulkrename $renamer $fx
+cmd bulkrename $renamer -n $fx
# vim:ft=cfg
diff --git a/.config/mpcplus/fzmp.conf b/.config/mpcplus/fzmp.conf
new file mode 100644
index 0000000..22439c3
--- /dev/null
+++ b/.config/mpcplus/fzmp.conf
@@ -0,0 +1,3 @@
+default_view songs
+full_song_format [[[%artist% - %album% / ][%title%]]|%file%]
+fzf_options --ignore-case
diff --git a/.config/mpd/mpd.conf##hostname.thoncc b/.config/mpd/mpd.conf##default
index a374418..a374418 100644
--- a/.config/mpd/mpd.conf##hostname.thoncc
+++ b/.config/mpd/mpd.conf##default
diff --git a/.config/neomutt/neomuttrc b/.config/neomutt/neomuttrc
index cd071ef..1e5bd13 100644
--- a/.config/neomutt/neomuttrc
+++ b/.config/neomutt/neomuttrc
@@ -9,13 +9,13 @@ set record = "+Sent"
set trash = "+Trash"
set postponed = "+Drafts"
-# imap credentials
-set imap_user = "loek@mail.pipeframe.xyz"
+# credentials
+set imap_user = "loek"
set imap_pass = "$(pass srv/wipper/passwd/loek)"
-
-# smtp credentials
set smtp_pass = "$imap_pass"
set smtp_url = "smtp://$imap_user@mail.pipeframe.xyz:587"
+set smtp_authenticators = 'login'
+set ssl_starttls = yes
set ssl_force_tls = yes
# automatically refresh incoming mail
diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim
index 35566e8..03150b5 100644
--- a/.config/nvim/init.vim
+++ b/.config/nvim/init.vim
@@ -19,13 +19,14 @@ set linebreak " set wrap but don't wrap inside words
set viminfo+='1000,n~/.local/nvim/viminfo
set guifont=JetBrainsMono\ Nerd\ Font:h9:#e-subpixelantialias:#h-slight
set linespace=5
+set tabpagemax=999
let g:sneak#label = 1
let g:which_key_map = {}
let g:airline_powerline_fonts = 1
let g:minimap_highlight='Visual'
let g:python3_host_prog='/usr/bin/python3'
-let g:vimtex_quickfix_open_on_warning = 0
-let g:vimtex_imaps_enabled = 0
+let g:DiffColors = 0
+let g:AutoPairsMultilineClose = 0
if exists("g:neovide")
nmap <silent> <C-=> :lua vim.g.neovide_scale_factor = vim.g.neovide_scale_factor + 0.1<CR>
@@ -48,6 +49,7 @@ call plug#begin('~/.config/nvim/plugged')
" quality of life
Plug 'jiangmiao/auto-pairs'
Plug 'tpope/vim-surround'
+Plug 'tpope/vim-speeddating'
Plug 'itchyny/lightline.vim'
Plug 'terryma/vim-multiple-cursors'
Plug 'liuchengxu/vim-which-key'
@@ -57,17 +59,15 @@ Plug 'neoclide/coc.nvim', {'branch': 'release'}
Plug 'puremourning/vimspector'
Plug 'junegunn/goyo.vim'
Plug 'psliwka/vim-smoothie'
-" Plug 'tpope/vim-fugitive'
Plug 'airblade/vim-gitgutter'
Plug 'wellle/targets.vim'
-" Plug 'dstein64/vim-startuptime'
Plug 'rrethy/vim-hexokinase', { 'do': 'make hexokinase' }
Plug 'dkarter/bullets.vim'
Plug 'editorconfig/editorconfig-vim'
+Plug 'rickhowe/diffunitsyntax'
" language plugins
Plug 'lervag/vimtex'
-" Plug 'pangloss/vim-javascript'
Plug 'hail2u/vim-css3-syntax'
Plug 'octol/vim-cpp-enhanced-highlight'
Plug 'vim-python/python-syntax'
@@ -76,7 +76,6 @@ Plug 'bartlomiejdanek/vim-dart'
Plug 'HerringtonDarkholme/yats.vim'
Plug 'cespare/vim-toml'
Plug 'tikhomirov/vim-glsl'
-" Plug 'gabrielelana/vim-markdown'
Plug 'vim-scripts/syntaxm4.vim'
Plug 'elkowar/yuck.vim'
Plug 'eraserhd/parinfer-rust', {'do': 'cargo build --release'}
@@ -88,23 +87,19 @@ Plug 'lonkaars/coc-khard'
" themes
Plug 'arzg/vim-colors-xcode'
-Plug '~/.config/nvim/local/bliss'
-Plug '~/.config/nvim/local/polarlight.vim'
-Plug '~/.config/nvim/local/autonyaa.vim'
-Plug 'lonkaars/blubber'
Plug 'romgrk/github-light.vim'
Plug 'vv9k/vim-github-dark'
Plug 'rose-pine/neovim'
+
+Plug '~/.config/nvim/local/coc-markdown-links'
call plug#end()
" keybinds
tnoremap <Esc> <C-\><C-n>
-
nnoremap tt :tabnew<CR>
-
-nmap <CR> o<Esc>
-nmap <leader>qf <Plug>(coc-fix-current)
-
+nnoremap <CR> o<Esc>
+nnoremap <leader>qf <Plug>(coc-fix-current)
+nnoremap <silent> * yiw:let @/='\<<C-R>=expand("<cword>")<CR>\>'<CR>:set hls<CR>
nnoremap <silent> <A-j> :m +1<CR>
nnoremap <silent> <A-k> :m -2<CR>
@@ -194,10 +189,20 @@ let g:which_key_map['.'] = {
map <silent> <leader>u :UndotreeToggle<cr>
let g:which_key_map.u = 'toggle undo tree'
+nnoremap <silent> <leader>e 0f!xC<c-r>=system(@-)<cr><esc>dd
+let g:which_key_map.e = 'read and execute after !'
+
" cmd maps
cnoreabbrev W w
cnoreabbrev sudow w !sudo tee %
+" emacs bindings in vim command-line
+cnoremap <A-b> <S-Left>
+cnoremap <A-f> <S-Right>
+cnoremap <C-a> <Home>
+cnoremap <C-e> <End>
+cnoremap <A-backspace> <C-w>
+
" hexokinase
let g:Hexokinase_termDisabled = 1
let g:Hexokinase_optOutPatterns = [ 'colour_names' ]
@@ -241,27 +246,15 @@ call lightline#init()
" vimtex config
let g:tex_flavor = 'latex'
-let g:vimtex_compiler_latexmk = {
- \ 'backend' : 'nvim',
- \ 'background' : 1,
- \ 'build_dir' : '',
- \ 'callback' : 1,
- \ 'continuous' : 1,
- \ 'executable' : 'latexmk',
- \ 'engine' : 'xelatex',
- \ 'hooks' : [],
- \ 'options' : [
- \ '-xelatex',
- \ '-file-line-error',
- \ '-synctex=1',
- \ '-interaction=nonstopmode',
- \ ],
- \}
+let g:vimtex_quickfix_open_on_warning = 0
+let g:vimtex_imaps_enabled = 0
+let g:vimtex_compiler_method = 'latexmk'
+let g:vimtex_compiler_latexmk_engines = { '_': '' }
" TeX quotes
autocmd FileType tex let b:surround_{char2nr("q")} = "`\r'"
autocmd FileType tex let b:surround_{char2nr('Q')} = "``\r''"
-autocmd FileType tex let b:AutoPairs = AutoPairsDefine({'(':')', '[':']', '{':'}', "``":"''", "`":"'", '$':'$', '"':'"'})
+autocmd FileType tex let b:AutoPairs = {'(':')', '[':']', '{':'}', "``":"''", "`":"'", '$':'$', '"':'"'}
" AutoPairs for plantuml
autocmd FileType plantuml let b:AutoPairs = {'(':')', '[':']', '{':'}', '`':'`'}
@@ -355,6 +348,19 @@ augroup Binary
au BufWritePost *.bin set noeol
augroup END
+" highlight Zephyr .overlay files as devicetree source (dts)
+augroup devicetree_ft
+ au!
+ au BufRead,BufNewFile *.overlay set syntax=dts
+ au BufRead,BufNewFile *.dtsi set syntax=dts
+augroup END
+
+augroup BibLaTeX
+ " add allowed characters in biblatex labels to word delimiters
+ autocmd!
+ autocmd FileType bib setlocal iskeyword+=:,-
+augroup END
+
" sneak
let g:sneak#use_ic_scs = 0
@@ -365,3 +371,5 @@ autocmd InsertLeave * call system("fcitx5-temp-off &")
" colorscheme
source $XDG_CONFIG_HOME/nvim/mode.vim
+set exrc
+set secure
diff --git a/.config/picom.conf b/.config/picom.conf
index f88a591..30e2693 100644
--- a/.config/picom.conf
+++ b/.config/picom.conf
@@ -53,9 +53,23 @@ rules = (
match = "window_type *= 'dock'";
shadow = false;
corner-radius = 0;
+ animations = (
+ {
+ triggers = [ "open" ];
+ preset = "slide-in";
+ direction = "up";
+ duration = 0.175;
+ },
+ {
+ triggers = [ "close" ];
+ preset = "slide-out";
+ direction = "up";
+ duration = 0.175;
+ },
+ );
},
{
- match = "window_type *= 'popup_menu'";
+ match = "window_type *= 'combo'";
shadow = true;
corner-radius = 10;
},
diff --git a/.config/polybar/config.ini##template b/.config/polybar/config.ini##template
index ed5371a..4581b90 100644
--- a/.config/polybar/config.ini##template
+++ b/.config/polybar/config.ini##template
@@ -43,7 +43,7 @@ font-2 = "Hiragino Kaku Gothic ProN W3:pixelsize=8:weight=medium:size=0;1"
font-3 = "Hiragino Kaku Gothic ProN W6:pixelsize=8:weight=medium:size=0;1"
font-4 = "Noto Sans KR:pixelsize=8:weight=medium:size=0;2"
-modules-left = time date cal
+modules-left = time date
{% if yadm.hostname == "thoncc" %}
modules-center = battery1 battery2 brightness
modules-right = mpd wireless keyboard volume
@@ -116,14 +116,9 @@ label-font = 2
[module/keyboard]
type = custom/script
-exec = ~/.local/share/bin/kbindicator
+exec = kbindicator
tail = true
-[module/cal]
-type = custom/script
-exec = now | ansi2polybar
-interval = 60
-
[module/mpd]
type = internal/mpd
format-online = <label-song>
@@ -135,7 +130,7 @@ label-song-ellipsis = true
[module/wacomtouch]
type = custom/script
-exec = ~/.local/share/bin/wacomtouch
+exec = wacomtouch
interval = 1
[module/battery1]
diff --git a/.config/rofi/config.rasi##template b/.config/rofi/config.rasi##template
index c467dcd..c6bf9c4 100644
--- a/.config/rofi/config.rasi##template
+++ b/.config/rofi/config.rasi##template
@@ -20,9 +20,10 @@ configuration {
window {
padding: 2px;
- background-color: ${background};
- text-color: ${foreground};
+ background-color: ${bg};
+ text-color: ${fg};
width: 350px;
+ border-radius: 10px;
}
* {
@@ -42,7 +43,7 @@ inputbar {
}
entry {
- padding: 10px;
+ padding: 10px 10px 8px 10px;
cursor-width: 1px;
}
@@ -51,14 +52,14 @@ listview {
scrollbar: false;
lines: 6;
fixed-height: false;
- padding: 1px 0px;
+ padding: 2px 0px;
}
element {
- margin: -1px 0px;
- padding: 6px 10px;
+ margin: -2px 0px;
+ padding: 6px 10px 3px 10px;
background-color: transparent;
- text-color: ${foreground};
+ text-color: ${fg};
}
element selected {
diff --git a/.config/xbindkeys/main##template b/.config/xbindkeys/main
index a1b5251..fb64a20 100644
--- a/.config/xbindkeys/main##template
+++ b/.config/xbindkeys/main
@@ -25,30 +25,26 @@
"pactl set-sink-volume @DEFAULT_SINK@ -1%"
Mod1+Mod4+minus
+"pactl set-sink-volume @DEFAULT_SINK@ -1%"
+ XF86AudioLowerVolume
"pactl set-sink-volume @DEFAULT_SINK@ +1%"
Mod1+Mod4+equal
-
"pactl set-sink-volume @DEFAULT_SINK@ +1%"
XF86AudioRaiseVolume
-"pactl set-sink-volume @DEFAULT_SINK@ -1%"
- XF86AudioLowerVolume
"pactl set-sink-mute @DEFAULT_SINK@ toggle"
XF86AudioMute
"pactl set-source-mute @DEFAULT_SOURCE@ toggle"
XF86AudioMicMute
-{% if yadm.hostname == "thoncc" %}
-"xbacklight -inc 10 -time 100 -fps 60"
- XF86MonBrightnessUp
-"xbacklight -dec 10 -time 100 -fps 60"
- XF86MonBrightnessDown
-{% else %}
-"brightness - 20"
+"brightness -10"
Shift+Mod4 + minus
-"brightness + 20"
+"brightness -10"
+ XF86MonBrightnessDown
+"brightness +10"
Shift+Mod4 + equal
-{% endif %}
+"brightness +10"
+ XF86MonBrightnessUp
"playerctl play-pause"
XF86AudioPlay
diff --git a/.config/zathura/zathurarc##template b/.config/zathura/zathurarc
index 932d1c7..ff927ca 100644
--- a/.config/zathura/zathurarc##template
+++ b/.config/zathura/zathurarc
@@ -1,11 +1,6 @@
set scroll-page-aware "true"
set scroll-full-overlap 0.01
set scroll-step 100
-{% if yadm.hostname == "thoncc" %}
-set font "JetBrainsMono Nerd Font 8"
-{% else %}
-set font "JetBrainsMono Nerd Font 9"
-{% endif %}
set selection-clipboard clipboard
# recolor (dark mode)
diff --git a/.local/share/applications/discord.desktop b/.local/share/applications/discord.desktop
index 676b330..403a457 100644
--- a/.local/share/applications/discord.desktop
+++ b/.local/share/applications/discord.desktop
@@ -7,3 +7,4 @@ Exec=discord
Icon=discord
Type=Application
Categories=Network;InstantMessaging;
+MimeType=x-scheme-handler/betterdiscord;
diff --git a/.local/share/applications/mozc-dictionary.desktop b/.local/share/applications/mozc-dictionary.desktop
new file mode 100644
index 0000000..c4f6193
--- /dev/null
+++ b/.local/share/applications/mozc-dictionary.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Name=Mozc dictionary tool
+Name[ja]=Mozc 辞書ツール
+Name[nl]=Mozc woordenboekhulpprogramma
+GenericName[ja]=日本語入力の辞書ツール
+GenericName[nl]=Hulpprogramma voor woordenboek van Japanse invoer
+GenericName=Japanese input method dictionary tool
+Exec=/usr/lib/mozc/mozc_tool --mode=dictionary_tool
+Icon=mozc
+Type=Application
+Categories=Settings;
diff --git a/.local/share/applications/mozc-settings.desktop b/.local/share/applications/mozc-settings.desktop
new file mode 100644
index 0000000..bcfde2d
--- /dev/null
+++ b/.local/share/applications/mozc-settings.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Name=Mozc settings
+Name[ja]=Mozc プロパティ
+Name[nl]=Mozc instellingen
+GenericName[ja]=日本語入力の設定
+GenericName[nl]=Instellingen voor Japanse invoermethode
+GenericName=Japanese IME configuration
+Exec=/usr/lib/mozc/mozc_tool --mode=config_dialog
+Icon=mozc
+Type=Application
+Categories=Settings;
diff --git a/.local/share/bin/= b/.local/share/bin/=
index 59b9b45..dd8ba6c 100755
--- a/.local/share/bin/=
+++ b/.local/share/bin/=
@@ -1,2 +1,16 @@
-#!/bin/sh
-python3 -c "from math import *; deg = pi / 180; print($*)"
+#!/bin/python3 --
+from sys import argv as _argv
+
+from math import *
+deg = pi / 180
+
+MIN = min
+MAX = max
+BIT = lambda n: 1 << n
+GENMASK = lambda h, l: (BIT(MAX(h, l) + 1) - 1) ^ (BIT(MIN(h, l)) - 1)
+
+try:
+ print(eval(" ".join(_argv[1:])))
+except:
+ exit(1)
+
diff --git a/.local/share/bin/brightness b/.local/share/bin/brightness
new file mode 100755
index 0000000..c1c6139
--- /dev/null
+++ b/.local/share/bin/brightness
@@ -0,0 +1,29 @@
+#!/bin/sh
+case "$*" in
+ +*) action="+" ;;
+ -*) action="-" ;;
+ *) action="=" ;;
+esac
+value="$(echo "$*" | tr -dc '[[:digit:]]')"
+
+if [ -n "$(command -v xbacklight)" ] ; then
+ [ "$action" = "+" ] && action="-inc"
+ [ "$action" = "-" ] && action="-dec"
+ [ "$action" = "=" ] && action="-set"
+
+ fork xbacklight -time 100 -fps 60 $action $value
+
+ exit 0
+
+elif [ -n "$(command -v ddcutil)" ] ; then
+ [ "$action" = "=" ] && action=""
+
+ for bus in 2 3 ; do
+ fork ddcutil --bus="$bus" --skip-ddc-checks --noverify setvcp 10 $action $value
+ done
+
+ exit 0
+
+fi
+exit 1
+
diff --git a/.local/share/bin/ccpreview b/.local/share/bin/ccpreview
index a835ab4..9f13acc 100755
--- a/.local/share/bin/ccpreview
+++ b/.local/share/bin/ccpreview
@@ -24,33 +24,51 @@ VIDEO_URL="av://v4l2:$VIDEO_DEVICE"
RESOLUTION="${WIDTH}x${HEIGHT}"
+fork() {
+ JOBS="$JOBS $(
+ "$@" > /dev/null 2> /dev/null &
+ echo $!
+ )"
+}
+
# set capture card v4l parameters
v4l2-ctl --silent --device "$VIDEO_DEVICE" \
--set-parm "$FRAMERATE" \
--set-fmt-video "width=$WIDTH,height=$HEIGHT,pixelformat=MJPG" \
--set-ctrl "brightness=0,contrast=128,saturation=128,hue=0"
-# preview window
-mpv \
- --msg-level=input=no --no-config --input-conf=/dev/null \
- --no-osc --no-input-default-bindings --pause=no --force-seekable=no \
- \
- --no-cache --untimed --no-correct-pts \
+_mpv() {
+ fork mpv \
+ --quiet --msg-level=input=no \
+ --no-config --input-conf=/dev/null \
+ --no-osc --no-border \
+ --no-input-default-bindings --pause=no --force-seekable=no \
+ --cache=no \
+ "$@"
+}
+
+# audio preview
+_mpv \
--no-demuxer-thread \
- --video-sync=audio \
--audio-buffer=0 \
- --vd-lavc-threads=1 \
--cache-pause=no \
--interpolation=no \
- --video-latency-hacks=yes \
--stream-buffer-size=4k \
- \
- --demuxer-lavf-o-add=fflags=+nobuffer \
- --demuxer-lavf-analyzeduration=0 \
+ --profile=low-latency \
+ --speed=1.001 \
+ "$AUDIO_URL"
+
+# video preview
+_mpv \
+ --untimed --no-correct-pts --no-demuxer-thread \
+ --profile=low-latency \
--demuxer-lavf-o-add=input_format=mjpeg \
--demuxer-lavf-o-add=framerate="$FRAMERATE" \
--demuxer-lavf-o-add=resolution="$RESOLUTION" \
--demuxer-lavf-o-add=rw_timeout=30000000 \
- \
- "$VIDEO_URL" --audio-file="$AUDIO_URL"
+ --speed=1.05 \
+ "$VIDEO_URL"
+
+sleep infinity
+kill -9 -- $JOBS
diff --git a/.local/share/bin/hide b/.local/share/bin/hide
new file mode 100755
index 0000000..cb49be0
--- /dev/null
+++ b/.local/share/bin/hide
@@ -0,0 +1,4 @@
+#!/bin/sh
+for file in "$@" ; do
+ mv "$file" ".$file"
+done
diff --git a/.local/share/bin/lrc2labels b/.local/share/bin/lrc2labels
new file mode 100755
index 0000000..31aa4be
--- /dev/null
+++ b/.local/share/bin/lrc2labels
@@ -0,0 +1,11 @@
+#!/bin/sh
+cat "$@" |\
+ gawk '
+match($0, /^\[([0-9]{2}):([0-9]{2}\.[0-9]{2})\](.*)/, group) {
+ time = group[1] * 60 + group[2]
+ lyric = group[3]
+
+ printf("%.2f\t%.2f\t%s\n", time, time, lyric)
+}
+'
+
diff --git a/.local/share/bin/mk b/.local/share/bin/mk
index ab0f586..b7e2b41 100755
--- a/.local/share/bin/mk
+++ b/.local/share/bin/mk
@@ -6,6 +6,13 @@ showmode() {
printf '\e[1A\e['$col'G\e[1;30m%s\e[0m\n' "$mode"
}
+mode_west() {
+ showmode 'west'
+ [ -z "$*" ] && set -- build
+ exec west "$@"
+}
+[ -e "west.yml" ] && mode_west "$@"
+
mode_cmake() {
showmode 'cmake'
builddir="build"
diff --git a/.local/share/bin/nginx-dev b/.local/share/bin/nginx-dev
new file mode 100755
index 0000000..40e73ad
--- /dev/null
+++ b/.local/share/bin/nginx-dev
@@ -0,0 +1,86 @@
+#!/bin/sh
+folder="$PWD"
+port=8080
+try_files='/$uri /$uri.html /$uri/index.html =404'
+access_log='/dev/stdout'
+cache_control='
+ proxy_store off;
+ proxy_cache off;
+ add_header Last-Modified $date_gmt;
+ add_header Cache-Control "private no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0";
+ if_modified_since off;
+ expires off;
+ etag off;
+'
+
+usage() {
+ cat << EOF
+usage: $(basename "$0") [options] [folder]
+
+options:
+ -p PORT host server on port PORT (default $port)
+ -t STR set try_files pattern to STR (default '$try_files')
+ -C enable server cache (disabled by default)
+ -v verbose mode (prints config before starting server)
+ -q quiet mode (disable access_log)
+ -x automatically open a browser
+ -h show this help
+EOF
+exit $1
+}
+
+ARGC=0
+while getopts hvp:Ct:qx OPT; do
+ [ $OPTIND -gt $ARGC ] && ARGC=$OPTIND
+ case $OPT in
+ h) usage 0 ;;
+ p) port="$OPTARG" ;;
+ t) try_files="$OPTARG" ;;
+ v) print_config=1 ;;
+ C) cache_control='' ;;
+ q) access_log="/dev/null" ;;
+ x) open_browser=1 ;;
+ \?|*) usage 1 ;;
+ esac
+done
+shift $(( $OPTIND - 1 ))
+
+[ $# -ge 1 ] && folder="$(readlink -f "$1")"
+
+config="$(mktemp)"
+pidfile="$(mktemp)"
+cat << EOF > "$config"
+worker_processes 1;
+daemon off;
+pid $pidfile;
+
+events {
+ worker_connections 1024;
+}
+
+http {
+ types_hash_max_size 4096;
+ include /etc/nginx/mime.types;
+ default_type application/octet-stream;
+
+ $cache_control
+
+ access_log $access_log;
+
+ server {
+ listen $port;
+ listen [::]:$port;
+
+ root $folder;
+
+ location / {
+ try_files $try_files;
+ }
+ }
+}
+EOF
+[ $print_config ] && cat "$config"
+[ $open_browser ] && (xdg-open "http://localhost:$port" 1> /dev/null 2> /dev/null &)
+nginx -c "$config"
+rm -f "$config" "$pidfile"
+
diff --git a/.local/share/bin/now b/.local/share/bin/now
deleted file mode 100755
index 8fca44f..0000000
--- a/.local/share/bin/now
+++ /dev/null
@@ -1,2 +0,0 @@
-#!/bin/sh
-printf '%s\n' "$(khal --color list now 1h --notstarted --day-format '' --format '({start-time}) {calendar-color}{title}{reset}')"
diff --git a/.local/share/bin/preview b/.local/share/bin/preview
index 0225848..141d03c 100755
--- a/.local/share/bin/preview
+++ b/.local/share/bin/preview
@@ -1,12 +1,26 @@
#!/bin/sh
-[ $# -ne 5 ] && exit 1
-FILE="$1"
-WIDTH="$2"
-HEIGHT="$3"
-POS_X="$4"
-POS_Y="$5"
+[ -n "$1" ] && FILE="$1" || {
+ echo "error: no input file"
+ exit 1
+}
+[ -n "$2" ] && WIDTH="$(( "$2" - 3 ))" || WIDTH="$(tput cols)"
+[ -n "$3" ] && HEIGHT="$3" || HEIGHT="$(tput lines)"
+[ -n "$4" ] && POS_X="$4" || POS_X="0"
+[ -n "$5" ] && POS_Y="$5" || POS_Y="0"
MIMETYPE="$(file --mime-type -Lb "$FILE")"
+EXT="${FILE#*.}"
+
+[ "$EXT" = "md" ] && [ "$MIMETYPE" = "text/plain" ] && MIMETYPE="application/markdown"
+[ "$MIMETYPE" = "application/javascript" ] && MIMETYPE="text/javascript"
+
+render_manpage() {
+ exec groff -T utf8 -m man -rcR=1 -rIN=0 -rLL="${WIDTH}n" << EOF
+.nr an-suppress-header-and-footer 1
+.TH
+$(cat | preconv)
+EOF
+}
case "$MIMETYPE" in
image/*)
@@ -27,11 +41,18 @@ case "$MIMETYPE" in
application/x-tar|\
application/x-bzip|\
application/x-bzip2|\
+ application/gzip|\
application/zip|\
application/x-7z-compressed|\
application/vnd.rar)
bsdtar -tf "$FILE"
;;
+ application/markdown)
+ pandoc --from=gfm --to=man "$FILE" | render_manpage
+ ;;
+ application/json)
+ jq --color-output . "$FILE"
+ ;;
*)
echo "$MIMETYPE"
file -b "$FILE" | fold --width="$WIDTH" --spaces
diff --git a/.local/share/bin/rofi b/.local/share/bin/rofi
index 2b2d0b6..d573764 100755
--- a/.local/share/bin/rofi
+++ b/.local/share/bin/rofi
@@ -1,4 +1,4 @@
#!/bin/sh
[ -e "$XDG_CONFIG_HOME/gtk-4.0/env" ] && . "$XDG_CONFIG_HOME/gtk-4.0/env"
-. "$XDG_CONFIG_HOME/rofi/colors"
+. "$XDG_CACHE_HOME/mode/state/vars"
exec /bin/rofi -no-default-config "$@"
diff --git a/.local/share/bin/screenrecord b/.local/share/bin/screenrecord
index 52c6e5b..d595cc8 100755
--- a/.local/share/bin/screenrecord
+++ b/.local/share/bin/screenrecord
@@ -1,3 +1,8 @@
#!/bin/sh
-giph -f 60 -s -b 4 -c 255,255,255 "$(date +'%Y-%m-%d_%H-%M-%S.mp4')"
+exec giph "$@" \
+ --framerate=60 \
+ --select \
+ --bordersize=4 \
+ --color=255,255,255 \
+ "$(date +'%Y-%m-%d_%H-%M-%S.mp4')"
diff --git a/.local/share/bin/set-default b/.local/share/bin/set-default
new file mode 100755
index 0000000..d93f65c
--- /dev/null
+++ b/.local/share/bin/set-default
@@ -0,0 +1,32 @@
+#!/bin/sh
+SCRIPT_NAME="$(basename "$0")"
+
+usage() {
+ code=0
+ if [ -z "$1" ] ; then
+ cat << EOF
+Set desktop entry ENTRY as default application for opening files with the same
+type as FILE
+
+EOF
+ else
+ echo "error: $1" >&2
+ code=1
+ fi
+ cat << EOF
+usage:
+ $SCRIPT_NAME ENTRY FILE [FILE]
+EOF
+ exit $code
+}
+
+[ $# -eq 0 ] && usage
+DESKTOP_ENTRY="$1"; shift
+[ -z "$DESKTOP_ENTRY" ] && usage "no desktop entry"
+[ $# -lt 1 ] && usage "no reference file(s)"
+
+for file in "$@" ; do
+ mimetype="$(xdg-mime query filetype "$file")"
+ xdg-mime default "$DESKTOP_ENTRY" "$mimetype"
+done
+
diff --git a/.local/share/mode/mode b/.local/share/mode/mode
index 3969fa1..55de32f 100755
--- a/.local/share/mode/mode
+++ b/.local/share/mode/mode
@@ -40,6 +40,24 @@ examples:
EOF
}
+# run a module file
+run_mod() {
+ mod_name="$1"
+
+ # modules must be executable
+ ! [ -x "$mod_name" ] && return
+
+ # parse interpreter from shebang
+ interpreter="$(basename "$(command -v $(head -n1 "$mod_name" | sed -n 's/^#!\(.*\)/\1/p'))")"
+ if [ "$interpreter" = "sh" ] ; then
+ # source module if interpreter is POSIX sh (makes plugin functions available)
+ ( . "$mod_name" )
+ else
+ # else, just run them
+ "$mod_name"
+ fi
+}
+
# generate config files from theme file using scripts in switch.d
switch() {
[ -z "$theme" ] && stupid "error: no theme selected"
@@ -56,20 +74,12 @@ switch() {
# load theme colors + aux variables
. "$theme"
- # load plugins (available to switch.d scripts only)
+ # load plugins (TODO: plugins aren't loaded when only reloading)
for plugin in "$data"/plug.d/* ; do . "$plugin" ; done
# generate new config files / snippets (in parallel)
for switch_function in "$data"/switch.d/* ; do
- ! [ -x "$switch_function" ] && continue
- interpreter="$(basename "$(command -v $(head -n1 "$switch_function" | sed -n 's/^#!\(.*\)/\1/p'))")"
- if [ "$interpreter" = "sh" ] ; then
- # source scripts if they are POSIX sh (makes plugin functions available)
- ( . "$switch_function" ) &
- else
- # else, just run them
- "$switch_function" &
- fi
+ run_mod "$switch_function" &
done
# join all processes started above
@@ -81,8 +91,7 @@ reload() {
echo "reloading programs..."
for reload_function in "$data"/reload.d/* ; do
- ! [ -x "$reload_function" ] && continue
- "$reload_function" &
+ run_mod "$reload_function" &
done
wait $(jobs -p)
@@ -127,6 +136,7 @@ for arg in "$@" ; do
esac
done
+# main
[ $run_cfggen -eq 1 ] && switch
[ $run_reload -eq 1 ] && reload
diff --git a/.local/share/mode/plug.d/10_lib b/.local/share/mode/plug.d/10_lib
index 61817bc..b3a0276 100644
--- a/.local/share/mode/plug.d/10_lib
+++ b/.local/share/mode/plug.d/10_lib
@@ -1,5 +1,46 @@
#!/bin/sh
# utility library functions
hex_to_rgb_array() { pastel format rgb "$1" | cut -c4- | tr '()' '[]' ; }
+
mix_rgb() { pastel mix --colorspace=RGB --fraction="$3" "$1" "$2" | pastel format hex ; }
+getvar() {
+ key="$1"
+ eval "printf '%s' \"\$$key\""
+}
+
+setvar() {
+ key="$1"
+ value="$2"
+ eval "$key='$(printf '%s' "$value")'"
+}
+
+themevar() {
+ key="$1"
+ if [ $# -eq 1 ] ; then
+ value="$(getvar "$key")"
+ else
+ value="$2"
+ setvar "$key" "$value"
+ fi
+
+ vars="$vars
+$(printf "export %s='%s'" "$key" "$value")"
+ eval "export $key"
+}
+
+mkcd() {
+ mkdir -p "$1"
+ cd "$1"
+}
+
+respawn_daemon() {
+ killall -q "$1" && fork "$@"
+}
+
+silent_fail_if_no_commmand() {
+ for name in "$@" ; do
+ [ -z "$(command -v "$name")" ] && exit
+ done
+}
+
diff --git a/.local/share/mode/plug.d/20_export_colors b/.local/share/mode/plug.d/20_export_colors
index 017446d..0f53d1f 100644
--- a/.local/share/mode/plug.d/20_export_colors
+++ b/.local/share/mode/plug.d/20_export_colors
@@ -9,7 +9,7 @@ check_color() {
echo "error: color $1 is not properly formatted (#RRGGBB)"
stupid && exit 1
fi
- eval "export $1"
+ themevar "$1"
}
for color in $(seq 0 15 | sed 's/^/color/') bg fg ; do
check_color $color
diff --git a/.local/share/mode/plug.d/20_export_mode b/.local/share/mode/plug.d/20_export_mode
index 78432b6..c82c4e1 100644
--- a/.local/share/mode/plug.d/20_export_mode
+++ b/.local/share/mode/plug.d/20_export_mode
@@ -5,5 +5,5 @@ if [ "$mode" != 'dark' ] && [ "$mode" != 'light' ] ; then
[ $? -eq 0 ] && mode=dark || mode=light
echo "warn: theme $theme did not define \$mode as \"light\" or \"dark\", guessed $mode" >&2
fi
-export mode
+themevar mode
diff --git a/.local/share/mode/plug.d/20_export_vim_theme b/.local/share/mode/plug.d/20_export_vim_theme
index be76b8b..12304f3 100644
--- a/.local/share/mode/plug.d/20_export_vim_theme
+++ b/.local/share/mode/plug.d/20_export_vim_theme
@@ -3,4 +3,4 @@
if [ "$(find "$XDG_CONFIG_HOME/nvim" -name "$vim_theme_name.vim" | wc -l)" -eq 0 ] ; then
echo "warn: vim theme $vim_theme_name does not appear to be installed" >&2
fi
-export vim_theme_name
+themevar vim_theme_name
diff --git a/.local/share/mode/plug.d/50_accent b/.local/share/mode/plug.d/50_accent
index 2a8a113..ceb3209 100644
--- a/.local/share/mode/plug.d/50_accent
+++ b/.local/share/mode/plug.d/50_accent
@@ -4,13 +4,12 @@
# do not generate accent color if already explicitly defined by theme
[ -n "$accent" ] && return
-[ "$mode" = "light" ] && {
- accent="$color15"
- accent_text="$color0"
-}
-[ "$mode" = "dark" ] && {
- accent="$(mix_rgb $bg $color0 0.5)"
- accent_text="$fg"
-}
+if [ "$mode" = "light" ] ; then
+ themevar accent "$color15"
+ themevar accent_text "$color0"
+fi
+if [ "$mode" = "dark" ] ; then
+ themevar accent "$(mix_rgb $bg $color0 0.5)"
+ themevar accent_text "$fg"
+fi
-export accent accent_text
diff --git a/.local/share/mode/reload.d/dunst b/.local/share/mode/reload.d/dunst
index 3c09a31..430320c 100755
--- a/.local/share/mode/reload.d/dunst
+++ b/.local/share/mode/reload.d/dunst
@@ -1,4 +1,3 @@
#!/bin/sh
-killall dunst
-fork dunst
+respawn_daemon dunst
diff --git a/.local/share/mode/reload.d/gtk b/.local/share/mode/reload.d/gtk
index a6dbb34..767969d 100644
--- a/.local/share/mode/reload.d/gtk
+++ b/.local/share/mode/reload.d/gtk
@@ -2,9 +2,7 @@
# this is max jank but xfsettingsd does other things besides live gtk theme
# reloading, and i don't like having it running constantly because it fucks
# up fcitx5 and xbindkeys
-(
- fork xfsettingsd --replace
- sleep 1
- killall xfsettingsd
-)
+fork xfsettingsd --replace
+sleep 1
+killall -q xfsettingsd
diff --git a/.local/share/mode/reload.d/nvim b/.local/share/mode/reload.d/nvim
index 84ae847..cfabcc7 100755
--- a/.local/share/mode/reload.d/nvim
+++ b/.local/share/mode/reload.d/nvim
@@ -1,4 +1,5 @@
#!/bin/sh
+silent_fail_if_no_commmand nvr
nvr --serverlist | while read -r nvim_socket ; do
fork nvr --nostart --servername "$nvim_socket" -c 'source $XDG_CONFIG_HOME/nvim/mode.vim'
done
diff --git a/.local/share/mode/reload.d/polybar b/.local/share/mode/reload.d/polybar
index af39394..1976811 100755
--- a/.local/share/mode/reload.d/polybar
+++ b/.local/share/mode/reload.d/polybar
@@ -1,3 +1,3 @@
#!/bin/sh
-polybar-msg cmd restart > /dev/null
+fork polybar-msg cmd restart
diff --git a/.local/share/mode/reload.d/term b/.local/share/mode/reload.d/term
index 5f02463..b711d56 100755
--- a/.local/share/mode/reload.d/term
+++ b/.local/share/mode/reload.d/term
@@ -26,5 +26,5 @@ escape_msgs="$(cat << EOF | tr -d '\n'
EOF
)"
-find /dev/pts -exec sh -c "printf \"$escape_msgs\" > {}" \; 2> /dev/null
+find /dev/pts -exec sh -c "printf '$escape_msgs' > {}" \; 2> /dev/null
diff --git a/.local/share/mode/switch.d/chromium b/.local/share/mode/switch.d/chromium
index 9048b80..fb701a5 100755
--- a/.local/share/mode/switch.d/chromium
+++ b/.local/share/mode/switch.d/chromium
@@ -1,17 +1,16 @@
#!/bin/sh
-PREFIX="$XDG_CACHE_HOME/mode/chromium"
+mkcd "$XDG_CACHE_HOME/mode/chromium"
-mkdir -p "$PREFIX"
-rm -f "$PREFIX/Cached Theme.pak"
+rm -f 'Cached Theme.pak'
-magick -size 100x100 "xc:$bg" "$PREFIX/bg.png"
+magick -size 100x100 "xc:$bg" 'bg.png'
bg_alt=$(mix_rgb $color7 $bg 0.20)
fg_alt=$(mix_rgb $color15 $fg 0.60)
bg="$(hex_to_rgb_array "$bg")"
fg="$(hex_to_rgb_array "$fg")"
bg_alt="$(hex_to_rgb_array "$bg_alt")"
fg_alt="$(hex_to_rgb_array "$fg_alt")"
-cat << EOF > "$PREFIX/manifest.json"
+cat << EOF > 'manifest.json'
{
"description": "colorscheme generated by mode",
"manifest_version": 2,
diff --git a/.local/share/mode/switch.d/discord b/.local/share/mode/switch.d/discord
index f656783..5931dec 100755
--- a/.local/share/mode/switch.d/discord
+++ b/.local/share/mode/switch.d/discord
@@ -1,5 +1,6 @@
#!/bin/sh
-cat << EOF > "$XDG_CONFIG_HOME/BetterDiscord/themes/mode.theme.css"
+mkcd "$XDG_CONFIG_HOME/BetterDiscord/themes"
+cat << EOF > 'mode.theme.css'
/**
* @name mode
* @author mode
diff --git a/.local/share/mode/switch.d/dunst b/.local/share/mode/switch.d/dunst
index d4fd8dc..f863100 100755
--- a/.local/share/mode/switch.d/dunst
+++ b/.local/share/mode/switch.d/dunst
@@ -1,5 +1,6 @@
#!/bin/sh
-cat "$XDG_CONFIG_HOME/dunst/base" - << EOF > "$XDG_CONFIG_HOME/dunst/dunstrc"
+mkcd "$XDG_CONFIG_HOME/dunst"
+cat 'base' - << EOF > 'dunstrc'
frame_color = "$accent"
[urgency_low]
diff --git a/.local/share/mode/switch.d/fcitx5 b/.local/share/mode/switch.d/fcitx5
index 4b35478..71880a7 100755
--- a/.local/share/mode/switch.d/fcitx5
+++ b/.local/share/mode/switch.d/fcitx5
@@ -1,5 +1,5 @@
#!/bin/sh
-cd "$XDG_DATA_HOME/fcitx5/themes/default"
+mkcd "$XDG_DATA_HOME/fcitx5/themes/default"
rounding=6
size=$(( 2 * $rounding + 4 ))
margin_h=6
diff --git a/.local/share/mode/switch.d/kitty b/.local/share/mode/switch.d/kitty
new file mode 100755
index 0000000..dddc41b
--- /dev/null
+++ b/.local/share/mode/switch.d/kitty
@@ -0,0 +1,25 @@
+#!/bin/sh
+mkcd "$XDG_CONFIG_HOME/kitty"
+
+cat << EOF > 'color.conf'
+background $bg
+foreground $fg
+
+color0 $color0
+color1 $color1
+color2 $color2
+color3 $color3
+color4 $color4
+color5 $color5
+color6 $color6
+color7 $color7
+color8 $color8
+color9 $color9
+color10 $color10
+color11 $color11
+color12 $color12
+color13 $color13
+color14 $color14
+color15 $color15
+EOF
+
diff --git a/.local/share/mode/switch.d/mode b/.local/share/mode/switch.d/mode
index 3b58fa6..f4c916e 100755
--- a/.local/share/mode/switch.d/mode
+++ b/.local/share/mode/switch.d/mode
@@ -1,8 +1,8 @@
#!/bin/sh
-PREFIX="$XDG_CACHE_HOME/mode/state"
-rm -rf "$PREFIX"/*
-mkdir -p "$PREFIX"
+mkcd "$XDG_CACHE_HOME/mode/state"
-echo "$mode" > "$PREFIX/mode"
-ln -sf "$theme" "$PREFIX/theme"
+echo "$mode" > mode
+rm theme
+ln -sf "$theme" theme
+echo "#!/bin/sh$vars" > vars
diff --git a/.local/share/mode/switch.d/polybar b/.local/share/mode/switch.d/polybar
index b7e752a..17fcee2 100755
--- a/.local/share/mode/switch.d/polybar
+++ b/.local/share/mode/switch.d/polybar
@@ -1,5 +1,6 @@
#!/bin/sh
-cat << EOF > "$XDG_CONFIG_HOME/polybar/colors.ini"
+mkcd "$XDG_CONFIG_HOME/polybar"
+cat << EOF > 'colors.ini'
[color]
bg = \${xrdb:background:$bg}
fg = \${xrdb:foreground:$fg}
diff --git a/.local/share/mode/switch.d/rofi b/.local/share/mode/switch.d/rofi
deleted file mode 100755
index 19b9008..0000000
--- a/.local/share/mode/switch.d/rofi
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/sh
-cat << EOF > "$XDG_CONFIG_HOME/rofi/colors"
-export background="$bg"
-export foreground="$fg"
-export accent="$accent"
-export accent_text="$accent_text"
-EOF
-
diff --git a/.local/share/mode/switch.d/vim b/.local/share/mode/switch.d/vim
index 6c83f9f..cb5a651 100755
--- a/.local/share/mode/switch.d/vim
+++ b/.local/share/mode/switch.d/vim
@@ -1,9 +1,8 @@
#!/bin/sh
-PREFIX="$XDG_CONFIG_HOME/nvim/mode"
-mkdir -p "$PREFIX"
+mkcd "$XDG_CONFIG_HOME/nvim/mode"
# lightline
-cat << EOF > "$PREFIX/lightline.vim"
+cat << EOF > 'lightline.vim'
let s:bg = [ '$bg', 'NONE' ]
let s:fg = [ '$fg', 'NONE' ]
let s:mode = [ '$color0', 'NONE' ]
@@ -14,7 +13,7 @@ let s:test = [ '#ff00ff', 'NONE' ]
let s:p = {'normal': {}, 'inactive': {}, 'insert': {}, 'replace': {}, 'visual': {}, 'tabline': {}}
let s:p.normal.left = [ [ s:fg, s:mode ], [ s:faint, s:bg ] ]
let s:p.normal.right = [ [ s:faint, s:bg ] ]
-let s:p.normal.middle = [ [ s:none, s:none ] ]
+let s:p.normal.middle = [ [ s:bg, s:bg ] ]
let s:p.normal.error = [ [ s:test, s:test ] ]
let s:p.normal.warning = [ [ s:test, s:test ] ]
let s:p.inactive.left = copy(s:p.normal.left)
@@ -32,7 +31,7 @@ let g:lightline#colorscheme#auto#palette = lightline#colorscheme#flatten(s:p)
EOF
# terminal colors
-cat << EOF > "$PREFIX/termcolors.vim"
+cat << EOF > 'termcolors.vim'
let g:terminal_color_0 = '$color0'
let g:terminal_color_1 = '$color1'
let g:terminal_color_2 = '$color2'
@@ -52,7 +51,7 @@ let g:terminal_color_15 = '$color15'
EOF
# color scheme
-cat << EOF > "$PREFIX/colorscheme.vim"
+cat << EOF > 'colorscheme.vim'
colorscheme $vim_theme_name
EOF
diff --git a/.local/share/mode/switch.d/zathura b/.local/share/mode/switch.d/zathura
index c0687df..e1a15e7 100755
--- a/.local/share/mode/switch.d/zathura
+++ b/.local/share/mode/switch.d/zathura
@@ -1,5 +1,6 @@
#!/bin/sh
-cat << EOF > "$XDG_CONFIG_HOME/zathura/colors"
+mkcd "$XDG_CONFIG_HOME/zathura"
+cat << EOF > 'colors'
set completion-bg "$bg"
set completion-fg "$fg"
set completion-highlight-bg "$accent"
diff --git a/.local/share/mode/themes/github-black b/.local/share/mode/themes/github-black
new file mode 100644
index 0000000..34b507c
--- /dev/null
+++ b/.local/share/mode/themes/github-black
@@ -0,0 +1,25 @@
+#!/bin/sh
+mode=dark
+
+color0='#484f58'
+color1='#ffa198'
+color2='#56d364'
+color3='#e3b341'
+color4='#79c0ff'
+color5='#d2a8ff'
+color6='#56d4dd'
+color7='#b1bac4'
+color8='#6e7681'
+color9='#ff7b72'
+color10='#3fb950'
+color11='#d29922'
+color12='#58a6ff'
+color13='#bc8cff'
+color14='#39c5cf'
+color15='#ffffff'
+
+bg='#000000'
+fg='#e6edf3'
+
+vim_theme_name='ghdark'
+
diff --git a/.local/share/mode/themes/xcode-dark b/.local/share/mode/themes/xcode-dark
new file mode 100644
index 0000000..eb75b80
--- /dev/null
+++ b/.local/share/mode/themes/xcode-dark
@@ -0,0 +1,24 @@
+#!/bin/sh
+mode=dark
+
+color0='#43454b'
+color1='#ff8a7a'
+color2='#83c9bc'
+color3='#d9c668'
+color4='#4ec4e6'
+color5='#ff85b8'
+color6='#cda1ff'
+color7='#ffffff'
+color8='#838991'
+color9='#ff8a7a'
+color10='#b1faeb'
+color11='#ffa14f'
+color12='#6bdfff'
+color13='#ff85b8'
+color14='#e5cfff'
+color15='#ffffff'
+
+bg='#1f1f24'
+fg='#e6edf3'
+
+vim_theme_name='xcodedarkhc'
diff --git a/.local/share/pass-extensions/duplicates.bash b/.local/share/pass-extensions/duplicates.bash
index cb1cbbc..3ba47aa 100755
--- a/.local/share/pass-extensions/duplicates.bash
+++ b/.local/share/pass-extensions/duplicates.bash
@@ -5,21 +5,18 @@ pass_names="$(pass names -l)"
[ $? -ne 0 ] && exit 1
pass_count="$(echo "$pass_names" | wc -l)"
-if [ "$pass_count" -gt 10 ] ; then
- cat << EOF >&2
-pass-duplicates needs to decrypt all your passwords one-by-one to cross-match
-them. This is all done in-memory, and nothing is saved to disk. You appear to
-have $pass_count passwords, so this may take some time...
-
-EOF
-fi
+pass_index=1
while read pass_name ; do
hash="$(pass show "$pass_name" | head -n1 | sha1sum | cut -c1-40)"
dupe_map["$pass_name"]="$hash"
dupe_tally["$hash"]=$(( ${dupe_tally["$hash"]} + 1 ))
+
+ printf '\rhashing... (%d/%d)' "$pass_index" "$pass_count" >&2
+ pass_index=$(( $pass_index + 1 ))
done < <(echo "$pass_names")
+printf '\r\e[2K' >&2
unique_duplicates=0
total_shared=0
diff --git a/.local/share/pass-extensions/g.bash b/.local/share/pass-extensions/g.bash
new file mode 100755
index 0000000..4ab3ace
--- /dev/null
+++ b/.local/share/pass-extensions/g.bash
@@ -0,0 +1,2 @@
+#!/bin/bash
+exec pass git "$@"
diff --git a/.profile b/.profile
index 9b8dc1e..9af7722 100644
--- a/.profile
+++ b/.profile
@@ -42,9 +42,8 @@ export GEM_HOME="$XDG_DATA_HOME/gem/ruby/3.0.0"
# script locations
if [ -z "$PATH_EXTENDED" ] ; then
+ PATH="/opt/zephyr-sdk/arm-zephyr-eabi/bin:$PATH"
PATH="$GEM_HOME/bin:$PATH"
- # PATH="$HOME/.lyp/bin:$PATH"
- # PATH="/opt/f4pga/xc7/conda/bin:$PATH"
PATH="$HOME/.local/share/cargo/bin:$PATH"
PATH="$HOME/.local/go/bin:$PATH"
PATH="$HOME/.local/bin:$PATH"
@@ -57,11 +56,13 @@ fi
export EDITOR="nvim -p"
export PAGER="less"
export FZF_DEFAULT_COMMAND="find . -name '.?*' -prune -o -print"
-export FZF_DEFAULT_OPTS="--color=bw,fg:7,scrollbar:8,info:8 --layout=reverse --info=inline-right --no-separator --marker='*' --pointer=''"
+export FZF_DEFAULT_OPTS="--color=bw,fg:7,scrollbar:8,info:8 --layout=reverse --info=inline-right --no-separator --no-scrollbar --marker='*' --pointer=''"
export GOPATH="$HOME/.local/go"
[ -e "$XDG_CONFIG_HOME/gtk-4.0/env" ] && . "$XDG_CONFIG_HOME/gtk-4.0/env"
export PASSWORD_STORE_ENABLE_EXTENSIONS=true
export PASSWORD_STORE_EXTENSIONS_DIR="$XDG_DATA_HOME/pass-extensions"
+export MOZ_USE_XINPUT2=1
+export CMAKE_EXPORT_COMPILE_COMMANDS=1
# LS_COLORS
[ ! -e "$XDG_CACHE_HOME/dircolors" ] || [ "$XDG_CONFIG_HOME/dircolors" -nt "$XDG_CACHE_HOME/dircolors" ] && dircolors "$XDG_CONFIG_HOME/dircolors" > "$XDG_CACHE_HOME/dircolors"
@@ -86,6 +87,9 @@ alias nvidia-settings='nvidia-settings --config="$XDG_CONFIG_HOME/nvidia/setting
alias gpg2="gpg2 --homedir $XDG_DATA_HOME/gnupg"
export PASSWORD_STORE_DIR="$XDG_DATA_HOME/pass"
export WGETRC="$XDG_CONFIG_HOME/wgetrc"
+export TEXMFHOME="$XDG_DATA_HOME/texmf"
+export TEXMFVAR="$XDG_CACHE_HOME/texlive/texmf-var"
+export TEXMFCONFIG="$XDG_CONFIG_HOME/texlive/texmf-config"
# disable dotnet telemetry
export DOTNET_CLI_TELEMETRY_OPTOUT=1
diff --git a/.zshrc b/.zshrc
index 9e19ed6..4ba1181 100644
--- a/.zshrc
+++ b/.zshrc
@@ -14,11 +14,19 @@ zstyle ':completion:*' list-colors "${(s.:.)LS_COLORS}"
zstyle ':completion:*:*:*:*:*' menu select
zstyle ':completion:*' matcher-list 'm:{[:lower:][:upper:]}={[:upper:][:lower:]}' 'r:|=*' 'l:|=* r:|=*'
zstyle ':completion:*' special-dirs true
-setopt auto_menu
+setopt auto_menu # show completion menu when spamming <tab>
setopt complete_in_word
-setopt always_to_end
+setopt always_to_end # move cursor to end of word after completion
+setopt auto_cd # cd if the command is a valid path
+WORDCHARS="${WORDCHARS:gs/\//}" # remove '/' from WORDCHARS
compinit -d "$ZSH_COMPDUMP"
+# history
+export HISTFILE="$XDG_DATA_HOME/zsh/history"
+export HISTSIZE=10000000
+export SAVEHIST=10000000
+setopt share_history
+
# keybinds
bindkey -e # emacs bindings
bindkey '^[[Z' reverse-menu-complete
@@ -33,7 +41,7 @@ prompt_segment() {
}
prompt_mod_git_info() {
git rev-parse --is-inside-work-tree 1> /dev/null 2> /dev/null || return
- prompt_segment "git $(git rev-parse --abbrev-ref HEAD)"
+ prompt_segment "git $(git rev-parse --abbrev-ref HEAD 2> /dev/null)"
}
# only display hostname in prompt if connected over SSH
[ -n "$SSH_CLIENT" ] && PROMPT+="$(prompt_segment '%m')"