Compare commits

...

5 commits

Author SHA1 Message Date
5e88bf3f74 bash: remove suffix from git scripts
All checks were successful
ci/woodpecker/push/lint Pipeline was successful
Signed-off-by: Michael Grote <michael.grote@posteo.de>
2024-06-05 19:14:32 +02:00
91aebe2017 bash: fix git-script linter errors
Signed-off-by: Michael Grote <michael.grote@posteo.de>
2024-06-05 19:13:48 +02:00
5927a331a0 bash: remove sealed secrets scripts 2024-06-05 19:07:22 +02:00
49d07f1ab4 bash: remove suffix from zfs-scripts 2024-06-05 19:07:16 +02:00
e3fb0156af bash: remove old scripts, nerd-laptop, rofi + i3 + alacritty 2024-06-05 19:07:09 +02:00
14 changed files with 6 additions and 197 deletions

View file

@ -1,40 +0,0 @@
#!/bin/sh
# i3-get-window-criteria - Get criteria for use with i3 config commands
# https://faq.i3wm.org/question/2172/how-do-i-find-the-criteria-for-use-with-i3-config-commands-like-for_window-eg-to-force-splashscreens-and-dialogs-to-show-in-floating-mode.1.html
# To use, run this script, then click on a window.
# Output is in the format: [<name>=<value> <name>=<value> ...]
# Known problem: when WM_NAME is used as fallback for the 'title="<string>"' criterion,
# quotes in "<string>" are not escaped properly. This is a problem with the output of `xprop`,
# reported upstream: https://bugs.freedesktop.org/show_bug.cgi?id=66807
PROGNAME=`basename "$0"`
# Check for xwininfo and xprop
for cmd in xwininfo xprop; do
if ! which $cmd > /dev/null 2>&1; then
echo "$PROGNAME: $cmd: command not found" >&2
exit 1
fi
done
match_int='[0-9][0-9]*'
match_string='".*"'
match_qstring='"[^"\\]*(\\.[^"\\]*)*"' # NOTE: Adds 1 backreference
{
# Run xwininfo, get window id
window_id=`xwininfo -int | sed -nre "s/^xwininfo: Window id: ($match_int) .*$/\1/p"`
echo "id=$window_id"
# Run xprop, transform its output into i3 criteria. Handle fallback to
# WM_NAME when _NET_WM_NAME isn't set
xprop -id $window_id |
sed -nr \
-e "s/^WM_CLASS\(STRING\) = ($match_qstring), ($match_qstring)$/instance=\1\nclass=\3/p" \
-e "s/^WM_WINDOW_ROLE\(STRING\) = ($match_qstring)$/window_role=\1/p" \
-e "/^WM_NAME\(STRING\) = ($match_string)$/{s//title=\1/; h}" \
-e "/^_NET_WM_NAME\(UTF8_STRING\) = ($match_qstring)$/{s//title=\1/; h}" \
-e '${g; p}'
} | sort | tr "\n" " " | sed -r 's/^(.*) $/[\1]\n/'

View file

@ -1,2 +1,3 @@
#!/bin/bash
# shellcheck disable=SC2063
git branch | grep -v "*" | grep -v master | grep -v main | xargs git branch -D ; git fetch --prune

View file

@ -13,13 +13,14 @@ function update {
if [ -e "$d/.ignore" ]; then
echo -e "\n${HIGHLIGHT}Ignoring $d${NORMAL}"
else
cd $d > /dev/null
cd "$d" || exit > /dev/null
if [ -d ".git" ]; then
echo -e "\n${HIGHLIGHT}Updating pwd$NORMAL"
git add .
git stash
git pull
else
# shellcheck disable=SC2035
scan *
fi
cd .. > /dev/null
@ -30,12 +31,13 @@ function update {
function scan {
#echo "pwd"
for x in $*; do
for x in "$@"; do
update "$x"
done
}
if [ "$1" != "" ]; then cd $1 > /dev/null; fi
if [ "$1" != "" ]; then cd "$1" || exit > /dev/null; fi
echo -e "${HIGHLIGHT}Scanning ${PWD}${NORMAL}"
# shellcheck disable=SC2035
scan *

View file

@ -1,28 +0,0 @@
#!/bin/bash
# Function to ask for confirmation
ask_confirmation() {
read -rp "Are you sure you want to proceed? (y/n): " response
case "$response" in
[yY][eE][sS]|[yY])
return 0 ;; # Proceed
*)
return 1 ;; # Cancel
esac
}
if ask_confirmation; then
echo "Proceeding..."
echo "docker system prune"
docker system prune -a
echo "Entferne inaktive Container"
docker container prune
echo "Entferne ungenutzte Images"
docker image prune
echo "Entferne inaktive Volumes"
docker volume prune
echo "Entferne inaktive Netzwerke"
docker network prune | docker images -q | xargs docker rmi
else
echo "Cancelled."
fi

