Browse Source

What

the fuck did you just fucking say about me, you little bitch? I'll have you know I graduated top of my class in the Navy Seals, and I've been involved in numerous secret raids on Al-Quaeda, and I have over 300 confirmed kills. I am trained in gorilla warfare and I'm the top sniper in the entire US armed forces. You are nothing to me but just another target. I will wipe you the fuck out with precision the likes of which has never been seen before on this Earth, mark my fucking words. You think you can get away with saying that shit to me over the Internet? Think again, fucker. As we speak I am contacting my secret network of spies across the USA and your IP is being traced right now so you better prepare for the storm, maggot. The storm that wipes out the pathetic little thing you call your life. You're fucking dead, kid. I can be anywhere, anytime, and I can kill you in over seven hundred ways, and that's just with my bare hands. Not only am I extensively trained in unarmed combat, but I have access to the entire arsenal of the United States Marine Corps and I will use it to its full extent to wipe your miserable ass off the face of the continent, you little shit. If only you could have known what unholy retribution your little "clever" comment was about to bring down upon you, maybe you would have held your fucking tongue. But you couldn't, you didn't, and now you're paying the price, you goddamn idiot. I will shit fury all over you and you will drown in it. You're fucking dead, kiddo.
master
SolitudeSF 1 year ago
commit
feb214d97e
No known key found for this signature in database
100 changed files with 4361 additions and 0 deletions
  1. 4
    0
      .gitignore
  2. 5
    0
      README.md
  3. 68
    0
      XCompose
  4. 1
    0
      Xresources
  5. 6
    0
      bin/agent-init
  6. 2
    0
      bin/anzu
  7. 3
    0
      bin/ddd
  8. 2
    0
      bin/disown
  9. 5
    0
      bin/e
  10. 9
    0
      bin/edit-script
  11. 81
    0
      bin/elvmv
  12. 3
    0
      bin/folderscontain
  13. 2
    0
      bin/fzy-kill
  14. 7
    0
      bin/fzy-pgrep
  15. 26
    0
      bin/get-song-cover
  16. 2
    0
      bin/get-wallpaper
  17. 4
    0
      bin/git-push-all
  18. 2
    0
      bin/git-yikes
  19. 4
    0
      bin/mime
  20. 5
    0
      bin/mpvwall
  21. 13
    0
      bin/mpw-get
  22. 2
    0
      bin/opus
  23. 2
    0
      bin/opussplit
  24. 2
    0
      bin/png-optimize
  25. 12
    0
      bin/randfile
  26. 12
    0
      bin/rofi-bspwm-unhide
  27. 1315
    0
      bin/rofi-emodji
  28. 16
    0
      bin/rofi-powermenu
  29. 2
    0
      bin/rofi-windowswitcher
  30. 9
    0
      bin/screenshot
  31. 50
    0
      bin/wal-to-context
  32. 2
    0
      bin/xbps-src
  33. 40
    0
      bin/xresources-to-context
  34. 16
    0
      bspwm
  35. 1
    0
      dunst
  36. 249
    0
      elvish/lib/completers.elv
  37. 29
    0
      elvish/lib/config.elv
  38. 36
    0
      elvish/lib/git.elv
  39. 7
    0
      elvish/lib/module.elv
  40. 21
    0
      elvish/lib/stack.elv
  41. 66
    0
      elvish/lib/theme.elv
  42. 32
    0
      elvish/lib/timer.elv
  43. 66
    0
      elvish/lib/util.elv
  44. 29
    0
      elvish/rc.elv
  45. 25
    0
      firefox/user.js
  46. 14
    0
      firefox/userChrome.css
  47. 95
    0
      fontconfig
  48. 37
    0
      gitconfig.ini
  49. 184
    0
      kak/kakrc
  50. 1
    0
      kitty/colors.conf
  51. 51
    0
      kitty/diff.conf
  52. 220
    0
      kitty/kitty.conf
  53. 53
    0
      mpd
  54. 38
    0
      mpv/mpv.conf
  55. 1
    0
      mpv/scripts/autoload.lua
  56. 1
    0
      mpv/scripts/locatefile.lua
  57. 1
    0
      mpv/scripts/navigator.lua
  58. 1
    0
      mpv/scripts/perfstats.lua
  59. 1
    0
      mpv/scripts/webm.lua
  60. 151
    0
      ncmpcpp
  61. 88
    0
      neofetch.sh
  62. 27
    0
      nim.nim
  63. 33
    0
      ntr/contexts/allomancer
  64. 33
    0
      ntr/contexts/anderson
  65. 33
    0
      ntr/contexts/apprentice
  66. 35
    0
      ntr/contexts/assuka
  67. 33
    0
      ntr/contexts/blaquemagick
  68. 33
    0
      ntr/contexts/coco
  69. 32
    0
      ntr/contexts/dracula
  70. 33
    0
      ntr/contexts/fahrenheit
  71. 31
    0
      ntr/contexts/gruvbox
  72. 33
    0
      ntr/contexts/iceberg
  73. 33
    0
      ntr/contexts/iosvkem
  74. 35
    0
      ntr/contexts/kiryuko
  75. 33
    0
      ntr/contexts/miasma
  76. 33
    0
      ntr/contexts/moonfly
  77. 33
    0
      ntr/contexts/nature-suede
  78. 31
    0
      ntr/contexts/nord
  79. 32
    0
      ntr/contexts/onedark
  80. 33
    0
      ntr/contexts/paints
  81. 33
    0
      ntr/contexts/petal
  82. 33
    0
      ntr/contexts/rusticated
  83. 33
    0
      ntr/contexts/seoul256
  84. 33
    0
      ntr/contexts/sourcerer
  85. 33
    0
      ntr/contexts/srcery
  86. 33
    0
      ntr/contexts/stellarized
  87. 34
    0
      ntr/contexts/sweetlove
  88. 33
    0
      ntr/contexts/twilight
  89. 33
    0
      ntr/contexts/vice
  90. 2
    0
      ntr/finishers/Xresources
  91. 2
    0
      ntr/finishers/default
  92. 7
    0
      ntr/finishers/dunst
  93. 2
    0
      ntr/finishers/kitty-colors
  94. 5
    0
      ntr/finishers/polybar
  95. 4
    0
      ntr/finishers/terminal_colors
  96. 6
    0
      ntr/profiles/default
  97. 20
    0
      ntr/templates/Xresources
  98. 33
    0
      ntr/templates/aminal
  99. 131
    0
      ntr/templates/dunst
  100. 0
    0
      ntr/templates/kitty-colors

+ 4
- 0
.gitignore View File

@@ -0,0 +1,4 @@
.pijul
.stfolder
.stignore
elvish/lib/github.com/

+ 5
- 0
README.md View File

@@ -0,0 +1,5 @@
# Huh?

