mirror of
https://github.com/Ahwxorg/nixos-config.git
synced 2025-12-05 15:15:39 +01:00
feat: finally adds unfuck script for when things go wrong
This commit is contained in:
parent
6c43318f71
commit
354115b7a3
2 changed files with 70 additions and 8 deletions
54
modules/home/scripts/scripts/unfuck.sh
Normal file
54
modules/home/scripts/scripts/unfuck.sh
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
#!/usr/bin/env bash
|
||||
# unfuck system when shit goes wrong
|
||||
|
||||
usage() {
|
||||
echo "usage: unfuck [OPTION]"
|
||||
echo "example: unfuck everything"
|
||||
}
|
||||
|
||||
unfuck_wallpaper() {
|
||||
pkill swww-daemon
|
||||
setsid swww-daemon &
|
||||
}
|
||||
|
||||
unfuck_bar() {
|
||||
pkill waybar
|
||||
setsid waybar &
|
||||
}
|
||||
|
||||
unfuck_networkmanager() {
|
||||
sudo systemctl restart NetworkManager
|
||||
}
|
||||
|
||||
unfuck_spotify() {
|
||||
if pgrep ncspot; then
|
||||
pkill ncspot
|
||||
ncspot
|
||||
elif pgrep spotify; then
|
||||
pkill spotify
|
||||
spotify
|
||||
fi
|
||||
}
|
||||
|
||||
unfuck_screenlock() {
|
||||
hyprctl --instance 0 'keyword misc:allow_session_lock_restore 1'
|
||||
hyprctl --instance 0 'dispatch exec lockscreen'
|
||||
}
|
||||
|
||||
case $1 in
|
||||
"")
|
||||
echo "what is fucked?"
|
||||
;;
|
||||
-h | --help)
|
||||
usage
|
||||
;;
|
||||
everything)
|
||||
unfuck_screenlock
|
||||
unfuck_bar
|
||||
unfuck_spotify
|
||||
unfuck_wallpaper
|
||||
;;
|
||||
*)
|
||||
eval "unfuck_$1"
|
||||
;;
|
||||
esac
|
||||
Loading…
Add table
Add a link
Reference in a new issue