Browse Source

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

master
SolitudeSF 5 months ago
parent
commit
8d00af8f46
No known key found for this signature in database
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]{
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
put noise scale noise-scale
} elif (eq $cmd[-2] --noise-level) {
put 0 1 2 3
} else {
put --scale_ratio --noise_level --mode --jobs -i -o
put --scale-ratio --noise-level --mode --jobs --png-compression \
--image-quality --silent -i -o
}
}

@@ -167,7 +168,7 @@ edit:completion:arg-completer[ntr] = [@cmd]{
}

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

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 }
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 elvish { pwd=~/.elvish edit (list -e elv | select) }
fn nim { edit $conf/nim/config.nims }
fn min { edit $E:HOME/.minrc }
fn ntr { pwd=$conf/ntr edit (list | select) }

+ 8
- 3
elvish/rc.elv View File

@@ -3,16 +3,21 @@ use util
use config
use module

fn ls [@a]{ exa --group-directories-first -s Name $@a }
fn cat [@a]{ bat $@a }

fn alias [@a]{ put [@b]{ (external $a[0]) (explode $a[1:]) $@b } }

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 (e:cat $f) }
rm -f $f
}

ls~ = (alias exa --group-directories-first -s Name)
cat~ = (alias bat)
xr~ = (alias sudo xbps-remove -R)

-exports- = [&]

{

+ 24
- 3
nim.nim View File

@@ -1,13 +1,34 @@
from macros import error

type Compiler = enum gcc = "gcc", clang = "clang"

switch "styleCheck", "hint"

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

when defined(wasm):
let linkerOptions = "-nostdlib -Wl,--no-entry,--allow-undefined,--gc-sections,--strip-all"
switch "o", projectName() & ".wasm"
switch "cpu", "i386"
switch "cc", "clang"
switch "d", "release"
switch "opt", "size"
switch "stackTrace", "off"
switch "nomain"
switch "d", "nimNoLibc"
switch "d", "noSignalHandler"
switch "passC", "--target=wasm32-unknown-unknown-wasm"
switch "passC", "-mexception-handling"
switch "passC", "-nostdlib"
switch "passL", "--target=wasm32-unknown-unknown-wasm"
switch "clang.options.linker", linkerOptions
switch "clang.cpp.options.linker", linkerOptions

when defined(musl):
setCompiler "x86_64-linux-musl-gcc"

+ 35
- 0
ntr/contexts/falcon View File

@@ -0,0 +1,35 @@
meta
name*: falcon
author: fenetikm
source: https://github.com/fenetikm/falcon

color
bg: #020221
fg: #b4b4b9
sel_bg: #ddcfbf
sel_fg: #36363a
cursor: #ffe8c0

color0: #000004
color8: #020221

color1: #ff3600
color9: #ff8e78

color2: #718e3f
color10: #b1bf75

color3: #ffc552
color11: #ffd392

color4: #635196
color12: #99a4bc

color5: #ff761a
color13: #ffb07b

color6: #34bfa4
color14: #8bccbf

color7: #b4b4b9
color15: #f8f8ff

+ 1
- 1
ntr/finishers/default View File

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

+ 1
- 1
ntr/templates/dunst View File

@@ -45,7 +45,7 @@ show_indicators = yes

icon_position = left
max_icon_size = 32
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
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

### History ###


+ 6
- 22
ranger/scope.sh View File

@@ -1,17 +1,8 @@
#!/bin/bash
#!/usr/bin/env bash

set -o noclobber -o noglob -o nounset -o pipefail
IFS=$'\n'

# If the option `use_preview_script` is set to `true`,
# then this script will be called and its output will be displayed in ranger.
# ANSI color codes are supported.
# STDIN is disabled, so interactive scripts won't work properly

# This script is considered a configuration file and must be updated manually.
# It will be left untouched if you upgrade ranger.

# Meanings of exit codes:
# code | meaning | action of ranger
# -----+------------+-------------------------------------------
# 0 | success | Display stdout as preview
@@ -34,9 +25,6 @@ FILE_EXTENSION="${FILE_PATH##*.}"
FILE_EXTENSION_LOWER=$(echo "${FILE_EXTENSION}" | tr '[:upper:]' '[:lower:]')

# Settings
HIGHLIGHT_SIZE_MAX=262143 # 256KiB
HIGHLIGHT_TABWIDTH=8
HIGHLIGHT_STYLE='pablo'
PYGMENTIZE_STYLE='autumn'


@@ -110,10 +98,10 @@ handle_image() {
exit 7;;

# Video
# video/*)
# # Thumbnail
# ffmpegthumbnailer -i "${FILE_PATH}" -o "${IMAGE_CACHE_PATH}" -s 0 && exit 6
# exit 1;;
video/*)
# Thumbnail
ffmpegthumbnailer -i "${FILE_PATH}" -o "${IMAGE_CACHE_PATH}" -s 0 && exit 6
exit 1;;
# PDF
# application/pdf)
# pdftoppm -f 1 -l 1 \
@@ -173,14 +161,10 @@ handle_mime() {
fi
if [[ "$( tput colors )" -ge 256 ]]; then
local pygmentize_format='terminal256'
local highlight_format='xterm256'
else
local pygmentize_format='terminal'
local highlight_format='ansi'
fi
highlight --replace-tabs="${HIGHLIGHT_TABWIDTH}" --out-format="${highlight_format}" \
--style="${HIGHLIGHT_STYLE}" --force -- "${FILE_PATH}" && exit 5
# pygmentize -f "${pygmentize_format}" -O "style=${PYGMENTIZE_STYLE}" -- "${FILE_PATH}" && exit 5
pygmentize -f "${pygmentize_format}" -O "style=${PYGMENTIZE_STYLE}" -- "${FILE_PATH}" && exit 5
exit 2;;

# Image

+ 3
- 2
sx.sh View File

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

Loading…
Cancel
Save