Dotfiles are partially managed/created with the help of [ntr](https://github.com/SolitudeSF/ntr) - templating configuration renderer. See [ntr/](ntr) for example.

`bin/` scripts are probably unusable on your system, since they depend on programs that aren't present in coreutils (for no practical reason other than marginal performance gain)

+ 68
- 0
XCompose View File

@@ -0,0 +1,68 @@
include "%L"

# Greek
<Multi_key> <g> <a> : "α"
<Multi_key> <g> <b> : "β"
<Multi_key> <g> <g> : "γ"
<Multi_key> <g> <d> : "δ"
<Multi_key> <g> <3> : "ε"
<Multi_key> <g> <z> : "ζ"
<Multi_key> <g> <e> : "η"
<Multi_key> <g> <h> : "θ"
<Multi_key> <g> <i> : "ι"
<Multi_key> <g> <k> : "κ"
<Multi_key> <g> <l> : "λ"
<Multi_key> <g> <m> : "μ"
<Multi_key> <g> <n> : "ν"
<Multi_key> <g> <x> : "ξ"
<Multi_key> <g> <p> : "π"
<Multi_key> <g> <r> : "ρ"
<Multi_key> <g> <s> : "σ"
<Multi_key> <g> <t> : "τ"
<Multi_key> <g> <u> : "ψ"
<Multi_key> <g> <f> : "φ"
<Multi_key> <g> <c> : "χ"
<Multi_key> <g> <o> : "ω"

<Multi_key> <g> <G> : "Γ"
<Multi_key> <g> <D> : "Δ"
<Multi_key> <g> <H> : "Θ"
<Multi_key> <g> <L> : "Λ"
<Multi_key> <g> <X> : "Ξ"
<Multi_key> <g> <P> : "Π"
<Multi_key> <g> <S> : "Σ"
<Multi_key> <g> <F> : "Φ"
<Multi_key> <g> <U> : "Ψ"
<Multi_key> <g> <O> : "Ω"

# Bold
<Multi_key> <B> <A> : "𝔸"
<Multi_key> <B> <B> : "𝔹"
<Multi_key> <B> <C> : "ℂ"
<Multi_key> <B> <D> : "𝔻"
<Multi_key> <B> <E> : "𝔼"
<Multi_key> <B> <F> : "𝔽"
<Multi_key> <B> <G> : "𝔾"
<Multi_key> <B> <H> : "ℍ"
<Multi_key> <B> <I> : "𝕀"
<Multi_key> <B> <J> : "𝕁"
<Multi_key> <B> <K> : "𝕂"
<Multi_key> <B> <L> : "𝕃"
<Multi_key> <B> <M> : "𝕄"
<Multi_key> <B> <N> : "ℕ"
<Multi_key> <B> <O> : "𝕆"
<Multi_key> <B> <P> : "ℙ"
<Multi_key> <B> <Q> : "ℚ"
<Multi_key> <B> <R> : "ℝ"
<Multi_key> <B> <S> : "𝕊"
<Multi_key> <B> <T> : "𝕋"
<Multi_key> <B> <U> : "𝕌"
<Multi_key> <B> <V> : "𝕍"
<Multi_key> <B> <W> : "𝕎"
<Multi_key> <B> <X> : "𝕏"
<Multi_key> <B> <Y> : "𝕐"
<Multi_key> <B> <Z> : "ℤ"

# Misc

<Multi_key> <equal> <asciitilde> : "≈"

+ 1
- 0
Xresources View File

@@ -0,0 +1 @@
ntr/templates/Xresources

+ 6
- 0
bin/agent-init View File

@@ -0,0 +1,6 @@
#!/bin/sh
echo "What the heck? :---DD"
printf %s "$(mpw -t x gpg 2>/dev/null)" | xclip -sel c -l 1
gpg2 -d -q "$HOME/.password.gpg" | xclip -l 1
mpw -t x ssh -M "$(xclip -o)" 2>/dev/null | xclip -sel c -l 1
ssh-add

+ 2
- 0
bin/anzu View File

@@ -0,0 +1,2 @@
#!/bin/sh
kitty +kitten icat "$(randfile "$HOME/pic/anzu")"

+ 3
- 0
bin/ddd View File

@@ -0,0 +1,3 @@
#!/bin/sh
[ "$(id -u)" = 0 ] || _sudo=sudo
[ $# = 2 ] && exec $_sudo dd if="$1" of="$2"

+ 2
- 0
bin/disown View File

@@ -0,0 +1,2 @@
#!/bin/sh
"$@" </dev/null >/dev/null 2>&1 &

+ 5
- 0
bin/e View File

@@ -0,0 +1,5 @@
#!/bin/sh
F=0
for arg; do [ -f "$arg" ] && F=1 && break; done
[ $F = 1 ] && F='' || F=$(fd -t f | fzy)
exec "$EDITOR" "$@" "$F"

+ 9
- 0
bin/edit-script View File

@@ -0,0 +1,9 @@
#!/bin/sh
[ -z "$1" ] && return 1 || f=$(command -v "$1")
if [ -z "$f" ]; then
f="$HOME/bin/$1"
$EDITOR "$f"
[ -f "$f" ] && chmod +x "$f"
else
exec $EDITOR "$f"
fi

+ 81
- 0
bin/elvmv View File

@@ -0,0 +1,81 @@
#!/usr/bin/env elvish

use re

fn call [a @b]{
list = [(splits ' ' $a)]
bin = (external $list[0])
rest = [$@b]
if (> (count $list) 1) {
rest = [$list[1:] $@b]
}
$bin $@rest
}

fn list-items [a]{
if (-is-dir $a) { put $a/* } else { put $a }
}

items = []

if (== (count $args) 0) {
items = [./*]
} else {
for i $args {
if (eq $i '-') {
each [x]{ items = [$@items (list-items $x)] }
} else {
items = [$@items (list-items $i)]
}
}
}

high = (- (count $items) 1)
file = (mktemp -p /tmp elvmvXXXXX)
print > $file
c = 0

for i $items {
echo $c"\t"$items[$c] >> $file
c = (+ $c 1)
}

editor = vi
if (has-env VISUAL) {
editor = (get-env VISUAL)
} elif (has-env EDITOR) {
editor = (get-env EDITOR)
}

fn abort [&code=1 a]{
echo $a >&2
rm $file
exit $code
}

try {
call $editor $file
} except {
abort 'Editor exited with error. Aborting...'
}

cat $file | each [l]{
matches = (re:find '^(\d+)\t?(.*)$' $l)
if (not (eq $matches '')) {
id = $matches[groups][1][text]
name = $matches[groups][2][text]
src = $items[$id]
if (> $id $high) {
abort 'Unknown item id: '$id'. Aborting...'
} elif (not (eq $src $name)) {
mkdir -p (path-dir $name)
mv $items[$id] $name
}
} elif (re:match '^\s*$' $l) {
continue
} else {
abort 'Couldn''t parse line "'$l'". Aborting...'
}
}

rm $file

+ 3
- 0
bin/folderscontain View File

@@ -0,0 +1,3 @@
#!/bin/sh
for i; do ext="$ext -e $i"; done
if [ "$ext" ]; then fd -L $ext | xe dirname | sort | uniq; fi

+ 2
- 0
bin/fzy-kill View File

@@ -0,0 +1,2 @@
#!/bin/sh
kill $(fzpgrep ${1:-.})

+ 7
- 0
bin/fzy-pgrep View File

@@ -0,0 +1,7 @@
#!/bin/sh
ps up $(pgrep -f ${@:-.}) | \
while read -r l; do
printf '%s\n' "$l" >&2
fzy | awk '{print $2}'
break
done

+ 26
- 0
bin/get-song-cover View File

@@ -0,0 +1,26 @@
#!/usr/bin/env elvish

if (eq (mpc current) "") { exit 1 }

library-location = (xdg-user-dir MUSIC)
song-relative = (mpc -f '%file%' | take 1)
song-location = $library-location'/'$song-relative
song-dir = (path-dir $song-location)
@images = (fd -t f -e png -e jpg -e jpeg . $song-dir)

if (> (count $images) 0) {
use str
image = ""
for i $images {
t = (str:to-lower (joins . [(splits . (path-base $i))][:-1]))
if (or (eq $t "cover") \
(eq $t "folder")) { image = $i }
}
if (eq $image '') {
print $images[0]
} else {
print $image
}
} else {
exit 1
}

+ 2
- 0
bin/get-wallpaper View File

@@ -0,0 +1,2 @@
#!/usr/bin/env elvish
print [(splits "'" (cat $E:XDG_CONFIG_HOME/setroot/.setroot-restore))][-2]

+ 4
- 0
bin/git-push-all View File

@@ -0,0 +1,4 @@
#!/bin/sh
for remote in $(git remote); do
git push "$remote" "$@"
done

+ 2
- 0
bin/git-yikes View File

@@ -0,0 +1,2 @@
#!/bin/sh
git commit --amend --no-edit -q && git push -f -q

+ 4
- 0
bin/mime View File

@@ -0,0 +1,4 @@
#!/bin/sh
for w; do
echo "$w: "$(xdg-mime query filetype "$w")
done

+ 5
- 0
bin/mpvwall View File

@@ -0,0 +1,5 @@
#!/bin/sh
pkill xwinwrap
exec xwinwrap -ni -fs -s -nf -b -un -argb -fdt -- \
mpv --wid WID --no-terminal --no-audio --no-config --no-border \
--x11-bypass-compositor=no --keepaspect=no --loop "$1"

+ 13
- 0
bin/mpw-get View File

@@ -0,0 +1,13 @@
#!/usr/bin/env elvish
t=""
if (eq 0 (count $args)) {
sites=[(keys (cat ~/.mpw.d/SolitudeSF.mpsites.json | from-json)[sites])]
if (eq ?(tty -s) $ok) {
t=(echo &sep="\n" $@sites | fzy)
} else {
t=(echo &sep="\n" $@sites | rofi -dmenu -p 'Enter site: ' -width 25)
}
} else {
t=$args[0]
}
mpw -t x -M (gpg2 -d -q ~/.password.gpg) $t 2>/dev/null | xclip -sel c -r

+ 2
- 0
bin/opus View File

@@ -0,0 +1,2 @@
#!/bin/sh
exec xe -ap -j0 '%.{flac,wv,ape,wav}' opusenc --quiet --bitrate 256 {} %.opus -- "$@"

+ 2
- 0
bin/opussplit View File

@@ -0,0 +1,2 @@
#!/bin/sh
split2flac -nd -D -F -cue *cue "$@" && opus *flac && rm *flac

+ 2
- 0
bin/png-optimize View File

@@ -0,0 +1,2 @@
#!/bin/sh
exec xe -a -j0 optipng -quiet -keep -o7 -- "$@"

+ 12
- 0
bin/randfile View File

@@ -0,0 +1,12 @@
#!/bin/sh
n=1
for arg; do
if [ -z "$n" ]; then
n=$arg
else case $arg in
-n) n="";;
*) dir=$arg;;
esac
fi
done
fd -I -d 1 -t f -t l . "${dir:-}" | shuf -n "$n"

+ 12
- 0
bin/rofi-bspwm-unhide View File

@@ -0,0 +1,12 @@
#!/bin/sh
win=$(bspc query -N -n .hidden.window)
n=$(for w in $win; do
name=$(xprop -id "$w" WM_CLASS 2>/dev/null | sed -r 's/.+ "(.+)"$/\1/')
title=$(xprop -id "$w" WM_NAME 2>/dev/null | sed -r 's/.+ "(.+)"$/\1/')
[ "$name" = "WM_CLASS" ] && echo "node $w" || echo "$name \"$title\""
done | rofi -dmenu -no-custom -format i -p 'Unhide: ')
if [ -n "$n" ]; then
id=$(echo "$win" | sed -n "$((n+1))p")
bspc node "$id" -d focused
bspc node "$id" -g hidden=off
fi

+ 1315
- 0
bin/rofi-emodji
File diff suppressed because it is too large
View File


+ 16
- 0
bin/rofi-powermenu View File

@@ -0,0 +1,16 @@
#!/bin/sh
# rofi based powermenu

LOCKSCREEN="trollock -b bg"

case "$(printf %s "\
Suspend
Lock screen
Reboot
Power-off
" | rofi -width 20 -lines 4 -dmenu -no-custom -i -format i -p 'Powermenu: ')" in
0) $LOCKSCREEN & sudo -n zzz;;
1) $LOCKSCREEN & xset dpms force off;;
2) sudo -n reboot;;
3) sudo -n poweroff;;
esac

+ 2
- 0
bin/rofi-windowswitcher View File

@@ -0,0 +1,2 @@
#!/bin/sh
rofi -show window -modi window -show-icons -columns 2 -kb-accept-entry 'Return,Alt+Tab'

+ 9
- 0
bin/screenshot View File

@@ -0,0 +1,9 @@
#!/bin/sh
dir=$(xdg-user-dir PICTURES)/screen
[ -d "$dir" ] || mkdir -p "$dir"
file=$(date +"%Y-%m-%d_%H:%M:%S").png
path=$dir/$file
if maim -u -s "$path"; then
notify-send --icon "$path" "Screenshot saved" "$path"
xclip -sel c -t image/png "$path"
fi

+ 50
- 0
bin/wal-to-context View File

@@ -0,0 +1,50 @@
#!/usr/bin/env elvish
use re

data = (all | from-json)
col = $data[colors]
spec = $data[special]
wall = $data[wallpaper]
name = (re:replace '(\..+)?$' '' (path-base $wall))
author = (get-env USER)

if (> (count $args) 0) {
name = $args[0]
if (> (count $args) 1) { author = $args[1] }
}

echo meta
echo ' name*: '$name
echo ' author: '$author
echo ' source: pywal'
echo
echo color
echo ' bg: '$spec[background]
echo ' fg: '$spec[foreground]
echo ' cursor: '$spec[cursor]
echo
echo 'color0: '$col[color0]
echo 'color8: '$col[color8]
echo
echo 'color1: '$col[color1]
echo 'color9: '$col[color9]
echo
echo 'color2: '$col[color2]
echo 'color10: '$col[color10]
echo
echo 'color3: '$col[color3]
echo 'color11: '$col[color11]
echo
echo 'color4: '$col[color4]
echo 'color12: '$col[color12]
echo
echo 'color5: '$col[color5]
echo 'color13: '$col[color13]
echo
echo 'color6: '$col[color6]
echo 'color14: '$col[color14]
echo
echo 'color7: '$col[color7]
echo 'color15: '$col[color15]
echo
echo 'wallpaper*: '(re:replace &literal=$true '^'(put ~) '{{$HOME}}' $wall)

+ 2
- 0
bin/xbps-src View File

@@ -0,0 +1,2 @@
#!/bin/sh
cd "$XBPS_DISTDIR" && exec ./xbps-src "$@"

+ 40
- 0
bin/xresources-to-context View File

@@ -0,0 +1,40 @@
#!/usr/bin/env elvish
use re
c = [&]
for l [(all)] {
if (re:match '^(\*\.?|URxvt\*)' $l) {
echo $l | eawk [_ k v]{
c[(re:replace '(^\*\.?|^URxvt\*|:$)' '' $k)] = $v
}
}
}
echo color
echo ' bg: '$c[background]
echo ' fg: '$c[foreground]
if (has-key $c cursorColor) {
echo ' cursor: '$c[cursorColor]
}
echo
echo 'color0: '$c[color0]
echo 'color8: '$c[color8]
echo
echo 'color1: '$c[color1]
echo 'color9: '$c[color9]
echo
echo 'color2: '$c[color2]
echo 'color10: '$c[color10]
echo
echo 'color3: '$c[color3]
echo 'color11: '$c[color11]
echo
echo 'color4: '$c[color4]
echo 'color12: '$c[color12]
echo
echo 'color5: '$c[color5]
echo 'color13: '$c[color13]
echo
echo 'color6: '$c[color6]
echo 'color14: '$c[color14]
echo
echo 'color7: '$c[color7]
echo 'color15: '$c[color15]

+ 16
- 0
bspwm View File

@@ -0,0 +1,16 @@
#!/bin/sh
bspc monitor -d 0 1 2 3 4 5 6 7 8 9

bspc config border_width 1
bspc config window_gap 3
bspc config split_ratio 0.5
bspc config removal_adjustment longest_side
bspc config borderless_monocle true
bspc config gapless_monocle true
bspc config focus_follows_pointer true
bspc config click_to_focus button1

bspc rule -a Nightly desktop='^2'
bspc rule -a mpv state=floating
bspc rule -a Peek state=floating
bspc rule -a kittyfloat state=floating

+ 1
- 0
dunst View File

@@ -0,0 +1 @@
ntr/templates/dunst

+ 249
- 0
elvish/lib/completers.elv View File

@@ -0,0 +1,249 @@
use re
use util

use github.com/xiaq/edit.elv/compl/git
git:apply

fn overlap-at [a b]{
for i [(range 1 (- (count $b) 1))] {
if (has-value $a $b[$i]) { put $i; return }
}
put $false
}

fn prefix-completer [p a]{
edit:completion:arg-completer[$p] = [@cmd]{
if (eq (count $cmd) 2) {
$a $@cmd
} elif (has-key $edit:completion:arg-completer $cmd[1]) {
$edit:completion:arg-completer[$cmd[1]] (explode $cmd[1:])
} else {
edit:complete-filename $cmd[-1]
}
}
}

fn complete-directory [a]{
dir = (path-dir $a)/
if (has-prefix $a $dir) {
a = (replaces &max=1 $dir '' $a)
} else {
dir = ''
}
for x [(put $dir*[match-hidden][nomatch-ok]$a*[match-hidden][nomatch-ok])] {
if (-is-dir $x) { edit:complex-candidate &code-suffix=/ &style='blue;bold' $x }
}
}

edit:completion:arg-completer[cd] = [@cmd]{
if (eq (count $cmd) 2) {
complete-directory $cmd[1]
}
}

edit:completion:arg-completer[kak] = [@cmd]{
if (eq $cmd[-2] -c) {
kak -l
} else {
edit:complete-filename $cmd[-1]
}
}

edit:completion:arg-completer[waifu2x-converter-cpp] = [@cmd]{
if (has-value [-i --input -o --output] $cmd[-2]) {
edit:complete-filename $cmd[-1]
} elif (has-value [-m --mode] $cmd[-2]) {
put noise scale noise_scale
} elif (eq $cmd[-2] --noise_level) {
put 1 2 3
} else {
put --scale_ratio --noise_level --mode --jobs -i -o
}
}

kitty-cmds = []
kitty-kittens = []

edit:completion:arg-completer[kitty] = [@cmd]{
if (== (count $kitty-cmds) 0) {
@kitty-cmds = (kitty @ --help | peach [x]{ if (re:match '^ \w' $x) { put $x[2:] } })
@kitty-kittens = (pwd=/usr/lib/kitty/kittens fd main.py | peach [x]{ path-dir $x })
}
if (has-value [kitten '+kitten'] $cmd[-2]) {
explode $kitty-kittens
} elif (eq $cmd[-2] '@') {
explode $kitty-cmds
} else {
edit:complete-filename $cmd[-1]
}
}

edit:completion:arg-completer[sv] = [@cmd]{
if (eq (count $cmd) 2) {
put status up down once pause cont hup alarm interrupt quit kill term 1 2 \
exit start try-restart check {force-,}{stop,reload,restart,shutdown}
} else {
pwd=/var/service put *
}
}

edit:completion:arg-completer[man] = [@cmd]{
pwd=/usr/share/man put man*/* | peach [a]{
re:replace &literal=$true '\.\dp?$' '' (path-base $a)
}
}

edit:completion:arg-completer[kill] = [@cmd]{
ps -u (whoami) --no-headers -o pid,command |\
eawk [_ p @c]{ edit:complex-candidate &display-suffix=(print ' '$@c) $p }
}

edit:completion:arg-completer[nimble] = [@cmd]{
if (eq (count $cmd) 2) {
put {un,}install develop check init publish build c cc js test doc{,2} \
refresh search list tasks path dump
if ?(isnimbleproject) {
nimble tasks 2>/dev/null | eawk [_ a @_]{ put $a }
}
} elif (eq $cmd[-2] install) {
for x (cat ~/.nimble/packages_official.json | from-json) { put $x[name] }
} elif (eq $cmd[-2] uninstall) {
pkgs = [&]
nimble list -i | eawk [_ n @v]{
@ver = $@v[:-1]
ver[0] = $ver[0][1:]
pkgs[$n] = $ver
}
if (has-suffix $cmd[-1] '@') {
for v $pkgs[$cmd[-1][:-1]] {
put $cmd[-1]$v
}
} else { keys $pkgs }
}
}

pijul-cmds = [add apply branches checkout clone credit delete-branch diff dist\
generate-completions help init key log ls mv patch pull push\
record remove revert rollback show-dependencies sign status tag unrecord]

edit:completion:arg-completer[pijul] = [@cmd]{
if (eq (count $cmd) 2) {
explode $pijul-cmds
}
}

neofetch-img = [ascii caca iterm2 jp2a kitty pixterm sixel termpix tycat w3m off]
neofetch-opts = []

edit:completion:arg-completer[neofetch] = [@cmd]{
if (== (count $neofetch-opts) 0) {
neofetch-opts = [(_ = ?(neofetch --help | each [x]{
if (has-prefix $x ' --') {
put $x | eawk [_ a @_]{ put $a }
}
})) --logo -L -v -vv]
}
explode $neofetch-opts
}

edit:completion:arg-completer[bspc] = [@cmd]{
if (eq (count $cmd) 2) {
put node desktop monitor query wm rule config subscribe quit
} elif (eq $cmd[1] subscribe) {
put all report monitor desktop node pointer
} elif (eq $cmd[1] rule) {
put --add --remove --list
} elif (eq $cmd[1] wm) {
put --dump-state --load-state --add-monitor --adopt-orphans --record-history --get-status
} elif (eq $cmd[1] query) {
put --nodes --desktops --monitors --tree
}
}

edit:completion:arg-completer[ntr] = [@cmd]{
if (not (has-prefix $cmd[-1] '-')) {
pwd=$E:XDG_CONFIG_HOME/ntr/contexts put **
}
}

edit:completion:arg-completer[update] = [@cmd]{
update | each [x]{ if (has-prefix $x "\t") { put $x[1:] } }
}

edit:completion:arg-completer[xr] = [@cmd]{
xpkg -m
xpkg -O | peach [x]{ edit:complex-candidate &style='red;inverse' $x }
}

edit:completion:arg-completer[xi] = [@cmd]{
pwd=$E:XBPS_DISTDIR/srcpkgs put *
}

xbps-src-cmds = []
xbps-src-arch = []

edit:completion:arg-completer[xbps-src] = [@cmd]{
if (== (count $xbps-src-cmds) 0) {
@xbps-src-cmds = (xbps-src -h | take 122 | drop 4 | each [x]{ put (re:find &max=1 '^\w+(\-\w+)*' $x)[text] })
@xbps-src-arch = (xbps-src -h | take 155 | drop 129)[1:]
}
if (eq $cmd[-2] '-a') {
explode $xbps-src-arch
} else {
if (not (overlap-at $xbps-src-cmds $cmd)) {
explode $xbps-src-cmds
} else {
pwd=$E:XBPS_DISTDIR/srcpkgs put *
}
}
}

edit:completion:arg-completer[strat] = [@cmd]{
@strata = (brl list)
has-strat = (overlap-at $strata $cmd)
if (not $has-strat) {
explode $strata
} else {
# edit:complete-sudo (explode $cmd[(+ $has-strat 1):])
}
}

brl-cmds = []

edit:completion:arg-completer[brl] = [@cmd]{
if (== (count $brl-cmds) 0) {
@brl-cmds = (brl -h | take 35 | drop 5 | each [x]{ put (re:find &max=1 '^ \w+' $x)[text][2:] })
}
len = (count $cmd)
if (== $len 2) {
explode $brl-cmds
} else {
c = $cmd[1]
if (has-value [status enable disable hide show] $c) {
brl list
} elif (eq $c fetch) {
brl fetch -L
}
}
}

edit:completion:arg-completer[promotescript] = [@cmd]{
pwd=~/bin put *
}

edit:completion:arg-completer[edit-script] = $edit:complete-sudo~
edit:completion:arg-completer[whereis] = $edit:complete-sudo~
edit:completion:arg-completer[which] = $edit:complete-sudo~

edit:completion:arg-completer[xq] = $edit:completion:arg-completer[xi]
edit:completion:arg-completer[xqt] = $edit:completion:arg-completer[xi]
edit:completion:arg-completer[xbps-install] = $edit:completion:arg-completer[xi]

prefixes = [
&sudo=$edit:complete-sudo~
&strace=$edit:complete-sudo~
&time=$edit:complete-sudo~
&torify=$edit:complete-sudo~
]

for k [(keys $prefixes)] { prefix-completer $k $prefixes[$k] }

+ 29
- 0
elvish/lib/config.elv View File

@@ -0,0 +1,29 @@
conf = (get-env XDG_CONFIG_HOME)
dot = (get-env DOTS_DIR)
ntrtmp = $conf/ntr/templates
setini = ['-e' 'set buffer filetype ini']
fn e [@a]{ kak $@a }

fn profile { e $E:HOME/.profile }
fn sx { e $conf/sx/sxrc }
fn git { e $conf/git/config }
fn xbps-src { e -e 'set buffer filetype sh' $E:XBPS_DISTDIR/etc/conf }
fn bspwm { e $conf/bspwm/bspwmrc }
fn sxhkd { e $conf/sxhkd/sxhkdrc; pkill -USR1 -x sxhkd }
fn polybar { e $ntrtmp/polybar }
fn rofi { e $conf/rofi/config.rasi }
fn dunst { e $ntrtmp/dunst }
fn elvish { pwd=~/.elvish e (fd . -L -e elv | fzy) }
fn nim { e $conf/nim/config.nims }
fn min { e $E:HOME/.minrc }
fn ntr { pwd=$conf/ntr e (fd . -L | fzy) }
fn splug { e $conf/splug/config.toml }
fn kitty { e $@setini $conf/kitty/kitty.conf }
fn kitty-diff { e $@setini $conf/kitty/diff.conf }
fn kitty-colors { e $@setini $dot/ntr/templates/kitty-colors }
fn ranger { e $conf/ranger/rc.conf }
fn rifle { e $conf/ranger/rifle.conf }
fn kak { e $conf/kak/kakrc }
fn pqiv { e $conf/pqivrc }
fn mpv { e $conf/mpv/mpv.conf }
fn ncmpcpp { e $@setini $conf/ncmpcpp/config }

+ 36
- 0
elvish/lib/git.elv View File

@@ -0,0 +1,36 @@
branch = ''
dirty = 0
staged = 0
untracked = 0
ahead = 0
behind = 0

fn refresh-status {
branch = ''
dirty = 0
staged = 0
untracked = 0
ahead = 0
behind = 0

_ = ?(
data = [(git --no-optional-locks status --ignore-submodules --porcelain=v2 -b 2>/dev/null)]
branch = [(splits ' ' $data[1])][2]

if (has-prefix $data[3] '# branch.ab') {
ahead behind = (explode [(splits ' ' $data[3])][2:])[1:]
}

for i $data {
if (or (has-prefix $i 1) (has-prefix $i 2)) {
if (eq $i[2] .) {
dirty = (+ $dirty 1)
} else {
staged = (+ $staged 1)
}
} elif (has-prefix $i '?') {
untracked = (+ $untracked 1)
}
}
)
}

+ 7
- 0
elvish/lib/module.elv View File

@@ -0,0 +1,7 @@
fn exported [a]{
result = [&]
keys $a | each [x]{
result[$x] = $a[$x]
}
put $result
}

+ 21
- 0
elvish/lib/stack.elv View File

@@ -0,0 +1,21 @@
fn calc [@a]{
s = []

for x $a {
if (eq $x '+') {
s = [(+ $@s)]
} elif (or (eq $x '*') (eq $x 'x')) {
s = [(* $@s)]
} elif (eq $x '-') {
i = (- $s[-2] $s[-1])
s = [(put $@s | take (- (count $s) 2)) $i]
} elif (eq $x '/') {
i = (/ $s[-2] $s[-1])
s = [(put $@s | take (- (count $s) 2)) $i]
} else {
s = [$@s $x]
}
}

put $@s
}

+ 66
- 0
elvish/lib/theme.elv View File

@@ -0,0 +1,66 @@
use re
use git
use util
use timer

edit:rprompt-persistent = $true
edit:prompt-stale-threshold = 0.1
edit:rprompt-stale-transform = { put ⏳ }
edit:-prompt-eagerness = 5
pwd-limit = 20
max-dir-len = 1
basesym = ▲

if (or (has-env SSH_CLIENT) (has-env SSH_TTY)) {
basesym = ◆
}

fn sym {
if ?(isnimbleproject) {
put 👑
} else { put $basesym }
}

fn pwd {
tmp = (tilde-abbr $pwd)
if (or (< (count $tmp) $pwd-limit) (< $max-dir-len 1)) {
put $tmp
} else {
re:replace '(\.?[^/]{'$max-dir-len'})[^/]*/' '$1/' $tmp
}
}

fn git {
git:refresh-status
if (not-eq $git:branch '') {
if (not-eq $git:untracked 0) {
styled ' +'$git:untracked magenta
}
if (not-eq $git:dirty 0) {
styled ' ✎'$git:dirty red
}
if (not-eq $git:staged 0) {
styled ' ✓'$git:staged green
}
if (not-eq $git:ahead 0) {
styled ' ⇡'$git:ahead blue
}
if (not-eq $git:behind 0) {
styled ' ⇣'$git:behind blue
}
styled ' '$git:branch cyan
}
}

edit:prompt = {
put "\n "(sym)' '
styled (pwd)' ' cyan
}

edit:rprompt = {
if (not-eq $num-bg-jobs 0) {
put ' '$num-bg-jobs
}
put $timer:composed
git
}

+ 32
- 0
elvish/lib/timer.elv View File

@@ -0,0 +1,32 @@
use util

start = (date +%s)
delta = 0
s = 0
m = 0
h = 0
composed = ''

fn pad [a]{ if (< $a 10) { put '0'$a } }

util:add-after-readline [_]{ start = (date +%s) }
util:add-before-readline {
delta = (- (date +%s) $start)
h = 0
m = 0
s = $delta
if (> $delta 3600) {
s = (% $delta 60)
m = (/ (- (% $delta 3600) $s) 60)
h = (/ (- $delta (* $m 60) $s) 3600)
composed = (edit:styled ' ⏱'$h':'(util:pad $m 2 &with=0)':'(util:pad $s 2 &with=0) bold)
} elif (> $delta 60) {
s = (% $delta 60)
m = (/ (- $delta $s) 60)
composed = (edit:styled ' ⏱'$m':'(util:pad $s 2 &with=0) bold)
} elif (> $delta 5) {
composed = (edit:styled ' ⏱'$delta bold)
} else {
composed = ''
}
}

+ 66
- 0
elvish/lib/util.elv View File

@@ -0,0 +1,66 @@
fn abort [&code=1 a]{
echo (styled $a red)
exit $code
}

fn set-title [a]{
print "\e]0;"$a"\e\\"
}

fn merge-list [a b]{
for c $b { a = [$@a $c] }
put $a
}

fn merge-map [a b]{
for k $b { a[$k] = $b[$k] }
put $a
}

fn if-not-zero [a b]{
if (not-eq $a 0) { $b }
}

fn switch [a b]{
$b[$a]
}

fn pad [a b &with=' ' &left=$true]{
p = (repeat (- $b (count $a)) $with | joins '')
if $left {
put $p$a
} else {
put $a$p
}
}

fn add-before-readline [@hooks]{
for hook $hooks {
if (not (has-value $edit:before-readline $hook)) {
edit:before-readline=[ $@edit:before-readline $hook ]
}
}
}

fn add-after-readline [@hooks]{
for hook $hooks {
if (not (has-value $edit:after-readline $hook)) {
edit:after-readline=[ $@edit:after-readline $hook ]
}
}
}

fn fold [a b]{
s = $a[0]
for i [(range 1 (count $a))] {
s = ($b $s $a[$i])
}
put $s
}

fn randselect [a]{
put $a[(randint 0 (count $a))]
}

fn to-upper-ascii [a]{ if (and (< (ord $a) 123) (> (ord $a) 96)) { chr (- (ord $a) 32) } else { put $a } }
fn to-lower-ascii [a]{ if (and (< (ord $a) 91 ) (> (ord $a) 64)) { chr (+ (ord $a) 32) } else { put $a } }

+ 29
- 0
elvish/rc.elv View File

@@ -0,0 +1,29 @@
use epm
use util
use config
use module

fn ls [@a]{ e:exa --group-directories-first -s Name $@a }
fn xqt [a]{ e $E:XBPS_DISTDIR/srcpkgs/$a/template }
fn xr [@a]{ sudo xbps-remove -R $@a }

-exports- = [&]


{
use theme
use completers
use github.com/xiaq/edit.elv/smart-matcher
use stack
-exports- = (module:exported $stack:)
smart-matcher:apply
util:add-before-readline {
util:set-title (tilde-abbr $pwd) >/dev/tty
}
util:add-after-readline [a]{
if (eq $a '') { print "\r" >/dev/tty; ls >/dev/tty }
util:set-title (splits ' ' $a | take 1)' '(tilde-abbr $pwd) >/dev/tty
}
}

set-env GPG_TTY (tty)

+ 25
- 0
firefox/user.js View File

@@ -0,0 +1,25 @@


user_pref("general.warnOnAboutConfig", false);

user_pref("browser.chrome.errorReporter.enabled", false);


user_pref("browser.newtabpage.activity-stream.feeds.section.highlights", false);
user_pref("browser.newtabpage.activity-stream.feeds.snippets", false);
user_pref("browser.newtabpage.activity-stream.feeds.topsites", false);
user_pref("browser.newtabpage.activity-stream.prerender", false);
user_pref("browser.newtabpage.activity-stream.showSearch", false);


user_pref("browser.safebrowsing.malware.enabled", false);
user_pref("browser.safebrowsing.phishing.enabled", false);

user_pref("browser.search.suggest.enabled", false);


user_pref("browser.tabs.closeTabByDblclick", true);


user_pref("extensions.formautofill.addresses.enabled", false);
user_pref("extensions.formautofill.creditCards.enabled", false);

+ 14
- 0
firefox/userChrome.css View File

@@ -0,0 +1,14 @@
#TabsToolbar {
visibility: collapse !important;
}

#sidebar {
max-width: none !important;
min-width: 0px !important;
}
#sidebar-box + #sidebar-splitter {
display: none !important;
}
#sidebar-box #sidebar-header {
visibility: collapse;
}

