/bin/sh -> dash doesn't work on Fedora.

This commit is contained in:
the_4n0nym0u53 2022-01-08 21:59:42 +01:00
parent 6818bc6c21
commit 75a0d08c4f
No known key found for this signature in database
GPG key ID: 35EE09F5481049BB
10 changed files with 16 additions and 22 deletions

View file

@ -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`.

View file

@ -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

View file

@ -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..."

View file

@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/dash
wl-copy -c
wl-copy -pc

View file

@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/dash
[ "$(lsb_release -si)" = "Artix" ] && paru
[ "$(lsb_release -si)" = "Fedora" ] && sudo dnf upgrade

View file

@ -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..."

View file

@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/dash
sleep 1

View file

@ -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\!"

View file

@ -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}\"}"

View file

@ -1,4 +1,5 @@
#!/usr/bin/env python3
import argparse
import logging
import sys