Various scripts that I maintain

Add start-service-if-needed script

Signed-off-by: Shiloh Fen <shiloh@shilohfen.com>

+10
+3
README.md
··· 42 42 43 43 # GNOME extension toggle 44 44 Provides an easy way to toggle a GNOME extension. Useful for setting up keyboard shortcuts. 45 + 46 + # Start Service if Needed 47 + Starts a systemd service if it is not already started, otherwise do nothing. Useful if you only want to ask for the password when the service actually needs to be started.
+7
scripts/start-service-if-needed.nu
··· 1 + #!/usr/bin/nu 2 + 3 + def main [service: string] { 4 + if (systemctl is-active --quiet $service | complete).exit_code == 3 { 5 + systemctl start $service 6 + } 7 + }