+ 95
- 0
fontconfig View File

@@ -0,0 +1,95 @@
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>

<match target="pattern">
<test name="family">
<string>Times New Roman</string>
</test>
<edit name="family">
<string>serif</string>
</edit>
</match>

<match target="pattern">
<test name="family">
<string>Arial</string>
</test>
<edit name="family">
<string>sans-serif</string>
</edit>
</match>

<match target="pattern">
<test name="family">
<string>Helvetica</string>
</test>
<edit name="family">
<string>sans-serif</string>
</edit>
</match>

<match target="pattern">
<test name="family">
<string>Verdana</string>
</test>
<edit name="family">
<string>sans-serif</string>
</edit>
</match>

<match target="pattern">
<test name="family">
<string>Nimbus Sans L</string>
</test>
<edit name="family">
<string>sans-serif</string>
</edit>
</match>

<match target="pattern">
<test name="family">
<string>Lucida</string>
</test>
<edit name="family">
<string>sans-serif</string>
</edit>
</match>

<match target="pattern">
<test name="family">
<string>serif</string>
</test>
<edit name="family" mode="assign">
<string>Liberation Serif</string>
</edit>
<edit name="hintstyle" mode="assign">
<const>hintslight</const>
</edit>
</match>

<match target="pattern">
<test name="family">
<string>sans-serif</string>
</test>
<edit name="family" mode="assign">
<string>Liberation Sans</string>
</edit>
<edit name="hintstyle" mode="assign">
<const>hintslight</const>
</edit>
</match>

