aboutsummaryrefslogtreecommitdiff
path: root/macos.local/flake/home/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'macos.local/flake/home/scripts')
-rw-r--r--macos.local/flake/home/scripts/core.nix.org27
-rw-r--r--macos.local/flake/home/scripts/deploy-website.org7
-rw-r--r--macos.local/flake/home/scripts/launcher.org7
-rw-r--r--macos.local/flake/home/scripts/manage-system.org47
-rw-r--r--macos.local/flake/home/scripts/remove-quarantine.org7
5 files changed, 95 insertions, 0 deletions
diff --git a/macos.local/flake/home/scripts/core.nix.org b/macos.local/flake/home/scripts/core.nix.org
new file mode 100644
index 0000000..f3fd314
--- /dev/null
+++ b/macos.local/flake/home/scripts/core.nix.org
@@ -0,0 +1,27 @@
+#+title: Custom Scripts
+
+Import various scripts useful on my system.
+#+begin_src nix
+ { config, pkgs, ... }:
+
+ {
+ home.file = {
+ "./.local/bin/deploy-website" = {
+ executable = true;
+ source = ./deploy-website;
+ };
+ "./.local/bin/launcher" = {
+ executable = true;
+ source = ./launcher;
+ };
+ "./.local/bin/remove-quarantine" = {
+ executable = true;
+ source = ./remove-quarantine;
+ };
+ "./.local/bin/manage-system" = {
+ executable = true;
+ source = ./manage-system;
+ };
+ };
+ }
+#+end_src
diff --git a/macos.local/flake/home/scripts/deploy-website.org b/macos.local/flake/home/scripts/deploy-website.org
new file mode 100644
index 0000000..76e5d54
--- /dev/null
+++ b/macos.local/flake/home/scripts/deploy-website.org
@@ -0,0 +1,7 @@
+#+title: Website Deploy Script
+
+Deploy my website from a specified branch by using =ssh= to get into my server and running the deploy script, passing command line arguments to the script.
+#+begin_src sh
+ #!/bin/sh
+ /usr/bin/ssh jjanzen.ca "sudo /usr/local/bin/deploy.sh "$@""
+#+end_src
diff --git a/macos.local/flake/home/scripts/launcher.org b/macos.local/flake/home/scripts/launcher.org
new file mode 100644
index 0000000..0063bf1
--- /dev/null
+++ b/macos.local/flake/home/scripts/launcher.org
@@ -0,0 +1,7 @@
+#+title: Launcher Script
+
+Use =choose-gui= to launch an application. This is used for a keyboard command to launch applications.
+#+begin_src sh
+ #!/bin/sh
+ open -n $(find -L /Applications /System/Applications /System/Applications/Utilities ~/Applications /opt/homebrew/opt/emacs-plus@* -maxdepth 1 -name "*.app" | choose -f "SauceCodePro Nerd Font" -s 15)
+#+end_src
diff --git a/macos.local/flake/home/scripts/manage-system.org b/macos.local/flake/home/scripts/manage-system.org
new file mode 100644
index 0000000..e8da0d9
--- /dev/null
+++ b/macos.local/flake/home/scripts/manage-system.org
@@ -0,0 +1,47 @@
+#+title: System Management Script
+
+#+begin_src sh
+ #!/bin/sh
+
+ usage ()
+ {
+ echo "Usage: $0 [command] where command is one of"
+ echo "help - show this message and exit"
+ echo "backup - push the configuration to the remote"
+ echo "update - update the system"
+ echo "install - install the system configurations"
+ }
+
+ [ "$#" -eq 0 ] && usage && exit 1
+
+ dir="$pwd"
+ cd ~/.dotfiles || exit 1
+
+ case "$1" in
+ help)
+ usage
+ cd "$dir" || exit 1
+ exit 0
+ ;;
+ backup)
+ git push
+ cd "$dir" || exit 1
+ exit 0
+ ;;
+ update)
+ make update
+ cd "$dir" || exit 1
+ exit 0
+ ;;
+ install)
+ make install
+ cd "$dir" || exit 1
+ exit 0
+ ;;
+ ,*)
+ usage
+ cd "$dir" || exit 1
+ exit 1
+ ;;
+ esac
+#+end_src
diff --git a/macos.local/flake/home/scripts/remove-quarantine.org b/macos.local/flake/home/scripts/remove-quarantine.org
new file mode 100644
index 0000000..373c503
--- /dev/null
+++ b/macos.local/flake/home/scripts/remove-quarantine.org
@@ -0,0 +1,7 @@
+#+title: Remove Quarantine
+
+macOS likes putting applications in quarantine without me wanting. This script removes an application from the quarantine. Remove the app from quarantine by recursively deleting the quarantine attribute on the application.
+#+begin_src sh
+ #!/bin/sh
+ /usr/bin/xattr -dr com.apple.quarantine "$@"
+#+end_src