diff --git a/bin/presentation-mode b/bin/presentation-mode index d9c0dd4..f7d6759 100755 --- a/bin/presentation-mode +++ b/bin/presentation-mode @@ -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 diff --git a/config/aerospace/aerospace.toml b/config/aerospace/aerospace.toml index 03118fd..20e491a 100644 --- a/config/aerospace/aerospace.toml +++ b/config/aerospace/aerospace.toml @@ -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' diff --git a/config/home/.hammerspoon/.luarc.json b/config/home/.hammerspoon/.luarc.json new file mode 100644 index 0000000..bb0fb02 --- /dev/null +++ b/config/home/.hammerspoon/.luarc.json @@ -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" + ] +} diff --git a/config/nvim/.luarc.json b/config/nvim/.luarc.json new file mode 100644 index 0000000..61e4ca9 --- /dev/null +++ b/config/nvim/.luarc.json @@ -0,0 +1,17 @@ +{ + "runtime": { + "version": "LuaJIT" + }, + "diagnostics": { + "globals": ["vim"] + }, + "workspace": { + "checkThirdParty": false + }, + "completion": { + "callSnippet": "Replace" + }, + "telemetry": { + "enable": false + } +} diff --git a/config/nvim/init.lua b/config/nvim/init.lua index 873b1a0..d976e3a 100644 --- a/config/nvim/init.lua +++ b/config/nvim/init.lua @@ -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 diff --git a/config/sketchybar/.luarc.json b/config/sketchybar/.luarc.json new file mode 100644 index 0000000..0d4f72d --- /dev/null +++ b/config/sketchybar/.luarc.json @@ -0,0 +1,7 @@ +{ + "$schema": "https://raw.githubusercontent.com/LuaLS/vscode-lua/master/setting/schema.json", + "runtime.version": "Lua 5.4", + "diagnostics.global": [ + "sbar" + ] +} diff --git a/config/sketchybar/config/dimens.lua b/config/sketchybar/config/dimens.lua index 8eb216b..b2cc457 100644 --- a/config/sketchybar/config/dimens.lua +++ b/config/sketchybar/config/dimens.lua @@ -12,7 +12,7 @@ local padding = { local graphics = { bar = { height = 30, - offset = 8, + offset = 5, }, background = { height = 24, diff --git a/config/sketchybar/items/spaces.lua b/config/sketchybar/items/spaces.lua index c7faa3b..3737a0e 100644 --- a/config/sketchybar/items/spaces.lua +++ b/config/sketchybar/items/spaces.lua @@ -24,7 +24,7 @@ local spaceConfigs = { ['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,