File tree Expand file tree Collapse file tree 6 files changed +70
-13
lines changed
Expand file tree Collapse file tree 6 files changed +70
-13
lines changed Original file line number Diff line number Diff line change 3939 "Library/Application Support/obs-studio/global.ini" . source = symlink "${ dotfilesPath } /modules/private/mac/obs/global.ini" ;
4040 "Library/Application Support/zen/Profiles/8fh0vfxw.Default (alpha)/chrome/userChrome.css" . source = symlink "${ dotfilesPath } /os/mac/zen/userChrome.css" ;
4141 "Library/LaunchAgents/com.user.disable.airpods.microphone.plist" . source = symlink "${ dotfilesPath } /os/mac/LaunchAgents/com.user.disable.airpods.microphone.plist" ;
42+ "Library/LaunchAgents/com.user.toggle.menubar.plist" . source = symlink "${ dotfilesPath } /os/mac/LaunchAgents/com.user.toggle.menubar.plist" ;
4243}
Original file line number Diff line number Diff line change 3131 system . defaults = import ./_macos-defaults.nix ;
3232 system . keyboard . enableKeyMapping = true ;
3333 system . keyboard . remapCapsLockToEscape = true ;
34+ system . primaryUser = "rafa.gomez" ;
3435
3536 # Necessary for using flakes on this system.
3637 nix . settings . experimental-features = "nix-command flakes" ;
Original file line number Diff line number Diff line change 1+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+ <plist version =" 1.0" >
4+ <dict >
5+ <key >Label </key >
6+ <string >com.user.toggle.menubar </string >
7+ <key >ProgramArguments </key >
8+ <array >
9+ <string >/Users/rafa.gomez/.dotfiles/bin/sdot </string >
10+ <string >mac </string >
11+ <string >toggle_menu_bar </string >
12+ </array >
13+ <key >StartInterval </key >
14+ <integer >5 </integer >
15+ <key >RunAtLoad </key >
16+ <true />
17+ </dict >
18+ </plist >
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ set -euo pipefail
4+
5+ source " $DOTLY_PATH /scripts/core/_main.sh"
6+
7+ # #? Ensure menu bar is visible only when there is one screen.
8+ # ?? 1.1.0
9+ # #?
10+ # #? Usage:
11+ # #? sync_menu_bar_visibility
12+ docs::parse " $@ "
13+
14+ function should_toggle_menu_bar_visibility() {
15+ local -r total_screens=$( get_total_screens)
16+ local -r is_menu_bar_hidden=$( is_menu_bar_hidden)
17+ local -r should_be_hidden=$(( total_screens > 1 ))
18+
19+ [[ " $is_menu_bar_hidden " -ne " $should_be_hidden " ]]
20+ }
21+
22+ function get_total_screens() {
23+ system_profiler SPDisplaysDataType | grep -c " Resolution"
24+ }
25+
26+ function is_menu_bar_hidden() {
27+ defaults read NSGlobalDomain _HIHideMenuBar
28+ }
29+
30+ function toggle_menu_bar() {
31+ open -g " raycast://extensions/iamyeizi/toggle-menu-bar/toggle"
32+ }
33+
34+ if should_toggle_menu_bar_visibility; then
35+ toggle_menu_bar
36+ fi
Original file line number Diff line number Diff line change @@ -73,6 +73,7 @@ export path=(
7373 " /opt/homebrew/opt/node@14/bin"
7474 " /opt/homebrew/bin"
7575 " /opt/homebrew/sbin"
76+ " /Users/rafa.gomez/.local/bin"
7677 " /usr/local/bin"
7778 " /bin"
7879 " /usr/bin"
You can’t perform that action at this time.
0 commit comments