| ... | ... | @@ -1,5 +1,6 @@ |
| 1 | 1 | { |
| 2 | 2 | pkgs, |
| 3 | lib, |
| 3 | 4 | config, |
| 4 | 5 | ... |
| 5 | 6 | }: let |
| ... | ... | @@ -7,393 +8,396 @@ |
| 7 | 8 | # folder = "~/.dotfiles/files/sketchybar"; |
| 8 | 9 | folder = ../../../files/sketchybar; |
| 9 | 10 | in { |
| 10 | | home.file = { |
| 11 | | sketchybarrc = { |
| 12 | | executable = true; |
| 13 | | target = ".config/sketchybar/sketchybarrc"; |
| 14 | | text = '' |
| 15 | | #!/usr/bin/env sh |
| 11 | home.file = |
| 12 | lib.attrsets.mapAttrs (file: value: ( |
| 13 | lib.attrsets.overrideExisting value {enable = config.shared.darwin.tiling.enable;} |
| 14 | )) { |
| 15 | sketchybarrc = { |
| 16 | executable = true; |
| 17 | target = ".config/sketchybar/sketchybarrc"; |
| 18 | text = '' |
| 19 | #!/usr/bin/env sh |
| 16 | 20 | |
| 17 | | source "$HOME/.config/sketchybar/colors.sh" # Loads all defined colors |
| 18 | | source "$HOME/.config/sketchybar/icons.sh" # Loads all defined icons |
| 21 | source "$HOME/.config/sketchybar/colors.sh" # Loads all defined colors |
| 22 | source "$HOME/.config/sketchybar/icons.sh" # Loads all defined icons |
| 19 | 23 | |
| 20 | | ITEM_DIR="$HOME/.config/sketchybar/items" # Directory where the items are configured |
| 21 | | PLUGIN_DIR="$HOME/.config/sketchybar/plugins" # Directory where all the plugin scripts are stored |
| 24 | ITEM_DIR="$HOME/.config/sketchybar/items" # Directory where the items are configured |
| 25 | PLUGIN_DIR="$HOME/.config/sketchybar/plugins" # Directory where all the plugin scripts are stored |
| 22 | 26 | |
| 23 | | FONT="SF Pro" # Needs to have Regular, Bold, Semibold, Heavy and Black variants |
| 24 | | PADDINGS=3 # All paddings use this value (icon, label, background) |
| 27 | FONT="SF Pro" # Needs to have Regular, Bold, Semibold, Heavy and Black variants |
| 28 | PADDINGS=3 # All paddings use this value (icon, label, background) |
| 25 | 29 | |
| 26 | | # Setting up and starting the helper process |
| 27 | | HELPER=git.felix.helper |
| 28 | | killall helper |
| 29 | | cd $HOME/.config/sketchybar/helper && make |
| 30 | | $HOME/.config/sketchybar/helper/helper $HELPER > /dev/null 2>&1 & |
| 30 | # Setting up and starting the helper process |
| 31 | HELPER=git.felix.helper |
| 32 | killall helper |
| 33 | cd $HOME/.config/sketchybar/helper && make |
| 34 | $HOME/.config/sketchybar/helper/helper $HELPER > /dev/null 2>&1 & |
| 31 | 35 | |
| 32 | | # Unload the macOS on screen indicator overlay for volume change |
| 33 | | # launchctl unload -F /System/Library/LaunchAgents/com.apple.OSDUIHelper.plist > /dev/null 2>&1 & |
| 36 | # Unload the macOS on screen indicator overlay for volume change |
| 37 | # launchctl unload -F /System/Library/LaunchAgents/com.apple.OSDUIHelper.plist > /dev/null 2>&1 & |
| 34 | 38 | |
| 35 | | # Setting up the general bar appearance and default values |
| 36 | | ${pkgs.sketchybar}/bin/sketchybar --bar height=40 \ |
| 37 | | color=$BAR_COLOR \ |
| 38 | | shadow=off \ |
| 39 | | position=top \ |
| 40 | | sticky=on \ |
| 41 | | padding_right=0 \ |
| 42 | | padding_left=0 \ |
| 43 | | corner_radius=12 \ |
| 44 | | y_offset=0 \ |
| 45 | | margin=2 \ |
| 46 | | blur_radius=0 \ |
| 47 | | notch_width=0 \ |
| 48 | | --default updates=when_shown \ |
| 49 | | icon.font="$FONT:Bold:14.0" \ |
| 50 | | icon.color=$ICON_COLOR \ |
| 51 | | icon.padding_left=$PADDINGS \ |
| 52 | | icon.padding_right=$PADDINGS \ |
| 53 | | label.font="$FONT:Semibold:13.0" \ |
| 54 | | label.color=$LABEL_COLOR \ |
| 55 | | label.padding_left=$PADDINGS \ |
| 56 | | label.padding_right=$PADDINGS \ |
| 57 | | background.padding_right=$PADDINGS \ |
| 58 | | background.padding_left=$PADDINGS \ |
| 59 | | background.height=26 \ |
| 60 | | background.corner_radius=9 \ |
| 61 | | popup.background.border_width=2 \ |
| 62 | | popup.background.corner_radius=11 \ |
| 63 | | popup.background.border_color=$POPUP_BORDER_COLOR \ |
| 64 | | popup.background.color=$POPUP_BACKGROUND_COLOR \ |
| 65 | | popup.background.shadow.drawing=on |
| 39 | # Setting up the general bar appearance and default values |
| 40 | ${pkgs.sketchybar}/bin/sketchybar --bar height=40 \ |
| 41 | color=$BAR_COLOR \ |
| 42 | shadow=off \ |
| 43 | position=top \ |
| 44 | sticky=on \ |
| 45 | padding_right=0 \ |
| 46 | padding_left=0 \ |
| 47 | corner_radius=12 \ |
| 48 | y_offset=0 \ |
| 49 | margin=2 \ |
| 50 | blur_radius=0 \ |
| 51 | notch_width=0 \ |
| 52 | --default updates=when_shown \ |
| 53 | icon.font="$FONT:Bold:14.0" \ |
| 54 | icon.color=$ICON_COLOR \ |
| 55 | icon.padding_left=$PADDINGS \ |
| 56 | icon.padding_right=$PADDINGS \ |
| 57 | label.font="$FONT:Semibold:13.0" \ |
| 58 | label.color=$LABEL_COLOR \ |
| 59 | label.padding_left=$PADDINGS \ |
| 60 | label.padding_right=$PADDINGS \ |
| 61 | background.padding_right=$PADDINGS \ |
| 62 | background.padding_left=$PADDINGS \ |
| 63 | background.height=26 \ |
| 64 | background.corner_radius=9 \ |
| 65 | popup.background.border_width=2 \ |
| 66 | popup.background.corner_radius=11 \ |
| 67 | popup.background.border_color=$POPUP_BORDER_COLOR \ |
| 68 | popup.background.color=$POPUP_BACKGROUND_COLOR \ |
| 69 | popup.background.shadow.drawing=on |
| 66 | 70 | |
| 67 | | # Left |
| 68 | | source "$ITEM_DIR/apple.sh" |
| 69 | | source "$ITEM_DIR/spaces.sh" |
| 70 | | source "$ITEM_DIR/front_app.sh" |
| 71 | # Left |
| 72 | source "$ITEM_DIR/apple.sh" |
| 73 | source "$ITEM_DIR/spaces.sh" |
| 74 | source "$ITEM_DIR/front_app.sh" |
| 71 | 75 | |
| 72 | | # Center |
| 73 | | # source "$ITEM_DIR/spotify.sh" |
| 74 | | source "$ITEM_DIR/calendar.sh" |
| 76 | # Center |
| 77 | # source "$ITEM_DIR/spotify.sh" |
| 78 | source "$ITEM_DIR/calendar.sh" |
| 75 | 79 | |
| 76 | | # Right |
| 77 | | # source "$ITEM_DIR/brew.sh" |
| 78 | | # source "$ITEM_DIR/github.sh" |
| 79 | | source "$ITEM_DIR/volume.sh" |
| 80 | | # source "$ITEM_DIR/divider.sh" |
| 81 | | # source "$ITEM_DIR/cpu.sh" |
| 80 | # Right |
| 81 | # source "$ITEM_DIR/brew.sh" |
| 82 | # source "$ITEM_DIR/github.sh" |
| 83 | source "$ITEM_DIR/volume.sh" |
| 84 | # source "$ITEM_DIR/divider.sh" |
| 85 | # source "$ITEM_DIR/cpu.sh" |
| 82 | 86 | |
| 83 | | # Forcing all item scripts to run (never do this outside of sketchybarrc) |
| 84 | | ${pkgs.sketchybar}/bin/sketchybar --update |
| 87 | # Forcing all item scripts to run (never do this outside of sketchybarrc) |
| 88 | ${pkgs.sketchybar}/bin/sketchybar --update |
| 85 | 89 | |
| 86 | | echo "sketchybar configuation loaded.." |
| 87 | | ''; |
| 88 | | }; |
| 89 | | icons = { |
| 90 | | executable = true; |
| 91 | | target = ".config/sketchybar/icons.sh"; |
| 92 | | source = folder + /icons.sh; |
| 93 | | }; |
| 94 | | colors = { |
| 95 | | executable = true; |
| 96 | | target = ".config/sketchybar/colors.sh"; |
| 97 | | text = '' |
| 98 | | #!/usr/bin/env sh |
| 99 | | # Color Palette |
| 100 | | export BLACK=0xff4c4f69 |
| 101 | | export WHITE=0xffeff1f5 |
| 102 | | export RED=0xffd20f39 |
| 103 | | export GREEN=0xff40a02b |
| 104 | | export BLUE=0xff1e66f5 |
| 105 | | export YELLOW=0xffdf8e1d |
| 106 | | export ORANGE=0xfffe640b |
| 107 | | export MAGENTA=0xffea76cb |
| 108 | | export GREY=0xff9ca0b0 |
| 109 | | export TRANSPARENT=0xff000000 |
| 110 | | export BLUE2=0xff7287fd |
| 111 | | export FLAMINGO=0xffdd7878 |
| 90 | echo "sketchybar configuation loaded.." |
| 91 | ''; |
| 92 | }; |
| 93 | icons = { |
| 94 | executable = true; |
| 95 | target = ".config/sketchybar/icons.sh"; |
| 96 | source = folder + /icons.sh; |
| 97 | }; |
| 98 | colors = { |
| 99 | executable = true; |
| 100 | target = ".config/sketchybar/colors.sh"; |
| 101 | text = '' |
| 102 | #!/usr/bin/env sh |
| 103 | # Color Palette |
| 104 | export BLACK=0xff4c4f69 |
| 105 | export WHITE=0xffeff1f5 |
| 106 | export RED=0xffd20f39 |
| 107 | export GREEN=0xff40a02b |
| 108 | export BLUE=0xff1e66f5 |
| 109 | export YELLOW=0xffdf8e1d |
| 110 | export ORANGE=0xfffe640b |
| 111 | export MAGENTA=0xffea76cb |
| 112 | export GREY=0xff9ca0b0 |
| 113 | export TRANSPARENT=0xff000000 |
| 114 | export BLUE2=0xff7287fd |
| 115 | export FLAMINGO=0xffdd7878 |
| 112 | 116 | |
| 113 | | # General bar colors |
| 114 | | export BAR_COLOR=0xeff1f5ff # Color of the bar |
| 115 | | export ICON_COLOR=0xff4c4f69 |
| 116 | | export LABEL_COLOR=0xff4c4f69 # Color of all labels |
| 117 | | export BACKGROUND_1=0xffbcc0cc |
| 118 | | export BACKGROUND_2=0xffbcc0cc |
| 117 | # General bar colors |
| 118 | export BAR_COLOR=0xeff1f5ff # Color of the bar |
| 119 | export ICON_COLOR=0xff4c4f69 |
| 120 | export LABEL_COLOR=0xff4c4f69 # Color of all labels |
| 121 | export BACKGROUND_1=0xffbcc0cc |
| 122 | export BACKGROUND_2=0xffbcc0cc |
| 119 | 123 | |
| 120 | | export POPUP_BACKGROUND_COLOR=$BLACK |
| 121 | | export POPUP_BORDER_COLOR=$WHITE |
| 124 | export POPUP_BACKGROUND_COLOR=$BLACK |
| 125 | export POPUP_BORDER_COLOR=$WHITE |
| 122 | 126 | |
| 123 | | export SHADOW_COLOR=$BLACK |
| 124 | | ''; |
| 125 | | }; |
| 126 | | items_apple = { |
| 127 | | executable = true; |
| 128 | | target = ".config/sketchybar/items/apple.sh"; |
| 129 | | source = folder + /items/executable_apple.sh; |
| 130 | | }; |
| 131 | | items_brew = { |
| 132 | | executable = true; |
| 133 | | target = ".config/sketchybar/items/brew.sh"; |
| 134 | | source = folder + /items/executable_brew.sh; |
| 135 | | }; |
| 136 | | items_calendar = { |
| 137 | | executable = true; |
| 138 | | target = ".config/sketchybar/items/calendar.sh"; |
| 139 | | text = '' |
| 140 | | #!/usr/bin/env sh |
| 127 | export SHADOW_COLOR=$BLACK |
| 128 | ''; |
| 129 | }; |
| 130 | items_apple = { |
| 131 | executable = true; |
| 132 | target = ".config/sketchybar/items/apple.sh"; |
| 133 | source = folder + /items/executable_apple.sh; |
| 134 | }; |
| 135 | items_brew = { |
| 136 | executable = true; |
| 137 | target = ".config/sketchybar/items/brew.sh"; |
| 138 | source = folder + /items/executable_brew.sh; |
| 139 | }; |
| 140 | items_calendar = { |
| 141 | executable = true; |
| 142 | target = ".config/sketchybar/items/calendar.sh"; |
| 143 | text = '' |
| 144 | #!/usr/bin/env sh |
| 141 | 145 | |
| 142 | | sketchybar --add item calendar center \ |
| 143 | | --set calendar icon=cal \ |
| 144 | | display=1 \ |
| 145 | | icon.font="$FONT:Black:12.0" \ |
| 146 | | icon.padding_right=0 \ |
| 147 | | label.width=50 \ |
| 148 | | label.align=right \ |
| 149 | | background.padding_left=15 \ |
| 150 | | update_freq=30 \ |
| 151 | | script="$PLUGIN_DIR/calendar.sh" \ |
| 152 | | click_script="$PLUGIN_DIR/zen.sh" |
| 153 | | ''; |
| 154 | | }; |
| 155 | | items_cpu = { |
| 156 | | executable = true; |
| 157 | | target = ".config/sketchybar/items/cpu.sh"; |
| 158 | | source = folder + /items/executable_cpu.sh; |
| 159 | | }; |
| 160 | | items_divider = { |
| 161 | | executable = true; |
| 162 | | target = ".config/sketchybar/items/divider.sh"; |
| 163 | | source = folder + /items/executable_divider.sh; |
| 164 | | }; |
| 165 | | items_front_app = { |
| 166 | | executable = true; |
| 167 | | target = ".config/sketchybar/items/front_app.sh"; |
| 168 | | text = '' |
| 169 | | #!/usr/bin/env sh |
| 170 | | FRONT_APP_SCRIPT='sketchybar --set $NAME label="$INFO"' |
| 171 | | sketchybar --add event window_focus \ |
| 172 | | --add event windows_on_spaces \ |
| 173 | | --add item system.aerospace left \ |
| 174 | | --set system.aerospace script="$PLUGIN_DIR/aerospace.sh" \ |
| 175 | | icon.font="$FONT:Bold:16.0" \ |
| 176 | | label.drawing=off \ |
| 177 | | icon.width=30 \ |
| 178 | | icon=$YABAI_GRID \ |
| 179 | | icon.color=$BLACK \ |
| 180 | | updates=on \ |
| 181 | | display=active \ |
| 182 | | --subscribe system.aerospace window_focus \ |
| 183 | | windows_on_spaces \ |
| 184 | | mouse.clicked \ |
| 185 | | --add item front_app left \ |
| 186 | | --set front_app script="$FRONT_APP_SCRIPT" \ |
| 187 | | icon.drawing=off \ |
| 188 | | background.padding_left=0 \ |
| 189 | | background.padding_right=10 \ |
| 190 | | label.color=$BLACK \ |
| 191 | | label.font="$FONT:Black:12.0" \ |
| 192 | | display=active \ |
| 193 | | --subscribe front_app front_app_switched |
| 194 | | ''; |
| 195 | | }; |
| 196 | | items_github = { |
| 197 | | executable = true; |
| 198 | | target = ".config/sketchybar/items/github.sh"; |
| 199 | | source = folder + /items/executable_github.sh; |
| 200 | | }; |
| 201 | | items_spaces = { |
| 202 | | executable = true; |
| 203 | | target = ".config/sketchybar/items/spaces.sh"; |
| 204 | | # label.background.color=$BACKGROUND_2 |
| 205 | | text = '' |
| 206 | | ${pkgs.sketchybar}/bin/sketchybar --add event aerospace_workspace_change |
| 207 | | ${pkgs.sketchybar}/bin/sketchybar --add event aerospace_mode_change |
| 208 | | for sid in $(${pkgs.aerospace}/bin/aerospace list-workspaces --all); do |
| 209 | | ${pkgs.sketchybar}/bin/sketchybar --add item space.$sid left \ |
| 210 | | --subscribe space.$sid aerospace_workspace_change \ |
| 211 | | --subscribe space.$sid aerospace_mode_change \ |
| 212 | | --set space.$sid \ |
| 213 | | icon=$sid \ |
| 214 | | icon.padding_left=22 \ |
| 215 | | icon.padding_right=22 \ |
| 216 | | icon.highlight_color=$WHITE \ |
| 217 | | icon.highlight=off \ |
| 218 | | icon.color=0xff4c566a \ |
| 219 | | background.padding_left=-8 \ |
| 220 | | background.padding_right=-8 \ |
| 221 | | background.color=$BACKGROUND_1 \ |
| 222 | | background.drawing=on \ |
| 223 | | script="$PLUGIN_DIR/aerospace.sh $sid" \ |
| 224 | | click_script="aerospace workspace $sid" \ |
| 225 | | label.font="Iosevka Nerd Font:Regular:16.0" \ |
| 226 | | label.padding_right=33 \ |
| 227 | | label.background.height=26 \ |
| 228 | | label.background.drawing=on \ |
| 229 | | label.background.corner_radius=9 \ |
| 230 | | label.drawing=off |
| 231 | | done |
| 232 | | ${pkgs.sketchybar}/bin/sketchybar --add item separator left \ |
| 233 | | --set separator icon= \ |
| 234 | | icon.font="Iosevka Nerd Font:Regular:16.0" \ |
| 235 | | background.padding_left=26 \ |
| 236 | | background.padding_right=15 \ |
| 237 | | label.drawing=off \ |
| 238 | | display=active \ |
| 239 | | icon.color=$GREEN |
| 240 | | ''; |
| 241 | | }; |
| 242 | | items_spotify = { |
| 243 | | executable = true; |
| 244 | | target = ".config/sketchybar/items/spotify.sh"; |
| 245 | | source = folder + /items/executable_spotify.sh; |
| 246 | | }; |
| 247 | | items_volume = { |
| 248 | | executable = true; |
| 249 | | target = ".config/sketchybar/items/volume.sh"; |
| 250 | | text = '' |
| 251 | | INITIAL_WIDTH=$(osascript -e 'set ovol to output volume of (get volume settings)') |
| 252 | | ${pkgs.sketchybar}/bin/sketchybar --add item volume right \ |
| 253 | | --subscribe volume volume_change \ |
| 254 | | --set volume script="$PLUGIN_DIR/volume.sh" \ |
| 255 | | updates=on \ |
| 256 | | icon.background.drawing=on \ |
| 257 | | icon.background.color=$FLAMINGO \ |
| 258 | | icon.background.height=8 \ |
| 259 | | icon.background.corner_radius=3 \ |
| 260 | | icon.width=$INITIAL_WIDTH \ |
| 261 | | width=100 \ |
| 262 | | icon.align=right \ |
| 263 | | label.drawing=off \ |
| 264 | | background.drawing=on \ |
| 265 | | background.color=$BACKGROUND_2 \ |
| 266 | | background.height=8 \ |
| 267 | | background.corner_radius=3 \ |
| 268 | | align=left |
| 146 | sketchybar --add item calendar center \ |
| 147 | --set calendar icon=cal \ |
| 148 | display=1 \ |
| 149 | icon.font="$FONT:Black:12.0" \ |
| 150 | icon.padding_right=0 \ |
| 151 | label.width=50 \ |
| 152 | label.align=right \ |
| 153 | background.padding_left=15 \ |
| 154 | update_freq=30 \ |
| 155 | script="$PLUGIN_DIR/calendar.sh" \ |
| 156 | click_script="$PLUGIN_DIR/zen.sh" |
| 157 | ''; |
| 158 | }; |
| 159 | items_cpu = { |
| 160 | executable = true; |
| 161 | target = ".config/sketchybar/items/cpu.sh"; |
| 162 | source = folder + /items/executable_cpu.sh; |
| 163 | }; |
| 164 | items_divider = { |
| 165 | executable = true; |
| 166 | target = ".config/sketchybar/items/divider.sh"; |
| 167 | source = folder + /items/executable_divider.sh; |
| 168 | }; |
| 169 | items_front_app = { |
| 170 | executable = true; |
| 171 | target = ".config/sketchybar/items/front_app.sh"; |
| 172 | text = '' |
| 173 | #!/usr/bin/env sh |
| 174 | FRONT_APP_SCRIPT='sketchybar --set $NAME label="$INFO"' |
| 175 | sketchybar --add event window_focus \ |
| 176 | --add event windows_on_spaces \ |
| 177 | --add item system.aerospace left \ |
| 178 | --set system.aerospace script="$PLUGIN_DIR/aerospace.sh" \ |
| 179 | icon.font="$FONT:Bold:16.0" \ |
| 180 | label.drawing=off \ |
| 181 | icon.width=30 \ |
| 182 | icon=$YABAI_GRID \ |
| 183 | icon.color=$BLACK \ |
| 184 | updates=on \ |
| 185 | display=active \ |
| 186 | --subscribe system.aerospace window_focus \ |
| 187 | windows_on_spaces \ |
| 188 | mouse.clicked \ |
| 189 | --add item front_app left \ |
| 190 | --set front_app script="$FRONT_APP_SCRIPT" \ |
| 191 | icon.drawing=off \ |
| 192 | background.padding_left=0 \ |
| 193 | background.padding_right=10 \ |
| 194 | label.color=$BLACK \ |
| 195 | label.font="$FONT:Black:12.0" \ |
| 196 | display=active \ |
| 197 | --subscribe front_app front_app_switched |
| 198 | ''; |
| 199 | }; |
| 200 | items_github = { |
| 201 | executable = true; |
| 202 | target = ".config/sketchybar/items/github.sh"; |
| 203 | source = folder + /items/executable_github.sh; |
| 204 | }; |
| 205 | items_spaces = { |
| 206 | executable = true; |
| 207 | target = ".config/sketchybar/items/spaces.sh"; |
| 208 | # label.background.color=$BACKGROUND_2 |
| 209 | text = '' |
| 210 | ${pkgs.sketchybar}/bin/sketchybar --add event aerospace_workspace_change |
| 211 | ${pkgs.sketchybar}/bin/sketchybar --add event aerospace_mode_change |
| 212 | for sid in $(${pkgs.aerospace}/bin/aerospace list-workspaces --all); do |
| 213 | ${pkgs.sketchybar}/bin/sketchybar --add item space.$sid left \ |
| 214 | --subscribe space.$sid aerospace_workspace_change \ |
| 215 | --subscribe space.$sid aerospace_mode_change \ |
| 216 | --set space.$sid \ |
| 217 | icon=$sid \ |
| 218 | icon.padding_left=22 \ |
| 219 | icon.padding_right=22 \ |
| 220 | icon.highlight_color=$WHITE \ |
| 221 | icon.highlight=off \ |
| 222 | icon.color=0xff4c566a \ |
| 223 | background.padding_left=-8 \ |
| 224 | background.padding_right=-8 \ |
| 225 | background.color=$BACKGROUND_1 \ |
| 226 | background.drawing=on \ |
| 227 | script="$PLUGIN_DIR/aerospace.sh $sid" \ |
| 228 | click_script="aerospace workspace $sid" \ |
| 229 | label.font="Iosevka Nerd Font:Regular:16.0" \ |
| 230 | label.padding_right=33 \ |
| 231 | label.background.height=26 \ |
| 232 | label.background.drawing=on \ |
| 233 | label.background.corner_radius=9 \ |
| 234 | label.drawing=off |
| 235 | done |
| 236 | ${pkgs.sketchybar}/bin/sketchybar --add item separator left \ |
| 237 | --set separator icon= \ |
| 238 | icon.font="Iosevka Nerd Font:Regular:16.0" \ |
| 239 | background.padding_left=26 \ |
| 240 | background.padding_right=15 \ |
| 241 | label.drawing=off \ |
| 242 | display=active \ |
| 243 | icon.color=$GREEN |
| 244 | ''; |
| 245 | }; |
| 246 | items_spotify = { |
| 247 | executable = true; |
| 248 | target = ".config/sketchybar/items/spotify.sh"; |
| 249 | source = folder + /items/executable_spotify.sh; |
| 250 | }; |
| 251 | items_volume = { |
| 252 | executable = true; |
| 253 | target = ".config/sketchybar/items/volume.sh"; |
| 254 | text = '' |
| 255 | INITIAL_WIDTH=$(osascript -e 'set ovol to output volume of (get volume settings)') |
| 256 | ${pkgs.sketchybar}/bin/sketchybar --add item volume right \ |
| 257 | --subscribe volume volume_change \ |
| 258 | --set volume script="$PLUGIN_DIR/volume.sh" \ |
| 259 | updates=on \ |
| 260 | icon.background.drawing=on \ |
| 261 | icon.background.color=$FLAMINGO \ |
| 262 | icon.background.height=8 \ |
| 263 | icon.background.corner_radius=3 \ |
| 264 | icon.width=$INITIAL_WIDTH \ |
| 265 | width=100 \ |
| 266 | icon.align=right \ |
| 267 | label.drawing=off \ |
| 268 | background.drawing=on \ |
| 269 | background.color=$BACKGROUND_2 \ |
| 270 | background.height=8 \ |
| 271 | background.corner_radius=3 \ |
| 272 | align=left |
| 269 | 273 | |
| 270 | | ${pkgs.sketchybar}/bin/sketchybar --add alias "Control Center,Sound" right \ |
| 271 | | --rename "Control Center,Sound" volume_alias \ |
| 272 | | --set volume_alias icon.drawing=off \ |
| 273 | | label.drawing=off \ |
| 274 | | alias.color=$BLUE2 \ |
| 275 | | background.padding_right=0 \ |
| 276 | | background.padding_left=5 \ |
| 277 | | width=50 \ |
| 278 | | align=right \ |
| 279 | | click_script="$PLUGIN_DIR/volume_click.sh" |
| 274 | ${pkgs.sketchybar}/bin/sketchybar --add alias "Control Center,Sound" right \ |
| 275 | --rename "Control Center,Sound" volume_alias \ |
| 276 | --set volume_alias icon.drawing=off \ |
| 277 | label.drawing=off \ |
| 278 | alias.color=$BLUE2 \ |
| 279 | background.padding_right=0 \ |
| 280 | background.padding_left=5 \ |
| 281 | width=50 \ |
| 282 | align=right \ |
| 283 | click_script="$PLUGIN_DIR/volume_click.sh" |
| 280 | 284 | |
| 281 | | ''; |
| 282 | | }; |
| 283 | | plugins_brew = { |
| 284 | | executable = true; |
| 285 | | target = ".config/sketchybar/plugins/brew.sh"; |
| 286 | | source = folder + /plugins/executable_brew.sh; |
| 287 | | }; |
| 288 | | plugins_calendar = { |
| 289 | | executable = true; |
| 290 | | target = ".config/sketchybar/plugins/calendar.sh"; |
| 291 | | source = folder + /plugins/executable_calendar.sh; |
| 292 | | }; |
| 293 | | plugins_github = { |
| 294 | | executable = true; |
| 295 | | target = ".config/sketchybar/plugins/github.sh"; |
| 296 | | source = folder + /plugins/executable_github.sh; |
| 297 | | }; |
| 298 | | plugins_icon_map = { |
| 299 | | executable = true; |
| 300 | | target = ".config/sketchybar/plugins/icon_map.sh"; |
| 301 | | source = folder + /plugins/executable_icon_map.sh; |
| 302 | | }; |
| 303 | | plugins_space = { |
| 304 | | executable = true; |
| 305 | | target = ".config/sketchybar/plugins/space.sh"; |
| 306 | | source = folder + /plugins/executable_space.sh; |
| 307 | | }; |
| 308 | | plugins_spotify = { |
| 309 | | executable = true; |
| 310 | | target = ".config/sketchybar/plugins/spotify.sh"; |
| 311 | | source = folder + /plugins/executable_spotify.sh; |
| 312 | | }; |
| 313 | | plugins_volume = { |
| 314 | | executable = true; |
| 315 | | target = ".config/sketchybar/plugins/volume.sh"; |
| 316 | | text = '' |
| 317 | | #!/usr/bin/env sh |
| 318 | | WIDTH=100 |
| 285 | ''; |
| 286 | }; |
| 287 | plugins_brew = { |
| 288 | executable = true; |
| 289 | target = ".config/sketchybar/plugins/brew.sh"; |
| 290 | source = folder + /plugins/executable_brew.sh; |
| 291 | }; |
| 292 | plugins_calendar = { |
| 293 | executable = true; |
| 294 | target = ".config/sketchybar/plugins/calendar.sh"; |
| 295 | source = folder + /plugins/executable_calendar.sh; |
| 296 | }; |
| 297 | plugins_github = { |
| 298 | executable = true; |
| 299 | target = ".config/sketchybar/plugins/github.sh"; |
| 300 | source = folder + /plugins/executable_github.sh; |
| 301 | }; |
| 302 | plugins_icon_map = { |
| 303 | executable = true; |
| 304 | target = ".config/sketchybar/plugins/icon_map.sh"; |
| 305 | source = folder + /plugins/executable_icon_map.sh; |
| 306 | }; |
| 307 | plugins_space = { |
| 308 | executable = true; |
| 309 | target = ".config/sketchybar/plugins/space.sh"; |
| 310 | source = folder + /plugins/executable_space.sh; |
| 311 | }; |
| 312 | plugins_spotify = { |
| 313 | executable = true; |
| 314 | target = ".config/sketchybar/plugins/spotify.sh"; |
| 315 | source = folder + /plugins/executable_spotify.sh; |
| 316 | }; |
| 317 | plugins_volume = { |
| 318 | executable = true; |
| 319 | target = ".config/sketchybar/plugins/volume.sh"; |
| 320 | text = '' |
| 321 | #!/usr/bin/env sh |
| 322 | WIDTH=100 |
| 319 | 323 | |
| 320 | | volume_change() { |
| 321 | | # INITIAL_WIDTH=$(${pkgs.sketchybar}/bin/sketchybar --query $NAME | ${pkgs.jq}/bin/jq ".icon.width") |
| 322 | | # if [ "$INITIAL_WIDTH" -eq "0" ]; then |
| 323 | | # ${pkgs.sketchybar}/bin/sketchybar --animate tanh 30 --set $NAME width=$WIDTH icon.width=$INFO |
| 324 | | # else |
| 325 | | # ${pkgs.sketchybar}/bin/sketchybar --set $NAME icon.width=$INFO width=$WIDTH |
| 326 | | # fi |
| 327 | | ${pkgs.sketchybar}/bin/sketchybar --set $NAME icon.width=$INFO |
| 324 | volume_change() { |
| 325 | # INITIAL_WIDTH=$(${pkgs.sketchybar}/bin/sketchybar --query $NAME | ${pkgs.jq}/bin/jq ".icon.width") |
| 326 | # if [ "$INITIAL_WIDTH" -eq "0" ]; then |
| 327 | # ${pkgs.sketchybar}/bin/sketchybar --animate tanh 30 --set $NAME width=$WIDTH icon.width=$INFO |
| 328 | # else |
| 329 | # ${pkgs.sketchybar}/bin/sketchybar --set $NAME icon.width=$INFO width=$WIDTH |
| 330 | # fi |
| 331 | ${pkgs.sketchybar}/bin/sketchybar --set $NAME icon.width=$INFO |
| 328 | 332 | |
| 329 | 333 | |
| 330 | | # sleep 5 |
| 331 | | # FINAL_WIDTH=$(${pkgs.sketchybar}/bin/sketchybar --query $NAME | ${pkgs.jq}/bin/jq ".icon.width") |
| 332 | | # if [ "$FINAL_WIDTH" -eq "$INFO" ]; then |
| 333 | | # ${pkgs.sketchybar}/bin/sketchybar --animate tanh 30 --set $NAME width=0 icon.width=0 |
| 334 | | # fi |
| 335 | | } |
| 336 | | |
| 337 | | case "$SENDER" in |
| 338 | | "volume_change") volume_change |
| 339 | | ;; |
| 340 | | esac |
| 341 | | ''; |
| 342 | | }; |
| 343 | | plugins_volume_click = { |
| 344 | | executable = true; |
| 345 | | target = ".config/sketchybar/plugins/volume_click.sh"; |
| 346 | | text = '' |
| 347 | | #!/usr/bin/env sh |
| 348 | | MUTED=$(osascript -e 'output muted of (get volume settings)') |
| 349 | | if [ "$MUTED" = "false" ]; then |
| 350 | | osascript -e 'set volume output muted true' |
| 351 | | else |
| 352 | | osascript -e 'set volume output muted false' |
| 353 | | fi |
| 354 | | ''; |
| 355 | | }; |
| 356 | | plugins_zen = { |
| 357 | | executable = true; |
| 358 | | target = ".config/sketchybar/plugins/zen.sh"; |
| 359 | | source = folder + /plugins/executable_zen.sh; |
| 360 | | }; |
| 361 | | plugins_aerospace = { |
| 362 | | executable = true; |
| 363 | | target = ".config/sketchybar/plugins/aerospace.sh"; |
| 364 | | text = '' |
| 365 | | #!/usr/bin/env bash |
| 366 | | source "$HOME/.config/sketchybar/colors.sh" # Loads all defined colors |
| 334 | # sleep 5 |
| 335 | # FINAL_WIDTH=$(${pkgs.sketchybar}/bin/sketchybar --query $NAME | ${pkgs.jq}/bin/jq ".icon.width") |
| 336 | # if [ "$FINAL_WIDTH" -eq "$INFO" ]; then |
| 337 | # ${pkgs.sketchybar}/bin/sketchybar --animate tanh 30 --set $NAME width=0 icon.width=0 |
| 338 | # fi |
| 339 | } |
| 367 | 340 | |
| 368 | | highlight_focused_workspace() { |
| 369 | | if [[ "$1" = "$FOCUSED_WORKSPACE" ]] |
| 370 | | then |
| 371 | | ${pkgs.sketchybar}/bin/sketchybar --animate tanh 20 --set $NAME icon.highlight=on label.width=0 |
| 341 | case "$SENDER" in |
| 342 | "volume_change") volume_change |
| 343 | ;; |
| 344 | esac |
| 345 | ''; |
| 346 | }; |
| 347 | plugins_volume_click = { |
| 348 | executable = true; |
| 349 | target = ".config/sketchybar/plugins/volume_click.sh"; |
| 350 | text = '' |
| 351 | #!/usr/bin/env sh |
| 352 | MUTED=$(osascript -e 'output muted of (get volume settings)') |
| 353 | if [ "$MUTED" = "false" ]; then |
| 354 | osascript -e 'set volume output muted true' |
| 372 | 355 | else |
| 373 | | ${pkgs.sketchybar}/bin/sketchybar --animate tanh 20 --set $NAME icon.highlight=off label.width=dynamic |
| 356 | osascript -e 'set volume output muted false' |
| 374 | 357 | fi |
| 375 | | } |
| 358 | ''; |
| 359 | }; |
| 360 | plugins_zen = { |
| 361 | executable = true; |
| 362 | target = ".config/sketchybar/plugins/zen.sh"; |
| 363 | source = folder + /plugins/executable_zen.sh; |
| 364 | }; |
| 365 | plugins_aerospace = { |
| 366 | executable = true; |
| 367 | target = ".config/sketchybar/plugins/aerospace.sh"; |
| 368 | text = '' |
| 369 | #!/usr/bin/env bash |
| 370 | source "$HOME/.config/sketchybar/colors.sh" # Loads all defined colors |
| 376 | 371 | |
| 377 | | illuminate_mode() { |
| 378 | | if [[ "$mode" = "service" ]] |
| 379 | | then |
| 380 | | ${pkgs.sketchybar}/bin/sketchybar --animate tanh 20 --set $NAME background.color=$ORANGE |
| 381 | | elif [[ "$mode" = "resize" ]] |
| 382 | | then |
| 383 | | ${pkgs.sketchybar}/bin/sketchybar --animate tanh 20 --set $NAME background.color=$GREEN |
| 384 | | else |
| 385 | | ${pkgs.sketchybar}/bin/sketchybar --animate tanh 20 --set $NAME background.color=$BACKGROUND_1 |
| 386 | | fi |
| 387 | | } |
| 388 | | case "$SENDER" in |
| 389 | | "aerospace_workspace_change") |
| 390 | | highlight_focused_workspace $1 |
| 391 | | ;; |
| 392 | | "aerospace_mode_change") |
| 393 | | illuminate_mode |
| 394 | | ;; |
| 395 | | esac |
| 396 | | ''; |
| 372 | highlight_focused_workspace() { |
| 373 | if [[ "$1" = "$FOCUSED_WORKSPACE" ]] |
| 374 | then |
| 375 | ${pkgs.sketchybar}/bin/sketchybar --animate tanh 20 --set $NAME icon.highlight=on label.width=0 |
| 376 | else |
| 377 | ${pkgs.sketchybar}/bin/sketchybar --animate tanh 20 --set $NAME icon.highlight=off label.width=dynamic |
| 378 | fi |
| 379 | } |
| 380 | |
| 381 | illuminate_mode() { |
| 382 | if [[ "$mode" = "service" ]] |
| 383 | then |
| 384 | ${pkgs.sketchybar}/bin/sketchybar --animate tanh 20 --set $NAME background.color=$ORANGE |
| 385 | elif [[ "$mode" = "resize" ]] |
| 386 | then |
| 387 | ${pkgs.sketchybar}/bin/sketchybar --animate tanh 20 --set $NAME background.color=$GREEN |
| 388 | else |
| 389 | ${pkgs.sketchybar}/bin/sketchybar --animate tanh 20 --set $NAME background.color=$BACKGROUND_1 |
| 390 | fi |
| 391 | } |
| 392 | case "$SENDER" in |
| 393 | "aerospace_workspace_change") |
| 394 | highlight_focused_workspace $1 |
| 395 | ;; |
| 396 | "aerospace_mode_change") |
| 397 | illuminate_mode |
| 398 | ;; |
| 399 | esac |
| 400 | ''; |
| 401 | }; |
| 397 | 402 | }; |
| 398 | | }; |
| 399 | 403 | } |