diff --git a/README.md b/README.md index 84c6bed..b4bace9 100644 --- a/README.md +++ b/README.md @@ -22,4 +22,4 @@ sudo ln -s $(which sudo) /usr/bin/doas - The install script requires GNU Stow to work. - Make sure to thoroughly examine these dotfiles and change them to your needs before using them. - See the READMEs in the individual subfolders here for special notes. -- I've installed `dash` and symlinked `/bin/sh` to it for faster execution of shell scripts. As such, all my scripts try to be as POSIX compliant as possible. If you're on an Arch based distro, you can install `dashbinsh` from the AUR to automatically keep `/bin/sh` symlinked to `dash`. +- I use `dash` instead of `sh` or `bash` for my shell scripts. As such, all my scripts try to be as POSIX compliant as possible. If you don't want to use `dash`, you can change the shebang in the scripts to `#!/bin/sh` or `#!/bin/bash`. diff --git a/artix-install.sh b/artix-install.sh index 71b371e..eb7ef87 100755 --- a/artix-install.sh +++ b/artix-install.sh @@ -7,14 +7,13 @@ fi echo "Configuring directories..." cd -- "$(dirname -- $0)" -ZDOTDIR="$HOME/.config/zsh" -mkdir -p "$ZDOTDIR" # Symlink only the individual files instead of the entire directory +mkdir -p "$HOME/.config/zsh" # Symlink only the individual files instead of the entire directory sleep 0.5 echo "Creating the symlinks with stow..." set -- "alacritty" "mako" "nvim" "scripts" "sway" "swaylock" "swaynag" "waybar" "zsh" -for pkg in $PKGS; do +for pkg in "$@"; do echo "* Stowing $pkg" stow -t "$HOME" --ignore="README.md" "$pkg" sleep 0.1 diff --git a/fedora-install.sh b/fedora-install.sh index f8a9658..106cf0a 100755 --- a/fedora-install.sh +++ b/fedora-install.sh @@ -6,9 +6,9 @@ if [ "$(lsb_release -si)" != "Fedora" ]; then fi echo "Configuring directories..." + cd -- "$(dirname -- $0)" -ZDOTDIR="$HOME/.config/zsh" -mkdir -p "$ZDOTDIR" # Symlink only the individual files instead of the entire directory +mkdir -p "$HOME/.config/zsh" # Symlink only the individual files instead of the entire directory sleep 0.5 echo "Creating the symlinks with stow..." diff --git a/scripts/.local/bin/clear-clipboard.sh b/scripts/.local/bin/clear-clipboard.sh index ff78998..b35f0b1 100755 --- a/scripts/.local/bin/clear-clipboard.sh +++ b/scripts/.local/bin/clear-clipboard.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/dash wl-copy -c wl-copy -pc diff --git a/scripts/.local/bin/update.sh b/scripts/.local/bin/update.sh index c3eba64..8b1f17d 100755 --- a/scripts/.local/bin/update.sh +++ b/scripts/.local/bin/update.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/dash [ "$(lsb_release -si)" = "Artix" ] && paru [ "$(lsb_release -si)" = "Fedora" ] && sudo dnf upgrade diff --git a/scripts/.local/bin/vfio.sh b/scripts/.local/bin/vfio.sh index 98738a9..efa50eb 100755 --- a/scripts/.local/bin/vfio.sh +++ b/scripts/.local/bin/vfio.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/dash if [ "$(lsb_release -si)" = "Arch" ] || [ "$(lsb_release -si)" = "Artix" ]; then echo "This script must be run on either Arch Linux or Artix Linux. Quitting..." diff --git a/sway/.config/sway/autostart.sh b/sway/.config/sway/autostart.sh index 6e07d2e..9020572 100755 --- a/sway/.config/sway/autostart.sh +++ b/sway/.config/sway/autostart.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/dash sleep 1 diff --git a/waybar/.config/waybar/ivpn-reconnect.sh b/waybar/.config/waybar/ivpn-reconnect.sh index f6b0ce6..f4f4fbd 100755 --- a/waybar/.config/waybar/ivpn-reconnect.sh +++ b/waybar/.config/waybar/ivpn-reconnect.sh @@ -1,7 +1,5 @@ -#!/bin/sh +#!/bin/dash -if ivpn connect -last; then - notify-send -u low "IVPN" "Successfully reconnected to IVPN server:\n$(ivpn status | sed -n 2p | xargs)" -else - notify-send -u critical "IVPN" "Failed to reconnect to IVPN\!" -fi +ivpn connect -last \ + && notify-send -u low "IVPN" "Successfully reconnected to IVPN server:\n$(ivpn status | sed -n 2p | xargs)" \ + || notify-send -u critical "IVPN" "Failed to reconnect to IVPN\!" diff --git a/waybar/.config/waybar/ivpn-status.sh b/waybar/.config/waybar/ivpn-status.sh index d35233f..645ba32 100755 --- a/waybar/.config/waybar/ivpn-status.sh +++ b/waybar/.config/waybar/ivpn-status.sh @@ -1,13 +1,9 @@ -#!/bin/sh +#!/bin/dash STATUS=`ivpn status | awk '{print "\\\n"$0}'` TOOLTIP=`env echo -E ${STATUS} | cut -c 3-` CLASS=`env echo ${STATUS} | grep 'VPN' | awk '{print $3}' | tr [:upper:] [:lower:]` -if [ "$CLASS" = "connected" ]; then - TEXT="\uf084" # key -else - TEXT="\uf071" # exclamation-triangle -fi +[ "$CLASS" = "connected" ] && TEXT="\uf084" || TEXT="\uf071" env echo "{\"text\": \"${TEXT}\", \"tooltip\": \"${TOOLTIP}\", \"class\": \"${CLASS}\"}" diff --git a/waybar/.config/waybar/mediaplayer.py b/waybar/.config/waybar/mediaplayer.py index cf3df4b..2630b1c 100755 --- a/waybar/.config/waybar/mediaplayer.py +++ b/waybar/.config/waybar/mediaplayer.py @@ -1,4 +1,5 @@ #!/usr/bin/env python3 + import argparse import logging import sys