From a89b7cfe62400e295b126313bd5a0596262b9633 Mon Sep 17 00:00:00 2001 From: Nico Date: Tue, 28 Oct 2025 20:37:40 +1100 Subject: [PATCH 1/4] yabai: make a script to toggle tiling --- stow/.config/yabai/toggle-tiling.sh | 52 +++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100755 stow/.config/yabai/toggle-tiling.sh diff --git a/stow/.config/yabai/toggle-tiling.sh b/stow/.config/yabai/toggle-tiling.sh new file mode 100755 index 0000000..5ef3618 --- /dev/null +++ b/stow/.config/yabai/toggle-tiling.sh @@ -0,0 +1,52 @@ +#!/bin/sh + +disableTiling () { + defaults write com.apple.dock orientation bottom + defaults write com.apple.dock autohide -bool FALSE + + killall Finder Dock sketchybar borders + yabai -m config menubar_opacity 1.0 + + SPACES=("1" "2" "3" "4" "5" "6" "7" "8" "9") + for i in "${!SPACES[@]}"; do + yabai -m space $i --layout float + done + + osascript -e 'tell application "System Events" + tell dock preferences + set properties to {autohide menu bar:false, autohide:false} + end tell + end tell' +} + +enableTiling () { + defaults write com.apple.dock orientation right + defaults write com.apple.dock autohide -bool FALSE + killall Dock Finder + + sketchybar & + sh ~/.cache/matugen-jankyborders.sh & + yabai -m config menubar_opacity 0.0 + + SPACES=("1" "2" "3" "4" "5" "6" "7" "8" "9") + for i in "${!SPACES[@]}"; do + yabai -m space $i --layout bsp + done + + + osascript -e ' + tell application "System Events" + tell dock preferences + set properties to {autohide menu bar:true, autohide:true} + end tell + end tell +' +} + +if [ "$1" = "on" ]; then + enableTiling +elif [ "$1" = "off" ]; then + disableTiling +else + echo "$0: [on|off]" +fi From 0de08d5891e396ce7af71188a60b990e0546b227 Mon Sep 17 00:00:00 2001 From: Nico Date: Tue, 28 Oct 2025 20:51:58 +1100 Subject: [PATCH 2/4] sketchybar: clean up file --- stow/.config/sketchybar/sketchybarrc | 143 +++++++++------------------ 1 file changed, 49 insertions(+), 94 deletions(-) diff --git a/stow/.config/sketchybar/sketchybarrc b/stow/.config/sketchybar/sketchybarrc index 2e3f6f8..a9f4093 100755 --- a/stow/.config/sketchybar/sketchybarrc +++ b/stow/.config/sketchybar/sketchybarrc @@ -1,73 +1,42 @@ # vim: set filetype=sh : -# This is a demo config to showcase some of the most important commands. -# It is meant to be changed and configured, as it is intentionally kept sparse. -# For a (much) more advanced configuration example see my dotfiles: -# https://github.com/FelixKratz/dotfiles - PLUGIN_DIR="$HOME/dots/stow/.config/sketchybar/plugins" +source $PLUGIN_DIR/../colours.sh # bar colours -##### Bar Appearance ##### -# Configuring the general appearance of the bar. -# These are only some of the options available. For all options see: -# https://felixkratz.github.io/SketchyBar/config/bar -# If you are looking for other colors, see the color picker: -# https://felixkratz.github.io/SketchyBar/config/tricks#color-picker - -sketchybar --bar position=top height=42 blur_radius=0 color=0x00000000 padding_right=15 padding_left=15 y_offset=0 corner_radius=0 - -source $PLUGIN_DIR/../colours.sh - -##### Changing Defaults ##### -# We now change some default values, which are applied to all further items. -# For a full list of all available item properties see: -# https://felixkratz.github.io/SketchyBar/config/items +sketchybar --bar \ + position=top \ + height=42 \ + blur_radius=0 \ + color=0x00000000 \ + padding_right=15 \ + padding_left=15 \ + y_offset=0 \ + corner_radius=0 \ default=( icon.font="ComicShannsMono Nerd Font:Regular:16.0" label.font="ComicShannsMono Nerd Font:Bold:12.0" - background.border_color=0x00000000 - background.border_width=3 - background.height=32 - - padding_left=1 - padding_right=1 label.color=$PRIMARY_COLOUR icon.color=$SECONDARY_COLOUR background.color=$BACKGROUND_COLOUR + background.corner_radius=$ROUNDING + background.border_color=0x00000000 + background.border_width=3 + + background.height=32 + background.padding_right=0 + background.padding_left=0 + icon.padding_left=10 icon.padding_right=1 label.padding_left=7 label.padding_right=7 - background.corner_radius=$ROUNDING ) sketchybar --default "${default[@]}" # -# Adding Left Items +# Left Items # -# Aerospace workspace indicators -sketchybar --add event aerospace_workspace_change -for sid in $(aerospace list-workspaces --all); do - sketchybar --add item space.$sid left \ - --subscribe space.$sid aerospace_workspace_change \ - --set space.$sid \ - background.color=$BACKGROUND_COLOUR \ - background.drawing=true \ - icon.drawing=false \ - background.height=28 \ - background.border_width=0 \ - background.padding_right=0 \ - background.padding_left=0 \ - label.color=$PRIMARY_COLOUR \ - label="$sid" \ - click_script="aerospace workspace $sid" \ - script="$CONFIG_DIR/plugins/aerospace.sh $sid" -done -# background.corner_radius=0 \ - - - # Yabai Workspace Indictators # SPACE_ICONS=("1" "2" "3" "4" "5" "6" "7" "8" "9") @@ -77,9 +46,8 @@ do space=( space="$sid" icon="${SPACE_ICONS[i]}" - background.drawing=true \ icon.drawing=false \ - background.height=28 \ + background.height=29 \ background.border_width=0 \ background.padding_right=0 \ background.padding_left=0 \ @@ -94,69 +62,56 @@ done # Focused window title sketchybar --add item front_app left \ - --set front_app icon="󱂬 " \ - script="$PLUGIN_DIR/front_app.sh" \ - --subscribe front_app front_app_switched \ + script="$PLUGIN_DIR/front_app.sh" \ + --set front_app icon="󱂬 " \ + --subscribe front_app front_app_switched \ # Currently playing music status (only works for Music.app) sketchybar --add item music left \ - --set music icon="󰎇 " update_freq=10 \ - script="$PLUGIN_DIR/music.sh" \ - click_script="osascript -e 'tell application \"Music\" to playpause'" \ - background.padding_right=0 \ - background.padding_left=0 \ - drawing=false \ - scroll_texts=1 \ - label.max_chars=50 \ - label.scroll_duration=500 \ - background.color=$PRIMARY_COLOUR \ - icon.color=$BACKGROUND_COLOUR \ - label.color=$BACKGROUND_COLOUR \ - drawing=false + --set music icon="󰎇 " update_freq=10 \ + script="$PLUGIN_DIR/music.sh" \ + click_script="osascript -e 'tell application \"Music\" to playpause'" \ + scroll_texts=1 \ + label.max_chars=50 \ + label.scroll_duration=500 \ + background.color=$PRIMARY_COLOUR \ + icon.color=$BACKGROUND_COLOUR \ + label.color=$BACKGROUND_COLOUR \ + drawing=false # -# Adding Right Items +# Right Items # # Clock sketchybar --add item clock right \ - --set clock icon=" " \ - update_freq=10 \ - background.padding_right=0 \ - background.padding_left=0 \ - label.padding_right=10 \ - script="$PLUGIN_DIR/clock.sh" + --set clock icon=" " \ + update_freq=10 \ + label.padding_right=10 \ + script="$PLUGIN_DIR/clock.sh" # Input Method sketchybar --add item input-method right \ - --set input-method icon="" \ - update_freq=1 \ - background.padding_right=0 \ - background.padding_left=0 \ - script="$PLUGIN_DIR/input-method.sh" + --set input-method icon="" \ + update_freq=1 \ + script="$PLUGIN_DIR/input-method.sh" # Battery sketchybar --add item battery right \ - --set battery update_freq=10 \ - script="$PLUGIN_DIR/battery.sh" \ - background.padding_right=0 \ - background.padding_left=0 \ + --set battery update_freq=10 \ + script="$PLUGIN_DIR/battery.sh" \ # Backlight sketchybar --add item backlight right \ - --set backlight icon="" \ - background.padding_right=0 \ - background.padding_left=0 \ - script="$PLUGIN_DIR/backlight.sh" \ - --subscribe backlight brightness_change \ + --set backlight icon="" \ + script="$PLUGIN_DIR/backlight.sh" \ + --subscribe backlight brightness_change \ # Volume sketchybar --add item audio right \ - --set audio \ - background.padding_right=0 \ - background.padding_left=0 \ - script="$PLUGIN_DIR/volume.sh" \ - --subscribe audio volume_change \ + --set audio \ + script="$PLUGIN_DIR/volume.sh" \ + --subscribe audio volume_change \ ##### Force all scripts to run the first time (never do this in a script) ##### sketchybar --update From 4fedd900ecb5f095c8bc8267979a6025677e3ce7 Mon Sep 17 00:00:00 2001 From: Nico Date: Wed, 29 Oct 2025 20:36:58 +1100 Subject: [PATCH 3/4] sketchybar: make active space indicator bigger --- stow/.config/sketchybar/plugins/space.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stow/.config/sketchybar/plugins/space.sh b/stow/.config/sketchybar/plugins/space.sh index aec9596..5381e9f 100755 --- a/stow/.config/sketchybar/plugins/space.sh +++ b/stow/.config/sketchybar/plugins/space.sh @@ -4,7 +4,7 @@ SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) source $SCRIPT_DIR/../colours.sh if [ $SELECTED = 'true' ]; then - sketchybar --set $NAME background.color=$PRIMARY_COLOUR label.color=$BACKGROUND_COLOUR + sketchybar --set $NAME background.color=$PRIMARY_COLOUR label.color=$BACKGROUND_COLOUR label.padding_left=15 label.padding_right=15 else - sketchybar --set $NAME background.color=$BACKGROUND_COLOUR label.color=$PRIMARY_COLOUR + sketchybar --set $NAME background.color=$BACKGROUND_COLOUR label.color=$PRIMARY_COLOUR label.padding_left=7 label.padding_right=7 fi From 7b1f12fd504d8970c3e53e8e626c62717cc91ab5 Mon Sep 17 00:00:00 2001 From: Nico Date: Wed, 29 Oct 2025 20:37:22 +1100 Subject: [PATCH 4/4] sketchybar: fix active window module --- stow/.config/sketchybar/sketchybarrc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/stow/.config/sketchybar/sketchybarrc b/stow/.config/sketchybar/sketchybarrc index a9f4093..656451b 100755 --- a/stow/.config/sketchybar/sketchybarrc +++ b/stow/.config/sketchybar/sketchybarrc @@ -62,9 +62,8 @@ done # Focused window title sketchybar --add item front_app left \ - script="$PLUGIN_DIR/front_app.sh" \ - --set front_app icon="󱂬 " \ - --subscribe front_app front_app_switched \ + --set front_app icon="󱂬 " script="$PLUGIN_DIR/front_app.sh" \ + --subscribe front_app front_app_switched # Currently playing music status (only works for Music.app) sketchybar --add item music left \