aboutsummaryrefslogtreecommitdiff
path: root/macos.local/.flake/home/scripts
diff options
context:
space:
mode:
authorJacob Janzen <jacob.a.s.janzen@gmail.com>2024-12-16 23:28:56 -0600
committerJacob Janzen <jacob.a.s.janzen@gmail.com>2024-12-16 23:28:56 -0600
commit26dd014860c0edd89a859d2d8c6dff10275acbad (patch)
treebe704eafeb9458cf202240dc0108f13501ae4272 /macos.local/.flake/home/scripts
parent530ee85037375106652e51a23cf05deb2a5ad1d9 (diff)
system changes
Diffstat (limited to 'macos.local/.flake/home/scripts')
-rw-r--r--macos.local/.flake/home/scripts/core.nix.org13
-rw-r--r--macos.local/.flake/home/scripts/launcher.nix.org26
-rw-r--r--macos.local/.flake/home/scripts/remove-quarantine.nix.org24
3 files changed, 63 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..2a908c0
--- /dev/null
+++ b/macos.local/.flake/home/scripts/core.nix.org
@@ -0,0 +1,13 @@
+#+title: Custom Scripts
+
+Import various scripts useful on my system.
+#+begin_src nix
+ { config, pkgs, ... }:
+
+ {
+ imports = [
+ ./launcher.nix
+ ./remove-quarantine.nix
+ ];
+ }
+#+end_src
diff --git a/macos.local/.flake/home/scripts/launcher.nix.org b/macos.local/.flake/home/scripts/launcher.nix.org
new file mode 100644
index 0000000..b9debc7
--- /dev/null
+++ b/macos.local/.flake/home/scripts/launcher.nix.org
@@ -0,0 +1,26 @@
+#+title: Launcher Script
+
+Use =choose-gui= to launch an application. This is used for an =skhd= keyboard command to launch applications.
+#+begin_src nix
+ { config, pkgs, ... }:
+
+ {
+ home.file."./.local/bin/launcher" = {
+ executable = true;
+ text = ''
+#+end_src
+
+Find an app with =choose-gui= and open it.
+#+begin_src sh
+ #!/bin/sh
+ app="$(ls /Applications/ /Applications/Utilities/ /System/Applications/ /System/Applications/Utilities/ ~/Applications/ | grep '\.app$' | sed 's/\.app$//g' | choose -f "SauceCodePro Nerd Font" -s 15 -b ece0c9).app"
+
+ open -n "$HOME/Applications/$app" || open -n "/Applications/$app" || open -n "/System/Applications/Utilities/$app" || open -n "/System/Applications/$app" || open -n "/Applications/Utilities/$app"
+#+end_src
+
+Close the block.
+#+begin_src nix
+ '';
+ };
+ }
+#+end_src
diff --git a/macos.local/.flake/home/scripts/remove-quarantine.nix.org b/macos.local/.flake/home/scripts/remove-quarantine.nix.org
new file mode 100644
index 0000000..fa8d882
--- /dev/null
+++ b/macos.local/.flake/home/scripts/remove-quarantine.nix.org
@@ -0,0 +1,24 @@
+#+title: Remove Quarantine
+
+macOS likes putting applications in quarantine without me wanting. This script removes an application from the quarantine.
+#+begin_src nix
+ { config, pkgs, ... }:
+
+ {
+ home.file."./.local/bin/remove-quarantine" = {
+ executable = true;
+ text = ''
+#+end_src
+
+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
+
+Close the block.
+#+begin_src nix
+ '';
+ };
+ }
+#+end_src