<match target="pattern">
<test name="family">
<string>monospace</string>
</test>
<edit name="family">
<string>Iosevka SS04</string>
</edit>
<edit name="hintstyle" mode="assign">
<const>hintslight</const>
</edit>
</match>

</fontconfig>

+ 37
- 0
gitconfig.ini View File

@@ -0,0 +1,37 @@
[user]
email = solitudesf@protonmail.com
name = SolitudeSF
signingkey = 789B06817C385387
[alias]
tags = tag -l
branches = branch -a
diffdir = difftool --dir-diff
alias = !fugitive alias
changelog = !fugitive changelog
lock = !fugitive lock
mirror = !fugitive mirror
open = !fugitive open
release = !fugitive release
scrap = !fugitive scrap
summary = !fugitive summary
undo = !fugitive undo
unlock = !fugitive unlock
unstage = !fugitive unstage
profile = !fugitive profile
get = !fugitive mirror
[commit]
gpgsign = true
[gpg]
program = gpg2
[credential]
helper = store
[diff]
tool = kitty
guitool = kitty.gui
[difftool]
prompt = false
trustExitCode = true
[difftool "kitty"]
cmd = kitty +kitten diff $LOCAL $REMOTE
[difftool "kitty.gui"]
cmd = kitty kitty +kitten diff $LOCAL $REMOTE

