From a6a7990e2361ea15ed09e27b2caac55e5b6d2462 Mon Sep 17 00:00:00 2001 From: Luca Bilke Date: Wed, 12 Apr 2023 11:37:10 +0200 Subject: [PATCH] cleanup cleanup --- .config/X11/xsession.d/20dbus_xdg-runtime | 2 +- .config/X11/xsession.d/30x11-resources | 2 +- .config/X11/xsession.d/50atk-adaptor | 2 +- .config/X11/xsession.d/50qt-a11y | 2 +- .config/X11/xsession.d/60gpg-agent | 7 +- .../xsession.d/{80auto-start => 80autostart} | 8 +- .../{90xsecurelock-setup => 90xsecurelock} | 2 +- .config/X11/xsession.d/99host-setup | 2 +- .config/lf/clean | 2 +- .config/lf/icons | 2 - .config/lf/preview | 38 ++--- .local/bin/brightness-notify | 24 +-- .local/bin/compiler | 30 ++-- .local/bin/daemons/sbd-battery | 4 +- .local/bin/daemons/sbd-music | 2 +- .local/bin/displayselect | 110 ++++++------- .local/bin/dmenuflameshot | 22 +-- .local/bin/dmenuhandler | 8 +- .local/bin/dmenumount | 100 ++++++------ .local/bin/dmenumountcifs | 8 +- .local/bin/dmenurecord | 148 +++++++++--------- .local/bin/dmenuumount | 30 ++-- .local/bin/dmenuunicode | 6 +- .local/bin/dotsync | 36 ++--- .local/bin/findup | 6 +- .local/bin/lf-select | 6 +- .local/bin/linkhandler | 24 +-- .local/bin/neofetch | 8 +- .local/bin/pamixer-notify | 18 +-- .local/bin/pauseallmpv | 4 +- .local/bin/queueandnotify | 6 +- .local/bin/rotdir | 2 +- .local/bin/statusbar/sb-battery | 12 +- .local/bin/statusbar/sb-clock | 2 +- .local/bin/statusbar/sb-cpu | 2 +- .local/bin/statusbar/sb-cpubars | 18 +-- .local/bin/statusbar/sb-disk | 2 +- .local/bin/statusbar/sb-forecast | 2 +- .local/bin/statusbar/sb-internet | 6 +- .local/bin/statusbar/sb-memory | 2 +- .local/bin/statusbar/sb-nettraf | 6 +- .local/bin/statusbar/sb-packages | 5 +- .local/bin/statusbar/sb-playerctl | 8 +- .local/bin/statusbar/sb-volume | 6 +- .local/bin/statusbar/sb-xkbmap | 4 +- .local/bin/trash/remaps | 44 +++--- .local/bin/upgrades | 19 ++- .../zsh/plugins/fast-syntax-highlighting | 1 + 48 files changed, 418 insertions(+), 392 deletions(-) rename .config/X11/xsession.d/{80auto-start => 80autostart} (73%) rename .config/X11/xsession.d/{90xsecurelock-setup => 90xsecurelock} (97%) create mode 160000 .local/share/zsh/plugins/fast-syntax-highlighting diff --git a/.config/X11/xsession.d/20dbus_xdg-runtime b/.config/X11/xsession.d/20dbus_xdg-runtime index a724c09c6..a14903612 100644 --- a/.config/X11/xsession.d/20dbus_xdg-runtime +++ b/.config/X11/xsession.d/20dbus_xdg-runtime @@ -1,4 +1,4 @@ -# vim:set ft=sh +# vim:set ft=sh: if [ -z "$DBUS_SESSION_BUS_ADDRESS" ] && [ -n "$XDG_RUNTIME_DIR" ] && [ "$XDG_RUNTIME_DIR" = "/run/user/$(id -u)" ] && diff --git a/.config/X11/xsession.d/30x11-resources b/.config/X11/xsession.d/30x11-resources index b19911c6b..2b248b155 100644 --- a/.config/X11/xsession.d/30x11-resources +++ b/.config/X11/xsession.d/30x11-resources @@ -1,3 +1,3 @@ -# vim:set ft=sh +# vim:set ft=sh: xrdb -merge $USRRESOURCES diff --git a/.config/X11/xsession.d/50atk-adaptor b/.config/X11/xsession.d/50atk-adaptor index 9f0879214..143669482 100644 --- a/.config/X11/xsession.d/50atk-adaptor +++ b/.config/X11/xsession.d/50atk-adaptor @@ -1,4 +1,4 @@ -# vim:set ft=sh +# vim:set ft=sh: add_module() { case :$GTK_MODULES: in diff --git a/.config/X11/xsession.d/50qt-a11y b/.config/X11/xsession.d/50qt-a11y index 25607b0b4..84dac0ff1 100644 --- a/.config/X11/xsession.d/50qt-a11y +++ b/.config/X11/xsession.d/50qt-a11y @@ -1,4 +1,4 @@ -# vim:set ft=sh +# vim:set ft=sh: export QT_ACCESSIBILITY=1 diff --git a/.config/X11/xsession.d/60gpg-agent b/.config/X11/xsession.d/60gpg-agent index c98d23a5e..bd3407066 100644 --- a/.config/X11/xsession.d/60gpg-agent +++ b/.config/X11/xsession.d/60gpg-agent @@ -1,7 +1,8 @@ -# vim:set ft=sh +# vim:set ft=sh: if [ "${SSH_AUTH_SOCK:-0}" -ne $$ ]; then - export SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)" + sock="$(gpgconf --list-dirs agent-ssh-socket)" + export SSH_AUTH_SOCK=$sock fi -export GPG_TTY="$(tty)" +export GPG_TTY="$TTY" gpg-connect-agent updatestartuptty /bye >/dev/null diff --git a/.config/X11/xsession.d/80auto-start b/.config/X11/xsession.d/80autostart similarity index 73% rename from .config/X11/xsession.d/80auto-start rename to .config/X11/xsession.d/80autostart index 6d54b5f37..6ec5ff598 100644 --- a/.config/X11/xsession.d/80auto-start +++ b/.config/X11/xsession.d/80autostart @@ -1,11 +1,12 @@ -# vim:set ft=sh +# vim:set ft=sh: start() { - pidof -s $1 || $@ >/dev/null 2>&1 & + pidof -sx $1 || $@ & } xwallpaper --zoom "${XDG_DATA_HOME:-$HOME/.local/share}/bg" & -killall remaps; remaps & +killall remaps +remaps & checkup & start playerctld daemon @@ -16,4 +17,3 @@ start pipewire start wireplumber start dwmblocks start remapd - diff --git a/.config/X11/xsession.d/90xsecurelock-setup b/.config/X11/xsession.d/90xsecurelock similarity index 97% rename from .config/X11/xsession.d/90xsecurelock-setup rename to .config/X11/xsession.d/90xsecurelock index 0502a0cf6..9e36d3afa 100644 --- a/.config/X11/xsession.d/90xsecurelock-setup +++ b/.config/X11/xsession.d/90xsecurelock @@ -1,4 +1,4 @@ -# vim:set ft=sh +# vim:set ft=sh: export XSECURELOCK_AUTH_BACKGROUND_COLOR="#24283b" export XSECURELOCK_AUTH_FOREGROUND_COLOR="#c0caf5" diff --git a/.config/X11/xsession.d/99host-setup b/.config/X11/xsession.d/99host-setup index bd5716cf9..31b99fd6c 100644 --- a/.config/X11/xsession.d/99host-setup +++ b/.config/X11/xsession.d/99host-setup @@ -1,3 +1,3 @@ -# vim:set ft=sh +# vim:set ft=sh: # Any host specific configuration goes here # This file is excluded from the dotsync script diff --git a/.config/lf/clean b/.config/lf/clean index 2612a1d03..ec1660e21 100755 --- a/.config/lf/clean +++ b/.config/lf/clean @@ -1,2 +1,2 @@ -#!/usr/bin/env bash +#!/bir/sh kitty +kitten icat --clear --silent --stdin no --transfer-mode memory >/dev/tty diff --git a/.config/lf/icons b/.config/lf/icons index 902bb0590..0f65f4779 100644 --- a/.config/lf/icons +++ b/.config/lf/icons @@ -1,5 +1,3 @@ -# vim:ft=conf - # file types ln  # LINK or  # ORPHAN diff --git a/.config/lf/preview b/.config/lf/preview index e93b5202d..b2c4843a6 100755 --- a/.config/lf/preview +++ b/.config/lf/preview @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/bin/sh image() { f=$1 w=$2 @@ -7,7 +7,7 @@ image() { y=$5 kitty +kitten icat --clear --stdin no --silent --transfer-mode memory --place "${w}x${h}@${x}x${y}" "$f" >/dev/tty && exit 1 chafa "$f" -f symbols -s "$((w-2))x$h" && exit 1 - echo -e "\e[31mImage previewer not installed\e[0m" + printf "%b" "\e[31mImage previewer failed\e[0m" return 1 } @@ -17,7 +17,7 @@ video() { h=$3 x=$4 y=$5 - thumb="$(vidthumb "$f")" || ( echo -e "\e[31mvidthumb script not in path\e[0m" && return 1 ) + thumb="$(vidthumb "$f")" || ( printf "%b" "\e[31mvidthumb script not in path\e[0m"; return 1 ) image "$thumb" "$w" "$h" "$x" "$y" return 1 } @@ -33,25 +33,25 @@ batorcat() { CACHE="$HOME/.cache/lf/thumbnail.$(stat --printf '%n\0%i\0%F\0%s\0%W\0%Y' -- "$(readlink -f "$1")" | sha256sum | awk '{print $1}'))" case "$(xdg-mime query filetype "$1")" in - */x-bzip-compressed-tar|*/x-compressed-tar|*/x-xz-compressed-tar) als -- "$1" && exit 0 || echo -e "\e[31matools not installed\e[0m" && exit 1;; - */x-7z-compressed|*/vnd.rar|*/x-tar|*/zip|*/x-java-archive|*/x-xz) 7z l "$1" | sed 1,11d && exit 0 || echo -e "\e[31m7zip not installed\e[0m" && exit 1;; - */x-cd-image) iso-info --no-header -l "$1" && exit 0 || echo -e "\e[31mlibcdio not installed\e[0m" && exit 1;; - */x-bittorrent) transmission-show "$1" && exit 0 || echo -e "\e[31mtransmission-cli not installed\e[0m" && exit 1;; - */vnd.sun.xml.writer) odt2txt "$1" && exit 0 || echo -e "\e[31modt2txt not installed\e[0m" && exit 1;; - */msword) catdoc "$1" && exit 0 || echo -e "\e[31mcatdoc not installed\e[0m" && exit 1;; - */vnd.openxmlformats-officedocument.wordprocessingml.document) docx2txt < "$1" && exit 0 || echo -e "\e[31mdocx2txt not installed\e[0m" && exit 1;; - */vnd.ms-excel) ssconvert --export-type=Gnumeric_stf:stf_csv "$1" "fd://1" | batorcat --language=csv && exit 0 || echo -e "\e[31mgnumeric not installed\e[0m" && exit 1;; - */vnd.openxmlformats-officedocument.spreadsheetml.sheet) ssconvert --export-type=Gnumeric_stf:stf_csv "$1" "fd://1" | batorcat --language=csv && exit 0 || echo -e "\e[31mgnumeric not installed\e[0m" && exit 1;; - */epub+zip) [ ! -f "$CACHE" ] && epub-thumbnailer "$1" "$CACHE" 1024; image "$CACHE" "$2" "$3" "$4" "$5" && exit 0 || echo -e "\e[31mepubthumbnailer not installed (https://github.com/marianosimone/epub-thumbnailer)\e[0m" && exit 1;; - */pgp-encrypted) gpg -d -- "$1" && exit 0 || echo -e "\e[31mgpg not installed\e[0m" && exit 1;; - */pkix-cert) openssl x509 -text -noout -in "$1" && exit 0 || echo -e "\e[31mopenssl not installed\e[0m" && exit 1;; + */x-bzip-compressed-tar|*/x-compressed-tar|*/x-xz-compressed-tar) als -- "$1" && exit 0 || printf "%b" "\e[31matools failed\e[0m" && exit 1;; + */x-7z-compressed|*/vnd.rar|*/x-tar|*/zip|*/x-java-archive|*/x-xz) 7z l "$1" | sed 1,11d && exit 0 || printf "%b" "\e[31m7zip failed\e[0m" && exit 1;; + */x-cd-image) iso-info --no-header -l "$1" && exit 0 || printf "%b" "\e[31mlibcdio failed\e[0m" && exit 1;; + */x-bittorrent) transmission-show "$1" && exit 0 || printf "%b" "\e[31mtransmission-cli failed\e[0m" && exit 1;; + */vnd.sun.xml.writer) odt2txt "$1" && exit 0 || printf "%b" "\e[31modt2txt failed\e[0m" && exit 1;; + */msword) catdoc "$1" && exit 0 || printf "%b" "\e[31mcatdoc failed\e[0m" && exit 1;; + */vnd.openxmlformats-officedocument.wordprocessingml.document) docx2txt < "$1" && exit 0 || printf "%b" "\e[31mdocx2txt failed\e[0m" && exit 1;; + */vnd.ms-excel) ssconvert --export-type=Gnumeric_stf:stf_csv "$1" "fd://1" | batorcat --language=csv && exit 0 || printf "%b" "\e[31mgnumeric failed\e[0m" && exit 1;; + */vnd.openxmlformats-officedocument.spreadsheetml.sheet) ssconvert --export-type=Gnumeric_stf:stf_csv "$1" "fd://1" | batorcat --language=csv && exit 0 || printf "%b" "\e[31mgnumeric failed\e[0m" && exit 1;; + */epub+zip) [ ! -f "$CACHE" ] && epub-thumbnailer "$1" "$CACHE" 1024; image "$CACHE" "$2" "$3" "$4" "$5" && exit 0 || printf "%b" "\e[31mepubthumbnailer failed (https://github.com/marianosimone/epub-thumbnailer)\e[0m" && exit 1;; + */pgp-encrypted) gpg -d -- "$1" && exit 0 || printf "%b" "\e[31mgpg failed\e[0m" && exit 1;; + */pkix-cert) openssl x509 -text -noout -in "$1" && exit 0 || printf "%b" "\e[31mopenssl failed\e[0m" && exit 1;; image/*) image "$1" "$2" "$3" "$4" "$5" ;; video/*) video "$1" "$2" "$3" "$4" "$5" ;; - *opendocument*) odt2txt "$1" && exit 0 || echo -e "\e[31modt2txt not installed\e[0m" && exit 1;; - */markdown) lowdown -Tterm "$1" && exit 0 || echo -e "\e[31mlowdown not installed \e[0m" && exit 1;; - */html) lynx -dump "$1" && exit 0 || w3m -dump "$1" && exit 0 || echo -e "\e[31neither lynx nor w3m installed\e[0m" && exit 1;; + *opendocument*) odt2txt "$1" && exit 0 || printf "%b" "\e[31modt2txt failed\e[0m" && exit 1;; + */markdown) lowdown -Tterm "$1" && exit 0 || printf "%b" "\e[31mlowdown failed \e[0m" && exit 1;; + */html) lynx -dump "$1" && exit 0 || w3m -dump "$1" && exit 0 || printf "%b" "\e[31neither lynx nor w3m installed\e[0m" && exit 1;; text/*|*/json|*/xml) batorcat "$1" "$2" ;; - */pdf) [ ! -f "${CACHE}.jpg" ] && pdftoppm -jpeg -f 1 -singlefile "$1" "$CACHE"; image "${CACHE}.jpg" "$2" "$3" "$4" "$5" && exit 0 || echo -e "\e[31mpoppler-utils/poppler not installed\e[0m" && exit 1;; + */pdf) [ ! -f "${CACHE}.jpg" ] && pdftoppm -jpeg -f 1 -singlefile "$1" "$CACHE"; image "${CACHE}.jpg" "$2" "$3" "$4" "$5" && exit 0 || printf "%b" "\e[31mpoppler-utils/poppler failed\e[0m" && exit 1;; esac case "$(file -bL --mime-type "$1")" in text/*) batorcat "$1" "$2" ;; diff --git a/.local/bin/brightness-notify b/.local/bin/brightness-notify index 3ce312f2b..682ab5448 100755 --- a/.local/bin/brightness-notify +++ b/.local/bin/brightness-notify @@ -3,7 +3,7 @@ msgTag="brightness" # Arbitrary but unique message tag highlight="#7aa2f7" round() { - awk "BEGIN {printf \"%.0f\", $*}" + awk "BEGIN {printf \"%.0f\", $*}" } oldbrightness="$(cat /sys/class/backlight/*/brightness)" @@ -12,22 +12,22 @@ newpercent="$(round "$oldpercent + $1")" newbrightness="$(round "$newpercent * (255/100)")" if [ "$newpercent" -gt "100" ]; then - icon="gpm-brightness-lcd" - newpercent=100 - newbrightness=255 + icon="gpm-brightness-lcd" + newpercent=100 + newbrightness=255 elif [ "$newpercent" -gt "50" ]; then - icon="gpm-brightness-lcd" + icon="gpm-brightness-lcd" elif [ "$newpercent" -gt "0" ]; then - icon="gpm-brightness-lcd-disabled" + icon="gpm-brightness-lcd-disabled" else - icon="gpm-brightness-lcd-disabled" - newpercent=0 - newbrightness=0 + icon="gpm-brightness-lcd-disabled" + newpercent=0 + newbrightness=0 fi round $newbrightness | tee /sys/class/backlight/*/brightness notify-send -a "changeBrightness" -i "$icon" -u low "Brightness: ${newpercent}%" \ - -h string:x-dunst-stack-tag:$msgTag \ - -h int:value:$newpercent \ - -h string:hlcolor:$highlight + -h string:x-dunst-stack-tag:$msgTag \ + -h int:value:$newpercent \ + -h string:hlcolor:$highlight diff --git a/.local/bin/compiler b/.local/bin/compiler index 8fc1c2406..0c1fef4a8 100755 --- a/.local/bin/compiler +++ b/.local/bin/compiler @@ -16,15 +16,15 @@ ext="${file##*.}" cd "$dir" || exit 1 textype() { - command="pdflatex" - texroot=$(readlink -f "$(grep -Poi "^ *% *\! *tex root *= *\w+(?:\.\w*)?" "$file" | cut -d "=" -f 2 | tr -d "[:blank:]")") - [ -n "$texroot" ] && base=$texroot && echo "Compiling from TeX root: $texroot" - (head -n5 "$file" | grep -qi 'xelatex') && command="xelatex" - $command --output-directory="$dir" "$base" && - grep -qi addbibresource "$file" && - biber --input-directory "$dir" "$base" && - $command --output-directory="$dir" "$base" && - $command --output-directory="$dir" "$base" + command="pdflatex" + texroot=$(readlink -f "$(grep -Poi "^ *% *\! *tex root *= *\w+(?:\.\w*)?" "$file" | cut -d "=" -f 2 | tr -d "[:blank:]")") + [ -n "$texroot" ] && base=$texroot && echo "Compiling from TeX root: $texroot" + (head -n5 "$file" | grep -qi 'xelatex') && command="xelatex" + $command --output-directory="$dir" "$base" && + grep -qi addbibresource "$file" && + biber --input-directory "$dir" "$base" && + $command --output-directory="$dir" "$base" && + $command --output-directory="$dir" "$base" } case "$ext" in @@ -35,18 +35,18 @@ cpp) g++ "$file" -o "$base" && "$base" ;; cs) mcs "$file" && mono "$base".exe ;; go) go run "$file" ;; h) sudo make install ;; - # findup is a script available here: https://unix.stackexchange.com/a/35265 + # findup is a script available here: https://unix.stackexchange.com/a/35265 java) - loc=$(findup . -name gradlew) - [ "$loc":w != "" ] && exec "$loc" run -q -p "$(dirname $loc)" - ;; + loc=$(findup . -name gradlew) + [ "$loc" != "" ] && exec "$loc" run -q -p "$(dirname "$loc")" + ;; m) octave "$file" ;; md) if [ -x "$(command -v pandoc)" ]; then pandoc -t latex -s -o "$base".pdf "$file" elif [ -x "$(command -v groffdown)" ]; then - groffdown -i "$file" | groff -T pdf >"$base.pdf" + groffdown -i "$file" | groff -T pdf >"$base.pdf" else - pandoc -t ms --highlight-style=kate -s -o "$base".pdf "$file" + pandoc -t ms --highlight-style=kate -s -o "$base".pdf "$file" fi ;; mom) preconv "$file" | refer -PS -e | groff -mom -kept -T pdf >"$base".pdf ;; ms) preconv "$file" | refer -PS -e | groff -me -ms -kept -T pdf >"$base".pdf ;; diff --git a/.local/bin/daemons/sbd-battery b/.local/bin/daemons/sbd-battery index 35ae49b72..028d290c1 100755 --- a/.local/bin/daemons/sbd-battery +++ b/.local/bin/daemons/sbd-battery @@ -2,6 +2,6 @@ # battery status file is sent in as an argument from sb-battery upower --monitor-detail -i "$1" | while read -r _; do - pkill -RTMIN+3 dwmblocks - timeout 5 cat > /dev/null + pkill -RTMIN+3 dwmblocks + timeout 5 cat >/dev/null done diff --git a/.local/bin/daemons/sbd-music b/.local/bin/daemons/sbd-music index a8e5e7b2f..6b7cb819c 100755 --- a/.local/bin/daemons/sbd-music +++ b/.local/bin/daemons/sbd-music @@ -1,4 +1,4 @@ #!/bin/sh while :; do - mpc idle >/dev/null && pkill -RTMIN+11 dwmblocks || break + ( mpc idle >/dev/null && pkill -RTMIN+11 dwmblocks ) || break done diff --git a/.local/bin/displayselect b/.local/bin/displayselect index f06e1a8c4..d10964837 100755 --- a/.local/bin/displayselect +++ b/.local/bin/displayselect @@ -6,64 +6,64 @@ twoscreen() { # If multi-monitor is selected and there are two screens. - mirror=$(printf "no\\nyes" | dmenu -i -p "Mirror displays?") - # Mirror displays using native resolution of external display and a scaled - # version for the internal display - if [ "$mirror" = "yes" ]; then - external=$(echo "$screens" | dmenu -i -p "Optimize resolution for:") - internal=$(echo "$screens" | grep -v "$external") + mirror=$(printf "no\\nyes" | dmenu -i -p "Mirror displays?") + # Mirror displays using native resolution of external display and a scaled + # version for the internal display + if [ "$mirror" = "yes" ]; then + external=$(echo "$screens" | dmenu -i -p "Optimize resolution for:") + internal=$(echo "$screens" | grep -v "$external") - res_external=$(xrandr --query | sed -n "/^$external/,/\+/p" | - tail -n 1 | awk '{print $1}') - res_internal=$(xrandr --query | sed -n "/^$internal/,/\+/p" | - tail -n 1 | awk '{print $1}') + res_external=$(xrandr --query | sed -n "/^$external/,/\+/p" | + tail -n 1 | awk '{print $1}') + res_internal=$(xrandr --query | sed -n "/^$internal/,/\+/p" | + tail -n 1 | awk '{print $1}') - res_ext_x=$(echo "$res_external" | sed 's/x.*//') - res_ext_y=$(echo "$res_external" | sed 's/.*x//') - res_int_x=$(echo "$res_internal" | sed 's/x.*//') - res_int_y=$(echo "$res_internal" | sed 's/.*x//') + res_ext_x=$(echo "$res_external" | sed 's/x.*//') + res_ext_y=$(echo "$res_external" | sed 's/.*x//') + res_int_x=$(echo "$res_internal" | sed 's/x.*//') + res_int_y=$(echo "$res_internal" | sed 's/.*x//') - scale_x=$(echo "$res_ext_x / $res_int_x" | bc -l) - scale_y=$(echo "$res_ext_y / $res_int_y" | bc -l) + scale_x=$(echo "$res_ext_x / $res_int_x" | bc -l) + scale_y=$(echo "$res_ext_y / $res_int_y" | bc -l) - xrandr --output "$external" --auto --scale 1.0x1.0 \ - --output "$internal" --auto --same-as "$external" \ - --scale "$scale_x"x"$scale_y" - else + xrandr --output "$external" --auto --scale 1.0x1.0 \ + --output "$internal" --auto --same-as "$external" \ + --scale "$scale_x"x"$scale_y" + else - primary=$(echo "$screens" | dmenu -i -p "Select primary display:") - secondary=$(echo "$screens" | grep -v "$primary") - direction=$(printf "left\\nright" | dmenu -i -p "What side of $primary should $secondary be on?") - xrandr --output "$primary" --auto --scale 1.0x1.0 --output "$secondary" --"$direction"-of "$primary" --auto --scale 1.0x1.0 - fi + primary=$(echo "$screens" | dmenu -i -p "Select primary display:") + secondary=$(echo "$screens" | grep -v "$primary") + direction=$(printf "left\\nright" | dmenu -i -p "What side of $primary should $secondary be on?") + xrandr --output "$primary" --auto --scale 1.0x1.0 --output "$secondary" --"$direction"-of "$primary" --auto --scale 1.0x1.0 + fi } morescreen() { # If multi-monitor is selected and there are more than two screens. - primary=$(echo "$screens" | dmenu -i -p "Select primary display:") - secondary=$(echo "$screens" | grep -v "$primary" | dmenu -i -p "Select secondary display:") - direction=$(printf "left\\nright" | dmenu -i -p "What side of $primary should $secondary be on?") - tertiary=$(echo "$screens" | grep -v "$primary" | grep -v "$secondary" | dmenu -i -p "Select third display:") - xrandr --output "$primary" --auto --output "$secondary" --"$direction"-of "$primary" --auto --output "$tertiary" --"$(printf "left\\nright" | grep -v "$direction")"-of "$primary" --auto + primary=$(echo "$screens" | dmenu -i -p "Select primary display:") + secondary=$(echo "$screens" | grep -v "$primary" | dmenu -i -p "Select secondary display:") + direction=$(printf "left\\nright" | dmenu -i -p "What side of $primary should $secondary be on?") + tertiary=$(echo "$screens" | grep -v "$primary" | grep -v "$secondary" | dmenu -i -p "Select third display:") + xrandr --output "$primary" --auto --output "$secondary" --"$direction"-of "$primary" --auto --output "$tertiary" --"$(printf "left\\nright" | grep -v "$direction")"-of "$primary" --auto } multimon() { # Multi-monitor handler. - case "$(echo "$screens" | wc -l)" in - 2) twoscreen ;; - *) morescreen ;; - esac + case "$(echo "$screens" | wc -l)" in + 2) twoscreen ;; + *) morescreen ;; + esac } onescreen() { # If only one output available or chosen. - xrandr --output "$1" --auto --scale 1.0x1.0 $(echo "$allposs" | grep -v "\b$1" | awk '{print "--output", $1, "--off"}' | paste -sd ' ' -)"" + xrandr --output "$1" --auto --scale 1.0x1.0 "$(echo "$allposs" | grep -v "\b$1" | awk '{print "--output", $1, "--off"}' | paste -sd ' ' -)" } postrun() { # Stuff to run to clean up. - setbg # Fix background if screen size/arangement has changed. - remaps # Re-remap keys if keyboard added (for laptop bases) - { - killall dunst - setsid -f dunst - } >/dev/null 2>&1 # Restart dunst to ensure proper location on screen + setbg # Fix background if screen size/arangement has changed. + remaps # Re-remap keys if keyboard added (for laptop bases) + { + killall dunst + setsid -f dunst + } >/dev/null 2>&1 # Restart dunst to ensure proper location on screen } # Get all possible displays @@ -74,22 +74,22 @@ screens=$(echo "$allposs" | awk '/ connected/ {print $1}') # If there's only one screen [ "$(echo "$screens" | wc -l)" -lt 2 ] && - { - onescreen "$screens" - postrun - notify-send "💻 Only one screen detected." "Using it in its optimal settings..." - exit - } + { + onescreen "$screens" + postrun + notify-send "💻 Only one screen detected." "Using it in its optimal settings..." + exit + } # Get user choice including multi-monitor and manual selection: chosen=$(printf "%s\\nmulti-monitor\\nmanual selection" "$screens" | dmenu -i -p "Select display arangement:") && - case "$chosen" in - "manual selection") - arandr - exit - ;; - "multi-monitor") multimon ;; - *) onescreen "$chosen" ;; - esac + case "$chosen" in + "manual selection") + arandr + exit + ;; + "multi-monitor") multimon ;; + *) onescreen "$chosen" ;; + esac postrun diff --git a/.local/bin/dmenuflameshot b/.local/bin/dmenuflameshot index 42d024606..b38991026 100755 --- a/.local/bin/dmenuflameshot +++ b/.local/bin/dmenuflameshot @@ -3,9 +3,9 @@ # this script provides a menu of screenshot options, using flameshot geom() { - case $1 in - "active") eval "$(xdotool getactivewindow getwindowgeometry --shell)" ;; - "select") eval "$(xdotool selectwindow getwindowgeometry --shell)" ;; + case $1 in + "active") eval "$(xdotool getactivewindow getwindowgeometry --shell)" ;; + "select") eval "$(xdotool selectwindow getwindowgeometry --shell)" ;; esac echo "${WIDTH}x${HEIGHT}+${X}+${Y}" } @@ -13,12 +13,12 @@ geom() { # variables output="${XDG_PICTURES_DIR:-$HOME/Pictures}/Screenshots/$(date '+%y%m%d-%H%M-%S').png" case "$(printf "selected area\\ncurrent window\\nselected window\\nfull screen\\nselected area (copy)\\ncurrent window (copy)\\nselect window (copy)\\nfull screen (copy)" | dmenu -i -p "Screenshot which area?")" in - "selected area") flameshot gui -p "$output" ;; - "current window") flameshot gui -p "$output" --region "$(geom active)";; - "selected window") flameshot gui -p "$output" --region "$(geom select)";; - "full screen") flameshot full -p "$output" ;; - "selected area (copy)") flameshot gui -c ;; - "current window (copy)") flameshot gui -p "$output" -c --region "$(geom active)";; - "selected window (copy)") flameshot gui -p "$output" -c --region "$(geom select)";; - "full screen (copy)") flameshot full -c ;; +"selected area") flameshot gui -p "$output" ;; +"current window") flameshot gui -p "$output" --region "$(geom active)" ;; +"selected window") flameshot gui -p "$output" --region "$(geom select)" ;; +"full screen") flameshot full -p "$output" ;; +"selected area (copy)") flameshot gui -c ;; +"current window (copy)") flameshot gui -p "$output" -c --region "$(geom active)" ;; +"selected window (copy)") flameshot gui -p "$output" -c --region "$(geom select)" ;; +"full screen (copy)") flameshot full -c ;; esac diff --git a/.local/bin/dmenuhandler b/.local/bin/dmenuhandler index c19383422..64a472d45 100755 --- a/.local/bin/dmenuhandler +++ b/.local/bin/dmenuhandler @@ -2,7 +2,7 @@ # Feed this script a link and it will give dmenu # some choice programs to use to open it. -feed="${1:-$(printf "%s" | dmenu -p 'Paste URL or file path')}" +feed="${1:-$(true | dmenu -p 'Paste URL or file path')}" case "$(printf "copy url\\nsxiv\\nsetbg\\nPDF\\nbrowser\\nlynx\\nvim\\nmpv\\nmpv loop\\nmpv float\\nqueue download\\nqueue yt-dlp\\nqueue yt-dlp audio" | dmenu -i -p "Open it with?")" in "copy url") echo "$feed" | xclip -selection clipboard ;; @@ -16,9 +16,9 @@ PDF) curl -sL "$feed" >"/tmp/$(echo "$feed" | sed "s|.*/||;s/%20/ /g")" && zathu sxiv) curl -sL "$feed" >"/tmp/$(echo "$feed" | sed "s|.*/||;s/%20/ /g")" && sxiv -a "/tmp/$(echo "$feed" | sed "s|.*/||;s/%20/ /g")" >/dev/null 2>&1 ;; vim) curl -sL "$feed" >"/tmp/$(echo "$feed" | sed "s|.*/||;s/%20/ /g")" && setsid -f "$TERMINAL" -e "$EDITOR" "/tmp/$(echo "$feed" | sed "s|.*/||;s/%20/ /g")" >/dev/null 2>&1 ;; setbg) - curl -L "$feed" >$XDG_CACHE_HOME/pic - xwallpaper --zoom $XDG_CACHE_HOME/pic >/dev/null 2>&1 - ;; + curl -L "$feed" >"$XDG_CACHE_HOME/pic" + xwallpaper --zoom "$XDG_CACHE_HOME/pic" >/dev/null 2>&1 + ;; browser) setsid -f "$BROWSER" "$feed" >/dev/null 2>&1 ;; lynx) lynx "$feed" >/dev/null 2>&1 ;; esac diff --git a/.local/bin/dmenumount b/.local/bin/dmenumount index fb43cbdac..63d517554 100755 --- a/.local/bin/dmenumount +++ b/.local/bin/dmenumount @@ -6,67 +6,73 @@ # input a novel directory, it will prompt you to create that directory. getmount() { - [ -z "$chosen" ] && exit 1 - # shellcheck disable=SC2086 - mp="$(find $1 2>/dev/null | dmenu -i -p "Type in mount point.")" || exit 1 - test -z "$mp" && exit 1 - if [ ! -d "$mp" ]; then - mkdiryn=$(printf "No\\nYes" | dmenu -i -p "$mp does not exist. Create it?") || exit 1 - [ "$mkdiryn" = "Yes" ] && (mkdir -p "$mp" || sudo -A mkdir -p "$mp") - fi + [ -z "$chosen" ] && exit 1 + # shellcheck disable=SC2086 + mp="$(find $1 2>/dev/null | dmenu -i -p "Type in mount point.")" || exit 1 + test -z "$mp" && exit 1 + if [ ! -d "$mp" ]; then + mkdiryn=$(printf "No\\nYes" | dmenu -i -p "$mp does not exist. Create it?") || exit 1 + [ "$mkdiryn" = "Yes" ] && (mkdir -p "$mp" || sudo -A mkdir -p "$mp") + fi } mountusb() { - chosen="$(echo "$usbdrives" | dmenu -i -p "Mount which drive?")" || exit 1 - chosen="$(echo "$chosen" | awk '{print $1}')" - sudo -A mount "$chosen" 2>/dev/null && notify-send "禍 USB mounting" "$chosen mounted." && exit 0 - alreadymounted=$(lsblk -nrpo "name,type,mountpoint" | awk '$3!~/\/boot|\/home$|SWAP/&&length($3)>1{printf "-not ( -path *%s -prune ) ",$3}') - getmount "/mnt /media /mount /home -maxdepth 5 -type d $alreadymounted" - partitiontype="$(lsblk -no "fstype" "$chosen")" - case "$partitiontype" in - "vfat") sudo -A mount -t vfat "$chosen" "$mp" -o rw,umask=0000 ;; - "exfat") sudo -A mount "$chosen" "$mp" -o uid="$(id -u)",gid="$(id -g)" ;; - *) - sudo -A mount "$chosen" "$mp" - user="$(whoami)" - ug="$(groups | awk '{print $1}')" - sudo -A chown "$user":"$ug" "$mp" - ;; - esac && notify-send "禍 USB mounting" "$chosen mounted to $mp." || - notify-send "禍 Drive failed to mount." "Probably a permissions issue or a drive is already mounted." + chosen="$(echo "$usbdrives" | dmenu -i -p "Mount which drive?")" || exit 1 + chosen="$(echo "$chosen" | awk '{print $1}')" + sudo -A mount "$chosen" 2>/dev/null && notify-send "禍 USB mounting" "$chosen mounted." && exit 0 + alreadymounted=$(lsblk -nrpo "name,type,mountpoint" | awk '$3!~/\/boot|\/home$|SWAP/&&length($3)>1{printf "-not ( -path *%s -prune ) ",$3}') + getmount "/mnt /media /mount /home -maxdepth 5 -type d $alreadymounted" + partitiontype="$(lsblk -no "fstype" "$chosen")" + if case "$partitiontype" in + "vfat") sudo -A mount -t vfat "$chosen" "$mp" -o rw,umask=0000 ;; + "exfat") sudo -A mount "$chosen" "$mp" -o uid="$(id -u)",gid="$(id -g)" ;; + *) + sudo -A mount "$chosen" "$mp" + user="$(whoami)" + ug="$(groups | awk '{print $1}')" + sudo -A chown "$user":"$ug" "$mp" + ;; + esac + then + notify-send "禍 USB mounting" "$chosen mounted to $mp." + else + notify-send "禍 Drive failed to mount." "Probably a permissions issue or a drive is already mounted." + fi } mountandroid() { - chosen="$(echo "$anddrives" | dmenu -i -p "Which Android device?")" || exit 1 - chosen="$(echo "$chosen" | cut -d : -f 1)" - getmount "$HOME -maxdepth 3 -type d" - echo "OK" | dmenu -i -p "Tap Allow on your phone if it asks for permission and then press enter" || exit 1 - simple-mtpfs --device "$chosen" "$mp" && - notify-send " Android Mounting" "Android device mounted to $mp." || - notify-send " Android Failed mounting." "Probably a permissions issue or phone is already mounted" + chosen="$(echo "$anddrives" | dmenu -i -p "Which Android device?")" || exit 1 + chosen="$(echo "$chosen" | cut -d : -f 1)" + getmount "$HOME -maxdepth 3 -type d" + echo "OK" | dmenu -i -p "Tap Allow on your phone if it asks for permission and then press enter" || exit 1 + if simple-mtpfs --device "$chosen" "$mp"; then + notify-send " Android Mounting" "Android device mounted to $mp." + else + notify-send " Android Failed mounting." "Probably a permissions issue or phone is already mounted" + fi } asktype() { - choice="$(printf "USB\\nAndroid" | dmenu -i -p "Mount a USB drive or Android device?")" || exit 1 - case $choice in - USB) mountusb ;; - Android) mountandroid ;; - esac + choice="$(printf "USB\\nAndroid" | dmenu -i -p "Mount a USB drive or Android device?")" || exit 1 + case $choice in + USB) mountusb ;; + Android) mountandroid ;; + esac } anddrives=$(simple-mtpfs -l 2>/dev/null) usbdrives="$(lsblk -rpo "name,type,size,mountpoint" | grep 'part\|rom' | awk '$4==""{printf "%s (%s)\n",$1,$3}')" if [ -z "$usbdrives" ]; then - [ -z "$anddrives" ] && echo "No USB drive or Android device detected" && exit - echo "Android device(s) detected." - mountandroid + [ -z "$anddrives" ] && echo "No USB drive or Android device detected" && exit + echo "Android device(s) detected." + mountandroid else - if [ -z "$anddrives" ]; then - echo "USB drive(s) detected." - mountusb - else - echo "Mountable USB drive(s) and Android device(s) detected." - asktype - fi + if [ -z "$anddrives" ]; then + echo "USB drive(s) detected." + mountusb + else + echo "Mountable USB drive(s) and Android device(s) detected." + asktype + fi fi diff --git a/.local/bin/dmenumountcifs b/.local/bin/dmenumountcifs index 99c0e1988..028b54b75 100755 --- a/.local/bin/dmenumountcifs +++ b/.local/bin/dmenumountcifs @@ -11,10 +11,10 @@ share=$(smbclient -L "$srvname" -N | grep Disk | awk '{print $1}' | dmenu -i -p share2mnt=//"$srvname".local/"$share" sharemount() { - mounted=$(mount -v | grep "$share2mnt") || ([ ! -d /mnt/"$share" ] && sudo mkdir /mnt/"$share") - [ -z "$mounted" ] && sudo mount -t cifs "$share2mnt" -o user=nobody,password="",noperm /mnt/"$share" && notify-send "Netshare $share mounted" && exit 0 - notify-send "Netshare $share already mounted" - exit 1 + mounted=$(mount -v | grep "$share2mnt") || ([ ! -d /mnt/"$share" ] && sudo mkdir /mnt/"$share") + [ -z "$mounted" ] && sudo mount -t cifs "$share2mnt" -o user=nobody,password="",noperm /mnt/"$share" && notify-send "Netshare $share mounted" && exit 0 + notify-send "Netshare $share already mounted" + exit 1 } sharemount diff --git a/.local/bin/dmenurecord b/.local/bin/dmenurecord index 407fa417d..25a48107d 100755 --- a/.local/bin/dmenurecord +++ b/.local/bin/dmenurecord @@ -10,108 +10,108 @@ # If there is already a running instance, user will be prompted to end it. updateicon() { - echo "$1" >/tmp/recordingicon - pkill -RTMIN+9 "${STATUSBAR:-dwmblocks}" + echo "$1" >/tmp/recordingicon + pkill -RTMIN+9 "${STATUSBAR:-dwmblocks}" } killrecording() { - recpid="$(cat /tmp/recordingpid)" - # kill with SIGTERM, allowing finishing touches. - kill -15 "$recpid" - rm -f /tmp/recordingpid - updateicon "" - pkill -RTMIN+9 "${STATUSBAR:-dwmblocks}" - # even after SIGTERM, ffmpeg may still run, so SIGKILL it. - sleep 3 - kill -9 "$recpid" - exit + recpid="$(cat /tmp/recordingpid)" + # kill with SIGTERM, allowing finishing touches. + kill -15 "$recpid" + rm -f /tmp/recordingpid + updateicon "" + pkill -RTMIN+9 "${STATUSBAR:-dwmblocks}" + # even after SIGTERM, ffmpeg may still run, so SIGKILL it. + sleep 3 + kill -9 "$recpid" + exit } screencast() { - ffmpeg -y \ - -f x11grab \ - -framerate 60 \ - -s "$(xdpyinfo | awk '/dimensions/ {print $2;}')" \ - -i "$DISPLAY" \ - -f alsa -i default \ - -r 30 \ - -c:v h264 -crf 0 -preset ultrafast -c:a aac \ - "$HOME/screencast-$(date '+%y%m%d-%H%M-%S').mp4" & - echo $! >/tmp/recordingpid - updateicon "ﲠ" + ffmpeg -y \ + -f x11grab \ + -framerate 60 \ + -s "$(xdpyinfo | awk '/dimensions/ {print $2;}')" \ + -i "$DISPLAY" \ + -f alsa -i default \ + -r 30 \ + -c:v h264 -crf 0 -preset ultrafast -c:a aac \ + "$HOME/screencast-$(date '+%y%m%d-%H%M-%S').mp4" & + echo $! >/tmp/recordingpid + updateicon "ﲠ" } video() { - ffmpeg \ - -f x11grab \ - -s "$(xdpyinfo | awk '/dimensions/ {print $2;}')" \ - -i "$DISPLAY" \ - -c:v libx264 -qp 0 -r 30 \ - "$HOME/video-$(date '+%y%m%d-%H%M-%S').mkv" & - echo $! >/tmp/recordingpid - updateicon "ﲣ" + ffmpeg \ + -f x11grab \ + -s "$(xdpyinfo | awk '/dimensions/ {print $2;}')" \ + -i "$DISPLAY" \ + -c:v libx264 -qp 0 -r 30 \ + "$HOME/video-$(date '+%y%m%d-%H%M-%S').mkv" & + echo $! >/tmp/recordingpid + updateicon "ﲣ" } webcamhidef() { - ffmpeg \ - -f v4l2 \ - -i /dev/video0 \ - -video_size 1920x1080 \ - "$HOME/webcam-$(date '+%y%m%d-%H%M-%S').mkv" & - echo $! >/tmp/recordingpid - updateicon "" + ffmpeg \ + -f v4l2 \ + -i /dev/video0 \ + -video_size 1920x1080 \ + "$HOME/webcam-$(date '+%y%m%d-%H%M-%S').mkv" & + echo $! >/tmp/recordingpid + updateicon "" } webcam() { - ffmpeg \ - -f v4l2 \ - -i /dev/video0 \ - -video_size 640x480 \ - "$HOME/webcam-$(date '+%y%m%d-%H%M-%S').mkv" & - echo $! >/tmp/recordingpid - updateicon "" + ffmpeg \ + -f v4l2 \ + -i /dev/video0 \ + -video_size 640x480 \ + "$HOME/webcam-$(date '+%y%m%d-%H%M-%S').mkv" & + echo $! >/tmp/recordingpid + updateicon "" } audio() { - ffmpeg \ - -f alsa -i default \ - -c:a flac \ - "$HOME/audio-$(date '+%y%m%d-%H%M-%S').flac" & - echo $! >/tmp/recordingpid - updateicon "" + ffmpeg \ + -f alsa -i default \ + -c:a flac \ + "$HOME/audio-$(date '+%y%m%d-%H%M-%S').flac" & + echo $! >/tmp/recordingpid + updateicon "" } askrecording() { - choice=$(printf "screencast\\nvideo\\nvideo selected\\naudio\\nwebcam\\nwebcam (hi-def)" | dmenu -i -p "Select recording style:") - case "$choice" in - screencast) screencast ;; - audio) audio ;; - video) video ;; - *selected) videoselected ;; - webcam) webcam ;; - "webcam (hi-def)") webcamhidef ;; - esac + choice=$(printf "screencast\\nvideo\\nvideo selected\\naudio\\nwebcam\\nwebcam (hi-def)" | dmenu -i -p "Select recording style:") + case "$choice" in + screencast) screencast ;; + audio) audio ;; + video) video ;; + *selected) videoselected ;; + webcam) webcam ;; + "webcam (hi-def)") webcamhidef ;; + esac } asktoend() { - response=$(printf "No\\nYes" | dmenu -i -p "Recording still active. End recording?") && - [ "$response" = "Yes" ] && killrecording + response=$(printf "No\\nYes" | dmenu -i -p "Recording still active. End recording?") && + [ "$response" = "Yes" ] && killrecording } videoselected() { - slop -f "%x %y %w %h" >/tmp/slop - read -r X Y W H /tmp/slop + read -r X Y W H /tmp/recordingpid - updateicon "ﲣ" + ffmpeg \ + -f x11grab \ + -framerate 60 \ + -video_size "$W"x"$H" \ + -i :0.0+"$X,$Y" \ + -c:v libx264 -qp 0 -r 30 \ + "$HOME/box-$(date '+%y%m%d-%H%M-%S').mkv" & + echo $! >/tmp/recordingpid + updateicon "ﲣ" } case "$1" in diff --git a/.local/bin/dmenuumount b/.local/bin/dmenuumount index 20e306a16..d06567d4e 100755 --- a/.local/bin/dmenuumount +++ b/.local/bin/dmenuumount @@ -5,23 +5,27 @@ # Drives mounted at /, /boot and /home will not be options to unmount. drives="$( - lsblk -nrpo "name,type,size,mountpoint,label" | awk -F':' '{gsub(/ /,":")}$4!~/\/boot|\/efi|\/home$|SWAP/&&length($4)>1{printf "%s (%s) %s\n",$4,$3,$5}' - awk '/simple-mtpfs/ { print "", $2; }' /etc/mtab + lsblk -nrpo "name,type,size,mountpoint,label" | awk -F':' '{gsub(/ /,":")}$4!~/\/boot|\/efi|\/home$|SWAP/&&length($4)>1{printf "%s (%s) %s\n",$4,$3,$5}' + awk '/simple-mtpfs/ { print "", $2; }' /etc/mtab )" chosen="$(echo "$drives" | dmenu -i -p "Unmount which drive?")" || exit 1 -case "$chosen" in -*) - chosen="${chosen#📱 }" - sudo -A umount -l "$chosen" - ;; -*) - chosen="${chosen% (*}" - sudo -A umount -l "$chosen" - ;; -esac && notify-send "禍 Drive unmounted." "$chosen successfully unmounted." || - notify-send "禍 Drive failed to unmount." "Possibly a permissions or I/O issue." +if case "$chosen" in + *) + chosen="${chosen#📱 }" + sudo -A umount -l "$chosen" + ;; + *) + chosen="${chosen% (*}" + sudo -A umount -l "$chosen" + ;; + esac +then + notify-send "禍 Drive unmounted." "$chosen successfully unmounted." +else + notify-send "禍 Drive failed to unmount." "Possibly a permissions or I/O issue." +fi sudo -A umount "$chosen" && notify-send "禍 USB unmounting" "$chosen unmounted." diff --git a/.local/bin/dmenuunicode b/.local/bin/dmenuunicode index 46900f06c..0d6681a46 100755 --- a/.local/bin/dmenuunicode +++ b/.local/bin/dmenuunicode @@ -11,8 +11,8 @@ chosen=$(cut -d ';' -f1 ~/.local/share/chars/* | dmenu -i -l 30 | sed "s/ .*//") # If you run this command with an argument, it will automatically insert the # character. Otherwise, show a message that the emoji has been copied. if [ -n "$1" ]; then - xdotool type "$chosen" + xdotool type "$chosen" else - printf "%s" "$chosen" | xclip -selection clipboard - notify-send "'$chosen' copied to clipboard." & + printf "%s" "$chosen" | xclip -selection clipboard + notify-send "'$chosen' copied to clipboard." & fi diff --git a/.local/bin/dotsync b/.local/bin/dotsync index 7617eca32..d0ee106fb 100755 --- a/.local/bin/dotsync +++ b/.local/bin/dotsync @@ -1,15 +1,15 @@ #!/bin/sh -GREEN='\033[1;32m' -BLUE='\033[1;34m' -RED='\033[1;30m' -NC='\033[0m' +GREEN='\e[1;32m' +BLUE='\e[1;34m' +RED='\e[1;30m' +NC='\e[0m' dotfiles="${1:-$HOME/.dotfiles}" printf "%bChanging directory to %s %b\n" "$BLUE" "$dotfiles" "$NC" if ! cd "$dotfiles"; then - printf "%bCould not CD into %s%b\n" "$RED" "$dotfiles" "$NC" - exit + printf "%bCould not CD into %s%b\n" "$RED" "$dotfiles" "$NC" + exit fi printf "\n" @@ -17,7 +17,7 @@ printf "%bStashing existing changes...%b\n" "$BLUE" "$NC" stash_result=$(git stash push -m "sync-dotfiles: Before syncing dotfiles") needs_pop=1 if [ "$stash_result" = "No local changes to save" ]; then - needs_pop=0 + needs_pop=0 fi printf "\n" @@ -27,18 +27,18 @@ git submodule update --remote --recursive --init printf "\n" if [ $needs_pop -eq 1 ]; then - printf "%bPopping stashed changes...%b\n" "$BLUE" "$NC" - git stash pop + printf "%bPopping stashed changes...%b\n" "$BLUE" "$NC" + git stash pop fi printf "\n" unmerged_files=$(git diff --name-only --diff-filter=U) if [ -n "$unmerged_files" ]; then - printf "%bThe following files have merge conflicts after popping the stash:%b\n" "$RED" "$NC" - printf "\n" - printf %"s\n" "$unmerged_files\n" + printf "%bThe following files have merge conflicts after popping the stash:%b\n" "$RED" "$NC" + printf "\n" + printf %"s\n" "$unmerged_files\n" else - stow -t "$HOME" . || printf "%bStow uninstalled or not in path!%b\n" "$RED" "$NC" + stow -t "$HOME" . || printf "%bStow uninstalled or not in path!%b\n" "$RED" "$NC" fi printf "%bGenerating librewolf profiles...%b\n" "$BLUE" "$NC" @@ -48,11 +48,11 @@ printf "\n" printf "Recompile/Install src files? [y/N] \n" read -r ans [ "$ans" = "y" ] && for f in "$dotfiles"/.local/src/*; do - if ! cd "$f"; then - printf "%bCould not CD into %s%b\n" "$RED" "$f" "$NC" - exit - fi - sudo make install + if ! cd "$f"; then + printf "%bCould not CD into %s%b\n" "$RED" "$f" "$NC" + exit + fi + sudo make install make clean done diff --git a/.local/bin/findup b/.local/bin/findup index af2da49c2..1b3bcc439 100755 --- a/.local/bin/findup +++ b/.local/bin/findup @@ -3,7 +3,7 @@ set -e path="$1" shift 1 while [[ $path != / ]]; do - find "$path" -maxdepth 1 -mindepth 1 "$@" - # Note: if you want to ignore symlinks, use "$(realpath -s "$path"/..)" - path="$(readlink -f "$path"/..)" + find "$path" -maxdepth 1 -mindepth 1 "$@" + # Note: if you want to ignore symlinks, use "$(realpath -s "$path"/..)" + path="$(readlink -f "$path"/..)" done diff --git a/.local/bin/lf-select b/.local/bin/lf-select index 3b2a17a55..657826e63 100755 --- a/.local/bin/lf-select +++ b/.local/bin/lf-select @@ -3,7 +3,7 @@ # Reads file names from stdin and selects them in lf. while read -r file; do - [ -z "$file" ] && continue - lf -remote "send select \"$file\"" - lf -remote "send toggle" + [ -z "$file" ] && continue + lf -remote "send select \"$file\"" + lf -remote "send toggle" done diff --git a/.local/bin/linkhandler b/.local/bin/linkhandler index 61ee6e903..a4e64970c 100755 --- a/.local/bin/linkhandler +++ b/.local/bin/linkhandler @@ -7,25 +7,25 @@ # otherwise it opens link in browser. if [ -z "$1" ]; then - url="$(xclip -o)" + url="$(xclip -o)" else - url="$1" + url="$1" fi case "$url" in *mkv | *webm | *mp4 | *youtube.com/watch* | *youtube.com/playlist* | *youtube.com/shorts* | *youtu.be* | *hooktube.com* | *bitchute.com* | *videos.lukesmith.xyz* | *odysee.com*) - setsid -f mpv -quiet "$url" >/dev/null 2>&1 - ;; + setsid -f mpv -quiet "$url" >/dev/null 2>&1 + ;; *png | *jpg | *jpe | *jpeg | *gif) - curl -sL "$url" >"/tmp/$(echo "$url" | sed "s/.*\///;s/%20/ /g")" && sxiv -a "/tmp/$(echo "$url" | sed "s/.*\///;s/%20/ /g")" >/dev/null 2>&1 & - ;; + curl -sL "$url" >"/tmp/$(echo "$url" | sed "s/.*\///;s/%20/ /g")" && sxiv -a "/tmp/$(echo "$url" | sed "s/.*\///;s/%20/ /g")" >/dev/null 2>&1 & + ;; *pdf | *cbz | *cbr) - curl -sL "$url" >"/tmp/$(echo "$url" | sed "s/.*\///;s/%20/ /g")" && zathura "/tmp/$(echo "$url" | sed "s/.*\///;s/%20/ /g")" >/dev/null 2>&1 & - ;; + curl -sL "$url" >"/tmp/$(echo "$url" | sed "s/.*\///;s/%20/ /g")" && zathura "/tmp/$(echo "$url" | sed "s/.*\///;s/%20/ /g")" >/dev/null 2>&1 & + ;; *mp3 | *flac | *opus | *mp3?source*) - qndl "$url" 'curl -LO' >/dev/null 2>&1 - ;; + qndl "$url" 'curl -LO' >/dev/null 2>&1 + ;; *) - [ -f "$url" ] && setsid -f "$TERMINAL" -e "$EDITOR" "$url" >/dev/null 2>&1 || setsid -f "$BROWSER" "$url" >/dev/null 2>&1 - ;; + [ -f "$url" ] && setsid -f "$TERMINAL" -e "$EDITOR" "$url" >/dev/null 2>&1 || setsid -f "$BROWSER" "$url" >/dev/null 2>&1 + ;; esac diff --git a/.local/bin/neofetch b/.local/bin/neofetch index 8c1c67264..854463ace 100755 --- a/.local/bin/neofetch +++ b/.local/bin/neofetch @@ -1,16 +1,16 @@ #!/bin/sh -RED=$(printf "\033[1;31m") -NORMAL=$(printf "\033[0m") +RED=$(printf "\e[1;31m") +NORMAL=$(printf "\e[0m") colors1() { for i in 0 1 2 3 4 5 6 7; do - printf "\033[4${i}m \033[0m" + printf "%b" "\e[4${i}m \e[0m" done } colors2() { for i in 0 1 2 3 4 5 6 7; do - printf "\033[10${i}m \033[0m" + printf "%b" "\e[10${i}m \e[0m" done } diff --git a/.local/bin/pamixer-notify b/.local/bin/pamixer-notify index 843ad80a9..8bdbc88bf 100755 --- a/.local/bin/pamixer-notify +++ b/.local/bin/pamixer-notify @@ -7,22 +7,22 @@ volume="$(pamixer --get-volume)" mute="$(pamixer --get-mute)" [ "$volume" -gt "100" ] && - highlight="#ff768e" || - highlight="#7aa2f7" + highlight="#ff768e" || + highlight="#7aa2f7" if [ "$mute" = "true" ]; then - icon="audio-volume-muted" + icon="audio-volume-muted" elif [ "$volume" -gt "70" ]; then - icon="audio-volume-high" + icon="audio-volume-high" elif [ "$volume" -gt "30" ]; then - icon="audio-volume-medium" + icon="audio-volume-medium" elif [ "$volume" -ge "0" ]; then - icon="audio-volume-low" + icon="audio-volume-low" fi notify-send -a "changeVolume" -i "$icon" -u low "Volume: ${volume}%" \ - -h string:x-dunst-stack-tag:$msgTag \ - -h int:value:$volume \ - -h string:hlcolor:$highlight + -h string:x-dunst-stack-tag:$msgTag \ + -h int:value:$volume \ + -h string:hlcolor:$highlight canberra-gtk-play -i audio-volume-change -d "changeVolume" diff --git a/.local/bin/pauseallmpv b/.local/bin/pauseallmpv index 442cdb365..af0b23296 100755 --- a/.local/bin/pauseallmpv +++ b/.local/bin/pauseallmpv @@ -5,6 +5,6 @@ # every single one of them with one command! This is bound to super + shift + p # (with other things) by default and is used in some other places. -for i in $(ls /tmp/mpvSockets/*); do - echo '{ "command": ["set_property", "pause", true] }' | socat - "$i" +for i in /tmp/mpvSockets/*/*; do + echo '{ "command": ["set_property", "pause", true] }' | socat - "$i" done diff --git a/.local/bin/queueandnotify b/.local/bin/queueandnotify index 03dea9c2d..34b9a164c 100755 --- a/.local/bin/queueandnotify +++ b/.local/bin/queueandnotify @@ -6,9 +6,9 @@ queuefile="${XDG_DATA_HOME:-$HOME/.local/share}/newsboat/queue" while read -r line; do - [ -z "$line" ] && continue - url="${line%%[ ]*}" - qndl "$url" "curl -LO" + [ -z "$line" ] && continue + url="${line%%[ ]*}" + qndl "$url" "curl -LO" done <"$queuefile" echo >"$queuefile" diff --git a/.local/bin/rotdir b/.local/bin/rotdir index 86da6dbef..7d22309d0 100755 --- a/.local/bin/rotdir +++ b/.local/bin/rotdir @@ -9,4 +9,4 @@ [ -z "$1" ] && echo "usage: rotdir regex 2>&1" && exit 1 base="$(basename "$1")" -ls "$PWD" | awk -v BASE="$base" 'BEGIN { lines = ""; m = 0; } { if ($0 == BASE) { m = 1; } } { if (!m) { if (lines) { lines = lines"\n"; } lines = lines""$0; } else { print $0; } } END { print lines; }' +find "$PWD" -maxdepth 1 | awk -v BASE="$base" 'BEGIN { lines = ""; m = 0; } { if ($0 == BASE) { m = 1; } } { if (!m) { if (lines) { lines = lines"\n"; } lines = lines""$0; } else { print $0; } } END { print lines; }' diff --git a/.local/bin/statusbar/sb-battery b/.local/bin/statusbar/sb-battery index 1ad0ace63..aa579582e 100755 --- a/.local/bin/statusbar/sb-battery +++ b/.local/bin/statusbar/sb-battery @@ -1,10 +1,10 @@ #!/bin/sh -red="\033[31m" -orange="\033[33m" -cyan="\033[36m" -green="\033[32m" -white="\033[37m" -reset="\033[0m" +red="\e[31m" +orange="\e[33m" +cyan="\e[36m" +green="\e[32m" +white="\e[37m" +reset="\e[0m" for battery in /sys/class/power_supply/BAT?*; do pidof -x sbd-battery >/dev/null 2>&1 || sbd-battery "$battery" >/dev/null 2>&1 & [ -n "${capacity+x}" ] && printf " " diff --git a/.local/bin/statusbar/sb-clock b/.local/bin/statusbar/sb-clock index 6f59a81ff..0e7e9cd3f 100755 --- a/.local/bin/statusbar/sb-clock +++ b/.local/bin/statusbar/sb-clock @@ -15,5 +15,5 @@ # "11") icon="" ;; # "12") icon="" ;; # esac -# printf "%s \033[11m%s\033[10m %s\n" "$(date "+%H:%M")" "$icon" "$(date "+%d.%m.%Y")" +# printf "%s \e[11m%s\e[10m %s\n" "$(date "+%H:%M")" "$icon" "$(date "+%d.%m.%Y")" date "+%H:%M %d.%m.%Y" diff --git a/.local/bin/statusbar/sb-cpu b/.local/bin/statusbar/sb-cpu index 0e9e3e80d..fc2f87955 100755 --- a/.local/bin/statusbar/sb-cpu +++ b/.local/bin/statusbar/sb-cpu @@ -1,3 +1,3 @@ #!/bin/sh # TODO: Add color -sensors | awk '/Core 0/ {print "\033[11m🌡\033[10m" $3}' +sensors | awk '/Core 0/ {print "\e[11m🌡\e[10m" $3}' diff --git a/.local/bin/statusbar/sb-cpubars b/.local/bin/statusbar/sb-cpubars index 54c2676b5..5e54d3ece 100755 --- a/.local/bin/statusbar/sb-cpubars +++ b/.local/bin/statusbar/sb-cpubars @@ -3,7 +3,7 @@ cache=/tmp/cpubarscache stats=$(awk '/cpu[0-9]+/ {printf "%d %d %d\n", substr($1,4), ($2 + $3 + $4 + $5), $5 }' /proc/stat) [ ! -f $cache ] && echo "$stats" >"$cache" old=$(cat "$cache") -printf "\033[11m﬙\033[10m " +printf "\e[11m﬙\e[10m " echo "$stats" | while read -r row; do id=${row%% *} rest=${row#* } @@ -12,15 +12,15 @@ echo "$stats" | while read -r row; do case "$(echo "$old" | awk '{if ($1 == id) printf "%d\n", (1 - (idle - $3) / (total - $2))*100 /12.5}' \ id="$id" total="$total" idle="$idle")" in - "0") printf "\033[32m▁" ;; - "1") printf "\033[32m▂" ;; - "2") printf "\033[32m▃" ;; - "3") printf "\033[33m▄" ;; - "4") printf "\033[33m▅" ;; - "5") printf "\033[33m▆" ;; - "6" | "7" | "8") printf "\033[31m▇" ;; + "0") printf "\e[32m▁" ;; + "1") printf "\e[32m▂" ;; + "2") printf "\e[32m▃" ;; + "3") printf "\e[33m▄" ;; + "4") printf "\e[33m▅" ;; + "5") printf "\e[33m▆" ;; + "6" | "7" | "8") printf "\e[31m▇" ;; esac done -printf "\033[0m\n" +printf "\e[0m\n" echo "$stats" >"$cache" diff --git a/.local/bin/statusbar/sb-disk b/.local/bin/statusbar/sb-disk index ef420e991..d4aa64995 100755 --- a/.local/bin/statusbar/sb-disk +++ b/.local/bin/statusbar/sb-disk @@ -2,4 +2,4 @@ # $1 should be drive mountpoint, otherwise assumed /. location=${1:-/} [ -d "$location" ] || exit -printf "\033[11m\033[10m %s\n" "$(df -h "$location" | awk ' /[0-9]/ {print $3 "/" $2}')" +printf "\e[11m\e[10m %s\n" "$(df -h "$location" | awk ' /[0-9]/ {print $3 "/" $2}')" diff --git a/.local/bin/statusbar/sb-forecast b/.local/bin/statusbar/sb-forecast index 373dc6399..19d7c6ddb 100755 --- a/.local/bin/statusbar/sb-forecast +++ b/.local/bin/statusbar/sb-forecast @@ -24,7 +24,7 @@ readfile() { } output() { readfile - printf "\033[12m%s\033[10m %s \033[34;11m\033[0m %s° \033[31;11m\033[0m %s°\n" "$emoji" "$precipitation" $highlow + printf "\e[12m%s\e[10m %s \e[34;11m\e[0m %s° \e[31;11m\e[0m %s°\n" "$emoji" "$precipitation" $highlow } if fresh; then diff --git a/.local/bin/statusbar/sb-internet b/.local/bin/statusbar/sb-internet index e37c04141..47639e2b1 100755 --- a/.local/bin/statusbar/sb-internet +++ b/.local/bin/statusbar/sb-internet @@ -5,7 +5,7 @@ if ls /sys/class/net/w*/operstate 1>/dev/null 2>&1; then for w in /sys/class/net/w*/; do percent="$(cat /proc/net/wireless | grep "$(basename "$(dirname $w/operstate)")" | tr -s ' ' | cut -d ' ' -f3 | tr -dc "[:digit:]")" grep -vxq '0x1003' "$w/flags" && wifi_icon="" || wifi_icon="$(sed "s/up/直/;s/down/睊/;s/dormant/睊/" $w/operstate | tr -d "[:space:]")" - printf "$shift\033[11m%s\033[10m %s" "$wifi_icon" "$percent" + printf "$shift\e[11m%s\e[10m %s" "$wifi_icon" "$percent" shift=" " done fi @@ -13,14 +13,14 @@ fi if ls /sys/class/net/e*/operstate 1>/dev/null 2>&1; then for e in /sys/class/net/e*/operstate; do if_icon="$(sed "s/down//;s/up//" $e)" - printf "$shift\033[11m%s\033[10m" "$if_icon" + printf "$shift\e[11m%s\e[10m" "$if_icon" shift=" " done fi if ls /sys/class/net/tun*/operstate 1>/dev/null 2>&1; then for _ in /sys/class/net/tun*/operstate; do - printf "$shift\033[11m%s\033[10m" "嬨" + printf "$shift\e[11m%s\e[10m" "嬨" shift=" " done fi diff --git a/.local/bin/statusbar/sb-memory b/.local/bin/statusbar/sb-memory index 922cdf882..83bebb1a1 100755 --- a/.local/bin/statusbar/sb-memory +++ b/.local/bin/statusbar/sb-memory @@ -1,2 +1,2 @@ #!/bin/sh -free --mebi | sed -n '2{p;q}' | awk '{printf ("\033[11m\033[10m %2.2fGiB/%2.2fGiB\n", ( $3 / 1024), ($2 / 1024))}' +free --mebi | sed -n '2{p;q}' | awk '{printf ("\e[11m\e[10m %2.2fGiB/%2.2fGiB\n", ( $3 / 1024), ($2 / 1024))}' diff --git a/.local/bin/statusbar/sb-nettraf b/.local/bin/statusbar/sb-nettraf index 2aea2c3ec..0e5f82ca8 100755 --- a/.local/bin/statusbar/sb-nettraf +++ b/.local/bin/statusbar/sb-nettraf @@ -1,7 +1,7 @@ #!/bin/sh -big="\033[11m" -reset="\033[10m" +big="\e[11m" +reset="\e[10m" update() { sum=0 @@ -16,4 +16,4 @@ update() { } rx=$(update /sys/class/net/[ew]*/statistics/rx_bytes) tx=$(update /sys/class/net/[ew]*/statistics/tx_bytes) -printf "$big$reset%5sB $big$reset%5sB\\n" $(numfmt --to=iec $rx $tx) +printf "$big$reset%5sB $big$reset%5sB\\n" $(numfmt --to=iec "$rx" "$tx") diff --git a/.local/bin/statusbar/sb-packages b/.local/bin/statusbar/sb-packages index 262718ba3..3cc45eed8 100755 --- a/.local/bin/statusbar/sb-packages +++ b/.local/bin/statusbar/sb-packages @@ -1,9 +1,10 @@ #!/bin/sh -icon="\033[11m\033[10m" +icon="\e[11m\e[10m" if command -v pacman 1>/dev/null 2>&1; then - printf "%b" "$(pacman -Qu | grep -Fcv "[ignored]" | sed "s/^/$icon /;s/^$icon 0$//g")" + num="$(pacman -Qu | grep -Fcv "[ignored]")" + [ "$num" -gt 0 ] && printf "%b %i" "$icon" "$num" fi if command -v apt 1>/dev/null 2>&1; then diff --git a/.local/bin/statusbar/sb-playerctl b/.local/bin/statusbar/sb-playerctl index d869c085a..ca87dacd3 100755 --- a/.local/bin/statusbar/sb-playerctl +++ b/.local/bin/statusbar/sb-playerctl @@ -1,13 +1,13 @@ #!/bin/sh -big="\033[11m" -reset="\033[10m" +big="\e[11m" +reset="\e[10m" pidof -x sbd-playerctl >/dev/null 2>&1 || sbd-playerctl >/dev/null 2>&1 & -[ "$(playerctl status 2>&1)" = "No players found" ] && printf "$bigﱙ$reset" && exit 1 +[ "$(playerctl status 2>&1)" = "No players found" ] && printf "%bﱙ%b" "$big" "$reset" && exit 1 # song="$(playerctl metadata xesam:artist) - $(playerctl metadata xesam:title)" song="$(playerctl metadata xesam:title) - $(playerctl metadata xesam:artist)" [ ${#song} -gt 35 ] && song="$(printf %.35s "$song")…" icon="$(playerctl status | sed "s/Playing//;s/Paused//;s/Stopped/ﱙ/;")" -printf "$big$icon$reset $song" +printf "%b" "$big$icon$reset $song" diff --git a/.local/bin/statusbar/sb-volume b/.local/bin/statusbar/sb-volume index 5bc77fc18..1459f107c 100755 --- a/.local/bin/statusbar/sb-volume +++ b/.local/bin/statusbar/sb-volume @@ -1,6 +1,6 @@ #!/bin/sh # Prints the current volume or ﱝ if muted. -[ "$(pamixer --get-mute)" = true ] && echo "\033[11mﱝ\033[10m" && exit +[ "$(pamixer --get-mute)" = true ] && echo "\e[11mﱝ\e[10m" && exit vol="$(pamixer --get-volume)" if [ "$vol" -gt "70" ]; then @@ -12,6 +12,6 @@ elif [ "$vol" -gt "0" ]; then elif [ "$vol" -eq "0" ]; then icon="" else - printf "\033[11m\033[10m " && exit + printf "\e[11m\e[10m " && exit fi -printf "\033[11m%s\033[10m %s\n" "$icon" "$vol" +printf "\e[11m%s\e[10m %s\n" "$icon" "$vol" diff --git a/.local/bin/statusbar/sb-xkbmap b/.local/bin/statusbar/sb-xkbmap index 1a9c3656b..db9306e45 100755 --- a/.local/bin/statusbar/sb-xkbmap +++ b/.local/bin/statusbar/sb-xkbmap @@ -1,3 +1,3 @@ -#/bin/sh +#!/bin/sh # pidof -x sbd-xkbmap >/dev/null 2>&1 || sbd-xkbmap >/dev/null 2>&1 & -printf "\033[11m\033[10m %s\n" "$(setxkbmap -query | grep -oP '(layout|variant):\s*\K\w+' | sed ':a;N;s/\n/:/')" +printf "\e[11m\e[10m %s\n" "$(setxkbmap -query | grep -oP '(layout|variant):\s*\K\w+' | sed ':a;N;s/\n/:/')" diff --git a/.local/bin/trash/remaps b/.local/bin/trash/remaps index 758319c88..eb4c69fc5 100755 --- a/.local/bin/trash/remaps +++ b/.local/bin/trash/remaps @@ -4,36 +4,36 @@ groups="us:dvorak de:nodeadkeys" index() { - echo "$groups" | cut -d ' ' -f "$1" + echo "$groups" | cut -d ' ' -f "$1" } if [ "$1" = "-n" ]; then - newgroup="$(setxkbmap -query | grep -oP '(layout|variant):\s*\K\w+' | sed ':a;N;s/\n/:/')" + newgroup="$(setxkbmap -query | grep -oP '(layout|variant):\s*\K\w+' | sed ':a;N;s/\n/:/')" elif [ "$1" = "" ]; then - current="$(setxkbmap -query | grep -oP '(layout|variant):\s*\K\w+' | sed ':a;N;s/\n/:/')" - i=1 - while [ ! "$found" ]; do - group=$(index $i) - if [ "$group" = "$current" ]; then - newgroup=$(index $((i + 1))) - [ -z "$newgroup" ] && newgroup=$(index 1) - found=true - elif [ -z "$group" ]; then - newgroup=$(index 1) - found=true - fi - i=$((i + 1)) - done + current="$(setxkbmap -query | grep -oP '(layout|variant):\s*\K\w+' | sed ':a;N;s/\n/:/')" + i=1 + while [ ! "$found" ]; do + group=$(index $i) + if [ "$group" = "$current" ]; then + newgroup=$(index $((i + 1))) + [ -z "$newgroup" ] && newgroup=$(index 1) + found=true + elif [ -z "$group" ]; then + newgroup=$(index 1) + found=true + fi + i=$((i + 1)) + done else - newgroup="$1" + newgroup="$1" fi setxkbmap \ - -layout "$(echo "$newgroup" | cut -d ':' -f1)" \ - -variant "$(echo "$newgroup" | cut -d ':' -f2)" \ - -option caps:super \ - 1>/dev/null 2>&1 || - echo "Unkown keyboard layout" >&2 + -layout "$(echo "$newgroup" | cut -d ':' -f1)" \ + -variant "$(echo "$newgroup" | cut -d ':' -f2)" \ + -option caps:super \ + 1>/dev/null 2>&1 || + echo "Unkown keyboard layout" >&2 xset r rate 300 50 xset -q | grep "Caps Lock:\s*on" && xdotool key Caps_Lock diff --git a/.local/bin/upgrades b/.local/bin/upgrades index d1eb9c2bb..2c3d9b8b9 100755 --- a/.local/bin/upgrades +++ b/.local/bin/upgrades @@ -13,10 +13,25 @@ command -v apt 1>/dev/null 2>&1 && sudo apt upgrade # This pkill is already handled by apt/pacman hooks: # pkill -RTMIN+8 "${STATUSBAR:-dwmblocks}" -# + +# apt # create the file /etc/apt/apt.conf.d/80statusbar containing the following + # DPkg::Post-Invoke {"/usr/bin/pkill -RTMIN+8 dwmblocks";}; -# TODO: provide example for pacman hook + + + +# pacman +# create the file /usr/share/libalpm/hooks/statusbar.hook containing the following + +# [Trigger] +# Operation = Upgrade +# Type = Package +# Target = * +# [Action] +# Description = Updating statusbar... +# When = PostTransaction +# Exec = /usr/bin/pkill -RTMIN+8 dwmblocks printf "\\nUpgrade complete.\\nPress to exit window.\\n\\n" read -r _ diff --git a/.local/share/zsh/plugins/fast-syntax-highlighting b/.local/share/zsh/plugins/fast-syntax-highlighting new file mode 160000 index 000000000..371591a7b --- /dev/null +++ b/.local/share/zsh/plugins/fast-syntax-highlighting @@ -0,0 +1 @@ +Subproject commit 371591a7b6f0f3c9501c52a7b566addbfd804d09