Muh dotfiles

This commit is contained in:
2025-05-10 10:18:28 +03:00
commit 0f4558597e
84 changed files with 4306 additions and 0 deletions

View File

@ -0,0 +1,46 @@
status is-interactive; or return
status is-login; and abbr H Hyprland
abbr l la
abbr m mkdir
abbr o open
abbr t trash
# abbr m mpv
abbr mm -- mpv --shuffle \$XDG_MUSIC_DIR
abbr g git
# abbr dots -- git --git-dir \~/.dotfiles/ --work-tree \~
abbr gl git log
abbr ga git add
abbr gc git commit
abbr gs git status
abbr gcl git clone
abbr gco git checkout
function __last_hist_item; printf $history[1]; end
abbr !! -p anywhere -f __last_hist_item
function __find_editor --description 'Edit with edit-in-kitty when in ssh'
if set -q SSH_TTY; and type -q edit-in-kitty
printf edit-in-kitty
else
printf $EDITOR
end
end
abbr e -f __find_editor
function __ssh_kitten --description 'Use ssh kitten if available'
type -q kitten; and printf 'kitten '
printf ssh
end
abbr s -f __ssh_kitten
function __multidot --description 'Use .... instead of ../../../'
string repeat -n (math (string length -- $argv) - 1) ../
end
abbr multidot -r '\.\.\.+$' -p anywhere -f __multidot
function __multicd; echo cd (__multidot $argv); end
abbr multicd -r '^\.\.+$' -f __multicd

View File

@ -0,0 +1,49 @@
set -gx XDG_CONFIG_HOME ~/.config
set -gx XDG_CACHE_HOME ~/.cache
set -gx XDG_STATE_HOME ~/.local/state
set -gx XDG_DATA_HOME ~/.local/share
set -gx XDG_MUSIC_DIR ~/music
set -gx XDG_VIDEOS_DIR ~/vid
set -gx XDG_PICTURES_DIR ~/pic
set -gx XDG_DOCUMENTS_DIR ~/doc
set -gx XDG_DESKTOP_DIR /tmp
set -gx XDG_DOWNLOAD_DIR /tmp
# set -gx XDG_TEMPLATES_DIR "$HOME/"
# set -gx XDG_PUBLICSHARE_DIR "$HOME/"
set -gx GOPATH $XDG_DATA_HOME/go # GOOUT my home
set -gx CARGO_HOME $XDG_DATA_HOME/cargo
# Can't use '~' in universal variables
set -gx fish_user_paths ~/.local/bin $CARGO_HOME/bin
# -agx is a bad idea as login shell itself also does it
set -gx WINEPATH /usr/x86_64-w64-mingw32/bin
# set -gx CPATH /usr/x86_64-w64-mingw32/include
set -gx BROWSER librewolf # for fish documentation mainly
# Convenience
set -gx SCREENSHOT_DIR $XDG_PICTURES_DIR/screen
set -gx SCREENRECORD_DIR $XDG_VIDEOS_DIR/screen
# Find an editor
for e in nvim vim vi helix nano
type -q $e; or continue
set -gx EDITOR $e
break
end
type -q nvim; and set -gx MANPAGER nvim +Man!
test -S ~/.bitwarden-ssh-agent.sock
and set -gx SSH_AUTH_SOCK ~/.bitwarden-ssh-agent.sock
# SSH with GPG
# set -e SSH_AGENT_PID
# set -gx GPG_TTY (tty)
# set -gx SSH_AUTH_SOCK (gpgconf --list-dirs agent-ssh-socket)
# gpg-connect-agent updatestartuptty /bye >/dev/null

0
.config/fish/config.fish Normal file
View File

View File

@ -0,0 +1,43 @@
# This file contains fish universal variable definitions.
# VERSION: 3.0
SETUVAR __fish_initialized:3800
SETUVAR fish_color_autosuggestion:6272a4
SETUVAR fish_color_cancel:ff5555\x1e\x2d\x2dreverse
SETUVAR fish_color_command:8be9fd
SETUVAR fish_color_comment:6272a4
SETUVAR fish_color_cwd:50fa7b
SETUVAR fish_color_cwd_root:red
SETUVAR fish_color_end:ffb86c
SETUVAR fish_color_error:ff5555
SETUVAR fish_color_escape:ff79c6
SETUVAR fish_color_history_current:\x2d\x2dbold
SETUVAR fish_color_host:bd93f9
SETUVAR fish_color_host_remote:bd93f9
SETUVAR fish_color_keyword:ff79c6
SETUVAR fish_color_match:\x2d\x2dbackground\x3dbrblue
SETUVAR fish_color_normal:f8f8f2
SETUVAR fish_color_operator:50fa7b
SETUVAR fish_color_option:ffb86c
SETUVAR fish_color_param:bd93f9
SETUVAR fish_color_quote:f1fa8c
SETUVAR fish_color_redirection:f8f8f2
SETUVAR fish_color_search_match:\x2d\x2dbackground\x3d44475a
SETUVAR fish_color_selection:\x2d\x2dbackground\x3d44475a
SETUVAR fish_color_status:ff5555
SETUVAR fish_color_user:8be9fd
SETUVAR fish_color_valid_path:\x2d\x2dunderline
SETUVAR fish_features:all
SETUVAR fish_key_bindings:fish_vi_key_bindings
SETUVAR fish_pager_color_background:\x1d
SETUVAR fish_pager_color_completion:f8f8f2
SETUVAR fish_pager_color_description:6272a4
SETUVAR fish_pager_color_prefix:8be9fd
SETUVAR fish_pager_color_progress:6272a4
SETUVAR fish_pager_color_secondary_background:\x1d
SETUVAR fish_pager_color_secondary_completion:f8f8f2
SETUVAR fish_pager_color_secondary_description:6272a4
SETUVAR fish_pager_color_secondary_prefix:8be9fd
SETUVAR fish_pager_color_selected_background:\x2d\x2dbackground\x3d44475a
SETUVAR fish_pager_color_selected_completion:f8f8f2
SETUVAR fish_pager_color_selected_description:6272a4
SETUVAR fish_pager_color_selected_prefix:8be9fd

View File

@ -0,0 +1,3 @@
function chat --wraps='ollama run --nowordwrap' --description 'Run an llm without history'
OLLAMA_NOHISTORY=y ollama run --nowordwrap $argv
end

View File

@ -0,0 +1,3 @@
function dots --wraps 'git --git-dir ~/.dotfiles/ --work-tree ~' --description 'Track dotfiles with git'
command git --git-dir ~/.dotfiles/ --work-tree ~ $argv
end

View File

@ -0,0 +1,3 @@
function fish_greeting
# command -q fortune; and fortune -as
end

View File

@ -0,0 +1 @@
function fish_mode_prompt; end

View File

@ -0,0 +1,65 @@
function fish_prompt --description 'Write out the prompt'
# Save those before running anything
set -l last_pipestatus $pipestatus
set -lx __fish_last_status $status # Export for __fish_print_pipestatus.
# Detect reflow from window size change
if test "$__fish_prompt_term_dimensions" != "$COLUMNS$LINES"
set -g __fish_prompt_term_dimensions "$COLUMNS$LINES"
if set -q __fish_prompt
echo -ns $__fish_prompt
return
end
end
# Write pipestatus if a command was issued
# TODO: hardcode this mess
if test "$__fish_prompt_status_generation" != $status_generation
set -g __fish_prompt_status_generation $status_generation
set -q fish_color_status; or set -g fish_color_status brred
set -f prompt_status (__fish_print_pipestatus '' '' '|' '' (set_color --bold $fish_color_status) $last_pipestatus)
end
# Only show login if in SSH or container
if not set -q prompt_host
set -g prompt_host '' # global because it's slow and unchanging
if set -q SSH_TTY; or begin
command -sq systemd-detect-virt
and systemd-detect-virt -q
end
set prompt_host "$(prompt_login) "
end
end
if not set -q __prompt_suffix
set -g __prompt_suffix '>'
set -g __prompt_color_cwd fish_color_cwd
if fish_is_root_user
set __prompt_suffix '#'
set -q fish_color_cwd_root; or set -g fish_color_cwd_root red
set __prompt_color_cwd fish_color_cwd_root
end
end
set -l suffix $__prompt_suffix
if test "$fish_key_bindings" = fish_vi_key_bindings
or test "$fish_key_bindings" = fish_hybrid_key_bindings
switch $fish_bind_mode
# case insert
case default
set suffix (set_color --bold brmagenta)N
case visual
set suffix (set_color --bold brcyan)V
case replace_one
set suffix (set_color --bold bryellow)R
case replace
set suffix (set_color --bold brred)R
end
end
set -l n (set_color normal)
set -g __fish_prompt $n $prompt_host (set_color $$__prompt_color_cwd) (prompt_pwd -D2) $n ' ' $prompt_status $suffix $n ' '
echo -ns $__fish_prompt
end

View File

@ -0,0 +1,53 @@
function fish_right_prompt
# Detect reflow from window size change
if test "$__fish_right_prompt_term_dimensions" != "$COLUMNS$LINES"
set -g __fish_right_prompt_term_dimensions "$COLUMNS$LINES"
if set -q __fish_right_prompt
echo -ns $__fish_right_prompt
return
end
end
set -g __fish_git_prompt_showdirtystate 1
set -g __fish_git_prompt_showuntrackedfiles 1
set -g __fish_git_prompt_showupstream informative
set -g __fish_git_prompt_showcolorhints 1
set -g __fish_git_prompt_use_informative_chars 1
# Unfortunately this only works if we have a sensible locale
string match -qi '*.utf-8' -- $LANG $LC_CTYPE $LC_ALL
and set -g __fish_git_prompt_char_dirtystate \U1F4a9
set -g __fish_git_prompt_char_untrackedfiles '?'
set -l vcs (fish_vcs_prompt '%s' 2>/dev/null)
set -q VIRTUAL_ENV_DISABLE_PROMPT
or set -g VIRTUAL_ENV_DISABLE_PROMPT true
set -q VIRTUAL_ENV
and set -l venv (string replace -r '.*/' '' -- "$VIRTUAL_ENV")
# Count duration (optionally)
if test $CMD_DURATION -gt 100 -a \
"$__fish_right_prompt_status_generation" != $status_generation
set -g __fish_right_prompt_status_generation $status_generation
set -l secs (math -s2 $CMD_DURATION / 1000 % 60)
set -l mins (math -s0 $CMD_DURATION / 60000 % 60)
set -l hrs (math -s0 $CMD_DURATION / 3600000)
set -l parts
# Remove excess verbosity
test $hrs -gt 0; and set -a parts $hrs'h'
if test $mins -gt 0
set -a parts $mins'm'
set secs (math -s0 $secs) # drop millis when there are mins
end
test $secs -gt 0 -a $hrs -eq 0; and set -a parts $secs's'
set -f duration (set_color white)(string join ':' -- $parts)
end
set -l n (set_color normal)
set -g __fish_right_prompt $n $venv' ' $duration' ' $vcs' ' (set_color brblack) (date '+%R') $n
echo -ns $__fish_right_prompt
end

View File

@ -0,0 +1,40 @@
function fish_user_key_bindings
if command -q fzf
set -gx FZF_CTRL_R_OPTS '--reverse'
function bind; end # thanks fzf for not using `builtin`
if functions -q fzf_key_bindings
fzf_key_bindings
else
echo 'WARNING: using `fzf --fish | source`'
command fzf --fish | source
end
functions -e bind
# FZF_ALT_C_COMMAND, FZF_ALT_C_OPTS
bind alt-c fzf-cd-widget
bind -M insert alt-c fzf-cd-widget
# FZF_CTRL_T_COMMAND, FZF_CTRL_T_OPTS
bind alt-f fzf-file-widget
bind -M insert alt-f fzf-file-widget
# FZF_CTRL_R_OPTS
bind ctrl-f fzf-history-widget
bind -M insert ctrl-f fzf-history-widget
else
echo 'INFO: fzf not found'
end
# Unused: alt-z, insert ctrl-r
bind alt-t transpose-words
bind -M insert alt-t transpose-words
bind -M visual alt-t transpose-words
bind ctrl-t transpose-chars
bind -M insert ctrl-t transpose-chars
bind -M visual ctrl-t transpose-chars
bind ctrl-z 'fish_commandline_append " &; disown"'
bind -M insert ctrl-z 'fish_commandline_append " &; disown"'
bind -M visual ctrl-z 'fish_commandline_append " &; disown"'
# bind -M insert ctrl-d exit
end

View File

@ -0,0 +1,3 @@
function la --wraps 'ls' --description 'List all files in directory using verbose format'
ls -lAh --group-directories-first $argv
end

View File

@ -0,0 +1,3 @@
function ll --wraps 'ls' --description 'List contents of directory using long format'
ls -lh --group-directories-first $argv
end

View File

@ -0,0 +1,7 @@
function music --wraps 'yt-dlp -x --embed-thumbnail --embed-chapters' --description 'Download music with yt-dlp'
test -d $argv[-1]; or set -a argv "$XDG_MUSIC_DIR"
echo "Downloading into $argv[-1]"
command yt-dlp --extract-audio --embed-thumbnail --embed-chapters \
--output "$argv[-1]/%(title)s.%(ext)s" $argv[..-2]
end

View File

@ -0,0 +1,3 @@
function tree
command tree -C --dirsfirst $argv
end

View File

@ -0,0 +1,11 @@
function y --wraps 'yazi' --description 'TUI file manager'
set -l tmp (mktemp -t 'yazi_cwd.XXX')
yazi --cwd-file="$tmp" $argv
set -l cwd (command cat -- "$tmp")
and test -n "$cwd"
and test "$cwd" != "$PWD"
and builtin cd -- "$cwd"
rm -f -- "$tmp"
end

3
.config/gdu/gdu.yaml Normal file
View File

@ -0,0 +1,3 @@
show-relative-size: true
show-item-count: true
show-mtime: false

23
.config/git/config Normal file
View File

@ -0,0 +1,23 @@
[init]
defaultBranch = main
[diff]
tool = nvimdiff
[core]
editor = nvim
; repositoryformatversion = 1
; [extensions]
; objectformat = sha256
[log]
showSignature = true
abbrevCommit = true
[gpg "ssh"]
allowedSignersFile = ~/.config/git/allowed_signers
[includeIf "gitdir:~/src/"]
path = ~/src/.gitconfig
; [filter "lfs"]
; required = true
; clean = git-lfs clean -- %f
; smudge = git-lfs smudge -- %f
; process = git-lfs filter-process

64
.config/htop/htoprc Normal file
View File

@ -0,0 +1,64 @@
# Beware! This file is rewritten by htop when settings are changed in the interface.
# The parser is also very primitive, and not human-friendly.
htop_version=3.4.1-3.4.1
config_reader_min_version=3
fields=0 48 17 18 38 40 39 2 50 37 46 47 49 1
hide_kernel_threads=1
hide_userland_threads=1
hide_running_in_container=1
shadow_other_users=0
show_thread_names=0
show_program_path=0
highlight_base_name=1
highlight_deleted_exe=1
shadow_distribution_path_prefix=1
highlight_megabytes=1
highlight_threads=1
highlight_changes=1
highlight_changes_delay_secs=4
find_comm_in_cmdline=1
strip_exe_from_cmdline=1
show_merged_command=1
header_margin=1
screen_tabs=0
detailed_cpu_time=0
cpu_count_from_one=0
show_cpu_usage=1
show_cpu_frequency=1
show_cpu_temperature=1
degree_fahrenheit=0
show_cached_memory=1
update_process_names=0
account_guest_in_cpu_meter=0
color_scheme=0
enable_mouse=1
delay=15
hide_function_bar=2
header_layout=two_67_33
column_meters_0=AllCPUs2 CPU
column_meter_modes_0=1 1
column_meters_1=DateTime Uptime LoadAverage Tasks Battery DiskIO NetworkIO Memory Swap
column_meter_modes_1=2 2 2 2 2 2 2 1 1
tree_view=1
sort_key=47
tree_sort_key=47
sort_direction=-1
tree_sort_direction=-1
tree_view_always_by_pid=0
all_branches_collapsed=0
screen:Main=PID USER PRIORITY NICE M_VIRT M_SHARE M_RESIDENT STATE NLWP PROCESSOR PERCENT_CPU PERCENT_MEM TIME Command
.sort_key=PERCENT_MEM
.tree_sort_key=PERCENT_MEM
.tree_view_always_by_pid=0
.tree_view=1
.sort_direction=-1
.tree_sort_direction=-1
.all_branches_collapsed=0
screen:I/O=PID USER IO_PRIORITY IO_RATE IO_READ_RATE IO_WRITE_RATE PERCENT_SWAP_DELAY PERCENT_IO_DELAY Command
.sort_key=IO_WRITE_RATE
.tree_sort_key=PID
.tree_view_always_by_pid=0
.tree_view=0
.sort_direction=-1
.tree_sort_direction=1
.all_branches_collapsed=0

552
.config/hypr/binds.conf Normal file
View File

