make luarc json works
This commit is contained in:
parent
4c8ccec1ae
commit
0cf7e16710
8 changed files with 98 additions and 45 deletions
|
|
@ -2,20 +2,51 @@
|
|||
|
||||
# This script is used to change the top and bottom padding of the outer container in the Aerospace theme.
|
||||
|
||||
presentation_pixel_gaps=300
|
||||
top_normal_pixel_gaps=82
|
||||
bottom_normal_pixel_gaps=40
|
||||
terminal_font_size=18
|
||||
terminal_presentation_font_size=22
|
||||
CONFIG_FILE="$HOME/.config/aerospace/aerospace.toml"
|
||||
BACKUP_FILE="/tmp/aerospace_presentation_backup"
|
||||
|
||||
presentation_top_gaps=80
|
||||
presentation_bottom_gaps=80
|
||||
presentation_left_gaps=80
|
||||
presentation_right_gaps=80
|
||||
|
||||
if [ "$1" == "on" ]; then
|
||||
# Save original lines with line numbers
|
||||
grep -n 'outer\.top\|outer\.bottom\|outer\.left\|outer\.right' "$CONFIG_FILE" > "$BACKUP_FILE"
|
||||
|
||||
# Replace with presentation values
|
||||
sed -i'' -e "s/^\([[:space:]]*outer\.top[[:space:]]*=\).*/\1 ${presentation_top_gaps}/" "$CONFIG_FILE"
|
||||
sed -i'' -e "s/^\([[:space:]]*outer\.bottom[[:space:]]*=\).*/\1 ${presentation_bottom_gaps}/" "$CONFIG_FILE"
|
||||
sed -i'' -e "s/^\([[:space:]]*outer\.left[[:space:]]*=\).*/\1 ${presentation_left_gaps}/" "$CONFIG_FILE"
|
||||
sed -i'' -e "s/^\([[:space:]]*outer\.right[[:space:]]*=\).*/\1 ${presentation_right_gaps}/" "$CONFIG_FILE"
|
||||
|
||||
# Set dark wallpaper for presentation
|
||||
osascript -e 'tell application "System Events" to set picture of every desktop to "/Users/rayandrew/Pictures/Wallpapers/black-gray.jpg"' > /dev/null 2>&1
|
||||
|
||||
if [ $1 == "on" ]; then
|
||||
sed -i '' "s/\(outer\.top = *\[.*\), $top_normal_pixel_gaps]/\1, $presentation_pixel_gaps]/" ~/.config/aerospace/aerospace.toml
|
||||
sed -i '' "s/\(outer\.bottom = *\[.*\), $bottom_normal_pixel_gaps]/\1, $presentation_pixel_gaps]/" ~/.config/aerospace/aerospace.toml
|
||||
osascript -e 'tell application "System Events" to set picture of every desktop to "/Users/stefan.pinter/Pictures/Wallpapers/black-gray.jpg"'
|
||||
aerospace reload-config
|
||||
elif [ $1 == "off" ]; then
|
||||
sed -i '' "s/\(outer\.top = *\[.*\), $presentation_pixel_gaps]/\1, $top_normal_pixel_gaps]/" ~/.config/aerospace/aerospace.toml
|
||||
sed -i '' "s/\(outer\.bottom = *\[.*\), $presentation_pixel_gaps]/\1, $bottom_normal_pixel_gaps]/" ~/.config/aerospace/aerospace.toml
|
||||
osascript -e 'tell application "System Events" to set picture of every desktop to "/Users/rayandrew/Pictures/Wallpapers/bluering.png"'
|
||||
echo -n "Presentation mode ON"
|
||||
|
||||
elif [ "$1" == "off" ]; then
|
||||
if [ ! -f "$BACKUP_FILE" ]; then
|
||||
echo "Error: No backup found. Run 'presentation-mode on' first."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Restore original values line by line
|
||||
while IFS=: read -r line_num content; do
|
||||
# Escape special characters for sed
|
||||
escaped_content=$(printf '%s\n' "$content" | sed 's/[&/\]/\\&/g')
|
||||
sed -i'' -e "${line_num}s/.*/${escaped_content}/" "$CONFIG_FILE"
|
||||
done < "$BACKUP_FILE"
|
||||
|
||||
# Restore original wallpaper
|
||||
osascript -e 'tell application "System Events" to set picture of every desktop to "/Users/rayandrew/Pictures/Wallpapers/bluering.png"' > /dev/null 2>&1
|
||||
|
||||
rm "$BACKUP_FILE"
|
||||
aerospace reload-config
|
||||
echo "Presentation mode OFF"
|
||||
|
||||
else
|
||||
echo "Usage: presentation-mode [on|off]"
|
||||
exit 1
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -112,6 +112,20 @@ on-focus-changed = [
|
|||
alt-shift-k = ['join-with up', 'mode main']
|
||||
alt-shift-l = ['join-with right', 'mode main']
|
||||
|
||||
|
||||
p = [
|
||||
'exec-and-forget ~/dotfiles/bin/presentation-mode on',
|
||||
'exec-and-forget /run/current-system/sw/bin/sketchybar --bar height=0',
|
||||
'exec-and-forget /run/current-system/sw/bin/sketchybar --trigger hide_message',
|
||||
'mode main'
|
||||
]
|
||||
shift-p = [
|
||||
'exec-and-forget ~/dotfiles/bin/presentation-mode off',
|
||||
'exec-and-forget /run/current-system/sw/bin/sketchybar --bar height=30',
|
||||
'exec-and-forget /run/current-system/sw/bin/sketchybar --trigger hide_message',
|
||||
'mode main'
|
||||
]
|
||||
|
||||
[[on-window-detected]]
|
||||
if.app-id = 'com.apple.finder'
|
||||
run = ['layout floating']
|
||||
|
|
@ -122,7 +136,7 @@ on-focus-changed = [
|
|||
|
||||
[[on-window-detected]]
|
||||
if.app-id = 'com.1password.1password'
|
||||
run = ['layout floating']
|
||||
run = ['move-node-to-workspace 5']
|
||||
|
||||
[[on-window-detected]]
|
||||
if.app-id = 'com.spotify.client'
|
||||
|
|
|
|||
10
config/home/.hammerspoon/.luarc.json
Normal file
10
config/home/.hammerspoon/.luarc.json
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"$schema": "https://raw.githubusercontent.com/LuaLS/vscode-lua/master/setting/schema.json",
|
||||
"runtime.version": "Lua 5.4",
|
||||
"diagnostics.global": [
|
||||
"hs"
|
||||
],
|
||||
"workspace.library": [
|
||||
"/Applications/Hammerspoon.app/Contents/Resources"
|
||||
]
|
||||
}
|
||||
17
config/nvim/.luarc.json
Normal file
17
config/nvim/.luarc.json
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
{
|
||||
"runtime": {
|
||||
"version": "LuaJIT"
|
||||
},
|
||||
"diagnostics": {
|
||||
"globals": ["vim"]
|
||||
},
|
||||
"workspace": {
|
||||
"checkThirdParty": false
|
||||
},
|
||||
"completion": {
|
||||
"callSnippet": "Replace"
|
||||
},
|
||||
"telemetry": {
|
||||
"enable": false
|
||||
}
|
||||
}
|
||||
|
|
@ -420,37 +420,10 @@ later(function()
|
|||
}
|
||||
|
||||
-- Setup language servers using vim.lsp.config
|
||||
-- Lua
|
||||
local runtime_path = vim.split(package.path, ';')
|
||||
table.insert(runtime_path, 'lua/?.lua')
|
||||
table.insert(runtime_path, 'lua/?/init.lua')
|
||||
|
||||
-- Lua (settings in .luarc.json, library paths handled by lazydev)
|
||||
vim.lsp.config.lua_ls = {
|
||||
cmd = { 'lua-language-server' },
|
||||
root_markers = { '.luarc.json', '.luarc.jsonc', '.luacheckrc', '.stylua.toml', 'stylua.toml', 'selene.toml', 'selene.yml', '.git' },
|
||||
settings = {
|
||||
Lua = {
|
||||
runtime = {
|
||||
version = 'LuaJIT',
|
||||
path = runtime_path,
|
||||
},
|
||||
diagnostics = {
|
||||
globals = { 'vim' },
|
||||
},
|
||||
workspace = {
|
||||
library = {
|
||||
vim.env.VIMRUNTIME,
|
||||
'${3rd}/luv/library',
|
||||
vim.fn.stdpath 'data' .. '/site/pack/deps/start',
|
||||
},
|
||||
checkThirdParty = false,
|
||||
},
|
||||
completion = {
|
||||
callSnippet = 'Replace',
|
||||
},
|
||||
telemetry = { enable = false },
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
-- TypeScript/JavaScript
|
||||
|
|
|
|||
7
config/sketchybar/.luarc.json
Normal file
7
config/sketchybar/.luarc.json
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"$schema": "https://raw.githubusercontent.com/LuaLS/vscode-lua/master/setting/schema.json",
|
||||
"runtime.version": "Lua 5.4",
|
||||
"diagnostics.global": [
|
||||
"sbar"
|
||||
]
|
||||
}
|
||||
|
|
@ -12,7 +12,7 @@ local padding <const> = {
|
|||
local graphics <const> = {
|
||||
bar = {
|
||||
height = 30,
|
||||
offset = 8,
|
||||
offset = 5,
|
||||
},
|
||||
background = {
|
||||
height = 24,
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ local spaceConfigs <const> = {
|
|||
['2'] = { icon = '', name = '' },
|
||||
['3'] = { icon = '', name = '' },
|
||||
['4'] = { icon = '', name = '' },
|
||||
['5'] = { icon = '', name = '' },
|
||||
['5'] = { icon = '', name = 'Misc' },
|
||||
['6'] = { icon = '', name = '' },
|
||||
['7'] = { icon = '', name = 'Music' },
|
||||
['8'] = { icon = '', name = 'Mail' },
|
||||
|
|
@ -124,12 +124,13 @@ local function addWorkspaceItem(workspaceName)
|
|||
width = 0,
|
||||
padding_left = 0,
|
||||
string = name,
|
||||
y_offset = 1,
|
||||
},
|
||||
icon = {
|
||||
string = icon,
|
||||
font = iconFont,
|
||||
color = settings.colors.white,
|
||||
y_offset = useBold and 1 or 0,
|
||||
y_offset = 1,
|
||||
},
|
||||
background = {
|
||||
color = settings.colors.bg1,
|
||||
|
|
|
|||
Loading…
Reference in a new issue