mirror of
https://github.com/ivuorinen/dotfiles.git
synced 2026-02-11 13:52:13 +00:00
Compare commits
2 Commits
25.6.23
...
feat/skhd-
| Author | SHA1 | Date | |
|---|---|---|---|
| 6b26215197 | |||
| a72c8ff33a |
52
config/skhd/move.sh
Executable file
52
config/skhd/move.sh
Executable file
@@ -0,0 +1,52 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
direction="$1" # east | west
|
||||||
|
|
||||||
|
# Active window and display
|
||||||
|
window=$(yabai -m query --windows --window)
|
||||||
|
display=$(yabai -m query --displays --display)
|
||||||
|
|
||||||
|
win_x=$(echo "$window" | jq '.frame.x')
|
||||||
|
win_w=$(echo "$window" | jq '.frame.w')
|
||||||
|
disp_x=$(echo "$display" | jq '.frame.x')
|
||||||
|
disp_w=$(echo "$display" | jq '.frame.w')
|
||||||
|
|
||||||
|
# Edge detection buffer
|
||||||
|
padding=20
|
||||||
|
move_to_display=false
|
||||||
|
|
||||||
|
if [[ "$direction" == "east" ]]; then
|
||||||
|
[[ $((win_x + win_w)) -ge $((disp_x + disp_w - padding)) ]] && move_to_display=true
|
||||||
|
elif [[ "$direction" == "west" ]]; then
|
||||||
|
[[ $win_x -le $((disp_x + padding)) ]] && move_to_display=true
|
||||||
|
fi
|
||||||
|
|
||||||
|
if $move_to_display; then
|
||||||
|
# Find the target display based on the direction
|
||||||
|
if [[ "$direction" == "east" ]]; then
|
||||||
|
target_display=$(yabai -m query --displays | jq ".[] | select(.frame.x > $disp_x)" | jq -s '.[0].index')
|
||||||
|
else
|
||||||
|
target_display=$(yabai -m query --displays | jq ".[] | select(.frame.x < $disp_x)" | jq -s '.[-1].index')
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ -n "$target_display" && "$target_display" != "null" ]]; then
|
||||||
|
# Find current space on the target display
|
||||||
|
target_space=$(yabai -m query --spaces | jq ".[] | select(.display == $target_display) | .index" | head -n1)
|
||||||
|
|
||||||
|
# If no space found, create a new one
|
||||||
|
if [[ -z "$target_space" || "$target_space" == "null" ]]; then
|
||||||
|
yabai -m space --create
|
||||||
|
sleep 0.3
|
||||||
|
# Asign the new space to the target display
|
||||||
|
target_space=$(yabai -m query --spaces | jq ".[] | select(.display == $target_display) | .index" | head -n1)
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Move the window to the new space and focus it
|
||||||
|
yabai -m window --space "$target_space"
|
||||||
|
yabai -m space --focus "$target_space"
|
||||||
|
yabai -m display --focus "$target_display"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
yabai -m window --warp "$direction"
|
||||||
|
fi
|
||||||
|
|
||||||
@@ -80,10 +80,12 @@ ctrl + alt - h : yabai -m window --grid 1:2:0:0:1:1 # 1/2 left
|
|||||||
ctrl + alt - l : yabai -m window --grid 1:2:1:0:1:1 # 1/2 right
|
ctrl + alt - l : yabai -m window --grid 1:2:1:0:1:1 # 1/2 right
|
||||||
|
|
||||||
## swap windows
|
## swap windows
|
||||||
shift + alt - h : yabai -m window --swap west
|
#shift + alt - h : yabai -m window --swap west
|
||||||
shift + alt - j : yabai -m window --swap south
|
shift + alt - j : yabai -m window --swap south
|
||||||
shift + alt - k : yabai -m window --swap north
|
shift + alt - k : yabai -m window --swap north
|
||||||
shift + alt - l : yabai -m window --swap east
|
#shift + alt - l : yabai -m window --swap east
|
||||||
|
alt + shift - l : ~/.config/skhd/move.sh east
|
||||||
|
alt + shift - h : ~/.config/skhd/move.sh west
|
||||||
|
|
||||||
## resize windows
|
## resize windows
|
||||||
ctrl + alt - h : yabai -m window --resize left:-50:0; \
|
ctrl + alt - h : yabai -m window --resize left:-50:0; \
|
||||||
|
|||||||
@@ -16,6 +16,9 @@
|
|||||||
"version": "2"
|
"version": "2"
|
||||||
},
|
},
|
||||||
"languages": {
|
"languages": {
|
||||||
|
"PHP": {
|
||||||
|
"language_servers": ["intelephense", "phpactor"]
|
||||||
|
},
|
||||||
"Python": {
|
"Python": {
|
||||||
"enable_language_server": true,
|
"enable_language_server": true,
|
||||||
"allow_rewrap": "anywhere",
|
"allow_rewrap": "anywhere",
|
||||||
@@ -30,6 +33,13 @@
|
|||||||
"source.fixAll.eslint": true
|
"source.fixAll.eslint": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"Markdown": {
|
||||||
|
"enable_language_server": true,
|
||||||
|
"preferred_line_length": 160,
|
||||||
|
"prettier": {
|
||||||
|
"allowed": true
|
||||||
|
}
|
||||||
|
},
|
||||||
"Lua": {
|
"Lua": {
|
||||||
"enable_language_server": true,
|
"enable_language_server": true,
|
||||||
"tab_size": 2
|
"tab_size": 2
|
||||||
@@ -55,13 +65,32 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"diagnostics": {
|
||||||
|
"button": true,
|
||||||
|
"include_warnings": true,
|
||||||
|
"lsp_pull_diagnostics": {
|
||||||
|
"enabled": true,
|
||||||
|
"debounce_ms": 50
|
||||||
|
},
|
||||||
|
"inline": {
|
||||||
|
"enabled": true,
|
||||||
|
"update_debounce_ms": 150
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"multi_cursor_modifier": "cmd_or_ctrl", // alias: "cmd", "ctrl"
|
||||||
|
"indent_guides": {
|
||||||
|
"enabled": true,
|
||||||
|
"coloring": "indent_aware"
|
||||||
|
},
|
||||||
"preferred_line_length": 100,
|
"preferred_line_length": 100,
|
||||||
|
"soft_wrap": "bounded",
|
||||||
|
"wrap_guides": [100, 120, 160, 200],
|
||||||
"format_on_save": "on",
|
"format_on_save": "on",
|
||||||
"vim_mode": true,
|
"vim_mode": true,
|
||||||
"theme": {
|
"theme": {
|
||||||
"mode": "system",
|
"mode": "system",
|
||||||
"light": "Tokyo Night Light",
|
"light": "Tomorrow",
|
||||||
"dark": "Tokyo Night Storm"
|
"dark": "Tomorrow at Midnight"
|
||||||
},
|
},
|
||||||
"inlay_hints": {
|
"inlay_hints": {
|
||||||
"enabled": true,
|
"enabled": true,
|
||||||
@@ -72,8 +101,44 @@
|
|||||||
"ui_font_size": 16,
|
"ui_font_size": 16,
|
||||||
"buffer_font_size": 16,
|
"buffer_font_size": 16,
|
||||||
"buffer_font_fallbacks": ["JetBrainsMono Nerd Font"],
|
"buffer_font_fallbacks": ["JetBrainsMono Nerd Font"],
|
||||||
"edit_predictions": {
|
"use_autoclose": false,
|
||||||
"disabled_globs": [".env", ".env.*"]
|
"hour_format": "hour24",
|
||||||
},
|
"auto_install_extensions": {
|
||||||
"hour_format": "hour24"
|
"angular": true,
|
||||||
|
"ansible": true,
|
||||||
|
"basher": true,
|
||||||
|
"biome": true,
|
||||||
|
"blade": true,
|
||||||
|
"csharp": true,
|
||||||
|
"css-modules-kit": true,
|
||||||
|
"dockerfile": true,
|
||||||
|
"git-firefly": true,
|
||||||
|
"github-activity-summarizer": true,
|
||||||
|
"golangci-lint": true,
|
||||||
|
"gosum": true,
|
||||||
|
"go-snippets": true,
|
||||||
|
"html": true,
|
||||||
|
"ini": true,
|
||||||
|
"json": true,
|
||||||
|
"json5": true,
|
||||||
|
"just": true,
|
||||||
|
"just-ls": true,
|
||||||
|
"lua": true,
|
||||||
|
"make": true,
|
||||||
|
"php": true,
|
||||||
|
"python-snippets": true,
|
||||||
|
"python-requirements": true,
|
||||||
|
"ruff": true,
|
||||||
|
"scss": true,
|
||||||
|
"sieve": true,
|
||||||
|
"stylelint": true,
|
||||||
|
"sql": true,
|
||||||
|
"toml": true,
|
||||||
|
"vue": true,
|
||||||
|
"vue-snippets": true,
|
||||||
|
"wakatime": true,
|
||||||
|
"xcode-themes": true,
|
||||||
|
"yaml": true,
|
||||||
|
"tomorrow-theme": true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user