@ -0,0 +1,552 @@
# vim:foldmethod=marker
# https://wiki.hyprland.org/Configuring/Binds/
# bind{l -> locked, r -> release, e -> repeat, n -> non-consuming, m -> mouse, t -> transparent}
# Mods: SHIFT CAPS CTRL/CONTROL ALT MOD2 MOD3 SUPER/WIN/LOGO/MOD4 MOD5
$mod = SUPER
$slurp_cmd = slurp -o -d -w 2 -B 00000000 -b 00000000 -s 00000000 -c
# Used with mod: aBcdEFGhIjkLmNOPQrStUvwxyz Tab1234567890-=Return
# General binds {{{
# bind = ALT, Space, exec, hyprctl keyword input:kb_variant = ""
bind = $mod, Q, killactive
bind = $mod, F, fullscreen
bind = $mod SHIFT, F, fullscreenstate, 0 3 # fool the window
bind = $mod CTRL, F, fullscreen, 1 # keep gaps and bars
bind = $mod SHIFT, Space, togglefloating
bind = $mod SHIFT, Space, centerwindow
bind = $mod, P, pin # show floating on all workspaces
bind = $mod, U, focusurgentorlast
bind = $mod, B, focuscurrentorlast
bind = $mod, S, togglespecialworkspace
bind = $mod, Tab, movecurrentworkspacetomonitor, +1
bind = $mod CTRL SHIFT ALT, x, exit
bind = $mod CTRL SHIFT ALT, x, exec, killall xdg-desktop-portal-hyprland
bind = $mod ALT, R, forcerendererreload
bind = $mod CTRL, R, exec, hyprctl reload
bind = $mod SHIFT, T, alterzorder, top
#bind = $mod, T, togglesplit # dwindle
#bind = $mod, V, layoutmsg, preselect, l
#bind = $mod, H, layoutmsg, preselect, r
bind = $mod, T, layoutmsg, orientationnext # master
#bind = $mod, M, layoutmsg, swapwithmaster auto
bind = $mod, A, layoutmsg, addmaster
bind = $mod SHIFT, A, layoutmsg, removemaster
bindm = $mod, mouse:272, movewindow
bindm = $mod, mouse:273, resizewindow
bind = $mod, Return, exec, kitty
bind = $mod, KP_Enter, exec, kitty
# works like shit with submaps
#bindit = $mod, SUPER_L, exec, pkill -USR1 waybar
#binditr = $mod, SUPER_L, exec, pkill -USR1 waybar
# }}}
# Media keys {{{
binde = $mod, F1, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-
binde = SHIFT, F1, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 1%-
binde = CTRL, F1, exec, playerctl volume 0.05-
binde = $mod CTRL, F1, exec, playerctl volume 0.01-
binde = $mod, F2, exec, wpctl set-volume -l 1.5 @DEFAULT_AUDIO_SINK@ 5%+
binde = SHIFT, F2, exec, wpctl set-volume -l 1.5 @DEFAULT_AUDIO_SINK@ 1%+
binde = CTRL, F2, exec, playerctl volume 0.05+
binde = $mod CTRL, F2, exec, playerctl volume 0.01+
bind = $mod, F3, exec, playerctl play-pause
bind = SHIFT, F3, exec, playerctl -a play-pause
# toggles
bindl = $mod, F5, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ 1
bind = SHIFT, F5, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ 0
bindl = $mod, F6, exec, wpctl set-mute @DEFAULT_AUDIO_SOURCE@ 1 ; killall waybar -s 35
bind = SHIFT, F6, exec, wpctl set-mute @DEFAULT_AUDIO_SOURCE@ 0 ; killall waybar -s 35
bindl = $mod, F7, exec, nmcli radio wifi off
bind = SHIFT, F7, exec, nmcli radio wifi on
bindl = $mod, F8, exec, bluetoothctl power off
bind = SHIFT, F8, exec, bluetoothctl power on
bind = $mod, F9, exec, playerctl previous
bind = $mod, F10, exec, playerctl next
bindle = $mod, F11, exec, brightnessctl s 5%-
binde = CTRL, F11, exec, brightnessctl s 1%-
binde = SHIFT, F11, exec, brightnessctl s 15%-
bindle = $mod, F12, exec, brightnessctl s 5%+
binde = CTRL, F12, exec, brightnessctl s 1%+
binde = SHIFT, F12, exec, brightnessctl s 15%+
bindle =, XF86MonBrightnessUP, exec, brightnessctl s 5%+
bindle =, XF86MonBrightnessDown, exec, brightnessctl s 5%-
binde = CTRL, XF86MonBrightnessUP, exec, brightnessctl s 1%+
binde = CTRL, XF86MonBrightnessDown, exec, brightnessctl s 1%-
binde = SHIFT, XF86MonBrightnessUP, exec, brightnessctl s 15%+
binde = SHIFT, XF86MonBrightnessDown, exec, brightnessctl s 15%-
binde =, XF86AudioRaiseVolume, exec, wpctl set-volume -l 1.5 @DEFAULT_AUDIO_SINK@ 5%+
binde =, XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-
binde = SHIFT, XF86AudioRaiseVolume, exec, wpctl set-volume -l 1.5 @DEFAULT_AUDIO_SINK@ 1%+
binde = SHIFT, XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 1%-
bindl =, XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ 1
bind = SHIFT, XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ 0
bindl =, XF86AudioMicMute, exec, wpctl set-mute @DEFAULT_AUDIO_SOURCE@ 1 ; killall waybar -s 35
bind = SHIFT, XF86AudioMicMute, exec, wpctl set-mute @DEFAULT_AUDIO_SOURCE@ 0 ; killall waybar -s 35
bind =, XF86AudioPlay, exec, playerctl play-pause
bind =, XF86AudioPrev, exec, playerctl previous
bind =, XF86AudioNext, exec, playerctl next
# instant region not saved
bind =, Print, exec, wl-copy -c; grim -g "$($slurp_cmd ff0000 && sleep 0.1)" -t png -l 6 - | wl-copy -t image/png
# delayed region not saved
bind = CTRL, Print, exec, grim -g "$($slurp_cmd 00ffff && sleep 3)" -t png -l 6 - | wl-copy -t image/png
# instant fullscreen not saved
bind = SHIFT, Print, exec, grim -o $(hyprctl activeworkspace | grep -Po '(?<=\d\) on monitor ).*?(?=:)') -t png -l 6 - | wl-copy -t image/png
# delayed fullscreen not saved
bind = SHIFT CTRL, Print, exec, sleep 3; grim -o $(hyprctl monitors | grep -Po '(?<=Monitor ).*?(?= \(ID \d*\):)') -t png -l 6 - | wl-copy -t image/png
# instant region saved
bind = $mod, Print, exec, grim -g "$($slurp_cmd 00ff00 && sleep 0.1)" -t png -l 6 - | tee $SCREENSHOT_DIR/$(date +'%-d.%m.%y-%H:%M:%S').png | wl-copy -t image/png
#TODO learn sed to screenshot active window
# bind = ALT, Print, exec, hyprpicker -rz &!; slurp; grim -g "$($slurp_cmd ffffff && sleep 0.1)" -t png -l 6 - | wl-copy -t image/png; kill $!
# }}}
# Submaps {{{
#TODO send print on alt+f4
bind = $mod, L, submap, launch
$media = NI󰝞 EO󰝝 P󰐎 - A󰝟 M󰍭 W󰣽 B󰂲 .󰳞 ,󰳠 K J M+W󰒎 R
bindl = $mod, M, submap, $media #mod+`
bindl = $mod, grave, submap, $media #mod+`
bind = $mod, G, submap, group
bind = $mod, R, submap, resize
bind = $mod SHIFT, W, submap, wallpaper
bind = $mod SHIFT, M, submap, mako
bind = $mod SHIFT, S, submap, system
bind = $mod SHIFT, D, submap, displays
bind = $mod CTRL, M, submap, move
# launch {{{
submap = launch
# apps
bind =, F, exec, librewolf
bind =, F, submap, reset
bind = SHIFT, F, exec, firefox
bind = SHIFT, F, submap, reset
bind = CTRL, F, exec, torbrowser-launcher
bind = CTRL, F, submap, reset
bind =, T, exec, killall telegram-desktop || telegram-desktop
bind =, T, submap, reset
bind =, S, exec, killall signal-desktop || signal-desktop
bind =, S, submap, reset
bind =, M, exec, QT_SCALE_FACTOR=1.25 fjordlauncher
bind =, M, submap, reset
bind =, E, exec, element-desktop
bind =, E, submap, reset
#bind =, N, exec, nemo
bind =, N, submap, reset
bind =, Y, exec, kitty yazi
bind =, Y, submap, reset
bind =, L, exec, logseq
bind =, L, submap, reset
bind =, O, exec, obsidian
bind =, O, submap, reset
bind =, K, exec, klavaro
bind =, K, submap, reset
bind = SHIFT, S, exec, mysql-workbench
bind = SHIFT, S, submap, reset
bind =, D, exec, discord --enable-features=UseOzonePlatform --ozone-platform=wayland
bind =, D, submap, reset
bind = SHIFT, V, exec, virtualboxvm --startvm Ghost11
bind = SHIFT, V, submap, reset
bind =, V, exec, bitwarden-desktop
bind =, V, submap, reset
bind = SHIFT, B, exec, flatpak run com.usebottles.bottles
bind = SHIFT, B, submap, reset
bind =, Q, exec, qbittorrent
bind =, Q, submap, reset
bind = SHIFT, D, exec, drawing
bind = SHIFT, D, submap, reset
bind =, A, exec, anki
bind =, A, submap, reset
# utilities
bind =, P, exec, pavucontrol
bind =, P, submap, reset
bind = SHIFT, P, exec, easyeffects
bind = SHIFT, P, submap, reset
bind =, B, exec, blueman-manager
bind =, B, submap, reset
bind =, C, exec, nm-connection-editor
bind =, C, submap, reset
bind = SHIFT, E, exec, killall nm-applet || nm-applet
bind = SHIFT, E, submap, reset
#bind =, G, exec, nwg-look
#bind =, G, submap, reset
#bind =, Q, exec, qt5ct
#bind =, Q, submap, reset
bind = SHIFT, A, exec, wdisplays # a for arandr
bind = SHIFT, A, submap, reset
# makes life easier
bind =, X, exec, ~/.config/hypr/scripts/xdph.sh
bind =, X, submap, reset
bind =, G, exec, killall gammastep || gammastep -m wayland -PO 4000
bind =, G, submap, reset
bind = SHIFT, L, exec, swaylock -C ~/.config/hypr/other/swaylock.conf
bind = SHIFT, L, submap, reset
bind =, H, exec, killall hyprpaper || hyprpaper
bind =, H, submap, reset
bind =, W, exec, pkill -USR1 waybar
#bind =, W, exec, hyprctl keyword general:gaps_out 0, 0, $(hyprctl getoption general:gaps_out | rg -q '0 0 0 0' && echo 10 || echo 0 ), 0
bind =, W, submap, reset
#bind =, , exec,
#bind =, , submap, reset
bind = $mod, L, submap, reset
bind =, Space, submap, reset
bind =, Return, submap, reset
bind =, Escape, submap, reset
# }}}
# mako {{{
submap = mako
bind =, D, exec, makoctl mode -a dnd; hyprctl notify 1 2000 "rgb(ff0000)" " DND"
bind =, D, submap, reset
bind =, A, exec, makoctl mode -a away
bind =, A, submap, reset
bind =, G, exec, makoctl dismiss -g
bind =, G, submap, reset
bind =, R, exec, makoctl restore
bind =, R, submap, reset
bind = SHIFT, A, exec, makoctl mode -r away
bind = SHIFT, A, submap, reset
bind = SHIFT, G, exec, makoctl dismiss -a
bind = SHIFT, G, submap, reset
bind = SHIFT, R, exec, makoctl reload; notify-send -t 2000 "reloaded"
bind = SHIFT, R, submap, reset
bind = SHIFT, D, exec, makoctl mode -r dnd; notify-send -t 2000 "dnd is off"
bind = SHIFT, D, submap, reset
bind = $mod, M, submap, reset
bind =, Space, submap, reset
bind =, Return, submap, reset
bind =, Escape, submap, reset
# }}}
# media {{{
submap = $media
binde =, 1, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-
binde = SHIFT, 1, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 1%-
binde = $mod, 1, exec, playerctl volume 0.05-
binde = CTRL, 1, exec, playerctl volume 0.01-
binde =, 2, exec, wpctl set-volume -l 1.5 @DEFAULT_AUDIO_SINK@ 5%+
binde = SHIFT, 2, exec, wpctl set-volume -l 1.5 @DEFAULT_AUDIO_SINK@ 1%+
binde = $mod, 2, exec, playerctl volume 0.05+
binde = CTRL, 2, exec, playerctl volume 0.01+
bind =, 3, exec, playerctl play-pause
bind = SHIFT, 3, exec, playerctl -a play-pause
#toggles
bindl =, 5, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ 1
bind = SHIFT, 5, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ 0
bindl =, 6, exec, wpctl set-mute @DEFAULT_AUDIO_SOURCE@ 1 ; killall waybar -s 35
bind = SHIFT, 6, exec, wpctl set-mute @DEFAULT_AUDIO_SOURCE@ 0 ; killall waybar -s 35
bindl =, 7, exec, nmcli radio wifi off
bind = SHIFT, 7, exec, nmcli radio wifi on
bindl =, 8, exec, bluetoothctl power off
bind = SHIFT, 8, exec, bluetoothctl power on
bind =, 9, exec, playerctl previous
bind =, 0, exec, playerctl next
bindle =, minus, exec, brightnessctl s 5%-
binde = CTRL, minus, exec, brightnessctl s 1%-
binde = SHIFT, minus, exec, brightnessctl s 15%-
bindle =, equal, exec, brightnessctl s 5%+
binde = CTRL, equal, exec, brightnessctl s 1%+
binde = SHIFT, equal, exec, brightnessctl s 15%+
binde = SHIFT, N, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-
binde =, N, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 1%-
binde = SHIFT, E, exec, wpctl set-volume -l 1.5 @DEFAULT_AUDIO_SINK@ 5%+
binde =, E, exec, wpctl set-volume -l 1.5 @DEFAULT_AUDIO_SINK@ 1%+
binde = SHIFT, I, exec, playerctl volume 0.05-
binde =, I, exec, playerctl volume 0.01-
binde = SHIFT, O, exec, playerctl volume 0.05+
binde =, O, exec, playerctl volume 0.01+
bind =, P, exec, playerctl play-pause
bind = SHIFT, P, exec, playerctl -a play-pause
bind =, comma, exec, playerctl previous
bind =, period, exec, playerctl next
#toggles
bindl =, A, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ 1
bind = SHIFT, A, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ 0
bindl =, M, exec, wpctl set-mute @DEFAULT_AUDIO_SOURCE@ 1 ; killall waybar -s 35
bind = SHIFT, M, exec, wpctl set-mute @DEFAULT_AUDIO_SOURCE@ 0 ; killall waybar -s 35
bindl = $mod, W, exec, nmcli networking off
bindl = $mod, W, exec, bluetoothctl power off
bind = $mod SHIFT, W, exec, nmcli networking on
bindl =, W, exec, nmcli radio wifi off
bind = SHIFT, W, exec, nmcli radio wifi on
bindl =, B, exec, bluetoothctl power off
bind = SHIFT, B, exec, bluetoothctl power on
bindle =, K, exec, brightnessctl s 5%-
binde = CTRL, K, exec, brightnessctl s 1%-
binde = SHIFT, K, exec, brightnessctl s 15%-
bindle =, J, exec, brightnessctl s 5%+
binde = CTRL, J, exec, brightnessctl s 1%+
binde = SHIFT, J, exec, brightnessctl s 15%+
bind =, R, exec, wl-screenrec --codec hevc -b '1 MB' --audio --audio-device $(pactl list short sinks | grep $(pactl get-default-sink) | head -c2) -f $SCREENRECORD_DIR/$(date +'%-d.%m.%y-%H:%M:%S').mkv
bind =, R, exec, sleep 0.5; killall waybar -s 36
bind =, R, submap, reset
bind = SHIFT, R, exec, wl-screenrec --codec hevc -b '1 MB' --audio -f $SCREENRECORD_DIR/$(date +'%-d.%m.%y-%H:%M:%S').mkv
bind = SHIFT, R, exec, sleep 0.5; killall waybar -s 36
bind = SHIFT, R, submap, reset
bind = CTRL, R, exec, wl-screenrec --codec hevc -b '0.5 MB' -g "$($slurp_cmd ff00ff)" -f $SCREENRECORD_DIR/$(date +'%-d.%m.%y-%H:%M:%S').mkv
bind = CTRL, R, exec, sleep 0.5; killall waybar -s 36
bind = CTRL, R, submap, reset
bind = $mod, R, exec, killall -INT wl-screenrec ; sleep 1; killall waybar -s 36
bind = $mod, R, submap, reset
bindl = $mod, M, submap, reset
bindl = $mod, grave, submap, reset
bindl =, Space, submap, reset
bindl =, Return, submap, reset
bindl =, Escape, submap, reset
# }}}
# wallpaper {{{
submap = wallpaper # more wallpapers, lmao
bind =, H, exec, killall hyprpaper || hyprpaper
bind =, 1, exec, sed -i 's/wall.$/wall1/g' ~/.config/hypr/hyprpaper.conf; killall hyprpaper; hyprpaper
bind =, 2, exec, sed -i 's/wall.$/wall2/g' ~/.config/hypr/hyprpaper.conf; killall hyprpaper; hyprpaper
bind =, 3, exec, sed -i 's/wall.$/wall3/g' ~/.config/hypr/hyprpaper.conf; killall hyprpaper; hyprpaper
bind =, 4, exec, sed -i 's/wall.$/wall4/g' ~/.config/hypr/hyprpaper.conf; killall hyprpaper; hyprpaper
bind =, 5, exec, sed -i 's/wall.$/wall5/g' ~/.config/hypr/hyprpaper.conf; killall hyprpaper; hyprpaper
bind =, 6, exec, sed -i 's/wall.$/wall6/g' ~/.config/hypr/hyprpaper.conf; killall hyprpaper; hyprpaper
bind =, 7, exec, sed -i 's/wall.$/wall7/g' ~/.config/hypr/hyprpaper.conf; killall hyprpaper; hyprpaper
bind =, 8, exec, sed -i 's/wall.$/wall8/g' ~/.config/hypr/hyprpaper.conf; killall hyprpaper; hyprpaper
bind =, 9, exec, sed -i 's/wall.$/wall9/g' ~/.config/hypr/hyprpaper.conf; killall hyprpaper; hyprpaper
bind =, 0, exec, sed -i 's/wall.$/wall0/g' ~/.config/hypr/hyprpaper.conf; killall hyprpaper; hyprpaper
bind =, 1, submap, reset
bind =, 2, submap, reset
bind =, 3, submap, reset
bind =, 4, submap, reset
bind =, 5, submap, reset
bind =, 6, submap, reset
bind =, 7, submap, reset
bind =, 8, submap, reset
bind =, 9, submap, reset
bind =, 0, submap, reset
bind = $mod SHIFT, W, submap, reset
bind =, Space, submap, reset
bind =, Return, submap, reset
bind =, Escape, submap, reset
# }}}
# group {{{
submap = group
bind =, G, togglegroup
bind =, G, submap, reset
bind =, L, lockactivegroup, toggle
bind =, L, submap, reset
bind =, A, lockgroups, lock
bind =, A, submap, reset
bind = SHIFT, A, lockgroups, unlock
bind = SHIFT, A, submap, reset
bind =, D, moveoutofgroup
bind =, D, submap, reset
binde =, E, movegroupwindow, b
binde =, I, movegroupwindow, f
binde =, N, changegroupactive, b
binde =, O, changegroupactive, f
binde =, down, movegroupwindow, b
binde =, up, movegroupwindow, f
binde =, left, changegroupactive, b
binde =, right, changegroupactive, f
binde = SHIFT, E, moveintogroup, d
binde = SHIFT, I, moveintogroup, u
binde = SHIFT, N, moveintogroup, l
binde = SHIFT, O, moveintogroup, r
binde = SHIFT, down, moveintogroup, d
binde = SHIFT, up, moveintogroup, u
binde = SHIFT, left, moveintogroup, l
binde = SHIFT, right, moveintogroup, r
bind = $mod SHIFT, G, submap, reset
bind =, Space, submap, reset
bind =, Return, submap, reset
bind =, Escape, submap, reset
# }}}
# system {{{
submap = system
bind =, S, exec, shutdown now
bind =, R, exec, systemctl reboot
bind =, Z, exec, systemctl suspend
bind =, Z, submap, reset
bind = $mod SHIFT, S, submap, reset
bind =, Space, submap, reset
bind =, Return, submap, reset
bind =, Escape, submap, reset
# }}}
# displays {{{
submap = displays
bind =, L, exec, ~/.config/hypr/scripts/displays.sh eDP-1 -
bind =, L, submap, reset
bind =, H, exec, ~/.config/hypr/scripts/displays.sh HDMI-A-1 -
bind =, H, submap, reset
bind =, A, exec, ~/.config/hypr/scripts/displays.sh eDP-1 ''
bind =, A, submap, reset
bind =, O, exec, ~/.config/hypr/scripts/displays.sh '' -eDP-1
bind =, O, submap, reset
bind =, D, exec, hyprctl keyword monitor eDP-1,preferred,auto,1
bind =, D, submap, reset
bind = SHIFT, D, exec, hyprctl keyword monitor eDP-1,disable
bind = SHIFT, D, submap, reset
bind = $mod SHIFT, D, submap, reset
bind =, Space, submap, reset
bind =, Return, submap, reset
bind =, Escape, submap, reset
# }}}
# resize {{{
submap = resize
bind = SHIFT, H, resizeactive, exact 720 480
bind = SHIFT, V, resizeactive, exact 480 720
binde =, E, resizeactive, 0 10
binde =, I, resizeactive, 0 -10
binde =, N, resizeactive, -10 0
binde =, O, resizeactive, 10 0
binde =, down, resizeactive, 0 10
binde =, up, resizeactive, 0 -10
binde =, left, resizeactive, -10 0
binde =, right, resizeactive, 10 0
binde = SHIFT, E, resizeactive, 0 50
binde = SHIFT, I, resizeactive, 0 -50
binde = SHIFT, N, resizeactive, -50 0
binde = SHIFT, O, resizeactive, 50 0
binde = SHIFT, down, resizeactive, 0 50
binde = SHIFT, up, resizeactive, 0 -50
binde = SHIFT, left, resizeactive, -50 0
binde = SHIFT, right, resizeactive, 50 0
bind = $mod SHIFT, R, submap, reset
bind =, Space, submap, reset
bind =, Return, submap, reset
bind =, Escape, submap, reset
# }}}
# move {{{
submap = move
bind =, C, centerwindow # for floating
bind =, C, submap, reset
binde =, E, moveactive, 0 10
binde =, I, moveactive, 0 -10
binde =, N, moveactive, -10 0
binde =, O, moveactive, 10 0
binde =, down, moveactive, 0 10
binde =, up, moveactive, 0 -10
binde =, left, moveactive, -10 0
binde =, right, moveactive, 10 0
binde = SHIFT, E, moveactive, 0 50
binde = SHIFT, I, moveactive, 0 -50
binde = SHIFT, N, moveactive, -50 0
binde = SHIFT, O, moveactive, 50 0
binde = SHIFT, down, moveactive, 0 50
binde = SHIFT, up, moveactive, 0 -50
binde = SHIFT, left, moveactive, -50 0
binde = SHIFT, right, moveactive, 50 0
bind = $mod SHIFT, M, submap, reset
bind =, Space, submap, reset
bind =, Return, submap, reset
bind =, Escape, submap, reset
# }}}
# back to default mode
submap = reset
# }}}
# Moving windows {{{
# TRUE scratchpad
bind = $mod, minus, movetoworkspacesilent, special
bind = $mod, equal, togglespecialworkspace
bind = $mod, equal, cyclenext, prev # first in first out
bind = $mod, equal, movetoworkspace, +0
# bind = $mod, equal, togglespecialworkspace
bind = $mod, E, movefocus, d
bind = $mod, I, movefocus, u
bind = $mod, N, movefocus, l
bind = $mod, O, movefocus, r
bind = $mod, down, movefocus, d
bind = $mod, up, movefocus, u
bind = $mod, left, movefocus, l
bind = $mod, right, movefocus, r
bind = $mod SHIFT, E, movewindow, d
bind = $mod SHIFT, I, movewindow, u
bind = $mod SHIFT, N, movewindow, l
bind = $mod SHIFT, O, movewindow, r
bind = $mod SHIFT, down, movewindow, d
bind = $mod SHIFT, up, movewindow, u
bind = $mod SHIFT, left, movewindow, l
bind = $mod SHIFT, right, movewindow, r
bind = $mod CTRL, E, cyclenext
bind = $mod CTRL, I, cyclenext, prev
bind = $mod CTRL, N, movetoworkspace, r-1 # r for current monitor
bind = $mod CTRL, O, movetoworkspace, r+1
bind = $mod CTRL, left, movetoworkspace, -1
bind = $mod CTRL, right, movetoworkspace, +1
bind = $mod, 1, workspace, 1
bind = $mod, 2, workspace, 2
bind = $mod, 3, workspace, 3
bind = $mod, 4, workspace, 4
bind = $mod, 5, workspace, 5
bind = $mod, 6, workspace, 6
bind = $mod, 7, workspace, 7
bind = $mod, 8, workspace, 8
bind = $mod, 9, workspace, 9
bind = $mod, 0, workspace, 10
bind = $mod SHIFT, 1, movetoworkspace, 1
bind = $mod SHIFT, 2, movetoworkspace, 2
bind = $mod SHIFT, 3, movetoworkspace, 3
bind = $mod SHIFT, 4, movetoworkspace, 4
bind = $mod SHIFT, 5, movetoworkspace, 5
bind = $mod SHIFT, 6, movetoworkspace, 6
bind = $mod SHIFT, 7, movetoworkspace, 7
bind = $mod SHIFT, 8, movetoworkspace, 8
bind = $mod SHIFT, 9, movetoworkspace, 9
bind = $mod SHIFT, 0, movetoworkspace, 10
bind = $mod CTRL, 1, movetoworkspacesilent, 1
bind = $mod CTRL, 2, movetoworkspacesilent, 2
bind = $mod CTRL, 3, movetoworkspacesilent, 3
bind = $mod CTRL, 4, movetoworkspacesilent, 4
bind = $mod CTRL, 5, movetoworkspacesilent, 5
bind = $mod CTRL, 6, movetoworkspacesilent, 6
bind = $mod CTRL, 7, movetoworkspacesilent, 7
bind = $mod CTRL, 8, movetoworkspacesilent, 8
bind = $mod CTRL, 9, movetoworkspacesilent, 9
bind = $mod CTRL, 0, movetoworkspacesilent, 10
# }}}
# TODO (to work on) {{{
# bindl=, switch:on:Lid Switch, exec, hyprctl keyword monitor eDP-1, disable
# bindl=, switch:off:Lid Switch, exec, hyprctl keyword monitor eDP-1, preferred, auto, 1
#bindl=, switch:Lid Switch, exec, swaylock -C ~/.config/hypr/other/swaylock.conf
# }}}

