bash: remove old scripts, nerd-laptop, rofi + i3 + alacritty

This commit is contained in:
Michael Grote 2024-06-05 19:03:57 +02:00
parent 51da6fdf67
commit e3fb0156af
5 changed files with 0 additions and 160 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,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,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