From 27b33a3f9e87b9e582041c5740e5f95be43470fc Mon Sep 17 00:00:00 2001 From: Benjamin Chausse Date: Fri, 12 Apr 2024 18:36:52 -0400 Subject: old image previews cleaner script --- .local/bin/previewclean | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100755 .local/bin/previewclean (limited to '.local/bin') diff --git a/.local/bin/previewclean b/.local/bin/previewclean new file mode 100755 index 0000000..8b0a570 --- /dev/null +++ b/.local/bin/previewclean @@ -0,0 +1,10 @@ +#!/bin/sh + +threshold="200000" # 200 MB +previewdir="${XDG_CACHE_HOME:-$HOME/.cache}/lf" + +# Check if the total size of the preview directory exceeds the threshold +# and remove the last viewed file until it doesn't +while [ "$(du -s "$previewdir" | cut -f1)" -gt "$threshold" ]; do + rm -f "$(find "$previewdir" -type f -printf '%T+ %p\n' | sort | head -n1 | cut -d' ' -f2)" +done -- cgit v1.2.3 From b91e290d6bfb333f064fa1abc7e5560cd25beff5 Mon Sep 17 00:00:00 2001 From: Benjamin Chausse Date: Sat, 13 Apr 2024 17:40:33 -0400 Subject: General housekeeping --- .config/sxhkd/sxhkdrc | 8 ++++---- .config/xresources/workstation | 7 ------- .local/bin/lfub | 25 ------------------------- .local/bin/updatestatus | 2 +- .profile | 5 +++-- .xinitrc | 4 ++-- 6 files changed, 10 insertions(+), 41 deletions(-) delete mode 100644 .config/xresources/workstation delete mode 100755 .local/bin/lfub (limited to '.local/bin') diff --git a/.config/sxhkd/sxhkdrc b/.config/sxhkd/sxhkdrc index 51b03cb..14125d6 100644 --- a/.config/sxhkd/sxhkdrc +++ b/.config/sxhkd/sxhkdrc @@ -146,8 +146,11 @@ super + e XF86WLAN killall nmtui || dropdowntoggle network nmtui ## TUI Audio Mixer (pulsemixer) +super + shift + p + killall pulsemixer || dropdowntoggle audio pulsemixer +## Display selector (connect to projector/secondary monitor) super + p - killall pulsemixer || dropdowntoggle bluetooth pulsemixer + displayselect ## TODOs (orgmode-nvim) super + space dropdowntoggle orgmode nvim +"Neorg index" @@ -165,9 +168,6 @@ super + r ## Application Launcher super + d j4-dmenu-desktop -## Display Layout Selector -super + shift + d - displayselect ## Emoji & Font-Awesome Selector alt + grave emoji-copy diff --git a/.config/xresources/workstation b/.config/xresources/workstation deleted file mode 100644 index 2d6d9c9..0000000 --- a/.config/xresources/workstation +++ /dev/null @@ -1,7 +0,0 @@ -Xft.dpi: 96 -Xft.autohing: 0 -Xft.lcdfilter: lcddefault -Xft.hintstyle: hintfull -Xft.hinting: 1 -Xft.antialias: 1 -Xft.rgba: rgb diff --git a/.local/bin/lfub b/.local/bin/lfub deleted file mode 100755 index 43a7ef9..0000000 --- a/.local/bin/lfub +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/sh - -# This is a wrapper script for lb that allows it to create image previews with -# ueberzug. This works in concert with the lf configuration file and the -# lf-cleaner script. - -set -e - -cleanup() { - exec 3>&- - rm "$FIFO_UEBERZUG" -} - -if [ -n "$SSH_CLIENT" ] || [ -n "$SSH_TTY" ]; then - lf "$@" -else - [ ! -d "$HOME/.cache/lf" ] && mkdir -p "$HOME/.cache/lf" - export FIFO_UEBERZUG="$HOME/.cache/lf/ueberzug-$$" - mkfifo "$FIFO_UEBERZUG" - ueberzug layer -s -p json <"$FIFO_UEBERZUG" & - exec 3>"$FIFO_UEBERZUG" - trap cleanup HUP INT QUIT TERM PWR EXIT - lf "$@" 3>&- - killall ueberzug >/dev/null 2>&1 -fi diff --git a/.local/bin/updatestatus b/.local/bin/updatestatus index aedbb84..7000608 100755 --- a/.local/bin/updatestatus +++ b/.local/bin/updatestatus @@ -4,7 +4,7 @@ time="$($1)" [ -z "$1" ] && time="5" # Prevent "no such file or directory" on 1st run -genlop -c >/tmp/genlop +clear && genlop -c >/tmp/genlop while true; do cat /tmp/genlop diff --git a/.profile b/.profile index 0055553..b86c829 100644 --- a/.profile +++ b/.profile @@ -19,13 +19,14 @@ export DISTRIB_ID=arch export DISTRIB_RELEASE=$(uname -r) export XDG_CONFIG_HOME=$HOME/.config export XDG_DATA_HOME=$HOME/.local/share +export XDG_CACHE_HOME=$HOME/.cache export R_PROFILE_USER=$HOME/.config/R/Rprofile export ZDOTDIR=$XDG_CONFIG_HOME/zsh export TEXMFHOME=$XDG_DATA_HOME/texmf export TEXSRC=$HOME/.local/src/sherbrooke-tex # Applications -export EDITOR=$(which nvim) +export EDITOR=/usr/bin/nvim export READER=/usr/bin/zathura export TERMINAL=/usr/local/bin/st export TERM=/usr/local/bin/st @@ -46,7 +47,7 @@ shortcutgen aliasgen # Import shortcut ENV variables -source "$HOME/.cache/env-shortcuts" +source "$XDG_CACHE_HOME/env-shortcuts" # Ensure XDG_RUNTIME_DIR is set if test -z "$XDG_RUNTIME_DIR"; then diff --git a/.xinitrc b/.xinitrc index c98de06..5e0df62 100644 --- a/.xinitrc +++ b/.xinitrc @@ -3,8 +3,8 @@ sxhkd & dunst & unclutter & picom -b & -echo us >$HOME/.cache/layout -xrdb -load $HOME/.Xresources +echo us >"$HOME/.cache/layout" +xrdb -load "$HOME/.Xresources" flashfocus -n 30 -t 150 -l never -o 0.75 -v ERROR & dwmblocks & remaps & -- cgit v1.2.3 From 3a3061d5dfe46d82d3fc90b1e7c919581b1f9662 Mon Sep 17 00:00:00 2001 From: Benjamin Chausse Date: Sat, 13 Apr 2024 17:43:43 -0400 Subject: Compile R flavoured LaTeX with xelatex (knitr) --- .local/bin/compiler | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to '.local/bin') diff --git a/.local/bin/compiler b/.local/bin/compiler index 220b4a9..e6a6db3 100755 --- a/.local/bin/compiler +++ b/.local/bin/compiler @@ -28,7 +28,7 @@ case "$file" in # *\.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""')" ;; +*\.rnw) Rscript -e "knitr::knit2pdf('""$file""',compiler='xelatex')" ;; *\.tex) textype "$file" ;; *\.md) pandoc "$file" --pdf-engine=xelatex -o "$base".pdf ;; *config.h) make && sudo make install ;; -- cgit v1.2.3 From 26ec2e5dc6e8c2369ecb34b642db546327a8b7dd Mon Sep 17 00:00:00 2001 From: Benjamin Chausse Date: Sun, 21 Apr 2024 23:35:51 -0400 Subject: Fix blocks spacing for dwmblocks scripts --- .local/bin/dwmbar/dwmb-eselect | 2 +- .local/bin/dwmbar/dwmb-layout | 2 +- .local/bin/dwmbar/dwmb-time | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) (limited to '.local/bin') diff --git a/.local/bin/dwmbar/dwmb-eselect b/.local/bin/dwmbar/dwmb-eselect index 2d83c8b..24372b4 100755 --- a/.local/bin/dwmbar/dwmb-eselect +++ b/.local/bin/dwmbar/dwmb-eselect @@ -1,6 +1,6 @@ #!/bin/sh -icon="" +icon="  " total="$(eselect news count all)" unread="$(eselect news count new)" diff --git a/.local/bin/dwmbar/dwmb-layout b/.local/bin/dwmbar/dwmb-layout index 9416a2e..1455398 100755 --- a/.local/bin/dwmbar/dwmb-layout +++ b/.local/bin/dwmbar/dwmb-layout @@ -1,3 +1,3 @@ #!/bin/sh -echo " $(cat $HOME/.cache/layout)" +echo "  $(cat "$HOME/.cache/layout")" diff --git a/.local/bin/dwmbar/dwmb-time b/.local/bin/dwmbar/dwmb-time index fc17227..bbd6585 100755 --- a/.local/bin/dwmbar/dwmb-time +++ b/.local/bin/dwmbar/dwmb-time @@ -1,4 +1,3 @@ #!/bin/sh date +"  %H:%M " - -- cgit v1.2.3