Skip to content

Commit

Permalink
mmmm
Browse files Browse the repository at this point in the history
  • Loading branch information
Glenn Wurr committed Aug 27, 2020
1 parent d6ae693 commit b897473
Show file tree
Hide file tree
Showing 11 changed files with 168 additions and 22 deletions.
23 changes: 14 additions & 9 deletions .skhdrc
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,16 @@
#
# an EOL character signifies the end of the bind.


cmd - return : osascript ~/bin/.osa/run_term.scpt
lshift + lcmd - return : osascript ~/bin/.osa/run_oterm.scpt
lshift + lcmd - f : osascript ~/bin/.osa/run_finder.scpt
# start term
lalt - return : osascript ~/bin/.osa/run_term.scpt
lalt + lshift - return : osascript ~/bin/.osa/run_oterm.scpt
# start finder
lalt + lshift - f : osascript ~/bin/.osa/run_finder.scpt
# close window
lalt + lshift - c : yabai -m window --close

# restart
shift + alt - r : brew services restart skhd
shift + alt - r : launchctl kickstart -k "gui/${UID}/homebrew.mxcl.yabai"

# focus window
lalt - h : yabai -m window --focus west
Expand Down Expand Up @@ -118,15 +121,17 @@ lalt - 8 : yabai -m space --focus 8
lalt - 9 : yabai -m space --focus 9

# focus monitor
lalt - 0x2B : yabai -m display --focus prev || yabai -m display --focus last
lalt - 0x2F : yabai -m display --focus next || yabai -m display --focus first
#lalt - 0x2B : yabai -m display --focus prev || yabai -m display --focus last
#lalt - 0x2F : yabai -m display --focus next || yabai -m display --focus first
lalt - 0x2B : yabai -m display --focus west
lalt - 0x2F : yabai -m display --focus east
lctrl + lalt - 3 : yabai -m display --focus 3
lctrl + lalt - 2 : yabai -m display --focus 2
lctrl + lalt - 1 : yabai -m display --focus 1

# send window to monitor
lalt + lshift - 0x2B : yabai -m window --display prev
lalt + lshift - 0x2F : yabai -m window --display next
lalt + lshift - 0x2B : yabai -m window --display west
lalt + lshift - 0x2F : yabai -m window --display east
lctrl + lalt + lshift - 1 : yabai -m window --display 1
lctrl + lalt + lshift - 2 : yabai -m window --display 2
lctrl + lalt + lshift - 3 : yabai -m window --display 3
Expand Down
50 changes: 38 additions & 12 deletions .yabairc
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,16 @@ yabai -m config mouse_follows_focus on
#yabai -m config focus_follows_mouse autoraise
yabai -m config focus_follows_mouse autofocus
yabai -m config window_placement second_child
# makes floating windows always on top:
yabai -m config window_topmost on
yabai -m config window_shadow on
yabai -m config window_opacity on
yabai -m config window_opacity_duration 0.0
yabai -m config window_opacity_duration 0.2
#yabai -m config active_window_opacity 1.0
yabai -m config active_window_opacity 0.96
yabai -m config active_window_opacity 0.98
yabai -m config normal_window_opacity 0.88
yabai -m config window_border on
yabai -m config window_border_width 10
yabai -m config window_border_width 8
yabai -m config active_window_border_color 0xff775759
yabai -m config normal_window_border_color 0xff555555
yabai -m config insert_feedback_color 0xffd75f5f
Expand All @@ -25,20 +26,43 @@ yabai -m config mouse_action2 resize

# general space settings
yabai -m config layout bsp
yabai -m config top_padding 12
yabai -m config bottom_padding 12
yabai -m config left_padding 12
yabai -m config right_padding 12
#yabai -m config window_gap 06
yabai -m config window_gap 12

# add padding for bar
yabai -m config top_padding 40
yabai -m config bottom_padding 40
yabai -m config left_padding 20
yabai -m config right_padding 20

yabai -m config window_gap 20

# add fixed padding for bar
yabai -m config external_bar all:20:20

# set space 1 to have no pad
yabai -m config --space 1 window_gap 0
yabai -m config --space 1 right_padding 0
yabai -m config --space 1 left_padding 0
yabai -m config --space 1 top_padding 0
yabai -m config --space 1 bottom_padding 0

# float and sticky system preferences
yabai -m rule --add app="^System Preferences$" manage=off
yabai -m rule --add app="^System Preferences$" manage=off layer=above
yabai -m rule --add app="^System Preferences$" sticky=on

yabai -m rule --add app="Finder" manage=off layer=above
yabai -m rule --add app="App Store" manage=off layer=above

yabai -m rule --add title='Opening$' manage=off layer=above
yabai -m rule --add title='Preferences$' manage=off layer=above

# pesky MS Teams notification window popups
#yabai -m rule --add title='^Microsoft Teams Notification$' manage=off layer=above sticky=on
yabai -m rule --add title='^Microsoft Teams Notification$' manage=off layer=below sticky=off border=off space=9

