Compare commits

..

No commits in common. "196c9c767fee447bbe9fc362459fefc051a04ae4" and "2b18907902b816adb391a618b819175faa9ecd3d" have entirely different histories.

7 changed files with 147 additions and 359 deletions

View File

@ -1,6 +1,5 @@
wf=hs.window.filter wf=hs.window.filter
ffBrowser = "Firefox" browser = "Brave Browser"
chromiumBrowser = "Brave Browser"
-- browser = "Chromium" -- browser = "Chromium"
-- Open new / focus existing Finder window in current desktop space -- Open new / focus existing Finder window in current desktop space
@ -71,10 +70,10 @@ end)
-- Open new / focus existing browser window in current desktop space -- Open new / focus existing browser window in current desktop space
function focusOrOpenFirefox() hs.hotkey.bind({"cmd", "ctrl"}, "W", function()
-- assumes wf_browser is the name of a firefox-based browser -- wf_browser = wf.new(false):setAppFilter(browser, {currentSpace=true}):setScreens({hs.screen.mainScreen()})
wf_browser = wf.new(false):setAppFilter(ffBrowser, {currentSpace=true, visible=true}) wf_browser = wf.new(false):setAppFilter(browser, {currentSpace=true})
local wins = wf_browser:getWindows() local wins = wf_browser:getWindows()
local count = 0 local count = 0
@ -83,45 +82,16 @@ function focusOrOpenFirefox()
if (count > 0) if (count > 0)
then then
wf_browser:getWindows()[1]:focus() wf_browser:getWindows()[1]:focus()
print(count)
else
-- for firefox:
hs.osascript.applescript(string.format([[
tell application "System Events" to tell process "%s"
click menu item "New Window" of menu "File" of menu bar 1
set frontmost to true
end tell
]], ffBrowser))
end
end
function focusOrOpenChromium()
-- assumes wf_browser is the name of a chromium-based browser
wf_browser = wf.new(false):setAppFilter(chromiumBrowser, {currentSpace=true, visible=true})
local wins = wf_browser:getWindows()
local count = 0
for _ in pairs(wins) do count = count + 1 end
if (count > 0)
then
wf_browser:getWindows()[1]:focus()
print(count)
else else
hs.osascript.applescript(string.format([[ hs.osascript.applescript(string.format([[
tell application "%s" tell application "%s"
make new window make new window
activate activate
end tell end tell
]], chromiumBrowser)) ]], browser))
end end
end end)
hs.hotkey.bind({"cmd", "ctrl"}, "W", focusOrOpenChromium)
-- CHROMIUM-BASED BROWSERS ONLY: Open new tab to right of current browser -- CHROMIUM-BASED BROWSERS ONLY: Open new tab to right of current browser
@ -129,7 +99,7 @@ hs.hotkey.bind({"cmd", "option"}, "T", function()
local focusedAppName = hs.window.focusedWindow():application():title() local focusedAppName = hs.window.focusedWindow():application():title()
if focusedAppName == chromiumBrowser if focusedAppName == browser
then then
hs.osascript.applescript(string.format([[ hs.osascript.applescript(string.format([[
tell application "System Events" to tell process "%s" tell application "System Events" to tell process "%s"
@ -151,15 +121,18 @@ function openVsCode(app)
local count = 0 local count = 0
for _ in pairs(wins) do count = count + 1 end for _ in pairs(wins) do count = count + 1 end
if (count > 0) then if (count > 0)
then
wf_app:getWindows()[1]:focus() wf_app:getWindows()[1]:focus()
else else
hs.osascript.applescript(string.format([[ hs.osascript.applescript(string.format([[
tell application "System Events" to tell process "%s" tell application "System Events" to tell process "%s"
click menu item "New Window" of menu "File" of menu bar 1 click menu item "New Window" of menu "File" of menu bar 1
set frontmost to true set frontmost to true
end tell end tell
]], app)) ]], app))
end end
end end
@ -169,14 +142,13 @@ hs.hotkey.bind({"cmd", "ctrl"}, "E", function()
openVsCode("Code") openVsCode("Code")
end) end)
hs.hotkey.bind({"cmd", "ctrl"}, "V", function()
-- hs.hotkey.bind({"cmd", "ctrl"}, "V", function()
-- openVsCode("Code") -- openVsCode("Code")
-- openVsCode("VSCodium") -- openVsCode("VSCodium")
-- No neovide function because it doesn't support system events (yet) -- No neovide function because it doesn't support system events (yet)
-- hs.application.open("Neovide") hs.application.open("Neovide")
-- end) end)
@ -208,20 +180,14 @@ end)
-- APP-AGNOSTIC GLOBAL OPEN/FOCUS BINDINGS -- APP-AGNOSTIC GLOBAL OPEN/FOCUS BINDINGS
-- common apps -- hs.hotkey.bind({"cmd", "ctrl"}, "E", function() hs.application.open("Emacs") end)
-- hs.hotkey.bind({"cmd", "ctrl"}, "Z", function() hs.application.open("Todoist") end) hs.hotkey.bind({"cmd", "ctrl"}, "O", function() hs.application.open("Obsidian") end)
-- hs.hotkey.bind({"cmd", "ctrl"}, "R", function() hs.application.open("Obsidian") end) hs.hotkey.bind({"cmd", "ctrl"}, "R", function() hs.application.open("Obsidian") end)
hs.hotkey.bind({"cmd", "ctrl"}, "M", function() hs.application.open("Spotify") end) hs.hotkey.bind({"cmd", "ctrl"}, "A", function() hs.application.open("Apebrain") end)
hs.hotkey.bind({"cmd", "ctrl"}, "N", function() hs.application.open("Obsidian") end)
hs.hotkey.bind({"cmd", "ctrl"}, "C", function() hs.application.open("Numi") end)
hs.hotkey.bind({"cmd", "ctrl"}, "S", function() hs.application.open("Signal") end) hs.hotkey.bind({"cmd", "ctrl"}, "S", function() hs.application.open("Signal") end)
hs.hotkey.bind({"cmd", "ctrl"}, "G", function() hs.application.open("Google Calendar") end) hs.hotkey.bind({"cmd", "ctrl"}, "G", function() hs.application.open("Godot") end)
hs.hotkey.bind({"cmd", "ctrl"}, "Z", function() hs.application.open("Preview") end)
-- annoying apps (manually open only)
hs.hotkey.bind({"cmd", "ctrl"}, "K", function() switchToIfOpen("KiCad") end)
hs.hotkey.bind({"cmd", "ctrl"}, "C", function() switchToIfOpen("CLion") end)
hs.hotkey.bind({"cmd", "ctrl"}, "J", function() hs.application.open("IntelliJ IDEA CE") end)
hs.hotkey.bind({"cmd", "ctrl"}, "I", function() hs.application.open("Insomnia") end)
-- Clear clipboard -- Clear clipboard
@ -231,47 +197,6 @@ hs.hotkey.bind({"cmd", "shift", "ctrl"}, "C", function()
end) end)
--------------------------------------
-- DESKTOP SWITCHING (axed)
-- Retroactive note: it should be harder, not easier, to context-switch :P
--------------------------------------
-- function gotoDesktopNumber(desktop)
-- local deskstr = string.format("Desktop %d", desktop)
-- local index = 0
-- for item in hs.spaces.spacesForScreen("Main") do
-- if item == deskstr then
-- break
-- else
-- index = index + 1
-- end
-- end
-- print("INDEX ", index)
-- hs.spaces.gotoSpace(index)
-- end
--
-- hs.hotkey.bind({"cmd", "ctrl"}, "1", function() gotoDesktopNumber(1) end)
-- hs.hotkey.bind({"cmd", "ctrl"}, "2", function() gotoDesktopNumber(2) end)
-- hs.hotkey.bind({"cmd", "ctrl"}, "3", function() gotoDesktopNumber(3) end)
-- hs.hotkey.bind({"cmd", "ctrl"}, "4", function() gotoDesktopNumber(4) end)
--------------------------------------
-- SWITCH TO IF OPEN
-- Switches to application if there's an instance of it open
--------------------------------------
function switchToIfOpen(app)
wf_app = wf.new(false):setAppFilter(app, {currentSpace=true, visible=true})
local wins = wf_app:getWindows()
local count = 0
for _ in pairs(wins) do count = count + 1 end
if (count > 0) then
wf_app:getWindows()[1]:focus()
end
end
-------------------------------------- --------------------------------------
-- KEY COMBO TO APPLICATION -- KEY COMBO TO APPLICATION
-- Sends keystrokes but only if the specified application is focused -- Sends keystrokes but only if the specified application is focused

View File

@ -4,6 +4,16 @@
<dict> <dict>
<key>AlternateMouseScroll</key> <key>AlternateMouseScroll</key>
<true/> <true/>
<key>AppleAntiAliasingThreshold</key>
<integer>1</integer>
<key>ApplePressAndHoldEnabled</key>
<false/>
<key>AppleScrollAnimationEnabled</key>
<integer>0</integer>
<key>AppleSmoothFixedFontsSizeThreshold</key>
<integer>1</integer>
<key>AppleWindowTabbingMode</key>
<string>manual</string>
<key>Custom Color Presets</key> <key>Custom Color Presets</key>
<dict> <dict>
<key>Brogrammer</key> <key>Brogrammer</key>
@ -1107,7 +1117,7 @@
<key>Non-ASCII Anti Aliased</key> <key>Non-ASCII Anti Aliased</key>
<true/> <true/>
<key>Normal Font</key> <key>Normal Font</key>
<string>MesloLGS-NF-Regular 13</string> <string>CaskaydiaCoveNerdFontComplete- 13</string>
<key>Option Key Sends</key> <key>Option Key Sends</key>
<integer>0</integer> <integer>0</integer>
<key>Prompt Before Closing 2</key> <key>Prompt Before Closing 2</key>

View File

@ -1,20 +1,11 @@
-- INSTALL PACKER:
-- git clone --depth 1 https://github.com/wbthomason/packer.nvim\
-- ~/.local/share/nvim/site/pack/packer/start/packer.nvim
-- check for vscode nvim plugin -- check for vscode nvim plugin
-- (https://github.com/vscode-neovim/vscode-neovim) -- (https://github.com/vscode-neovim/vscode-neovim)
if vim.g.vscode then if not vim.g.vscode then
do return end
else
if vim.g.neovide then
vim.o.guifont = "CaskaydiaCove Nerd Font:h14"
vim.g.neovide_hide_mouse_when_typing = true
end
end
-- aliases -- aliases
local o = vim.o local o = vim.o
local c = vim.cmd local c = vim.cmd
local map = vim.api.nvim_set_keymap local map = vim.api.nvim_set_keymap
@ -25,7 +16,7 @@ o.termguicolors = true
o.mouse = 'a' o.mouse = 'a'
-- o.autoindent = true -- o.autoindent = true
o.smartindent = true -- replacing autoindent with this o.smartindent = true -- replacing autoindent with this
o.wrap = false o.wrap = true
o.nobinary = true o.nobinary = true
o.relativenumber = true o.relativenumber = true
o.tabstop = 4 o.tabstop = 4
@ -42,8 +33,7 @@ end
-- keybinds -- keybinds
-- file management -- file management
-- map('n', '<c-t>', ':CHADopen<cr>', {silent = true}) map('n', '<c-t>', ':CHADopen<cr>', {silent = true})
map('n', '<c-b>', ':NvimTreeToggle<cr>', {silent = true})
map('n', '<c-`>', ':ToggleTerm direction="float"<cr>', {silent = true}) map('n', '<c-`>', ':ToggleTerm direction="float"<cr>', {silent = true})
-- exit terminal requires <Cmd> prefix -- exit terminal requires <Cmd> prefix
@ -99,12 +89,7 @@ return require('packer').startup(function(use)
} }
end} end}
-- use {'ms-jpq/chadtree', branch = 'chad'} use {'ms-jpq/chadtree', branch = 'chad'}
use {"nvim-tree/nvim-tree.lua", config = function()
require("nvim-tree").setup()
end}
use {"nvim-tree/nvim-web-devicons"}
use 'nvim-lua/plenary.nvim' use 'nvim-lua/plenary.nvim'
use 'nvim-telescope/telescope.nvim' use 'nvim-telescope/telescope.nvim'
use {"akinsho/toggleterm.nvim", tag = '*', config = function() use {"akinsho/toggleterm.nvim", tag = '*', config = function()
@ -116,9 +101,6 @@ return require('packer').startup(function(use)
} }
end} end}
-- NOTE: requires Node.js >= 17
-- use {'github/copilot.vim', run = ':Copilot setup'}
end) end)
end

View File

@ -47,7 +47,7 @@
}, },
"footprintAlpha" : { "footprintAlpha" : {
"float" : 0.3 "float" : 0.30000001192092896
}, },
"footprintBorderWidth" : { "footprintBorderWidth" : {
"float" : 2 "float" : 2
@ -65,7 +65,7 @@
"float" : 0 "float" : 0
}, },
"hideMenubarIcon" : { "hideMenubarIcon" : {
"bool" : true "bool" : false
}, },
"ignoredSnapAreas" : { "ignoredSnapAreas" : {
"int" : 0 "int" : 0
@ -146,7 +146,7 @@
"bool" : false "bool" : false
}, },
"todo" : { "todo" : {
"int" : 2 "int" : 0
}, },
"todoApplication" : { "todoApplication" : {
@ -164,22 +164,14 @@
"int" : 0 "int" : 0
}, },
"windowSnapping" : { "windowSnapping" : {
"int" : 2 "int" : 1
} }
}, },
"shortcuts" : { "shortcuts" : {
"almostMaximize" : {
"keyCode" : 43,
"modifierFlags" : 1441792
},
"bottomHalf" : { "bottomHalf" : {
"keyCode" : 38, "keyCode" : 38,
"modifierFlags" : 1441792 "modifierFlags" : 1441792
}, },
"center" : {
"keyCode" : 25,
"modifierFlags" : 1441792
},
"centerThird" : { "centerThird" : {
"keyCode" : 3, "keyCode" : 3,
"modifierFlags" : 786432 "modifierFlags" : 786432
@ -192,10 +184,6 @@
"keyCode" : 14, "keyCode" : 14,
"modifierFlags" : 786432 "modifierFlags" : 786432
}, },
"larger" : {
"keyCode" : 24,
"modifierFlags" : 1441792
},
"lastThird" : { "lastThird" : {
"keyCode" : 5, "keyCode" : 5,
"modifierFlags" : 786432 "modifierFlags" : 786432
@ -212,10 +200,6 @@
"keyCode" : 46, "keyCode" : 46,
"modifierFlags" : 1441792 "modifierFlags" : 1441792
}, },
"maximizeHeight" : {
"keyCode" : 29,
"modifierFlags" : 1441792
},
"nextDisplay" : { "nextDisplay" : {
"keyCode" : 124, "keyCode" : 124,
"modifierFlags" : 1441792 "modifierFlags" : 1441792
@ -228,10 +212,6 @@
"keyCode" : 37, "keyCode" : 37,
"modifierFlags" : 1441792 "modifierFlags" : 1441792
}, },
"smaller" : {
"keyCode" : 27,
"modifierFlags" : 1441792
},
"topHalf" : { "topHalf" : {
"keyCode" : 40, "keyCode" : 40,
"modifierFlags" : 1441792 "modifierFlags" : 1441792

View File

@ -1,4 +1,5 @@
// Place your key bindings in this file to override the defaultsauto[] // Keybinds in here override the editor defaults
[ [
{ {
"key": "cmd+1", "key": "cmd+1",
@ -73,132 +74,11 @@
"command": "-workbench.action.openEditorAtIndex9" "command": "-workbench.action.openEditorAtIndex9"
}, },
{ {
"key": "alt+cmd+1", "key": "cmd",
"command": "workbench.action.focusFirstEditorGroup" "command": "workbench.action.openEditorAtIndex"
},
{
"key": "cmd+1",
"command": "-workbench.action.focusFirstEditorGroup"
},
{
"key": "alt+cmd+3",
"command": "workbench.action.focusThirdEditorGroup"
},
{
"key": "cmd+3",
"command": "-workbench.action.focusThirdEditorGroup"
},
{
"key": "alt+cmd+6",
"command": "workbench.action.focusSixthEditorGroup"
},
{
"key": "cmd+6",
"command": "-workbench.action.focusSixthEditorGroup"
},
{
"key": "alt+cmd+7",
"command": "workbench.action.focusSeventhEditorGroup"
},
{
"key": "cmd+7",
"command": "-workbench.action.focusSeventhEditorGroup"
},
{
"key": "alt+cmd+2",
"command": "workbench.action.focusSecondEditorGroup"
},
{
"key": "cmd+2",
"command": "-workbench.action.focusSecondEditorGroup"
},
{
"key": "alt+cmd+4",
"command": "workbench.action.focusFourthEditorGroup"
},
{
"key": "cmd+4",
"command": "-workbench.action.focusFourthEditorGroup"
},
{
"key": "alt+cmd+5",
"command": "workbench.action.focusFifthEditorGroup"
},
{
"key": "cmd+5",
"command": "-workbench.action.focusFifthEditorGroup"
},
{
"key": "alt+cmd+8",
"command": "workbench.action.focusEighthEditorGroup"
},
{
"key": "cmd+8",
"command": "-workbench.action.focusEighthEditorGroup"
},
{
"key": "alt+cmd+0",
"command": "workbench.action.focusLastEditorGroup"
},
{
"key": "cmd+h",
"command": "workbench.action.toggleAuxiliaryBar"
},
{
"key": "cmd+g",
"command": "git-graph.view"
}, },
{ {
"key": "cmd+m", "key": "cmd+m",
"command": "-markdown.extension.editing.toggleMath", "command": "editor.action.toggleMinimap"
"when": "editorTextFocus && !editorReadonly && editorLangId == 'markdown'" }
},
{
"key": "ctrl+shift+tab",
"command": "workbench.action.showPreviousWindowTab"
},
{
"key": "ctrl+tab",
"command": "workbench.action.showNextWindowTab"
},
{
"key": "ctrl+shift+tab",
"command": "-workbench.action.quickOpenLeastRecentlyUsedEditorInGroup",
"when": "!activeEditorGroupEmpty"
},
{
"key": "ctrl+shift+tab",
"command": "-workbench.action.quickOpenNavigatePreviousInEditorPicker",
"when": "inEditorsPicker && inQuickOpen"
},
{
"key": "ctrl+tab",
"command": "-workbench.action.quickOpenPreviousRecentlyUsedEditorInGroup",
"when": "!activeEditorGroupEmpty"
},
{
"key": "ctrl+tab",
"command": "-workbench.action.quickOpenNavigateNextInEditorPicker",
"when": "inEditorsPicker && inQuickOpen"
},
{
"key": "shift+cmd+z",
"command": "workbench.action.toggleZenMode"
},
{
"key": "ctrl+shift+1",
"command": "workbench.action.terminal.focusAtIndex1"
},
{
"key": "ctrl+shift+2",
"command": "workbench.action.terminal.focusAtIndex2"
},
{
"key": "ctrl+shift+3",
"command": "workbench.action.terminal.focusAtIndex3"
},
{
"key": "ctrl+shift+4",
"command": "workbench.action.terminal.focusAtIndex4"
},
] ]

View File

@ -1,8 +1,7 @@
#!/bin/bash #!/bin/bash
# PROJECT DIR PRUNING SCRIPT # PROJECT DIR PRUNING SCRIPT
# Lists projects in current directory with a clean git status,
# sorted in reverse by date modified
printf "%-40s%-20s%s\n" 'Clean git, oldest to newest' 'Date Modified' 'Size' printf "%-40s%-20s%s\n" 'Clean git, oldest to newest' 'Date Modified' 'Size'
printf "%-40s%-20s%s\n" '===========================' '=============' '====' printf "%-40s%-20s%s\n" '===========================' '=============' '===='

12
ssh/motd/thinkpad-motd Normal file
View File

@ -0,0 +1,12 @@
_____ _ _ _____ _ _ _ ________ ___ ______
|_ _| | | |_ _| \ | || | / /| ___ \/ _ \| _ \
| | | |_| | | | | \| || |/ / | |_/ / /_\ \ | | |
| | | _ | | | | . ` || \ | __/| _ | | | |
| | | | | |_| |_| |\ || |\ \| | | | | | |/ /
\_/ \_| |_/\___/\_| \_/\_| \_/\_| \_| |_/___/
===========================================================
WARNING: DO NOT RESTART. THIS MACHINE'S SSD IS ENCRYPTED.
===========================================================