getRelativePosition () local curr_absolute_pos = hs. “Um, wouldn’t it be cool if I could make the big border around my screen disappear again”Īh yes, yes it would: function clearScreen() if micMuteStatusLine then micMuteStatusLine:delete() end end hs.hotkey.- 2022.03.23 - sng_hn.lee - mouse 움직이도록 설ㅏ function move_click_mouse () - local function func_move_mouse_hjkl ( key ) local step_x_size = 30. Let’s set our newly mapped Caps Lock key up as a variable as we’ll be using it a lot: hyper = end if micMuteStatusLine then micMuteStatusLine:delete() end max = hs.screen.primaryScreen():fullFrame() micMuteStatusLine = hs.drawing.rectangle(hs.geometry.rect(max.x, max.y, max.w, max.h)) micMuteStatusLine:setStrokeColor(micMuteStatusLineColor) micMuteStatusLine:setFillColor(micMuteStatusLineColor) micMuteStatusLine:setFill(false) micMuteStatusLine:setStrokeWidth(30) micMuteStatusLine:show() end for i,dev in ipairs(hs.audiodevice.allInputDevices()) do dev:watcherCallback(displayMicMuteStatus):watcherStart() end function toggleMicMuteStatus() local currentAudioInput = hs.audiodevice.current(true) local currentAudioInputObject = hs.audiodevice.findInputByUID(currentAudioInput.uid) currentAudioInputObject:setInputMuted(not muted) displayMicMuteStatus() end displayMicMuteStatus() hs.hotkey.bind(hyper, "m", toggleMicMuteStatus) micMuteStatusMenu:setClickCallback(toggleMicMuteStatus) function toggleMicMuteStatusAlert() if micMuteStatusAlert then micMuteStatusAlert = false micMuteStatusLine:delete() else micMuteStatusAlert = true displayMicMuteStatus() end end The file should open in your preferred text editor. Click its menu icon and select “Open Config”. Now we can starting setting up some stuff in Hammerspoon. Karabiner allows you to fiddle around with your keyboard mappings - I set Cap Lock to be the same as pressing Cmd-Ctrl-Shift-Alt. With Karabiner, I can actually make the Caps Lock key do something useful. You can still type capital letters without a caps lock key - I keep discovering, to my amazement, people that don’t know that you can hold down the shift key to type capital letters!!! As a long time hater of the Caps Lock key, once of the first things I do when I get a new Mac is disable it: As soon as I’d installed Hammerspoon, I also installed Karabiner Elements (Download from ). Oh, before we do, I should quickly mention Karabiner. There’s no tick boxes and options, it’s all written by you, so you can hook up all the functionality in any way you want. And loads more stuff.īut the best thing is, its config file is a script that you write yourself. It can display notifications, move windows, talk to other applications, add things to your menu bar, draw on the screen, watch for changes to your battery, carry out actions when you plug things into your computer. Like an actual hammer combined with an actual spoon, it does almost everything you could possibly want. I quick Google search failed to dig up any apps that do this. I thought it’d be nice, if rather than having to click on the wifi in the menu bar to check which network I was on, I could just glance at the menu bar where it could be displayed at all times. Frequently though, I’d discover that my wifi was dropping out, only to find that my laptop had connected to the sushi shop next door rather than my own work hotspot. Recently I started a job in a new office, where I like to work from the basement of the building.
0 Comments
Leave a Reply. |