From 0c8fa3a2a270747f3dbb54fe8792f3f0aec997e3 Mon Sep 17 00:00:00 2001 From: Ryan Schanzenbacher Date: Mon, 3 Aug 2026 01:22:44 -0400 Subject: Initial commit: combined darwin + guix-linux home-manager flake Supersedes nix-dotfiles (darwin) and guix-dotfiles' ad-hoc nix-home-manager flake (linux). See README.md/MIGRATION.md. --- .../lib/scripts/firefox-dev-audio.applescript | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100755 users/ryan/modules/simple-bar/simple-bar-source/lib/scripts/firefox-dev-audio.applescript (limited to 'users/ryan/modules/simple-bar/simple-bar-source/lib/scripts/firefox-dev-audio.applescript') diff --git a/users/ryan/modules/simple-bar/simple-bar-source/lib/scripts/firefox-dev-audio.applescript b/users/ryan/modules/simple-bar/simple-bar-source/lib/scripts/firefox-dev-audio.applescript new file mode 100755 index 0000000..6618fec --- /dev/null +++ b/users/ryan/modules/simple-bar/simple-bar-source/lib/scripts/firefox-dev-audio.applescript @@ -0,0 +1,24 @@ +set browser to "" +set title_string to "" +set active_tab to 0 + +to replace_chars(this_text, search_string, replacement_string) + set AppleScript's text item delimiters to the search_string + set the item_list to every text item of this_text + set AppleScript's text item delimiters to the replacement_string + set this_text to the item_list as string + set AppleScript's text item delimiters to "" + return this_text +end replace_chars + +tell application "Firefox Developer Edition" + set the_title to (name of windows whose name contains "- YouTube") as text + + if "- YouTube" is in the_title then + if active_tab is 0 then set title_string to " " & text 1 thru -11 of the_title + set browser to "firefox" + set active_tab to 1 + end if +end tell + +return "{ \"browser\": \"" & browser & "\", \"title\": \"" & replace_chars(title_string, "\"", "Ò") & "\" }" -- cgit v1.3.1