Beaucoup de changements, du coup, je ne sais plus lesquels

This commit is contained in:
Benjamin VAUDOUR 2022-08-09 13:32:42 +02:00
parent 19045449bc
commit 4f5dd6ea11
7 changed files with 39 additions and 12 deletions

View File

@ -1,11 +1,11 @@
edit:add-var adguard~ {|@argv| edit:add-var adguard~ {|@argv|
use str use str
sudo chattr -i /etc/resolv.conf doas chattr -i /etc/resolv.conf
var beg = 's|^.*\(192\.168\.0\.25\)|' var beg = 's|^.*\(192\.168\.0\.25\)|'
var end = 'nameserver \1|' var end = 'nameserver \1|'
if (and (> (count $argv) 0) (str:has-prefix $argv[0] u)) { if (and (> (count $argv) 0) (str:has-prefix $argv[0] u)) {
set end = '# '$end set end = '# '$end
} }
sudo sed -i $beg$end /etc/resolv.conf doas sed -i $beg$end /etc/resolv.conf
sudo chattr +i /etc/resolv.conf doas chattr +i /etc/resolv.conf
} }

View File

@ -10,10 +10,13 @@ edit:add-var du~ {|@argv| e:du -h $@argv }
#edit:add-var git~ $e:hub~ #edit:add-var git~ $e:hub~
edit:add-var grep~ {|@argv| e:grep --color=tty -d skip $@argv } edit:add-var grep~ {|@argv| e:grep --color=tty -d skip $@argv }
#edit:add-var grep~ {|@argv| e:ack $@argv } #edit:add-var grep~ {|@argv| e:ack $@argv }
edit:add-var hx~ {|@argv| e:helix $@argv }
edit:add-var mv~ {|@argv| e:mv -iv $@argv } edit:add-var mv~ {|@argv| e:mv -iv $@argv }
edit:add-var pf~ {|@argv| e:pkgfile -vri $@argv } edit:add-var pf~ {|@argv| e:pkgfile -vri $@argv }
edit:add-var rm~ {|@argv| e:rm -Iv $@argv } edit:add-var rm~ {|@argv| e:rm -Iv $@argv }
edit:add-var rename~ $e:go-rename~ edit:add-var rename~ $e:go-rename~
edit:add-var sudo~ {|@argv| fail 'Use doas instead'}
edit:add-var timidity~ {|@argv| e:timidity -a -K -1 $@argv } edit:add-var timidity~ {|@argv| e:timidity -a -K -1 $@argv }
edit:add-var tree~ {|@argv| e:tree -puhC --dirsfirst --du -D $@argv } edit:add-var tree~ {|@argv| e:tree -puhC --dirsfirst --du -D $@argv }
edit:add-var wget~ {|@argv| e:wget2 $@argv } edit:add-var ungron~ {|@argv| e:gron --ungron $@argv }
#edit:add-var wget~ {|@argv| e:wget2 $@argv }

View File

@ -3,7 +3,7 @@ use str
fn -check {|f| fn -check {|f|
use str use str
var @missings = (try { var @missings = (try {
sudo ldd $f 2>/dev/null | grep 'not found' | eawk {|_ m @_| put $m } doas ldd $f 2>/dev/null | grep 'not found' | eawk {|_ m @_| put $m }
} catch e { } catch e {
}) })
if (> (count $missings) 1) { if (> (count $missings) 1) {
@ -20,17 +20,17 @@ fn -check-executable {|f|
fn -cbin {|| fn -cbin {||
echo (styled 'Searching broken binaries…' bold bright-yellow) echo (styled 'Searching broken binaries…' bold bright-yellow)
sudo find /usr/bin -maxdepth 1 -type f 2>/dev/null | each $-check~ doas find /usr/bin -maxdepth 1 -type f 2>/dev/null | each $-check~
} }
fn -clib {|| fn -clib {||
echo (styled 'Searching broken libs…' bold bright-yellow) echo (styled 'Searching broken libs…' bold bright-yellow)
sudo find /usr/lib/*.so* -maxdepth 1 -type f 2>/dev/null | each $-check-executable~ doas find /usr/lib/*.so* -maxdepth 1 -type f 2>/dev/null | each $-check-executable~
} }
fn -copt {|| fn -copt {||
echo (styled 'Searching broken binariess in opt…' bold bright-yellow) echo (styled 'Searching broken binariess in opt…' bold bright-yellow)
sudo find /opt -maxdepth 3 -type f 2>/dev/null | each $-check-executable~ doas find /opt -maxdepth 3 -type f 2>/dev/null | each $-check-executable~
} }
edit:add-var checklinks~ {|| edit:add-var checklinks~ {||

21
aliases/transfer.elv Normal file
View File

@ -0,0 +1,21 @@
var domain = https://transfer.hostux.net/
edit:add-var transfer~ {|@argv|
use path
if (not-eq (count $argv) 0) {
fail('Usage: transfer <fichier_ou_repertoire>')
}
var file = $argv[0]
var filename = (basename $file)
var is_dir = (path:is-dir &follow-symlink=$true $file)
var is_regular = (path:is-regular &follow-symlink=$true $file)
if (not (and is_dir is_regular)) {
fail("'"$file"' nexiste pas")
}
if is_dir {
set filename = $filename'.tar.gz'
cd $file
tar -c . | e:curl --progress-bar --upload-file - $domain$filename | tee /dev/null
} else {
cat $file | e:curl --progress-bar --upload-file - $domain$filename | teee /dev/null
}
}

View File

@ -1,6 +1,6 @@
edit:add-var upd~ {|@args| edit:add-var upd~ {|@args|
if ?(mirror-check --fast) { if ?(mirror-check --fast) {
sudo pacman -Syu doas pacman -Syu
} }
} }

View File

@ -1,4 +1,5 @@
var cmd = $e:vim~ var cmd = $e:nvim~
#var cmd = $e:helix~
#var cmd = $e:kak~ #var cmd = $e:kak~
#var cmd = $e:emacs~ #var cmd = $e:emacs~

6
rc.elv
View File

@ -1,7 +1,9 @@
#set-env BAT_THEME Coldark-Cold #set-env BAT_THEME Coldark-Cold
set-env BAT_PAGER 'less -RF' set-env BAT_PAGER 'less -RF'
set-env EDITOR vim #set-env EDITOR vim
set-env VIEW 'vim -R' set-env EDITOR kak
#set-env VIEW 'vim -R'
set-env VIEW 'kak -ro'
set-env CURRENT_SHELL 'elvish' set-env CURRENT_SHELL 'elvish'
set-env STARSHIP_CONFIG ~/.config/starship/starship.toml set-env STARSHIP_CONFIG ~/.config/starship/starship.toml
set-env PERL5LIB /home/benjamin/perl5/lib/perl5 set-env PERL5LIB /home/benjamin/perl5/lib/perl5