mirror of
https://github.com/Ahwxorg/nixos-config.git
synced 2025-12-04 15:00:13 +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
|
|
@ -1,16 +1,23 @@
|
|||
{pkgs, ...}: let
|
||||
{ pkgs, ... }:
|
||||
let
|
||||
wall-change = pkgs.writeShellScriptBin "wall-change" (builtins.readFile ./scripts/wall-change.sh);
|
||||
wallpaper-picker = pkgs.writeShellScriptBin "wallpaper-picker" (builtins.readFile ./scripts/wallpaper-picker.sh);
|
||||
wallpaper-picker = pkgs.writeShellScriptBin "wallpaper-picker" (
|
||||
builtins.readFile ./scripts/wallpaper-picker.sh
|
||||
);
|
||||
runbg = pkgs.writeShellScriptBin "runbg" (builtins.readFile ./scripts/runbg.sh);
|
||||
|
||||
notes = pkgs.writeShellScriptBin "notes" (builtins.readFile ./scripts/notes.sh);
|
||||
grabtext = pkgs.writeShellScriptBin "grabtext" (builtins.readFile ./scripts/grabtext.sh);
|
||||
unfuck = pkgs.writeShellScriptBin "unfuck" (builtins.readFile ./scripts/unfuck.sh);
|
||||
|
||||
toggle_blur = pkgs.writeScriptBin "toggle_blur" (builtins.readFile ./scripts/toggle_blur.sh);
|
||||
toggle_oppacity = pkgs.writeScriptBin "toggle_oppacity" (builtins.readFile ./scripts/toggle_oppacity.sh);
|
||||
toggle_oppacity = pkgs.writeScriptBin "toggle_oppacity" (
|
||||
builtins.readFile ./scripts/toggle_oppacity.sh
|
||||
);
|
||||
|
||||
ascii = pkgs.writeScriptBin "ascii" (builtins.readFile ./scripts/ascii.sh);
|
||||
in {
|
||||
in
|
||||
{
|
||||
home.packages = with pkgs; [
|
||||
wall-change
|
||||
wallpaper-picker
|
||||
|
|
@ -22,6 +29,7 @@ in {
|
|||
|
||||
notes
|
||||
grabtext
|
||||
unfuck
|
||||
|
||||
ascii
|
||||
|
||||
|
|
|
|||
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