Compare commits

..

3 commits

Author SHA1 Message Date
Felix Buehler
531430c1eb git/config: set default-branch & ignore skipped cherry-picks
Some checks failed
Build / Lint Code Base (push) Has been cancelled
CI / build (push) Has been cancelled
2026-02-02 20:30:42 +01:00
Felix Buehler
4be0c9ae64 shell/aliases: remove unused sudo commands 2026-02-02 20:14:10 +01:00
Felix Buehler
de2fa53348 shell/*: run shellcheck on it 2026-02-02 20:13:26 +01:00
4 changed files with 27 additions and 48 deletions

View file

@ -101,3 +101,7 @@
pruneTags = true pruneTags = true
[help] [help]
autocorrect = prompt autocorrect = prompt
[init]
defaultBranch = main
[advice]
skippedCherryPicks = false

View file

@ -36,32 +36,14 @@ alias fu='sudo "$BASH" -c "$(history -p !!)"'
# open any file wihtout the knowledge of what type it is # open any file wihtout the knowledge of what type it is
alias of="xdg-open" alias of="xdg-open"
# only list the IO of <processname> with iotop # sudo aliases
# io <processname>
io(){
local sudo_needed
[ -n "$(type sudo 2>/dev/null)" ] && [ "$USER" != 'root' ] \
&& sudo_needed="sudo"
${sudo_needed} iotop -p"$(pidof "$1" | sed 's/ / -p/g')"
}
if [ -n "$(type sudo 2>/dev/null)" ] && [ "$USER" != 'root' ]; then if [ -n "$(type sudo 2>/dev/null)" ] && [ "$USER" != 'root' ]; then
#create sudo aliases WITHOUT leading s #create sudo aliases WITHOUT leading s
for sudo in fwupdmgr mount umount iftop iotop fsadm lvchange lvconvert lvcreate lvdisplay lvextend lvm lvmchange lvmconf lvmconfig lvmdiskscan lvmdump lvmetad lvmsadc lvmsar lvreduce lvremove lvrename lvresize lvs lvscan pvchange pvck pvcreate pvdisplay pvmove pvremove pvresize pvs pvscan vgcfgbackup vgcfgrestore vgchange vgck vgconvert vgcreate vgdisplay vgexport vgextend vgimport vgimportclone vgmerge vgmknodes vgreduce vgremove vgrename vgs vgscan vgsplit; for sudo in fwupdmgr mount umount iftop iotop fsadm lvchange lvconvert lvcreate lvdisplay lvextend lvm lvmchange lvmconf lvmconfig lvmdiskscan lvmdump lvmetad lvmsadc lvmsar lvreduce lvremove lvrename lvresize lvs lvscan pvchange pvck pvcreate pvdisplay pvmove pvremove pvresize pvs pvscan vgcfgbackup vgcfgrestore vgchange vgck vgconvert vgcreate vgdisplay vgexport vgextend vgimport vgimportclone vgmerge vgmknodes vgreduce vgremove vgrename vgs vgscan vgsplit;
do do
type $sudo > /dev/null 2>&1 && alias $sudo="sudo $sudo"; type "${sudo}" > /dev/null 2>&1 && alias "${sudo}"="sudo ${sudo}";
done done
unset sudo unset sudo
type pacman >/dev/null 2>&1 && pacman(){
local sudo_needed
# Check if pacman has -S, -R or -U option
# which should indicate in most times if we need sudo
echo "$*" | grep -- "-[SRU]" >/dev/null 2>&1 \
&& sudo_needed="sudo"
${sudo_needed} /usr/bin/pacman "$@"
}
fi fi
alias pwedit="sudo vim -p /etc/{passwd,group,shadow,gshadow}" alias pwedit="sudo vim -p /etc/{passwd,group,shadow,gshadow}"
@ -95,14 +77,13 @@ alias pacman-update='sudo pacman -Syu'
alias aur-update='yay -Syua' alias aur-update='yay -Syua'
# NIX: # NIX:
alias nix-list-results='ls -l /nix/var/nix/gcroots/auto/'
nixpkgs-build() { nixpkgs-build() {
if [[ $# -lt 1 ]]; then if [ "$#" -lt 1 ]; then
echo "Usage: nixpkgs-build <package> [parameters...]" echo "Usage: nixpkgs-build <package> [parameters...]"
return 1 return 1
fi fi
local pkg="$1" pkg=$1
shift shift
if command -v nom >/dev/null 2>&1; then if command -v nom >/dev/null 2>&1; then
@ -129,8 +110,8 @@ alias ttime_black="sh -c \"sleep 300 && notify-send -u critical 'The tea is read
for INTERFACE in /sys/class/net/*; do for INTERFACE in /sys/class/net/*; do
[ -e "$INTERFACE" ] || break # incase it is empty [ -e "$INTERFACE" ] || break # incase it is empty
INTERFACE=$(basename "$INTERFACE") INTERFACE=$(basename "$INTERFACE")
alias ping-all-$INTERFACE="ping -6 ff02::1%$INTERFACE" alias "ping-all-$INTERFACE"="ping -6 ff02::1%$INTERFACE"
alias ping-routes-$INTERFACE="ping -6 ff02::2%$INTERFACE" alias "ping-routes-$INTERFACE"="ping -6 ff02::2%$INTERFACE"
done done
alias sort-by-size="du -hsc * | sort -hk1" alias sort-by-size="du -hsc * | sort -hk1"

View file

@ -2,13 +2,13 @@
#correct some fast tipped cds #correct some fast tipped cds
c() { c() {
if [ "$1" = "d.." ]; then if [ "${1}" = "d.." ]; then
cd ..; cd .. || return
pwd; pwd
fi fi
if [ -d "$1" ]; then if [ -d "${1}" ]; then
cd "$1" || exit; cd "${1}" || return
pwd; pwd
fi fi
return 0; return 0
} }

View file

@ -1,21 +1,15 @@
#!/bin/sh #!/bin/sh
# Append our default paths set_path(){
appendpath () { if [ -d "${1}" ]; then
case ":$PATH:" in export PATH="${1}:${PATH}"
*:"$1":*)
;;
*)
if [ -d "$1" ]; then
export PATH="${PATH:+$PATH:}$1"
fi fi
esac
} }
appendpath ~/.local/bin set_path ~/.local/bin
appendpath ~/.bin set_path ~/.bin
export GOPATH=$HOME/.go export GOPATH="${HOME}/.go"
export GOBIN=$HOME/.gobin export GOBIN="${HOME}/.gobin"
appendpath "$GOPATH"/bin set_path "${GOPATH}/bin"
appendpath "$GOBIN" set_path "${GOBIN}"