Browse Source

ntr fixes and `falcon` theme. nim wasm support. `alias` function in elvish. completion updates.

master
SolitudeSF 3 months ago
parent
commit
8d00af8f46
Signed by: SolitudeSF <solitudesf@protonmail.com> GPG Key ID: 789B06817C385387
9 changed files with 85 additions and 38 deletions
  1. 6
    5
      elvish/lib/completers.elv
  2. 1
    1
      elvish/lib/config.elv
  3. 8
    3
      elvish/rc.elv
  4. 24
    3
      nim.nim
  5. 35
    0
      ntr/contexts/falcon
  6. 1
    1
      ntr/finishers/default
  7. 1
    1
      ntr/templates/dunst
  8. 6
    22
      ranger/scope.sh
  9. 3
    2
      sx.sh

+ 6
- 5
elvish/lib/completers.elv View File

@@ -53,11 +53,12 @@ edit:completion:arg-completer[waifu2x-converter-cpp] = [@cmd]{
53 53
   if (has-value [-i --input -o --output] $cmd[-2]) {
54 54
     edit:complete-filename $cmd[-1]
55 55
   } elif (has-value [-m --mode] $cmd[-2]) {
56
-    put noise scale noise_scale
57
-  } elif (eq $cmd[-2] --noise_level) {
58
-    put 1 2 3
56
+    put noise scale noise-scale
57
+  } elif (eq $cmd[-2] --noise-level) {
58
+    put 0 1 2 3
59 59
   } else {
60
-    put --scale_ratio --noise_level --mode --jobs -i -o
60
+    put --scale-ratio --noise-level --mode --jobs --png-compression \
61
+      --image-quality --silent -i -o
61 62
   }
62 63
 }
63 64
 
@@ -167,7 +168,7 @@ edit:completion:arg-completer[ntr] = [@cmd]{
167 168
 }
168 169
 
169 170
 edit:completion:arg-completer[update] = [@cmd]{
170
-  update | each [x]{ if (has-prefix $x "\t") { put $x[1:] } }
171
+  update | each [x]{ if (has-prefix $x "    ") { put $x[4:] } }
171 172
 }
172 173
 
