From 4cab17e726d99b47bafc8f605424bca265e94404 Mon Sep 17 00:00:00 2001 From: fabian Date: Fri, 2 Jun 2023 15:52:22 +0200 Subject: [PATCH 1/2] - added shebang line, so nano etc. get the syntax highlighting right - added function to automatically update flatpaks --- home_external/.bash_aliases | 17 +++++++++++++++++ home_external/.bash_aliases_extra | 1 + 2 files changed, 18 insertions(+) diff --git a/home_external/.bash_aliases b/home_external/.bash_aliases index 1503122..97b906c 100644 --- a/home_external/.bash_aliases +++ b/home_external/.bash_aliases @@ -1,3 +1,5 @@ +#!/usr/bin/env bash + if [ "$TERM" == 'xterm-kitty' ]; then alias ssh='kitty +kitten ssh' alias diff='kitty +kitten diff' @@ -29,6 +31,21 @@ alias fssizes='df -kh --output=size,used,avail,pcent,target | sort -hr' alias dirsizes='du -kh --apparent-size --max-depth=1 | sort -hr' +updateFlatpak() { + noconfirm= + if [[ $1 == "-y" ]]; then + noconfirm="--assumeyes"; + fi + executeAndNotify "doUpdateFlatpak $noconfirm" "flatpaks updated" "flatpak update failed"; +} + + +doUpdateFlatpak() { + flatpak update $1; + flatpak remove --unused $1 +} + + # executes command and notifies upon failure execute() { dir="$(pwd)"; diff --git a/home_external/.bash_aliases_extra b/home_external/.bash_aliases_extra index e69de29..f1f641a 100644 --- a/home_external/.bash_aliases_extra +++ b/home_external/.bash_aliases_extra @@ -0,0 +1 @@ +#!/usr/bin/env bash From 8358af1077af1f96756999b05363147cd5893103 Mon Sep 17 00:00:00 2001 From: fabian Date: Fri, 2 Jun 2023 15:54:37 +0200 Subject: [PATCH 2/2] - added useful shell features - cosmetics: whitespace --- home_external/.bashrc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/home_external/.bashrc b/home_external/.bashrc index 6875a62..9b5b727 100644 --- a/home_external/.bashrc +++ b/home_external/.bashrc @@ -2,6 +2,9 @@ # see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) # for examples +set -o pipefail +# set -u + # If not running interactively, don't do anything if [[ $- != *i* ]]; then return @@ -188,7 +191,7 @@ ex () *.tar.bz2) tar xjf $1 ;; *.tar.gz) tar xzf $1 ;; *.bz2) bunzip2 $1 ;; - *.rar) unrar x $1 ;; + *.rar) unrar x $1 ;; *.gz) gunzip $1 ;; *.tar) tar xf $1 ;; *.tbz2) tar xjf $1 ;;