View file

@ -1,80 +0,0 @@
#!/bin/bash
function lock {
# Take a screenshot
scrot /tmp/screen_locked.png
# Pixellate it 10x
mogrify -scale 10% -scale 1000% /tmp/screen_locked.png
# Lock screen displaying this image.
i3lock -i /tmp/screen_locked.png
# delete Image
rm -f /tmp/screen_locked.png
}
function reboot {
sudo systemctl reboot
}
function shutdown {
sudo systemctl poweroff
}
function suspend {
lock
sudo systemctl suspend
}
function hibernate {
lock
sudo systemctl hibernate
}
function help {
echo "
Usage:
./pwr.sh [-r|-s|-sd|-hb]
Arguments:
-r, --reboot Reboot this system.
-s, --shutdown Shutdown this system.
-sd, --suspend Suspends this system.
-hb, --hibernate Hibernates this system.
-h, --help Displays this help.
"
}
function display_off {
# Turn the screen off
xset dpms force off
}
if [[ -n "$1" ]]; then
case "$1" in
--reboot | -r)
dunstify -u critical "reboot"
sleep 3
reboot
;;
--shutdown | -s)
dunstify -u critical "shutdown"
sleep 3
shutdown
;;
--suspend | -sd)
dunstify -u critical "suspend"
sleep 3
suspend
;;
--hibernate | -hb)
dunstify -u critical "hibernate"
sleep 3
hibernate
;;
--help | -h)
help
exit 0
;;
*)
echo -e "\e[31mUnbekannter Parameter!"
exit 1
esac
else
lock
sleep 60
display_off
fi

View file

@ -1,18 +0,0 @@
#!/bin/bash
tmpfile=$(mktemp)
cat << EOF
kind: Secret
apiVersion: v1
metadata:
name: NAME_DES_SECRETS
namespace: drone
stringData:
ICH_BIN_DER VARIABLEN_NAME: ICH_BIN_DAS_PASSWORT
EOF > $tmpfile
vim $tmpfile
cat $tmpfile | kubeseal --controller-namespace kube-system --format yaml > ./sealed-secret.yaml
cat sealed-secret.yaml
rm $tmpfile ./sealed-secret.yaml

View file

@ -1,8 +0,0 @@
#!/bin/bash
if [[ "$#" -eq 2 ]]; then
kubectl get secret $1 -n $2 -o jsonpath="{.data.<key>}" | base64 --decode ; echo""
else
echo "Missing:
\$1 = secretname
\$2 = namespace"
fi

View file

@ -1,8 +0,0 @@
#!/bin/bash
echo ">>> write key to ./main.key"
kubectl get secret -n kube-system -l sealedsecrets.bitnami.com/sealed-secrets-key -o yaml > main.key
# https://github.com/bitnami-labs/sealed-secrets#how-can-i-do-a-backup-of-my-sealedsecrets
# restore with:
# kubectl apply -f main.key
# kubectl delete pod -n kube-system -l name=sealed-secrets-controller

View file

@ -1,10 +0,0 @@
#!/bin/bash
if ! pgrep -x "alacritty" > /dev/null
then
# wechsle zu workspace 1 und starte alacritty
i3-msg 'workspace 1; exec --no-startup-id /usr/local/bin/alacritty'
else
# wenn alacritty schon läuft wechsle nur zu workspace 1
dunstify -u low "alacritty is already running"
i3-msg 'workspace 1'
fi

View file

@ -1,2 +0,0 @@
#!/bin/bash
rofi -combi-modi window,drun -show combi