Browse Source

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

master
SolitudeSF 3 months ago
parent
commit
0e63de903c
Signed by: SolitudeSF <solitudesf@protonmail.com> GPG Key ID: 789B06817C385387
11 changed files with 137 additions and 47 deletions
  1. 1
    1
      bin/mpw-get
  2. 5
    0
      bin/wlp
  3. 38
    26
      elvish/lib/config.elv
  4. 3
    2
      elvish/rc.elv
  5. 9
    6
      kak/kakrc
  6. 1
    2
      kitty/kitty.conf
  7. 1
    1
      neofetch.sh
  8. 1
    1
      ntr/finishers/default
  9. 70
    0
      ntr/templates/pygments
  10. 4
    4
      profile
  11. 4
    4
      sx.sh

+ 1
- 1
bin/mpw-get View File

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

+ 5
- 0
bin/wlp View File

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

+ 38
- 26
elvish/lib/config.elv View File

@@ -1,30 +1,42 @@
1 1
 conf = (get-env XDG_CONFIG_HOME)
2 2
 dot = (get-env DOTS_DIR)
3 3
 ntrtmp = $conf/ntr/templates
4
-setini = ['-e' 'set buffer filetype ini']
5
-fn e [@a]{ kak $@a }
6 4
 
7
-fn profile { e $E:HOME/.profile }
8
-fn sx { e $conf/sx/sxrc }
9
-fn git { e $conf/git/config }
10
-fn xbps-src { e -e 'set buffer filetype sh' $E:XBPS_DISTDIR/etc/conf }
11
-fn bspwm { e $conf/bspwm/bspwmrc }
12
-fn sxhkd { e $conf/sxhkd/sxhkdrc; pkill -USR1 -x sxhkd }
13
-fn polybar { e $ntrtmp/polybar }
14
-fn rofi { e $conf/rofi/config.rasi }
15
-fn dunst { e $ntrtmp/dunst }
16
-fn elvish { pwd=~/.elvish e (fd . -L -e elv | fzy) }
17
-fn nim { e $conf/nim/config.nims }
18
-fn min { e $E:HOME/.minrc }
19
-fn ntr { pwd=$conf/ntr e (fd . -L | fzy) }
20
-fn splug { e $conf/splug/config.toml }
21
-fn kitty { e $@setini $conf/kitty/kitty.conf }
22
-fn kitty-diff { e $@setini $conf/kitty/diff.conf }
23
-fn kitty-colors { e $@setini $dot/ntr/templates/kitty-colors }
24
-fn ranger { e $conf/ranger/rc.conf }
25
-fn rifle { e $conf/ranger/rifle.conf }
26
-fn kak { e $conf/kak/kakrc }
27
-fn pqiv { e $conf/pqivrc }
28
-fn mpv { e $conf/mpv/mpv.conf }
29
-fn ncmpcpp { e $@setini $conf/ncmpcpp/config }
30
-fn bedrock { e /bedrock/etc/bedrock.conf }
5
+fn list [@a]{
6
+  fd . -L -t f $@a
7
+}
8
+fn select [@a]{
9
+  sk --height=35% --layout=reverse -m $@a
10
+}
11
+fn edit [&type='' @a]{
12
+  settype = []
13
+  if (not-eq $type '') {
14
+    settype = ['-e' 'set buffer filetype '$type]
15
+  }
16
+  kak $@settype $@a
17
+}
18
+
19
+fn profile { edit $E:HOME/.profile }
20
+fn sx { edit &type=sh $conf/sx/sxrc }
21
+fn git { edit $conf/git/config }
22
+fn xbps-src { edit &type=sh $E:XBPS_DISTDIR/etc/conf }
23
+fn bspwm { edit &type=sh $conf/bspwm/bspwmrc }
24
+fn sxhkd { edit $conf/sxhkd/sxhkdrc; pkill -USR1 -x sxhkd }
25
+fn polybar { edit $ntrtmp/polybar }
26
+fn rofi { edit &type=css $conf/rofi/config.rasi }
27
+fn dunst { edit $ntrtmp/dunst }
28
+fn elvish { pwd=~/.elvish edit (list -edit elv | select) }
29
+fn nim { edit $conf/nim/config.nims }
30
+fn min { edit $E:HOME/.minrc }
31
+fn ntr { pwd=$conf/ntr edit (list | select) }
32
+fn splug { edit $conf/splug/config.toml }
33
+fn kitty { edit &type=ini $conf/kitty/kitty.conf }
34
+fn kitty-diff { edit &type=ini $conf/kitty/diff.conf }
35
+fn kitty-colors { edit &type=ini $dot/ntr/templates/kitty-colors }
36
+fn ranger { edit $conf/ranger/rc.conf }
37
+fn rifle { edit $conf/ranger/rifle.conf }
38
+fn kak { edit $conf/kak/kakrc }
39
+fn pqiv { edit $conf/pqivrc }
40
+fn mpv { edit $conf/mpv/mpv.conf }
41
+fn ncmpcpp { edit &type=ini $conf/ncmpcpp/config }
42
+fn bedrock { edit /bedrock/etc/bedrock.conf; sudo brl apply }

+ 3
- 2
elvish/rc.elv View File

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

+ 9
- 6
kak/kakrc View File

@@ -1,13 +1,13 @@
1 1
 # Manually merge and source plugins
2 2
 eval %sh{
3
-    cat $(find "$kak_config/autosource" -name '*\.kak')
3
+    kaksource "$kak_config/autosource"
4 4
     kak-lsp --kakoune -s $kak_session
5
+    colorcol
5 6
 }