173 174
 edit:completion:arg-completer[xr] = [@cmd]{

+ 1
- 1
elvish/lib/config.elv View File

@@ -25,7 +25,7 @@ fn sxhkd { edit $conf/sxhkd/sxhkdrc; pkill -USR1 -x sxhkd }
25 25
 fn polybar { edit $ntrtmp/polybar }
26 26
 fn rofi { edit &type=css $conf/rofi/config.rasi }
27 27
 fn dunst { edit $ntrtmp/dunst }
28
-fn elvish { pwd=~/.elvish edit (list -edit elv | select) }
28
+fn elvish { pwd=~/.elvish edit (list -e elv | select) }
29 29
 fn nim { edit $conf/nim/config.nims }
30 30
 fn min { edit $E:HOME/.minrc }
31 31
 fn ntr { pwd=$conf/ntr edit (list | select) }

+ 8
- 3
elvish/rc.elv View File

@@ -3,16 +3,21 @@ use util
3 3
 use config
4 4
 use module
5 5
 
6
-fn ls [@a]{ exa --group-directories-first -s Name $@a }
7
-fn cat [@a]{ bat $@a }
6
+
7
+fn alias [@a]{ put [@b]{ (external $a[0]) (explode $a[1:]) $@b } }
8
+
8 9
 fn xqt [a]{ e $E:XBPS_DISTDIR/srcpkgs/$a/template }
9
-fn xr [@a]{ sudo xbps-remove -R $@a }
10
+
10 11
 fn r [@a]{
11 12
   f = (mktemp)
12 13
   if ?(ranger --choosedir=$f $@a) { cd (e:cat $f) }
13 14
   rm -f $f
14 15
 }
15 16
 
17
+ls~ = (alias exa --group-directories-first -s Name)
18
+cat~ = (alias bat)
19
+xr~ = (alias sudo xbps-remove -R)
20
+
16 21
 -exports- = [&]
17 22
 
18 23
 {

+ 24
- 3
nim.nim View File

@@ -1,13 +1,34 @@
1 1
 from macros import error
2 2
 
3
+type Compiler = enum gcc = "gcc", clang = "clang"
4
+
3 5
 switch "styleCheck", "hint"
4 6
 
5
-proc setCompiler(s: string) =
7
+proc setCompiler(s: string, compiler = gcc, cpp = false) =
6 8
   let c = findExe s
9
+  let cpp = (if cpp: ".cpp" else: "")
7 10
   if c.len == 0:
8 11
     error s & " binary wasn't found in $PATH."
9
-  switch "gcc.exe", c
10
-  switch "gcc.linkerexe", c
12
+  switch $compiler & cpp & ".exe", c
13
+  switch $compiler & cpp & ".linkerexe", c
14
+
15
+when defined(wasm):
16
+  let linkerOptions = "-nostdlib -Wl,--no-entry,--allow-undefined,--gc-sections,--strip-all"
17
+  switch "o", projectName() & ".wasm"
18
+  switch "cpu", "i386"
19
+  switch "cc", "clang"
20
+  switch "d", "release"
21
+  switch "opt", "size"
22
+  switch "stackTrace", "off"
23
+  switch "nomain"
24
+  switch "d", "nimNoLibc"
25
+  switch "d", "noSignalHandler"
26
+  switch "passC", "--target=wasm32-unknown-unknown-wasm"
27
+  switch "passC", "-mexception-handling"
28
+  switch "passC", "-nostdlib"
29
+  switch "passL", "--target=wasm32-unknown-unknown-wasm"
30
+  switch "clang.options.linker", linkerOptions
31
+  switch "clang.cpp.options.linker", linkerOptions
11 32
 
12 33
 when defined(musl):
13 34
   setCompiler "x86_64-linux-musl-gcc"

+ 35
- 0
ntr/contexts/falcon View File

@@ -0,0 +1,35 @@
1
+meta
2
+  name*:  falcon
3
+  author: fenetikm
4
+  source: https://github.com/fenetikm/falcon
5
+
6
+color
7
+  bg:     #020221
8
+  fg:     #b4b4b9
9
+  sel_bg: #ddcfbf
10
+  sel_fg: #36363a
11
+  cursor: #ffe8c0
12
+
13
+color0:   #000004
14
+color8:   #020221
15
+
16
+color1:   #ff3600
17
+color9:   #ff8e78
18
+
19
+color2:   #718e3f
20
+color10:  #b1bf75
21
+
22
+color3:   #ffc552
23
+color11:  #ffd392
24
+
25
+color4:   #635196
26
+color12:  #99a4bc
27
+
28
+color5:   #ff761a
29
+color13:  #ffb07b
30
+
31
+color6:   #34bfa4
32
+color14:  #8bccbf
33
+
34
+color7:   #b4b4b9
35
+color15:  #f8f8ff

+ 1
- 1
ntr/finishers/default View File

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

+ 1
- 1
ntr/templates/dunst View File

@@ -45,7 +45,7 @@ show_indicators = yes
45 45
 
46 46
 icon_position = left
47 47
 max_icon_size = 32
48
-icon_path = /usr/share/icons/Paper/32x32/status/:/usr/share/icons/Paper/32x32/devices/:/usr/share/icons/Paper/32x32/apps/:/usr/share/icons/Paper/32x32/actions
48
+icon_path = /home/solitude/.icons/Paper/32x32/status/:/home/solitude/.icons/Paper/32x32/devices/:/home/solitude/.icons/Paper/32x32/apps/:/home/solitude/.icons/Paper/32x32/actions
49 49
 
50 50
 ### History ###
51 51
 

+ 6
- 22
ranger/scope.sh View File

@@ -1,17 +1,8 @@
1
-#!/bin/bash
1
+#!/usr/bin/env bash
2 2
 
3 3
 set -o noclobber -o noglob -o nounset -o pipefail
4 4
 IFS=$'\n'
5 5
 
6
-# If the option `use_preview_script` is set to `true`,
7
-# then this script will be called and its output will be displayed in ranger.
8
-# ANSI color codes are supported.
9
-# STDIN is disabled, so interactive scripts won't work properly
10
-
11
-# This script is considered a configuration file and must be updated manually.
12
-# It will be left untouched if you upgrade ranger.
13
-
14
-# Meanings of exit codes:
15 6
 # code | meaning    | action of ranger
16 7
 # -----+------------+-------------------------------------------
17 8
 # 0    | success    | Display stdout as preview
@@ -34,9 +25,6 @@ FILE_EXTENSION="${FILE_PATH##*.}"
34 25
 FILE_EXTENSION_LOWER=$(echo "${FILE_EXTENSION}" | tr '[:upper:]' '[:lower:]')
35 26
 
36 27
 # Settings
37
-HIGHLIGHT_SIZE_MAX=262143  # 256KiB
38
-HIGHLIGHT_TABWIDTH=8
39
-HIGHLIGHT_STYLE='pablo'
40 28
 PYGMENTIZE_STYLE='autumn'
41 29
 
42 30
 
@@ -110,10 +98,10 @@ handle_image() {
110 98
             exit 7;;
111 99
 
112 100
         # Video
113
-        # video/*)
114
-        #     # Thumbnail
115
-        #     ffmpegthumbnailer -i "${FILE_PATH}" -o "${IMAGE_CACHE_PATH}" -s 0 && exit 6
116
-        #     exit 1;;
101
+        video/*)
102
+            # Thumbnail
103
+            ffmpegthumbnailer -i "${FILE_PATH}" -o "${IMAGE_CACHE_PATH}" -s 0 && exit 6
104
+            exit 1;;
117 105
         # PDF
118 106
         # application/pdf)
119 107
         #     pdftoppm -f 1 -l 1 \
@@ -173,14 +161,10 @@ handle_mime() {
173 161
             fi
174 162
             if [[ "$( tput colors )" -ge 256 ]]; then
175 163
                 local pygmentize_format='terminal256'
176
-                local highlight_format='xterm256'
177 164
             else
178 165
                 local pygmentize_format='terminal'
179
-                local highlight_format='ansi'
180 166
             fi
181
-            highlight --replace-tabs="${HIGHLIGHT_TABWIDTH}" --out-format="${highlight_format}" \
182
-                --style="${HIGHLIGHT_STYLE}" --force -- "${FILE_PATH}" && exit 5
183
-            # pygmentize -f "${pygmentize_format}" -O "style=${PYGMENTIZE_STYLE}" -- "${FILE_PATH}" && exit 5
167
+            pygmentize -f "${pygmentize_format}" -O "style=${PYGMENTIZE_STYLE}" -- "${FILE_PATH}" && exit 5
184 168
             exit 2;;
185 169
 
186 170
         # Image

+ 3
- 2
sx.sh View File

@@ -1,11 +1,12 @@
1
-xrdb -nocpp "$HOME/.Xresources"
1
+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 5
 wlp &
6 6
 mpd &
7
-dunst &
8 7
 perWindowLayoutD &
8
+disown dunst &
9
+disown unclutter &
9 10
 disown sxhkd &
10 11
 disown devmon -s \
11 12
  --exec-on-drive 'notify-send -a udevil -i media-removable "$l" "$f mounted at $d"' \

Loading…
Cancel
Save