Browse Source

Elvish refactoring. Wallpaper wrapper. kaksource. Lots of minor changes.

master
SolitudeSF 3 years ago
parent
commit
0e63de903c
No known key found for this signature in database
GPG Key ID: 789B06817C385387
  1. 2
      bin/mpw-get
  2. 5
      bin/wlp
  3. 64
      elvish/lib/config.elv
  4. 5
      elvish/rc.elv
  5. 15
      kak/kakrc
  6. 3
      kitty/kitty.conf
  7. 2
      neofetch.sh
  8. 2
      ntr/finishers/default
  9. 70
      ntr/templates/pygments
  10. 8
      profile
  11. 8
      sx.sh

2
bin/mpw-get

@ -3,7 +3,7 @@ t="" @@ -3,7 +3,7 @@ t=""
if (eq 0 (count $args)) {
@sites=(keys (from-json <~/.mpw.d/(get-env MPW_FULLNAME).mpsites.json)[sites])
if (eq ?(tty -s) $ok) {
t=(echo &sep="\n" $@sites | fzy)
t=(echo &sep="\n" $@sites | sk)
} else {
t=(echo &sep="\n" $@sites | rofi -dmenu -p 'Enter site: ' -width 25)
}

5
bin/wlp

@ -0,0 +1,5 @@ @@ -0,0 +1,5 @@
#!/bin/sh
wall_path=$HOME/.wallpaper
cmd='hsetroot -full'
[ -n "$1" ] && printf %s "$1" >"$wall_path"
$cmd "$(cat "$wall_path")"

64
elvish/lib/config.elv

@ -1,30 +1,42 @@ @@ -1,30 +1,42 @@
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 }
fn bedrock { e /bedrock/etc/bedrock.conf }
fn list [@a]{
fd . -L -t f $@a
}
fn select [@a]{
sk --height=35% --layout=reverse -m $@a
}
fn edit [&type='' @a]{
settype = []
if (not-eq $type '') {
settype = ['-e' 'set buffer filetype '$type]
}
kak $@settype $@a
}
fn profile { edit $E:HOME/.profile }
fn sx { edit &type=sh $conf/sx/sxrc }
fn git { edit $conf/git/config }
fn xbps-src { edit &type=sh $E:XBPS_DISTDIR/etc/conf }
fn bspwm { edit &type=sh $conf/bspwm/bspwmrc }
fn sxhkd { edit $conf/sxhkd/sxhkdrc; pkill -USR1 -x sxhkd }
fn polybar { edit $ntrtmp/polybar }
fn rofi { edit &type=css $conf/rofi/config.rasi }
fn dunst { edit $ntrtmp/dunst }
fn elvish { pwd=~/.elvish edit (list -edit elv | select) }
fn nim { edit $conf/nim/config.nims }
fn min { edit $E:HOME/.minrc }
fn ntr { pwd=$conf/ntr edit (list | select) }
fn splug { edit $conf/splug/config.toml }
fn kitty { edit &type=ini $conf/kitty/kitty.conf }
fn kitty-diff { edit &type=ini $conf/kitty/diff.conf }
fn kitty-colors { edit &type=ini $dot/ntr/templates/kitty-colors }
fn ranger { edit $conf/ranger/rc.conf }
fn rifle { edit $conf/ranger/rifle.conf }
fn kak { edit $conf/kak/kakrc }
fn pqiv { edit $conf/pqivrc }
fn mpv { edit $conf/mpv/mpv.conf }
fn ncmpcpp { edit &type=ini $conf/ncmpcpp/config }
fn bedrock { edit /bedrock/etc/bedrock.conf; sudo brl apply }

5
elvish/rc.elv

@ -3,12 +3,13 @@ use util @@ -3,12 +3,13 @@ use util
use config
use module
fn ls [@a]{ e:exa --group-directories-first -s Name $@a }
fn ls [@a]{ exa --group-directories-first -s Name $@a }
fn cat [@a]{ bat $@a }
fn xqt [a]{ e $E:XBPS_DISTDIR/srcpkgs/$a/template }
fn xr [@a]{ sudo xbps-remove -R $@a }
fn r [@a]{
f = (mktemp)
if ?(ranger --choosedir=$f $@a) { cd (cat $f) }
if ?(ranger --choosedir=$f $@a) { cd (e:cat $f) }
rm -f $f
}

15
kak/kakrc