6 7
 
7 8
 # Initialization
8 9
 
9 10
 decl -hidden regex curword
10
-decl str termcmd 'kitty -1 sh -c'
11 11
 
12 12
 set global ui_options ncurses_assistant=none
13 13
 set global scrolloff 7,7
@@ -15,14 +15,15 @@ set global autoreload yes
15 15
 set global kitty_window_type kitty
16 16
 set global grepcmd 'rg -iHL --column'
17 17
 set global modelinefmt '%opt{modeline_git_branch} %val{bufname}
18
-%val{cursor_line}:%val{cursor_char_column} {{mode_info}} {{context_info}}
19
-◂%val{client}⊙%val{session}▸'
18
+%val{cursor_line}:%val{cursor_char_column} {{mode_info}}
19
+{{context_info}}◂%val{client}⊙%val{session}▸'
20 20
 
21 21
 set global connect_source "%val{config}/autosource/splug"
22 22
 set global connect_shell elvish
23 23
 set global fzf_implementation sk
24 24
 set global fzf_file_command fd
25
-set global fzf_highlighter bat
25
+set global fzf_highlight_cmd bat
26
+set global fzf_sk_grep_command 'rg -LHn'
26 27
 
27 28
 unalias global e edit
28 29
 alias global e edit-or-dir
@@ -162,6 +163,9 @@ hook global BufReload    .* %{ git show-diff }
162 163
 hook global WinCreate .* %{
163 164
     auto-pairs-enable
164 165
     search-highlighter-enable
166
+    colorcol-enable
167
+    colorcol-auto-refresh
168
+    discord-presence-enable
165 169
 }
166 170
 
167 171
 hook global BufWritePre .* %{ nop %sh{
@@ -203,7 +207,6 @@ hook global WinSetOption filetype=elvish %{
203 207
 hook global WinSetOption filetype=(go|rust|python) %{
204 208
     lsp-engage
205 209
     set global lsp_server_configuration pyls.plugins.jedi_completion.include_params=false
206
-    hook window BufWritePre .* lsp-formatting-sync
207 210
 }
208 211
 
209 212
 hook global WinSetOption filetype=nim %{

+ 1
- 2
kitty/kitty.conf View File

@@ -216,5 +216,4 @@ map ctrl+g new_tab_with_cwd tig
216 216
 # map ctrl+alt+a send_text normal Word\x1b[H
217 217
 # map ctrl+alt+a send_text application Word\x1bOH
218 218
 
219
-clear_all_shortcuts no
220
-# symbol_map U+E0A0-U+E0A2,U+E0B0-U+E0B3 PowerlineSymbols
219
+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

+ 1
- 1
neofetch.sh View File

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

+ 1
- 1
ntr/finishers/default View File

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

+ 70
- 0
ntr/templates/pygments View File

@@ -0,0 +1,70 @@
1
+from pygments.style import Style
2
+from pygments.token import (
3
+    Comment,
4
+    Error,
5
+    Keyword,
6
+    Literal,
7
+    Name,
8
+    Number,
9
+    Operator,
10
+    String,
11
+    Text,
12
+)
13
+
14
+
15
+class NTRStyle(Style):
16
+    base00 = "<{color0}>"
17
+    base01 = "<{color1}>"
18
+    base02 = "<{color2}>"
19
+    base03 = "<{color3}>"
20
+    base04 = "<{color4}>"
21
+    base05 = "<{color5}>"
22
+    base06 = "<{color6}>"
23
+    base07 = "<{color7}>"
24
+    base08 = "<{color8}>"
25
+    base09 = "<{color9}>"
26
+    base0a = "<{color10}>"
27
+    base0b = "<{color11}>"
28
+    base0c = "<{color12}>"
29
+    base0d = "<{color13}>"
30
+    base0e = "<{color14}>"
31
+    base0f = "<{color15}>"
32
+
33
+    default_style = ""
34
+
35
+    background_color = base00
36
+    highlight_color = base02
37
+
38
+    styles = {
39
+        Text: base05,
40
+        Error: base08,  # .err
41
+        Comment: base03,  # .c
42
+        Comment.Preproc: base0f,  # .cp
43
+        Comment.PreprocFile: base0b,  # .cpf
44
+        Keyword: base0e,  # .k
45
+        Keyword.Type: base08,  # .kt
46
+        Name.Attribute: base0d,  # .na
47
+        Name.Builtin: base0d,  # .nb
48
+        Name.Builtin.Pseudo: base08,  # .bp
49
+        Name.Class: base0d,  # .nc
50
+        Name.Constant: base09,  # .no
51
+        Name.Decorator: base09,  # .nd
52
+        Name.Function: base0d,  # .nf
53
+        Name.Namespace: base0d,  # .nn
54
+        Name.Tag: base0e,  # .nt
55
+        Name.Variable: base0d,  # .nv
56
+        Name.Variable.Instance: base08,  # .vi
57
+        Number: base09,  # .m
58
+        Operator: base0c,  # .o
59
+        Operator.Word: base0e,  # .ow
60
+        Literal: base0b,  # .l
61
+        String: base0b,  # .s
62
+        String.Interpol: base0f,  # .si
63
+        String.Regex: base0c,  # .sr
64
+        String.Symbol: base09,  # .ss
65
+    }
66
+
67
+
68
+NTRStyle.__name__ = "NTRStyle"
69
+globals()[NTRStyle.__name__] = globals()["NTRStyle"]
70
+del globals()["NTRStyle"]

+ 4
- 4
profile View File

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

+ 4
- 4
sx.sh View File

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

Loading…
Cancel
Save