diff options
33 files changed, 131 insertions, 124 deletions
diff --git a/bash/agents.sh b/bash/agents.sh index 5dec196..d49757b 100644 --- a/bash/agents.sh +++ b/bash/agents.sh @@ -1,4 +1,5 @@ #!/usr/bin/env bash +# shellcheck disable=SC2015 eval "$(thefuck --alias f)" @@ -11,13 +12,11 @@ start_agent() { ssh-agent | sed 's/^echo/#echo/' > "${SSH_ENV}" echo succeeded chmod 600 "${SSH_ENV}" - # shellcheck source=/dev/null . "${SSH_ENV}" > /dev/null ssh-add } [ -f "${SSH_ENV}" ] && { - # shellcheck source=/dev/null . "${SSH_ENV}" > /dev/null pgrep ^ssh-agent$ > /dev/null || { start_agent diff --git a/bash/aliases.sh b/bash/aliases.sh index 403709c..52d24b4 100644 --- a/bash/aliases.sh +++ b/bash/aliases.sh @@ -8,13 +8,14 @@ alias l="ls -lahp" alias ll="ls -lhp" alias yt-dl="yt_dl" isLinux && { - alias copy="tr -d '\n' | xclip -sel clip" + alias copy="tr -d '\\n' | xclip -sel clip" } isMac && { - alias copy="tr -d '\n' | pbcopy" + alias copy="tr -d '\\n' | pbcopy" } -alias trim="tr -d '\n'" -alias lower="tr [:upper:] [:lower:]" +alias trim="tr -d '\\n'" +alias lowercase="tr [:upper:] [:lower:]" +alias lc="tr [:upper:] [:lower:]" alias pia-vpn="sudo openvpn --config $DOTFILES/VPN/euandreh.ovpn" # Source: https://unix.stackexchange.com/questions/25327/watch-command-alias-expansion#25329 alias watch="watch --color " @@ -31,9 +32,9 @@ alias fim="play $DOTFILES/bash/Positive.ogg &> /dev/null" alias mux="tmuxinator" u() { - pushd ~/annex > /dev/null; + pushd ~/annex > /dev/null || exit 1; git annex info --fast | grep available; - popd > /dev/null; + popd > /dev/null || exit 1; } export -f u diff --git a/bash/bash_profile.sh b/bash/bash_profile.sh index 12ce7f9..41bc7e9 100644 --- a/bash/bash_profile.sh +++ b/bash/bash_profile.sh @@ -1 +1,3 @@ +#!/usr/bin/env bash + source ~/annex/dev/code/dotfiles/bash/bashrc.sh diff --git a/bash/bashrc.sh b/bash/bashrc.sh index d06692b..a895df1 100644 --- a/bash/bashrc.sh +++ b/bash/bashrc.sh @@ -1,3 +1,5 @@ +#!/usr/bin/env bash + export DOTFILES=~/annex/dev/code/dotfiles source $DOTFILES/bash/platform.sh @@ -10,7 +12,6 @@ source $DOTFILES/bash/agents.sh source $DOTFILES/bash/init.sh source $DOTFILES/bash/symlinks.sh source $DOTFILES/bash/youtube.sh -source $DOTFILES/bash/tmuxinator-templates.sh source $DOTFILES/bash/facepalm/rotten-apple.sh source $DOTFILES/bash/npm.sh source $DOTFILES/bash/x.sh @@ -28,7 +29,7 @@ export PATH="$HOME/annex/dev/code/songbooks/cli:$PATH" alias sb="songbooks" isLinux && { - source "$(dirname $(readlink $(which autojump)))/../share/autojump/autojump.bash" + source "$(dirname "$(readlink "$(command -v autojump)")")/../share/autojump/autojump.bash" } export PATH="$HOME/.perl6/bin:$PATH" diff --git a/bash/colors.sh b/bash/colors.sh index 90cabc4..68acb06 100644 --- a/bash/colors.sh +++ b/bash/colors.sh @@ -1,4 +1,5 @@ #!/usr/bin/env bash +# shellcheck disable=1117 disable=1004 disable=2034 disable=2154 # Customize BASH PS1 prompt to show current GIT repository and branch. # by Mike Stewart - http://MediaDoneRight.com @@ -208,7 +209,7 @@ function lightblueb { } export -f lightblueb -function ,colors { +function colors { black "black" blackb "blackb" white "white" diff --git a/bash/env.sh b/bash/env.sh index 8ac8a25..5a09663 100644 --- a/bash/env.sh +++ b/bash/env.sh @@ -33,7 +33,7 @@ export EDITOR=vi export PATH="$DOTFILES/scripts/:$PATH" export PATH="$DOTFILES/encrypted/scripts/:$PATH" export INPUTRC=~/.inputrc -export CACHE_DIR="~/Nextcloud/cache" +export CACHE_DIR="$HOME/Nextcloud/cache" export PATH="$HOME/dev/libre/website/:$PATH" diff --git a/bash/facepalm/rotten-apple.sh b/bash/facepalm/rotten-apple.sh index 50d85c8..222a2b0 100644 --- a/bash/facepalm/rotten-apple.sh +++ b/bash/facepalm/rotten-apple.sh @@ -6,8 +6,8 @@ isMac && { alias limpar-derived-data="rm -rf ~/Library/Developer/Xcode/DerivedData/" alias fim="afplay $DOTFILES/bash/facepalm/Positive.mp3" - if [ -f $(brew --prefix)/etc/bash_completion ]; then - . $(brew --prefix)/etc/bash_completion + if [ -f "$(brew --prefix)/etc/bash_completion" ]; then + . "$(brew --prefix)/etc/bash_completion" fi [ -f /usr/local/etc/bash_completion ] && . /usr/local/etc/bash_completion diff --git a/bash/fake-symlinks.sh b/bash/fake-symlinks.sh index 336f0c5..3927b0c 100644 --- a/bash/fake-symlinks.sh +++ b/bash/fake-symlinks.sh @@ -1,19 +1,33 @@ #!/usr/bin/env bash if [[ -n "$GITHUB_TOKEN" ]]; then - cat $DOTFILES/git/gitconfig.ini | envsubst > ~/.gitconfig + envsubst < "$DOTFILES/git/gitconfig.ini" > ~/.gitconfig fi -SRHT_REPOS=("website" "mentat" "cement" "pouchdb-materialized-view" "pires" "superlogin" "superlogin-client") +SRHT_REPOS=(website mentat cement pouchdb-materialized-view pires superlogin superlogin-client) SRHT_REPOS_PATH="$HOME/dev/libre" -for repo in ${SRHT_REPOS[@]}; do - cat $DOTFILES/templates/sr-ht-build.yaml | REPO="$repo" envsubst > "$SRHT_REPOS_PATH/$repo/.build.yml" +for repo in "${SRHT_REPOS[@]}"; do + REPO="$repo" envsubst < "$DOTFILES/templates/sr-ht-build.yaml" > "$SRHT_REPOS_PATH/$repo/.build.yml" done -for repo in ${SRHT_REPOS[@]}; do +for repo in "${SRHT_REPOS[@]}"; do if [[ "$repo" != "website" ]]; then - cat "$DOTFILES/templates/env.sh" | REPO="$repo" envsubst > "$SRHT_REPOS_PATH/$repo/env.sh" + REPO="$repo" envsubst < "$DOTFILES/templates/env.sh" > "$SRHT_REPOS_PATH/$repo/env.sh" fi done + +mkdir -p ~/.tmuxinator + +TMUXINATOR_TEMPLATES=(annex pires songbooks sosps) + +for template in "${TMUXINATOR_TEMPLATES[@]}"; do + cp "$DOTFILES/tmux/projects/$template.yml" "$HOME/.tmuxinator/$template.yml" +done + +# DHALL_BUILD_REPOS=(website) + +# for repo in "${DHALL_BUILD_REPOS[@]}"; do +# dhall 2> /dev/null <<< "./sr-ht-build.dhall \"$repo\"" | dhall-to-json --pretty > "$SRHT_REPOS_PATH/$repo/.build.yml" +# done diff --git a/bash/init.sh b/bash/init.sh index 777a322..4e0ee65 100644 --- a/bash/init.sh +++ b/bash/init.sh @@ -1,10 +1,10 @@ #!/usr/bin/env bash locked_init() { - pushd ~/ > /dev/null + pushd ~/ > /dev/null || exit 1 mkdir -p ~/.emacs.d/.cache/ - mkdir -p $(dirname "$AUTOJUMP_TXT") + mkdir -p "$(dirname "$AUTOJUMP_TXT")" touch "$AUTOJUMP_TXT" # clone all missing repos @@ -13,12 +13,12 @@ locked_init() { printf "" > /tmp/mr-repos mr inject > /dev/null - printf "(\n" > /tmp/mr-projectile + printf "(\\n" > /tmp/mr-projectile sed -E 's/\/home\/andreh/~/' /tmp/mr-repos | awk '{print "\""$1"/""\""}' >> /tmp/mr-projectile printf ")" >> /tmp/mr-projectile cp /tmp/mr-projectile ~/.emacs.d/.cache/projectile-bookmarks.eld - popd > /dev/null + popd > /dev/null || exit 1 } export -f locked_init @@ -32,7 +32,7 @@ export -f locked_init # Tests -pushd $DOTFILES > /dev/null +pushd "$DOTFILES" > /dev/null || exit 1 sizes=$(git diff-files --ignore-submodules | awk '{print $6}' | xargs du | awk '{print $1}') for size in $sizes; do @@ -42,4 +42,4 @@ for size in $sizes; do fi done -popd > /dev/null +popd > /dev/null || exit 1 diff --git a/bash/npm.sh b/bash/npm.sh index c23c074..7fbe4f7 100644 --- a/bash/npm.sh +++ b/bash/npm.sh @@ -2,9 +2,9 @@ # FIXME: port to NixOS npm_i() { - (which $1 &> /dev/null) || { + (command -v "$1" &> /dev/null) || { yellow "Installing $2" - npm i -g $2 + npm i -g "$2" } } diff --git a/bash/platform.sh b/bash/platform.sh index efa5061..eb262e9 100644 --- a/bash/platform.sh +++ b/bash/platform.sh @@ -1,11 +1,11 @@ #!/usr/bin/env bash isMac () { - [[ `uname` == 'Darwin' ]] + [[ "$(uname)" == 'Darwin' ]] } isLinux () { - [[ `uname` == 'Linux' ]] + [[ "$(uname)" == 'Linux' ]] } isMac && { diff --git a/bash/symlinks.sh b/bash/symlinks.sh index 39d0a0b..e56ee58 100644 --- a/bash/symlinks.sh +++ b/bash/symlinks.sh @@ -1,77 +1,77 @@ #!/usr/bin/env bash function upsert_dir_symlink() { - local readonly from="$1" - local readonly to="$2" - ([ -d "$to" ] || [ -L "$to" ]) || { + local from="$1" + local to="$2" + { [ -d "$to" ] || [ -L "$to" ]; } || { ln -s "$from" "$to" } } export -f upsert_dir_symlink -upsert_dir_symlink $DOTFILES/encrypted/borg ~/.config/borg +upsert_dir_symlink "$DOTFILES/encrypted/borg" ~/.config/borg -ln -fs $DOTFILES/bash/bashrc.sh ~/.bashrc -ln -fs $DOTFILES/bash/bash_profile.sh ~/.bash_profile -ln -fs $DOTFILES/git/gitattributes ~/.gitattributes -ln -fs $DOTFILES/git/gitignore ~/.gitignore_global -ln -fs $DOTFILES/git/bash_git.sh ~/.bash_git -ln -fs $DOTFILES/encrypted/nugitconfig.ini ~/.nugitconfig -ln -fs $DOTFILES/sbclrc.lisp ~/.sbclrc -ln -fs $DOTFILES/inputrc.conf ~/.inputrc -ln -fs $DOTFILES/Xmodmap.conf ~/.Xmodmap +ln -fs "$DOTFILES/bash/bashrc.sh" ~/.bashrc +ln -fs "$DOTFILES/bash/bash_profile.sh" ~/.bash_profile +ln -fs "$DOTFILES/git/gitattributes" ~/.gitattributes +ln -fs "$DOTFILES/git/gitignore" ~/.gitignore_global +ln -fs "$DOTFILES/git/bash_git.sh" ~/.bash_git +ln -fs "$DOTFILES/encrypted/nugitconfig.ini" ~/.nugitconfig +ln -fs "$DOTFILES/sbclrc.lisp" ~/.sbclrc +ln -fs "$DOTFILES/inputrc.conf" ~/.inputrc +ln -fs "$DOTFILES/Xmodmap.conf" ~/.Xmodmap isLinux && { - ln -fs $DOTFILES/nixos/npmrc.sh ~/.npmrc + ln -fs "$DOTFILES/nixos/npmrc.sh" ~/.npmrc } ## SSH config mkdir -p ~/.ssh -ln -fs $DOTFILES/ssh_config.conf ~/.ssh/config +ln -fs "$DOTFILES/ssh_config.conf" ~/.ssh/config -ln -fs $DOTFILES/git/mrconfig.ini ~/.mrconfig +ln -fs "$DOTFILES/git/mrconfig.ini" ~/.mrconfig -upsert_dir_symlink $MEDIA_PREFIX/UTCLOUD ~/UTCLOUD -upsert_dir_symlink $MEDIA_PREFIX/SNEAKER ~/SNEAKER +upsert_dir_symlink "$MEDIA_PREFIX/UTCLOUD" ~/UTCLOUD +upsert_dir_symlink "$MEDIA_PREFIX/SNEAKER" ~/SNEAKER ## Clojure mkdir -p ~/.lein ~/.clojure -ln -fs $DOTFILES/lein/profiles.clj ~/.lein/profiles.clj -ln -fs $DOTFILES/lein/deps.edn ~/.clojure/deps.edn +ln -fs "$DOTFILES/lein/profiles.clj" ~/.lein/profiles.clj +ln -fs "$DOTFILES/lein/deps.edn" ~/.clojure/deps.edn ## AWS mkdir -p ~/.aws -ln -fs $DOTFILES/encrypted/aws/config ~/.aws/config -ln -fs $DOTFILES/encrypted/aws/credentials ~/.aws/credentials +ln -fs "$DOTFILES/encrypted/aws/config" ~/.aws/config +ln -fs "$DOTFILES/encrypted/aws/credentials" ~/.aws/credentials ## tmux -ln -fs $DOTFILES/tmux/tmux.conf ~/.tmux.conf -ln -fs $DOTFILES/tmux/tmux-macos.conf ~/.tmux-macos.conf -ln -fs $DOTFILES/tmux/tmux-gnu-linux.conf ~/.tmux-gnu-linux.conf +ln -fs "$DOTFILES/tmux/tmux.conf" ~/.tmux.conf +ln -fs "$DOTFILES/tmux/tmux-macos.conf" ~/.tmux-macos.conf +ln -fs "$DOTFILES/tmux/tmux-gnu-linux.conf" ~/.tmux-gnu-linux.conf ## NixOS -ln -fs $DOTFILES/nixos/evince.destkop ~/.local/share/applications/evince.desktop -ln -fs $DOTFILES/nixos/firefox.destkop ~/.local/share/applications/firefox.desktop +ln -fs "$DOTFILES/nixos/evince.destkop" ~/.local/share/applications/evince.desktop +ln -fs "$DOTFILES/nixos/firefox.destkop" ~/.local/share/applications/firefox.desktop ## Emacs -mkdir -p $HOME/.emacs.d/private/layers/ -ln -fs $DOTFILES/spacemacs.el ~/.spacemacs -ln -fs $DOTFILES/emacs/gnus.el ~/.gnus.el -ln -fs $CACHE_DIR/euandreh-auto-save.el ~/.emacs.d/.cache/layouts/euandreh-auto-save +mkdir -p "$HOME/.emacs.d/private/layers/" +ln -fs "$DOTFILES/spacemacs.el" ~/.spacemacs +ln -fs "$DOTFILES/emacs/gnus.el" ~/.gnus.el +ln -fs "$CACHE_DIR/euandreh-auto-save.el" ~/.emacs.d/.cache/layouts/euandreh-auto-save ## xmonad mkdir -p ~/.xmonad -ln -fs $DOTFILES/xmonad/xsession.sh ~/.xsession -ln -fs $DOTFILES/xmonad/xmonad.hs ~/.xmonad/xmonad.hs -ln -fs $DOTFILES/xmonad/xmobar.hs ~/.xmobarrc +ln -fs "$DOTFILES/xmonad/xsession.sh" ~/.xsession +ln -fs "$DOTFILES/xmonad/xmonad.hs" ~/.xmonad/xmonad.hs +ln -fs "$DOTFILES/xmonad/xmobar.hs" ~/.xmobarrc ## Mail mkdir -p ~/mbsync/.notmuch/hooks ~/mbsync/EuAndreh ~/mbsync/Gmail ~/mbsync/Nubank -ln -fs $DOTFILES/mail/notmuch-post.sh ~/mbsync/.notmuch/hooks/post-new -ln -fs $DOTFILES/mail/mbsyncrc.ini ~/.mbsyncrc -ln -fs $DOTFILES/mail/notmuch.ini ~/.notmuch-config -ln -fs /tmp/mbsync.$(date +%Y-%m-%d).log /tmp/mbsync.log -ln -fs /tmp/notmuch.$(date +%Y-%m-%d).log /tmp/notmuch.log +ln -fs "$DOTFILES/mail/notmuch-post.sh" ~/mbsync/.notmuch/hooks/post-new +ln -fs "$DOTFILES/mail/mbsyncrc.ini" ~/.mbsyncrc +ln -fs "$DOTFILES/mail/notmuch.ini" ~/.notmuch-config +ln -fs /tmp/mbsync."$(date +%Y-%m-%d)".log /tmp/mbsync.log +ln -fs /tmp/notmuch."$(date +%Y-%m-%d)".log /tmp/notmuch.log ## GNUS -ln -fs $DOTFILES/encrypted/IMAP/authinfo.gpg ~/.authinfo.gpg +ln -fs "$DOTFILES/encrypted/IMAP/authinfo.gpg" ~/.authinfo.gpg diff --git a/bash/tmuxinator-templates.sh b/bash/tmuxinator-templates.sh deleted file mode 100755 index adbbb5c..0000000 --- a/bash/tmuxinator-templates.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env bash - -mkdir -p ~/.tmuxinator - -templates=(annex pires songbooks sosps) - -for template in ${templates[@]}; do - cp $DOTFILES/tmux/projects/$template.yml ~/.tmuxinator/$template.yml -done diff --git a/bash/util.sh b/bash/util.sh index 833bc9c..e29d02f 100644 --- a/bash/util.sh +++ b/bash/util.sh @@ -1,20 +1,20 @@ #!/usr/bin/env bash extract () { - if [ -f $1 ] ; then - case $1 in - *.tar.bz2) tar xvjf $1 ;; - *.tar.gz) tar xvzf $1 ;; - *.bz2) bunzip2 $1 ;; - *.rar) unrar x $1 ;; - *.gz) gunzip $1 ;; - *.tar) tar xvf $1 ;; - *.tbz2) tar xvjf $1 ;; - *.tgz) tar xvzf $1 ;; - *.zip) unzip $1 ;; - *.Z) uncompress $1 ;; - *.7z) 7z x $1 ;; - *.xz) unxz $1 ;; + if [ -f "$1" ] ; then + case "$1" in + *.tar.bz2) tar xvjf "$1" ;; + *.tar.gz) tar xvzf "$1" ;; + *.bz2) bunzip2 "$1" ;; + *.rar) unrar x "$1" ;; + *.gz) gunzip "$1" ;; + *.tar) tar xvf "$1" ;; + *.tbz2) tar xvjf "$1" ;; + *.tgz) tar xvzf "$1" ;; + *.zip) unzip "$1" ;; + *.Z) uncompress "$1" ;; + *.7z) 7z x "$1" ;; + *.xz) unxz "$1" ;; *) echo "don't know how to extract '$1'..." ;; esac else @@ -24,11 +24,11 @@ extract () { merkle-tree () { dirname="${1-.}" - pushd "$dirname" > /dev/null + pushd "$dirname" > /dev/null || exit 1 find . -type f | \ sort | \ xargs -I{} sha256sum "{}" | \ sha256sum | \ awk '{print $1}' - popd > /dev/null + popd > /dev/null || exit 1 } diff --git a/bash/youtube.sh b/bash/youtube.sh index c40e0a7..19c9af0 100644 --- a/bash/youtube.sh +++ b/bash/youtube.sh @@ -2,7 +2,7 @@ export DEFAULT_PLAYLIST_END=15 export DEFAULT_INC_STEP=10 -export YT_TEMPLATE="~/Downloads/yt-dl/%(uploader)s/%(upload_date)s %(title)s.%(ext)s" +export YT_TEMPLATE="$HOME/Downloads/yt-dl/%(uploader)s/%(upload_date)s %(title)s.%(ext)s" # Always downloads video, doesn't look at the download-archive yt_dl() { diff --git a/dhall/dhall-gen.sh b/dhall/dhall-gen.sh deleted file mode 100755 index 9bba429..0000000 --- a/dhall/dhall-gen.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env bash - -REPOS_PATH="$HOME/dev/libre" - -for repo in $(cat repos.txt); do - dhall 2> /dev/null <<< "./sr-ht-build.dhall \"$repo\"" | dhall-to-json --pretty > "$REPOS_PATH/$repo/.build.yml" -done diff --git a/dhall/repos.txt b/dhall/repos.txt deleted file mode 100644 index 0154e4c..0000000 --- a/dhall/repos.txt +++ /dev/null @@ -1 +0,0 @@ -website diff --git a/encrypted/env.sh b/encrypted/env.sh Binary files differindex af98c5c..e4ebb21 100644 --- a/encrypted/env.sh +++ b/encrypted/env.sh diff --git a/encrypted/nu/nurc.sh b/encrypted/nu/nurc.sh Binary files differindex a8532c2..b92a178 100644 --- a/encrypted/nu/nurc.sh +++ b/encrypted/nu/nurc.sh diff --git a/encrypted/scripts/video-feed.sh b/encrypted/scripts/video-feed.sh Binary files differindex 6efa22d..a6e17d9 100755 --- a/encrypted/scripts/video-feed.sh +++ b/encrypted/scripts/video-feed.sh diff --git a/nixos/npmrc.sh b/nixos/npmrc.sh index 326ac0b..2669f85 100644 --- a/nixos/npmrc.sh +++ b/nixos/npmrc.sh @@ -1,4 +1,5 @@ -prefix="~/.npm-packages" +# shellcheck disable=2148 disable=2034 +prefix="$HOME/.npm-packages" # Taken from: # http://www.tomsquest.com/blog/2018/10/better-npm-ing/ save-exact=true diff --git a/scripts/backup.sh b/scripts/backup.sh index a33a630..6a4de25 100755 --- a/scripts/backup.sh +++ b/scripts/backup.sh @@ -6,12 +6,12 @@ # if [ ! -d ~/UTCLOUD/ ]; then - red "~/UTCLOUD not attached. Backup not started." + red "$HOME/UTCLOUD not attached. Backup not started." exit 1 fi if [ ! -d ~/borgbackup/ ]; then - yellow "~/borgbackup/ repository doesn't exist. Downloading latest version from ~/UTCLOUD/borg/borgbackup/ into ~/borgbackup/" + yellow "$HOME/borgbackup/ repository doesn't exist. Downloading latest version from ~/UTCLOUD/borg/borgbackup/ into ~/borgbackup/" # The initial borg repo was created with: # $ borg init --append-only --encryption=keyfile ~/borgbackup # See also: https://borgbackup.readthedocs.io/en/stable/usage/notes.html#append-only-mode @@ -46,7 +46,7 @@ green "Done" # yellow "Backing up git repos" -pushd ~/ +pushd ~/ || exit 1 mr -s master mr -s status @@ -54,13 +54,13 @@ mr -s -j16 update mr -s hd mr -s -j4 rsyncnet -popd +popd || exit 1 yellow "Syncing annex" -pushd ~/annex/ +pushd ~/annex/ || exit 1 git annex sync -popd +popd || exit 1 green "Done" diff --git a/scripts/cp-todos.sh b/scripts/cp-todos.sh index 5ec5a0f..d8e6f30 100755 --- a/scripts/cp-todos.sh +++ b/scripts/cp-todos.sh @@ -1,2 +1,4 @@ +#!/usr/bin/env bash + cp "$HOME/annex/txt/TODOs.org" "$HOME/Nextcloud/Notes/org.txt" cp "$HOME/annex/txt/TODOs.org" "$HOME/Nextcloud/cache/TODOs.org" diff --git a/scripts/dhall-gen.sh b/scripts/dhall-gen.sh deleted file mode 120000 index 75b8290..0000000 --- a/scripts/dhall-gen.sh +++ /dev/null @@ -1 +0,0 @@ -../dhall/dhall-gen.sh
\ No newline at end of file diff --git a/scripts/gc.sh b/scripts/gc.sh index ac1b412..c4d3ec3 100755 --- a/scripts/gc.sh +++ b/scripts/gc.sh @@ -10,8 +10,8 @@ yellow "Cleaning up the NixOS store" profiles=(per-user/root/channels per-user/andreh/profile per-user/andreh/channels system) -for p in ${profiles[@]}; do - sudo nix-env --delete-generations old -p /nix/var/nix/profiles/$p +for p in "${profiles[@]}"; do + sudo nix-env --delete-generations old -p "/nix/var/nix/profiles/$p" done # Current profile, change when installing with =nix-env -iA nixpkgs.bsdgames= @@ -36,11 +36,11 @@ sudo find /tmp -type f -atime +10 -delete yellow "Erasing docker images" echo y | docker system prune -a -docker rmi $(docker images -a -q) -docker rm $(docker ps -a -f status=exited -q) +docker rmi "$(docker images -a -q)" +docker rm "$(docker ps -a -f status=exited -q)" -docker stop $(docker ps -a -q) -docker rm $(docker ps -a -q) +docker stop "$(docker ps -a -q)" +docker rm "$(docker ps -a -q)" echo y | docker volume prune echo y | docker container prune diff --git a/scripts/mail.sh b/scripts/mail.sh index a7c8208..00c111f 100755 --- a/scripts/mail.sh +++ b/scripts/mail.sh @@ -1,3 +1,5 @@ +#!/usr/bin/env bash + if [ "$1" = "-s" ]; then mbsync -aV &>> /tmp/mbsync.log && notmuch new &>> /tmp/notmuch.log else diff --git a/scripts/once-only-nextcloud.sh b/scripts/once-only-nextcloud.sh index 8400080..7886b6f 100755 --- a/scripts/once-only-nextcloud.sh +++ b/scripts/once-only-nextcloud.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/usr/bin/env bash if [ "$(pidof nextcloud)" ] then diff --git a/scripts/single-monitor.sh b/scripts/single-monitor.sh index ec6c5e2..5b0d03e 100755 --- a/scripts/single-monitor.sh +++ b/scripts/single-monitor.sh @@ -1,2 +1,2 @@ -#!/bin/sh +#!/usr/bin/env bash xrandr --output VIRTUAL1 --off --output eDP1 --primary --mode 1920x1080 --pos 640x1440 --rotate normal --output DP1 --off --output HDMI2 --off --output HDMI1 --off --output DP2 --off diff --git a/scripts/startx b/scripts/startx index 9b1d153..cca34a2 100755 --- a/scripts/startx +++ b/scripts/startx @@ -1,3 +1,3 @@ -#!/bin/sh +#!/usr/bin/env bash sudo systemctl restart display-manager & diff --git a/scripts/three-monitors.sh b/scripts/three-monitors.sh index d1ef7c6..d8c4e53 100755 --- a/scripts/three-monitors.sh +++ b/scripts/three-monitors.sh @@ -1,2 +1,2 @@ -#!/bin/sh +#!/usr/bin/env bash xrandr --output VIRTUAL1 --off --output eDP1 --primary --mode 1920x1080 --pos 640x1440 --rotate normal --output DP1 --off --output HDMI2 --off --output HDMI1 --mode 2560x1440 --pos 0x0 --rotate normal --output DP2 --mode 2560x1440 --pos 2560x0 --rotate left diff --git a/dhall/sr-ht-build.dhall b/templates/sr-ht-build.dhall index 41b937b..41b937b 100644 --- a/dhall/sr-ht-build.dhall +++ b/templates/sr-ht-build.dhall diff --git a/vps/push-receive-redeploy.sh b/vps/push-receive-redeploy.sh index 87fecd5..46a65bc 100755 --- a/vps/push-receive-redeploy.sh +++ b/vps/push-receive-redeploy.sh @@ -1,6 +1,6 @@ -#!/bin/sh +#!/usr/bin/env bash -cd ~/ +cd ~/ || exit 1 docker pull registry.gitlab.com/euandreh/songbooks/prod:latest docker-compose stop songbooks_app docker-compose up -d --no-deps songbooks_app diff --git a/xmonad/xsession.sh b/xmonad/xsession.sh index b25a9a1..542994f 100644 --- a/xmonad/xsession.sh +++ b/xmonad/xsession.sh @@ -1 +1,3 @@ +#!/usr/bin/env bash + xmonad |