+ 184
- 0
kak/kakrc View File

@@ -0,0 +1,184 @@
# Merge and manually source plugins
eval %sh{
cat $(find "$kak_config/autosource" -name '*\.kak') >/tmp/kakmerge.kak
printf %s 'source /tmp/kakmerge.kak'
}

# Initialization
decl -hidden regex curword

set global ui_options ncurses_assistant=none
set global scrolloff 7,7
set global autoreload yes
set global kitty_window_type os
set global termcmd 'kitty -1 sh -c'
set global grepcmd 'rg -iHL --column'
set global filetree_find_cmd 'fd -L -t f -d 2'
set global modelinefmt '%opt{modeline_git_branch} %val{bufname}
%val{cursor_line}:%val{cursor_char_column} {{mode_info}} {{context_info}}
◂%val{client}⊙%val{session}▸'

unalias global e edit
alias global e edit-or-dir

face global LineNumbersWrapped black

addhl global/ number-lines -hlcursor -separator ' '
addhl global/ column 80 default,rgb:303030
addhl global/ regex '\h+$' 0:default,red
addhl global/ regex \b(TODO|FIXME|XXX|NOTE)\b 0:default+rb
addhl global/ show-matching
addhl global/ wrap -word -indent -marker ↪
addhl global/ dynregex '%reg{/}' 0:+u
addhl global/ dynregex '%opt{curword}' 0:+b

