From 8f91a8163b009d9727fb43247542636e7fb08f42 Mon Sep 17 00:00:00 2001 From: Samuel Ortion Date: Wed, 16 Aug 2023 08:41:12 +0200 Subject: [PATCH] feat: Add lp-mouse, and amended latexmkrc --- .aliases | 12 ++++---- .gitmodules | 3 ++ .latexmkrc | 70 ++++++++++++++++++++++++++++++++++++------- .loadenv.sh | 6 ++-- .zshrc | 8 +++-- liquidprompt/lp-mouse | 1 + 6 files changed, 79 insertions(+), 21 deletions(-) create mode 100644 .gitmodules create mode 160000 liquidprompt/lp-mouse diff --git a/.aliases b/.aliases index a79895d..6426d02 100644 --- a/.aliases +++ b/.aliases @@ -1,11 +1,11 @@ -alias o="evince2" +alias o="xdg-open" alias pro="cd ~/Documents/Projects" alias doc="cd ~/Documents" -alias activenv="mamba activate hic2023py3.11" - +alias vim="nvim" alias int="cd ~/Documents/cours/licence/L3/stage/pasteur/projects/" alias blog="cd ~/Documents/Projects/myself/log/" +alias cours="cd ~/Documents/cours/master/M1/S1/" # Print field name from header with the field rank csv_fields() { @@ -16,6 +16,8 @@ csv_fields() { head -n 1 "${file}" | tr "${delimiter}" "\n" | awk '{print NR, $0}' } +alias edit="$VISUAL" + export templates_dir="~/Documents/Projects/templates" alias new.td='copier "$templates_dir/latex/td.template"' alias new.cm='copier "$templates_dir/latex/cm.template"' @@ -25,6 +27,6 @@ pdfcompress () { gs -q -dNOPAUSE -dBATCH -dSAFER -sDEVICE=pdfwrite -dCompatibilityLevel=1.3 -dPDFSETTINGS=/screen -dEmbedAllFonts=true -dSubsetFonts=true -dColorImageDownsampleType=/Bicubic -dColorImageResolution=144 -dGrayImageDownsampleType=/Bicubic -dGrayImageResolution=144 -dMonoImageDownsampleType=/Bicubic -dMonoImageResolution=144 -sOutputFile="$2" "$1"; } -colorinvert() { convert "$1" -channel RGB -negate "$(echo $1 | sed 's/\./-inv\./')" - +colorinvert() { + convert "$1" -channel RGB -negate "$(echo $1 | sed 's/\./-inv\./')" } diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..94c1f8c --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "liquidprompt/lp-mouse"] + path = liquidprompt/lp-mouse + url = git@github.com:UncleSamulus/lp-mouse.git diff --git a/.latexmkrc b/.latexmkrc index 20c452a..ad341c4 100644 --- a/.latexmkrc +++ b/.latexmkrc @@ -1,24 +1,72 @@ -# Minted -&set_tex_cmds( '-shell-escape %O ' - . '\'\PassOptionsToPackage{outputdir={%Y}}{minted}\input{%S}\'' - ); +$hash_calc_ignore_pattern{aux} = + '^\\\\gdef\\\\minted@oldcachelist\{,' + . '|^\s*default\.pygstyle,' + . '|^\s*[[:xdigit:]]+\.pygtex'; -$pdflatex = 'lualatex -shell-escape -file-line-error -interaction=nonstopmode -synctex=1 -output-directory=build %O %S | texlogsieve'; -$aux_dir = 'build'; +$pdflatex = +'lualatex -shell-escape -file-line-error -interaction=nonstopmode -synctex=1 -output-directory=build %O ' + . '\'\PassOptionsToPackage{outputdir=build}{minted}\input{%S}\'' + . '| texlogsieve'; +$aux_dir = 'build'; $bibtex_use = 2; + # Amend cleaned extensions $clean_ext .= " fdb_latexmk run.xml synctex.gz"; + # Make latexmk quiet $latexmk_silent = 1; # Makeglossaries -add_cus_dep('acn', 'acr', 0, 'makeglossaries'); -add_cus_dep('glo', 'gls', 0, 'makeglossaries'); +add_cus_dep( 'acn', 'acr', 0, 'makeglossaries' ); +add_cus_dep( 'glo', 'gls', 0, 'makeglossaries' ); $clean_ext .= " acr acn alg glo gls glg"; sub makeglossaries { - my ($base_name, $path) = fileparse( $_[0] ); + my ( $base_name, $path ) = fileparse( $_[0] ); my @args = ( "-q", "-d", $path, $base_name ); if ($silent) { unshift @args, "-q"; } - return system "makeglossaries", "-d", $path, $base_name; -} \ No newline at end of file + return system "makeglossaries", "-d", $path, $base_name; +} + +sub biber { + my ( $base_name, $path ) = fileparse( $_[0] ); + my @args = ( "--output-directory", $path, $base_name ); + return system "biber", @args; +} + +$silent = 1; # This adds "-interaction batchmode" +$silence_logfile_warnings = 1; + +END { + local $?; # do not override previous exit status + if ( -s "$root_filename.blg" and open my $bibfile, + '<', "$root_filename.blg" ) + { + print("**********************\n"); + print("bibtex/biber messages:\n"); + while ( my $line = <$bibfile> ) { + if ( $line =~ /You.ve used/ ) { + last; + } + else { + print($line); + } + } + close($bibfile); + } + if ( -s "$root_filename.ilg" and open my $indfile, + '<', "$root_filename.ilg" ) + { + print("*************************\n"); + print("makeindex/xindy messages:\n"); + while ( my $line = <$indfile> ) { + print($line); + } + close($indfile); + } + if ( -s "$root_filename.log" ) { + print("***************\n"); + print("LaTeX messages:\n"); + Run_subst("texlogsieve %R.log"); + } +} diff --git a/.loadenv.sh b/.loadenv.sh index efeb62e..376f7e4 100644 --- a/.loadenv.sh +++ b/.loadenv.sh @@ -1,9 +1,9 @@ -export PATH="/home/$USER/.luarocks/bin:/home/$USER/.julia/bin:/home/$USER/.cargo/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/home/$USER/.local/bin:/home/$USER/bin:/home/$USER/Documents/cours/tools/bin/:/usr/games/:/home/$USER/.config/emacs/bin/" +export PATH="/home/$USER/.luarocks/bin:/home/$USER/.julia/bin:/home/$USER/.cargo/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/home/$USER/.local/bin:/home/$USER/bin:/home/$USER/Documents/cours/tools/bin/:/usr/games/:/home/$USER/.config/emacs/bin/:/usr/local/cuda/bin//" # export EDITOR=vim export ALTERNATE_EDITOR="" -export EDITOR="emacsclient -t" # $EDITOR opens in terminal -export VISUAL="emacsclient -c -a emacs" # $VISUAL opens in GUI mode +export EDITOR="emacsclient -t" # $EDITOR opens in terminal +export VISUAL="emacsclient -fs -c -a emacs" # $VISUAL opens in GUI mode # nvm export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")" diff --git a/.zshrc b/.zshrc index b143d53..3a9d56d 100644 --- a/.zshrc +++ b/.zshrc @@ -1,9 +1,9 @@ autoload antigen -source ~/.aliases - source ~/.loadenv.sh +source ~/.aliases + source ~/.dotfiles/antigen/antigen.zsh antigen use oh-my-zsh @@ -34,8 +34,12 @@ source ~/.antigen/bundles/nojhan/liquidprompt/liquidprompt # source ~/.antigen/bundles/nojhan/liquidprompt/themes/powerline/powerline.theme && lp_theme powerline +source ~/.dotfiles/liquidprompt/lp-mouse/preset.conf + source ~/.antigen/bundles/nojhan/lp-dotmatrix/presets/variant-chevron.conf +source ~/.antigen/bundles/nojhan/lp-dotmatrix/presets/colors_green-red.conf + source ~/.antigen/bundles/nojhan/lp-dotmatrix/dotmatrix.theme && lp_theme dotmatrix # source <(/home/sortion/.cargo/bin/starship init zsh --print-full-init) diff --git a/liquidprompt/lp-mouse b/liquidprompt/lp-mouse new file mode 160000 index 0000000..9cc137a --- /dev/null +++ b/liquidprompt/lp-mouse @@ -0,0 +1 @@ +Subproject commit 9cc137a33be56f01a3228971cf263b530c14f9ef