commit 01568f14134b6f90e6959442818dcb1bde15de59 Author: Adam Goldsmith Date: Tue Feb 19 10:13:32 2019 -0500 Initial Commit, working chunkwm setup diff --git a/.chunkwmrc b/.chunkwmrc new file mode 100755 index 0000000..9790366 --- /dev/null +++ b/.chunkwmrc @@ -0,0 +1,141 @@ +#!/bin/bash + +# +# NOTE: any 'chunkc' command that is run from this config file +# that is NOT 'chunkc core::<..>' or 'chunkc set ..' +# MUST be put in the background using & +# +# e.g: +# chunkc tiling::rule --owner Finder --name Copy --state float & +# + +# +# NOTE: specify the absolutepath of the file to use for logging. +# 'stdout' or 'stderr' can be used instead of an actual filepath. +# + +chunkc core::log_file stdout + +# +# NOTE: specify the desired level of logging. +# +# - none, debug, profile, warn, error +# + +chunkc core::log_level warn + +# +# NOTE: specify the absolutepath to the directory to use when loading a plugin. +# + +chunkc core::plugin_dir /usr/local/opt/chunkwm/share/chunkwm/plugins + +# +# NOTE: if enabled, chunkwm will monitor the specified plugin_dir +# and automatically reload any '.so' file that is changed. +# + +chunkc core::hotload 0 + +# +# NOTE: the following are config variables for the chunkwm-tiling plugin. +# + +chunkc set custom_bar_enabled 0 +chunkc set custom_bar_all_monitors 0 +chunkc set custom_bar_offset_top 22 +chunkc set custom_bar_offset_bottom 0 +chunkc set custom_bar_offset_left 0 +chunkc set custom_bar_offset_right 0 + +chunkc set global_desktop_mode bsp +chunkc set global_desktop_offset_top 0 +chunkc set global_desktop_offset_bottom 0 +chunkc set global_desktop_offset_left 0 +chunkc set global_desktop_offset_right 0 +chunkc set global_desktop_offset_gap 0 + +# +# NOTE: syntax for desktop-specific settings +# +# chunkc set 2_desktop_mode monocle +# chunkc set 5_desktop_mode float +# chunkc set 3_desktop_offset_top 190 +# chunkc set 3_desktop_offset_bottom 190 +# chunkc set 3_desktop_offset_left 190 +# chunkc set 3_desktop_offset_right 190 +# chunkc set 3_desktop_offset_gap 30 +# + +chunkc set desktop_padding_step_size 10.0 +chunkc set desktop_gap_step_size 5.0 + +chunkc set bsp_spawn_left 1 +chunkc set bsp_optimal_ratio 1.618 +chunkc set bsp_split_mode optimal +chunkc set bsp_split_ratio 0.5 + +chunkc set monitor_focus_cycle 1 +chunkc set window_focus_cycle monitor + +chunkc set mouse_follows_focus intrinsic +chunkc set window_float_next 0 +chunkc set window_region_locked 1 + +chunkc set mouse_move_window \"fn 1\" +chunkc set mouse_resize_window \"fn 2\" +chunkc set mouse_motion_interval 35 + +chunkc set preselect_border_color 0xffd75f5f +chunkc set preselect_border_width 5 +chunkc set preselect_border_radius 0 +chunkc set preselect_border_outline 0 + +# +# NOTE: these settings require chwm-sa. +# (https://github.com/koekeishiya/chwm-sa) +# + +chunkc set window_float_topmost 0 +chunkc set window_fade_inactive 0 +chunkc set window_fade_alpha 0.85 +chunkc set window_fade_duration 0.25 +chunkc set window_use_cgs_move 0 + +# +# NOTE: the following are config variables for the chunkwm-border plugin. +# +# NOTE: syntax for `focused_border_outline` setting +# 0 = false, inline border +# 1 = true, outline border +# + +chunkc set focused_border_color 0xff0f6288 +chunkc set focused_border_width 5 +chunkc set focused_border_radius 0 +chunkc set focused_border_outline 0 +chunkc set focused_border_skip_floating 0 +chunkc set focused_border_skip_monocle 0 + +# +# NOTE: the following are config variables for the chunkwm-ffm plugin. +# + +chunkc set ffm_bypass_modifier fn +chunkc set ffm_standby_on_float 1 + +# +# NOTE: specify plugins to load when chunkwm starts. +# + +chunkc core::load border.so +chunkc core::load tiling.so +#chunkc core::load ffm.so + +# +# NOTE: sample rules for the tiling plugin +# + +chunkc tiling::rule --owner Finder --name Copy --state float & +chunkc tiling::rule --owner \"App Store\" --state float & +chunkc tiling::rule --owner Emacs --except "^$|\*lsp-ui-doc-.*\*" --state tile & diff --git a/.config/karabiner/compile.py b/.config/karabiner/compile.py new file mode 100755 index 0000000..67ca187 --- /dev/null +++ b/.config/karabiner/compile.py @@ -0,0 +1,9 @@ +#!/usr/bin/env python3 + +import sys +import yaml +import json + +with open('karabiner.yaml') as in_f: + with open('karabiner.json', 'w') as out_f: + json.dump(yaml.load(in_f), out_f, indent=4) diff --git a/.config/karabiner/karabiner.yaml b/.config/karabiner/karabiner.yaml new file mode 100644 index 0000000..00babde --- /dev/null +++ b/.config/karabiner/karabiner.yaml @@ -0,0 +1,116 @@ +global: + check_for_updates_on_startup: false + show_in_menu_bar: true + show_profile_name_in_menu_bar: false + +profiles: + - name: Default profile + selected: true + simple_modifications: + - {from: {key_code: caps_lock}, to: {key_code: left_control}} + + complex_modifications: + parameters: + basic.simultaneous_threshold_milliseconds: 50 + basic.to_delayed_action_delay_milliseconds: 500 + basic.to_if_alone_timeout_milliseconds: 1000 + basic.to_if_held_down_threshold_milliseconds: 500 + + rules: + - description: Both shifts -> caps lock + manipulators: + - from: {key_code: left_shift, modifiers: {mandatory: [right_shift], optional: [caps_lock]}} + to: [{key_code: caps_lock}] + to_if_alone: [{key_code: left_shift}] + type: basic + - from: {key_code: right_shift, modifiers: {mandatory: [left_shift], optional: [caps_lock]}} + to: [{key_code: caps_lock}] + to_if_alone: [{key_code: right_shift}] + type: basic + + - description: No-Op command-q + manipulators: + - from: {key_code: q, modifiers: {mandatory: [command], optional: [caps_lock]}} + type: basic + + - description: command-shift-q -> command-alt-q + manipulators: + - from: {key_code: q, modifiers: {mandatory: [command, shift], optional: [caps_lock]}} + to: [{key_code: q, modifiers: [left_command, left_option]}] + type: basic + + - description: C-backspace -> M-backspace, except in Emacs, because Emacs is fine + manipulators: + - conditions: [{type: frontmost_application_unless, bundle_identifiers: [org.gnu.Emacs]}] + from: {key_code: delete_or_backspace, modifiers: {mandatory: [control], optional: [caps_lock]}} + to: [{key_code: delete_or_backspace, modifiers: [left_option]}] + type: basic + + - description: Alt-left in Firefox -> Ctrl-left + manipulators: + - <<: &match_firefox + conditions: [{type: frontmost_application_if, bundle_identifiers: [org.mozilla.firefox]}] + from: {key_code: left_arrow, modifiers: {mandatory: [option]}} + to: [{key_code: left_arrow, modifiers: [left_control]}] + type: basic + + - description: Alt-right in Firefox -> Ctrl-right + manipulators: + - <<: *match_firefox + from: {key_code: right_arrow, modifiers: {mandatory: [option]}} + to: [{key_code: right_arrow, modifiers: [left_control]}] + type: basic + + - description: stop fullscreen in firefox + manipulators: + - <<: *match_firefox + from: {key_code: f, modifiers: {mandatory: [left_control]}} + to: [{key_code: f, modifiers: [command]}] + type: basic + + - description: mission control mouse to top + manipulators: + - from: {key_code: f3, modifiers: {optional: [caps_lock]}} + to: + # wow this is dumb (moves mouse to top of screen) + - mouse_key: {y: -3000, speed_multiplier: 4 } + - mouse_key: {y: -3000, speed_multiplier: 4 } + - mouse_key: {y: -3000, speed_multiplier: 4 } + - mouse_key: {y: -3000, speed_multiplier: 4 } + - mouse_key: {y: -3000, speed_multiplier: 4 } + - mouse_key: {y: -3000, speed_multiplier: 4 } + - mouse_key: {y: -3000, speed_multiplier: 4 } + - mouse_key: {y: -3000, speed_multiplier: 4 } + # then brings up mission control, to show desktop previews + - key_code: mission_control + type: basic + + + fn_function_keys: + - {from: {key_code: f1}, to: {consumer_key_code: display_brightness_decrement}} + - {from: {key_code: f2}, to: {consumer_key_code: display_brightness_increment}} + - {from: {key_code: f3}, to: {key_code: mission_control}} + - {from: {key_code: f4}, to: {key_code: launchpad}} + - {from: {key_code: f5}, to: {key_code: illumination_decrement}} + - {from: {key_code: f6}, to: {key_code: illumination_increment}} + - {from: {key_code: f7}, to: {consumer_key_code: rewind}} + - {from: {key_code: f8}, to: {consumer_key_code: play_or_pause}} + - {from: {key_code: f9}, to: {consumer_key_code: fastforward}} + - {from: {key_code: f10}, to: {consumer_key_code: mute}} + - {from: {key_code: f11}, to: {consumer_key_code: volume_decrement}} + - {from: {key_code: f12}, to: {consumer_key_code: volume_increment}} + + devices: + - identifiers: + is_keyboard: true + is_pointing_device: false + product_id: 610 + vendor_id: 1452 + disable_built_in_keyboard_if_exists: false + ignore: false + manipulate_caps_lock_led: true + fn_function_keys: [] + simple_modifications: [] + + virtual_hid_keyboard: + country_code: 0 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..bd82611 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/.config/karabiner/karabiner.json diff --git a/.skhdrc b/.skhdrc new file mode 100644 index 0000000..f841b02 --- /dev/null +++ b/.skhdrc @@ -0,0 +1,138 @@ +# -*- mode: conf-colon; -*- + +cmd - return : osascript -e $'tell application "iTerm2"\n tell current window\n create window with default profile\n end tell\nend tell' || open /Applications/iTerm.app # open terminal +cmd - e : emacsclient -cn # open Emacs +cmd + shift - e: exec emacsclient -ce '(nm)' # open Emacs with Nevermore +cmd + alt - f: osascript -e $'tell application "System Events" to tell process "Firefox"\n click menu item "New Window" of menu "File" of menu bar 1\n end tell' || open /Applications/Firefox.app # open firefox + +# close focused window +# note: with carabiner this is also 'cmd + shift - q' +cmd + alt - q : chunkc tiling::window --close + +# Lock/turn off screen +# requires system setting "require password immediately after sleep or screen saver begins" +ctrl + cmd - l : pmset displaysleepnow +ctrl + alt - l : pmset displaysleepnow + +# focus window +cmd - h : chunkc tiling::window --focus west +cmd - j : chunkc tiling::window --focus south +cmd - k : chunkc tiling::window --focus north +cmd - l : chunkc tiling::window --focus east + +# cmd - j : chunkc tiling::window --focus prev +# cmd - k : chunkc tiling::window --focus next + +# equalize size of windows +shift + cmd - 0 : chunkc tiling::desktop --equalize + +# swap window +shift + alt + cmd - h : chunkc tiling::window --swap west +shift + alt + cmd - j : chunkc tiling::window --swap south +shift + alt + cmd - k : chunkc tiling::window --swap north +shift + alt + cmd - l : chunkc tiling::window --swap east + +# move window +shift + cmd - h : chunkc tiling::window --warp west +shift + cmd - j : chunkc tiling::window --warp south +shift + cmd - k : chunkc tiling::window --warp north +shift + cmd - l : chunkc tiling::window --warp east + +# create desktop, move window and follow focus +shift + cmd - n : chunkc tiling::desktop --create;\ + id=$(chunkc tiling::query --desktops-for-monitor $(chunkc tiling::query --monitor-for-desktop $(chunkc tiling::query --desktop id)));\ + chunkc tiling::window --send-to-desktop $(echo ${id##* });\ + chunkc tiling::desktop --focus $(echo ${id##* }) + +# create desktop and follow focus +cmd + alt - n : chunkc tiling::desktop --create;\ + id=$(chunkc tiling::query --desktops-for-monitor $(chunkc tiling::query --monitor-for-desktop $(chunkc tiling::query --desktop id)));\ + chunkc tiling::desktop --focus $(echo ${id##* }) +# destroy desktop +cmd + alt - w : chunkc tiling::desktop --annihilate + +# fast focus desktop +cmd - tab : chunkc tiling::desktop --focus $(chunkc get _last_active_desktop) +cmd + alt - z : chunkc tiling::desktop --focus prev +cmd + alt - c : chunkc tiling::desktop --focus next +cmd - 1 : i=1; chunkc tiling::desktop --focus $(( $(chunkc tiling::query --desktop id) == $i ? $(chunkc get _last_active_desktop) : $i )) +cmd - 2 : i=2; chunkc tiling::desktop --focus $(( $(chunkc tiling::query --desktop id) == $i ? $(chunkc get _last_active_desktop) : $i )) +cmd - 3 : i=3; chunkc tiling::desktop --focus $(( $(chunkc tiling::query --desktop id) == $i ? $(chunkc get _last_active_desktop) : $i )) +cmd - 4 : i=4; chunkc tiling::desktop --focus $(( $(chunkc tiling::query --desktop id) == $i ? $(chunkc get _last_active_desktop) : $i )) +cmd - 5 : i=5; chunkc tiling::desktop --focus $(( $(chunkc tiling::query --desktop id) == $i ? $(chunkc get _last_active_desktop) : $i )) +cmd - 6 : i=6; chunkc tiling::desktop --focus $(( $(chunkc tiling::query --desktop id) == $i ? $(chunkc get _last_active_desktop) : $i )) +cmd - 7 : i=7; chunkc tiling::desktop --focus $(( $(chunkc tiling::query --desktop id) == $i ? $(chunkc get _last_active_desktop) : $i )) +cmd - 8 : i=8; chunkc tiling::desktop --focus $(( $(chunkc tiling::query --desktop id) == $i ? $(chunkc get _last_active_desktop) : $i )) +cmd - 9 : i=9; chunkc tiling::desktop --focus $(( $(chunkc tiling::query --desktop id) == $i ? $(chunkc get _last_active_desktop) : $i )) +cmd - 0 : i=10; chunkc tiling::desktop --focus $(( $(chunkc tiling::query --desktop id) == $i ? $(chunkc get _last_active_desktop) : $i )) + +# send window to desktop +shift + cmd - tab : chunkc tiling::window --send-to-desktop $(chunkc get _last_active_desktop) +shift + cmd - z : chunkc tiling::window --send-to-desktop prev +shift + cmd - c : chunkc tiling::window --send-to-desktop next +shift + cmd - 1 : chunkc tiling::window --send-to-desktop 1 +shift + cmd - 2 : chunkc tiling::window --send-to-desktop 2 +shift + cmd - 3 : chunkc tiling::window --send-to-desktop 3 +shift + cmd - 4 : chunkc tiling::window --send-to-desktop 4 +shift + cmd - 5 : chunkc tiling::window --send-to-desktop 5 +shift + cmd - 6 : chunkc tiling::window --send-to-desktop 6 +shift + cmd - 7 : chunkc tiling::window --send-to-desktop 7 +shift + cmd - 8 : chunkc tiling::window --send-to-desktop 8 +shift + cmd - 9 : chunkc tiling::window --send-to-desktop 9 +shift + cmd - 0 : chunkc tiling::window --send-to-desktop 10 + +# increase region size +shift + alt - a : chunkc tiling::window --use-temporary-ratio 0.1 --adjust-window-edge west +shift + alt - s : chunkc tiling::window --use-temporary-ratio 0.1 --adjust-window-edge south +shift + alt - w : chunkc tiling::window --use-temporary-ratio 0.1 --adjust-window-edge north +shift + alt - d : chunkc tiling::window --use-temporary-ratio 0.1 --adjust-window-edge east + +# decrease region size +shift + cmd - a : chunkc tiling::window --use-temporary-ratio -0.1 --adjust-window-edge west +shift + cmd - s : chunkc tiling::window --use-temporary-ratio -0.1 --adjust-window-edge south +shift + cmd - w : chunkc tiling::window --use-temporary-ratio -0.1 --adjust-window-edge north +shift + cmd - d : chunkc tiling::window --use-temporary-ratio -0.1 --adjust-window-edge east + +# set insertion point for focused container +# ctrl + alt - f : chunkc tiling::window --use-insertion-point cancel +# ctrl + alt - h : chunkc tiling::window --use-insertion-point west +# ctrl + alt - j : chunkc tiling::window --use-insertion-point south +# ctrl + alt - k : chunkc tiling::window --use-insertion-point north +# ctrl + alt - l : chunkc tiling::window --use-insertion-point east + +# rotate tree +cmd + alt - r : chunkc tiling::desktop --rotate 90 + +# mirror tree y-axis +cmd + alt - y : chunkc tiling::desktop --mirror vertical + +# mirror tree x-axis +cmd + alt - x : chunkc tiling::desktop --mirror horizontal + +# toggle window fullscreen +cmd + alt - f : chunkc tiling::window --toggle fullscreen + +# toggle window native fullscreen +cmd + alt + shift - f : chunkc tiling::window --toggle native-fullscreen + +# toggle window parent zoom +# alt - d : chunkc tiling::window --toggle parent + +# toggle window split type +cmd + alt - e : chunkc tiling::window --toggle split + +# toggle window fade +# alt - q : chunkc tiling::window --toggle fade + +# toggle sticky +# alt - s : chunkc tiling::window --toggle sticky + +# float window +cmd + shift - space : chunkc tiling::window --toggle float + +# change layout of desktop +cmd + alt - a : chunkc tiling::desktop --layout bsp +cmd + alt - s : chunkc tiling::desktop --layout monocle +cmd + alt - d : chunkc tiling::desktop --layout float + +cmd + alt - w : chunkc tiling::desktop --deserialize ~/.chunkwm_layouts/dev_1 diff --git a/POSTSTOW b/POSTSTOW new file mode 100755 index 0000000..472f3a6 --- /dev/null +++ b/POSTSTOW @@ -0,0 +1,5 @@ +#!/bin/bash + +echo "building karabiner yaml => json" +cd ~/.config/karabiner/ +./compile.py