@ -1,13 +1,13 @@ @@ -1,13 +1,13 @@
# Manually merge and source plugins
eval %sh{
cat $(find "$kak_config/autosource" -name '*\.kak')
kaksource "$kak_config/autosource"
kak-lsp --kakoune -s $kak_session
colorcol
}
# Initialization
decl -hidden regex curword
decl str termcmd 'kitty -1 sh -c'
set global ui_options ncurses_assistant=none
set global scrolloff 7,7
@ -15,14 +15,15 @@ set global autoreload yes @@ -15,14 +15,15 @@ set global autoreload yes
set global kitty_window_type kitty
set global grepcmd 'rg -iHL --column'
set global modelinefmt '%opt{modeline_git_branch} %val{bufname}
%val{cursor_line}:%val{cursor_char_column} {{mode_info}} {{context_info}}
◂%val{client}⊙%val{session}▸'
%val{cursor_line}:%val{cursor_char_column} {{mode_info}}
{{context_info}}◂%val{client}⊙%val{session}▸'
set global connect_source "%val{config}/autosource/splug"
set global connect_shell elvish
set global fzf_implementation sk
set global fzf_file_command fd
set global fzf_highlighter bat
set global fzf_highlight_cmd bat
set global fzf_sk_grep_command 'rg -LHn'
unalias global e edit
alias global e edit-or-dir
@ -162,6 +163,9 @@ hook global BufReload .* %{ git show-diff } @@ -162,6 +163,9 @@ hook global BufReload .* %{ git show-diff }
hook global WinCreate .* %{
auto-pairs-enable
search-highlighter-enable
colorcol-enable
colorcol-auto-refresh
discord-presence-enable
}
hook global BufWritePre .* %{ nop %sh{
@ -203,7 +207,6 @@ hook global WinSetOption filetype=elvish %{ @@ -203,7 +207,6 @@ hook global WinSetOption filetype=elvish %{
hook global WinSetOption filetype=(go|rust|python) %{
lsp-engage
set global lsp_server_configuration pyls.plugins.jedi_completion.include_params=false
hook window BufWritePre .* lsp-formatting-sync
}
hook global WinSetOption filetype=nim %{

3
kitty/kitty.conf

@ -216,5 +216,4 @@ map ctrl+g new_tab_with_cwd tig @@ -216,5 +216,4 @@ map ctrl+g new_tab_with_cwd tig
# 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
symbol_map U+23FB-U+23FE,U+2B58,U+E200-U+E2A9,U+E0A0-U+E0A3,U+E0B0-U+E0BF,U+E0C0-U+E0C8,U+E0CC-U+E0CF,U+E0D0-U+E0D2,U+E0D4,U+E700-U+E7C5,U+F000-U+F2E0,U+2665,U+26A1,U+F400-U+F4A8,U+F67C,U+E000-U+E00A,U+F300-U+F313,U+E5FA-U+E62B 3270Medium Nerd Font Mono

2
neofetch.sh

@ -72,7 +72,7 @@ ascii_colors=(distro) @@ -72,7 +72,7 @@ ascii_colors=(distro)
ascii_bold=on
image_backend=kitty
image_source=$(get_mpd_album_art)
image_source=$(getmpdalbumart)
[ -z "$image_source" ] && image_source=$(randfile "$(xdg-user-dir PICTURES)/anzu")
image_loop=off
thumbnail_dir="${XDG_CACHE_HOME:-$HOME/.cache}/thumbnails/neofetch"

2
ntr/finishers/default

@ -1,2 +1,2 @@ @@ -1,2 +1,2 @@
#!/bin/sh
[ -n "$NTR_wallpaper" ] && setroot --store -z "$NTR_wallpaper" || return 0
[ -n "$NTR_wallpaper" ] && wlp "$NTR_wallpaper"

70
ntr/templates/pygments

@ -0,0 +1,70 @@ @@ -0,0 +1,70 @@
from pygments.style import Style
from pygments.token import (
Comment,
Error,
Keyword,
Literal,
Name,
Number,
Operator,
String,
Text,
)
class NTRStyle(Style):
base00 = "<{color0}>"
base01 = "<{color1}>"
base02 = "<{color2}>"
base03 = "<{color3}>"
base04 = "<{color4}>"
base05 = "<{color5}>"
base06 = "<{color6}>"
base07 = "<{color7}>"
base08 = "<{color8}>"
base09 = "<{color9}>"
base0a = "<{color10}>"
base0b = "<{color11}>"
base0c = "<{color12}>"
base0d = "<{color13}>"
base0e = "<{color14}>"
base0f = "<{color15}>"
default_style = ""
background_color = base00
highlight_color = base02
styles = {
Text: base05,
Error: base08, # .err
Comment: base03, # .c
Comment.Preproc: base0f, # .cp
Comment.PreprocFile: base0b, # .cpf
Keyword: base0e, # .k
Keyword.Type: base08, # .kt
Name.Attribute: base0d, # .na
Name.Builtin: base0d, # .nb
Name.Builtin.Pseudo: base08, # .bp
Name.Class: base0d, # .nc
Name.Constant: base09, # .no
Name.Decorator: base09, # .nd
Name.Function: base0d, # .nf
Name.Namespace: base0d, # .nn
Name.Tag: base0e, # .nt
Name.Variable: base0d, # .nv
Name.Variable.Instance: base08, # .vi
Number: base09, # .m
Operator: base0c, # .o
Operator.Word: base0e, # .ow
Literal: base0b, # .l
String: base0b, # .s
String.Interpol: base0f, # .si
String.Regex: base0c, # .sr
String.Symbol: base09, # .ss
}
NTRStyle.__name__ = "NTRStyle"
globals()[NTRStyle.__name__] = globals()["NTRStyle"]
del globals()["NTRStyle"]

8
profile

@ -21,8 +21,8 @@ PAGER=less @@ -21,8 +21,8 @@ PAGER=less
MANPAGER=less
QT_QPA_PLATFORMTHEME=gtk2
LESSHISTFILE='-'
GTK2_RC_FILES=$XDG_CONFIG_HOME/gtk-2.0/gtkrc
LESSHISTFILE="-"
GNUPGHOME=$XDG_DATA_HOME/gnupg
GPG_AGENT_INFO=$GNUPGHOME/S.gpg-agent:0:1
@ -34,9 +34,9 @@ unset LS_COLORS @@ -34,9 +34,9 @@ unset LS_COLORS
# Mass export
export \
XDG_DATA_HOME XDG_RUNTIME_DIR XDG_CACHE_HOME XDG_CONFIG_HOME XDG_RUNTIME_DIR \
XBPS_DISTDIR DOTS_DIR GTK2_RC_FILES LESSHISTFILE TERMINAL EDITOR VISUAL \
PAGER MANPAGER GPG_TTY GPG_AGENT_INFO GNUPGHOME QT_QPA_PLATFORMTHEME \
_JAVA_AWT_WM_NONREPARENTING _JAVA_OPTIONS GOPATH CARGO_HOME
XBPS_DISTDIR DOTS_DIR GTK2_RC_FILES TERMINAL EDITOR VISUAL PAGER MANPAGER \
GOPATH CARGO_HOME GPG_TTY GPG_AGENT_INFO GNUPGHOME QT_QPA_PLATFORMTHEME \
_JAVA_AWT_WM_NONREPARENTING _JAVA_OPTIONS LESSHISTFILE
# Init sharable {ssh,gpg}-agent
if [ -z "$SSH_AUTH_SOCK" ]; then

8
sx.sh

@ -2,15 +2,15 @@ xrdb -nocpp "$HOME/.Xresources" @@ -2,15 +2,15 @@ xrdb -nocpp "$HOME/.Xresources"
xsetroot -cursor_name left_ptr &
setxkbmap -layout us,ru -variant ,ruu -option 'grp:shift_caps_toggle,grp_led:scroll,lv3:ralt_switch,compose:rwin-altgr,nbsp:level3' &
start-pulseaudio-x11 &
setroot --restore &
wlp &
mpd &
dunst &
perWindowLayoutD &
disown sxhkd &
disown devmon -s \
--exec-on-drive 'notify-send -a udevil -i media-removable "$l" "$f mounted at $d"' \
--exec-on-unmount 'notify-send -a udevil -i media-removable "$l" "$f unmounted from $d"' \
--exec-on-removed 'notify-send -a udevil -i media-removable "$l" "$f removed from $d"' &
--exec-on-drive 'notify-send -a udevil -i media-removable "$l" "$f mounted at $d"' \
--exec-on-unmount 'notify-send -a udevil -i media-removable "$l" "$f unmounted from $d"' \
--exec-on-remove 'notify-send -a udevil -i media-removable "$l" "$f removed from $d"' &
disown syncthing -no-browser &
disown polybar -q main &
exec bspwm

Loading…
Cancel
Save