# Keybinds
map global normal <space> ,
map global normal -docstring 'remove all sels except main' <backspace> <space>
map global normal -docstring 'remove main sel' <a-backspace> <a-space>
map global normal -docstring 'comment line' '#' :comment-line<ret>
map global normal -docstring 'comment block' '<a-#>' :comment-block<ret>
map global normal -docstring 'delete to end of line' D <a-l>d
map global normal -docstring 'yank to end of line' Y <a-l>y

map global user -docstring "add phantom selection" f :phantom-sel-add-selection<ret>
map global user -docstring "clear all phantom selections" <a-f> :phantom-sel-select-all<ret>:phantom-sel-clear<ret>
map global user -docstring "next phantom selection" F :phantom-sel-iterate-next<ret>
map global user -docstring "previous phantom selection" <a-F> :phantom-sel-iterate-prev<ret>

map global user -docstring "filetree" t :filetree<ret>
map global user -docstring 'buffers' <ret> :rofi-buffers<ret>

map global normal -docstring 'select view' <a-%> ':select-view<ret>'
map global view -docstring 'select view' s '<esc>:select-view<ret>'

map global user -docstring "add mark" m :mark-word<ret>
map global user -docstring "clear marks" M :mark-clear<ret>

map global user -docstring "expand selection" e :expand<ret>
map global user -docstring "expand repeat" E :expand-repeat<ret>

map global normal <c-p> ':yank-ring-previous<ret>'
map global normal <c-n> ':yank-ring-next<ret>'
map global normal Y ':yank-ring-open<ret>'

declare-user-mode surround
map global user -docstring "surround mode" s ':enter-user-mode surround<ret>'
map global surround -docstring 'surround' s ':surround<ret>'
map global surround -docstring 'change' c ':change-surround<ret>'
map global surround -docstring 'delete' d ':delete-surround<ret>'
map global surround -docstring 'select tag' t ':select-surrounding-tag<ret>'
map global surround -docstring 'auto-pairs surround' a ':auto-pairs-surround<ret>'

declare-user-mode anchor
map global normal ';' ':enter-user-mode anchor<ret>'
map global anchor -docstring 'reduce to anchor' a '<a-;>;'
map global anchor -docstring 'reduce to cursor' c ';'
map global anchor -docstring 'flip cursor and anchor' f '<a-;>'
map global anchor -docstring 'ensure anchor after cursor' h '<a-:><a-;>'
map global anchor -docstring 'ensure cursor after anchor' l '<a-:>'
map global anchor -docstring 'select cursor and anchor' s '<a-S>'

map global user -docstring "clip-paste after" p '<a-!>xsel -b -o<ret>'
map global user -docstring "clip-paste before" P '!xsel -b -o<ret>'
map global user -docstring "clip-paste replace" R '|xsel -b -o<ret>'
map global user -docstring "clip-yank" y '<a-|>xclip -i -f -sel c<ret>'

map global user -docstring "next error" l :lint-next-error<ret>
map global user -docstring "previous error" L :lint-previous-error<ret>

# Functions
def toggle-highlighter -params .. -docstring 'Toggle highlighter' %{
try %{
addhl window/%arg{@} %arg{@}
echo -markup {green} %arg{@}
} catch %{
rmhl window/%arg{@}
echo -markup {red} %arg{@}
}
}

def lint-on-write -docstring 'Activate linting on buffer write' %{
lint-enable
hook buffer BufWritePost .* %{ lint }
}

def rofi-buffers -docstring 'Select an open buffer using Rofi' %{ eval %sh{
BUF=$(eval set -- "$kak_buflist"; for i; do echo "$i"; done\
| rofi -dmenu -no-custom -p 'Select buffer: ')
[ -n "$BUF" ] && echo buffer "$BUF"
} }