yabai -m rule --add app="GarageBand" sticky=off manage=off layer=below space=4

# focus last recent window in event of window or app getting closed:
yabai -m signal --add event=window_destroyed action="yabai -m query --windows --window &> /dev/null || yabai -m window --focus recent"
yabai -m signal --add event=application_terminated action="yabai -m query --windows --window &> /dev/null || yabai -m window --focus recent"

# show digital colour meter topmost and on all spaces
#yabai -m rule --add app="^Digital Colou?r Meter$" sticky=on

Expand All @@ -47,3 +71,5 @@ yabai -m signal --add event=space_changed \
action="$HOME/bin/mac_refresh_nibar"
yabai -m signal --add event=display_changed \
action="$HOME/bin/mac_refresh_nibar"

mac_restart_uber
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/sh

PATH=/usr/local/bin/:$PATH

# Check if yabai exists
if ! [ -x "$(command -v yabai)" ]; then
echo "{\"error\":\"yabai binary not found\"}"
exit 1
fi

SPACES_TERTIARY=$(yabai -m query --space3 --display 3)

echo $(cat <<-EOF
{
"spaces_tertiary": $SPACES_TERTIARY
}
EOF
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import Desktop from "./lib/Desktop.jsx";
import Error from "./lib/Error.jsx";
import parse from "./lib/parse.jsx";
import styles from "./lib/styles.jsx";

const style = {
padding: "0 8px",
display: "grid",
gridAutoFlow: "column",
gridGap: "16px",
position: "fixed",
overflow: "hidden",
left: "0px",
top: "0px",
fontFamily: styles.fontFamily,
lineHeight: styles.lineHeight,
fontSize: styles.fontSize,
color: styles.colors.dim,
fontWeight: styles.fontWeight
};

export const refreshFrequency = false;
export const command = "./nibar/scripts/spaces_tertiary.sh";

export const render = ({ output }) => {
const data = parse(output);
if (typeof data === "undefined") {
return (
<div style={style}>
<Error msg="Error: unknown script output" side="left" />
</div>
);
}
if (typeof data.error !== "undefined") {
return (
<div style={style}>
<Error msg={`Error: ${data.error}`} side="left" />
</div>
);
}
return (
<div style={style}>
<Desktop output={data.spaces_tertiary} />
</div>
);
};

export default null;
1 change: 1 addition & 0 deletions bin/awsproxy
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ssh -v -N -D 22223 awsgw
1 change: 1 addition & 0 deletions bin/ch_virt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
virt-manager -c 'qemu+ssh://mack/system?socket=/var/run/libvirt/libvirt-sock'
1 change: 1 addition & 0 deletions bin/mac_refresh_nibar
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
osascript -e 'tell application "Übersicht" to refresh widget id "nibar-spaces-primary-jsx"'
osascript -e 'tell application "Übersicht" to refresh widget id "nibar-spaces-secondary-jsx"'
osascript -e 'tell application "Übersicht" to refresh widget id "nibar-spaces-tertiary-jsx"'
16 changes: 16 additions & 0 deletions bin/mac_restart_uber
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

function _kill() {
pgrep Übersicht | xargs kill
}

function _run() {
( "/Applications/Übersicht.app/Contents/MacOS/Übersicht" 2>&1 | tee -a "${HOME}/.uber.log" ) &
}


_kill || true
_kill || true

_run &

6 changes: 5 additions & 1 deletion bin/mac_setup
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ sudo defaults write /Library/Preferences/com.apple.windowserver DisplayResolutio
defaults write com.apple.finder QuitMenuItem -bool true

# Finder: disable window animations and Get Info animations
#defaults write com.apple.finder DisableAllAnimations -bool true
defaults write com.apple.finder DisableAllAnimations -bool true

# Set Desktop as the default location for new Finder windows
# For other paths, use `PfLo` and `file:///full/path/here/`
Expand Down Expand Up @@ -742,3 +742,7 @@ for app in "Activity Monitor" \
killall "${app}" &> /dev/null
done
echo "Done. Note that some of these changes require a logout/restart to take effect."

# no desktop icons
defaults write com.apple.finder CreateDesktop false && \
killall Finder
9 changes: 9 additions & 0 deletions bin/mac_wall
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#! /bin/bash
#script to change all desktop backgrounds
if [ -z "$1" ]; then
echo "Please specify an absolute path to an image as first parameter"
exit -1
fi

osascript -e "tell application \"System Events\" to set picture of every desktop to \"$1\""
killall Dock
17 changes: 17 additions & 0 deletions bin/vipe
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash


TMPFILE=`mktemp -q -t tmp.vipe.XXXXXXXXX`
trap "rm -f ${TMPFILE}" EXIT

# read from stdin
if [ ! -t 0 ]; then
cat - > $TMPFILE
fi

# spawn editor with stdio connected
${EDITOR} "${TMPFILE}" < /dev/tty > /dev/tty || exit $?

# write to stdout
cat $TMPFILE && exit 0 || exit $?

0 comments on commit b897473

Please sign in to comment.