add & run shfmt

This commit is contained in:
Aminda Suomalainen 2023-05-18 12:25:47 +03:00
parent f7b8a40b28
commit 5f5a98ec79
Signed by: Mikaela
SSH Key Fingerprint: SHA256:CXLULpqNBdUKB6E6fLA1b/4SzG0HvKD19PbIePU175Q
22 changed files with 46 additions and 61 deletions

View File

@ -40,6 +40,11 @@ repos:
hooks:
- id: black
#- id: black-jupyter
- repo: https://github.com/scop/pre-commit-shfmt
rev: v3.6.0-2
hooks:
- id: shfmt
#- id: shfmt-docker
- repo: https://github.com/editorconfig-checker/editorconfig-checker.python
rev: "2.7.1"
hooks:

View File

@ -4,8 +4,7 @@
# installations. I am too lazy to always do this by hand!
# Loop with the users
for user in mikaela matti tommi tiina nenne anneli
do
for user in mikaela matti tommi tiina nenne anneli; do
# To see that it works
echo "Current user: $user"
# Create the user & homedir if it doesn't exist
@ -21,8 +20,7 @@ do
done
# And next sudoers
for sudoer in mikaela matti tommi tiina
do
for sudoer in mikaela matti tommi tiina; do
# Add the user to sudo group (as they are administrator)
echo "Current sudoer: $sudoer"
usermod -a -G wheel $sudoer

View File

@ -22,8 +22,7 @@ if hash jami-gnome 2>/dev/null; then
fi
# Telegram.org
if [ -f ~/.local/Telegram/Updater ]
then
if [ -f ~/.local/Telegram/Updater ]; then
(~/.local/Telegram/Updater -many -startintray &)
else
if hash telegram-desktop 2>/dev/null; then

View File

@ -105,8 +105,7 @@ if hash needrestart 2>/dev/null; then
fi
# Sedric workaround, located in this repo. I trust /root/
if [ -f /root/fixgrub.bash ]
then
if [ -f /root/fixgrub.bash ]; then
/root/fixgrub.bash
fi

View File

@ -11,7 +11,6 @@
## Copy-paste the following to your crontab without the #
# */5 * * * * /usr/local/bin/ydns-simple >/dev/null 2>&1
# yDNS details
USEREMAIL=""
PASSWORD=""

View File

@ -16,7 +16,6 @@
## Copy-paste the following to your crontab without the #
# */5 * * * * PATH_TO_HOME_DIRECTORY_HERE/.local/bin/ydns6 >/dev/null 2>&1
# yDNS details
USEREMAIL=""
PASSWORD=""

View File

@ -3,8 +3,7 @@ VERSION=1.19.1-0
PLATFORM=linux-amd64
# If the signature is already downloaded, don't redownload it
if [ -f "forgejo-$VERSION-$PLATFORM.asc" ]
then
if [ -f "forgejo-$VERSION-$PLATFORM.asc" ]; then
printf "Forĝejo signature already downloaded.\n"
else
printf "Downloading Forĝejo $VERSION-$PLATFORM signature…\n"
@ -12,8 +11,7 @@ else
fi
# If the binary is already downloaded, don't redownload it
if [ -f "forgejo-$VERSION-$PLATFORM" ]
then
if [ -f "forgejo-$VERSION-$PLATFORM" ]; then
printf "Forĝejo already downloaded.\n"
else
printf "Downloading Forĝejo $VERSION on $PLATFORM…\n"

View File

@ -9,8 +9,7 @@ set -x
# This script is Fedora specific for now.
# There is no reason to run if dnf hasn't moved the proper config aside.
if [ -f /boot/efi/EFI/fedora/grub.cfg.rpmsave ]
then
if [ -f /boot/efi/EFI/fedora/grub.cfg.rpmsave ]; then
rm -f /boot/efi/EFI/fedora/grub.cfg.rpmsave
grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg
fi

View File

@ -6,8 +6,7 @@ TORRENTS=$(transmission-remote -l|wc -l)
CURRENT=1
# until $CURRENT equals $TORRENTS ?
until [ $CURRENT -gt $TORRENTS ]
do
until [ $CURRENT -gt $TORRENTS ]; do
# get the information for $CURRENT? Grep the magnet line and cut out the
# frist field ("Magnet: ") using awk?
transmission-remote -l -t $CURRENT -i | grep -i magnet | awk -F': ' '{print $2}'

View File

@ -11,16 +11,13 @@ FlagsForFirefox="--ProfileManager $@"
# Firefox (stable, beta) and signatures: https://releases.mozilla.org/pub/firefox/releases/
# Developer edition (and signatures): https://releases.mozilla.org/pub/devedition/releases/
if [ -f ~/.local/firefox/firefox ]
then
if [ -f ~/.local/firefox/firefox ]; then
~/.local/firefox/firefox $FlagsForFirefox
# Fallback to global wayland installation
elif [ -f /usr/bin/firefox-wayland ]
then
elif [ -f /usr/bin/firefox-wayland ]; then
/usr/bin/firefox-wayland $FlagsForFirefox
# Fallback to global installation
elif [ -f /usr/bin/firefox ]
then
elif [ -f /usr/bin/firefox ]; then
/usr/bin/firefox $FlagsForFirefox
# Fallback to flatpak, don't care if it doesn't exist
else

View File

@ -5,11 +5,9 @@
# bad.
set -x
if [ -f /snap/bin/fluffychat ]
then
if [ -f /snap/bin/fluffychat ]; then
snap run fluffychat $@
elif [ -f /var/lib/flatpak/exports/bin/im.fluffychat.Fluffychat ]
then
elif [ -f /var/lib/flatpak/exports/bin/im.fluffychat.Fluffychat ]; then
flatpak run im.fluffychat.Fluffychat $@
else
/usr/bin/fluffychat

View File

@ -5,8 +5,7 @@
set -x
# Check if go is installed through snap
if [ -f /snap/bin/go ]
then
if [ -f /snap/bin/go ]; then
snap run go $@
# Fallback to system installation

View File

@ -10,16 +10,13 @@ export MOZ_ENABLE_WAYLAND=1
FlagsForThunderbird="--ProfileManager $@"
# Thunderbird (stable, beta) and signatures: https://releases.mozilla.org/pub/thunderbird/releases/
if [ -f ~/.local/thunderbird/thunderbird ]
then
if [ -f ~/.local/thunderbird/thunderbird ]; then
~/.local/thunderbird/thunderbird $FlagsForThunderbird
# Fallback to global installation
elif [ -f /usr/bin/thunderbird-wayland ]
then
elif [ -f /usr/bin/thunderbird-wayland ]; then
/usr/bin/thunderbird-wayland $FlagsForThunderbird
# Fallback to global installation
elif [ -f /usr/bin/thunderbird ]
then
elif [ -f /usr/bin/thunderbird ]; then
/usr/bin/thunderbird $FlagsForThunderbird
# Fallback to flatpak, don't care if it doesn't exist
else

View File

@ -13,7 +13,6 @@ qrencode -l H -s $PIXELSIZE -o $1.png "WIFI:T:WPA;S:$1;P:$2;;"
# Might as well jpg this too
convert "$1".png "$1".jpg
# Prints details
echo "SSID: $1"
echo "Passphrase: $2"