Shell scripts:
- Improve install script with for loop - Change hash bangs to /bin/sh because I've symlinked /bin/sh to dash, they should work with bash as well due to POSIX compliance
This commit is contained in:
parent
de9220bc73
commit
b9bc23d46e
37
install.sh
37
install.sh
|
@ -1,31 +1,28 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
echo -e "Configuring directories..."
|
echo "Configuring directories..."
|
||||||
DOTDIR=$(cd -- "$(dirname -- $0)" &> /dev/null && pwd)
|
cd -- "$(dirname -- $0)"
|
||||||
ZDOTDIR="$HOME/.config/zsh"
|
ZDOTDIR="$HOME/.config/zsh"
|
||||||
mkdir -p $ZDOTDIR # Symlink only the individual files instead of the entire directory
|
mkdir -p "$ZDOTDIR" # Symlink only the individual files instead of the entire directory
|
||||||
|
|
||||||
sleep 0.5
|
sleep 0.5
|
||||||
echo -e "Creating the symlinks with stow..."
|
echo "Creating the symlinks with stow..."
|
||||||
|
|
||||||
stow -d $DOTDIR -t $HOME --ignore="README.md" alacritty \
|
for dir in *
|
||||||
mako \
|
do
|
||||||
nvim \
|
[ -d "$dir" ] && stow -t "$HOME" --ignore="README.md" "$dir"
|
||||||
scripts \
|
done
|
||||||
sway \
|
|
||||||
swaylock \
|
|
||||||
swaynag \
|
|
||||||
waybar \
|
|
||||||
zsh
|
|
||||||
|
|
||||||
sleep 0.5
|
sleep 0.5
|
||||||
echo -e "Making scripts executable..."
|
echo "Making scripts executable..."
|
||||||
|
|
||||||
chmod +x $DOTDIR/scripts/.local/bin/clear-clipboard.sh
|
chmod +x scripts/.local/bin/clear-clipboard.sh
|
||||||
chmod +x $DOTDIR/sway/.config/sway/autostart.sh
|
chmod +x scripts/.local/bin/update.sh
|
||||||
chmod +x $DOTDIR/waybar/.config/waybar/ivpn-status.sh
|
chmod +x scripts/.local/bin/vfio.sh
|
||||||
chmod +x $DOTDIR/waybar/.config/waybar/ivpn-reconnect.sh
|
chmod +x sway/.config/sway/autostart.sh
|
||||||
chmod +x $DOTDIR/waybar/.config/waybar/mediaplayer.py
|
chmod +x waybar/.config/waybar/ivpn-reconnect.sh
|
||||||
|
chmod +x waybar/.config/waybar/ivpn-status.sh
|
||||||
|
chmod +x waybar/.config/waybar/mediaplayer.py
|
||||||
|
|
||||||
sleep 0.5
|
sleep 0.5
|
||||||
echo -e "Done!"
|
echo "Done!"
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#!/usr/bin/env dash
|
#!/bin/sh
|
||||||
|
|
||||||
wl-copy -c
|
wl-copy -c
|
||||||
wl-copy -pc
|
wl-copy -pc
|
||||||
|
|
8
scripts/.local/bin/update.sh
Executable file
8
scripts/.local/bin/update.sh
Executable file
|
@ -0,0 +1,8 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
[ "$(lsb_release -si)" = "Artix" ] && paru
|
||||||
|
[ "$(lsb_release -si)" = "Fedora" ] && sudo dnf upgrade
|
||||||
|
|
||||||
|
command -v flatpak >/dev/null 2>&1 && { echo; flatpak update; }
|
||||||
|
command -v npm >/dev/null 2>&1 && { echo; npm up -g; }
|
||||||
|
command -v docker >/dev/null 2>&1 && { echo; docker images | awk '(NR>1) && ($2!~/none/) {print $1":"$2}' | xargs -l docker pull; }
|
|
@ -1,4 +1,4 @@
|
||||||
#!/usr/bin/env dash
|
#!/bin/sh
|
||||||
|
|
||||||
if [ $(id -u) -ne 0 ]; then
|
if [ $(id -u) -ne 0 ]; then
|
||||||
echo "This script must be run as root. Quitting..."
|
echo "This script must be run as root. Quitting..."
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#!/usr/bin/env dash
|
#!/bin/sh
|
||||||
|
|
||||||
if ivpn connect -last; then
|
if ivpn connect -last; then
|
||||||
notify-send -u low "IVPN" "Successfully reconnected to IVPN server:\n$(ivpn status | sed -n 2p | xargs)"
|
notify-send -u low "IVPN" "Successfully reconnected to IVPN server:\n$(ivpn status | sed -n 2p | xargs)"
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#!/usr/bin/env dash
|
#!/bin/sh
|
||||||
|
|
||||||
STATUS=`ivpn status | awk '{print "\\\n"$0}' | head -n -1`
|
STATUS=`ivpn status | awk '{print "\\\n"$0}'`
|
||||||
TOOLTIP=`env echo -E ${STATUS} | cut -c 3-`
|
TOOLTIP=`env echo -E ${STATUS} | cut -c 3-`
|
||||||
CLASS=`env echo ${STATUS} | grep 'VPN' | awk '{print $3}' | tr [:upper:] [:lower:]`
|
CLASS=`env echo ${STATUS} | grep 'VPN' | awk '{print $3}' | tr [:upper:] [:lower:]`
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue