make luarc json works

This commit is contained in:
Ray Andrew 2025-11-29 18:30:09 -06:00
parent 4c8ccec1ae
commit 0cf7e16710
Signed by: rayandrew
SSH key fingerprint: SHA256:XYrYrxF0Z3A72n8P/p6mqPRNQZT22F88XcLsG+kX4xw
8 changed files with 98 additions and 45 deletions

View file

@ -2,20 +2,51 @@
# This script is used to change the top and bottom padding of the outer container in the Aerospace theme. # This script is used to change the top and bottom padding of the outer container in the Aerospace theme.
presentation_pixel_gaps=300 CONFIG_FILE="$HOME/.config/aerospace/aerospace.toml"
top_normal_pixel_gaps=82 BACKUP_FILE="/tmp/aerospace_presentation_backup"
bottom_normal_pixel_gaps=40
terminal_font_size=18 presentation_top_gaps=80
terminal_presentation_font_size=22 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"'
aerospace reload-config aerospace reload-config
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 fi

View file

@ -112,6 +112,20 @@ on-focus-changed = [
alt-shift-k = ['join-with up', 'mode main'] alt-shift-k = ['join-with up', 'mode main']
alt-shift-l = ['join-with right', '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]] [[on-window-detected]]
if.app-id = 'com.apple.finder' if.app-id = 'com.apple.finder'
run = ['layout floating'] run = ['layout floating']
@ -122,7 +136,7 @@ on-focus-changed = [
[[on-window-detected]] [[on-window-detected]]
if.app-id = 'com.1password.1password' if.app-id = 'com.1password.1password'
run = ['layout floating'] run = ['move-node-to-workspace 5']
[[on-window-detected]] [[on-window-detected]]
if.app-id = 'com.spotify.client' if.app-id = 'com.spotify.client'

View 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
View file

@ -0,0 +1,17 @@
{
"runtime": {
"version": "LuaJIT"
},
"diagnostics": {
"globals": ["vim"]
},
"workspace": {
"checkThirdParty": false
},
"completion": {
"callSnippet": "Replace"
},
"telemetry": {
"enable": false
}
}

View file

@ -420,37 +420,10 @@ later(function()
} }
-- Setup language servers using vim.lsp.config -- Setup language servers using vim.lsp.config
-- Lua -- Lua (settings in .luarc.json, library paths handled by lazydev)
local runtime_path = vim.split(package.path, ';')
table.insert(runtime_path, 'lua/?.lua')
table.insert(runtime_path, 'lua/?/init.lua')
vim.lsp.config.lua_ls = { vim.lsp.config.lua_ls = {
cmd = { 'lua-language-server' }, cmd = { 'lua-language-server' },
root_markers = { '.luarc.json', '.luarc.jsonc', '.luacheckrc', '.stylua.toml', 'stylua.toml', 'selene.toml', 'selene.yml', '.git' }, 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 -- TypeScript/JavaScript

View 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"
]
}

View file

@ -12,7 +12,7 @@ local padding <const> = {
local graphics <const> = { local graphics <const> = {
bar = { bar = {
height = 30, height = 30,
offset = 8, offset = 5,
}, },
background = { background = {
height = 24, height = 24,

View file

@ -24,7 +24,7 @@ local spaceConfigs <const> = {
['2'] = { icon = '', name = '' }, ['2'] = { icon = '', name = '' },
['3'] = { icon = '', name = '' }, ['3'] = { icon = '', name = '' },
['4'] = { icon = '', name = '' }, ['4'] = { icon = '', name = '' },
['5'] = { icon = '', name = '' }, ['5'] = { icon = '󰌾', name = 'Misc' },
['6'] = { icon = '', name = '' }, ['6'] = { icon = '', name = '' },
['7'] = { icon = '󰎆', name = 'Music' }, ['7'] = { icon = '󰎆', name = 'Music' },
['8'] = { icon = '󰇮', name = 'Mail' }, ['8'] = { icon = '󰇮', name = 'Mail' },
@ -124,12 +124,13 @@ local function addWorkspaceItem(workspaceName)
width = 0, width = 0,
padding_left = 0, padding_left = 0,
string = name, string = name,
y_offset = 1,
}, },
icon = { icon = {
string = icon, string = icon,
font = iconFont, font = iconFont,
color = settings.colors.white, color = settings.colors.white,
y_offset = useBold and 1 or 0, y_offset = 1,
}, },
background = { background = {
color = settings.colors.bg1, color = settings.colors.bg1,