View File

@ -0,0 +1,2 @@
monitor = eDP-1, preferred, 0x0, 1
monitor =, disable

View File

@ -0,0 +1,42 @@
#monitor = eDP-1, disable
#monitor =, preferred, auto, 1
source = ~/.config/hypr/displays.conf
source = ~/.config/hypr/binds.conf
source = ~/.config/hypr/variables.conf
source = ~/.config/hypr/rules.conf
exec-once = hyprpaper
exec-once = gammastep -m wayland -PO 4000
exec-once = /usr/lib/polkit-kde-authentication-agent-1 # asking for a password whenever an app wants to elevate it's privileges
exec-once = swayidle -w -C ~/.config/hypr/other/swayidle.conf
exec-once = waybar
# exec-once = ~/.config/hypr/scripts/check_displays.sh
# uncomment if apps take too long to open:
#exec-once = dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP
#exec-once = ~/.config/hypr/scripts/xdph.sh
env = XCURSOR_SIZE,24
env = ANKI_WAYLAND,1
env = GDK_BACKEND,wayland #,x11
env = SDL_VIDEODRIVER,wayland
env = CLUTTER_BACKEND,wayland
#env = XDG_SESSION_TYPE,wayland
#env = XDG_CURRENT_DESKTOP,Hyprland
#env = XDG_SESSION_DESKTOP,Hyprland
env = QT_QPA_PLATFORM,wayland #;xcb
env = QT_AUTO_SCREEN_SCALE_FACTOR,1 # enable auto scaling, depening on dpi
env = QT_WAYLAND_DISABLE_WINDOWDECORATION,1
env = QT_QPA_PLATFORMTHEME,qt5ct
env = ELECTRON_OZONE_PLATFORM_HINT,wayland
#env = _JAVA_AWT_WM_NONREPARENTING,1 # if a Java app starts with a blank screen
# NONE=-1 WARNING=0 INFO=1 HINT=2 ERROR=3 CONFUSED=4 OK=5
exec = hyprctl notify -1 1000 "rgb(00ff00)" "Config applied"

View File

@ -0,0 +1,4 @@
ipc = off # battery!
splash = false
preload = ~/.walls/wall3
wallpaper =, ~/.walls/wall3

View File

@ -0,0 +1,6 @@
timeout 1200 'hyprctl notify -1 5000 "rgb(ff0000)" ". ."' resume 'hyprctl notify 5 2000 "rgb(00ff00)" ""'
timeout 1206 'swaylock -C ~/.config/hypr/other/swaylock.conf'
timeout 1216 'hyprctl dispatch dpms off' resume 'hyprctl dispatch dpms on'
timeout 2400 'systemctl suspend'
before-sleep 'swaylock -C ~/.config/hypr/other/swaylock.conf'

View File

@ -0,0 +1,9 @@
# flags
daemonize
ignore-empty-password
#no-unlock-indicator
# params
#image=~/Pictures/wallpaper.jpg
#scaling=fill
color=446666

52
.config/hypr/rules.conf Normal file
View File

@ -0,0 +1,52 @@
#https://wiki.hyprland.org/Configuring/Window-Rules/
#https://wiki.hyprland.org/Configuring/Workspace-Rules/
#workspace = 1, monitor:HDMI-A-1
#workspace = 2, monitor:HDMI-A-1
#workspace = 3, monitor:HDMI-A-1
#workspace = 4, monitor:HDMI-A-1
#workspace = 5, monitor:eDP-1
windowrulev2 = monitor 1, class:Liftoff.*
windowrulev2 = workspace 10, class:Liftoff.*
windowrulev2 = immediate, class:Liftoff.*
windowrulev2 = fullscreen, class:Liftoff.*
windowrulev2 = monitor 1, initialTitle:Minecraft.*
windowrulev2 = workspace 10, initialTitle:Minecraft.*
windowrulev2 = immediate, initialTitle:Minecraft.*
windowrulev2 = fullscreen, initialTitle:Minecraft.*
workspace = 10, border:false, rounding:false
workspace = w[tv1], gapsout:0, gapsin:0
workspace = f[1], gapsout:0, gapsin:0
windowrulev2 = bordersize 0, floating:0, onworkspace:w[tv1]
windowrulev2 = rounding 0, floating:0, onworkspace:w[tv1]
windowrulev2 = bordersize 0, floating:0, onworkspace:f[1]
windowrulev2 = rounding 0, floating:0, onworkspace:f[1]
# windowrulev2 = float, class:^(LibreWolf)$
windowrulev2 = float, class:^(Bitwarden)$
windowrulev2 = float, class:^(cmst)$
windowrulev2 = float, class:^(nemo)$
windowrulev2 = float, class:^(qt5ct)$
#windowrulev2 = float, class:^(Logseq)$
#windowrulev2 = float, class:^(obsidian)$
windowrulev2 = float, class:^(waypaper)$
windowrulev2 = float, class:^(nwg-look)$
windowrulev2 = float, class:^(wdisplays)$
windowrulev2 = float, class:^(VirtualBox)$
windowrulev2 = float, class:^(pavucontrol)$
windowrulev2 = float, class:^(connman-gtk)$
windowrulev2 = float, class:^(boulder_dash)$
windowrulev2 = float, class:^(blueman-manager)$
windowrulev2 = float, class:^(org.gnome.Software)$
windowrulev2 = float, class:^(nm-connection-editor)$
#windowrulev2 = float, class:^(org.qbittorrent.qBittorrent)$
windowrulev2 = float, class:^(org.kde.polkit-kde-authentication-agent-1)$
windowrulev2 = float, class:^(org.telegram.desktop|telegramdesktop)$, title:^(Media viewer)$
windowrulev2 = workspace 4 silent, class:^(discord)$
windowrulev2 = workspace 4 silent, class:^(org.telegram.desktop)$

View File

@ -0,0 +1,8 @@
#!/usr/bin/bash
while [ 1 ]; do
if [[ $(hyprctl monitors) = *HEADLESS* ]]; then
~/.config/hypr/scripts/displays.sh eDP-1 ''
fi
sleep 1
done

View File

@ -0,0 +1,27 @@
#!/usr/bin/bash
for MON in "$@";
do
if [[ ${MON::1} == '-' ]]; then
STR+="monitor =${MON:1}, disable\n"
else
hyprctl keyword "monitor $MON,prefferred,auto,1"
STR+="monitor = $MON, preferred, auto, 1\n"
fi
done
if [[ $1 ]]; then STR=${STR/auto/0x0}; fi
sleep 2
printf "$STR" > ~/.config/hypr/displays.conf
if [[ $(hyprctl getoption misc:disable_autoreload) =~ int:\ 1 ]];
then hyprctl reload; fi
# Restart programs that have issues
sleep 2
hyprctl dispatch -- exec "killall gammastep && gammastep -m wayland -PO 4000"
hyprctl dispatch -- exec "killall hyprpaper && hyprpaper"
hyprctl dispatch -- exec "killall waybar && waybar"
hyprctl notify 5 1500 "rgb(aa44ff)" " displays"

View File

@ -0,0 +1,11 @@
#!/usr/bin/bash
# I have no idea what is this script
grim -s1 -t png -l0 -o "$(hyprctl activeworkspace | grep -Po '(?<=\d\) on monitor ).*?(?=:)')" /tmp/screenshot.png
hyprctl dispatch workspace 11
swayimg -n /tmp/screenshot.png &
IMG_PID=$!
sleep 0.2; hyprctl dispatch fullscreen
convert -crop $(slurp -odw 2 -B 00000000 -b 00000000 -s 00000000 -c 88CCFF -f "%wx%h+%X+%Y") /tmp/screenshot.png - | wl-copy -t image/png
hyprctl dispatch workspace previous
kill $IMG_PID

11
.config/hypr/scripts/xdph.sh Executable file
View File

@ -0,0 +1,11 @@
#!/usr/bin/bash
sleep 1
killall -e xdg-desktop-portal-hyprland
killall -e xdg-desktop-portal-wlr
killall xdg-desktop-portal
/usr/lib/xdg-desktop-portal-hyprland &
hyprctl notify -1 2000 "rgb(00ffff)" "XDPH"
sleep 2
/usr/lib/xdg-desktop-portal &
hyprctl notify -1 1000 "rgb(00ffff)" "XDP"

244
.config/hypr/variables.conf Normal file
View File

@ -0,0 +1,244 @@
# vim:foldmethod=marker
# https://wiki.hyprland.org/Configuring/Variables/
ecosystem {
no_update_news = true
}
general { # {{{
border_size = 1
no_border_on_floating = false
gaps_in = 0 #4
gaps_out = 0, 0, 0, 0
#col.inactive_border = rgb(4499bb)
#col.active_border = rgb(44ffaa) rgba(00000000) rgb(44ffaa) 145deg
#col.inactive_border = rgb(bb0055)
col.inactive_border = rgb(44aaaa)
col.active_border = rgb(ff00ff)
#col.group_border = rgb(6666bb)
#col.group_border_active = rgb(00ddcc)
#col.group_border_locked = rgb(994444)
#col.group_border_locked_active = rgb(dd88dd)
# cursor_inactive_timeout = 0 # hide cursor after
# no_cursor_warps = false # false = move cursor on focusing
no_focus_fallback = false
# apply_sens_to_raw = false
resize_on_border = true
extend_border_grab_area = 5
hover_icon_on_border = false
allow_tearing = true
layout = master
} # }}}
dwindle { # {{{
pseudotile = false
force_split = 2 # 0->follows mouse, 1->left or top, 2->right or bottom
preserve_split = true
smart_split = false
smart_resizing = false
permanent_direction_override = true
special_scale_factor = 1
split_width_multiplier = 1
# no_gaps_when_only = 1
use_active_for_splits = true
default_split_ratio = 1 # 0.1 - 1.9 1=50/50
} # }}}
master { # {{{
allow_small_split = true
special_scale_factor = 1
mfact = 0.5 #0-1
# new_is_master = false
new_on_top = false
# no_gaps_when_only = 1 # 0, 1-no border, 2-border
orientation = left
inherit_fullscreen = true
# always_center_master = false
smart_resizing = true
} # }}}
decoration { # {{{
#rounding = 8
active_opacity = 1.0
inactive_opacity = 1.0
fullscreen_opacity = 1.0
blur {
enabled = true
size = 3
passes = 1
ignore_opacity = false # make the blur layer ignore the opacity of the window
new_optimizations = true
xray = false
noise = 0 #0-1
contrast = 1.45 #0-2
brightness = 0.8 #0-2
special = false
}
# drop_shadow = false
# shadow_range = 4
# shadow_render_power = 3
# shadow_ignore_window = true
# shadow_offset = [0, 0]
# shadow_scale = 1.0
# col.shadow = rgba(1a1a1aee)
# col.shadow_inactive = rgba(1a1a1aee)
dim_inactive = false
dim_strength = 0.2
dim_special = 0
dim_around = 0.4
#screen_shader = [[Empty]]
} # }}}
animations { # {{{
enabled = false # animations actually look better that way
#bezier = linear, 0, 0, 0, 0
#bezier = bop, 1, 1, 0, 1 # custom
#bezier = eob, 0.34, 1.56, 0.64, 1 # easeOutBack
#animation = workspaces, 1, 2, bop, slidevert
#animation = windowsIn, 1, 1, bop, popin 95%
#animation = windowsOut, 1, 8, linear, slide
#animation = border, 1, 2, linear
#animation = borderangle, 1, 50, linear, loop
#animation = global, 0 #, 1, linear
#animation = windows, 0 #, 1, linear
#animation = fade, 0 #, 1, linear
#animation = windowsMove, 0 #, 1, linear
#animation = specialWorkspace, 0 #, 1, linear
#animation = fadeIn
#animation = fadeOut
#animation = fadeSwitch
#animation = fadeShadow
#animation = fadeDim
} # }}}
input { # {{{
#kb_model
kb_layout = us,ua
kb_variant = colemak,
kb_options = altwin:swap_lalt_lwin, grp:win_space_toggle, grp_led:caps, shift:both_capslock_cancel
#kb_rules
#kb_file
numlock_by_default = false
repeat_rate = 30
repeat_delay = 300
sensitivity = 0.5 # -1.0 to 1.0
accel_profile = flat
force_no_accel = false
left_handed = false
scroll_method = 2fg
scroll_button = 0
scroll_button_lock = 1 # something i don't use
natural_scroll = false
follow_mouse = 1 # 0 - Cursor movement will not change focus. 1 - Cursor movement will always change focus to the window under the cursor. 2 - Cursor focus will be detached from keyboard focus. Clicking on a window will move keyboard focus to that window. 3 - Cursor focus will be completely separate from keyboard focus. Clicking on a window will not change keyboard focus.
mouse_refocus = true # don't let mouse moves on window to steal focus back from new opened window unless the mouse crosses the border or the old window is clicked
float_switch_override_focus = 1 #???
touchpad {
disable_while_typing = false
natural_scroll = true
scroll_factor = 1.1
middle_button_emulation = false
clickfinger_behavior = false
tap-to-click = true
tap_button_map = lrm
drag_lock = false
tap-and-drag = true
}
#touchdevice {
# transform = 0
# #output
#}
}
device {
name = logitech-g102-prodigy-gaming-mouse,
sensitivity = 0.5
}
device {
name = at-translated-set-2-keyboard # Ctrl, AltGr, Win, Space, AltR, Ctrl; Shift+Shift for CAPS
kb_options = altwin:swap_lalt_lwin, grp:win_space_toggle, grp_led:caps, shift:both_capslock_cancel
} # }}}
gestures { # {{{
workspace_swipe = false
#workspace_swipe_fingers = 3
#workspace_swipe_distance = 150
#workspace_swipe_invert = true
#workspace_swipe_min_speed_to_force = 30
#workspace_swipe_cancel_ratio = 0.5
#workspace_swipe_create_new = true
#workspace_swipe_forever = false
#workspace_swipe_numbered = false
#workspace_swipe_use_r = false
} # }}}
misc { # {{{
disable_hyprland_logo = true
disable_splash_rendering = true
force_default_wallpaper = 1
#force_hypr_chan = true
vfr = true # good for battery, variable frame rate
vrr = 0 # adaptive sync, change refresh rate of display, 0 - off, 1 - on, 2 - fullscreen only
mouse_move_enables_dpms = true
key_press_enables_dpms = true
always_follow_on_dnd = true
layers_hog_keyboard_focus = true
animate_manual_resizes = false
animate_mouse_windowdragging = false
disable_autoreload = false #! set to true for battery
enable_swallow = false
#swallow_regex
#swallow_exception_regex
focus_on_activate = false
# no_direct_scanout = true
# hide_cursor_on_touch = true
mouse_move_focuses_monitor = true
render_ahead_of_time = false
render_ahead_safezone = 1
# cursor_zoom_factor = 1.0
# cursor_zoom_rigid = false
allow_session_lock_restore = true
#group_insert_after_current = true # insert new windows after current
#group_focus_removed_window = true
#groupbar_scrolling = true
#render_titles_in_groupbar = true
#groupbar_titles_font_size = 24
#groupbar_gradients = false
#groupbar_text_color = rgb(FFFFFF)
background_color = rgb(000000)
close_special_on_empty=true
new_window_takes_over_fullscreen = 2
} # }}}
binds { # {{{
pass_mouse_when_bound = false
scroll_event_delay = 300
workspace_back_and_forth = true
allow_workspace_cycles = true # false: 1331 = 1st workspace, true: 3rd
focus_preferred_method = 0
workspace_center_on = 0
ignore_group_lock = false
} # }}}
xwayland { # {{{
use_nearest_neighbor = true
force_zero_scaling = false
} # }}}
#debug { # {{{
#name description type default
#overlay print the debug performance overlay. Disable VFR for accurate results. bool false
#damage_blink (epilepsy warning!) flash areas updated with damage tracking bool false
#disable_logs disable logging bool false
#disable_time disables time logging bool true
#damage_tracking redraw only the needed bits of the display. Do not change. (default: full - 2) monitor - 1, none - 0 int 2
#enable_stdout_logs enables logging to stdout bool false
#manual_crash set to 1 and then back to 0 to crash Hyprland. int 0
#suppress_errors if true, do not display config file parsing errors. bool false
#watchdog_timeout sets the timeout in seconds for watchdog to abort processing of a signal of the main thread. Set to 0 to disable. int 5
# } # }}}

390
.config/kitty/kitty.conf Normal file
View File

