From 2c5a050641d5400843facfc65e58a2bef5d87422 Mon Sep 17 00:00:00 2001 From: Benjamin Chausse Date: Wed, 24 Jan 2024 12:22:09 -0500 Subject: Multithreaded R package compilation --- .config/shortcutrc | 2 ++ .config/startup/battlestation | 2 +- .config/startup/intern | 0 .config/zsh/.zshrc | 2 +- .local/bin/Rinstall | 5 ++--- .local/bin/backlightctl | 2 +- .local/bin/compiler | 48 +++++++++++++++++++++---------------------- .local/bin/dwmbar/dwmb-vpn | 23 ++++++++++----------- .local/bin/vpnmenu | 6 +++--- 9 files changed, 45 insertions(+), 45 deletions(-) mode change 100644 => 100755 .config/startup/battlestation mode change 100644 => 100755 .config/startup/intern diff --git a/.config/shortcutrc b/.config/shortcutrc index c85f550..2295bd5 100644 --- a/.config/shortcutrc +++ b/.config/shortcutrc @@ -25,6 +25,8 @@ # - lowercase shortcuts prepended by 'y' copies selected files to these paths # - lowercase shortcuts prepended by 'm' moves selected files to these paths +CV, cv, ~/Dropbox/A/work/Application/CV/current +Website, ww, ~/Workspace/chausse.xyz Config, cf, ~/.config Neovim, vi, ~/.config/nvim School, sf, ~/Dropbox/A/scholar/sherbrooke/24-01 diff --git a/.config/startup/battlestation b/.config/startup/battlestation old mode 100644 new mode 100755 index c3c5ea2..19c541e --- a/.config/startup/battlestation +++ b/.config/startup/battlestation @@ -7,4 +7,4 @@ gentoo-pipewire-launcher & nvidia-settings --load-config-only & # Load stacked dual monitor configuration -$XDG_CONFIG_HOME/screenlayout/battlestation-dualmon.sh & +$XDG_CONFIG_HOME/screenlayout/battlestation-dualmon & diff --git a/.config/startup/intern b/.config/startup/intern old mode 100644 new mode 100755 diff --git a/.config/zsh/.zshrc b/.config/zsh/.zshrc index 7ec7bc0..eefa79a 100644 --- a/.config/zsh/.zshrc +++ b/.config/zsh/.zshrc @@ -87,7 +87,7 @@ mkcd() { } # Loading shortcuts made by aliasgen and shortcutgen -source $HOME/.cache/zsh-aliases* +source $HOME/.cache/zsh-aliases source $HOME/.cache/zsh-shortcuts source $HOME/.cache/shell-vars diff --git a/.local/bin/Rinstall b/.local/bin/Rinstall index 8d2857e..a4ee1c5 100755 --- a/.local/bin/Rinstall +++ b/.local/bin/Rinstall @@ -1,5 +1,4 @@ #!/bin/sh -for f in $* - do - sudo R --vanilla -e "install.packages('"$f"', repos='http://cran.us.r-project.org')" +for f in $*; do + sudo R --vanilla -e "install.packages('"$f"', repos='http://cran.us.r-project.org', Ncpus=10)" done diff --git a/.local/bin/backlightctl b/.local/bin/backlightctl index d3f6280..1d38c07 100755 --- a/.local/bin/backlightctl +++ b/.local/bin/backlightctl @@ -31,7 +31,7 @@ get_percent() { # $1 is converted to a value between 0-$max within this function get_total() { value="$(to_value "$1")" - printf "%d" "$(($(get_status) + value))" + printf "%d" "$(($(get_status) + $value))" } helpmsg="Usage: backlightctl -[FLAG] [PERCENTAGE] diff --git a/.local/bin/compiler b/.local/bin/compiler index 9020284..220b4a9 100755 --- a/.local/bin/compiler +++ b/.local/bin/compiler @@ -12,30 +12,30 @@ base="${file%.*}" cd "$dir" || exit -textype() { \ - command="pdflatex" - ( sed 5q "$file" | grep -i -q 'xelatex' ) && command="xelatex" - $command --output-directory="$dir" "$base" && - grep -i addbibresource "$file" >/dev/null && - biber --input-directory "$dir" "$base" && - $command --output-directory="$dir" "$base" && - $command --output-directory="$dir" "$base" - } +textype() { + command="pdflatex" + (sed 5q "$file" | grep -i -q 'xelatex') && command="xelatex" + $command --output-directory="$dir" "$base" && + grep -i addbibresource "$file" >/dev/null && + biber --input-directory "$dir" "$base" && + $command --output-directory="$dir" "$base" && + $command --output-directory="$dir" "$base" +} case "$file" in - *\.ms) refer -PS -e -p"$REFERBIB" "$file" | groff -me -ms -kejpt -T pdf > "$base".pdf ;; - *\.gd) groffdown "$file" | refer -PS -e "-p$REFERBIB" | groff -me -ms -kejpt -T pdf > "$base".pdf ;; - # *\.gd) groffdown "$file" | refer -PS -e "$REFERBIB" | groff -me -ms -kejpt -T pdf > "$base".pdf ;; - *\.mom) refer -PS -e -p"$REFERBIB" "$file" | groff -mom -kejpt -T pdf > "$base".pdf ;; - *\.rmd) echo "require(rmarkdown); render('$file')" | R -q --vanilla ;; - *\.rnw) Rscript -e "knitr::knit2pdf('"$file"')" ;; - *\.tex) textype "$file" ;; - *\.md) pandoc "$file" --pdf-engine=xelatex -o "$base".pdf ;; - *config.h) make && sudo make install ;; - *\.c) cc "$file" -o "$base" && "$base" ;; - *\.py) python "$file" ;; - *\.go) go run "$file" ;; - *\.sent) setsid sent "$file" 2>/dev/null & ;; - *.Xresources) xrdb -load "$file" ;; - *) sed 1q "$file" | grep "^#!/" | sed "s/^#!//" | xargs -r -I % "$file" ;; +*\.ms) refer -PS -e -p"$REFERBIB" "$file" | groff -me -ms -kejpt -T pdf >"$base".pdf ;; +*\.gd) groffdown "$file" | refer -PS -e "-p$REFERBIB" | groff -me -ms -kejpt -T pdf >"$base".pdf ;; +# *\.gd) groffdown "$file" | refer -PS -e "$REFERBIB" | groff -me -ms -kejpt -T pdf > "$base".pdf ;; +*\.mom) refer -PS -e -p"$REFERBIB" "$file" | groff -mom -kejpt -T pdf >"$base".pdf ;; +*\.rmd) echo "require(rmarkdown); render('$file')" | R -q --vanilla ;; +*\.rnw) Rscript -e "knitr::knit2pdf('""$file""')" ;; +*\.tex) textype "$file" ;; +*\.md) pandoc "$file" --pdf-engine=xelatex -o "$base".pdf ;; +*config.h) make && sudo make install ;; +*\.c) cc "$file" -o "$base" && "$base" ;; +*\.py) python "$file" ;; +*\.go) go run "$file" ;; +*\.sent) setsid sent "$file" 2>/dev/null & ;; +*.Xresources) xrdb -load "$file" ;; +*) sed 1q "$file" | grep "^#!/" | sed "s/^#!//" | xargs -r -I % "$file" ;; esac diff --git a/.local/bin/dwmbar/dwmb-vpn b/.local/bin/dwmbar/dwmb-vpn index 9ddb5b5..4ce86f9 100755 --- a/.local/bin/dwmbar/dwmb-vpn +++ b/.local/bin/dwmbar/dwmb-vpn @@ -4,13 +4,13 @@ vpnstatus="$(piactl get connectionstate)" case "$vpnstatus" in - Disconnected) icon=" " ;; - Connecting) icon="  " ;; - Connected) icon=" " ;; - Interrupted) icon="  " ;; - Reconnecting) icon="  " ;; - DisconnectingToReconnect) icon="  ";; - Disconnecting) icon="  " ;; +Disconnected) icon=" " ;; +Connecting) icon="  " ;; +Connected) icon=" " ;; +Interrupted) icon=" " ;; +Reconnecting) icon="  " ;; +DisconnectingToReconnect) icon="  " ;; +Disconnecting) icon="  " ;; esac # case "$vpnstatus" in @@ -25,7 +25,6 @@ esac echo " $icon" - # \033]01;31\] # pink # \033]00m\] # white # \033]01;36\] # bold green @@ -34,8 +33,8 @@ echo " $icon" # \033]01;33\] # bold yellow # s/onnected\sto\s//; case $BLOCK_BUTTON in - 1) piactl connect && notify-send -a "VPN" "Connected" && kill -36 $(pidof dwmblocks);; - 2) vpnmenu ;; - 3) piactl disconnect && notify-send -a "VPN" "Disonnected" && kill -36 $(pidof dwmblocks);; - 6) "$TERMINAL" -e "$EDITOR" "$0" ;; +1) piactl connect && notify-send -a "VPN" "Connected" && kill -36 "$(pidof dwmblocks)" ;; +2) vpnmenu ;; +3) piactl disconnect && notify-send -a "VPN" "Disonnected" && kill -36 "$(pidof dwmblocks)" ;; +6) "$TERMINAL" -e "$EDITOR" "$0" ;; esac diff --git a/.local/bin/vpnmenu b/.local/bin/vpnmenu index ff584e0..a42d000 100755 --- a/.local/bin/vpnmenu +++ b/.local/bin/vpnmenu @@ -3,8 +3,8 @@ region="$(piactl get regions | dmenu -p "Select Region: ")" update=$(kill -36 $(pidof dwmblocks)) -[ "$region" == "" ] && notify-send -a " VPN" "Operation aborted" -[ "$region" != "" ] && piactl set region "$region" && \ - $update && notify-send -a " VPN" "Changed region to $region" && \ +[ "$region" == "" ] && notify-send -a " VPN" "Operation aborted" +[ "$region" != "" ] && piactl set region "$region" && + $update && notify-send -a " VPN" "Changed region to $region" && sleep 3 && $update # Comment next line if not using the vpn dwmblock -- cgit v1.2.3