Skip to content

Commit

Permalink
updates and screenshot
Browse files Browse the repository at this point in the history
  • Loading branch information
davay committed Mar 11, 2024
1 parent b5eee21 commit 53c042e
Show file tree
Hide file tree
Showing 12 changed files with 75 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .config/sketchybar/get_y_offset.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
count=$(system_profiler SPDisplaysDataType | grep -c Resolution)
airplay=$(system_profiler SPDisplaysDataType | grep -c AirPlay)

if [[ $count -eq 2 ]] && [[ $airplay -eq 0 ]]; then
if [[ $count -eq 3 ]] || ([[ $count -eq 2 ]] && [[ $airplay -eq 0 ]]); then
echo "-24"
else
echo "-38"
Expand Down
32 changes: 18 additions & 14 deletions .config/skhd/skhdrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# focus windo
# focus window
alt - h : if [ "$(yabai -m query --spaces --space | jq -r '.type')" = "stack" ]; then (yabai -m window --focus stack.prev || yabai -m window --focus stack.last); else yabai -m window --focus west; fi
alt - j : yabai -m window --focus south
alt - k : yabai -m window --focus north
Expand All @@ -10,8 +10,10 @@ alt + shift - j : yabai -m window --warp south
alt + shift - k : yabai -m window --warp north
alt + shift - l : yabai -m window --warp east

# balance size of windows
alt + shift - 0 : yabai -m space --balance
# [SIP] create and destroy desktops
alt - d : yabai -m space --create && yabai -m space --focus next
alt + shift - d : yabai -m space --create && yabai -m window --space next && yabai -m space --focus next
alt - w : yabai -m space --destroy

# [SIP] fast focus desktop
alt - 1 : yabai -m space --focus 1
Expand All @@ -38,43 +40,45 @@ alt + shift - 8 : yabai -m window --space 8 && yabai -m space --focus 8
# alt - right : yabai -m display --focus 1

# move to prev or next space
alt - left : yabai -m space --focus prev
alt - right : yabai -m space --focus next
alt - q : yabai -m space --focus prev
alt - e : yabai -m space --focus next

# toggle window fullscreen zoom
alt - f : yabai -m window --toggle zoom-fullscreen
# toggle (tiling) window fullscreen zoom
# alt - f : yabai -m window --toggle zoom-fullscreen

# toggle window native fullscreen
alt + shift - f : yabai -m window --toggle native-fullscreen
alt - f : yabai -m window --toggle native-fullscreen

# toggle window split type
alt - z : yabai -m window --toggle split
# alt - z : yabai -m window --toggle split

# float / unfloat window and restore position
#alt - t : yabai -m window --toggle float && /tmp/yabai-restore/$(yabai -m query --windows --window | jq -re '.id').restore 2>/dev/null || true
alt - t : yabai -m window --toggle float && yabai -m window --grid 4:4:1:1:2:2
# alt - t : yabai -m window --toggle float && /tmp/yabai-restore/$(yabai -m query --windows --window | jq -re '.id').restore 2>/dev/null || true

# [SIP] toggle picture-in-picture
alt - p : yabai -m window --toggle pip

# change layout of desktop
#alt - space : yabai -m space --layout $(yabai -m query --spaces --space | jq -r 'if .type == "bsp" then "float" else "bsp" end')
# alt - space : yabai -m space --layout $(yabai -m query --spaces --space | jq -r 'if .type == "bsp" then "float" else "bsp" end')

# get window title, mapped to period, previously mapped to grave at 0x32 (`)
alt - 0x2F : yabai -m query --windows --window | jq .app | pbcopy

# text macro, mostly for Agenda (Markdown) -- WARNING release the alt key asap. Prepend "sleep 0.001 &&" for further buffer.
alt - 0x1B : osascript -e 'tell application "System Events" to keystroke "[] "'
# alt - 0x1B : osascript -e 'tell application "System Events" to keystroke "[] "'

# screenshot, -[c]lipboard -[i]nteractive -[v]ideo -[V]ideo <seconds> -[k]licks
# alt+shift-s is used for shottr
alt - s : screencapture -c -i
alt - v : screencapture -V 12 -k ~/Desktop/"$(date +'%F_%H%M%S').mov" &

# restart sketchybar
alt - r : brew services restart sketchybar

# restart yabai
alt - y : yabai --restart-service

# Apps
cmd + shift - space : open -na 'Warp'
alt - space : open -na 'Warp'
ctrl + alt - n : open -na 'Arc' --args --incognito
ctrl + alt - e : open -a 'Finder'
13 changes: 12 additions & 1 deletion .config/yabai/yabairc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,18 @@

# [SIP] automatically load scripting addition, must manually perform visudo step to change hash after every Yabai update (maybe OS update too?)
# https://github.com/koekeishiya/yabai/wiki/Installing-yabai-(latest-release)#configure-scripting-addition
# Also check if updating OS -> need to update yabai