def no-tabs -params 0..1 -docstring 'Indent with spaces' %{
eval %sh{ [ -n "$1" ] && printf %s "
set buffer indentwidth $1
set buffer tabstop $1
set buffer softtabstop $1
" }
exec :expandtab<ret>
hook buffer InsertKey <space> %{ try %{
exec -draft h<a-i><space><a-k>^\h+<ret>
exec -with-hooks <tab>
} }
}

def clean-trailing-whitespace -docstring 'Remove trailing whitespace' %{
try %{ exec -draft '%s\h+$<ret>d' }
}

# Hooks
hook global WinCreate ^[^*]+$ %{
auto-pairs-enable
}

hook global BufOpenFile .* %{
change-directory-current-buffer
}

hook global NormalIdle .* %{
try %{ exec -draft '<a-i>w:palette-status<ret>' }
}

hook global BufWritePre .* %{ nop %sh{
mkdir -p "$(dirname "$kak_buffile")"
}}

hook global BufWritePost .* %{ git show-diff }
hook global BufReload .* %{ git show-diff }

hook global NormalIdle .* %{
eval -draft %{ try %{
exec <space><a-i>w <a-k>\A\w+\z<ret>
set buffer curword "\b\Q%val{selection}\E\b"
} catch %{
set buffer curword ''
} }
}

# Filetype detection
hook global BufCreate .*srcpkgs/.+/template$ %{
set buffer filetype sh
def xgensum %{ %sh{ xgensum -i "$kak_buffile" } }
}

hook global BufCreate .*/\.?((sx|xinit)(rc)?|profile) %{ set buffer filetype sh }
hook global BufCreate .*\.ino %{ set buffer filetype cpp }
hook global BufCreate .*\.cs %{ addhl window/java }

# Filetype settings
hook global WinSetOption filetype=sh %{
set buffer lintcmd 'shellcheck -x -fgcc'
lint-on-write
}

hook global WinSetOption filetype=elvish %{
no-tabs 2
}

hook global WinSetOption filetype=nim %{
set buffer gdb_program 'nim-gdb'
no-tabs 2
# set buffer lintcmd "sh -c 'cp -f $0 $0.nim;nim --stdout --colors:off --hints:off --path:$(dirname ${kak_buffile}) check $0 | sed \"s/(/:/;s/, /:/;s/)/:/\" | sed \":a;N;/\n[buf.nim]/!s/\n//;ta;P;D\"'"
# set buffer lintcmd "sh -c 'nim --stdout --hints:off check $0 | sed \'s/(/:/;s/, /:/;s/)/:/\''"
# lint-on-write
}

+ 1
- 0
kitty/colors.conf View File

@@ -0,0 +1 @@
/home/solitude/dot/ntr/templates/kitty-colors

+ 51
- 0
kitty/diff.conf View File

@@ -0,0 +1,51 @@
syntax_aliases pyj:py recipe:py
pygments_style default
num_context_lines 3
diff_cmd auto
replace_tab_by \x20\x20\x20\x20

foreground black
background white
title_fg black
title_bg white
margin_bg #fafbfc
margin_fg #aaaaaa
removed_bg #ffeef0
highlight_removed_bg #fdb8c0
removed_margin_bg #ffdce0
added_bg #e6ffed
highlight_added_bg #acf2bd
added_margin_bg #cdffd8
filler_bg #fafbfc
hunk_margin_bg #dbedff
hunk_bg #f1f8ff
search_bg #444
search_fg white
select_bg #B4D5FE
select_fg black

map q quit
map esc quit
map j scroll_by 1
map k scroll_by -1
map down scroll_by 1
map up scroll_by -1
map home scroll_to start
map end scroll_to end
map page_down scroll_to next-page
map page_up scroll_to prev-page
map space scroll_to next-page
map n scroll_to next-change
map p scroll_to prev-change
map a change_context all
map = change_context default
map + change_context 5
map - change_context -5
map / start_search regex forward
map ? start_search regex backward
map . scroll_to next-match
map , scroll_to prev-match
map > scroll_to next-match
map < scroll_to prev-match
map f start_search substring forward
map b start_search substring backward

+ 220
- 0
kitty/kitty.conf View File

@@ -0,0 +1,220 @@
include colors.conf

font_family Iosevka Term SS04
italic_font Iosevka Term SS04 Oblique
bold_font Iosevka Term SS04 Bold
bold_italic_font Iosevka Term SS04 Bold Oblique
font_size 12.0

adjust_line_height 0
adjust_column_width 0
box_drawing_scale 0.001, 1, 1.5, 2

cursor_blink_interval 0.5
cursor_stop_blinking_after 15.0

scrollback_lines 2000
scrollback_pager_history_size 10
scrollback_pager less --chop-long-lines -R +INPUT_LINE_NUMBER

wheel_scroll_multiplier 5.0
click_interval 0.5

select_by_word_characters :@-./_~?&=%+#

shell elvish
editor kak

mouse_hide_wait 0
focus_follows_mouse yes

enabled_layouts *

# 'c' suffix for cells instead of pixels
remember_window_size no
initial_window_width 640
initial_window_height 400
hide_window_decorations no

repaint_delay 15
input_delay 3
sync_to_monitor no

visual_bell_duration 0.0
enable_audio_bell yes
window_alert_on_bell yes
bell_on_tab yes

open_url_modifiers kitty_mod
open_url_with default

rectangle_select_modifiers ctrl+alt

close_on_child_death no
copy_on_select no
allow_remote_control yes
startup_session none
clipboard_control write-clipboard write-primary read-clipboard read-primary
term xterm-kitty

window_border_width 1
window_margin_width 0
window_padding_width 0

inactive_text_alpha 1.0

tab_bar_edge bottom
tab_bar_margin_width 0
# fade | separator
tab_bar_style separator
tab_fade 0.15 0.3 0.45 0.8
tab_separator " ┇"

active_tab_font_style bold-italic
inactive_tab_font_style normal

url_style double

background_opacity 1.0
dynamic_background_opacity no
dim_opacity 0.75

cursor_shape beam

# Key mapping
# http://www.glfw.org/docs/latest/group__keys.html
# http://www.glfw.org/docs/latest/group__mods.html
# The name to use is the part after the `GLFW_KEY_` prefix.
#
# https://github.com/xkbcommon/libxkbcommon/blob/master/xkbcommon/xkbcommon-keysyms.h
# The name to use is the part after the `XKB_KEY_` prefix

# + - chord
# > - sequence
# no_op - unbind
# map key combine <separator> action1 <separator> action2 <separator> action3 ...
kitty_mod ctrl+shift

map ctrl+shift+delete clear_terminal reset active
map kitty_mod+f9 clear_terminal reset active
map kitty_mod+f10 clear_terminal clear active
map kitty_mod+f11 clear_terminal scrollback active

# Clipboard
map kitty_mod+c copy_to_clipboard
map kitty_mod+v paste_from_clipboard
map shift+insert paste_from_selection
# You can also pass the contents of the current selection to any program using
# pass_selection_to_program. By default, the system's open program is used, but
# you can specify your own, for example:
# map kitty_mod+o pass_selection_to_program firefox

# Scrolling
map kitty_mod+up scroll_line_up
map kitty_mod+down scroll_line_down
map kitty_mod+k scroll_line_up
map kitty_mod+j scroll_line_down
map kitty_mod+page_up scroll_page_up
map kitty_mod+page_down scroll_page_down
map kitty_mod+home scroll_home
map kitty_mod+end scroll_end
map kitty_mod+h show_scrollback

# Window management
map kitty_mod+enter new_window
map kitty_mod+w close_window
map kitty_mod+] next_window
map kitty_mod+[ previous_window
map kitty_mod+f move_window_forward
map kitty_mod+b move_window_backward
map kitty_mod+` move_window_to_top
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+right next_tab
map kitty_mod+left previous_tab
map kitty_mod+t new_tab
map kitty_mod+q close_tab
map kitty_mod+l next_layout
map kitty_mod+. move_tab_forward
map kitty_mod+, move_tab_backward
# You can also create shortcuts to go to specific tabs, with 1 being the first tab
# map ctrl+alt+1 goto_tab 1
# map ctrl+alt+2 goto_tab 2

# Layout management
# You can create shortcuts to switch to specific layouts
# map ctrl+alt+1 goto_layout tall
# map ctrl+alt+2 goto_layout stack

# Font sizes
# all | current
map kitty_mod+equal change_font_size all +2.0
map kitty_mod+minus change_font_size all -2.0
map kitty_mod+backspace change_font_size all 0
# map kitty_mod+f6 change_font_size all 10.0
# map kitty_mod+f6 change_font_size current 10.0

# Kittens
# Open a currently visible URL using the keyboard. The program used to open the
# URL is specified in open_url_with.
map kitty_mod+e kitten hints
# Select a path/filename and insert it into the terminal. Useful, for instance to
# run git commands on a filename output from a previous git command.
map kitty_mod+p>f kitten hints --type path --program -
# Select a path/filename and open it with the default open program.
map kitty_mod+p>shift+f kitten hints --type path
# Select a line of text and insert it into the terminal. Use for the
# output of things like: ls -1
map kitty_mod+p>l kitten hints --type line --program -
# Select words and insert into terminal.
map kitty_mod+p>w kitten hints --type word --program -

map kitty_mod+f11 toggle_fullscreen
map kitty_mod+u input_unicode_character
# Open the kitty shell in a new window/tab/overlay/os_window to control kitty using commands.
map kitty_mod+f2 edit_config_file
map kitty_mod+escape kitty_shell overlay
map kitty_mod+a>m set_background_opacity +0.1
map kitty_mod+a>l set_background_opacity -0.1
map kitty_mod+a>1 set_background_opacity 1
map kitty_mod+a>d set_background_opacity default

# Launching and data passing
# source: @selection @text @ansi @{,ansi_}{screen,alternate} none
# target: os_window window tab overlay none
# new_{window,tab,os_window}{,_with_cwd} $program? $source?
# pipe $source $target $program
map f1 pipe @ansi_alternate overlay less +g -R
# map f2 pipe @selection overlay less +g -R
map ctrl+alt+enter new_os_window_with_cwd
map ctrl+g new_tab_with_cwd tig

# Sending arbitrary text on shortcut key presses
# You can tell kitty to send arbitrary (UTF-8) encoded text to
# the client program when pressing specified shortcut keys. For example:
# map ctrl+alt+a send_text all Special text
# This will send "Special text" when you press the Ctrl+Alt+a key combination.
# The text to be sent is a python string literal so you can use escapes like
# \x1b to send control codes or \u21fb to send unicode characters (or you can
# just input the unicode characters directly as UTF-8 text). The first argument
# to send_text is the keyboard modes in which to activate the shortcut. The possible
# values are normal or application or kitty or a comma separated combination of them.
# The special keyword all means all modes. The modes normal and application refer to
# the DECCKM cursor key mode for terminals, and kitty refers to the special kitty
# extended keyboard protocol. Another example, that outputs a word and then moves the cursor
# to the start of the line (same as pressing the Home key):
# map ctrl+alt+a send_text normal Word\x1b[H
# map ctrl+alt+a send_text application Word\x1bOH

clear_all_shortcuts no
# symbol_map U+E0A0-U+E0A2,U+E0B0-U+E0B3 PowerlineSymbols

+ 53
- 0
mpd View File

@@ -0,0 +1,53 @@
music_directory "~/mus/"
db_file "~/.data/mpd/database"
log_file "~/.data/mpd/log"
pid_file "~/.data/mpd/pid"
state_file "~/.data/mpd/state"
playlist_directory "~/.data/mpd/playlists"
log_level "default"
password "password@read,add,control,admin"
default_permissions "read,add,control,admin"
user "solitude"
bind_to_address "127.0.0.1"
bind_to_address "~/.data/mpd/socket"
port "6600"
auto_update "yes"
#auto_update_depth "3"
replaygain "album"
replaygain_preamp "0"
#volume_normalization "no"
#audio_buffer_size "2048"
#buffer_before_play "10%"
#connection_timeout "60"
#max_connections "10"
#max_playlist_length "16384"
#max_command_list_size "2048"
#max_output_buffer_size "8192"
filesystem_charset "UTF-8"
#id3v1_encoding "ISO-8859-1"

input {
plugin "tidal"
enabled "no"
}

audio_output {
type "pulse"
name "mpd pulse"
}

audio_output {
type "fifo"
name "mpd fifo"
path "/tmp/mpd.fifo"
format "48000:16:2"
}

audio_output {
type "httpd"
name "mpd soryegeton"
encoder "opus"
port "8000"
quality "0"
format "48000:16:2"
}

+ 38
- 0
mpv/mpv.conf View File

@@ -0,0 +1,38 @@
msg-module
msg-color

# Video
profile=gpu-hq

# Track Selection
# audio settings
alang=en,eng,English

# Subtitles
slang=eng,en,English
demuxer-mkv-subtitle-preroll=yes

# Screenshot
screenshot-format=png
screenshot-png-compression=9
screenshot-high-bit-depth=no
screenshot-template="~/pic/mpv/%F%#04n%p[%tY%tm%td_%tH]"

# OSD
osd-font="Iosevka SS04"

# Playback Control
[extension.gif]
loop-file=inf

[extension.webm]
loop-file=inf

[extension.mp4]
loop-file=inf

[extension.jpg]
loop-file=inf

[extension.png]
loop-file=inf

+ 1
- 0
mpv/scripts/autoload.lua View File

@@ -0,0 +1 @@
/home/solitude/.data/splug/github.com+mpv-player+mpv/TOOLS/lua/autoload.lua

+ 1
- 0
mpv/scripts/locatefile.lua View File

@@ -0,0 +1 @@
/home/solitude/.data/splug/github.com+nimatrueway+mpv-locatefile-lua-script/locatefile.lua

+ 1
- 0
mpv/scripts/navigator.lua View File

@@ -0,0 +1 @@
/home/solitude/.data/splug/github.com+jonniek+mpv-filenavigator/navigator.lua

+ 1
- 0
mpv/scripts/perfstats.lua View File

@@ -0,0 +1 @@
/home/solitude/.data/splug/github.com+kevinlekiller+mpv_scripts/perfstats/perfstats.lua

+ 1
- 0
mpv/scripts/webm.lua View File

@@ -0,0 +1 @@
/home/solitude/.data/splug/github.com+ElegantMonkey+mpv-webm/build/webm.lua

+ 151
- 0
ncmpcpp View File

@@ -0,0 +1,151 @@
# MPD
mpd_host = "127.0.0.1"
mpd_port = "6600"
mpd_connection_timeout = "5"
;mpd_crossfade_time = "5"
# Directories
mpd_music_dir = "/mnt/media/Music"
ncmpcpp_directory = "~/.config/ncmpcpp"
lyrics_directory = "~/.cache/lyrics"
# General
mouse_list_scroll_whole_page = "no"
lines_scrolled = "1"
message_delay_time = "2"
default_find_mode = "wrapped"
autocenter_mode = "yes"
centered_cursor = "yes"
follow_now_playing_lyrics = "yes"
locked_screen_width_part = "60"
external_editor = "kak"
use_console_editor = "yes"
ask_before_clearing_playlists = "no"
show_duplicate_tags = "no"
incremental_seeking = "yes"
seek_time = "1"
volume_change_step = "2"
execute_on_song_change = ""
execute_on_player_state_change = ""
# Window
user_interface = "alternative"
enable_window_title = "no"
song_window_title_format = "{%a - }{%t}|{%f}"
current_item_prefix = "$(yellow)$r"
current_item_suffix = "$/r$(end)"
current_item_inactive_column_prefix = "$(white)$r"
current_item_inactive_column_suffix = "$/r$(end)"
selected_item_prefix = "$6"
selected_item_suffix = "$9"
discard_colors_if_item_is_selected = "yes"
modified_item_prefix = "$3> $9"
# Header
display_bitrate = "no"
display_remaining_time = "no"
alternative_header_first_line_format = "$b$1$aqqu$/a$9 {%t}|{%f} $1$atqq$/a$9$/b"
alternative_header_second_line_format = "{{$4$b%a$/b$9}{ - $7%b$9}{ ($4%y$9)}}|{%D}"
header_visibility = "no"
# Playlist
playlist_display_mode = "classic"
song_columns_list_format = "(25)[cyan]{a} (40)[]{t} (30)[red]{b} (7f)[green]{l}"
song_list_format = "{%a - }{%t}|{$8%f$9}$R{$3%l$9}"
now_playing_prefix = "$b$2▶ "
now_playing_suffix = "$2$/b$2"
playlist_show_remaining_time = "no"
playlist_shorten_total_times = "yes"
playlist_separate_albums = "yes"
playlist_disable_highlight_delay = "3"
playlist_show_mpd_host = "no"
# Browser
browser_display_mode = "columns"
browser_sort_mode = "format"
browser_sort_format = {%n }{%a - }{%t}|{%f} {(%l)}
browser_playlist_prefix = "$2playlist$9 "
# Library
song_library_format = "{%n - }{%t}|{%f}"
# Leftout
song_status_format = {{%a{ "%b"{ (-- %y --)}} - }{%t}}|{%f}
;song_status_format = " $2%a $4⟫$3⟫ $8%t $4⟫$3⟫ $5%b "
search_engine_display_mode = "columns"
playlist_editor_display_mode = "columns"
;tag_editor_album_format = "{(%y) }%b"
# Colors
main_window_color = "white"
header_window_color = "cyan"
volume_color = "red"
alternative_ui_separator_color = "yellow"
state_line_color = "yellow"
state_flags_color = "red"
progressbar_color = "yellow"
progressbar_elapsed_color = "white"
statusbar_color = "red"
visualizer_color = "blue, cyan, green, yellow, magenta, red"
;visualizer_color = "41, 83, 119, 155, 185, 215, 209, 203, 197, 161"
# Visibility
statusbar_visibility = "yes"
titles_visibility = "yes"
# Progressbar
#progressbar_look = "─╼─"
#progressbar_look = "=>"
#progressbar_look = "─- "
#progressbar_look = "▒▒░"
#progressbar_look = "┅┅┄"
#progressbar_look = "─⊙┄"
#progressbar_look = "─➞─"
#progressbar_look = "─┅─"
#progressbar_look = "▪▪▪"
#progressbar_look = "▪▪▫"
#progressbar_look = "───"
#progressbar_look = "▁▁▁"
#progressbar_look = "‒‒‒"
#progressbar_look = "■◣ "
progressbar_look = "◈◆◇"
# Visualizer
visualizer_in_stereo = "yes"
visualizer_fifo_path = "/tmp/mpd.fifo"
visualizer_output_name = "my_fifo"
visualizer_sync_interval = "30"
visualizer_type = "spectrum"
visualizer_look = "◆▋"
## %l - length
## %f - filename
## %D - directory
## %a - artist
## %A - album artist
## %t - title
## %b - album
## %y - year
## %n - track number (01/12 -> 01)
## %N - full track info (01/12 -> 01/12)
## %g - genre
## %c - composer
## %p - performer
## %d - disc
## %C - comment
## $R - begin right alignment
## $var - set, $/var - unset
## b - bold text
## u - underline text
## r - reverse colors
## a - use alternative character set
## 0 - default window color (discards all other colors)
## 1 - black
## 2 - red
## 3 - green
## 4 - yellow
## 5 - blue
## 6 - magenta
## 7 - cyan
## 8 - white
## 9 - end of current color

+ 88
- 0
neofetch.sh View File

@@ -0,0 +1,88 @@
print_info() {
prin
info title
prin
info OS distro
info Host model
info Kernel kernel
info Uptime uptime
info Packages packages
info Shell shell
info Resolution resolution
info DE de
info WM wm
info Theme theme
info Icons icons
info Terminal term
info 'Terminal Font' term_font
info CPU cpu
info GPU gpu
info Memory memory
prin
info Song song
info cols
}

kernel_shorthand=on
# on off tiny
distro_shorthand=off
os_arch=on
# on off tiny
uptime_shorthand=off
# on off tiny
package_managers=on
shell_path=off
shell_version=on

# scaling_cur_freq scaling_min_freq scaling_max_freq bios_limit.
speed_type=bios_limit
speed_shorthand=on
cpu_brand=on
cpu_speed=on
# logical physical off
cpu_cores=logical
# C F off
cpu_temp=off

gpu_brand=on
# all dedicated integrated
gpu_type=all
refresh_rate=off

gtk_shorthand=on
gtk2=on
gtk3=on

music_player=mpd
song_format="%artist% - %album% - %title%"
song_shorthand=on
mpc_args=()

colors=(distro)
bold=on
underline_enabled=on
underline_char=-
block_range=(0 15)
color_blocks=on
block_width=3
block_height=1

ascii_distro=auto
ascii_colors=(distro)
ascii_bold=on

image_backend=kitty
image_source=$(get_mpd_album_art)
[ -z "$image_source" ] && image_source=$(randfile "$(xdg-user-dir PICTURES)/anzu")
image_loop=off
thumbnail_dir="${XDG_CACHE_HOME:-$HOME/.cache}/thumbnails/neofetch"
# none fit fill *
crop_mode=fill
# northwest north northeast west center
# east southwest south southeast
crop_offset=center
# auto 00px 00% none
image_size=auto
gap=6
yoffset=1
xoffset=3

+ 27
- 0
nim.nim View File

@@ -0,0 +1,27 @@
from macros import error

switch "styleCheck", "hint"

proc setCompiler(s: string) =
let c = findExe s
if c.len == 0:
error s & " binary wasn't found in $PATH."
switch "gcc.exe", c
switch "gcc.linkerexe", c

when defined(win):
setCompiler "x86_64-w64-mingw32-gcc"
switch "gcc.options.linker", ""
switch "os", "windows"
switch "define", "windows"

when defined(musl):
setCompiler "x86_64-linux-musl-gcc"
switch "passL", "-static"

when defined(release):
switch "nimcache", "/tmp/nim/" & projectName() & "/r"
switch "passC", "-flto"
switch "passL", "-s"
else:
switch "nimcache", "/tmp/nim/" & projectName() & "/d"

+ 33
- 0
ntr/contexts/allomancer View File

@@ -0,0 +1,33 @@
meta
name*: allomancer
author: Nequo