diff --git a/.config/zsh/.zshrc b/.config/zsh/.zshrc index 1425172..6d69e09 100755 --- a/.config/zsh/.zshrc +++ b/.config/zsh/.zshrc @@ -14,8 +14,7 @@ alias wget='wget --hsts-file="$XDG_CACHE_HOME/wget-hsts"' alias javafx='java --module-path /usr/lib/jvm/default/lib/ --add-modules javafx.base,javafx.controls,javafx.graphics,javafx.media,javafx.swing,javafx.web' alias sxiv='nsxiv' alias blueman='blueman-manager' -alias spotify='spotify-launcher' -alias spotify-launcher='dlkiller spotify-launcher' +alias spotify='dlkiller spotify' alias zoom='dlkiller zoom' alias tor='torbrowser-launcher' if [ ! -z "$(grep nixos /etc/os-release)" ]; then diff --git a/.local/bin/overrides/passmenu b/.local/bin/overrides/passmenu deleted file mode 100755 index 7d524a5..0000000 --- a/.local/bin/overrides/passmenu +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env sh -# This script exists because I want to use dmenu instead of dmenu-wl, which passmenu -# defaults to if it sees that your $WAYLAND_DISPLAY variable is set. I also passed -# $PINENTRY_USER_DATA which will eventually reach the pinentry-wrapper script and launch -# a graphical pinentry as opposed to my curses default, since launching pinentry-curses -# outside of a terminal just breaks everything. - -PINENTRY_USER_DATA=rofi WAYLAND_DISPLAY= /usr/bin/passmenu - diff --git a/.local/bin/sysbin b/.local/bin/sysbin index ad4093c..d0fd520 100755 --- a/.local/bin/sysbin +++ b/.local/bin/sysbin @@ -2,13 +2,29 @@ # Finds the absolute path of a system binary by checking places in most-likely order. # Helpful for when overriding a binary with a script, meaning the script takes higher # precedence in the path, but then the script needs to call the actual binary. -# I understand that this is not the most ~NixOS~ way of doing things. -if [ -e "/usr/bin/$1" ]; then - echo "/usr/bin/$1" -elif [ -e "/bin/$1" ]; then - echo "/bin/$1" -elif [ -e "/run/current-system/sw/bin/$1" ]; then - echo "/run/current-system/sw/bin/$1" +if [ -z "$1" ]; then + # No program prvided + exit 1 fi +# Split the custom path into an array based on ":" (path separator) +IFS=":" read -ra path_dirs <<< "$PATH" + +# Iterate through the directories in PATH_2 +for dir in "${path_dirs[@]}"; do + if [ "$(echo "$dir" | cut -c 1)" = "~" ] || [ "$(echo "$dir" | cut -c 1-5)" = "/home" ]; then + # We are looking in a user's home, skip. + continue + fi + + potential_path="$dir/$1" + if [ -x "$potential_path" ]; then + echo "$potential_path" + exit 0 + fi +done + +echo "command not found: $1" +exit 2 # Not found +