###
# sudo visudo -f /private/etc/sudoers.d/yabai
# input the line below into the file you are editing.
# replace <yabai> with the path to the yabai binary (output of: which yabai).
# replace <user> with your username (output of: whoami).
# replace <hash> with the sha256 hash of the yabai binary (output of: shasum -a 256 $(which yabai)).
# this hash must be updated manually after running brew upgrade.
#
# <user> ALL=(root) NOPASSWD: sha256:<hash> <yabai> --load-sa
###

yabai -m signal --add event=dock_did_restart action="sudo yabai --load-sa"
sudo yabai --load-sa

Expand Down
Binary file added .config/yadm/dotfiles.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 5 additions & 1 deletion .config/yadm/mac-install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
- tty-clock
- jupyterlab
- mdcat
- git-lfs
state: latest
update_homebrew: yes

Expand Down Expand Up @@ -80,7 +81,6 @@
- microsoft-teams
- anaconda
- r
- rstudio
- google-drive
- openinterminal
- gpg-suite
Expand All @@ -90,6 +90,9 @@
- mysql
- mysqlworkbench
- pycharm
- chromedriver
- tableau
- ferdium
state: latest

- name: "Cargo: Install Rust Packages"
Expand All @@ -106,6 +109,7 @@
- 409183694 # Keynote
- 409203825 # Numbers
- 409201541 # Pages
- 1448648921 # Seashore
state: latest

# Mac Defaults
Expand Down
9 changes: 8 additions & 1 deletion .config/yadm/sysfiles/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,15 @@ return {
"ellisonleao/gruvbox.nvim",
name = "gruvbox",
config = function()
require("gruvbox").setup {}
require("gruvbox").setup({})
end,
},
{
"kylechui/nvim-surround",
tag = "main", -- Use for stability; omit to use `main` branch for the latest features
config = function()
require("nvim-surround").setup({})
end,
}
},
}
2 changes: 2 additions & 0 deletions .gitconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true
[core]
autocrlf = input
1 change: 1 addition & 0 deletions .ideavimrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
set clipboard+=unnamed
24 changes: 22 additions & 2 deletions .zshrc
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@ alias cdexr="cd ~/Repos/Personal/EditXR/"
alias cdrepos="cd ~/Repos/"
alias cdwork="cd ~/Repos/Work/"
alias cdschool="cd ~/Repos/School/"
alias cdmangas="cd ~/Mangas/"
alias cdpersonal="cd ~/Repos/Personal/"

# Python alias
alias nuke="pip freeze | cut -d "@" -f1 | xargs pip uninstall -y"
alias freeze="pip list --format=freeze > requirements.txt"

# SSH alias
alias sshpi="ssh pi@raspberrypi"
Expand All @@ -40,6 +44,22 @@ alias backmerge="currBranch=\$(git rev-parse --abbrev-ref HEAD) && git checkout
alias clean="git reset --hard && git clean -dfx"
alias upstream="currBranch=\$(git rev-parse --abbrev-ref HEAD) && git push --set-upstream origin \$currBranch"

# gen z alias
alias please="sudo"
alias based="cd ~/"
alias bet="git add"
alias fr="git commit"
alias yoink="git pull"
alias yeet="git push"
alias cap="-n"
alias nocap="-f"
alias yap="-v"
alias noyap="-q"
alias yikes="git clean -dfx"
alias bigyikes="git reset --hard HEAD"
alias smash="git merge"
alias ong="rm -rf"

# Custom functions
timezsh() {
shell=${1-$SHELL}
Expand All @@ -63,7 +83,7 @@ alias upstream="currBranch=\$(git rev-parse --abbrev-ref HEAD) && git push --set

rmManga() {
/Users/davay/.config/yadm/rmManga.exp | osascript -e 'tell application "System Events" to keystroke "5fZfFaqnVx" using {control down, shift down}'
}
} # TODO: wtf is this, check previous commits

# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
Expand Down
Binary file modified Library/Preferences/.GlobalPreferences.plist
Binary file not shown.
Binary file modified Library/Preferences/pbs.plist
Binary file not shown.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
# Description

A [yadm](https://yadm.io/) + [Ansible](https://docs.ansible.com/ansible/latest/user_guide/index.html#getting-started) instant setup for fresh OS installs
A [yadm](https://yadm.io/) + [Ansible](https://docs.ansible.com/ansible/latest/user_guide/index.html#getting-started) instant setup for fresh OS installs.

NOTE: Main branch is brand new -- Mac only for now. Old combined Linux + Mac setup is in archive branch. Yabai, skhd, and sketchybar are all preinstalled along with configs, but manual setup is required, instructions not here.

## Screenshot

![Worfklow Example](/.config/yadm/dotfiles.png)

## Installation

### 1. Install Brew
Expand Down

0 comments on commit 53c042e

Please sign in to comment.