@ -0,0 +1,390 @@
# vim:fileencoding=utf-8:foldmethod=marker:foldlevel=0
# Fonts {{{
font_family Hack Nerd Font Regular
bold_font Hack Nerd Font Bold
italic_font Hack Nerd Font Italic
bold_italic_font Hack Nerd Font Bold Italic
font_size 18
force_ltr yes
text_composition_strategy 1 0
disable_ligatures cursor
# font_features none
# symbol_map U+E0A0-U+E0A3,U+E0C0-U+E0C7 FONT
# narrow_symbols U+E0A0-U+E0A3,U+E0C0-U+E0C7 1
# modify_font underline_thickness 150%
# box_drawing_scale 0.001, 1, 1.5, 2
# undercurl_style thin-sparse
# }}}
# Cursor customization {{{
# cursor #cccccc
# cursor_text_color #111111
# cursor_shape block
# cursor_beam_thickness 1.5
# cursor_underline_thickness 2.0
# cursor_blink_interval -1
cursor_stop_blinking_after 10
# }}}
# Scrollback {{{
scrollback_lines 2000
# scrollback_pager less --chop-long-lines --RAW-CONTROL-CHARS +INPUT_LINE_NUMBER
scrollback_pager_history_size 100
scrollback_fill_enlarged_window yes
# wheel_scroll_multiplier 5.0
# wheel_scroll_min_lines 1
# touch_scroll_multiplier 1.0
# }}}
# Mouse {{{
# mouse_hide_wait 3.0
# url_color #0087bd
url_style straight
open_url_with default
# url_prefixes file ftp ftps gemini git gopher http https irc ircs kitty mailto news sftp ssh
# detect_urls yes
# url_excluded_characters
show_hyperlink_targets yes
copy_on_select no
# paste_actions quote-urls-at-prompt
strip_trailing_spaces always
#select_by_word_characters @-./_~?&=%+#
select_by_word_characters_forward -_
click_interval 0.5
focus_follows_mouse no
# pointer_shape_when_grabbed arrow
# default_pointer_shape beam
# pointer_shape_when_dragging beam
# Mouse actions {{{
clear_all_mouse_actions yes
mouse_map left click ungrabbed mouse_handle_click selection link prompt
mouse_map shift+left click grabbed,ungrabbed mouse_handle_click selection link prompt
mouse_map ctrl+shift+left release grabbed,ungrabbed mouse_handle_click link
mouse_map ctrl+shift+left press grabbed discard_event
mouse_map middle release ungrabbed paste_from_selection
mouse_map left press ungrabbed mouse_selection normal
mouse_map ctrl+alt+left press ungrabbed mouse_selection rectangle
mouse_map left doublepress ungrabbed mouse_selection word
mouse_map left triplepress ungrabbed mouse_selection line
mouse_map ctrl+alt+left triplepress ungrabbed mouse_selection line_from_point
mouse_map right press ungrabbed mouse_selection extend
mouse_map shift+middle release ungrabbed,grabbed paste_selection
mouse_map shift+middle press grabbed discard_event
mouse_map shift+left press ungrabbed,grabbed mouse_selection normal
mouse_map ctrl+shift+alt+left press ungrabbed,grabbed mouse_selection rectangle
mouse_map shift+left doublepress ungrabbed,grabbed mouse_selection word
mouse_map shift+left triplepress ungrabbed,grabbed mouse_selection line
mouse_map ctrl+shift+alt+left triplepress ungrabbed,grabbed mouse_selection line_from_point
mouse_map shift+right press ungrabbed,grabbed mouse_selection extend
mouse_map ctrl+shift+right press ungrabbed mouse_show_command_output
# }}}
# }}}
# Performance tuning {{{
# repaint_delay 10
# input_delay 3
sync_to_monitor yes
# }}}
# Terminal bell {{{
# enable_audio_bell yes
# visual_bell_duration 0.0
# visual_bell_color #9f60ff
# window_alert_on_bell yes
bell_on_tab "!"
# command_on_bell none
# bell_path none
# linux_bell_theme __custom
# }}}
# Window layout {{{
remember_window_size no
initial_window_width 930
initial_window_height 540
enabled_layouts grid,horizontal,vertical,stack
window_resize_step_cells 2
window_resize_step_lines 1
window_border_width 1px
# draw_minimal_borders yes
# window_margin_width 0
# single_window_margin_width -1
# window_padding_width 0
# placement_strategy center
# active_border_color #77ff77
# inactive_border_color #7777ff
# bell_border_color #ff0000
# inactive_text_alpha 1.0
hide_window_decorations yes
# window_logo_path none
# window_logo_position bottom-right
# window_logo_alpha 0.5
# resize_debounce_time 0.1
# resize_draw_strategy static
# resize_in_steps no
# visual_window_select_characters 1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ
# confirm_os_window_close -1
# }}}
# Tab bar {{{
tab_bar_style custom
tab_bar_align center
tab_bar_min_tabs 2
tab_activity_symbol "!"
tab_title_max_length 50
tab_title_template "{fmt.fg.magenta}{bell_symbol}{fmt.fg.cyan}{activity_symbol}{fmt.fg._af77d7}{layout_name[0].upper()}{num_windows} {fmt.fg._8767d7}{title.split()[0]}{fmt.fg._884488}"
active_tab_title_template "{fmt.fg.magenta}{bell_symbol}{fmt.fg.cyan}{activity_symbol}{fmt.fg._e797ff}{layout_name[0].upper()}{num_windows} {fmt.fg._6fb7ff}{'/'+'/'.join(x[0] if x[0] != '.' else x[:2] for x in tab.active_wd.split('/') if x != '')} {fmt.fg._7777ff}{tab.active_exe}"
tab_powerline_style slanted
# tab_bar_edge bottom
# tab_bar_margin_width 0.0
# tab_bar_margin_height 0.0 0.0
# tab_switch_strategy previous
# tab_fade 0.25 0.5 0.75 1
# tab_separator " ┇"
# active_tab_foreground #000
# active_tab_background #e7e7ff
active_tab_font_style bold-italic
# inactive_tab_foreground #444
# inactive_tab_background #c7c7dd
# inactive_tab_font_style normal
# tab_bar_background #224
# tab_bar_margin_color #224
# }}}
# Color scheme {{{
# foreground #dddddd
# background #000000
background_opacity 0.65
# background_image none
# background_image_layout tiled
# background_image_linear no
# dynamic_background_opacity no
# background_tint 0.0
# background_tint_gaps 1.0
# dim_opacity 0.75
# selection_foreground #000000
# selection_background #fffacd
# The color table {{{
# color0 #000000
# color8 #767676
# color1 #cc0403
# color9 #f2201f
# color2 #19cb00
# color10 #23fd00
# color3 #cecb00
# color11 #fffd00
# color4 #0d73cc
# color12 #1a8fff
# color5 #cb1ed1
# color13 #fd28ff
# color6 #0dcdcd
# color14 #14ffff
# color7 #dddddd
# color15 #ffffff
# mark1_foreground black
# mark1_background #98d3cb
# mark2_foreground black
# mark2_background #f2dcd3
# mark3_foreground black
# mark3_background #f274bc
# }}}
# }}}
# Advanced {{{
# shell .
editor nvim
# close_on_child_death no
# remote_control_password
# allow_remote_control no
# listen_on none
# env
# watcher
# exe_search_path
# update_check_interval 24
# startup_session none
# clipboard_control write-clipboard write-primary read-clipboard-ask read-primary-ask
# clipboard_max_size 512
# file_transfer_confirmation_bypass
# allow_hyperlinks yes
# shell_integration enabled
# allow_cloning ask
# clone_source_strategies venv,conda,env_var,path
# term xterm-kitty
# }}}
# OS specific tweaks {{{
# wayland_titlebar_color system
# macos_titlebar_color system
# macos_option_as_alt no
# macos_hide_from_tasks no
# macos_quit_when_last_window_closed no
# macos_window_resizable yes
# macos_thicken_font 0
# macos_traditional_fullscreen no
# macos_show_window_title_in all
# macos_menubar_title_max_length 0
# macos_custom_beam_cursor no
# macos_colorspace srgb
linux_display_server auto
# }}}
# Keyboard shortcuts {{{
kitty_mod ctrl+shift
clear_all_shortcuts yes
# action_alias
# kitten_alias
# Miscellaneous {{{
map shift+space send_text all \033[32;2u
map kitty_mod+v paste_from_clipboard
map ctrl+alt+v paste_from_selection
map kitty_mod+u kitten unicode_input
map kitty_mod+c copy_to_clipboard
map kitty_mod+y open_url_with_hints
map kitty_mod+s launch firefox --search "@selection"
map ctrl+alt+s launch --stdin-source=@selection --type=tab nvim
map kitty_mod+p kitten hints --type path --program nemo
map ctrl+alt+p kitten hints --type hyperlink --program nemo
map kitty_mod+/ show_kitty_doc overview
map kitty_mod+equal change_font_size all +1.0
map kitty_mod+minus change_font_size all -1.0
map kitty_mod+backspace change_font_size all 0
map kitty_mod+g load_config_file
map ctrl+alt+g edit_config_file
map ctrl+shift+alt+g debug_config
map ctrl+shift+alt+/ clear_terminal reset active
# }}}
# Scrollback {{{
map kitty_mod+e scroll_line_down
map kitty_mod+i scroll_line_up
map ctrl+alt+e scroll_page_down
map ctrl+alt+i scroll_page_up
map ctrl+alt+down scroll_page_down
map ctrl+alt+up scroll_page_up
map ctrl+shift+alt+e scroll_end
map ctrl+shift+alt+i scroll_home
map ctrl+shift+alt+down scroll_end
map ctrl+shift+alt+up scroll_home
map kitty_mod+z scroll_to_prompt -1
map kitty_mod+x scroll_to_prompt 1
map kitty_mod+k show_scrollback
map kitty_mod+b show_last_visited_command_output
map ctrl+alt+b show_last_non_empty_command_output
# }}}
# Window management {{{
map kitty_mod+enter new_os_window
map ctrl+alt+enter new_os_window_with_cwd
map kitty_mod+w new_window
map ctrl+alt+w new_window_with_cwd
map kitty_mod+q close_window_with_confirmation
map kitty_mod+r start_resizing_window
map kitty_mod+n previous_window
map kitty_mod+o next_window
map kitty_mod+, move_window_backward
map kitty_mod+. move_window_forward
map kitty_mod+` move_window_to_top
map kitty_mod+d detach_window ask
map kitty_mod+f focus_visible_window
map kitty_mod+m swap_with_window
map kitty_mod+l next_layout
map ctrl+alt+l toggle_layout stack
map kitty_mod+1 first_window
map kitty_mod+2 second_window
map kitty_mod+3 third_window
map kitty_mod+4 fourth_window
map kitty_mod+5 fifth_window
map kitty_mod+6 sixth_window
map kitty_mod+7 seventh_window
map kitty_mod+8 eighth_window
map kitty_mod+9 ninth_window
map kitty_mod+0 tenth_window
# }}}
# Tab management {{{
map kitty_mod+t new_tab
map ctrl+alt+t new_tab_with_cwd !neighbor
map ctrl+alt+q close_tab
map ctrl+alt+n previous_tab
map ctrl+alt+o next_tab
map ctrl+alt+left previous_tab
map ctrl+alt+right next_tab
map ctrl+alt+, move_tab_backward
map ctrl+alt+. move_tab_forward
map ctrl+alt+d detach_tab ask
map ctrl+alt+r set_tab_title
map ctrl+alt+1 goto_tab 1
map ctrl+alt+2 goto_tab 2
map ctrl+alt+3 goto_tab 3
map ctrl+alt+4 goto_tab 4
map ctrl+alt+5 goto_tab 5
map ctrl+alt+6 goto_tab 6
map ctrl+alt+7 goto_tab 7
map ctrl+alt+8 goto_tab 8
map ctrl+alt+9 goto_tab 9
map ctrl+alt+0 goto_tab 10
map ctrl+alt+- goto_tab -1
map ctrl+alt+= goto_tab 100
# }}}
# Hints {{{
map kitty_mod+h>n kitten hints --type linenum nvim +{line} {path}
# paste to cmd
map kitty_mod+h>w kitten hints --type word --program -
map kitty_mod+h>l kitten hints --type line --program -
map kitty_mod+h>p kitten hints --type path --program -
map kitty_mod+h>i kitten hints --type ip --program -
map kitty_mod+h>h kitten hints --type hash --program -
# copy to clipboard
map ctrl+alt+h>w kitten hints --type word --program @
map ctrl+alt+h>l kitten hints --type line --program @
map ctrl+alt+h>p kitten hints --type path --program @
map ctrl+alt+h>i kitten hints --type ip --program @
map ctrl+alt+h>h kitten hints --type hash --program @
# }}}
# }}}

73
.config/kitty/tab_bar.py Normal file
View File

@ -0,0 +1,73 @@
# pyright: reportMissingImports=false
from kitty.fast_data_types import Screen
from kitty.tab_bar import (
DrawData,
ExtraData,
TabBarData,
as_rgb,
draw_title,
)
def draw_tab(
draw_data: DrawData,
screen: Screen,
tab: TabBarData,
before: int,
max_tab_length: int,
index: int,
is_last: bool,
extra_data: ExtraData,
) -> int:
tab_bg = screen.cursor.bg
tab_fg = screen.cursor.fg
default_bg = as_rgb(int(draw_data.default_bg))
if extra_data.next_tab:
next_tab_bg = as_rgb(draw_data.tab_bg(extra_data.next_tab))
needs_soft_separator = next_tab_bg == tab_bg
else:
next_tab_bg = default_bg
needs_soft_separator = False
separator_symbol, soft_separator_symbol = ("", "")
min_title_length = 1 + 2
start_draw = 2
if screen.cursor.x == 0:
screen.draw(" ")
start_draw = 1
if is_last:
start_draw = 1
if min_title_length >= max_tab_length:
screen.draw("")
else:
draw_title(draw_data, screen, tab, index, max_tab_length)
extra = screen.cursor.x + start_draw - before - max_tab_length
if extra > 0 and extra + 1 < screen.cursor.x:
screen.cursor.x -= extra + 1
screen.draw("")
if not needs_soft_separator:
screen.draw(" ")
screen.cursor.fg = tab_bg
screen.cursor.bg = next_tab_bg
if not is_last:
screen.draw(separator_symbol)
else:
prev_fg = screen.cursor.fg
if tab_bg == tab_fg:
screen.cursor.fg = default_bg
elif tab_bg != default_bg:
c1 = draw_data.inactive_bg.contrast(draw_data.default_bg)
c2 = draw_data.inactive_bg.contrast(draw_data.inactive_fg)
if c1 < c2:
screen.cursor.fg = default_bg
screen.draw(f" {soft_separator_symbol}")
screen.cursor.fg = prev_fg
end = screen.cursor.x
if end < screen.columns:
screen.draw(" ")
return end

View File

@ -0,0 +1 @@
--ozone-platform-hint=auto

92
.config/mako/config Normal file
View File

@ -0,0 +1,92 @@
#-------OTHER---------------------------
# pango-list
font=Hack Nerd Font Mono 13
sort=+time
# -1, all notifications
max-visible=4
# save to history buffer
max-history=10
# 0 to disabe timeout
default-timeout=5000
group-by=app-icon,app-name,summary,body,urgency
# Default: <b>%s</b>\n%b Default when grouped: (%g) <b>%s</b>\n%b
format=<b>%s</b>\n%b
#icon-path=path[:path...]
on-notify=exec mpv /usr/share/sounds/freedesktop/stereo/message.oga
on-button-left=invoke-default-action
on-button-middle=dismiss-group
on-button-right=dismiss
#-------PX------------------------------
width=400
# Max height
height=150
border-size=2
border-radius=7
# ls /usr/share/icons/hicolor/
max-icon-size=48
#-------COLOR---RRGGBB or RRGGBBAA---
background-color=#00000099
text-color=#FFFFFF
border-color=#0099FF
# over | source
progress-color=source #8866FFCC
#-------POSITION------------------------
#output=""
# background, bottom, top, overlay
layer=top
# top-{right,center,left}, bottom-{right,center,left}, center-{right,left}, center
anchor=top-right
# left|center|right
text-alignment=left
# left, right, top, bottom
icon-location=left
#-------DIRECTIONAL---------------------
outer-margin=10
# between notifications
margin=10
padding=5,0
#-------0|1-----------------------------
icons=1
# Pango markup
markup=1
# requested by applications
actions=1
# max-history param determines the amount
history=1
ignore-timeout=0
#-------MODES and CRITERIAS-------------
[mode=dnd]
invisible=1
on-notify=none
[mode=away]
on-notify=none
ignore-timeout=1
default-timeout=0
#TODO no-sound
[urgency=low]
border-color=#33CC99
[urgency=normal]
border-color=#99CCFF
[urgency=high]
border-color=#FF0066
ignore-timeout=1
default-timeout=0
# Directional values:
# A single value will apply to all four edges.
# Two values will set vertical and horizontal edges separately.
# Three will set top, horizontal, and bottom edges separately.
# Four will set top, right, bottom, and left edges separately.
# margin = 10,20,5

9
.config/mako/reload.sh Executable file
View File

@ -0,0 +1,9 @@
#!/usr/bin/env sh
makoctl reload
# to test a 'high' urgency notification add '-u critical '
notify-send -a "Test notif app" -i firefox -t 5000 "Here is some summary" "needed to <s>create</s> that script cuz /usr/bin/makoctl reload wasn't working and was preventing the notification to appear with no logs"
notify-send -a "Test notif app" -i firefox -t 5000 "1" "this is one"
notify-send -a "Test notif app" -i firefox -t 5000 "2" "this is two"
#notify-send -a "Test notif app" -i firefox -t 5000 "3" "this is three"
#notify-send -a "Test notif app" -i firefox -t 5000 "4" "this is four"

181
.config/mpv/input.conf Normal file
View File

@ -0,0 +1,181 @@
# mpv keybindings
#
# Location of user-defined bindings: ~/.config/mpv/input.conf
#
# Lines starting with # are comments. Use SHARP to assign the # key.
# Copy this file and uncomment and edit the bindings you want to change.
#
# List of commands and further details: DOCS/man/input.rst
# List of special keys: --input-keylist
# Keybindings testing mode: mpv --input-test --force-window --idle
#
# Use 'ignore' to unbind a key fully (e.g. 'ctrl+a ignore').
#
# Strings need to be quoted and escaped:
# KEY show-text "This is a single backslash: \\ and a quote: \" !"
#
# You can use modifier-key combinations like Shift+Left or Ctrl+Alt+x with
# the modifiers Shift, Ctrl, Alt and Meta (may not work on the terminal).
#
# The default keybindings are hardcoded into the mpv binary.
# You can disable them completely with: --no-input-default-bindings
# Developer note:
# On compilation, this file is baked into the mpv binary, and all lines are
# uncommented (unless '#' is followed by a space) - thus this file defines the
# default key bindings.
# If this is enabled, treat all the following bindings as default.
#default-bindings start
#MBTN_LEFT ignore # don't do anything
#MBTN_LEFT_DBL cycle fullscreen # toggle fullscreen
#MBTN_RIGHT cycle pause # toggle pause/playback mode
#MBTN_BACK playlist-prev # skip to the previous file
#MBTN_FORWARD playlist-next # skip to the next file
# Mouse wheels, touchpad or other input devices that have axes
# if the input devices supports precise scrolling it will also scale the
# numeric value accordingly
#WHEEL_UP add volume 2
#WHEEL_DOWN add volume -2
#WHEEL_LEFT seek -10 # seek 10 seconds backward
#WHEEL_RIGHT seek 10 # seek 10 seconds forward
## Seek units are in seconds, but note that these are limited by keyframes
#RIGHT seek 5 # seek 5 seconds forward
#LEFT seek -5 # seek 5 seconds backward
#UP seek 60 # seek 1 minute forward
#DOWN seek -60 # seek 1 minute backward
# Do smaller, always exact (non-keyframe-limited), seeks with shift.
# Don't show them on the OSD (no-osd).
#Shift+RIGHT no-osd seek 1 exact # seek exactly 1 second forward
#Shift+LEFT no-osd seek -1 exact # seek exactly 1 second backward
#Shift+UP no-osd seek 5 exact # seek exactly 5 seconds forward
#Shift+DOWN no-osd seek -5 exact # seek exactly 5 seconds backward
#Ctrl+LEFT no-osd sub-seek -1 # seek to the previous subtitle
#Ctrl+RIGHT no-osd sub-seek 1 # seek to the next subtitle
#Ctrl+Shift+LEFT sub-step -1 # change subtitle timing such that the previous subtitle is displayed
#Ctrl+Shift+RIGHT sub-step 1 # change subtitle timing such that the next subtitle is displayed
#Alt+left add video-pan-x 0.1 # move the video right
#Alt+right add video-pan-x -0.1 # move the video left
#Alt+up add video-pan-y 0.1 # move the video down
#Alt+down add video-pan-y -0.1 # move the video up
#Alt++ add video-zoom 0.1 # zoom in
#ZOOMIN add video-zoom 0.1 # zoom in
#Alt+- add video-zoom -0.1 # zoom out
#ZOOMOUT add video-zoom -0.1 # zoom out
#Alt+BS set video-zoom 0 ; set video-pan-x 0 ; set video-pan-y 0 # reset zoom and pan settings
#PGUP add chapter 1 # seek to the next chapter
#PGDWN add chapter -1 # seek to the previous chapter
#Shift+PGUP seek 600 # seek 10 minutes forward
#Shift+PGDWN seek -600 # seek 10 minutes backward
#[ multiply speed 1/1.1 # decrease the playback speed
#] multiply speed 1.1 # increase the playback speed
#{ multiply speed 0.5 # halve the playback speed
#} multiply speed 2.0 # double the playback speed
#BS set speed 1.0 # reset the speed to normal
#Shift+BS revert-seek # undo the previous (or marked) seek
#Shift+Ctrl+BS revert-seek mark # mark the position for revert-seek
#q quit
#Q quit-watch-later # exit and remember the playback position
#q {encode} quit 4
#ESC set fullscreen no # leave fullscreen
#ESC {encode} quit 4
#p cycle pause # toggle pause/playback mode
#. frame-step # advance one frame and pause
#, frame-back-step # go back by one frame and pause
#SPACE cycle pause # toggle pause/playback mode
#> playlist-next # skip to the next file
#ENTER playlist-next # skip to the next file
#< playlist-prev # skip to the previous file
#O no-osd cycle-values osd-level 3 1 # toggle displaying the OSD on user interaction or always
#o show-progress # show playback progress
#P show-progress # show playback progress
#i script-binding stats/display-stats # display information and statistics
#I script-binding stats/display-stats-toggle # toggle displaying information and statistics
#` script-binding console/enable # open the console
#z add sub-delay -0.1 # shift subtitles 100 ms earlier
#Z add sub-delay +0.1 # delay subtitles by 100 ms
#x add sub-delay +0.1 # delay subtitles by 100 ms
#ctrl++ add audio-delay 0.100 # change audio/video sync by delaying the audio
#ctrl+- add audio-delay -0.100 # change audio/video sync by shifting the audio earlier
#Shift+g add sub-scale +0.1 # increase the subtitle font size
#Shift+f add sub-scale -0.1 # decrease the subtitle font size
#9 add volume -2
#/ add volume -2
#0 add volume 2
#* add volume 2
#m cycle mute # toggle mute
#1 add contrast -1
#2 add contrast 1
#3 add brightness -1
#4 add brightness 1
#5 add gamma -1
#6 add gamma 1
#7 add saturation -1
#8 add saturation 1
#Alt+0 set current-window-scale 0.5 # halve the window size
#Alt+1 set current-window-scale 1.0 # reset the window size
#Alt+2 set current-window-scale 2.0 # double the window size
#d cycle deinterlace # toggle the deinterlacing filter
#r add sub-pos -1 # move subtitles up
#R add sub-pos +1 # move subtitles down
#t add sub-pos +1 # move subtitles down
#v cycle sub-visibility # hide or show the subtitles
#Alt+v cycle secondary-sub-visibility # hide or show the secondary subtitles
#V cycle sub-ass-vsfilter-aspect-compat # toggle stretching SSA/ASS subtitles with anamorphic videos to match the historical renderer
#u cycle-values sub-ass-override "force" "yes" # toggle overriding SSA/ASS subtitle styles with the normal styles
#j cycle sub # switch subtitle track
#J cycle sub down # switch subtitle track backwards
#SHARP cycle audio # switch audio track
#_ cycle video # switch video track
#T cycle ontop # toggle placing the video on top of other windows
#f cycle fullscreen # toggle fullscreen
#s screenshot # take a screenshot of the video in its original resolution with subtitles
#S screenshot video # take a screenshot of the video in its original resolution without subtitles
#Ctrl+s screenshot window # take a screenshot of the window with OSD and subtitles
#Alt+s screenshot each-frame # automatically screenshot every frame; issue this command again to stop taking screenshots
#w add panscan -0.1 # decrease panscan
#W add panscan +0.1 # shrink black bars by cropping the video
#e add panscan +0.1 # shrink black bars by cropping the video
#A cycle-values video-aspect-override "16:9" "4:3" "2.35:1" "-1" # cycle the video aspect ratio ("-1" is the container aspect)
#POWER quit
#PLAY cycle pause # toggle pause/playback mode
#PAUSE cycle pause # toggle pause/playback mode
#PLAYPAUSE cycle pause # toggle pause/playback mode
#PLAYONLY set pause no # unpause
#PAUSEONLY set pause yes # pause
#STOP quit
#FORWARD seek 60 # seek 1 minute forward
#REWIND seek -60 # seek 1 minute backward
#NEXT playlist-next # skip to the next file
#PREV playlist-prev # skip to the previous file
#VOLUME_UP add volume 2
#VOLUME_DOWN add volume -2
#MUTE cycle mute # toggle mute
#CLOSE_WIN quit
#CLOSE_WIN {encode} quit 4
#ctrl+w quit
#E cycle edition # switch edition
#l ab-loop # set/clear A-B loop points
#L cycle-values loop-file "inf" "no" # toggle infinite looping
#ctrl+c quit 4
#DEL script-binding osc/visibility # cycle OSC visibility between never, auto (mouse-move) and always
#ctrl+h cycle-values hwdec "auto-safe" "no" # toggle hardware decoding
#F8 show-text ${playlist} # show the playlist
#F9 show-text ${track-list} # show the list of video, audio and sub tracks
#
# Legacy bindings (may or may not be removed in the future)
#
#! add chapter -1 # seek to the previous chapter
#@ add chapter 1 # seek to the next chapter
#
# Not assigned by default
# (not an exhaustive list of unbound commands)
#
# ? cycle sub-forced-events-only # display only DVD/PGS forced subtitle events
# ? stop # stop playback (quit or enter idle mode)

28
.config/mpv/mpv.conf Normal file
View File

@ -0,0 +1,28 @@
volume=50
hwdec=auto
ytdl-format=bestvideo[height<=?1080][vcodec!=?av01]+bestaudio/best
sub-pos=20
# sub-visibility=yes
# sub-auto=fuzzy
# alang=jpn
# slang=jpn
# audio-file-auto=fuzzy
# save-position-on-quit=yes
# autofit-larger=100%x100%
# geometry=50%:50%
# sid=10,1
# ontop
# osd-on-seek=no
# cache-pause
# cache=yes
# demuxer-max-back-bytes=500000MiB
# demuxer-max-bytes=500000MiB
# force-seekable=yes
# keep-open=yes
# script-opts=ytdl_hook-ytdl_path=yt-dlp
# #Basic quality profile which sets some settings (Highly recommended)
# profile=gpu-hq
# #Higher value means better quality
# screenshot-jpeg-quality=95

22
.config/nvim/README.md Normal file
View File

@ -0,0 +1,22 @@
_This is **my** configuration of Neovim._
- Fast -- Startup is < 20ms, using it as a `$MANPAGER` after all
- Minimal -- _Text Editor just text editor Please [dont't](https://github.com/glepnir/nvim) do no more_
- Different -- Did some sketchy stuff here and there
## Structure
- **init.lua**: Pull _The stuff_ together (or don't when opening GPG files)
- **lua/**: _The stuff_
- **gpg.lua**: Futile attempts to safely edit [(un)safe GPG encrypted](https://www.latacora.com/blog/2019/07/16/the-pgp-problem/) files
- **utils.lua**: Useful functions used throughout the config
- **options.lua**
- **autocmds.lua**
- **mappings.lua**: Deferred loading cuz there is too much '>.<
- **playground.lua**: Useful functions which are... well... not very useful
- **plugins/**: Plugin specs which are autosourced (and cached!) by Lazy.nvim
- **configs/**: Large parts of plugin specs separated from **plugins/** to load faster
---
> _Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away._
― Antoine de Saint-Exupéry

View File

@ -0,0 +1,26 @@
{
"Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" },
"LuaSnip": { "branch": "master", "commit": "c9b9a22904c97d0eb69ccb9bab76037838326817" },
"cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" },
"cmp-nvim-lsp": { "branch": "main", "commit": "a8912b88ce488f411177fc8aed358b04dc246d7b" },
"cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" },
"cyberdream.nvim": { "branch": "main", "commit": "4aa7c64b0b18a542d6587632efa93c3bea469979" },
"friendly-snippets": { "branch": "main", "commit": "fc8f183479a472df60aa86f00e295462f2308178" },
"gitsigns.nvim": { "branch": "main", "commit": "9cd665f46ab7af2e49d140d328b8e72ea1cf511b" },
"harpoon": { "branch": "harpoon2", "commit": "ed1f853847ffd04b2b61c314865665e1dadf22c7" },
"lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "1a31f824b9cd5bc6f342fc29e9a53b60d74af245" },
"mason.nvim": { "branch": "main", "commit": "fc98833b6da5de5a9c5b1446ac541577059555be" },
"nvim-cmp": { "branch": "main", "commit": "b5311ab3ed9c846b585c0c15b7559be131ec4be9" },
"nvim-lspconfig": { "branch": "master", "commit": "2e3f389aa06c7b7c29600ec2e67ee64c332077eb" },
"nvim-treesitter": { "branch": "master", "commit": "3b308861a8d7d7bfbe9be51d52e54dcfd9fe3d38" },
"nvim-treesitter-textobjects": { "branch": "master", "commit": "ed373482db797bbf71bdff37a15c7555a84dce47" },
"nvim-web-devicons": { "branch": "master", "commit": "50b5b06bff13a9b4eab946de7c7033649a6618a1" },
"onedark.nvim": { "branch": "master", "commit": "0e5512d1bebd1f08954710086f87a5caa173a924" },
"plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" },
"telescope-fzf-native.nvim": { "branch": "main", "commit": "1f08ed60cafc8f6168b72b80be2b2ea149813e55" },
"telescope.nvim": { "branch": "0.1.x", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" },
"tokyonight.nvim": { "branch": "main", "commit": "057ef5d260c1931f1dffd0f052c685dcd14100a3" },
"vim-startuptime": { "branch": "master", "commit": "b6f0d93f6b8cf6eee0b4c94450198ba2d6a05ff6" },
"which-key.nvim": { "branch": "main", "commit": "370ec46f710e058c9c1646273e6b225acf47cbed" }
}

View File

@ -0,0 +1,21 @@
vim.api.nvim_create_autocmd("TextYankPost", {
callback = function() vim.highlight.on_yank() end
})
-- Doesn't trigger for manpages
vim.api.nvim_create_autocmd({ "BufReadPost", "BufWritePost", "BufNewFile" }, {
callback = vim.schedule_wrap(function()
vim.api.nvim_exec_autocmds("User", { pattern = "LazyFile" })
vim.schedule_wrap(vim.api.nvim_exec_autocmds)("User", { pattern = "VeryLazyFile" })
end)
})
vim.api.nvim_create_autocmd("LspAttach", { -- Overrides the default keymaps
callback = function(args)
vim.bo[args.buf].omnifunc = "v:lua.vim.lsp.omnifunc" -- <c-x><c-o>
vim.keymap.set("n", "gd", vim.lsp.buf.definition, { buffer = args.buf })
vim.keymap.set("n", "gD", vim.lsp.buf.declaration, { buffer = args.buf })
end
})
--vim.api.nvim_create_autocmd("CursorHold", { callback = lsp.document_highlight })
--vim.api.nvim_create_autocmd("CursorMoved", { callback = lsp.clear_references })

View File

@ -0,0 +1,191 @@
local cmp = require "cmp"
local luasnip = require "luasnip"
local kinds = {
Enum = " Enum",
File = " File",
Text = " Text",
Unit = "󰑭 Unit",
Class = " Class",
Color = " Color",
Event = " Event",
Field = " Field",
Value = "󰎠 Value",
Folder = " Path",
Method = " Methd",
Module = " Modle",
Struct = "󰙅 Strct",
Keyword = "󰌋 Kword",
Snippet = " Snipp",
Constant = "󰏿 Const",
Function = "󰊕 Func",
Operator = " Oper",
Property = " Prop",
Variable = " Var",
Interface = " Itrfc",
Reference = "󰈇 Rfrnc",
EnumMember = " EnMem",
Constructor = "🏗 Cstctr",
TypeParameter = " TpPrm",
}
local function format_completion_entries(entry, vim_item) -- :h complete-items
vim_item.menu = ({
buffer = "[Buf]",
luasnip = "[LS]",
nvim_lsp = "[LSP]",
})[entry.source.name]
vim_item.kind = kinds[vim_item.kind] or "?"
return vim_item
end
-- Close the damn completion window
local function exit_completion()
vim.api.nvim_feedkeys("gi", "n", false)
end
local function register_oneshots()
for _, key in ipairs { "<CR>", "<Tab>", "<Space>", "<Down>", "<Up>", "<Left>", "<Right>" } do
vim.keymap.set("i", key, function()
exit_completion()
vim.keymap.del("i", key, { buffer = 0 })
return key
end, { buffer = 0, expr = true })
end
end
local function get_completion_buffers()
local buffers = {}
for _, win_id in ipairs(vim.api.nvim_list_wins()) do -- only visible buffers
local buf_id = vim.api.nvim_win_get_buf(win_id)
local buf_lines = vim.api.nvim_buf_line_count(buf_id)
local buf_bytes = vim.api.nvim_buf_get_offset(buf_id, buf_lines)
if buf_bytes < 196608 then -- 192 KiB
table.insert(buffers, buf_id)
end
end
return buffers
end
-- TODO use most common instead of just common
local function longest_common_completion()
cmp.complete { config = { -- should be fast asf
sources = {
{ name = "buffer", option = {
get_bufnrs = get_completion_buffers } },
-- { name = "nvim_lsp" }, -- there is other completion for lsp
},
performance = {
throttle = 0,
debounce = 15,
max_view_entries = 10,
fetching_timeout = 100
},
preselect = cmp.PreselectMode.None, -- not to mess up common_string
formatting = { format = false }
} }
return cmp.complete_common_string()
end
local mappings = {
["<C-n>"] = cmp.mapping.scroll_docs(4),
["<C-e>"] = cmp.mapping.scroll_docs(-4),
-- in my kitty.conf: map shift+space send_text all \033[32;2u
["<S-Space>"] = cmp.mapping.select_next_item(),
["<C-Space>"] = cmp.mapping.select_prev_item(),
["<S-Tab>"] = function()
if cmp.visible_docs() then
cmp.close_docs()
else
cmp.open_docs()
end
end,
-- My Caps is BS cuz caps is bs.
["<S-BS>"] = cmp.mapping(function()
if cmp.visible() then
exit_completion()
else
luasnip.expand_or_jump()
end
end, { "i", "s" }),
["<C-BS>"] = cmp.mapping(function()
if cmp.visible() then
cmp.abort()
exit_completion()
else
luasnip.jump(-1)
end
end, { "i", "s" }),
["<S-CR>"] = function()
if cmp.visible() then
cmp.confirm { select = true, behavior = cmp.ConfirmBehavior.Replace }
elseif cmp.complete() then
register_oneshots()
end
end,
["<C-CR>"] = function()
if cmp.visible() then
cmp.confirm { select = true, behavior = cmp.ConfirmBehavior.Insert }
elseif longest_common_completion() then
exit_completion()
else
register_oneshots()
end
end
}
cmp.setup.global { -- = cmp.setup
completion = {
autocomplete = false,
completeopt = "menu,menuone,noselect" -- noselect for complete_common_string
},
performance = {
--debounce = 60,
throttle = 15, -- 30
--fetching_timeout = 500,
max_view_entries = 40, -- 200
},
mapping = mappings,
preselect = cmp.PreselectMode.Item, -- Honour LSP preselect requests
--experimental = { ghost_text = true }
snippet = {
expand = function(args) luasnip.lsp_expand(args.body) end
},
formatting = {
expandable_indicator = true, -- show ~ indicator
fields = { "abbr", "kind", "menu" },
format = format_completion_entries,
},
view = {
docs = { auto_open = true },
entries = { name = "custom", selection_order = "near_cursor" }
},
sources = {
{ name = "nvim_lsp", group_index = 1 },
{ name = "luasnip", group_index = 2 },
{ name = "buffer", group_index = 2, option = {
indexing_interval = 100, -- default 100 ms
indexing_batch_size = 500, -- default 1000 lines
max_indexed_line_length = 2048, -- default 40*1024 bytes
get_bufnrs = get_completion_buffers
} }
},
window = {
completion = cmp.config.window.bordered {
side_padding = 0,
scrollbar = false,
border = vim.g.border_bleed
},
documentation = cmp.config.window.bordered {
side_padding = 0,
border = vim.g.border_bleed
}
}
}

View File

@ -0,0 +1,63 @@
local gs = require "gitsigns"
gs.setup {
auto_attach = true,
attach_to_untracked = false, -- use keymap
max_file_length = 10000,
update_debounce = 500,
-- base = "@", -- index by default
-- worktrees = {}, -- TODO for dotfiles
numhl = true,
signcolumn = false,
current_line_blame = false,
sign_priority = 6,
diff_opts = {
internal = true, -- for linematch
linematch = true, -- align lines
algorithm = "histogram", -- myers, minimal, patience, histrogram
},
preview_config = { border = vim.g.border_bleed },
}
-- Normal
Lmap("hb", "Blame line", gs.blame_line)
Lmap("hB", "Blame full", W(gs.blame_line) { full = true })
Lmap("hs", "Stage hunk", gs.stage_hunk)
Lmap("hr", "Reset hunk", gs.reset_hunk)
Lmap("hS", "Stage buffer", gs.stage_buffer)
Lmap("hR", "Reset buffer", gs.reset_buffer)
Lmap("hu", "Undo stage hunk", gs.undo_stage_hunk) -- only in current session
Lmap("hp", "Preview hunk", gs.preview_hunk)
Lmap("hi", "Inline preview", gs.preview_hunk_inline)
Lmap("hl", "List hunks", gs.setloclist)
Lmap("hq", "Qlist all hunks", W(gs.setqflist) "attached")
Lmap("hQ", "Qlist ALL hunks", W(gs.setqflist) "all")
Lmap("hs", "x", "Stage region", function() gs.stage_hunk { vim.fn.line ".", vim.fn.line "v" } end)
Lmap("hr", "x", "Reset region", function() gs.reset_hunk { vim.fn.line ".", vim.fn.line "v" } end)
-- Toggle
Lmap("hts", "Signs", gs.toggle_signs)
Lmap("htn", "Number hl", gs.toggle_numhl)
Lmap("htl", "Line hl", gs.toggle_linehl)
Lmap("htd", "Deleted", gs.toggle_deleted)
Lmap("htw", "Word diff", gs.toggle_word_diff)
Lmap("htb", "Blame", gs.toggle_current_line_blame)
-- View file
Lmap("hvh", "HEAD", W(gs.show) "@")
Lmap("hvp", "HEAD~", W(gs.show) "~")
Lmap("hvs", "Staged", gs.show)
Lmap("hvH", "Diff HEAD", W(gs.diffthis, "@", { split = "belowright" }))
Lmap("hvP", "Diff HEAD~", W(gs.diffthis, "~", { split = "belowright" }))
Lmap("hvS", "Diff Staged", W(gs.diffthis, nil, { split = "belowright" }))
-- Control
Lmap("hca", "Attach", gs.attach)
Lmap("hcd", "Detach", gs.detach)
Lmap("hcD", "Detach all", gs.detach_all)
Lmap("hcr", "Refresh", gs.refresh)
Lmap("hcs", "Base->staged", gs.change_base)
Lmap("hcS", "Base->staged all", W(gs.change_base, nil, true))
Lmap("hch", "Base->HEAD", W(gs.change_base) "@")
Lmap("hcH", "Base->HEAD all", W(gs.change_base, "@", true))
-- Other
vim.keymap.set({"x", "o"}, "ih", gs.select_hunk, { desc = "Select hunk" })
MakePair("h", "hunk", gs.next_hunk, gs.prev_hunk)

View File

@ -0,0 +1,30 @@
local lspconfig = require "lspconfig"
vim.diagnostic.config {
underline = true,
virtual_text = {
spacing = 4,
source = "if_many",
severity = { min = vim.diagnostic.severity.WARN },
},
-- virtual_lines = true,
severity_sort = true,
update_in_insert = false,
signs = { text = { "", "!", "󰙎", "󱠃" } }, -- E, W, I, H
float = { source = "if_many", border = vim.g.border_bleed },
}
lspconfig.util.default_config = vim.tbl_deep_extend("force", lspconfig.util.default_config, {
handlers = {
["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, {
border = vim.g.border_bleed, max_width = 80
}),
["textDocument/signatureHelp"] = vim.lsp.with(vim.lsp.handlers.signature_help, {
border = vim.g.border_bleed, max_width = 80
})
},
capabilities = pcall(require, "cmp_nvim_lsp") and
package.loaded.cmp_nvim_lsp.default_capabilities() or nil
})
require("lspconfig.ui.windows").default_options.border = vim.g.border -- :LspInfo

View File

@ -0,0 +1,94 @@
local telescope = require "telescope"
local builtin = require "telescope.builtin"
local layout = require "telescope.actions.layout"
--local actions = require "telescope.actions"
telescope.setup {
defaults = {
layout_strategy = "flex",
--preview = { hide_on_startup = true, filesize_limit = 0.1 --MB },
layout_config = {
vertical = { width = 0.9, height = 0.9 },
horizontal = { width = 0.9, height = 0.7 },
},
cycle_layout_list = { "vertical", "horizontal" },
-- borderchars = { "▔", "▕", "▁", "▏", "🭽", "🭾", "🭿", "🭼" },
path_display = { shorten = { len = 1, exclude = { -1 } } },
vimgrep_arguments = { -- live_grep & grep_string
"rg", "--color=never", "--no-heading", "--with-filename",
"--line-number", "--column", "--smart-case", "--trim" -- trim spaces
},
mappings = {
i = {
["<Esc>"] = "close",
["<C-d>"] = "delete_buffer", -- for buffers
["<C-h>"] = "select_horizontal", -- H| split
["<C-p>"] = layout.toggle_preview,
["<C-r>"] = layout.cycle_layout_next,
["<C-s>"] = "cycle_previewers_next", -- for git commits
["<C-a>"] = "cycle_previewers_prev",
["<C-n>"] = "preview_scrolling_down",
["<C-e>"] = "preview_scrolling_up",
["<C-Down>"] = "cycle_history_next",
["<C-Up>"] = "cycle_history_prev",
},
}
},
extensions = {
fzf = {
fuzzy = true,
override_generic_sorter = true,
override_file_sorter = true,
case_mode = "smart_case",
}
}
}
telescope.load_extension("fzf")
local which_key = package.loaded["which-key"]
if which_key then
which_key.add({
{ "<Leader>s", group = "Search" },
{ "<Leader>sh", group = "Git" },
{ "<Leader>sl", group = "LSP" },
})
end
Lmap("f", Try(builtin.git_files, builtin.find_files))
Lmap(".", function() builtin.find_files { cwd = vim.fn.expand("%:p:h") } end)
Lmap("/", builtin.current_buffer_fuzzy_find)
Lmap("so", builtin.oldfiles)
Lmap("sb", "Buffers", builtin.buffers)
Lmap("sf", "Files workdir", builtin.find_files)
Lmap("sn", "Nvim dotfiles", W(builtin.find_files) { cwd = vim.fn.expand("~/.config/nvim") })
Lmap("s.", "Dotfiles", W(builtin.find_files) { cwd = vim.fn.expand("~/.config/") })
Lmap("sd", "Diagnostics", builtin.diagnostics)
Lmap("ss", "Str in workdir", builtin.live_grep)
Lmap("sk", "Help tags", builtin.help_tags)
Lmap("sm", "Man pages", builtin.man_pages)
Lmap("s/", "/ history", builtin.search_history)
Lmap("sq", "Quickfix hist", builtin.quickfixhistory)
Lmap("sc", "nx", "Cursor workdir", builtin.grep_string)
Lmap("sp", "Pickers", builtin.pickers)
Lmap("sr", "Resume", builtin.resume)
Lmap("st", "Treesitter obj", builtin.treesitter)
-- Git
Lmap("shf", "Files", builtin.git_files)
Lmap("shs", "Status", builtin.git_status)
Lmap("shc", "Commits", builtin.git_commits)
Lmap("shB", "Branches", builtin.git_branches)
Lmap("shb", "Buf commits", builtin.git_bcommits)
-- LSP
Lmap("sld", "Definitions", builtin.lsp_definitions)
Lmap("slt", "Type defenitions", builtin.lsp_type_definitions)
Lmap("slr", "References", builtin.lsp_references)
Lmap("sli", "Incoming calls", builtin.lsp_incoming_calls)
Lmap("slo", "Outgoing calls", builtin.lsp_outgoing_calls)
Lmap("slm", "Implementations", builtin.lsp_implementations)
Lmap("sls", "Buffer symbols", builtin.lsp_document_symbols)
Lmap("slW", "Workspace symbols", builtin.lsp_workspace_symbols)
Lmap("slw", "Workspace dynamic", builtin.lsp_dynamic_workspace_symbols)
-- TODO Lmap("shb", "x", "Buf commits", builtin.git_bcommits_range)

View File

@ -0,0 +1,147 @@
local treesitter_config = {
auto_install = true,
sync_install = false,
ensure_installed = {
"arduino",
"bash",
"c",
"cmake",
"comment",
"cpp",
"c_sharp",
"diff",
"haskell",
"html",
"javascript",
"json",
"jsonc",
"lua",
"luadoc",
"luap",
"make",
"markdown",
"markdown_inline",
"ninja",
"python",
"query",
"regex",
"rust",
"toml",
"vim",
"vimdoc",
"yaml",
},
-- MODULES
indent = { enable = true }, -- for the `=` formatting
highlight = { enable = true },
incremental_selection = {
enable = true,
keymaps = {
init_selection = "<Tab>",
node_incremental = "<Tab>",
node_decremental = "<S-Tab>",
scope_incremental = "<C-Tab>",
}
}
}
treesitter_config.textobjects = {
select = {
enable = true,
lookahead = true, -- look for an object further in the file
include_surrounding_whitespace = false, -- disabled for Python
keymaps = { -- i - invocation, o - object, n - note, a - argument
["ai"] = "@call.outer", ["ic"] = "@conditional.inner",
["al"] = "@loop.outer", ["ia"] = "@parameter.inner",
["ak"] = "@block.outer", ["if"] = "@function.inner",
["ao"] = "@class.outer", ["in"] = "@comment.inner",
["ar"] = "@return.outer", ["ir"] = "@return.inner",
["an"] = "@comment.outer", ["io"] = "@class.inner",
["af"] = "@function.outer", ["ik"] = "@block.inner",
["aa"] = "@parameter.outer", ["il"] = "@loop.inner",
["as"] = "@assignment.outer", -- TODO
["ac"] = "@conditional.outer", ["ii"] = "@call.inner",
}
},
swap = {
enable = true,
swap_next = { -- a bit too much i guess... XD
[")i"] = "@call.inner", [")C"] = "@conditional.outer",
[")l"] = "@loop.inner", [")A"] = "@parameter.outer",
[")k"] = "@block.inner", [")F"] = "@function.outer",
[")o"] = "@class.inner", [")N"] = "@comment.outer",
[")r"] = "@return.inner", [")R"] = "@return.outer",
[")n"] = "@comment.inner", [")O"] = "@class.outer",
[")f"] = "@function.inner", [")K"] = "@block.outer",
[")a"] = "@parameter.inner", [")L"] = "@loop.outer",
[")c"] = "@conditional.inner", [")I"] = "@call.outer",
},
swap_previous = {
["(i"] = "@call.inner", ["(C"] = "@conditional.outer",
["(l"] = "@loop.inner", ["(A"] = "@parameter.outer",
["(k"] = "@block.inner", ["(F"] = "@function.outer",
["(o"] = "@class.inner", ["(N"] = "@comment.outer",
["(r"] = "@return.inner", ["(R"] = "@return.outer",
["(n"] = "@comment.inner", ["(O"] = "@class.outer",
["(f"] = "@function.inner", ["(K"] = "@block.outer",
["(a"] = "@parameter.inner", ["(L"] = "@loop.outer",
["(c"] = "@conditional.inner", ["(I"] = "@call.outer",
},
},
move = {
enable = true,
set_jumps = true, -- <C-o> back, <C-i> forward
goto_next = {},
goto_previous = {},
goto_next_start = {
["]i"] = "@call.outer", ["]c"] = "@conditional.outer",
["]l"] = "@loop.outer", -- ["]s"] = "@assignment.inner",
["]k"] = "@block.outer", ["]a"] = "@parameter.outer",
["]o"] = "@class.outer", ["]f"] = "@function.outer",
["]r"] = "@return.outer", ["]n"] = "@comment.outer",
},
goto_next_end = {
["]I"] = "@call.outer", ["]C"] = "@conditional.outer",
["]L"] = "@loop.outer", -- ["]S"] = "@assignment.inner",
["]K"] = "@block.outer", ["]A"] = "@parameter.outer",
["]O"] = "@class.outer", ["]F"] = "@function.outer",
["]R"] = "@return.outer", ["]N"] = "@comment.outer",
},
goto_previous_start = {
["[i"] = "@call.outer", ["[c"] = "@conditional.outer",
["[l"] = "@loop.outer", -- ["[s"] = "@assignment.inner",
["[k"] = "@block.outer", ["[a"] = "@parameter.outer",
["[o"] = "@class.outer", ["[f"] = "@function.outer",
["[r"] = "@return.outer", ["[n"] = "@comment.outer",
},
goto_previous_end = {
["[I"] = "@call.outer", ["[C"] = "@conditional.outer",
["[L"] = "@loop.outer", -- ["[S"] = "@assignment.inner",
["[K"] = "@block.outer", ["[A"] = "@parameter.outer",
["[O"] = "@class.outer", ["[F"] = "@function.outer",
["[R"] = "@return.outer", ["[N"] = "@comment.outer",
},
},
lsp_interop = {
enable = true, -- vim.lsp.util.open_floating_preview
floating_preview_opts = { border = vim.g.border_bleed },
peek_definition_code = {
["<Leader>lpo"] = { query = "@class.outer", desc = "Object" },
["<Leader>lpf"] = { query = "@function.outer", desc = "Function" },
["<Leader>lpa"] = { query = "@parameter.inner", desc = "Parameter" },
["<Leader>lps"] = { query = "@assignment.outer", desc = "Assignment" },
},
},
}
require("nvim-treesitter.configs").setup(treesitter_config)
local map = vim.keymap.set
local ts_repeat_move = require "nvim-treesitter.textobjects.repeatable_move"
map({ "n", "x", "o" }, "f", ts_repeat_move.builtin_f_expr, {expr=true})
map({ "n", "x", "o" }, "F", ts_repeat_move.builtin_F_expr, {expr=true})
map({ "n", "x", "o" }, "t", ts_repeat_move.builtin_t_expr, {expr=true})
map({ "n", "x", "o" }, "T", ts_repeat_move.builtin_T_expr, {expr=true})
map({ "n", "x", "o" }, ";", ts_repeat_move.repeat_last_move)
map({ "n", "x", "o" }, ",", ts_repeat_move.repeat_last_move_opposite)

124
.config/nvim/lua/gpg.lua Normal file
View File

@ -0,0 +1,124 @@
--[[
TODO:
* make a plugin state table for each buffer
* what TO DO if also editing the file externally? have a decrypt fn?
* query for encryption parameters and be smart
* support key decryption & encryption
* write commands to manage parameters
MAYBE:
* be able to encrypt into binary? (bin decription works using file path and not buf contents)
* make fancy windows? why tho
AT LEAST TRY:
* ediding encrypted tar files. (is tar plugin even in Lua yet?)
]]
local function set_gpg_encrypt(passphrase)
-- Encrypt text within buffer. On error use old cipher.
vim.b.gpg_encrypt = function()
local result = vim.system(
{ "/usr/bin/gpg", "--batch", "--armor", "--symmetric", "--cipher-algo", "AES256", "--passphrase", passphrase },
{ env = {}, clear_env = true, stdin = vim.api.nvim_buf_get_lines(0, 0, -1, true), text = true }
):wait()
if result.code == 0 then
vim.b.backup_encrypted = vim.split(result.stdout, "\n", { trimempty = true })
else
vim.notify(result.stderr, vim.log.levels.ERROR)
end
vim.api.nvim_buf_set_lines(0, 0, -1, true, vim.b.backup_encrypted or {})
end
end
local gpg_group = vim.api.nvim_create_augroup("custom_gpg", { clear = true })
vim.api.nvim_create_autocmd({ "BufNewFile", "BufReadPre", "FilterReadPre", "FileReadPre" }, {
pattern = { "*.gpg", "*.asc" },
group = gpg_group,
callback = function() -- turn off options that write to disk
vim.opt_local.shada = ""
vim.opt_local.swapfile = false
vim.opt_local.undofile = false
end,
})
vim.api.nvim_create_autocmd({ "BufReadPost", "FileReadPost" }, {
pattern = { "*.gpg", "*.asc" },
group = gpg_group,
callback = function()
-- if vim.b.gpg_abort then return end
-- autocmd can't cancel :w, so for error cases using this backup cipher
vim.b.backup_encrypted = vim.api.nvim_buf_get_lines(0, 0, -1, true)
while true do
local passphrase = vim.fn.inputsecret("Enter passphrase to decrypt or 'q' to not: ")
if passphrase == "q" then
vim.b.gpg_abort = true
break
end
local result = vim.system(
{ "/usr/bin/gpg", "--batch", "--decrypt", "--passphrase",
passphrase, vim.api.nvim_buf_get_name(0) },
{ env = {}, clear_env = true, text = true }
):wait()
if result.code == 0 then
vim.api.nvim_buf_set_lines(0, 0, -1, true, vim.split(result.stdout:gsub("\n$", ""), "\n"))
set_gpg_encrypt(passphrase)
break
end
vim.notify(result.stderr, vim.log.levels.ERROR)
end
-- Execute BufReadPost without .gpg in filename
vim.api.nvim_exec_autocmds("BufReadPost", { pattern = vim.fn.expand("%:r") })
end,
})
-- Encrypt all text in buffer before writing
vim.api.nvim_create_autocmd({ "BufWritePre", "FileWritePre" }, {
pattern = { "*.gpg", "*.asc" },
group = gpg_group,
callback = function()
if vim.b.gpg_abort then
return
end
if vim.b.gpg_encrypt then
vim.b.gpg_encrypt()
return
end
vim.notify("Need passphrase to encrypt new file.", vim.log.levels.INFO)
while true do
local passphrase = vim.fn.inputsecret("Enter passphrase for encryption or 'q' to abort: ")
if passphrase == "q" then
vim.api.nvim_buf_set_lines(0, 0, -1, true, {}) -- can't stop writing operation
return
end
local passphrase2 = vim.fn.inputsecret("Repeat passphrase or 'q' to abort: ")
if passphrase2 == "q" then
vim.api.nvim_buf_set_lines(0, 0, -1, true, {}) -- can't stop writing operation
return
end
if passphrase == passphrase2 then
set_gpg_encrypt(passphrase)
vim.b.gpg_encrypt()
break
end
vim.notify("\nPassphrases do not match!", vim.log.levels.WARN)
end
end,
})
-- Undo the encryption in buffer after the file has been written
vim.api.nvim_create_autocmd({ "BufWritePost", "FileWritePost" }, {
pattern = { "*.gpg", "*.asc" },
group = gpg_group,
command = ":silent u",
})

View File

@ -0,0 +1,186 @@
-- LEADER
-- Utilities
Lmap("ul", "<Cmd>Lazy<CR>")
Lmap("um", "<Cmd>Mason<CR>")
Lmap("uL", "<Cmd>LspInfo<CR>")
Lmap("uc", "<Cmd>CmpStatus<CR>")
Lmap("un", "Netrw", vim.cmd.Ex)
-- Toggle stuff
local function toggle(o, a, b, p)
return function()
if vim.o[o] == a then vim.o[o] = b else vim.o[o] = a end
if p then vim.cmd("set "..o.."?") end
end
end
Lmap("tn", "Number", "<Cmd>set number!<CR>")
Lmap("ts", "Spellcheck", "<Cmd>set spell!<CR>")
Lmap("tl", "Cursorline", "<Cmd>set cursorline!<CR>")
Lmap("tr", "Relative num", "<Cmd>set relativenumber!<CR>")
-- Lmap("tw", "Wrap", "<Cmd>set wrap!<CR><Cmd>set wrap?<CR>")
Lmap("tw", "Wrap", toggle("wrap", true, false, 1))
Lmap("tb", "Statusline", toggle("ls", 0, 3))
Lmap("t:", "Cmd", toggle("ch", 0, 1))
Lmap("tc", "Column", toggle("cc", "80,100", ""))
-- Clipboard stuff
Lmap("p", "x", "Void paste", [["_dP]])
Lmap("p", "Clipboard paste", [["+p]])
Lmap("P", "Clipboard Paste", [["+P]])
Lmap("d", "nx", "Void delete", [["_d]])
Lmap("D", "nx", "Void Delete", [["_D]])
Lmap("y", "nx", "Clipboard yank", [["+y]])
Lmap("Y", "nx", "Clipboard Yank", [["+y$]])
-- Other
Lmap("g", "File name", "<Cmd>echo expand('%:p')<CR>")
-- Quickfix list
Lmap("co", "Open", "<Cmd>copen<CR>")
Lmap("cc", "Close", "<Cmd>cclose<CR>")
Lmap("cn", "Newer list", "<Cmd>cnewer<CR>")
Lmap("ce", "Older list", "<Cmd>colder<CR>")
Lmap("cl", "Last item", "<Cmd>clast<CR>")
Lmap("cf", "First item", "<Cmd>cfirst<CR>")
-- Location list
Lmap("Co", "Open", "<Cmd>lopen<CR>")
Lmap("Cc", "Close", "<Cmd>lclose<CR>")
Lmap("Cn", "Newer list", "<Cmd>lnewer<CR>")
Lmap("Ce", "Older list", "<Cmd>lolder<CR>")
Lmap("Cl", "Last item", "<Cmd>llast<CR>")
Lmap("Cf", "First item", "<Cmd>lfirst<CR>")
-- Buffers
Lmap("bd", "Delete", "<Cmd>bdelete<CR>")
Lmap("bu", "Unload", "<Cmd>bunload<CR>")
Lmap("bb", "Last accessed", "<Cmd>buffer#<CR>")
Lmap("bm", "Last modified", "<Cmd>bmodified<CR>")
Lmap("bh", "H- split with next", "<Cmd>sbnext<CR>")
Lmap("bH", "H- split with prev", "<Cmd>sbprev<CR>")
Lmap("bv", "V| split with next", "<Cmd>vert sbnext<CR>")
Lmap("bV", "V| split with prev", "<Cmd>vert sbprev<CR>")
Lmap("bs", "V| split with last", "<Cmd>vert sbuffer#<CR>")
Lmap("bS", "H- split with last", "<Cmd>sbuffer#<CR>")
-- Windows 
Lmap("ww", "Last accessed", "<C-W>p")
Lmap("wn", "New V|", "<Cmd>vnew<CR>")
Lmap("wN", "New H-", "<Cmd>new<CR>")
Lmap("wd", "Close", "<C-W>c")
Lmap("wD", "Close last accessd", "<C-W>p<C-W>c")
Lmap("wo", "Close others", "<C-W>o")
Lmap("wx", "Xchange with next", "<C-W>x")
Lmap("we", "Equal size", "<C-W>=")
Lmap("wW", "Max width", "<C-W>|")
Lmap("wH", "Max height", "<C-W>_")
Lmap("wr", "Rotate downwards", "<C-W>r")
Lmap("wR", "Rotate upwards", "<C-W>R")
Lmap("ws", "V| split", "<C-W>v")
Lmap("wS", "H- split", "<C-W>s")
Lmap("wj", "Move win down", "<C-W>J")
Lmap("wk", "Move win up", "<C-W>K")
Lmap("wh", "Move win left", "<C-W>H")
Lmap("wl", "Move win right", "<C-W>L")
Lmap("w<Down>", "Move win down", "<C-W>J")
Lmap("w<Up>", "Move win up", "<C-W>K")
Lmap("w<Left>", "Move win left", "<C-W>H")
Lmap("w<Right>","Move win right", "<C-W>L")
-- LSP
local lsp = vim.lsp.buf
local diag = vim.diagnostic
-- Normal
Lmap("o", "Diagnostics float", diag.open_float)
Lmap("lh", "Help", lsp.hover)
Lmap("ls", "Signature help", lsp.signature_help)
Lmap("ln", "Rename", lsp.rename)
Lmap("lv", "Highlight", lsp.document_highlight)
Lmap("lV", "Clear highlight", lsp.clear_references)
Lmap("ld", "Definition", lsp.definition)
Lmap("lD", "Declaration", lsp.declaration)
Lmap("lt", "Type definition", lsp.type_definition)
Lmap("la", "nx", "Code action", lsp.code_action)
Lmap("lf", "nx", "Format", W(lsp.format) { async = true })
Lmap("lt", "Type under cursor", function() vim.lsp.util.open_floating_preview(
{ vim.lsp.semantic_tokens.get_at_pos()[1].type },
nil, { border = vim.g.border_bleed })
end)
-- Control
Lmap("lcs", "Show", diag.show)
Lmap("lch", "Hide", diag.hide)
Lmap("lce", "Enable", diag.enable)
Lmap("lcd", "Disable", diag.disable)
-- List
Lmap("lld", "Diagnostics all Q", diag.setqflist)
Lmap("llD", "Diagnostics buf L", diag.setloclist)
Lmap("llr", "References", lsp.references)
Lmap("lli", "Incoming calls", lsp.incoming_calls)
Lmap("llo", "Outgoing calls", lsp.outgoing_calls)
Lmap("llm", "Implementations", lsp.implementation)
Lmap("lls", "Buffer symbols", lsp.document_symbol)
Lmap("llw", "Workspace symbols", lsp.workspace_symbol)
-- Workspace
Lmap("lwa", "Add folder", lsp.add_workspace_folder)
Lmap("lwr", "Remove folder", lsp.remove_workspace_folder)
Lmap("lwl", "List folders", function() vim.print(lsp.list_workspace_folders()) end)
-- Next/Prev
local cmd = W(vim.cmd)
local function try(func, fallback)
return function() return pcall(vim.cmd, func) or vim.cmd(fallback) end
end
MakePair("s", "misspelled word", cmd "norm!]s", cmd "norm![s")
MakePair("b", "buffer", cmd "bnext", cmd "bprev")
MakePair("w", "window", cmd "wincmd w", cmd "wincmd W")
MakePair("Q", "loclist", try("lnext", "lfirst"), try("lprev", "llast"))
MakePair("q", "quickfix", try("cnext", "cfirst"), try("cprev", "clast"))
MakePair("d", "diagnostic", diag.goto_next, diag.goto_prev)
local map = vim.keymap.set
-- ADDITIONAL
-- map("i", "<A-Right>", "O") -- for 2 keyboard layer
map("i", "<A-BS>", "<Del>")
map("n", "<C-i>", "<C-i>") -- jump list
map("", "<Esc>", "<Esc><Cmd>noh<CR>")
map("n", "))", ")", { desc = "Sentence forward" }) -- )* taken by treesitter
map("n", "((", "(", { desc = "Sentence backward" })
-- visual stuff
map("x", "<", "<gv")
map("x", ">", ">gv")
map("x", "<S-Down>", ":move '>+1<CR>gv=gv")
map("x", "<S-UP>", ":move '<-2<CR>gv=gv")
-- lock the cursor at the buffer center
map("n", "J", "mjJ`j")
map("n", "n", "nzvzz")
map("n", "N", "Nzvzz")
map("n", "*", "*zvzz")
map("n", "#", "#zvzz")
map("n", "g*", "g*zvzz")
map("n", "g#", "g#zvzz")
map("n", "<C-d>", "<C-d>zz")
map("n", "<C-u>", "<C-u>zz")
-- down/up on wrapped lines
map("i", "<Down>", "<Cmd>norm! gj<CR>")
map("i", "<Up>", "<Cmd>norm! gk<CR>")
map({ "n", "x" }, "<Down>", "j", { remap = true })
map({ "n", "x" }, "<Up>", "k", { remap = true })
map({ "n", "x" }, "j", [[v:count == 0 ? "gj" : "j"]], { expr = true })
map({ "n", "x" }, "k", [[v:count == 0 ? "gk" : "k"]], { expr = true })
-- LAYOUT
map("n", "<A-Down>", "<A-j>", { remap = true })
map("n", "<A-Up>", "<A-k>", { remap = true })
map("n", "<A-Left>", "<A-h>", { remap = true })
map("n", "<A-Right>", "<A-l>", { remap = true })
map("n", "<C-Down>", "<C-j>", { remap = true })
map("n", "<C-Up>", "<C-k>", { remap = true })
map("n", "<C-Left>", "<C-h>", { remap = true })
map("n", "<C-Right>", "<C-l>", { remap = true })
map("n", "<A-j>", "<C-W>j", { desc = "Lower window" })
map("n", "<A-k>", "<C-W>k", { desc = "Upper window" })
map("n", "<A-h>", "<C-W>h", { desc = "Left window" })
map("n", "<A-l>", "<C-W>l", { desc = "Right window" })
map("n", "<C-j>", "<Cmd>resize -2<CR>", { desc = "Decrease height" })
map("n", "<C-k>", "<Cmd>resize +2<CR>", { desc = "Increase height" })
map("n", "<C-h>", "<Cmd>vert resize -2<CR>", { desc = "Decrease width" })
map("n", "<C-l>", "<Cmd>vert resize +2<CR>", { desc = "Increase width" })

View File

@ -0,0 +1,76 @@
local o = vim.opt
vim.g.mapleader = " " -- must be before any plugins
vim.g.maplocalleader = " "
-- vim.g.editorconfig = true
-- behaviour
o.swapfile = false
o.undofile = true
o.undolevels = 10000
o.updatetime = 500 -- save swap, trigger CursorHold
o.timeout = false -- hit <ESC> manually instead
o.timeoutlen = 600 -- ms to wait for a mapping sequence
o.splitbelow = true
o.splitright = true
o.ignorecase = true
o.smartcase = true -- don't ignore case for CAPITALS
o.hlsearch = true -- default
o.incsearch = true -- default
o.confirm = true -- :q when there are changes
o.shortmess = "atTIcCF" -- oO?
o.wildmode = "longest:full,full" -- cmd completion
o.completeopt = "menu,menuone,longest" -- omnifunc completion
o.mouse = "a"
o.spell = false
o.spelllang = "en_us,uk"
o.spelloptions = "camel"
o.fileencodings = "utf-8,cp1251,cp866"
--o.clipboard = "unnamed"plus?
o.iskeyword:append "-" -- is part of the word
o.formatoptions:append "n" -- indents for numbered lists
-- movement
o.scrolloff = 7 -- vertical
o.sidescrolloff = 10
o.autoindent = true -- default
o.smartindent = true
o.expandtab = true -- spaces > tabs
o.tabstop = 8 -- to see the Tabs, see also `listchars`
o.softtabstop = 4
o.shiftwidth = 4 -- >> and <<
o.virtualedit = "block" -- move cursor anywhere in visual block mode
-- look
o.cmdheight = 1 -- 0 is experimental
o.rulerformat = ""
o.pumheight = 10 -- lines in cmp menu
o.pumblend = 10 -- cmp menu transparency
o.showmode = true -- in cmdline
o.wrap = false
o.linebreak = true -- when `wrap`, break lines at `breakat`
o.showbreak = "🞄" -- 🞄➣◜◞◟◝╴└╰... at the beginning of wrapped lines
o.breakindent = true -- for wrapped blocks to have indent
o.title = true -- better window title
o.list = true -- show trailing invisible chars
o.listchars = "tab:󰌒 ,trail:·,nbsp:%,leadmultispace: ▏" -- ▎▍
o.colorcolumn = "80,100"
o.cursorline = true
o.laststatus = 0 -- 3 for statusline only on last win; 0 to hide
o.conceallevel = 3 -- hide markup
o.number = true
o.numberwidth = 1 -- minimal possible width
o.rnu = true
o.signcolumn = "number"
o.termguicolors = true -- RGB True color
o.fillchars = {
fold = " ",
foldopen = "",
foldclose = "",
foldsep = " ",
diff = "",
eob = " ",
lastline = ""
}
-- CUSTOM
vim.g.border = "single" -- :h nvim_open_win
vim.g.border_bleed = { "🭽", "", "🭾", "", "🭿", "", "🭼", "" } -- full-bleed

View File

@ -0,0 +1,40 @@
---Handle require calls
---@param module_name string
---@param success_callback fun(module: table): any | any
---@param error_callback? fun(error: string): any | any
function Protected_require(module_name, success_callback, error_callback)
local status, module = pcall(require, module_name)
if status then
if type(success_callback) == "function" then
return success_callback(module)
end
return success_callback
end
if type(error_callback) == "function" then
return error_callback(module)
end
return error_callback
end
---vim.keymap.set but one-time-use
---@param mode string | table
---@param lhs string
---@param rhs fun(any) | string
---@param opts? table
function Oneshot_keymap(mode, lhs, rhs, opts)
local buffer = opts and opts.buffer and { buffer = opts.buffer }
local function trigger_oneshot()
vim.keymap.set(mode, lhs, rhs, opts)
local keys = vim.api.nvim_replace_termcodes(lhs, true, false, true)
vim.api.nvim_feedkeys(keys, "m", false)
vim.schedule_wrap(vim.keymap.del)(mode, lhs, buffer) -- run a bit later
end
vim.keymap.set(mode, lhs, trigger_oneshot, buffer)
end

View File

@ -0,0 +1,18 @@
return {
"hrsh7th/nvim-cmp",
event = "InsertEnter", -- , "CmdlineEnter"
dependencies = {
"hrsh7th/cmp-nvim-lsp",
"hrsh7th/cmp-buffer",
{
"L3MON4D3/LuaSnip", -- jsregexp is optional
dependencies = "rafamadriz/friendly-snippets",
config = function()
require("luasnip.loaders.from_vscode").lazy_load()
end
},
"saadparwaiz1/cmp_luasnip", -- TODO
},
config = function() require "configs.cmp" end
}

View File

@ -0,0 +1,23 @@
local function config(test, opts)
opts.transparent = true
require("tokyonight").setup(opts)
vim.cmd.colorscheme "tokyonight"
end
return {
"navarasu/onedark.nvim",
{
"scottmckendry/cyberdream.nvim",
-- lazy = false,
-- priority = 1000,
config = config,
},
{
"folke/tokyonight.nvim",
lazy = false, -- for priority to work
priority = 1000, -- load before all other start plugins
config = config,
opts = { style = "moon" },
}
}

View File

@ -0,0 +1,10 @@
return {
"numToStr/Comment.nvim",
keys = {
{ "gc", mode = { "n", "x" } },
{ "gb", mode = { "n", "x" } },
{ "gp", "yy<Plug>(comment_toggle_linewise_current)p" },
{ "gp", "ygv<Plug>(comment_toggle_blockwise_visual)'>o<CR>p==", mode = "x" },
},
opts = {}
}

View File

@ -0,0 +1,5 @@
return {
"lewis6991/gitsigns.nvim",
event = "User VeryLazyFile",
config = function() require "configs.gitsigns" end
}

View File

@ -0,0 +1,31 @@
return {
"ThePrimeagen/harpoon", branch = "harpoon2",
dependencies = "nvim-lua/plenary.nvim",
keys = {
{ "<Leader>a", desc = "Append harpoon" },
{ "<Leader>A", desc = "Prepend harpoon" },
{ "<Leader>m", desc = "Harpoon menu" },
{ "<Leader>M", desc = "Harpoon clear" },
"<C-n>", "<C-p>", "]m", "[m",
"ñ", "é", "í", "ó", -- AltGr Colemak layer
},
config = function()
local harpoon = require "harpoon"
harpoon:setup()
Lmap("a", function() harpoon:list():append() end)
Lmap("A", function() harpoon:list():prepend() end)
Lmap("m", function() harpoon.ui:toggle_quick_menu(harpoon:list()) end)
Lmap("M", function() harpoon:list():clear() end)
MakePair("m", "harpoon", function() harpoon:list():next() end, function() harpoon:list():prev() end)
local map = vim.keymap.set
map("n", "<C-p>", function() harpoon:list():prev() end)
map("n", "<C-n>", function() harpoon:list():next() end)
-- TODO ._.
map("n", "ñ", function() harpoon:list():select(1) end)
map("n", "é", function() harpoon:list():select(2) end)
map("n", "í", function() harpoon:list():select(3) end)
map("n", "ó", function() harpoon:list():select(4) end)
end
}

View File

@ -0,0 +1,22 @@
return {} -- can't really make this to work normally
-- 'Wansmer/langmapper.nvim',
-- lazy = false,
-- priority = 1,
-- opts = {},
-- init = function()
-- local ua = [['йцукенгшщзхїґфівапролджєячсмитьбю.]]
-- local UA = [[ʼЙЦУКЕНГШЩЗХЇҐФІВАПРОЛДЖЄЯЧСМИТЬБЮ,]]
-- local en = [[`qwfpgjluy;[]\arstdhneio'zxcvbkm,./]]
-- local EN = [[~QWFPGJLUY:{}|ARSTDHNEIO"ZXCVBKM<>?]]
--
-- local function escape(str)
-- local escape_chars = [[;,."|\]]
-- return vim.fn.escape(str, escape_chars)
-- end
--
-- vim.opt.langmap = vim.fn.join({
-- escape(UA) .. ';' .. escape(EN),
-- escape(ua) .. ';' .. escape(en),
-- }, ',')
-- end
-- }

View File

@ -0,0 +1,144 @@
local M = {
"williamboman/mason-lspconfig.nvim",
event = "BufReadPre",
dependencies = { -- load those first
"mason.nvim",
{
"neovim/nvim-lspconfig",
config = function() require "configs.lspconfig" end
}
}
}
M.opts = {
ensure_installed = {
"lua_ls",
"bashls",
"tinymist",
"rust_analyzer",
"yamlls",
"clangd",
"jdtls",
"hyprls",
-- "sqls",
-- "arduino_language_server",
-- "cmake",
--"csharp_ls", -- piece of 󰱵
-- "hls", -- Haskell
-- "taplo", -- toml
-- "jsonls",
-- "ruff_lsp", -- Python
},
handlers = { -- automatic server setup
function(server_name) -- default handler
package.loaded.lspconfig[server_name].setup {}
end
}
}
M.opts.handlers.lua_ls = function()
package.loaded.lspconfig.lua_ls.setup {
settings = {
Lua = {
diagnostics = { globals = { "vim" } }
}
}
}
end
M.opts.handlers.harper_ls = function()
package.loaded.lspconfig.harper_ls.setup {
settings = { -- https://writewithharper.com/docs/integrations/neovim
["harper-ls"] = {
isolateEnglish = true, -- highly experimental
fileDictPath = vim.fn.stdpath("config") .. "/spell/spell/",
userDictPath = vim.fn.stdpath("config") .. "/spell/en.utf-8.add",
codeActions = {
forceStable = true -- preserve the order of actions
},
diagnosticSeverity = "information" -- "hint", "information", "warning", "error"
-- markdown = { ignore_link_title = true }
-- linters = { -- turned off by default
-- spelled_numbers = false, wrong_quotes = false, linking_verbs = false,
-- boring_words = false, use_genitive = false, plural_conjugate = false,
-- no_oxford_comma = false,
-- }
}
},
}
end
-- https://myriad-dreamin.github.io/tinymist//frontend/neovim.html
M.opts.handlers.tinymist = function()
package.loaded.lspconfig.tinymist.setup {
settings = {
formatterPrintWidth = 100, -- can't stand 120
formatterMode = "typstyle", -- or typstfmt
-- exportPdf = "onDocumentHasTitle", -- default: never
semanticTokens = "enable"
},
single_file_support = true,
root_dir = function(_, bufnr)
return vim.fs.root(bufnr, { ".git" }) or vim.fn.expand "%:p:h"
end,
}
end
M.opts.handlers.yamlls = function()
package.loaded.lspconfig.yamlls.setup {
settings = {
yaml = {
format = { enable = true },
schemaStore = { enable = true },
}
}
}
end
M.opts.handlers.rust_analyzer = function() -- TODO
package.loaded.lspconfig.rust_analyzer.setup {
settings = {
["rust-analyzer"] = {
cargo = {
allFeatures = true,
loadOutDirsFromCheck = true,
runBuildScripts = true,
},
-- Add clippy lints for Rust.
checkOnSave = true,
check = {
-- allFeatures = true,
command = "clippy",
extraArgs = {
"--",
"--no-deps", -- run Clippy only on the given crate
-- Deny, Warn, Allow, Forbid
"-Wclippy::correctness", -- code that is outright wrong or useless
"-Wclippy::complexity", -- code that does something simple but in a complex way
"-Wclippy::suspicious", -- code that is most likely wrong or useless
"-Wclippy::style", -- code that should be written in a more idiomatic way
"-Wclippy::perf", -- code that can be written to run faster
"-Wclippy::pedantic", -- lints which are rather strict or have occasional false positives
"-Wclippy::nursery", -- new lints that are still under development
"-Wclippy::cargo", -- lints for the cargo manifest
-- Use in production
"-Aclippy::restriction", -- lints which prevent the use of language and library features
-- Other
"-Aclippy::must_use_candidate", -- must_use is rather annoing
},
},
procMacro = {
enable = true,
-- ignored = {
-- ["async-trait"] = { "async_trait" },
-- ["napi-derive"] = { "napi" },
-- ["async-recursion"] = { "async_recursion" },
-- },
},
},
}
}
end
return M

View File

@ -0,0 +1,14 @@
return {
"williamboman/mason.nvim",
opts = {
ui = {
height = 0.8,
border = vim.g.border,
icons = {
package_pending = "󱦳",
package_installed = "",
package_uninstalled = ""
}
}
}
}

View File

@ -0,0 +1,16 @@
return {
"nvim-telescope/telescope.nvim", branch = "0.1.x",
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-tree/nvim-web-devicons",
{ "nvim-telescope/telescope-fzf-native.nvim", build = "make" }
},
keys = { -- so lazy 🥱
{ "<Leader>s", desc = "Load Telescope", mode = { "n", "x" } },
-- { "<Leader>o", desc = "Find old files" },
{ "<Leader>.", desc = "Find files in ." },
{ "<Leader>/", desc = "Telescope /" },
{ "<Leader>f", desc = "Find files" },
},
config = function() require "configs.telescope" end
}

View File

@ -0,0 +1,14 @@
return {
"nvim-treesitter/nvim-treesitter",
event = "User LazyFile",
-- lazy = false, --TODO
build = ":TSUpdate",
dependencies = "nvim-treesitter/nvim-treesitter-textobjects",
init = function()
vim.o.foldenable = true
vim.o.foldlevel = 99
vim.o.foldmethod = "expr"
vim.o.foldexpr = "nvim_treesitter#foldexpr()"
end,
config = function() require "configs.treesitter" end
}

View File

@ -0,0 +1,6 @@
return {
"dstein64/vim-startuptime",
cmd = "StartupTime", -- lazy-load on a command
keys = { { "<Leader>us", "<Cmd>StartupTime<CR>", desc = "StartupTime" } },
init = function() vim.g.startuptime_tries = 25 end
}

View File

@ -0,0 +1,64 @@
return {
"folke/which-key.nvim",
event = "VeryLazy",
opts = {
win = {
border = vim.g.border,
padding = { 0, 1, 0, 1 } -- ^, <, _, >
},
layout = {
spacing = 4,
align = "center",
width = { min = 1 },
height = { min = 1, max = 15 }
},
replace = { ["<leader>"] = "L" },
plugins = { spelling = { suggestions = 40 } },
},
init = function()
vim.o.timeout = true
vim.o.timeoutlen = 400 -- before opening WhichKey
end,
config = function(_, opts)
require("which-key").setup(opts)
require("which-key").add({ -- Naming groups here
{ "<Leader>C", group = "Loclist" },
{ "<Leader>b", group = "Buffer" },
{ "<Leader>c", group = "Quickfix" },
{ "<Leader>h", group = "Gitsigns" },
{ "<Leader>hc", group = "Control" },
{ "<Leader>ht", group = "Toggle" },
{ "<Leader>hv", group = "View" },
{ "<Leader>l", group = "LSP" },
{ "<Leader>lc", group = "Control" },
{ "<Leader>ll", group = "List" },
{ "<Leader>lp", group = "Peek definiton" },
{ "<Leader>lw", group = "Workspace" },
{ "<Leader>t", group = "Toggle" },
{ "<Leader>u", group = "Utils" },
{ "<Leader>w", group = "Window" },
-- c = { name = "Quickfix" },
-- C = { name = "Loclist" },
-- u = { name = "Utils" },
-- t = { name = "Toggle" },
-- b = { name = "Buffer" },
-- w = { name = "Window" },
-- h = { name = "Gitsigns",
-- v = { name = "View" },
-- t = { name = "Toggle" },
-- c = { name = "Control" },
-- },
-- l = {
-- name = "LSP",
-- l = { name = "List" },
-- c = { name = "Control" },
-- w = { name = "Workspace" },
-- p = { name = "Peek definiton" },
-- },
-- }, { prefix = "<Leader>" })
})
end
}

View File

@ -0,0 +1,65 @@
local map = vim.keymap.set
---function() y("1") end = W(y) "1"
---function() y(1,2) end = W(y,1,2)
---@param func function
function W(func, ...)
if ... then
local args = {...}
return function() func(unpack(args)) end
end
return function(arg)
return function() func(arg) end
end
end
---vim.keymap.set("n","<Leader>t",":Lazy<CR>",{desc="D"}) = Lmap("t", "D", ":Lazy<CR>")
---vim.keymap.set({"n","v"},"<Leader>D",":Lazy<CR>",{desc="D"}) = Lmap("t", "nv", "D", ":Lazy<CR>")
function Lmap(...)
local args = {...}
local len = select("#", ...)
if len == 3 then -- most used
map("n", "<Leader>"..args[1], args[3], { desc = args[2] })
elseif len == 2 then
map("n", "<Leader>"..args[1], args[2])
else -- 4
local modes = {}
args[2]:gsub(".", function(c) table.insert(modes, c) end)
map(modes, "<Leader>"..args[1], args[4], { desc = args[3] })
end
end
-- if try() succeeds then else_() else except(), always finally()
function Try(try, except, else_, finally)
return function()
if pcall(try) then
if else_ then else_() end
else
if except then except() end
end
if finally then finally() end
end
end
---Switch move pair to tresitter.textobjects.repeatable_move when it becomes available
---@param char string
---@param desc string
---@param next_func function
---@param prev_func function
function MakePair(char, desc, next_func, prev_func)
local function check_treesitter(func)
local ts_repeat = package.loaded["nvim-treesitter.textobjects.repeatable_move"]
if not ts_repeat then return func() end
local next, prev = ts_repeat.make_repeatable_move_pair(next_func, prev_func)
map("n", "]"..char, next, { desc = "Next "..desc.." (repeatable)" })
map("n", "["..char, prev, { desc = "Prev "..desc.." (repeatable)" })
if func == next_func then next() else prev() end
end
map("n", "]"..char, function() check_treesitter(next_func) end, { desc = "Next "..desc })
map("n", "["..char, function() check_treesitter(prev_func) end, { desc = "Prev "..desc })
end

22
.config/paru/paru.conf Normal file
View File

@ -0,0 +1,22 @@
[options]
PgpFetch
Provides
Devel
DevelSuffixes = -git -cvs -svn -bzr -darcs -always -hg -fossil
# build all packages, then install them at once
BatchInstall
NewsOnUpgrade
# Repo + AUR
CombinedUpgrade
UseAsk
#FailFast
UpgradeMenu
#BottomUp # aur search results first
#AurOnly # sysupgrade only for AUR
#SaveChanges # commit changes to pkgbuilds
#KeepRepoCache # keep old AUR package versions
[bin]
Sudo = doas
FileManager = yazi
#MFlags = --skippgpcheck

View File

@ -0,0 +1,33 @@
context.modules = [
{ name = libpipewire-module-filter-chain
args = {
node.description = "Noise Canceling source"
media.name = "Noise Canceling source"
filter.graph = {
nodes = [
{
type = ladspa
name = rnnoise
plugin = /usr/lib/ladspa/librnnoise_ladspa.so
label = noise_suppressor_mono
control = {
"VAD Threshold (%)" = 85.0
"VAD Grace Period (ms)" = 200
"Retroactive VAD Grace (ms)" = 20
}
}
]
}
capture.props = {
node.name = "capture.rnnoise_source"
node.passive = true
audio.rate = 48000
}
playback.props = {
node.name = "rnnoise_source"
media.class = Audio/Source
audio.rate = 48000
}
}
}
]

View File

@ -0,0 +1,9 @@
# GenericExecuteSynth "export XDATA=\'$DATA\'; echo \"$XDATA\" | sed -z 's/\\n/ /g' | piper-tts -q -m \"$HOME/local/tts/en_GB-cori-medium.onnx\" -f - | mpv --volume=80 --no-terminal --keep-open=no -"
GenericExecuteSynth "export XDATA=\'$DATA\'; echo \"$XDATA\" | tr '\n' ' ' | \
piper-tts -q -m $HOME/local/tts/$VOICE.onnx -f - | \
mpv --volume=80 --no-terminal --keep-open=no -"
AddVoice "en" "FEMALE1" "en_GB-cori-high"
AddVoice "en" "FEMALE2" "en_GB-cori-medium"
DefaultVoice "en_GB-cori-high"

View File

@ -0,0 +1,53 @@
# CommunicationMethod "unix_socket"
# SocketPath "default"
# Port 6560
# LocalhostAccessOnly 1
# 0 to disable
Timeout 60
LogLevel 3
LogDir "default"
DefaultPunctuationMode "all"
# preprocess characters and punctuation
SymbolsPreproc "none"
AudioOutputMethod "pipewire"
AddModule "piper-tts-generic" "sd_generic" "piper-tts-generic.conf"
DefaultModule piper-tts-generic
DefaultVoiceType "FEMALE1"
DefaultLanguage "en"
#LogDir "/var/log/speech-dispatcher/"
#LogDir "stdout"
#CustomLogFile "protocol" "/var/log/speech-dispatcher/speech-dispatcher-protocol.log"
# DefaultRate 0
# DefaultPitch 0
# DefaultPitchRange 0
# DefaultVolume 100
# DefaultClientName "unknown:unknown:unknown"
# DefaultPriority "text"
# number of sentences before pause repeated?
# DefaultPauseContext 0
#SymbolsPreprocFile "gender-neutral.dic"
#SymbolsPreprocFile "font-variants.dic"
#SymbolsPreprocFile "symbols.dic"
#SymbolsPreprocFile "emojis.dic"
#SymbolsPreprocFile "orca.dic"
#SymbolsPreprocFile "orca-chars.dic"
#SymbolsPreprocFile "symbols-fallback.dic"
# DefaultCapLetRecognition "none"
# DefaultSpelling Off
#AudioPulseDevice "default"
#AudioPulseMinLength 10
#AudioALSADevice "default"
#AudioOSSDevice "/dev/dsp"
#AudioNASServer "tcp/localhost:5450"
#AddModule "espeak" "sd_espeak" "espeak.conf"
#AddModule "espeak-ng" "sd_espeak-ng" "espeak-ng.conf"
#AddModule "festival" "sd_festival" "festival.conf"
#AddModule "voxin" "sd_voxin" "voxin.conf"
# AddModule "testing"
#LanguageDefaultModule "en" "espeak"
#LanguageDefaultModule "cs" "festival"
#LanguageDefaultModule "es" "festival"
#Include "clients/*.conf"
# DisableAutoSpawn

View File

@ -0,0 +1,88 @@
" Colemak experience:
" UNBINDS
unbind [c
unbind ]c
unbind ;m
unbind ;M
unbind --mode=visual j
unbind --mode=visual =
unbind <C-f>
unbind <C-b>
" NORMAL
bind e scrollline 8
bind i scrollline -8
bind n scrollpx -50
bind o scrollpx 50
bind E forward
bind I back
bind N tabprev
bind O tabnext
bind k fillcmdline open
bind K current_url open
bind D tabclose #
bind ' gobble 1 markjump
bind }} urlincrement 1
bind {{ urlincrement -1
bind <C-r> reader
bind <C-e> scrollline 1
bind <C-y> scrollline -1
" VISUAL
bind --mode=visual e js document.getSelection().modify("extend","forward","line")
bind --mode=visual i js document.getSelection().modify("extend","backward","line")
bind --mode=visual n js document.getSelection().modify("extend","backward","character")
bind --mode=visual o js document.getSelection().modify("extend","forward","character")
bind --mode=visual l js document.getSelection().modify("extend","forward","word")
bind --mode=visual h js tri.visual.reverseSelection(document.getSelection())
bind --mode=visual <Tab> js let n = document.getSelection().anchorNode; let p = n.parentNode; if (p) { p.prev = n; let s = window.getSelection(); s.removeAllRanges(); let r = document.createRange(); r.selectNodeContents(p); s.addRange(r) }
bind --mode=visual <S-Tab> js let p = document.getSelection().anchorNode.prev; let s = window.getSelection(); s.removeAllRanges(); if (p) { let r = document.createRange(); r.selectNodeContents(p); s.addRange(r) }
bind --mode=visual k fillcmdline open
" ADDITIONAL
bind ge editor
bind --mode=input <C-e> editor
bind ;l hint -JFc img i => tri.excmds.open('https://lens.google.com/uploadbyurl?url='+i.src)
bind ;L hint -JFc img i => tri.excmds.tabopen('https://lens.google.com/uploadbyurl?url='+i.src)
bind j fillcmdline hint -f
bind J fillcmdline hint -fb
bind / fillcmdline find
bind ? fillcmdline find --reverse
bind l findnext --search-from-view
bind L findnext --search-from-view --reverse
bind gn findselect
bind gN composite findnext --search-from-view --reverse; findselect
bind <C-[> composite mode normal; hidecmdline; nohlsearch
bind <Escape> composite mode normal; hidecmdline; nohlsearch
bind h composite set hintautoselect true; set hintfiltermode simple; set hintchars arstfwneiouykv; reset f; reset F
bind H composite set hintautoselect false; set hintfiltermode vimperator-reflow; set hintchars 4328901576; lang_f; lang_F
" ALIASES
command map bind
command lang_f bind f composite set keyboardlayoutforce false; hint; set keyboardlayoutforce true
command lang_F bind F composite set keyboardlayoutforce false; hint -b; set keyboardlayoutforce true
" Settings:
" FEEL
set newtab about:blank
set modeindicatorshowkeys true
set smoothscroll true
set scrollduration 75
set modeindicatormodes {"normal":"true","insert":"true","input":"true","ignore":"false","ex":"true","hint":"true","visual":"true"}
" BEHAVIOUR
set editorcmd kitty nvim
keyfeed h
set hintdelay 0
set keyboardlayoutforce true
set keyboardlayoutoverrides {"KeyE":["f","F"],"KeyR":["p","P"],"KeyT":["g","G"],"KeyY":["j","J"],"KeyU":["l","L"],"KeyI":["u","U"],"KeyO":["y","Y"],"KeyP":[";",":"],"KeyS":["r","R"],"KeyD":["s","S"],"KeyF":["t","T"],"KeyG":["d","D"],"KeyJ":["n","N"],"KeyK":["e","E"],"KeyL":["i","I"],"KeyN":["k","K"],"Semicolon":["o","O"]}
" URLS
blacklistadd https://typst.app/
blacklistadd https://monkeytype.com/
blacklistadd https://play.rust-lang.org
blacklistadd https://leetcode.com/problems/
setnull searchurls
set searchurls {"d":"https://duckduckgo.com/?q=","q":"https://www.qwant.com/?q=","g":"https://www.google.com/search?q=","s":"https://startpage.com/do/search?q=","sx":"https://searx.org/search?q=","sn":"https://searx.neocities.org/?q=","so":"https://stackoverflow.com/search?q=","r":"https://www.reddit.com/search/?q=","y":"https://www.youtube.com/results?search_query=","gh":"https://github.com/search?q=","osm":"https://www.openstreetmap.org/search?query=","w":"https://en.wikipedia.org/wiki/Special:Search/","gw":"https://wiki.gentoo.org/index.php?title=Special:Search&profile=default&search=","aw":"https://wiki.archlinux.org/index.php?title=Special:Search&search="}
" fillcmdline_tmp 2000 Sourced successfully!
" vim: ft=vim

235
.config/waybar/config.jsonc Normal file
View File

@ -0,0 +1,235 @@
{
"name": "main",
"layer": "top",
"position": "bottom",
//"output": ["HDMI-A-1"],
"height": 24,
//"width": 1280,
"modules-left": [
"hyprland/workspaces",
"hyprland/submap"
],
"modules-center": [
"hyprland/window"
],
"modules-right": [
"tray",
"bluetooth",
"network",
"network#eth",
"cpu",
"memory",
"disk",
"custom/plugged",
"battery",
"custom/record",
"wireplumber",
"custom/microphone",
"backlight",
"hyprland/language",
"custom/clock"
],
"fixed-center": false,
//"margin": 5,
//"margin-<top|left|bottom|right>": int,
"spacing": 0,
"exclusive": true,
"ipc": false,
//"include": ["~/.config/waybar/modules.jsonc"]
"hyprland/workspaces": {
"all-outputs": false,
"show-special": true,
"format": "{icon}",
"format-icons": {
"1": "1",
"2": "2",
"3": "3",
"4": "4",
"5": "5",
"6": "6",
"7": "7",
"8": "8",
"9": "9",
"10": "10",
"default": "+",
"special": "S" // yup, all for it
}
},
"hyprland/submap": {
"tooltip": false
},
"hyprland/window": {
"max-length": 100,
"separate-outputs": false
},
"tray": {
"spacing": 3,
"icon-size": 18,
"reverse-direction": true,
"show-passive-items": false
},
"bluetooth": {
"tooltip": true,
"max-length": 25,
"tooltip-format": "{device_enumerate}",
"tooltip-format-enumerate-connected": "'{device_alias}' ({device_address}), {device_address_type}",
"format": "",
"format-on": " {controller_alias}",
"format-off": "󰂲",
"format-disabled": "󰂲", // "" hides the module
"format-connected": "󰂱 {device_alias}"
},
"network": {
"interval": 6,
"tooltip": true,
"max-length": 10,
"family": "ipv4",
"interface": "wlan0",
"format-linked": "󱤚 ",
"format": "{icon} {essid}",
"format-disconnected": "󰣽 ", // 󰤮
"format-alt": "{icon} ({signalStrength}%) {essid} {frequency}MHz",
"tooltip-format": "{ifname} {ipaddr}\n{essid} {frequency}MHz {signalStrength}% {signaldBm}dBm\nD:{bandwidthDownBytes} U:{bandwidthUpBytes} T:{bandwidthTotalBytes}",
"format-icons": [
"󰣾",
"󰣴",
"󰣶",
"󰣸",
"󰣺"
] // ["󰤯","󰤟","󰤢","󰤥","󰤨"]
},
"network#eth": {
"interval": 10,
"tooltip": true,
"family": "ipv4",
"interface": "enp4s0f3u1u2",
"format": "󰈁",
"format-linked": "󰴼",
"format-disconnected": "󰈂",
"tooltip-format": "{ifname} {ipaddr}\nD:{bandwidthDownBytes} U:{bandwidthUpBytes} T:{bandwidthTotalBytes}"
},
"cpu": {
"interval": 6,
"tooltip": true,
"format": "󰻠 {usage}%",
"format-alt": "󰻠 {usage}% {avg_frequency}GHz({min_frequency}-{max_frequency})  {load}"
},
"memory": {
"interval": 12,
"tooltip": false,
"format": "󰍛 {percentage}%",
"format-alt": "󰍛 {used}G/{total}G 󰮱 {swapUsed}G/{swapTotal}G"
},
"disk": {
"interval": 60,
"tooltip": false,
"path": "/",
"format": "🖴 {percentage_used}%",
"format-alt": "🖴 {used}/{total}"
},
"custom/record": {
// SIGRTMIN+{N}, 2 is 36 in killall
"signal": 2,
"interval": 5,
"tooltip": false,
"exec": "~/.config/waybar/scripts/record.sh",
"format": "{}"
},
"wireplumber": {
"tooltip": true,
"tooltip-format": "{node_name}",
"on-scroll-up": "",
"on-scroll-down": "",
//"max-volume": 100,
"format": "{icon} {volume}%",
"format-muted": "",
"format-icons": [
"󰕿",
"󰖀",
"󰖀",
"󰕾"
]
},
"custom/microphone": {
// SIGRTMIN+{N}, 1 is 35 in killall
"signal": 1,
"interval": 12,
"tooltip": true,
"exec": "~/.config/waybar/scripts/microphone.sh",
"return-type": "json",
"escape": false,
"format": "{}",
"format-alt": "{alt}"
},
"backlight": {
"tooltip": false,
"on-scroll-up": "",
"on-scroll-down": "",
"format": "{icon} {percent}%",
"format-icons": [
"󰛩",
"󱩎",
"󱩏",
"󱩐",
"󱩑",
"󱩒",
"󱩓",
"󱩔",
"󱩕",
"󱩖",
"󰛨"
]
},
"hyprland/language": {
"format": "{}",
"format-en": "EN",
"format-uk": "UA"
},
"custom/plugged": {
"interval": 5,
"tooltip": false,
"exec": "~/.config/waybar/scripts/plugged.sh",
"format": "{} "
},
"battery": {
"interval": 12,
"tooltip": false,
"tooltip-format": "{timeTo}",
"bat": "BAT0",
"adapter": "AC",
"design-capacity": true,
//"full-at": 80,
"states": {
"warning": 30,
"critical": 10
},
"format-time": "{H}:{m}",
"format-plugged": "{capacity}%",
"format-full": "󱟠{capacity}%",
"format-charging": "󰂄{capacity}% {time} {power:.1f}W",
"format": "{icon}{capacity}% {power:.2f}W {time}",
"format-icons": [
"󱃍",
"󰁺",
"󰁻",
"󰁼",
"󰁽",
"󰁾",
"󰁿",
"󰂀",
"󰂁",
"󰂂",
"󰁹"
]
},
"custom/clock": {
"interval": 10,
//"restart-interval": 0,
"tooltip": false,
"exec": "~/.config/waybar/scripts/clock.sh",
"return-type": "json",
"escape": false,
"format": "{}",
"format-alt": "{alt}"
}
}

View File

@ -0,0 +1,4 @@
#!/usr/bin/bash
TEXT=$(date +'%-d %a %R')
ALT=$(date +'%a/%b %-d.%m.%Y %R')
echo '{"text": "'$TEXT'", "alt": "'$ALT'"}'

View File

@ -0,0 +1,12 @@
#!/usr/bin/bash
STATE=$(pactl get-source-mute @DEFAULT_SOURCE@)
NAME=$(pactl get-default-source | grep -Po '(?<=\.).*?(?=[_-]\d)')
VOL=$(pactl get-source-volume @DEFAULT_SOURCE@ | grep -Po '\d*(?=%)' | head -n1)
ICON='󱦊'; CLASS='unknown'
case $STATE in
"Mute: yes") ICON='󰍭'; CLASS='muted';;
"Mute: no") ICON='󰍬'; CLASS='unmuted';;
esac
echo '{"text": "'$ICON'", "alt": "'$ICON $VOL%'", "tooltip": "'${NAME//[-_]/ }'", "class": "'$CLASS'"}'

View File

@ -0,0 +1,4 @@
#!/usr/bin/bash
ICONS=(󱘖 )
STATE=$(cat /sys/class/power_supply/AC/online)
echo ${ICONS[$STATE]}

View File

@ -0,0 +1,7 @@
#!/usr/bin/bash
VAR=$(pidof wl-screenrec | wc -w)
if [ $VAR = 0 ]; then
echo '-'
else
echo "󰑋 $VAR"
fi

71
.config/waybar/style.css Normal file
View File

@ -0,0 +1,71 @@
* {
border: none;
min-height: 0;
border-radius: 0;
font-size: 16px;
font-weight: 600;
font-family: HackNerdFont;
}
window#waybar {
color: #FFFFFF;
background: #2B2A33;
}
#workspaces button { padding: 0 3px; }
#workspaces button.active { background-color: #446688; }
#submap {
margin-left: 4px;
padding: 0 5px;
background-color: #882222;
}
#tray, #bluetooth, #network, #network.eth, #cpu, #memory, #disk, #custom-record, #wireplumber, #custom-microphone, #backlight, #language, #custom-plugged, #battery, #custom-clock {
margin: 0 3px;
padding: 0 3px;
}
#bluetooth, #network, #network.eth {
border-bottom: 1px solid #EE99EE;
}
#bluetooth { margin-left: 6px; }
#network.eth { margin-right: 6px; }
#cpu, #memory, #disk, #custom-plugged, #battery{
border-bottom: 1px solid #44CC44;
}
#cpu { margin-left: 6px; }
#battery { margin-right: 6px; }
#custom-record {
border-bottom: 1px solid #00BBFF;
}
#custom-record { margin-left: 6px; }
#custom-record { margin-right: 6px; }
#wireplumber, #custom-microphone, #backlight, #language {
border-bottom: 1px solid #BBCCFF;
}
#wireplumber { margin-left: 6px; }
#language { margin-right: 6px; }
#custom-plugged {
margin-right: 0;
padding-right: 0;
border-right: 0;
}
#battery {
margin-left: 0;
padding-left: 0;
border-left: 0;
}
#battery.warning, #custom-microphone.muted, #wireplumber.muted
{ background-color: #886600; }
#battery.critical, #custom-microphone.unknown
{ background-color: #880000; }
#custom-clock { margin-right: 0; }

10
.config/yazi/init.lua Normal file
View File

@ -0,0 +1,10 @@
function Linemode:mtime()
local time = math.floor(self._file.cha.mtime or 0)
if time == 0 then
return ""
elseif os.date("%Y", time) == os.date("%Y") then
return os.date("%d %b %H:%M", time)
else
return os.date("%d %b %y", time)
end
end

13
.config/yazi/keymap.toml Normal file
View File

@ -0,0 +1,13 @@
"$schema" = "https://yazi-rs.github.io/schemas/keymap.json"
[manager]
prepend_keymap = [
{ on = "<C-y>", run = "plugin wl-clipboard", desc = "Yank to clipboard" },
{ on = "R", run = "rename --empty=stem --cursor=start", desc = "Rename file full" },
{ on = [
"g",
"d",
], run = "cd ~/documents", desc = "Goto ~/documents" },
{ on = "<A-s>", run = "search --via=rga", desc = "Search files by content via ripgrep-all" },
]

View File

@ -0,0 +1,9 @@
[[plugin.deps]]
use = "grappas/wl-clipboard"
rev = "c4edc4f"
hash = "51ff959c3c26cb3889589a0f8d394f14"
[[flavor.deps]]
use = "yazi-rs/flavors:dracula"
rev = "68326b4"
hash = "53e1f10ae0f6abd406e463fceca8622a"

2
.config/yazi/theme.toml Normal file
View File

@ -0,0 +1,2 @@
[flavor]
dark = "dracula"

30
.config/yazi/yazi.toml Normal file
View File

@ -0,0 +1,30 @@
"$schema" = "https://yazi-rs.github.io/schemas/yazi.json"
[manager]
ratio = [0, 2, 3] # prev, current, next / preview
sort_by = "natural" # 1.md < 2.md < 10.md
# sort_translit = false # replaces  as A, Æ as AE, etc.
linemode = "mtime"
scrolloff = 5
# mouse_events = ["click", "scroll"] # plugin stuff
title_format = "Yazi: {cwd}"
[preview]
wrap = "no"
tab_size = 8
max_width = 1024
max_height = 1024
cache_dir = "~/.cache/yazi/"
image_delay = 0
# image_filter = "triangle"
# image_quality = 75
# [tasks]
# suppress_preload = false
# image_alloc = 536870912 # 512MB
[input]
cursor_blink = true
[which]
sort_by = "key"

57
.gitignore vendored Normal file
View File

@ -0,0 +1,57 @@
/*
!/.gitignore
!/.gnupg/
/.gnupg/*
!/.gnupg/*.conf
# sloppy
!/.local/
/.local/*
!/.local/share/
/.local/share/*
!/.local/share/cargo/
/.local/share/cargo/*
!/.local/share/cargo/config.toml
!/.config/
/.config/*
# CLI / TUI
!.config/gdu/
!.config/fish/
!.config/paru/
!.config/htop/
!.config/yazi/
.config/yazi/*/
!.config/git/
.config/git/*
!.config/git/config
!.config/nvim/
.config/nvim/*
!.config/nvim/lua/
!.config/nvim/README.md
!.config/nvim/lazy-lock.json
# GUI
!.config/hypr/
!.config/mako/
!.config/kitty/
!.config/waybar/
# Media
!.config/mpv/
!.config/pipewire/
!.config/speech-dispatcher/
# Misc
# !.config/user-dirs.locale
!.config/logseq-flags.conf
!/.config/tridactyl/
/.config/tridactyl/*
!.config/tridactyl/tridactylrc

2
.gnupg/dirmngr.conf Normal file
View File

@ -0,0 +1,2 @@
no-use-tor
keyserver hkps://keys.openpgp.org

1
.gnupg/gpg-agent.conf Normal file
View File

@ -0,0 +1 @@
enable-ssh-support

10
.gnupg/gpg.conf Normal file
View File

@ -0,0 +1,10 @@
# When verifying signatures with unknown keys
auto-key-retrieve
# Use keyserver specified in the key
keyserver-options honor-keyserver-url
# Main key is only for certifying subkeys
default-new-key-algo ed25519/cert
# Source for the entire public key
# Git will autofetch keys and validate commints on `git log --show-signature`
# if `auto-key-retrieve` is enabled and `honor-keyserver-url` is set.
sig-keyserver-url https://gitea.linerds.us/0x1D8.gpg

View File

@ -0,0 +1,17 @@
[build]
rustc-wrapper = "sccache"
rustflags = ["-Z", "threads=8"]
[unstable]
codegen-backend = true
[profile.dev]
opt-level = 1
codegen-backend = "cranelift"
[profile.dev.package."*"]
opt-level = 3
[target.x86_64-unknown-linux-gnu]
linker = "/usr/bin/clang"
rustflags = ["-C", "link-arg=-fuse-ld=/usr/bin/mold"] # "target-cpu=native"